forked from tools/tape-springboot-sysadmin
init
This commit is contained in:
91
src/views/setting/TaskLogs.vue
Normal file
91
src/views/setting/TaskLogs.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="record-page">
|
||||
<ILayoutPage ref="pageRef" :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>
|
||||
</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 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: "执行日志",
|
||||
dataIndex: "recordDetail",
|
||||
bodySlot: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
]);
|
||||
|
||||
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%;
|
||||
}
|
||||
|
||||
.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