hrp-ui-base 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs +1 -1
- package/dist/components.es.js +3595 -1224
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +86 -69
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/api/notice/NoticeController.ts +73 -0
- package/src/api/notice/bo/NoticePageBO.ts +24 -0
- package/src/api/notice/bo/NoticeVO.ts +31 -0
- package/src/assets/layout/avatar-default.svg +6 -0
- package/src/assets/layout/collect-active.svg +7 -0
- package/src/assets/layout/collect-default.svg +7 -0
- package/src/assets/layout/download-active.svg +8 -0
- package/src/assets/layout/download-default.svg +8 -0
- package/src/assets/layout/export-dark.svg +7 -0
- package/src/assets/layout/export-default.svg +7 -0
- package/src/assets/layout/font-active.svg +6 -0
- package/src/assets/layout/font-default.svg +6 -0
- package/src/assets/layout/help-active.svg +10 -0
- package/src/assets/layout/help-default.svg +10 -0
- package/src/assets/layout/home-active.svg +6 -0
- package/src/assets/layout/home.svg +6 -0
- package/src/assets/layout/menu-expand.svg +6 -0
- package/src/assets/layout/menu-icon.png +0 -0
- package/src/assets/layout/menu-position-active.svg +6 -0
- package/src/assets/layout/menu-position-default.svg +6 -0
- package/src/assets/layout/message-active.svg +9 -0
- package/src/assets/layout/message-default.svg +9 -0
- package/src/assets/layout/moon.svg +8 -0
- package/src/assets/layout/router-all-dark.svg +11 -0
- package/src/assets/layout/router-all-default.svg +17 -0
- package/src/assets/layout/search-active.svg +20 -0
- package/src/assets/layout/search-default.svg +20 -0
- package/src/assets/layout/star-active.svg +1 -0
- package/src/assets/layout/star-default.svg +3 -0
- package/src/assets/layout/sun-active.svg +6 -0
- package/src/assets/layout/sun-default.svg +6 -0
- package/src/assets/layout/switch-moon.svg +3 -0
- package/src/assets/layout/switch-sun.svg +41 -0
- package/src/assets/layout/todo-active.svg +12 -0
- package/src/assets/layout/todo-default.svg +12 -0
- package/src/assets/layout/user-dark.svg +13 -0
- package/src/assets/layout/user-default.svg +13 -0
- package/src/components/base-layout/index.vue +198 -0
- package/src/components/layout/SysHeader.vue +90 -0
- package/src/components/layout/SysHeaderLeft.vue +116 -0
- package/src/components/layout/SysHeaderRight.vue +112 -0
- package/src/components/layout/SysHeaderTabs.vue +289 -0
- package/src/components/layout/components/avatar-component.vue +77 -0
- package/src/components/layout/components/dark-component.vue +82 -0
- package/src/components/layout/components/download-component.vue +49 -0
- package/src/components/layout/components/font-size-component.vue +66 -0
- package/src/components/layout/components/menu-position-component.vue +97 -0
- package/src/components/layout/components/message-component.vue +64 -0
- package/src/components/layout/components/todo-component.vue +55 -0
- package/src/components/layout/index.ts +24 -0
- package/src/components/layout/message/message-dictionary.ts +27 -0
- package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/350/223/235.svg +8 -0
- package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/351/273/221.svg +8 -0
- package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245.svg +8 -0
- package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/350/223/235.svg +12 -0
- package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/351/273/221.svg +12 -0
- package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245.svg +12 -0
- package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/350/223/235.svg +8 -0
- package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/351/273/221.svg +8 -0
- package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245.svg +8 -0
- package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/350/223/235.svg +13 -0
- package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/351/273/221.svg +13 -0
- package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245.svg +13 -0
- package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/350/223/235.svg +11 -0
- package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/351/273/221.svg +11 -0
- package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245.svg +11 -0
- package/src/components/layout/message/message-icon//347/251/272/347/212/266/346/200/201.svg +17 -0
- package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/350/223/235.svg +13 -0
- package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/351/273/221.svg +13 -0
- package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245.svg +13 -0
- package/src/components/layout/message/message-notification-drawer.vue +529 -0
- package/src/components/layout/personalization-guide-dialog.vue +255 -0
- package/src/components/layout/sideMenu-global.scss +115 -0
- package/src/components/layout/sideMenu.scss +312 -0
- package/src/components/layout/sideMenu.vue +542 -0
- package/src/components/layout/sideMenuSonList.vue +185 -0
- package/src/components/layout/styles/icon.scss +72 -0
- package/src/components/layout/types.ts +98 -0
- package/src/components.ts +19 -4
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<transition name="slide-left">
|
|
4
|
+
<div id="messageDrawer" v-if="dialogVisible" class="message-drawer el-drawer__body " style="width: 860px;max-width: 80%;height: calc(100%);
|
|
5
|
+
position: fixed;z-index: 1000;right: 0;display: flex;flex-direction: column;
|
|
6
|
+
bottom: 0;top: 0;border-radius: 5px 0 0 5px;" v-loading="formLoading">
|
|
7
|
+
<div class="title-wrapper">
|
|
8
|
+
<span class="msg-tittle">消息通知</span>
|
|
9
|
+
<el-icon size="20" color="#909399" class="closed-dialog-icon" @click="close">
|
|
10
|
+
<CloseBold />
|
|
11
|
+
</el-icon>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="menu-wrapper">
|
|
14
|
+
<el-select style="max-width: 180px;" @focus="focusIcon = false" @visible-change="focusIcon = !focusIcon"
|
|
15
|
+
@change="messageSelectHandler" v-model="notificationType">
|
|
16
|
+
<template #label="{ label, value }">
|
|
17
|
+
<div style="display: flex;align-items: center">
|
|
18
|
+
<el-icon class="el-icon--right" v-if="value === 'all'" style="margin-right: 5px;">
|
|
19
|
+
<img src="./message-icon/全部通知.svg" width="16" height="16" v-if="focusIcon" />
|
|
20
|
+
<img src="./message-icon/全部通知-黑.svg" width="16" height="16" v-else />
|
|
21
|
+
</el-icon>
|
|
22
|
+
<el-icon class="el-icon--right" v-if="value === 'unread'" style="margin-right: 5px;">
|
|
23
|
+
<img src="./message-icon/未读通知.svg" width="16" height="16" v-if="focusIcon" />
|
|
24
|
+
<img src="./message-icon/未读通知-黑.svg" width="16" height="16" v-else />
|
|
25
|
+
</el-icon>
|
|
26
|
+
<el-icon class="el-icon--right" v-if="value === 'approval-notice'" style="margin-right: 5px;">
|
|
27
|
+
<img src="./message-icon/审批通知.svg" width="16" height="16" v-if="focusIcon">
|
|
28
|
+
<img src="./message-icon/审批通知-黑.svg" width="16" height="16" v-else />
|
|
29
|
+
</el-icon>
|
|
30
|
+
<el-icon class="el-icon--right" v-if="value === 'system-notice'" style="margin-right: 5px;">
|
|
31
|
+
<img src="./message-icon/系统通知.svg" width="16" height="16" v-if="focusIcon">
|
|
32
|
+
<img src="./message-icon/系统通知-黑.svg" width="16" height="16" v-else>
|
|
33
|
+
</el-icon>
|
|
34
|
+
<el-icon class="el-icon--right" v-if="value === 'message-notice'" style="margin-right: 5px;">
|
|
35
|
+
<img src="./message-icon/公告通知.svg" width="16" height="16" v-if="focusIcon">
|
|
36
|
+
<img src="./message-icon/公告通知-黑.svg" width="16" height="16" v-else>
|
|
37
|
+
</el-icon>
|
|
38
|
+
<el-icon class="el-icon--right" v-if="value === 'file-notice'" style="margin-right: 5px;">
|
|
39
|
+
<img src="./message-icon/导出通知.svg" width="16" height="16" v-if="focusIcon">
|
|
40
|
+
<img src="./message-icon/导出通知-黑.svg" width="16" height="16" v-else>
|
|
41
|
+
</el-icon>
|
|
42
|
+
<span>{{ label }} </span>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
<el-option v-for="(item) in NOTIFICATION_TYPE" :label="item.name" :key="item.id" :value="item.id">
|
|
46
|
+
<div style="display: flex;align-items: center;" id="selectType">
|
|
47
|
+
<el-icon class="el-icon--right" v-if="item.id === 'all'">
|
|
48
|
+
<img src="./message-icon/全部通知-黑.svg" width="16" height="16" v-if="focusIcon" />
|
|
49
|
+
<img src="./message-icon/全部通知-蓝.svg" width="16" height="16" v-else />
|
|
50
|
+
</el-icon>
|
|
51
|
+
<el-icon class="el-icon--right" v-if="item.id === 'unread'">
|
|
52
|
+
<img src="./message-icon/未读通知-黑.svg" width="16" height="16" v-if="item.id !== notificationType" />
|
|
53
|
+
<img src="./message-icon/未读通知-蓝.svg" width="16" height="16" v-else />
|
|
54
|
+
</el-icon>
|
|
55
|
+
<el-icon class="el-icon--right" v-if="item.id === 'approval-notice'">
|
|
56
|
+
<img src="./message-icon/审批通知-黑.svg" width="16" height="16" v-if="item.id !== notificationType">
|
|
57
|
+
<img src="./message-icon/审批通知-蓝.svg" width="16" height="16" v-else>
|
|
58
|
+
</el-icon>
|
|
59
|
+
<el-icon class="el-icon--right" v-if="item.id === 'system-notice'">
|
|
60
|
+
<img src="./message-icon/系统通知-黑.svg" width="16" height="16" v-if="item.id !== notificationType">
|
|
61
|
+
<img src="./message-icon/系统通知-蓝.svg" width="16" height="16" v-else>
|
|
62
|
+
</el-icon>
|
|
63
|
+
<el-icon class="el-icon--right" v-if="item.id === 'message-notice'">
|
|
64
|
+
<img src="./message-icon/公告通知-黑.svg" width="16" height="16" v-if="item.id !== notificationType">
|
|
65
|
+
<img src="./message-icon/公告通知-蓝.svg" width="16" height="16" v-else>
|
|
66
|
+
</el-icon>
|
|
67
|
+
<el-icon class="el-icon--right" v-if="item.id === 'file-notice'">
|
|
68
|
+
<img src="./message-icon/导出通知-黑.svg" width="16" height="16" v-if="item.id !== notificationType">
|
|
69
|
+
<img src="./message-icon/导出通知-蓝.svg" width="16" height="16" v-else>
|
|
70
|
+
</el-icon>
|
|
71
|
+
<span style="margin-left: 5px">{{ item.name }}</span>
|
|
72
|
+
</div>
|
|
73
|
+
</el-option>
|
|
74
|
+
</el-select>
|
|
75
|
+
<el-dropdown class="example-showcase" trigger="click">
|
|
76
|
+
<span class="el-dropdown-link">
|
|
77
|
+
<el-button plain>
|
|
78
|
+
批量操作
|
|
79
|
+
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
80
|
+
</el-button>
|
|
81
|
+
</span>
|
|
82
|
+
<template #dropdown>
|
|
83
|
+
<el-dropdown-menu>
|
|
84
|
+
<el-dropdown-item id="dropDownReadMenuItem" @click="readNoticeHandler">标记所有为已读</el-dropdown-item>
|
|
85
|
+
<el-dropdown-item id="dropDownReadMenuItem" @click="deleteReadNoticeHandler">删除所有已读通知</el-dropdown-item>
|
|
86
|
+
</el-dropdown-menu>
|
|
87
|
+
</template>
|
|
88
|
+
</el-dropdown>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="list-wrapper" @scroll="handleScroll" v-if="!ifEmpty">
|
|
91
|
+
<div v-for="(item) in noticeVO" :key="item.noticeId" class="message-item" @click="messageItemHandler(item)">
|
|
92
|
+
<el-badge is-dot class="item" :hidden="item.ifRead" style="display: inline-block">
|
|
93
|
+
<div v-if="item.noticeType === 'message-notice'" style="width:20px;height: 20px">
|
|
94
|
+
<img src="./message-icon/公告通知.svg" width="20" height="20" class="message-icon">
|
|
95
|
+
<img src="./message-icon/公告通知-蓝.svg" width="20" height="20" class="message-icon-blue">
|
|
96
|
+
</div>
|
|
97
|
+
<div v-if="item.noticeType === 'approval-notice'" style="width:20px;height: 20px">
|
|
98
|
+
<img src="./message-icon/审批通知.svg" width="20" height="20" class="message-icon">
|
|
99
|
+
<img src="./message-icon/审批通知-蓝.svg" width="20" height="20" class="message-icon-blue">
|
|
100
|
+
</div>
|
|
101
|
+
<div v-if="item.noticeType === 'file-notice'" style="width:20px;height: 20px">
|
|
102
|
+
<img src="./message-icon/导出通知.svg" width="20" height="20" class="message-icon">
|
|
103
|
+
<img src="./message-icon/导出通知-蓝.svg" width="20" height="20" class="message-icon-blue">
|
|
104
|
+
</div>
|
|
105
|
+
<div v-if="item.noticeType === 'system-notice'" style="width:20px;height: 20px">
|
|
106
|
+
<img src="./message-icon/系统通知.svg" width="20" height="20" class="message-icon">
|
|
107
|
+
<img src="./message-icon/系统通知-蓝.svg" width="20" height="20" class="message-icon-blue">
|
|
108
|
+
</div>
|
|
109
|
+
</el-badge>
|
|
110
|
+
<div class="message-info ">
|
|
111
|
+
<div class="flex-between">
|
|
112
|
+
<span :class="item.ifRead ? 'noticeType-color-read' : 'noticeType-color'" class="message-title">{{
|
|
113
|
+
item.noticeTitle
|
|
114
|
+
}}</span>
|
|
115
|
+
<el-icon color="#909399 " size="17" class="closed-icon" @click.stop="deleteNoticeInfoByNoticeIds(item)">
|
|
116
|
+
<CloseBold />
|
|
117
|
+
</el-icon>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="message-content"
|
|
120
|
+
:class="item.ifRead ? 'message-content-color-read' : 'message-content-color'">
|
|
121
|
+
{{ item.noticeContent }}
|
|
122
|
+
</div>
|
|
123
|
+
<div style="height: 24px;width: 100%;font-size: var(--font-size-description);" class="flex-between">
|
|
124
|
+
<div :class="item.ifRead ? 'noticeFoot-color-read' : 'noticeFoot-color'">{{ item.noticeTime ?
|
|
125
|
+
getTime(item.noticeTime) : '年月日' }}</div>
|
|
126
|
+
<el-button plain type="primary" size="small" class="export-btn" v-if="item.noticeType === 'file-notice'"
|
|
127
|
+
@click.stop="downloadHandler(item)"><span
|
|
128
|
+
style="font-size:var(--font-size-description)">去下载</span></el-button>
|
|
129
|
+
<el-button plain type="primary" size="small" class="export-btn" v-if="item.noticeType !== 'file-notice'"
|
|
130
|
+
@click.stop="messageItemHandler(item)"><span
|
|
131
|
+
style="font-size: var(--font-size-description)">查看详情</span></el-button>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="foot-text" v-if="ifText" v-loading="moreLoading">
|
|
136
|
+
<span class="foot-text-more" v-if="ifTextMore" @click="getMore">查看更多</span>
|
|
137
|
+
<span v-else>已经没有更多消息了</span>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<div v-else
|
|
141
|
+
style="flex-grow: 1;display: flex;justify-content: center;align-items: center;flex-direction: column">
|
|
142
|
+
<img src="./message-icon/空状态.svg" width="320px" height="320px">
|
|
143
|
+
<div class="foot-text"><span>已经没有更多消息了</span></div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</transition>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<script setup lang="ts">
|
|
151
|
+
import { ref, watch, inject } from "vue";
|
|
152
|
+
import { ArrowDown, CloseBold } from '@element-plus/icons-vue'
|
|
153
|
+
import { NOTIFICATION_TYPE } from "./message-dictionary";
|
|
154
|
+
import NoticeController from "../../../api/notice/NoticeController";
|
|
155
|
+
import type NoticePageBO from "../../../api/notice/bo/NoticePageBO";
|
|
156
|
+
import type NoticeVO from "../../../api/notice/bo/NoticeVO";
|
|
157
|
+
import moment from "moment";
|
|
158
|
+
import { ElMessage } from "element-plus";
|
|
159
|
+
|
|
160
|
+
const emit = defineEmits<{
|
|
161
|
+
(e: 'close'): void
|
|
162
|
+
(e: 'update-count'): void
|
|
163
|
+
(e: 'navigate', notice: NoticeVO): void
|
|
164
|
+
(e: 'download', notice: NoticeVO): void
|
|
165
|
+
}>()
|
|
166
|
+
|
|
167
|
+
const formLoading = ref<boolean>(false)
|
|
168
|
+
const moreLoading = ref<boolean>(false)
|
|
169
|
+
const dialogVisible = ref<boolean>(false)
|
|
170
|
+
const notificationType = ref<string>('all')
|
|
171
|
+
const ifEmpty = ref<boolean>(false)
|
|
172
|
+
const ifText = ref<boolean>(false)
|
|
173
|
+
const ifTextMore = ref<boolean>(false)
|
|
174
|
+
const focusIcon = ref<boolean>(false)
|
|
175
|
+
|
|
176
|
+
/** 打开弹窗 */
|
|
177
|
+
const open = async () => {
|
|
178
|
+
formLoading.value = true
|
|
179
|
+
dialogVisible.value = true
|
|
180
|
+
resetForm()
|
|
181
|
+
await selectNoticePage()
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const handleScroll = async (e: any) => {}
|
|
185
|
+
|
|
186
|
+
/** 点击加载更多 */
|
|
187
|
+
const getMore = async () => {
|
|
188
|
+
if (total.value > noticePageBO.value.offset + 10) {
|
|
189
|
+
moreLoading.value = true
|
|
190
|
+
noticePageBO.value.offset += 10
|
|
191
|
+
await selectNoticePage()
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** 查询条件 */
|
|
196
|
+
const noticePageBO = ref<NoticePageBO>({
|
|
197
|
+
noticeType: '',
|
|
198
|
+
timeStamp: '',
|
|
199
|
+
offset: 0,
|
|
200
|
+
pageSize: 10,
|
|
201
|
+
pageNum: 1
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
/** 消息数组 */
|
|
205
|
+
const noticeVO = ref<NoticeVO[]>([])
|
|
206
|
+
const total = ref<number>(0)
|
|
207
|
+
|
|
208
|
+
/** 获得消息分页数组函数 */
|
|
209
|
+
const selectNoticePage = async () => {
|
|
210
|
+
noticePageBO.value.noticeType = notificationType.value
|
|
211
|
+
noticePageBO.value.timeStamp = moment.unix(moment().unix()).format("YYYY-MM-DD HH:mm:ss")
|
|
212
|
+
await NoticeController.selectNoticePage(noticePageBO.value).then(data => {
|
|
213
|
+
if (data.code === 200 && data.res) {
|
|
214
|
+
if (data.res.records) {
|
|
215
|
+
noticeVO.value.push(...data.res.records)
|
|
216
|
+
}
|
|
217
|
+
total.value = data.res.total
|
|
218
|
+
ifEmpty.value = noticeVO.value.length === 0
|
|
219
|
+
ifText.value = true
|
|
220
|
+
ifTextMore.value = total.value > noticePageBO.value.offset + 10
|
|
221
|
+
} else if (data.code === 200 && data.res === null) {
|
|
222
|
+
noticeVO.value = []
|
|
223
|
+
ifEmpty.value = true
|
|
224
|
+
ifText.value = true
|
|
225
|
+
ifTextMore.value = total.value > noticePageBO.value.offset + 10
|
|
226
|
+
}
|
|
227
|
+
}).finally(() => {
|
|
228
|
+
formLoading.value = false
|
|
229
|
+
moreLoading.value = false
|
|
230
|
+
})
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** 获得时间 */
|
|
234
|
+
const getTime = (dateString: string) => {
|
|
235
|
+
let date = new Date(dateString)
|
|
236
|
+
return date.getFullYear() + "年" +
|
|
237
|
+
("0" + (date.getMonth() + 1)).slice(-2) + "月" +
|
|
238
|
+
("0" + date.getDate()).slice(-2) + "日 " +
|
|
239
|
+
date.getHours() + ":" +
|
|
240
|
+
("0" + date.getMinutes()).slice(-2);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// 给整个文档添加点击事件监听器
|
|
244
|
+
document.addEventListener('mouseup', function (event: any) {
|
|
245
|
+
let target = event.target;
|
|
246
|
+
let closeDom = document.querySelectorAll('.el-notification__closeBtn')
|
|
247
|
+
if (closeDom) {
|
|
248
|
+
for (let i = 0; i < closeDom.length; i++) {
|
|
249
|
+
closeDom[i].id = 'el-notification__closeBtn'
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
while (target && target.id !== 'tourMessageId' && target.id !== 'selectType'
|
|
253
|
+
&& target.id !== 'el-notification__closeBtn'
|
|
254
|
+
&& target.id !== 'dropDownReadMenuItem' && target.id !== 'messageDrawer') {
|
|
255
|
+
target = target.parentNode;
|
|
256
|
+
}
|
|
257
|
+
if (!target) {
|
|
258
|
+
close()
|
|
259
|
+
}
|
|
260
|
+
}, true);
|
|
261
|
+
|
|
262
|
+
/** 修改消息类型函数*/
|
|
263
|
+
const messageSelectHandler = async () => {
|
|
264
|
+
noticePageBO.value.pageNum = 1
|
|
265
|
+
noticeVO.value = []
|
|
266
|
+
noticePageBO.value.offset = 0
|
|
267
|
+
ifText.value = false
|
|
268
|
+
formLoading.value = true
|
|
269
|
+
await selectNoticePage()
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** 删除单个消息函数*/
|
|
273
|
+
const deleteNoticeInfoByNoticeIds = (e: NoticeVO) => {
|
|
274
|
+
NoticeController.deleteNoticeInfoByNoticeIds([e.noticeId]).then(data => {
|
|
275
|
+
if (data.code === 200 && data) {
|
|
276
|
+
noticeVO.value = noticeVO.value.filter(item => item.noticeId !== e.noticeId)
|
|
277
|
+
noticePageBO.value.offset = noticePageBO.value.offset - 1
|
|
278
|
+
ifEmpty.value = noticeVO.value.length === 0 && !ifTextMore.value
|
|
279
|
+
emit('update-count')
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** 标记所有为已读*/
|
|
285
|
+
const readNoticeHandler = async () => {
|
|
286
|
+
await NoticeController.readNoticeInfoByNoticeType(notificationType.value).then(async (data) => {
|
|
287
|
+
if (data.code === 200 && data) {
|
|
288
|
+
noticeVO.value = []
|
|
289
|
+
noticePageBO.value.pageNum = 1
|
|
290
|
+
noticePageBO.value.offset = 0
|
|
291
|
+
await selectNoticePage()
|
|
292
|
+
emit('update-count')
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/** 删除所有已读通知*/
|
|
298
|
+
const deleteReadNoticeHandler = async () => {
|
|
299
|
+
await NoticeController.deleteReadNoticeInfoByNoticeType(notificationType.value).then(async (data) => {
|
|
300
|
+
if (data.code === 200 && data) {
|
|
301
|
+
ElMessage({ type: 'success', message: '删除成功' })
|
|
302
|
+
noticeVO.value = []
|
|
303
|
+
noticePageBO.value.pageNum = 1
|
|
304
|
+
noticePageBO.value.offset = 0
|
|
305
|
+
await selectNoticePage()
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** 点击跳转通知详情 - 通过事件通知 scm 处理路由跳转 */
|
|
311
|
+
const messageItemHandler = async (e: NoticeVO) => {
|
|
312
|
+
await NoticeController.readNoticeInfo(e.noticeId)
|
|
313
|
+
e.ifRead = true
|
|
314
|
+
emit('navigate', e)
|
|
315
|
+
emit('update-count')
|
|
316
|
+
close()
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** 文件下载 - 通过事件通知 scm 处理 */
|
|
320
|
+
const downloadHandler = async (e: NoticeVO) => {
|
|
321
|
+
if (!e.ifRead) {
|
|
322
|
+
e.ifRead = true
|
|
323
|
+
await NoticeController.readNoticeInfo(e.noticeId)
|
|
324
|
+
emit('update-count')
|
|
325
|
+
}
|
|
326
|
+
emit('download', e)
|
|
327
|
+
close()
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** 表单重置 */
|
|
331
|
+
const resetForm = () => {
|
|
332
|
+
notificationType.value = 'all'
|
|
333
|
+
noticePageBO.value.pageNum = 1
|
|
334
|
+
noticePageBO.value.offset = 0
|
|
335
|
+
noticePageBO.value.timeStamp = ''
|
|
336
|
+
noticeVO.value = []
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/** 抽屉关闭 */
|
|
340
|
+
const close = () => {
|
|
341
|
+
dialogVisible.value = false
|
|
342
|
+
emit('close')
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
defineExpose({ open, close })
|
|
346
|
+
|
|
347
|
+
/** 获得messageInfo - 外部注入新通知 */
|
|
348
|
+
let messageInfo = inject('messageInfo', ref<NoticeVO>({
|
|
349
|
+
noticeId: '',
|
|
350
|
+
noticeType: '',
|
|
351
|
+
noticeContent: '',
|
|
352
|
+
noticeTitle: '',
|
|
353
|
+
urlRoute: '',
|
|
354
|
+
ifRead: false,
|
|
355
|
+
noticeTime: ''
|
|
356
|
+
}))
|
|
357
|
+
|
|
358
|
+
watch(() => { return messageInfo.value }, (value) => {
|
|
359
|
+
if (messageInfo.value.noticeType === notificationType.value
|
|
360
|
+
|| notificationType.value === 'all' || notificationType.value === 'unread') {
|
|
361
|
+
noticeVO.value.unshift(messageInfo.value)
|
|
362
|
+
ifEmpty.value = noticeVO.value.length === 0
|
|
363
|
+
}
|
|
364
|
+
}, { immediate: true, deep: true })
|
|
365
|
+
</script>
|
|
366
|
+
|
|
367
|
+
<style scoped lang="scss">
|
|
368
|
+
.slide-left-enter-active,
|
|
369
|
+
.slide-left-leave-active {
|
|
370
|
+
transition: all 0.7s ease;
|
|
371
|
+
}
|
|
372
|
+
.slide-left-enter-from {
|
|
373
|
+
transform: translateX(100%);
|
|
374
|
+
}
|
|
375
|
+
.slide-left-leave-to {
|
|
376
|
+
transform: translateX(100%);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.flex-between {
|
|
380
|
+
display: flex;
|
|
381
|
+
justify-content: space-between;
|
|
382
|
+
align-items: center;
|
|
383
|
+
margin-bottom: 5px;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.message-drawer {
|
|
387
|
+
background-color: var(--custom-theme-fill-7);
|
|
388
|
+
box-shadow: -1px 0px 4px 1px rgba(144, 147, 153, 0.2);
|
|
389
|
+
|
|
390
|
+
.title-wrapper {
|
|
391
|
+
padding: 10px;
|
|
392
|
+
display: flex;
|
|
393
|
+
justify-content: space-between;
|
|
394
|
+
align-items: center;
|
|
395
|
+
|
|
396
|
+
.msg-tittle {
|
|
397
|
+
font-size: var(--font-size-h1);
|
|
398
|
+
font-weight: bold;
|
|
399
|
+
color: var(--custom-theme-text-2)
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.menu-wrapper {
|
|
404
|
+
padding: 10px;
|
|
405
|
+
display: flex;
|
|
406
|
+
justify-content: space-between;
|
|
407
|
+
width: 100%;
|
|
408
|
+
border-bottom: var(--custom-theme-border-4) 1px solid;
|
|
409
|
+
flex-shrink: 0;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.list-wrapper {
|
|
413
|
+
display: flex;
|
|
414
|
+
flex-direction: column;
|
|
415
|
+
flex-grow: 1;
|
|
416
|
+
overflow: scroll;
|
|
417
|
+
box-sizing: border-box;
|
|
418
|
+
|
|
419
|
+
.message-item {
|
|
420
|
+
display: flex;
|
|
421
|
+
justify-content: flex-start;
|
|
422
|
+
padding: 10px;
|
|
423
|
+
border-bottom: var(--custom-theme-border-4) 1px solid;
|
|
424
|
+
|
|
425
|
+
.message-icon-blue,
|
|
426
|
+
.export-btn,
|
|
427
|
+
.closed-icon {
|
|
428
|
+
display: none;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.message-info {
|
|
432
|
+
margin-left: 5px;
|
|
433
|
+
display: inline-block;
|
|
434
|
+
width: calc(100% - 35px);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.message-content {
|
|
438
|
+
margin: 8px 0;
|
|
439
|
+
overflow: hidden;
|
|
440
|
+
text-overflow: ellipsis;
|
|
441
|
+
white-space: nowrap;
|
|
442
|
+
width: 100%;
|
|
443
|
+
font-size: var(--font-size-description);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.message-title {
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
text-overflow: ellipsis;
|
|
449
|
+
white-space: nowrap;
|
|
450
|
+
width: 100%;
|
|
451
|
+
font-size: var(--font-size-body);
|
|
452
|
+
font-weight: bold;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.message-content-color {
|
|
456
|
+
color: var(--custom-theme-text-1);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.message-content-color-read {
|
|
460
|
+
color: var(--el-color-info);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.message-item:hover {
|
|
465
|
+
cursor: pointer;
|
|
466
|
+
}
|
|
467
|
+
.message-item:hover .message-icon {
|
|
468
|
+
display: none;
|
|
469
|
+
}
|
|
470
|
+
.message-item:hover .message-icon-blue {
|
|
471
|
+
display: block;
|
|
472
|
+
}
|
|
473
|
+
.message-item:hover .export-btn {
|
|
474
|
+
display: block;
|
|
475
|
+
}
|
|
476
|
+
.message-item:hover .closed-icon {
|
|
477
|
+
display: block;
|
|
478
|
+
}
|
|
479
|
+
.message-item:hover {
|
|
480
|
+
background-color: var(--custom-theme-fill-4);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.closed-dialog-icon:hover {
|
|
485
|
+
cursor: pointer;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.foot-text {
|
|
489
|
+
font-size: var(--font-size-body);
|
|
490
|
+
color: var(--custom-theme-info-normal);
|
|
491
|
+
display: flex;
|
|
492
|
+
justify-content: center;
|
|
493
|
+
margin: 10px 0
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.foot-text-more:hover {
|
|
497
|
+
cursor: pointer;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.noticeType-color {
|
|
501
|
+
color: var(--custom-theme-text-2);
|
|
502
|
+
}
|
|
503
|
+
.noticeType-color-read {
|
|
504
|
+
color: var(--custom-theme-text-4);
|
|
505
|
+
}
|
|
506
|
+
.noticeFoot-color {
|
|
507
|
+
color: var(--custom-theme-text-3);
|
|
508
|
+
}
|
|
509
|
+
.noticeFoot-color-read {
|
|
510
|
+
color: var(--custom-theme-text-5);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
</style>
|
|
514
|
+
<style lang="scss">
|
|
515
|
+
.message-drawer {
|
|
516
|
+
.el-drawer__header {
|
|
517
|
+
margin-bottom: 0;
|
|
518
|
+
border-bottom: var(--custom-theme-border-4) 1px solid;
|
|
519
|
+
padding-bottom: 5px
|
|
520
|
+
}
|
|
521
|
+
.el-drawer__body {
|
|
522
|
+
padding: 10px;
|
|
523
|
+
box-sizing: border-box;
|
|
524
|
+
display: flex;
|
|
525
|
+
flex-direction: column;
|
|
526
|
+
flex: 1;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
</style>
|