1 line
6.2 KiB
JSON
1 line
6.2 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/web.url-search-params.delete.js\";\nimport \"core-js/modules/web.url-search-params.has.js\";\nimport \"core-js/modules/web.url-search-params.size.js\";\nimport { ZeroCodeAxios } from \"@/request/request.js\";\nconst components = {};\nconst props = [\"above_page_data\"];\nconst data = function () {\n return {\n form: {\n name: \"\",\n host: \"\",\n port: \"\",\n user: \"\",\n password: \"\"\n },\n loading: false,\n options: \"\",\n activeName: \"\"\n };\n};\nfunction mounted() {}\nconst methods = {\n export_project() {\n this.loading = true;\n ZeroCodeAxios({\n url: \":10098/ApiClass/base_api_control/api_url/\",\n method: \"POST\",\n responseType: 'blob',\n // 设置为 blob\n data: {\n \"submit_data\": {\n \"data\": {\n project_sign: this.above_page_data.sign,\n project_out_path: this.form.path,\n ip: this.form.ip,\n db_name: this.form.db_name,\n user: this.form.user,\n pwd: this.form.pwd\n }\n }\n }\n }).then(res => {\n this.loading = false;\n const url = window.URL.createObjectURL(new Blob([res.data], {\n 'type': 'application/zip'\n }));\n const a = document.createElement('a');\n a.style.display = 'none';\n a.href = url;\n a.download = 'output.zip'; // 你可以根据需要更改下载文件的名称\n document.body.appendChild(a);\n a.click();\n window.URL.revokeObjectURL(url);\n document.body.removeChild(a);\n }).catch(error => {\n this.loading = false;\n });\n }\n};\nexport default {\n data: data,\n methods: methods,\n mounted: mounted,\n components: components,\n props: props\n};","map":{"version":3,"names":["ZeroCodeAxios","components","props","data","form","name","host","port","user","password","loading","options","activeName","mounted","methods","export_project","url","method","responseType","project_sign","above_page_data","sign","project_out_path","path","ip","db_name","pwd","then","res","window","URL","createObjectURL","Blob","a","document","createElement","style","display","href","download","body","appendChild","click","revokeObjectURL","removeChild","catch","error"],"sources":["/Users/xubincheng/Desktop/job/zero_code_all/zero_project/ZeroCodeProject/main/client/src/components/App_creator/app_creator_components/export_project/export_project.js"],"sourcesContent":["import {ZeroCodeAxios} from \"@/request/request.js\"\r\n\r\nconst components = {}\r\n\r\nconst props = [\"above_page_data\"]\r\n\r\nconst data = function () {\r\n return {\r\n form: {\r\n name: \"\",\r\n host: \"\",\r\n port: \"\",\r\n user: \"\",\r\n password: \"\"\r\n },\r\n loading: false,\r\n options: \"\",\r\n activeName: \"\",\r\n }\r\n}\r\n\r\nfunction mounted() {\r\n\r\n}\r\n\r\nconst methods = {\r\n export_project() {\r\n this.loading = true\r\n ZeroCodeAxios({\r\n url: \":10098/ApiClass/base_api_control/api_url/\",\r\n method: \"POST\",\r\n responseType: 'blob', // 设置为 blob\r\n data: {\r\n \"submit_data\": {\r\n \"data\": {\r\n project_sign: this.above_page_data.sign,\r\n project_out_path: this.form.path,\r\n ip: this.form.ip,\r\n db_name: this.form.db_name,\r\n user: this.form.user,\r\n pwd: this.form.pwd,\r\n }\r\n }\r\n }\r\n }).then(res => {\r\n this.loading = false\r\n const url = window.URL.createObjectURL(new Blob([res.data], {'type': 'application/zip'}));\r\n const a = document.createElement('a');\r\n a.style.display = 'none';\r\n a.href = url;\r\n a.download = 'output.zip'; // 你可以根据需要更改下载文件的名称\r\n document.body.appendChild(a);\r\n a.click();\r\n window.URL.revokeObjectURL(url);\r\n document.body.removeChild(a);\r\n }).catch(error => {\r\n this.loading = false\r\n })\r\n }\r\n}\r\n\r\nexport default {\r\n data: data,\r\n methods: methods,\r\n mounted: mounted,\r\n components: components,\r\n props: props\r\n}"],"mappings":";;;AAAA,SAAQA,aAAa,QAAO,sBAAsB;AAElD,MAAMC,UAAU,GAAG,CAAC,CAAC;AAErB,MAAMC,KAAK,GAAG,CAAC,iBAAiB,CAAC;AAEjC,MAAMC,IAAI,GAAG,SAAAA,CAAA,EAAY;EACrB,OAAO;IACHC,IAAI,EAAE;MACFC,IAAI,EAAE,EAAE;MACRC,IAAI,EAAE,EAAE;MACRC,IAAI,EAAE,EAAE;MACRC,IAAI,EAAE,EAAE;MACRC,QAAQ,EAAE;IACd,CAAC;IACDC,OAAO,EAAE,KAAK;IACdC,OAAO,EAAE,E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