index.vue
1.86 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
<template>
<PageWrapper title="我的通知详情">
<Description @register="register1" class="mt-4" />
</PageWrapper>
</template>
<script lang="ts">
import { defineComponent, watch, ref } from 'vue';
import { Description, DescItem, useDescription } from '/@/components/Description/index';
import { PageWrapper } from '/@/components/Page';
const schema: DescItem[] = [
{
field: 'creator',
label: '创建者',
},
{
field: 'createTime',
label: '创建时间',
},
{
field: 'title',
label: '标题',
},
{
field: 'updateTime',
label: '更新时间',
},
{
field: 'senderName',
label: '发送者',
},
{
field: 'readDate',
label: '阅读时间',
},
{
field: 'readStatus',
label: '阅读状态',
render: (_, data) => {
return data.readStatus === 0 ? '草稿' : data.readStatus === 1 ? '已读' : '其他';
},
},
{
field: 'type',
label: '类型',
render: (_, data) => {
return data.type === 'NOTICE'
? '公告'
: data.type === 'MEETING'
? '会议'
: data.type === 'OTHER'
? '其他'
: '';
},
},
{
field: 'updater',
label: '更新者',
},
];
export default defineComponent({
components: { Description, PageWrapper },
props: {
emitChildData: {
type: Object,
},
},
setup(props) {
let useDescriptionData: any = ref(null);
watch(
() => props.emitChildData,
async (newV) => {
useDescriptionData.value = newV;
}
);
const [register1] = useDescription({
title: '通知详情',
bordered: false,
data: useDescriptionData,
schema: schema,
});
return { register1 };
},
});
</script>