|
|
@ -33,12 +33,13 @@ |
|
|
|
<!-- 如果是都选中了,就是整点和半点每间隔30分钟执行一次!! --> |
|
|
|
<div v-if="scope.row.timerType===4 && scope.row.timeInterval === '1'">整点</div> |
|
|
|
<div v-if="scope.row.timerType===4 && scope.row.timeInterval === '2'">半点</div> |
|
|
|
<div v-if="scope.row.timerType===4 && (scope.row.timeInterval && scope.row.timeInterval.split(',').length === 2)">整点/半点</div> |
|
|
|
<div v-if="scope.row.timerType===4 && (scope.row.timeInterval && scope.row.timeInterval.indexOf(',') !== -1 && scope.row.timeInterval.split(',').length === 2)">整点/半点</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="nextExecute" label="下次运行"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.nextExecute | parseTime }}</div> |
|
|
|
<div v-if="scope.row.nextExecute">{{ scope.row.nextExecute | parseTime }}</div> |
|
|
|
<div v-else> - </div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="lastExecute" label="最后运行"> |
|
|
@ -209,9 +210,9 @@ import pagination from '@crud/Pagination' |
|
|
|
import Detail from './module/detail' |
|
|
|
import { parseTime, timeToTimestamp } from '@/utils/index.js' |
|
|
|
import { getAllDev } from '@/api/system/logs' |
|
|
|
import qs from 'qs' |
|
|
|
import { exportFile } from '@/utils/index' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
// import qs from 'qs' |
|
|
|
// import { exportFile } from '@/utils/index' |
|
|
|
// import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
const defaultForm = { id: null, taskType: null, deviceId: null, taskName: null, timerType: 2, timeInterval: 1, status: 1, startTime2: parseTime(new Date().getTime()), endTime2: null, nowTime: null, longTime: true, remark: null, halfOrPart: [] } |
|
|
|
|
|
|
@ -364,10 +365,10 @@ export default { |
|
|
|
computed: { |
|
|
|
isRequired() { |
|
|
|
return this.form.longTime === false |
|
|
|
}, |
|
|
|
...mapGetters([ |
|
|
|
'baseApi' |
|
|
|
]) |
|
|
|
} |
|
|
|
// ...mapGetters([ |
|
|
|
// 'baseApi' |
|
|
|
// ]) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
}, |
|
|
@ -387,17 +388,18 @@ export default { |
|
|
|
}, |
|
|
|
// 初始化编辑时候的角色与岗位 |
|
|
|
[CRUD.HOOK.beforeToEdit](crud, form) { |
|
|
|
if (form.endTime === null) { |
|
|
|
form.longTime = true |
|
|
|
} |
|
|
|
if (form.timerType === 4 && form.timeInterval) { |
|
|
|
form.halfOrPart = form.timeInterval.split(',') |
|
|
|
form.halfOrPart = form.timeInterval.split(',').map(Number) |
|
|
|
} |
|
|
|
if (form.startTime) { |
|
|
|
this.form.startTime2 = parseTime(form.startTime) |
|
|
|
} |
|
|
|
if (form.endTime) { |
|
|
|
this.form.endTime2 = parseTime(form.endTime) |
|
|
|
form.longTime = false |
|
|
|
} else { |
|
|
|
this.form.endTime2 = null |
|
|
|
form.longTime = true |
|
|
|
} |
|
|
|
}, |
|
|
|
[CRUD.HOOK.beforeValidateCU](crud, form) { |
|
|
@ -426,7 +428,6 @@ export default { |
|
|
|
delete crud.form.endTime2 |
|
|
|
delete crud.form.nowTime |
|
|
|
delete crud.form.halfOrPart |
|
|
|
console.log(crud.form) |
|
|
|
return true |
|
|
|
}, |
|
|
|
changeFormTab(index) { |
|
|
@ -467,6 +468,8 @@ export default { |
|
|
|
if (val === 4) { |
|
|
|
this.form.timeInterval = null |
|
|
|
this.form.halfOrPart = [1] |
|
|
|
} else { |
|
|
|
this.form.timeInterval = 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取设备 |
|
|
@ -499,6 +502,10 @@ export default { |
|
|
|
// 双击详情 |
|
|
|
handleDbClick(row) { |
|
|
|
this.$refs.detailRefs.detailVisible = true |
|
|
|
this.$refs.detailRefs.detailTitle = row.taskName + '-日志' |
|
|
|
this.$refs.detailRefs.currentTaskId = row.id |
|
|
|
this.$refs.detailRefs.page.page = 1 |
|
|
|
this.$refs.detailRefs.getInitTimedTasksLog(row.id) |
|
|
|
}, |
|
|
|
// 改变状态 |
|
|
|
changeStatus(data, val) { |
|
|
@ -511,26 +518,25 @@ export default { |
|
|
|
'id': data.id, |
|
|
|
'status': val |
|
|
|
} |
|
|
|
console.log('params', params) |
|
|
|
// crudTask.FetchStatus(params).then(res => { |
|
|
|
// this.crud.notify('状态修改成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|
|
|
// }).catch(() => { |
|
|
|
// data.status = !data.status |
|
|
|
// }) |
|
|
|
crudTask.FetchStatus(params).then(res => { |
|
|
|
this.crud.notify('状态修改成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|
|
|
}).catch(() => { |
|
|
|
// data.status = !data.status |
|
|
|
data.status = !data.status |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
data.status = !data.status |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 导出接口调用 |
|
|
|
downloadApi(data) { |
|
|
|
const ids = data.map(item => { return item.id }) |
|
|
|
const params = { |
|
|
|
'logIds': ids |
|
|
|
} |
|
|
|
console.log(params) |
|
|
|
// /case/exportCaseLogList |
|
|
|
exportFile(this.baseApi + '/api?' + qs.stringify(params, { indices: false })) |
|
|
|
} |
|
|
|
// 导出接口调用 |
|
|
|
// downloadApi(data) { |
|
|
|
// const ids = data.map(item => { return item.id }) |
|
|
|
// const params = { |
|
|
|
// 'logIds': ids |
|
|
|
// } |
|
|
|
// console.log(params) |
|
|
|
// // /case/exportCaseLogList |
|
|
|
// exportFile(this.baseApi + '/api?' + qs.stringify(params, { indices: false })) |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|