{"remainingRequest":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/BaseicInformation/BaseicInformation.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/BaseicInformation/BaseicInformation.vue","mtime":1701674859498},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js","mtime":1701674874357},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js","mtime":1701674874903}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { newApplication, updateApplication, getApplications, oveorview } from \"@/service/CommonApi.js\";\nimport DataSourceList from \"@/components/AdvancedTool/DataSourceList.vue\";\nimport { nameCheck } from \"@/utils/utils.js\";\n\nexport default {\n name: \"baseicinformation\",\n components:{\n DataSourceList\n },\n data(){\n \n return{\n params: {\n id: \"\",\n name: \"\",\n description: \"\",\n type: \"\",\n activated: true,\n orderNo: 0,\n datasourceId: \"\",\n datasourceName: \"\"\n },\n rules: {\n name: [\n { required: true, message: this.$t('placeholder.software_name'), trigger: 'blur' },\n { validator: nameCheck, trigger: \"blur\" },\n ],\n description: [\n { required: true, message: this.$t('placeholder.description'), trigger: 'blur' }\n ]\n },\n outerVisible: false,\n data: {},\n datasourceType:'dialog',\n\n }\n },\n\n mounted(){\n //判断是否是新建,edit:true为编辑\n if(this.$route.query.edit && this.$route.query.edit!='false'){\n let appId = sessionStorage.getItem(\"appId\");\n let params = {\n ...this.params,\n id: appId,\n }\n this.params = params;\n this.getApplications()\n }else{\n let urlObj = JSON.parse(this.$route.query.params)\n let type = urlObj.type;\n let params = {\n ...this.params,\n type: Number(type),\n }\n this.params = params;\n }\n },\n\n methods:{\n //关闭数据源弹窗\n closeDatasource(){\n this.outerVisible=false;\n },\n // 清除选中的数据源\n cleanDatasource(){\n this.params.datasourceName = \"\"\n this.params.datasourceId = \"\"\n this.outerVisible=false;\n },\n /**\n * 获取软件详细-基本信息\n */\n getApplications(){\n getApplications(this.params, {\n onSucess: response => {\n if (response.data.errcode == 0) {\n let data = response.data.data;\n let params = {\n ...this.params,\n id: data.id,\n name: data.name,\n description: data.description,\n type: data.type,\n activated: data.activated,\n orderNo: data.orderNo,\n datasourceId: data.datasourceId,\n datasourceName: data.datasourceName\n }\n this.params = params;\n // 将数据来源id放到vuex中用作表单判断\n this.$store.commit('setDataSourceId', data.datasourceId)\n }\n }\n });\n },\n\n /**\n * 返回\n */\n goBack(){\n this.$router.push({path: '/home/softwarelist'});\n },\n\n /**\n * 生成概览\n */\n oveorview(){\n let params = this.params;\n if(!params.datasourceId){\n this.$message.error(this.$t('placeholder.save_soft_setdbsource'))\n return false\n }\n oveorview(params.id, {\n onSucess: response => {\n let filename='';\n // let type = response.headers[\"content-type\"];\n if(response.headers['content-disposition']){\n filename=decodeURIComponent(\n response.headers['content-disposition'].split(\"=\")[response.headers['content-disposition'].split(\"=\").length-1].replace(/\"/g,\"\")\n );\n }else{\n filename=this.$('placeholder.download');\n }\n const blob = response.data;\n const href = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = href;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n \n }\n });\n },\n\n /**\n * 保存软件\n */\n btnSave(params){\n if(this.params.id != \"\"){\n this.$refs[params].validate((valid) => {\n if (valid) {\n updateApplication(this.params, {\n onSucess: response => {\n if (response.data.errcode == 0) {\n this.$message({\n message: this.$t('msg.ss'),\n type: 'success'\n });\n // 将数据来源id放到vuex中用作表单判断\n this.$store.commit('setDataSourceId', this.params.datasourceId)\n }\n }\n });\n } else {\n return false;\n }\n });\n }else{\n this.$refs[params].validate(async (valid) => {\n if (valid) {\n const response = await newApplication(this.params);\n if (response.data.errcode == 0) {\n let params = {\n ...this.params,\n id: response.data.data.id\n };\n this.params = params;\n this.$message.success(this.$t('msg.ss'));\n // 将数据来源id放到vuex中用作表单判断\n this.$store.commit('setDataSourceId', this.params.datasourceId)\n }\n } else {\n return false;\n }\n });\n }\n },\n\n /**\n * 打开数据源列表对话框\n */\n openDataSourceDialog(){\n let params = this.params;\n if(params.id == \"\"){\n this.$message({\n message: this.$t('placeholder.save_software'),\n type: 'info'\n });\n }else{\n this.outerVisible = true;\n }\n },\n /**\n * 选中数据源回显\n */\n onRowClick(row){\n let params = {\n ...this.params,\n datasourceId: row.id,\n datasourceName: row.name\n }\n this.params = params;\n this.outerVisible = false;\n },\n\n }\n}\n",null]}