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
| <template>
| <AppContainer>
| <ProTableV2
| :columns="columns"
| :show-pagination="false"
| :table-data="exceptionLogs"
| :column-render-map="columnsRenderProps"
| >
| <template #createdUser="{ row }">
| <el-button type="primary" link @click="handleAdd({ json: row.createdUser })"
| >查看</el-button
| >
| </template>
| </ProTableV2>
| <JsonViewerDialog v-bind="dialogProps" />
| </AppContainer>
| </template>
|
| <script setup lang="ts">
| import {
| AppContainer,
| ProTableV2,
| defineColumns,
| ProTableV2Props,
| useFormDialog,
| } from '@bole-core/components';
| import JsonViewerDialog from './JsonViewerDialog.vue';
|
| defineOptions({
| name: 'ExceptionLogsView',
| });
|
| type Props = {
| exceptionLogs: API.GetExceptionLogsQueryResultItem[];
| };
| const props = withDefaults(defineProps<Props>(), {
| exceptionLogs: () => [] as API.GetExceptionLogsQueryResultItem[],
| });
|
| const columns = defineColumns(
| ['type', 'code', 'message', 'stackTrace', 'createdUser', 'createdTime'].map((x, index) => ({
| id: index + '',
| enCode: x,
| name: x,
| }))
| );
|
| const columnsRenderProps: ProTableV2Props['columnRenderMap'] = {
| createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
| };
|
| const { dialogProps, handleAdd } = useFormDialog({
| defaultFormParams: {
| json: null,
| },
| });
| </script>
|
|