任务中心

This commit is contained in:
iqudoo
2026-06-07 11:10:48 +08:00
parent 72207bb1bf
commit 93798e05ec
3 changed files with 123 additions and 58 deletions

View File

@@ -1,9 +1,8 @@
<template>
<div class="record-page">
<ILayoutPage ref="pageRef" :config="config">
<ILayoutPage :config="config">
<template #bodyCell="{ column, record, type }">
<template v-if="column.dataIndex === 'recordDetail'">
<pre class="log-params">{{ displayParams(taskInfo.taskParams) }}</pre>
<LogContentPreview :content="record.logsContent" />
</template>
</template>
@@ -23,21 +22,6 @@ const props = defineProps({
},
});
const pageRef = ref(null);
const refreshPage = () => {
pageRef.value.refreshPage();
};
const displayParams = (params) => {
try {
let paramsObj = JSON.parse(params);
return JSON.stringify(paramsObj, null, 2);
} catch (_) {
return params;
}
};
const recordColumns = ref([
{
title: "执行日志",
@@ -47,6 +31,23 @@ const recordColumns = ref([
},
]);
function formatTaskParams(params) {
if (params == null || params === "") return "";
if (typeof params === "object") {
try {
return JSON.stringify(params, null, 2);
} catch (_) {
return String(params);
}
}
try {
const paramsObj = JSON.parse(params);
return JSON.stringify(paramsObj, null, 2);
} catch (_) {
return String(params);
}
}
const config = ref({
infoPages: [
{
@@ -77,15 +78,4 @@ const config = ref({
height: 100%;
min-height: 100%;
}
.log-params {
color: #999;
padding: 10px;
font-size: 12px;
white-space: pre-wrap;
word-break: break-all;
background-color: #f5f5f5;
border-radius: 5px;
}
</style>