{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\infoManagement\\components\\taskForm-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\infoManagement\\components\\taskForm-dialog.vue","mtime":1684458239215},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"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//\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//\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\r\nimport req from '@/request.js'\r\nimport collocation from '@/api/collocation.js'\r\nexport default {\r\n name: 'FormDialog',\r\n props: {\r\n showFormDia: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: ''\r\n },\r\n pId: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n data() {\r\n return {\r\n params: {\r\n taskName: '', //任务名称\r\n taskType: undefined, //任务类别\r\n taskClass: '', //任务执行类\r\n taskRate: null, //任务调用频率\r\n taskRateUnit: 'm', //任务调用频率单位(m:分钟,h:小时,d:天,w:周,M:月,Y:年)\r\n sourceCode: '', //数据源\r\n sourceTable: '', //源表名\r\n taskMemo: '', //任务说明\r\n id: null,\r\n taskStatus: ''\r\n },\r\n dataSources: [], //数据源列表\r\n sourceTables: [], //源表名列表\r\n show: true,\r\n tooltip: '',\r\n taskTypes: [\r\n {value: 1, label: '定时任务'},\r\n {value: 2, label: '非定时任务'}\r\n ], //任务类别列表\r\n taskRateUnits: [\r\n {value: 0, label: 'm'},\r\n {value: 1, label: 'h'},\r\n {value: 2, label: 'd'},\r\n {value: 3, label: 'w'},\r\n {value: 4, label: 'M'},\r\n {value: 5, label: 'Y'}\r\n ], //任务调用频率单位列表\r\n rules: {\r\n taskName: [\r\n {\r\n required: true,\r\n message: '请输入任务名称',\r\n trigger: 'blur'\r\n }\r\n ],\r\n taskType: [\r\n {\r\n required: true,\r\n message: '请选择任务类别',\r\n trigger: 'blur'\r\n }\r\n ],\r\n taskClass: [\r\n {\r\n required: true,\r\n message: '请输入任务执行类',\r\n trigger: 'blur'\r\n }\r\n ],\r\n taskRate: [\r\n {\r\n required: true,\r\n message: '请输入任务调用频率',\r\n trigger: 'blur'\r\n }\r\n ],\r\n sourceCode: [\r\n {\r\n required: true,\r\n message: '请输入数据源',\r\n trigger: 'blur'\r\n }\r\n ],\r\n sourceTable: [\r\n {\r\n required: true,\r\n message: '请输入源表名',\r\n trigger: 'blur'\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n created() {\r\n this.getDataSources()\r\n this.getDetailInfo()\r\n },\r\n methods: {\r\n // 关闭新增窗口\r\n handleClose() {\r\n this.params = {\r\n taskName: null, //任务名称\r\n taskType: null, //任务类别\r\n taskClass: '', //任务执行类\r\n taskRate: null, //任务调用频率\r\n taskRateUnit: '', //任务调用频率单位(m:分钟,h:小时,d:天,w:周,M:月,Y:年)\r\n sourceCode: '', //数据源\r\n sourceTable: '', //源表名\r\n taskMemo: '', //任务说明\r\n id: null\r\n }\r\n this.$emit('closeFormDiao')\r\n },\r\n // 获取数据源\r\n getDataSources() {\r\n let portal = window.context.portal\r\n req.get(portal + '/sys/sysDataSource/v1/getDataSources').then(res => {\r\n this.dataSources = res.data\r\n })\r\n },\r\n changCode() {\r\n console.log(this.sourceTables)\r\n },\r\n //获取源表名\r\n remoteMethod(query) {\r\n let obj = {\r\n dsalias: this.params.sourceCode,\r\n isTable: '1',\r\n objName: query\r\n }\r\n this.sourceTables = []\r\n collocation.sourceTables(obj, res => {\r\n this.sourceTables = res\r\n console.log(res)\r\n })\r\n },\r\n // 根据ID查询\r\n getDetailInfo() {\r\n if (this.title === '修改') {\r\n collocation.detailId(this.pId, res => {\r\n this.params.taskName = res.taskName\r\n this.params.taskType = res.taskType\r\n this.params.taskClass = res.taskClass\r\n this.params.taskRate = res.taskRate\r\n this.params.taskRateUnit = res.taskRateUnit\r\n this.params.sourceCode = res.sourceCode\r\n this.params.sourceTable = res.sourceTable\r\n this.params.taskMemo = res.taskMemo\r\n this.params.taskStatus = res.taskStatus\r\n this.params.id = res.id\r\n })\r\n } else {\r\n }\r\n },\r\n\r\n // 保存新增任务\r\n goInfo(e) {\r\n this.$refs.formInfo.validate(valid => {\r\n console.log(valid)\r\n if (valid) {\r\n if (this.title === '新增') {\r\n let arr = JSON.parse(JSON.stringify(this.params))\r\n collocation.addSave(this.params, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '新增成功',\r\n duration: 2000\r\n // offset: 80\r\n })\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n } else {\r\n }\r\n })\r\n }\r\n if (this.title === '修改') {\r\n collocation.upData(this.params, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '修改成功',\r\n duration: 2000\r\n })\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n } else {\r\n }\r\n })\r\n }\r\n } else {\r\n return false\r\n }\r\n })\r\n },\r\n // 验证任务执行\r\n verification() {\r\n let className = this.params.taskClass\r\n collocation.verification(className, res => {\r\n console.log(res)\r\n if (res.state) {\r\n this.$message({\r\n message: '验证成功',\r\n type: 'success',\r\n duration: 2000\r\n })\r\n }\r\n })\r\n },\r\n getRowKey(row) {\r\n return row.id\r\n }\r\n }\r\n}\r\n",null]}