taskLog.vue
4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<route lang="yaml">
name: taskLog //分类分级任务日志
</route>
<script lang="ts" setup name="taskLog">
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { getTaskExecPageList, filterVal } from "@/api/modules/dataInventory";
import { TableColumnWidth } from '@/utils/enum';
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
const loading = ref(false);
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const searchItemValue: any = ref({});
const currTableData: any = ref({});
const tableInfo = ref({
id: "mapping-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{ label: "任务名称", field: "taskName", width: 96 },
{
label: "目录名称", field: "cgDirName", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => {
router.push({
name: "templateConfig",
query: { guid: scope.row.damGuid },
});
}
},
{
label: "元数据", field: "metaNames", width: 200, getName: (scope) => {
const metaNames = scope.row.metaNames || [];
return metaNames.join(',');
}
},
{ label: "任务修改人", field: "updateUserName", width: 120 },
{ label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{ label: "结果确认人", field: "confirmUserName", width: 120 },
{ label: "确认时间", field: "confirmTime", width: TableColumnWidth.DATETIME },
{
label: "结果状态", field: "status", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.status, 'confirmStatus');
}, tagType: (scope) => {
return scope.row.confirmStatus == 'Y' ? 'success' : 'warning';
}
},
],
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 90,
btns: (scope) => {
return [
{ label: "查看结果", value: "log" },
];
},
},
});
const getTableData = () => {
loading.value = true;
getTaskExecPageList(
Object.assign({}, searchItemValue.value, {
pageIndex: page.value.curr,
pageSize: page.value.limit,
taskGuid: route.query.guid
})
).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
}
})
.catch((res) => {
loading.value = false;
});
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type == "log") {
toPath(type);
}
};
const toPath = (type) => {
router.push({
name: "taskDetail",
query: {
guid: currTableData.value.taskGuid,
name: currTableData.value.taskName,
execGuid: currTableData.value.guid,
type
},
});
}
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.limit = page.value.limit;
tableInfo.value.page.curr = page.value.curr;
getTableData();
};
const getFirstPageData = () => {
page.value.curr = 1
tableInfo.value.page.curr = 1;
getTableData();
}
onActivated(() => {
// getFirstPageData()
})
onBeforeMount(() => {
getFirstPageData()
})
</script>
<template>
<div class="container_wrap" v-loading="loading">
<div class="table_panel_wrap" v-if="tableInfo.data.length">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
<div class="card-noData" v-else>
<img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
<p>暂无分类分级任务日志记录</p>
</div>
</div>
</template>
<style scoped lang="scss">
.table_tool_wrap {
width: 100%;
height: 40px !important;
padding: 0 8px;
.table_title {
height: 40px;
line-height: 40px;
font-weight: 600;
font-size: 16px;
color: #212121;
}
}
.table_panel_wrap {
width: 100%;
height: 100%;
padding: 12px 8px 0;
}
.card-noData {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
</style>