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