{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\components\\taskFormDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\components\\taskFormDialog.vue","mtime":1667545182676},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-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//\nimport req from '@/request.js';\nimport collection from '@/api/device/collection.js';\nexport default {\n name: 'TaskFormDialog',\n data: function data() {\n return {\n visible: false,\n title: '新增',\n params: {\n taskName: '',\n //任务名称\n taskType: undefined,\n //任务类别\n taskClass: '',\n //任务执行类\n taskRate: null,\n //任务调用频率\n taskRateUnit: 'm',\n //任务调用频率单位(m:分钟,h:小时,d:天,w:周,M:月,Y:年)\n sourceCode: '',\n //数据源\n sourceTable: '',\n //源表名\n taskMemo: '',\n //任务说明\n taskStatus: ''\n },\n dataSources: [],\n //数据源列表\n sourceTables: [],\n //源表名列表\n taskTypes: [{\n value: 1,\n label: '定时任务'\n }, {\n value: 2,\n label: '非定时任务'\n }],\n //任务类别列表\n taskRateUnits: [{\n value: 0,\n label: 'm'\n }, {\n value: 1,\n label: 'h'\n }, {\n value: 2,\n label: 'd'\n }, {\n value: 3,\n label: 'w'\n }, {\n value: 4,\n label: 'M'\n }, {\n value: 5,\n label: 'Y'\n }],\n //任务调用频率单位列表\n rules: {\n taskName: [{\n required: true,\n message: '请输入任务名称',\n trigger: 'blur'\n }],\n taskType: [{\n required: true,\n message: '请选择任务类别',\n trigger: 'blur'\n }],\n taskClass: [{\n required: true,\n message: '请输入任务执行类',\n trigger: 'blur'\n }],\n taskRate: [{\n required: true,\n message: '请输入任务调用频率',\n trigger: 'blur'\n }]\n }\n };\n },\n methods: {\n add: function add() {\n this.visible = true;\n this.getDataSources();\n },\n edit: function edit(row) {\n this.title = '修改';\n this.getDataSources();\n this.getDetail(row.id);\n },\n // 关闭新增窗口\n handleClose: function handleClose() {\n this.params = {\n taskName: '',\n //任务名称\n taskType: undefined,\n //任务类别\n taskClass: '',\n //任务执行类\n taskRate: null,\n //任务调用频率\n taskRateUnit: 'm',\n //任务调用频率单位(m:分钟,h:小时,d:天,w:周,M:月,Y:年)\n sourceCode: '',\n //数据源\n sourceTable: '',\n //源表名\n taskMemo: '',\n //任务说明\n taskStatus: ''\n };\n this.title = '新增';\n this.$refs.formInfo.resetFields();\n this.visible = false;\n },\n //获取源表名\n remoteMethod: function remoteMethod(query) {\n var _this = this;\n\n var obj = {\n dsalias: this.params.sourceCode,\n isTable: '1',\n objName: query\n };\n this.sourceTables = [];\n collection.sourceTables(obj, function (res) {\n _this.sourceTables = res;\n });\n },\n // 根据ID查询\n getDetail: function getDetail(id) {\n var _this2 = this;\n\n collection.detailId(id, function (res) {\n _this2.params = res;\n _this2.visible = true;\n });\n },\n // 保存新增任务\n handleSave: function handleSave() {\n var _this3 = this;\n\n this.$refs.formInfo.validate(function (valid) {\n console.log(valid);\n\n if (valid) {\n if (_this3.title === '新增') {\n var arr = JSON.parse(JSON.stringify(_this3.params));\n collection.addSave(_this3.params, function (response) {\n if (response.state) {\n _this3.$notify({\n type: 'success',\n message: '新增成功',\n duration: 2000\n });\n\n _this3.handleClose();\n\n _this3.$emit('reload');\n }\n });\n }\n\n if (_this3.title === '修改') {\n collection.upData(_this3.params, function (response) {\n if (response.state) {\n _this3.$notify({\n type: 'success',\n message: '修改成功',\n duration: 2000\n });\n\n _this3.handleClose();\n\n _this3.$emit('reload');\n }\n });\n }\n } else {\n _this3.$notify({\n type: 'warning',\n message: \"请完善表单信息!\",\n duration: 2000\n });\n }\n });\n },\n // 验证任务执行\n verification: function verification() {\n var _this4 = this;\n\n var className = this.params.taskClass;\n\n if (!className) {\n this.$message({\n message: '任务执行类为空!',\n type: 'warning',\n duration: 2000\n });\n return;\n }\n\n collection.verification(className, function (res) {\n console.log(res);\n\n if (res.state) {\n _this4.$message({\n message: '验证成功',\n type: 'success',\n duration: 2000\n });\n }\n });\n },\n // 获取数据源\n getDataSources: function getDataSources() {\n var _this5 = this;\n\n var portal = window.context.portal;\n req.get(portal + '/sys/sysDataSource/v1/getDataSources').then(function (res) {\n _this5.dataSources = res.data;\n });\n }\n }\n};",null]}