You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

857 lines
24 KiB

8 months ago
8 months ago
8 months ago
3 months ago
5 months ago
5 months ago
5 months ago
8 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
  1. <script setup>
  2. import {computed, onMounted, ref} from 'vue'
  3. import {useRoute, useRouter} from 'vue-router'
  4. import {ElMessage} from 'element-plus'
  5. import ChangePassword from '@/components/dialogs/changePassword.vue'
  6. import LanguageSwitch from '@/components/dialogs/LanguageSwitch.vue' // 语言切换
  7. import {useAdminStore} from '@/store'
  8. import {storeToRefs} from 'pinia'
  9. import {filterMenu, getRoutePath} from "@/utils/menuUtils.js";
  10. import API from '@/util/http.js'
  11. import bell from '@/assets/SvgIcons/bell.svg'
  12. import noMessage from '@/assets/images/no-message.svg'
  13. import goTop from '@/assets/SvgIcons/go-top.svg'
  14. import {getOrderPage} from '@/utils/goToCheck.js'
  15. import {groupMessages} from "@/utils/getMessage.js"
  16. import {findMenuById,permissionMapping} from "@/utils/menuTreePermission.js"
  17. import {useMessageStore} from '@/store/index.js'
  18. // 国际化
  19. import { useI18n } from 'vue-i18n'
  20. const {t} = useI18n();
  21. // ------------------ ICONS ------------------
  22. const icons = import.meta.glob('@/assets/SvgIcons/*.svg', {eager: true})
  23. const menuNameMap = {
  24. '2': 'workbench', // 工作台
  25. '3': 'gold-management', //金币管理
  26. '58': 'cash-management', //现金管理
  27. '119': 'activity-management', //活动管理
  28. '124': 'channel-management', //频道管理
  29. '128': 'permission-management', //权限管理
  30. '146': 'mutiple-language', //多语言配置
  31. }
  32. const getIconPath = (menuNameId) => {
  33. const englishName = menuNameMap[menuNameId] || menuNameId;
  34. const possibleKeys = [
  35. `@/assets/SvgIcons/${englishName}.svg`,
  36. `./SvgIcons/${englishName}.svg`,
  37. `/src/assets/SvgIcons/${englishName}.svg`
  38. ]
  39. for (const key of possibleKeys) {
  40. if (icons[key]) {
  41. const iconModule = icons[key]
  42. return iconModule.default || iconModule
  43. }
  44. }
  45. }
  46. // ------------------ 语言切换 ------------------
  47. const languageSwitchRef = ref()
  48. const openLanguageSwitch = () => {
  49. languageSwitchRef.value?.open()
  50. }
  51. const handleLanguageChanged = (lang) => {
  52. ElMessage.success(t('elmessage.languageChangedSuccess', { lang }))
  53. }
  54. // ------------------ 刷新数据 ------------------
  55. const refreshData = async () => {
  56. try {
  57. ElMessage({ message: t('elmessage.refreshLoading'), type: 'info' })
  58. const response = await API({url: '/Mysql', method: 'POST', data: {}});
  59. if (response && response.code === 200) {
  60. const currentRoute = route.fullPath;
  61. router.replace('/blank');
  62. setTimeout(() => router.replace(currentRoute), 10);
  63. ElMessage.success(t('elmessage.refreshSuccess'))
  64. } else {
  65. ElMessage.error(t('elmessage.refreshFailed', { msg: response?.msg || t('elmessage.unknownError') }))
  66. }
  67. } catch (error) {
  68. console.error(error)
  69. ElMessage.error(t('elmessage.refreshError'))
  70. }
  71. }
  72. // ------------------ 菜单逻辑 ------------------
  73. const route = useRoute()
  74. const router = useRouter()
  75. const adminStore = useAdminStore()
  76. const {adminData, menuTree, flag} = storeToRefs(adminStore)
  77. const menuList = ref(filterMenu(menuTree.value))
  78. function findBestMatch(menuList, path) {
  79. let bestMatch = ''
  80. function traverse(menus) {
  81. for (const item of menus) {
  82. const itemPath = getRoutePath(item)
  83. if (path.startsWith(itemPath) && itemPath.length > bestMatch.length) {
  84. bestMatch = itemPath
  85. }
  86. if (item.children?.length) traverse(item.children)
  87. }
  88. }
  89. traverse(menuList)
  90. return bestMatch || path
  91. }
  92. const activeMenu = computed(() => findBestMatch(menuList.value, route.path))
  93. // ------------------ 用户信息 / 密码修改 ------------------
  94. const messageVisible = ref(false)
  95. const openMessage = () => (messageVisible.value = true)
  96. const closeMessage = () => (messageVisible.value = false)
  97. const message = function () {
  98. openMessage()
  99. }
  100. const showPasswordDialog = ref(false)
  101. const pwdRef = ref()
  102. const openChangePassword = () => (showPasswordDialog.value = true)
  103. const onPwdDialogClosed = () => pwdRef.value?.resetFields()
  104. // ------------------ 退出登录 ------------------
  105. function logout() {
  106. const machineId = localStorage.getItem('machineId')
  107. localStorage.removeItem('token')
  108. adminStore.clearState()
  109. router.push('/login?machineId=' + machineId)
  110. ElMessage.success(t('elmessage.logoutSuccess'))
  111. }
  112. // ------------------ 员工数据开关 ------------------
  113. const toggleFlag = () => {
  114. const newFlag = flag.value === 1 ? 0 : 1
  115. adminStore.setFlag(newFlag)
  116. ElMessage.success(newFlag === 1 ? t('elmessage.staffHidden') : t('elmessage.staffShown'))
  117. }
  118. // ------------------ 消息中心(完全修复版) ------------------
  119. const messageStore = useMessageStore()
  120. const {messages} = storeToRefs(messageStore)
  121. //根据用户id查询消息状态
  122. const selectStatusById = () => {
  123. // 定义权限检查函数
  124. const hasPermission = (permission) => findMenuById(menuTree.value, permission);
  125. // 初始化状态数组
  126. const status = [];
  127. // ===== 收款流程状态 =====
  128. // 地区财务收款待审核
  129. if (hasPermission(permissionMapping.area_finance_collection_pending)) {
  130. status.push(0);
  131. }
  132. //地区客服收款
  133. if (hasPermission(permissionMapping.collection_area_submit)) {
  134. status.push(2);
  135. }
  136. // 地区负责人收款待审核
  137. // else if (hasPermission(permissionMapping.area_manager_collection_pending)) {
  138. // status.push(0);
  139. // }
  140. // ===== 退款流程状态 =====
  141. // 地区财务退款审核
  142. if (hasPermission(permissionMapping.audit_area_finance_refund)) {
  143. status.push(10);
  144. }
  145. // 地区负责人退款审核
  146. if (hasPermission(permissionMapping.audit_area_manager_refund)) {
  147. status.push(20);
  148. }
  149. // 总部财务退款审核
  150. if (hasPermission(permissionMapping.audit_headquarters_refund)) {
  151. status.push(30);
  152. }
  153. // 执行人待处理
  154. if (hasPermission(permissionMapping.view_execution_details)) {
  155. status.push(40);
  156. }
  157. //地区客服退款审核驳回
  158. if (hasPermission(permissionMapping.refund_area_cash)) {
  159. status.push(12,22,32);
  160. }
  161. // 去重并返回结果(单一角色下实际不会有重复)
  162. return [...new Set(status)];
  163. };
  164. console.log('权限测试',selectStatusById());
  165. // 获取消息
  166. const getMessage = async () => {
  167. console.log('权限测试',displayMessages);
  168. try {
  169. let params = {status: selectStatusById()};
  170. console.log('权限测试============',params);
  171. localStorage.setItem('status',params.status)
  172. const res = await API({
  173. url: '/getMessage',
  174. method: 'POST',
  175. data: params
  176. });
  177. if (res?.data) {
  178. const cleanList = res.data.filter(i => i.flag !== 1)
  179. messageStore.setMessages(cleanList)
  180. }
  181. } catch (e) {
  182. console.error("getMessage error:", e)
  183. }
  184. }
  185. // 点击铃铛 → 打开弹窗并刷新
  186. const showMessageDialog = ref(false)
  187. const openMessageDialog = async () => {
  188. showMessageDialog.value = true
  189. await getMessage() // 等待消息更新
  190. }
  191. // 关闭消息窗口
  192. const closeMessageDialog = () => showMessageDialog.value = false
  193. // 小红点(完全响应式)
  194. const messageDot = computed(() => messages.value.length > 0)
  195. // 消息数量(完全响应式)
  196. const messageNum = computed(() => messages.value.length)
  197. // 按日期分组(computed)
  198. const messageList = computed(() => groupMessages(messages.value))
  199. // 按日期生成最终结构(computed)
  200. const groupedMessages = computed(() => {
  201. const result = {}
  202. messageList.value.forEach(item => {
  203. if (!result[item.group]) result[item.group] = []
  204. result[item.group].push(item)
  205. })
  206. return result
  207. })
  208. // 显示全部 or 显示前两条
  209. const showAll = ref(false)
  210. const displayMessages = computed(() => {
  211. if (showAll.value) return groupedMessages.value
  212. let count = 0
  213. const limited = {}
  214. const groupOrderKeys = ['today', 'yesterday', 'earlier']
  215. for (const key of groupOrderKeys) {
  216. const label = t(`home.messageGroups.${key}`)
  217. const group = groupedMessages.value[label]
  218. if (!group) continue
  219. limited[label] = []
  220. for (const item of group) {
  221. if (count < 2) {
  222. limited[label].push(item)
  223. count++
  224. }
  225. }
  226. if (limited[label].length === 0) delete limited[label]
  227. if (count >= 2) break
  228. }
  229. return limited
  230. })
  231. const toggleShowAll = () => showAll.value = !showAll.value
  232. // 返回顶部
  233. const scrollContainer = ref(null)
  234. const scrollToTop = () => scrollContainer.value?.scrollTo({top: 0, behavior: 'smooth'})
  235. // 点击消息 → 已读 + 跳转
  236. const handleMessageClick = async (item) => {
  237. const res = await API({
  238. url: '/getMessage/update',
  239. method: 'POST',
  240. data: {id: item.id}
  241. });
  242. if (res.code === 200) {
  243. closeMessageDialog()
  244. await router.push(getOrderPage(item.status))
  245. await getMessage()
  246. ElMessage.success(t('elmessage.jumpSuccess'))
  247. } else {
  248. ElMessage.error(t('elmessage.jumpFailed'))
  249. }
  250. }
  251. onMounted(() => getMessage())
  252. </script>
  253. <template>
  254. <div class="main-container">
  255. <!-- 背景毛玻璃层作为内容容器 -->
  256. <div class="background-glass">
  257. <!-- 侧边栏 -->
  258. <div class="sidebar-container">
  259. <el-aside class="sidebar-layout">
  260. <div class="logo">
  261. <img src="../assets/logo.png" alt="logo" style="width: 9vh; height: 9vh"/>
  262. </div>
  263. <div class="menu-scroll-container">
  264. <el-menu :router="true" :default-active="activeMenu" style="min-height: 80vh;border:none;">
  265. <!-- 递归渲染菜单层级 -->
  266. <template v-for="menu in menuList" :key="menu.id">
  267. <!-- 有子菜单的父级菜单menuType=2 且存在children -->
  268. <el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.id.toString()">
  269. <template #title>
  270. <img
  271. :src="getIconPath(menu.id)"
  272. :alt="`${menu.menuName}图标`"
  273. style="width: 4vh; height: 4vh; margin-right: 4px;"
  274. >
  275. <span class="menu-item-text">{{ menu.menuName }}</span>
  276. </template>
  277. <!-- 子菜单 -->
  278. <template v-for="child in menu.children" :key="child.id">
  279. <!-- 子菜单为叶子节点无children -->
  280. <el-menu-item v-if="!child.children || child.children.length === 0" :index="getRoutePath(child)">
  281. <el-icon style="margin-right: 4px;">
  282. <Folder/>
  283. </el-icon>
  284. <span class="menu-item-text">{{ child.menuName }}</span>
  285. </el-menu-item>
  286. <!-- 子菜单有下级 -->
  287. <el-sub-menu v-else :index="child.id.toString()">
  288. <template #title>
  289. <el-icon style="margin-right: 4px;">
  290. <Folder/>
  291. </el-icon>
  292. <span class="menu-item-text">{{ child.menuName }}</span>
  293. </template>
  294. <!-- 递归 下一级-->
  295. <template v-for="grandChild in child.children" :key="grandChild.id">
  296. <el-menu-item :index="getRoutePath(grandChild)">
  297. <el-icon style="margin-right: 4px;">
  298. <Folder/>
  299. </el-icon>
  300. <span class="menu-item-text">{{ grandChild.menuName }}</span>
  301. </el-menu-item>
  302. </template>
  303. </el-sub-menu>
  304. </template>
  305. </el-sub-menu>
  306. <!-- 无子菜单的一级菜单 -->
  307. <el-menu-item v-else :index="getRoutePath(menu)">
  308. <img
  309. :src="getIconPath(menu.id)"
  310. :alt="`${menu.menuName}图标`"
  311. style="width: 4vh; height: 4vh; margin-right: 4px;"
  312. >
  313. <span class="menu-item-text">{{ menu.menuName }}</span>
  314. </el-menu-item>
  315. </template>
  316. </el-menu>
  317. </div>
  318. <div style="display: flex">
  319. <!-- 底部固定的设置中心 -->
  320. <div class="settings-container">
  321. <el-dropdown placement="top-start">
  322. <span class="el-dropdown-link">
  323. <!-- 暂时使用静态路径确保设置图标正常显示 -->
  324. <img src="@/assets/SvgIcons/setting.svg" :alt="t('home.settingsCenter')" style="width: 4vh; height: 4vh"/>
  325. <span>{{ t('home.settingsCenter') }}</span>
  326. <el-icon class="arrow-icon">
  327. <ArrowUp/>
  328. </el-icon>
  329. </span>
  330. <template #dropdown>
  331. <el-dropdown-menu>
  332. <!-- <el-dropdown-item @click="refreshData()">数据刷新</el-dropdown-item>-->
  333. <el-dropdown-item @click="openLanguageSwitch">{{ t('home.languageSwitch') }}</el-dropdown-item>
  334. <el-dropdown-item @click="toggleFlag()">
  335. {{ flag === 1 ? t('home.showStaffData') : t('home.hideStaffData') }}
  336. </el-dropdown-item>
  337. <el-dropdown-item @click="message()">{{ t('home.viewProfile') }}</el-dropdown-item>
  338. <el-dropdown-item @click="openChangePassword">{{ t('home.changePassword') }}</el-dropdown-item>
  339. <el-dropdown-item @click="logout">{{ t('home.logout') }}</el-dropdown-item>
  340. </el-dropdown-menu>
  341. </template>
  342. </el-dropdown>
  343. </div>
  344. <!-- 消息提示 这里的 小红点不用el-badge 他在切换状态会抽一下 应该是dom问题 -->
  345. <div class="message-container">
  346. <div style="position: relative;">
  347. <el-image :src="bell" style="width: 28px; height: 28px;" @click="openMessageDialog"></el-image>
  348. <span v-show="messageDot" class="dot"></span>
  349. </div>
  350. </div>
  351. </div>
  352. </el-aside>
  353. </div>
  354. <!-- 右侧内容区域 -->
  355. <div class="content-container">
  356. <!-- 头部
  357. <el-header class="header">
  358. </el-header> -->
  359. <!-- 主内容区域 -->
  360. <div class="main-area">
  361. <el-main>
  362. <router-view></router-view>
  363. </el-main>
  364. </div>
  365. </div>
  366. </div>
  367. <!-- 查看个人信息 -->
  368. <el-dialog v-model="messageVisible" :title="t('home.viewProfile')" width="500px">
  369. <el-form :model="adminData">
  370. <el-form-item :label="t('home.dialog.userName')" label-width="100px" label-position="left">
  371. <span class="message-font">{{ adminData.adminName }}</span>
  372. </el-form-item>
  373. <el-form-item :label="t('home.dialog.jwcode')" label-width="100px" label-position="left">
  374. <span class="message-font">{{ adminData.account }}</span>
  375. </el-form-item>
  376. <el-form-item :label="t('home.dialog.market')" label-width="100px" label-position="left">
  377. <span class="message-font">{{ adminData.markets }}</span>
  378. </el-form-item>
  379. <el-form-item :label="t('home.dialog.registerTime')" label-width="100px" label-position="left">
  380. <span class="message-font">{{ adminData.createTime }}</span>
  381. </el-form-item>
  382. </el-form>
  383. <template #footer>
  384. <div>
  385. <el-button text @click="closeMessage()">{{ t('common_export.close') }}</el-button>
  386. </div>
  387. </template>
  388. </el-dialog>
  389. <!-- 自定义密码修改弹窗组件 -->
  390. <el-dialog v-model="showPasswordDialog" :center="true" width="470px" @closed="onPwdDialogClosed">
  391. <ChangePassword ref="pwdRef" @confirm="showPasswordDialog = false"/>
  392. </el-dialog>
  393. <!--消息推送的弹窗-->
  394. <el-dialog style="background: #F3FAFE" v-model="showMessageDialog" title="" width="500px">
  395. <div class="message-title">
  396. <el-divider
  397. class="divider"
  398. direction="vertical"
  399. ></el-divider>
  400. {{ t('home.messageCenter') }} ({{ messageNum }})
  401. </div>
  402. <!-- todo 这是为了样式显示 一定要改逻辑-->
  403. <div v-if="messageNum === 0">
  404. <div class="no-message">
  405. <el-image :src="noMessage"></el-image>
  406. <p class="no-message-text">{{ t('home.noMessage') }}</p>
  407. </div>
  408. </div>
  409. <div v-else
  410. ref="scrollContainer"
  411. style="max-height: 60vh; overflow-y: auto;">
  412. <!-- 按时间分组的消息列表 -->
  413. <div
  414. v-for="(group, time) in displayMessages"
  415. :key="time"
  416. style="margin-bottom: 16px;"
  417. >
  418. <div class="time-header">
  419. {{ time }} <span class="little-dot"></span>
  420. <el-divider
  421. style="height: 2px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  422. ></el-divider>
  423. </div>
  424. <div
  425. v-for="item in group"
  426. :key="item.id"
  427. class="message-item"
  428. >
  429. <div style="display: flex; margin-bottom: 10px">
  430. <span class="red-dot"></span>
  431. <span class="message-card-title">{{ item.title }}</span>
  432. <div
  433. class="message-time"
  434. :style="{ color: item.czTime.includes('分钟') ? 'red' : '' }"
  435. >
  436. {{ item.czTime }}
  437. </div>
  438. </div>
  439. <div class="message-desc">
  440. <div v-if="findMenuById(menuTree, permissionMapping.refund_headquarters_finance)">[{{ item.marketName }}] </div>
  441. <div>[{{item.name}}{{ item.jwcode }}]{{ t('home.orderNeedsReview') }}</div>
  442. </div>
  443. <el-button
  444. type="primary"
  445. style="margin: 0 auto; display: block;"
  446. @click="handleMessageClick(item)"
  447. >
  448. {{ t('home.goToView') }}
  449. </el-button>
  450. </div>
  451. <el-divider
  452. style="height: 1px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  453. ></el-divider>
  454. </div>
  455. <!-- 控制按钮 -->
  456. <div>
  457. <el-button
  458. type="text"
  459. v-if="messageNum > 2"
  460. class="view-all"
  461. @click="toggleShowAll"
  462. >
  463. {{ showAll ? t('home.collapse') : t('home.viewAll') }}
  464. </el-button>
  465. <div v-if="showAll" @click="scrollToTop" class="go-top">
  466. <el-image
  467. :src="goTop"
  468. style="width: 20px; height: 20px;"
  469. fit="contain"
  470. />
  471. <span>{{ t('home.backToTop') }}</span>
  472. </div>
  473. </div>
  474. </div>
  475. </el-dialog>
  476. <!-- 语言切换弹窗 -->
  477. <LanguageSwitch ref="languageSwitchRef" />
  478. </div>
  479. </template>
  480. <style scoped>
  481. /* 主容器,设置背景图并居中 */
  482. .main-container {
  483. position: fixed;
  484. top: 0;
  485. left: 0;
  486. right: 0;
  487. bottom: 0;
  488. background-image: url('@/assets/backgroundBlue.png');
  489. background-size: cover;
  490. background-position: center center;
  491. background-repeat: no-repeat;
  492. overflow: hidden;
  493. }
  494. /* 背景毛玻璃层(作为内容容器) */
  495. .background-glass {
  496. position: absolute;
  497. top: 1vh;
  498. left: 1vh;
  499. right: 1vh;
  500. bottom: 1vh;
  501. background-image: url('@/assets/blue-background.png');
  502. background-size: cover;
  503. z-index: 1;
  504. display: flex;
  505. flex-direction: row;
  506. padding: 10px;
  507. border-radius: 12px;
  508. }
  509. /* 侧边栏容器 */
  510. .sidebar-container {
  511. flex-shrink: 0;
  512. }
  513. .logo {
  514. display: flex;
  515. align-items: center;
  516. justify-content: center;
  517. height: 12vh;
  518. }
  519. /* 菜单项文字样式 */
  520. .menu-item-text {
  521. display: inline-block;
  522. max-width: 120px; /* 设置最大宽度 */
  523. min-width: 80px; /* 设置最小宽度 */
  524. /* overflow: hidden; */
  525. /* text-overflow: ellipsis; */
  526. white-space: nowrap; /* 不换行 */
  527. flex: 1; /* 自动填充剩余空间 */
  528. text-align: left; /* 文字左对齐 */
  529. }
  530. /* 中间可滚动菜单容器 */
  531. .menu-scroll-container {
  532. flex: 1;
  533. overflow-y: auto;
  534. padding: 10px 0;
  535. }
  536. /* 底部设置中心样式 */
  537. .settings-container {
  538. padding: 10px 0 10px 20px; /* 上,右, 下,左 */
  539. display: flex;
  540. align-items: center; /* 垂直居中 */
  541. }
  542. /* 调整下拉菜单的样式,确保它向上弹出 */
  543. .el-dropdown-link:focus {
  544. /* 移除底部的异常效果 */
  545. outline: none;
  546. text-decoration: none;
  547. }
  548. .el-dropdown-link {
  549. display: flex;
  550. align-items: center;
  551. cursor: pointer;
  552. gap: 10px; /* 图标和文字左右间距 */
  553. }
  554. .sidebar-layout {
  555. width: 16vw;
  556. height: 100%;
  557. background: #E7F4FD; /* 浅蓝色背景 */
  558. /* backdrop-filter: blur(5px); 毛玻璃效果 --消耗性能 */
  559. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
  560. border-radius: 12px;
  561. display: flex;
  562. flex-direction: column;
  563. position: relative;
  564. transition: all 0.3s ease;
  565. }
  566. /* 内容区域容器 */
  567. .content-container {
  568. flex: 1;
  569. display: flex;
  570. flex-direction: column;
  571. margin-left: 5px;
  572. gap: 5px;
  573. height: 100%;
  574. overflow: hidden;
  575. }
  576. /* 主内容区域容器 */
  577. .main-area {
  578. flex: 1;
  579. background: #E7F4FD;
  580. /* 半透明浅色背景 */
  581. /* backdrop-filter: blur(5px); */
  582. /* 毛玻璃效果 */
  583. border-radius: 12px;
  584. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  585. /* 添加阴影增强层次感 */
  586. overflow: hidden;
  587. display: flex;
  588. flex-direction: column;
  589. }
  590. /* 主内容区域样式 */
  591. .el-main {
  592. height: 100%;
  593. padding: 1px 8px 10px 8px;
  594. background: transparent;
  595. overflow-y: auto;
  596. /* 应用自定义滚动条 */
  597. }
  598. /* 确保el-menu撑满容器 */
  599. .sidebar-layout .el-menu {
  600. width: 100%;
  601. }
  602. /* 侧边栏菜单样式 适配浅色背景 */
  603. .el-menu {
  604. background: transparent !important;
  605. }
  606. /* 工作台,金币管理,现金管理 */
  607. ::v-deep(.el-sub-menu__title:hover),
  608. ::v-deep(.el-menu-item:hover) {
  609. background: #E5EBFE;
  610. }
  611. /* 子菜单展开时和背景同色 */
  612. ::v-deep(.el-sub-menu__title),
  613. ::v-deep(.el-menu-item) {
  614. background: #E7F4FD;
  615. }
  616. .message-font {
  617. /* 个人信息字体样式 */
  618. font-size: 16px;
  619. font-weight: bold;
  620. }
  621. /* 确保全局el-container适应容器 */
  622. :deep(.el-container) {
  623. /* vue3的深度选择器,用于覆盖element-plus的默认样式 */
  624. min-height: 100%;
  625. width: 100%;
  626. background: transparent;
  627. }
  628. /* 为侧边栏和主内容区域添加滚动条样式 */
  629. .menu-scroll-container,
  630. .el-main {
  631. scrollbar-width: thin;
  632. /* Firefox */
  633. scrollbar-color: rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.2);
  634. /* Firefox滑块和轨道颜色 */
  635. }
  636. /* 小红点 */
  637. .dot {
  638. position: absolute;
  639. top: -2px;
  640. right: -2px;
  641. width: 8px;
  642. height: 8px;
  643. background: #F23C39;
  644. border-radius: 50%;
  645. }
  646. /* 消息中心整体容器 */
  647. .message-container {
  648. padding: 10px 50px 10px 50px; /* 上,右, 下,左 */
  649. display: flex;
  650. align-items: center; /* 垂直居中 */
  651. }
  652. /* 消息中心标题 */
  653. .message-title {
  654. display: flex;
  655. font-size: 16px;
  656. color: black;
  657. .divider {
  658. align-items: flex-start;
  659. gap: 36px;
  660. align-self: stretch;
  661. height: 20px;
  662. border-left: 3px solid #266EFF;
  663. }
  664. }
  665. /* 无消息的样式 */
  666. .no-message {
  667. text-align: center;
  668. position: relative;
  669. .no-message-text {
  670. position: absolute;
  671. top: 60%;
  672. left: 50%;
  673. /* 水平垂直居中 */
  674. transform: translate(-50%, -50%);
  675. /* 文字样式 */
  676. font-weight: bold;
  677. margin: 0;
  678. /* 可添加更多样式(如字体大小、阴影等) */
  679. font-size: 14px;
  680. }
  681. }
  682. /* 有消息的样式 */
  683. .time-header {
  684. font-size: 14px;
  685. color: #666;
  686. display: flex;
  687. align-items: center;
  688. gap: 8px;
  689. }
  690. .message-item {
  691. height: 100px;
  692. padding: 10px 10px 10px 10px;
  693. border-radius: 4px;
  694. border: 1px solid #E5E5E5;
  695. background: #FCFEFF;
  696. margin-bottom: 10px;
  697. }
  698. .message-card-title {
  699. font-weight: bold;
  700. margin-right: 4px;
  701. }
  702. /* 圆点样式 */
  703. .red-dot {
  704. width: 6px;
  705. height: 6px;
  706. margin-right: 9px;
  707. border-radius: 50%;
  708. background-color: red;
  709. }
  710. .message-desc {
  711. display: flex;
  712. font-size: 13px;
  713. color: #666;
  714. margin: 4px 0 15px 15px;
  715. }
  716. .message-time {
  717. margin-left: auto;
  718. font-size: 13px;
  719. color: #999;
  720. }
  721. .view-all {
  722. display: block;
  723. margin: 0 auto 16px;
  724. }
  725. .little-dot {
  726. display: inline-block;
  727. width: 8px; /* 圆点直径 */
  728. height: 8px;
  729. border-radius: 50%; /* 圆形 */
  730. background-color: #CEE5FE;;
  731. }
  732. /* 返回最上*/
  733. .go-top {
  734. display: flex;
  735. flex-direction: column;
  736. align-items: center;
  737. gap: 4px;
  738. cursor: pointer;
  739. padding: 8px;
  740. }
  741. </style>