CatNoticeModal.vue
2.49 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
<template>
<div>
<BasicModal
v-bind="$attrs"
@register="registerModal"
:showFooter="false"
:title="dataSource?.sysNotice?.title"
width="50%"
centered
:showCancelBtn="false"
:showOkBtn="false"
@cancel="handleClose"
>
<PageWrapper dense contentFullHeight contentBackground>
<div class="detail-notice-info">
<span class="mr-6"
><UserOutlined class="mr-2" />发送者:{{ dataSource?.sysNotice?.senderName }}</span
>
<span class="mr-6"
><SolutionOutlined class="mr-2" />通知类型:{{
dataSource?.sysNotice?.type === 'NOTICE'
? '公告'
: dataSource?.sysNotice?.type === 'MEETING'
? '会议'
: dataSource?.sysNotice?.type === 'OTHER'
? '其他'
: ''
}}</span
>
<span class="mr-6"
><FieldTimeOutlined class="mr-2" />发送时间{{ dataSource?.sysNotice.senderDate }}</span
>
</div>
<!--eslint-disable-next-line vue/no-v-html-->
<p v-html="dataSource?.sysNotice?.content"></p>
</PageWrapper>
</BasicModal>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { UserOutlined, SolutionOutlined, FieldTimeOutlined } from '@ant-design/icons-vue';
import { PageWrapper } from '/@/components/Page';
import { notifyMyGetDetailApi } from '/@/api/stationnotification/stationnotifyApi';
export default defineComponent({
name: 'MyNoticeDrawer',
components: { BasicModal, PageWrapper, UserOutlined, SolutionOutlined, FieldTimeOutlined },
emits: ['success', 'register'],
setup(_, { emit }) {
const dataSource = ref();
const [registerModal] = useModalInner(async (data) => {
dataSource.value = data.record;
});
const handleClose = async () => {
// 如果已读,就不刷新表格了
if (unref(dataSource).readStatus === '1') return;
await notifyMyGetDetailApi(unref(dataSource).id);
emit('success');
};
return {
registerModal,
handleClose,
dataSource,
};
},
});
</script>
<style lang="less" scoped>
.detail-notice-info {
color: #999;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding-top: 5px;
padding-bottom: 5px;
margin-bottom: 16px;
}
</style>