fix任务日志查看详情问题

This commit is contained in:
不做码农 2022-05-12 13:43:19 +08:00
parent b7034918d4
commit 647bb1f3df
2 changed files with 31 additions and 8 deletions

View File

@ -32,7 +32,7 @@
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button plain v-hasPermi="['monitor:job:query']" type="info" icon="operation" @click="handleJobLog()"> <el-button plain v-hasPermi="['monitor:job:query']" type="info" icon="operation" @click="onJobLogView()">
{{ $t('btn.log') }} {{ $t('btn.log') }}
</el-button> </el-button>
</el-col> </el-col>
@ -549,6 +549,9 @@ const logForm = reactive({
jobId: undefined, jobId: undefined,
title: undefined, title: undefined,
}) })
function onJobLogView(){
router.push({ path: 'job/log' })
}
/** 任务日志列表查询 */ /** 任务日志列表查询 */
function handleJobLog(row) { function handleJobLog(row) {
if (undefined != row.id) { if (undefined != row.id) {

View File

@ -22,8 +22,7 @@
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"></el-date-picker>
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
@ -36,7 +35,9 @@
<el-button type="danger" plain icon="delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['PRIV_JOBLOG_DELETE']">删除</el-button> <el-button type="danger" plain icon="delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['PRIV_JOBLOG_DELETE']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="delete" @click="handleClean" :disabled="total <= 0" v-hasPermi="['PRIV_JOBLOG_REMOVE']">清空</el-button> <el-button type="danger" plain icon="delete" @click="handleClean" :disabled="total <= 0" v-hasPermi="['PRIV_JOBLOG_REMOVE']"
>清空</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['PRIV_JOBLOG_EXPORT']">导出</el-button> <el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['PRIV_JOBLOG_EXPORT']">导出</el-button>
@ -54,7 +55,9 @@
<el-table-column label="执行状态" align="center" prop="status" :formatter="statusFormat" /> <el-table-column label="执行状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="作业用时" align="center" prop="elapsed"> <el-table-column label="作业用时" align="center" prop="elapsed">
<template #default="scope"> <template #default="scope">
<span :style="scope.row.elapsed < 1000 ? 'color:green' : scope.row.elapsed < 3000 ? 'color:orange' : 'color:red'">{{ scope.row.elapsed / 1000 }} ms</span> <span :style="scope.row.elapsed < 1000 ? 'color:green' : scope.row.elapsed < 3000 ? 'color:orange' : 'color:red'">
{{ Math.floor(scope.row.elapsed) / 1000 }} ms
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="执行时间" align="center" prop="createTime" width="180"> <el-table-column label="执行时间" align="center" prop="createTime" width="180">
@ -73,7 +76,7 @@
<!-- 调度日志详细 --> <!-- 调度日志详细 -->
<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="form" :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">
<el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item> <el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
@ -125,6 +128,7 @@ const open = ref(false)
const dateRange = ref([]) const dateRange = ref([])
const statusOptions = ref([]) const statusOptions = ref([])
const jobGroupOptions = ref([]) const jobGroupOptions = ref([])
const formRef = ref()
const data = reactive({ const data = reactive({
form: {}, form: {},
@ -175,10 +179,24 @@ function handleQuery() {
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
dateRange.value = [] dateRange.value = []
resetForm('queryForm') proxy.resetForm('queryForm')
handleQuery() handleQuery()
} }
function reset() {
form.value = {
createTime: undefined,
elapsed: 0,
exception: undefined,
invokeTarget: undefined,
jobGroup: undefined,
jobId: 0,
jobLogId: 0,
jobMessage: undefined,
jobName: undefined,
status: undefined,
}
proxy.resetForm('formRef')
}
// //
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.jobLogId) ids.value = selection.map((item) => item.jobLogId)
@ -186,8 +204,10 @@ function handleSelectionChange(selection) {
} }
/** 详细按钮操作 */ /** 详细按钮操作 */
function handleView(row) { function handleView(row) {
reset()
open.value = true open.value = true
form.value = row form.value = row
console.log(row)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {