forked from tools/tape-springboot-sysadmin
任务中心
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user