feat:任务新增详情
This commit is contained in:
parent
4cff25960b
commit
36f1c67466
@ -40,7 +40,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-table ref="tasks" v-loading="loading" :data="dataTasks" border="" row-key="id" @sort-change="handleSortable">
|
<el-table ref="tasks" v-loading="loading" :data="dataTasks" border="" row-key="id" @sort-change="handleSortable">
|
||||||
<el-table-column type="index" :index="handleIndexCalc" label="#" align="center" />
|
<el-table-column type="index" :index="handleIndexCalc" label="#" align="center" />
|
||||||
<el-table-column prop="name" :show-overflow-tooltip="true" label="任务名称" width="80" />
|
<el-table-column prop="name" label="任务名称" width="100" />
|
||||||
<el-table-column prop="jobGroup" :show-overflow-tooltip="true" align="center" label="任务分组" width="80" />
|
<el-table-column prop="jobGroup" :show-overflow-tooltip="true" align="center" label="任务分组" width="80" />
|
||||||
<el-table-column prop="assemblyName" align="center" label="程序集名称" :show-overflow-tooltip="true" />
|
<el-table-column prop="assemblyName" align="center" label="程序集名称" :show-overflow-tooltip="true" />
|
||||||
<el-table-column prop="className" align="center" label="任务类名" :show-overflow-tooltip="true" />
|
<el-table-column prop="className" align="center" label="任务类名" :show-overflow-tooltip="true" />
|
||||||
@ -56,6 +56,9 @@
|
|||||||
<el-table-column prop="remark" align="center" label="备注" :show-overflow-tooltip="true" />
|
<el-table-column prop="remark" align="center" label="备注" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<el-link size="small" class="ml10" icon="view" v-hasPermi="['monitor:job:query']" @click="handleDetails(scope.row)">
|
||||||
|
{{ $t('btn.details') }}
|
||||||
|
</el-link>
|
||||||
<el-link size="small" class="ml10" icon="view" v-hasPermi="['monitor:job:query']" @click="handleJobLog(scope.row)">
|
<el-link size="small" class="ml10" icon="view" v-hasPermi="['monitor:job:query']" @click="handleJobLog(scope.row)">
|
||||||
{{ $t('btn.log') }}
|
{{ $t('btn.log') }}
|
||||||
</el-link>
|
</el-link>
|
||||||
@ -239,7 +242,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer v-if="btnVisible">
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
||||||
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
||||||
@ -301,7 +304,7 @@ const queryParams = reactive({
|
|||||||
PageNum: 1,
|
PageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderby: 'createTime',
|
orderby: 'createTime',
|
||||||
sort: 'descending',
|
sort: 'descending'
|
||||||
})
|
})
|
||||||
// 计划任务列表
|
// 计划任务列表
|
||||||
const dataTasks = ref([])
|
const dataTasks = ref([])
|
||||||
@ -312,7 +315,7 @@ const formRef = ref(null)
|
|||||||
// 任务状态字典
|
// 任务状态字典
|
||||||
const isStartOptions = ref([
|
const isStartOptions = ref([
|
||||||
{ dictLabel: '运行中', dictValue: 'true', listClass: 'success' },
|
{ dictLabel: '运行中', dictValue: 'true', listClass: 'success' },
|
||||||
{ dictLabel: '已停止', dictValue: 'false' },
|
{ dictLabel: '已停止', dictValue: 'false' }
|
||||||
])
|
])
|
||||||
// 任务组名字典
|
// 任务组名字典
|
||||||
const jobGroupOptions = ref([])
|
const jobGroupOptions = ref([])
|
||||||
@ -320,12 +323,12 @@ const jobGroupOptions = ref([])
|
|||||||
const triggerTypeOptions = ref([
|
const triggerTypeOptions = ref([
|
||||||
{
|
{
|
||||||
label: '[普通]',
|
label: '[普通]',
|
||||||
value: 0,
|
value: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '[表达式]',
|
label: '[表达式]',
|
||||||
value: 1,
|
value: 1
|
||||||
},
|
}
|
||||||
])
|
])
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
@ -340,9 +343,11 @@ const state = reactive({
|
|||||||
cron: [{ required: true, message: '请输入cron表达式', trigger: 'blur' }],
|
cron: [{ required: true, message: '请输入cron表达式', trigger: 'blur' }],
|
||||||
beginTime: [{ required: false, message: '请选择开始日期', trigger: 'blur' }],
|
beginTime: [{ required: false, message: '请选择开始日期', trigger: 'blur' }],
|
||||||
endTime: [{ required: false, message: '请选择结束日期', trigger: 'blur' }],
|
endTime: [{ required: false, message: '请选择结束日期', trigger: 'blur' }],
|
||||||
intervalSecond: [{ message: '请设置执行间隔', type: 'number', trigger: 'blur' }],
|
intervalSecond: [{ message: '请设置执行间隔', type: 'number', trigger: 'blur' }]
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
// 按钮是否可见
|
||||||
|
const btnVisible = ref(true)
|
||||||
const { rules, form } = toRefs(state)
|
const { rules, form } = toRefs(state)
|
||||||
// 时间的选择
|
// 时间的选择
|
||||||
// const pickerOptions = reactive({
|
// const pickerOptions = reactive({
|
||||||
@ -370,13 +375,14 @@ function handleReset() {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
reset()
|
reset()
|
||||||
|
btnVisible.value = true
|
||||||
open.value = true
|
open.value = true
|
||||||
title.value = '添加计划任务'
|
title.value = '添加计划任务'
|
||||||
}
|
}
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset()
|
||||||
|
btnVisible.value = true
|
||||||
getTasks(row.id).then((res) => {
|
getTasks(row.id).then((res) => {
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
open.value = true
|
open.value = true
|
||||||
@ -423,7 +429,7 @@ function handleDelete(row) {
|
|||||||
.$confirm('是否确认删除名称为"' + jobInfo.name + '"的计划任务?', '警告', {
|
.$confirm('是否确认删除名称为"' + jobInfo.name + '"的计划任务?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
deleteTasks(jobInfo.id).then((response) => {
|
deleteTasks(jobInfo.id).then((response) => {
|
||||||
@ -443,7 +449,7 @@ function handleRun(row) {
|
|||||||
.$confirm('确认要立即执行一次"' + jobInfo.name + '"任务吗?', '警告', {
|
.$confirm('确认要立即执行一次"' + jobInfo.name + '"任务吗?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
runTasks(jobInfo.id).then((res) => {
|
runTasks(jobInfo.id).then((res) => {
|
||||||
@ -498,7 +504,7 @@ function reset() {
|
|||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
intervalSecond: 1,
|
intervalSecond: 1,
|
||||||
cron: undefined,
|
cron: undefined,
|
||||||
taskType: 1,
|
taskType: 1
|
||||||
}
|
}
|
||||||
proxy.resetForm('formRef')
|
proxy.resetForm('formRef')
|
||||||
}
|
}
|
||||||
@ -517,7 +523,7 @@ function handleExport() {
|
|||||||
.$confirm('是否确认导出所有任务?', '警告', {
|
.$confirm('是否确认导出所有任务?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return exportTasks()
|
return exportTasks()
|
||||||
@ -540,8 +546,8 @@ watch(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
/** 任务日志 */
|
/** 任务日志 */
|
||||||
@ -549,7 +555,7 @@ watch(
|
|||||||
const logForm = reactive({
|
const logForm = reactive({
|
||||||
beginTime: undefined,
|
beginTime: undefined,
|
||||||
jobId: undefined,
|
jobId: undefined,
|
||||||
title: undefined,
|
title: undefined
|
||||||
})
|
})
|
||||||
function onJobLogView() {
|
function onJobLogView() {
|
||||||
router.push({ path: 'job/log' })
|
router.push({ path: 'job/log' })
|
||||||
@ -568,4 +574,13 @@ function handleJobLog(row) {
|
|||||||
jobLogList.value = response.data.result
|
jobLogList.value = response.data.result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
function handleDetails(row) {
|
||||||
|
reset()
|
||||||
|
getTasks(row.id).then((res) => {
|
||||||
|
form.value = res.data
|
||||||
|
open.value = true
|
||||||
|
title.value = '详情'
|
||||||
|
btnVisible.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
<!-- 调度日志详细 -->
|
<!-- 调度日志详细 -->
|
||||||
<el-dialog title="调度日志详细" v-model="open" width="700px" append-to-body>
|
<el-dialog title="日志详细" v-model="open" width="700px" append-to-body>
|
||||||
<el-form ref="formRef" :model="form" label-width="100px">
|
<el-form ref="formRef" :model="form" label-width="100px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -98,8 +98,7 @@
|
|||||||
<div v-else-if="form.status == 1">失败</div>
|
<div v-else-if="form.status == 1">失败</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" v-if="form.status == 1"
|
<el-col :span="24" v-if="form.status == 1">
|
||||||
>>
|
|
||||||
<el-form-item label="异常信息:">{{ form.exception }}</el-form-item>
|
<el-form-item label="异常信息:">{{ form.exception }}</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -138,8 +137,8 @@ const data = reactive({
|
|||||||
jobName: undefined,
|
jobName: undefined,
|
||||||
jobGroup: undefined,
|
jobGroup: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
jobId: undefined,
|
jobId: undefined
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const { form, queryParams } = toRefs(data)
|
const { form, queryParams } = toRefs(data)
|
||||||
@ -193,7 +192,7 @@ function reset() {
|
|||||||
jobLogId: 0,
|
jobLogId: 0,
|
||||||
jobMessage: undefined,
|
jobMessage: undefined,
|
||||||
jobName: undefined,
|
jobName: undefined,
|
||||||
status: undefined,
|
status: undefined
|
||||||
}
|
}
|
||||||
proxy.resetForm('formRef')
|
proxy.resetForm('formRef')
|
||||||
}
|
}
|
||||||
@ -216,7 +215,7 @@ function handleDelete(row) {
|
|||||||
.$confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?', '警告', {
|
.$confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return delJobLog(jobLogIds)
|
return delJobLog(jobLogIds)
|
||||||
@ -232,7 +231,7 @@ function handleClean() {
|
|||||||
.$confirm('是否确认清空所有调度日志数据项?', '警告', {
|
.$confirm('是否确认清空所有调度日志数据项?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return cleanJobLog()
|
return cleanJobLog()
|
||||||
@ -248,7 +247,7 @@ function handleExport() {
|
|||||||
.$confirm('是否确认导出所有调度日志数据项?', '警告', {
|
.$confirm('是否确认导出所有调度日志数据项?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return exportJobLog(queryParams.value)
|
return exportJobLog(queryParams.value)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user