{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\CollectionTask.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\CollectionTask.vue","mtime":1686644136998},{"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//\n//\n//\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 FormDialog from './components/taskFormDialog.vue'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport collection from '@/api/device/collection.js'\r\nimport req from '@/request.js'\r\nexport default {\r\n name: 'CollectionTask',\r\n components: {\r\n FormDialog,\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n querys: [\r\n {\r\n group: 'filter',\r\n operation: 'LIKE',\r\n property: 'taskName',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'filter',\r\n operation: 'EQUAL',\r\n property: 'taskType',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n ],\r\n total: 0,\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 tableData: [],\r\n taskTypes: [\r\n {value: 1, label: '定时任务'},\r\n {value: 2, label: '非定时任务'},\r\n ],\r\n operation: '操作',\r\n logQuery: '日志查询',\r\n taskStatus: '', //NONE停止任务 NORMAL运行任务 PAUSED暂停任务\r\n loading: false,\r\n multipleSelection: [], // 复选框\r\n title: '',\r\n }\r\n },\r\n created() {},\r\n methods: {\r\n // 获取分页数据\r\n loadData(page) {\r\n if (page) {\r\n this.queryParam.pageBean.page = page\r\n }\r\n this.loading = true\r\n this.tableData = []\r\n this.queryParam.querys = []\r\n if (this.querys[0].value) {\r\n this.queryParam.querys.push(this.querys[0])\r\n }\r\n if (this.querys[1].value) {\r\n this.queryParam.querys.push(this.querys[1])\r\n }\r\n collection.listQuery(this.queryParam, (res) => {\r\n if (res.rows && res.rows.length) {\r\n this.total = res.total\r\n this.tableData = this.formatData(res.rows)\r\n }\r\n this.$set(this.tableData)\r\n this.loading = false\r\n })\r\n },\r\n formatData(rows) {\r\n rows.forEach((item) => {\r\n this.taskTypes.forEach((type) => {\r\n if (type.value === item.taskType) {\r\n item['taskType'] = type.label\r\n }\r\n })\r\n })\r\n return rows\r\n },\r\n clearQuerys() {\r\n this.querys[0].value = ''\r\n this.querys[1].value = ''\r\n },\r\n reload() {\r\n this.loadData(1)\r\n },\r\n // 任务启动状态\r\n startUpJob(row) {\r\n console.log(row.id)\r\n let taskId = row.id\r\n if (row.taskStatus === 'NONE') {\r\n console.log(row.taskStatus)\r\n collection.startUpJob(taskId, (res) => {\r\n if (res.state) {\r\n console.log(res)\r\n row.taskStatus = 'NORMAL'\r\n }\r\n })\r\n }\r\n if (row.taskStatus === 'PAUSED') {\r\n console.log(row.taskStatus)\r\n collection.startUpJob(taskId, (res) => {\r\n if (res.state) {\r\n console.log(res)\r\n row.taskStatus = 'NORMAL'\r\n this.$notify({\r\n message: '开启成功',\r\n type: 'success',\r\n duration: 2000,\r\n })\r\n }\r\n })\r\n }\r\n if (row.taskStatus === 'NORMAL') {\r\n console.log(row.taskStatus)\r\n collection.stopJob(taskId, (res) => {\r\n if (res.state) {\r\n console.log(res)\r\n row.taskStatus = 'PAUSED'\r\n this.$notify({\r\n message: '暂停成功',\r\n type: 'success',\r\n duration: 2000,\r\n })\r\n }\r\n })\r\n }\r\n },\r\n // 跳转日志查询\r\n toLogQuery(row) {\r\n if (this.$route.path.indexOf('frontPlat') !== -1) {\r\n this.$router.push({\r\n name: 'LogQuery',\r\n query: {id: row.id, taskName: row.taskName},\r\n })\r\n } else {\r\n this.$router.push({\r\n name: 'LogQueryLink',\r\n query: {id: row.id, taskName: row.taskName},\r\n })\r\n }\r\n },\r\n\thandleDelete(){\r\n\t\tconst task = window.context.task\r\n\t\treq.remove(task + '/biz/task/schedulerTask/v1/' + '?ids=' + this.multipleSelection).then(res => {\r\n\t\t this.$notify({\r\n\t\t type: 'success',\r\n\t\t message: '删除成功',\r\n\t\t duration: 2000,\r\n\t\t })\r\n\t\t this.loadData()\r\n\t\t})\r\n\t}\r\n },\r\n}\r\n",null]}