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.

880 lines
25 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 list = Array.isArray(res.data) ? res.data : (Array.isArray(res.data?.list) ? res.data.list : [])
  179. const cleanList = list.filter(i => i.flag !== 1)
  180. messageStore.setMessages(cleanList)
  181. }
  182. } catch (e) {
  183. console.error("getMessage error:", e)
  184. }
  185. }
  186. // 点击铃铛 → 打开弹窗并刷新
  187. const showMessageDialog = ref(false)
  188. const openMessageDialog = async () => {
  189. showMessageDialog.value = true
  190. await getMessage() // 等待消息更新
  191. }
  192. // 关闭消息窗口
  193. const closeMessageDialog = () => showMessageDialog.value = false
  194. // 小红点(完全响应式)
  195. const messageDot = computed(() => messages.value.length > 0)
  196. // 消息数量(完全响应式)
  197. const messageNum = computed(() => messages.value.length)
  198. // 按日期分组(computed)
  199. const messageList = computed(() => groupMessages(messages.value))
  200. // 按日期生成最终结构(computed)
  201. const groupedMessages = computed(() => {
  202. const result = {}
  203. messageList.value.forEach(item => {
  204. if (!result[item.group]) result[item.group] = []
  205. result[item.group].push(item)
  206. })
  207. return result
  208. })
  209. // 显示全部 or 显示前两条
  210. const showAll = ref(false)
  211. const displayMessages = computed(() => {
  212. if (showAll.value) return groupedMessages.value
  213. let count = 0
  214. const limited = {}
  215. const groupOrderKeys = ['today', 'yesterday', 'earlier']
  216. for (const key of groupOrderKeys) {
  217. const label = t(`home.messageGroups.${key}`)
  218. const group = groupedMessages.value[label]
  219. if (!group) continue
  220. limited[label] = []
  221. for (const item of group) {
  222. if (count < 2) {
  223. limited[label].push(item)
  224. count++
  225. }
  226. }
  227. if (limited[label].length === 0) delete limited[label]
  228. if (count >= 2) break
  229. }
  230. return limited
  231. })
  232. const toggleShowAll = () => showAll.value = !showAll.value
  233. // 返回顶部
  234. const scrollContainer = ref(null)
  235. const scrollToTop = () => scrollContainer.value?.scrollTo({top: 0, behavior: 'smooth'})
  236. const getPathByQueryId = (queryId) => {
  237. const qid = Number(queryId)
  238. if (!Number.isFinite(qid)) return null
  239. const matchedRoutes = router.getRoutes().filter(r => {
  240. const pid = r.meta?.permissionId
  241. if (Array.isArray(pid)) return pid.includes(qid)
  242. return pid === qid
  243. })
  244. if (!matchedRoutes.length) return null
  245. matchedRoutes.sort((a, b) => {
  246. const aDepth = typeof a.path === 'string' ? a.path.split('/').length : 0
  247. const bDepth = typeof b.path === 'string' ? b.path.split('/').length : 0
  248. return bDepth - aDepth
  249. })
  250. return matchedRoutes[0]?.path || null
  251. }
  252. // 点击消息 → 已读 + 跳转
  253. const handleMessageClick = async (item) => {
  254. const res = await API({
  255. url: '/getMessage/update',
  256. method: 'POST',
  257. data: {id: item.id}
  258. });
  259. if (res.code === 200) {
  260. closeMessageDialog()
  261. const targetPath = item?.queryId ? getPathByQueryId(item.queryId) : null
  262. await router.push(targetPath || getOrderPage(item.status) || '/noPermission')
  263. await getMessage()
  264. ElMessage.success(t('elmessage.jumpSuccess'))
  265. } else {
  266. ElMessage.error(t('elmessage.jumpFailed'))
  267. }
  268. }
  269. onMounted(() => getMessage())
  270. </script>
  271. <template>
  272. <div class="main-container">
  273. <!-- 背景毛玻璃层作为内容容器 -->
  274. <div class="background-glass">
  275. <!-- 侧边栏 -->
  276. <div class="sidebar-container">
  277. <el-aside class="sidebar-layout">
  278. <div class="logo">
  279. <img src="../assets/logo.png" alt="logo" style="width: 9vh; height: 9vh"/>
  280. </div>
  281. <div class="menu-scroll-container">
  282. <el-menu :router="true" :default-active="activeMenu" style="min-height: 80vh;border:none;">
  283. <!-- 递归渲染菜单层级 -->
  284. <template v-for="menu in menuList" :key="menu.id">
  285. <!-- 有子菜单的父级菜单menuType=2 且存在children -->
  286. <el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.id.toString()">
  287. <template #title>
  288. <img
  289. :src="getIconPath(menu.id)"
  290. :alt="`${menu.menuName}图标`"
  291. style="width: 4vh; height: 4vh; margin-right: 4px;"
  292. >
  293. <span class="menu-item-text">{{ menu.menuName }}</span>
  294. </template>
  295. <!-- 子菜单 -->
  296. <template v-for="child in menu.children" :key="child.id">
  297. <!-- 子菜单为叶子节点无children -->
  298. <el-menu-item v-if="!child.children || child.children.length === 0" :index="getRoutePath(child)">
  299. <el-icon style="margin-right: 4px;">
  300. <Folder/>
  301. </el-icon>
  302. <span class="menu-item-text">{{ child.menuName }}</span>
  303. </el-menu-item>
  304. <!-- 子菜单有下级 -->
  305. <el-sub-menu v-else :index="child.id.toString()">
  306. <template #title>
  307. <el-icon style="margin-right: 4px;">
  308. <Folder/>
  309. </el-icon>
  310. <span class="menu-item-text">{{ child.menuName }}</span>
  311. </template>
  312. <!-- 递归 下一级-->
  313. <template v-for="grandChild in child.children" :key="grandChild.id">
  314. <el-menu-item :index="getRoutePath(grandChild)">
  315. <el-icon style="margin-right: 4px;">
  316. <Folder/>
  317. </el-icon>
  318. <span class="menu-item-text">{{ grandChild.menuName }}</span>
  319. </el-menu-item>
  320. </template>
  321. </el-sub-menu>
  322. </template>
  323. </el-sub-menu>
  324. <!-- 无子菜单的一级菜单 -->
  325. <el-menu-item v-else :index="getRoutePath(menu)">
  326. <img
  327. :src="getIconPath(menu.id)"
  328. :alt="`${menu.menuName}图标`"
  329. style="width: 4vh; height: 4vh; margin-right: 4px;"
  330. >
  331. <span class="menu-item-text">{{ menu.menuName }}</span>
  332. </el-menu-item>
  333. </template>
  334. </el-menu>
  335. </div>
  336. <div style="display: flex">
  337. <!-- 底部固定的设置中心 -->
  338. <div class="settings-container">
  339. <el-dropdown placement="top-start">
  340. <span class="el-dropdown-link">
  341. <!-- 暂时使用静态路径确保设置图标正常显示 -->
  342. <img src="@/assets/SvgIcons/setting.svg" :alt="t('home.settingsCenter')" style="width: 4vh; height: 4vh"/>
  343. <span>{{ t('home.settingsCenter') }}</span>
  344. <el-icon class="arrow-icon">
  345. <ArrowUp/>
  346. </el-icon>
  347. </span>
  348. <template #dropdown>
  349. <el-dropdown-menu>
  350. <!-- <el-dropdown-item @click="refreshData()">数据刷新</el-dropdown-item>-->
  351. <el-dropdown-item @click="openLanguageSwitch">{{ t('home.languageSwitch') }}</el-dropdown-item>
  352. <el-dropdown-item @click="toggleFlag()">
  353. {{ flag === 1 ? t('home.showStaffData') : t('home.hideStaffData') }}
  354. </el-dropdown-item>
  355. <el-dropdown-item @click="message()">{{ t('home.viewProfile') }}</el-dropdown-item>
  356. <el-dropdown-item @click="openChangePassword">{{ t('home.changePassword') }}</el-dropdown-item>
  357. <el-dropdown-item @click="logout">{{ t('home.logout') }}</el-dropdown-item>
  358. </el-dropdown-menu>
  359. </template>
  360. </el-dropdown>
  361. </div>
  362. <!-- 消息提示 这里的 小红点不用el-badge 他在切换状态会抽一下 应该是dom问题 -->
  363. <div class="message-container">
  364. <div style="position: relative;">
  365. <el-image :src="bell" style="width: 28px; height: 28px;" @click="openMessageDialog"></el-image>
  366. <span v-show="messageDot" class="dot"></span>
  367. </div>
  368. </div>
  369. </div>
  370. </el-aside>
  371. </div>
  372. <!-- 右侧内容区域 -->
  373. <div class="content-container">
  374. <!-- 头部
  375. <el-header class="header">
  376. </el-header> -->
  377. <!-- 主内容区域 -->
  378. <div class="main-area">
  379. <el-main>
  380. <router-view></router-view>
  381. </el-main>
  382. </div>
  383. </div>
  384. </div>
  385. <!-- 查看个人信息 -->
  386. <el-dialog v-model="messageVisible" :title="t('home.viewProfile')" width="500px">
  387. <el-form :model="adminData">
  388. <el-form-item :label="t('home.dialog.userName')" label-width="100px" label-position="left">
  389. <span class="message-font">{{ adminData.adminName }}</span>
  390. </el-form-item>
  391. <el-form-item :label="t('home.dialog.jwcode')" label-width="100px" label-position="left">
  392. <span class="message-font">{{ adminData.account }}</span>
  393. </el-form-item>
  394. <el-form-item :label="t('home.dialog.market')" label-width="100px" label-position="left">
  395. <span class="message-font">{{ adminData.markets }}</span>
  396. </el-form-item>
  397. <el-form-item :label="t('home.dialog.registerTime')" label-width="100px" label-position="left">
  398. <span class="message-font">{{ adminData.createTime }}</span>
  399. </el-form-item>
  400. </el-form>
  401. <template #footer>
  402. <div>
  403. <el-button text @click="closeMessage()">{{ t('common_export.close') }}</el-button>
  404. </div>
  405. </template>
  406. </el-dialog>
  407. <!-- 自定义密码修改弹窗组件 -->
  408. <el-dialog v-model="showPasswordDialog" :center="true" width="470px" @closed="onPwdDialogClosed">
  409. <ChangePassword ref="pwdRef" @confirm="showPasswordDialog = false"/>
  410. </el-dialog>
  411. <!--消息推送的弹窗-->
  412. <el-dialog style="background: #F3FAFE" v-model="showMessageDialog" title="" width="500px">
  413. <div class="message-title">
  414. <el-divider
  415. class="divider"
  416. direction="vertical"
  417. ></el-divider>
  418. {{ t('home.messageCenter') }} ({{ messageNum }})
  419. </div>
  420. <!-- todo 这是为了样式显示 一定要改逻辑-->
  421. <div v-if="messageNum === 0">
  422. <div class="no-message">
  423. <el-image :src="noMessage"></el-image>
  424. <p class="no-message-text">{{ t('home.noMessage') }}</p>
  425. </div>
  426. </div>
  427. <div v-else
  428. ref="scrollContainer"
  429. style="max-height: 60vh; overflow-y: auto;">
  430. <!-- 按时间分组的消息列表 -->
  431. <div
  432. v-for="(group, time) in displayMessages"
  433. :key="time"
  434. style="margin-bottom: 16px;"
  435. >
  436. <div class="time-header">
  437. {{ time }} <span class="little-dot"></span>
  438. <el-divider
  439. style="height: 2px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  440. ></el-divider>
  441. </div>
  442. <div
  443. v-for="item in group"
  444. :key="item.id"
  445. class="message-item"
  446. >
  447. <div style="display: flex; margin-bottom: 10px">
  448. <span class="red-dot"></span>
  449. <span class="message-card-title">{{ item.title }}</span>
  450. <div
  451. class="message-time"
  452. :style="{ color: item.czTime.includes('分钟') ? 'red' : '' }"
  453. >
  454. {{ item.czTime }}
  455. </div>
  456. </div>
  457. <div class="message-desc">
  458. <div v-if="findMenuById(menuTree, permissionMapping.refund_headquarters_finance)">[{{ item.marketName }}] </div>
  459. <div>[{{item.name}}{{ item.jwcode }}]{{ item.desc}}</div>
  460. </div>
  461. <el-button
  462. type="primary"
  463. style="margin: 0 auto; display: block;"
  464. @click="handleMessageClick(item)"
  465. >
  466. {{ t('home.goToView') }}
  467. </el-button>
  468. </div>
  469. <el-divider
  470. style="height: 1px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  471. ></el-divider>
  472. </div>
  473. <!-- 控制按钮 -->
  474. <div>
  475. <el-button
  476. type="text"
  477. v-if="messageNum > 2"
  478. class="view-all"
  479. @click="toggleShowAll"
  480. >
  481. {{ showAll ? t('home.collapse') : t('home.viewAll') }}
  482. </el-button>
  483. <div v-if="showAll" @click="scrollToTop" class="go-top">
  484. <el-image
  485. :src="goTop"
  486. style="width: 20px; height: 20px;"
  487. fit="contain"
  488. />
  489. <span>{{ t('home.backToTop') }}</span>
  490. </div>
  491. </div>
  492. </div>
  493. </el-dialog>
  494. <!-- 语言切换弹窗 -->
  495. <LanguageSwitch ref="languageSwitchRef" />
  496. </div>
  497. </template>
  498. <style scoped>
  499. /* 主容器,设置背景图并居中 */
  500. .main-container {
  501. position: fixed;
  502. top: 0;
  503. left: 0;
  504. right: 0;
  505. bottom: 0;
  506. background-image: url('@/assets/backgroundBlue.png');
  507. background-size: cover;
  508. background-position: center center;
  509. background-repeat: no-repeat;
  510. overflow: hidden;
  511. }
  512. /* 背景毛玻璃层(作为内容容器) */
  513. .background-glass {
  514. position: absolute;
  515. top: 1vh;
  516. left: 1vh;
  517. right: 1vh;
  518. bottom: 1vh;
  519. background-image: url('@/assets/blue-background.png');
  520. background-size: cover;
  521. z-index: 1;
  522. display: flex;
  523. flex-direction: row;
  524. padding: 10px;
  525. border-radius: 12px;
  526. }
  527. /* 侧边栏容器 */
  528. .sidebar-container {
  529. flex-shrink: 0;
  530. }
  531. .logo {
  532. display: flex;
  533. align-items: center;
  534. justify-content: center;
  535. height: 12vh;
  536. }
  537. /* 菜单项文字样式 */
  538. .menu-item-text {
  539. display: inline-block;
  540. max-width: 120px; /* 设置最大宽度 */
  541. min-width: 80px; /* 设置最小宽度 */
  542. /* overflow: hidden; */
  543. /* text-overflow: ellipsis; */
  544. white-space: nowrap; /* 不换行 */
  545. flex: 1; /* 自动填充剩余空间 */
  546. text-align: left; /* 文字左对齐 */
  547. }
  548. /* 中间可滚动菜单容器 */
  549. .menu-scroll-container {
  550. flex: 1;
  551. overflow-y: auto;
  552. padding: 10px 0;
  553. }
  554. /* 底部设置中心样式 */
  555. .settings-container {
  556. padding: 10px 0 10px 20px; /* 上,右, 下,左 */
  557. display: flex;
  558. align-items: center; /* 垂直居中 */
  559. }
  560. /* 调整下拉菜单的样式,确保它向上弹出 */
  561. .el-dropdown-link:focus {
  562. /* 移除底部的异常效果 */
  563. outline: none;
  564. text-decoration: none;
  565. }
  566. .el-dropdown-link {
  567. display: flex;
  568. align-items: center;
  569. cursor: pointer;
  570. gap: 10px; /* 图标和文字左右间距 */
  571. }
  572. .sidebar-layout {
  573. width: 16vw;
  574. height: 100%;
  575. background: #E7F4FD; /* 浅蓝色背景 */
  576. /* backdrop-filter: blur(5px); 毛玻璃效果 --消耗性能 */
  577. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
  578. border-radius: 12px;
  579. display: flex;
  580. flex-direction: column;
  581. position: relative;
  582. transition: all 0.3s ease;
  583. }
  584. /* 内容区域容器 */
  585. .content-container {
  586. flex: 1;
  587. display: flex;
  588. flex-direction: column;
  589. margin-left: 5px;
  590. gap: 5px;
  591. height: 100%;
  592. overflow: hidden;
  593. }
  594. /* 主内容区域容器 */
  595. .main-area {
  596. flex: 1;
  597. background: #E7F4FD;
  598. /* 半透明浅色背景 */
  599. /* backdrop-filter: blur(5px); */
  600. /* 毛玻璃效果 */
  601. border-radius: 12px;
  602. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  603. /* 添加阴影增强层次感 */
  604. overflow: hidden;
  605. display: flex;
  606. flex-direction: column;
  607. }
  608. /* 主内容区域样式 */
  609. .el-main {
  610. height: 100%;
  611. padding: 1px 8px 10px 8px;
  612. background: transparent;
  613. overflow-y: auto;
  614. /* 应用自定义滚动条 */
  615. }
  616. /* 确保el-menu撑满容器 */
  617. .sidebar-layout .el-menu {
  618. width: 100%;
  619. }
  620. /* 侧边栏菜单样式 适配浅色背景 */
  621. .el-menu {
  622. background: transparent !important;
  623. }
  624. /* 工作台,金币管理,现金管理 */
  625. ::v-deep(.el-sub-menu__title:hover),
  626. ::v-deep(.el-menu-item:hover) {
  627. background: #E5EBFE;
  628. }
  629. /* 子菜单展开时和背景同色 */
  630. ::v-deep(.el-sub-menu__title),
  631. ::v-deep(.el-menu-item) {
  632. background: #E7F4FD;
  633. }
  634. .message-font {
  635. /* 个人信息字体样式 */
  636. font-size: 16px;
  637. font-weight: bold;
  638. }
  639. /* 确保全局el-container适应容器 */
  640. :deep(.el-container) {
  641. /* vue3的深度选择器,用于覆盖element-plus的默认样式 */
  642. min-height: 100%;
  643. width: 100%;
  644. background: transparent;
  645. }
  646. /* 为侧边栏和主内容区域添加滚动条样式 */
  647. .menu-scroll-container,
  648. .el-main {
  649. scrollbar-width: thin;
  650. /* Firefox */
  651. scrollbar-color: rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.2);
  652. /* Firefox滑块和轨道颜色 */
  653. }
  654. /* 小红点 */
  655. .dot {
  656. position: absolute;
  657. top: -2px;
  658. right: -2px;
  659. width: 8px;
  660. height: 8px;
  661. background: #F23C39;
  662. border-radius: 50%;
  663. }
  664. /* 消息中心整体容器 */
  665. .message-container {
  666. padding: 10px 50px 10px 50px; /* 上,右, 下,左 */
  667. display: flex;
  668. align-items: center; /* 垂直居中 */
  669. }
  670. /* 消息中心标题 */
  671. .message-title {
  672. display: flex;
  673. font-size: 16px;
  674. color: black;
  675. .divider {
  676. align-items: flex-start;
  677. gap: 36px;
  678. align-self: stretch;
  679. height: 20px;
  680. border-left: 3px solid #266EFF;
  681. }
  682. }
  683. /* 无消息的样式 */
  684. .no-message {
  685. text-align: center;
  686. position: relative;
  687. .no-message-text {
  688. position: absolute;
  689. top: 60%;
  690. left: 50%;
  691. /* 水平垂直居中 */
  692. transform: translate(-50%, -50%);
  693. /* 文字样式 */
  694. font-weight: bold;
  695. margin: 0;
  696. /* 可添加更多样式(如字体大小、阴影等) */
  697. font-size: 14px;
  698. }
  699. }
  700. /* 有消息的样式 */
  701. .time-header {
  702. font-size: 14px;
  703. color: #666;
  704. display: flex;
  705. align-items: center;
  706. gap: 8px;
  707. }
  708. .message-item {
  709. height: 100px;
  710. padding: 10px 10px 10px 10px;
  711. border-radius: 4px;
  712. border: 1px solid #E5E5E5;
  713. background: #FCFEFF;
  714. margin-bottom: 10px;
  715. }
  716. .message-card-title {
  717. font-weight: bold;
  718. margin-right: 4px;
  719. }
  720. /* 圆点样式 */
  721. .red-dot {
  722. width: 6px;
  723. height: 6px;
  724. margin-right: 9px;
  725. border-radius: 50%;
  726. background-color: red;
  727. }
  728. .message-desc {
  729. display: flex;
  730. font-size: 13px;
  731. color: #666;
  732. margin: 4px 0 15px 15px;
  733. }
  734. .message-time {
  735. margin-left: auto;
  736. font-size: 13px;
  737. color: #999;
  738. }
  739. .view-all {
  740. display: block;
  741. margin: 0 auto 16px;
  742. }
  743. .little-dot {
  744. display: inline-block;
  745. width: 8px; /* 圆点直径 */
  746. height: 8px;
  747. border-radius: 50%; /* 圆形 */
  748. background-color: #CEE5FE;;
  749. }
  750. /* 返回最上*/
  751. .go-top {
  752. display: flex;
  753. flex-direction: column;
  754. align-items: center;
  755. gap: 4px;
  756. cursor: pointer;
  757. padding: 8px;
  758. }
  759. </style>