Files
springboot-shop-sysadmin/src/views/setting/TaskLogs.vue
2026-06-07 11:10:48 +08:00

82 lines
1.6 KiB
Vue

<template>
<div class="record-page">
<ILayoutPage :config="config">
<template #bodyCell="{ column, record, type }">
<template v-if="column.dataIndex === 'recordDetail'">
<LogContentPreview :content="record.logsContent" />
</template>
</template>
</ILayoutPage>
</div>
</template>
<script setup>
import { ref } from "vue";
import ILayoutPage from "@/iview/ILayoutPage.vue";
import LogContentPreview from "@/components/LogContentPreview.vue";
const props = defineProps({
taskInfo: {
type: Object,
required: true,
},
});
const recordColumns = ref([
{
title: "执行日志",
dataIndex: "recordDetail",
bodySlot: true,
ellipsis: true,
},
]);
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: [
{
title: "兽药企业信息",
name: "info",
recordApi: "api.system.async.task.info.logs",
recordMap: (record) => {
return record;
},
defaultParams: () => {
return {
guid: props.taskInfo.guid,
};
},
hiddenLabel: true,
columns: recordColumns.value,
},
],
detailPages: [],
formPages: [
],
});
</script>
<style scoped>
.record-page {
width: 100%;
height: 100%;
min-height: 100%;
}
</style>