mirror of https://gitee.com/xiaonuobase/snowy
【更新】完成定时任务前端立即运行功能
parent
0b0d7e7cfd
commit
d13dfb0043
|
@ -46,6 +46,10 @@ export default {
|
|||
jobRunJob(data) {
|
||||
return request('runJob', data)
|
||||
},
|
||||
// 运行定时任务
|
||||
jobRunJobNow(data) {
|
||||
return request('runJobNow', data)
|
||||
},
|
||||
// 获取定时任务类
|
||||
jobGetActionClass(data) {
|
||||
return request('getActionClass', data, 'get')
|
||||
|
|
|
@ -84,20 +84,18 @@
|
|||
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
submitLoading.value = true
|
||||
jobApi
|
||||
.submitForm(formData.value, !formData.value.id)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
formRef.value.validate().then(() => {
|
||||
submitLoading.value = true
|
||||
jobApi
|
||||
.submitForm(formData.value, !formData.value.id)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
// 分类
|
||||
const categoryOptions = tool.dictTypeList('JOB_CATEGORY').map((item) => {
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
<a @click="immediatelyRun(record)">立即运行</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="form.onOpen(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定要删除此定时任务吗?" @confirm="deleteJob(record)">
|
||||
|
@ -123,7 +125,7 @@
|
|||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: '200px'
|
||||
width: '220px'
|
||||
}
|
||||
]
|
||||
let selectedRowKeys = ref([])
|
||||
|
@ -169,6 +171,15 @@
|
|||
})
|
||||
}
|
||||
}
|
||||
// 立即运行
|
||||
const immediatelyRun = (record) => {
|
||||
const params = {
|
||||
id: record.id
|
||||
}
|
||||
jobApi.jobRunJobNow(params).then(() => {
|
||||
table.value.refresh(true)
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
const deleteJob = (record) => {
|
||||
let params = [
|
||||
|
|
Loading…
Reference in New Issue