Layout.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. <template>
  2. <el-container class="layout-container">
  3. <!-- Mobile overlay -->
  4. <div v-if="isMobile && sidebarVisible" class="sidebar-overlay" @click="sidebarVisible = false"></div>
  5. <el-aside :class="['el-aside', { 'sidebar-mobile': isMobile, 'sidebar-open': isMobile && sidebarVisible, 'sidebar-closed': isMobile && !sidebarVisible }]" :width="isMobile ? '200px' : '200px'">
  6. <div class="logo">浠艾福</div>
  7. <el-scrollbar wrap-class="sidebar-scrollbar-wrap">
  8. <div v-if="menuLoadFailed && effectiveMenuItems.length === 0" class="menu-load-failed">
  9. <i class="el-icon-warning-outline"></i>
  10. <p class="menu-load-failed-title">菜单加载失败</p>
  11. <p class="menu-load-failed-sub">请刷新页面重试</p>
  12. </div>
  13. <el-menu
  14. :default-active="activeMenu"
  15. class="sidebar-menu"
  16. background-color="transparent"
  17. text-color="var(--adm-sidebar-text)"
  18. active-text-color="var(--adm-sidebar-text-active)"
  19. @select="handleMenuSelect"
  20. >
  21. <template v-for="item in effectiveMenuItems">
  22. <el-submenu v-if="item.children && item.children.length > 0 && hasPerm(item.perm)" :key="item.title || item.path" :index="item.title || item.path">
  23. <template slot="title">
  24. <i :class="item.icon"></i>
  25. <span>{{ item.title || item.label }}</span>
  26. </template>
  27. <template v-for="child in item.children">
  28. <!-- 子项有 children = 三级菜单 -->
  29. <el-submenu v-if="child.children && child.children.length > 0 && hasPerm(child.perm)" :key="child.title" :index="child.title">
  30. <template slot="title">
  31. <i :class="child.icon"></i>
  32. <span>{{ child.title || child.label }}</span>
  33. </template>
  34. <el-menu-item
  35. v-for="grandson in child.children"
  36. :key="grandson.path || grandson.id"
  37. :index="grandson.path"
  38. >
  39. <i :class="grandson.icon"></i>
  40. <span slot="title">{{ grandson.label }}</span>
  41. </el-menu-item>
  42. </el-submenu>
  43. <!-- 普通二级菜单项 -->
  44. <el-menu-item v-else-if="hasPerm(child.perm)" :key="child.path || child.id" :index="getMenuIndex(child)">
  45. <i :class="child.icon"></i>
  46. <span slot="title">{{ child.label }}</span>
  47. </el-menu-item>
  48. </template>
  49. </el-submenu>
  50. <el-menu-item v-else-if="hasPerm(item.perm)" :key="item.path || item.id" :index="getMenuIndex(item)">
  51. <i :class="item.icon"></i>
  52. <span slot="title">{{ item.label }}</span>
  53. </el-menu-item>
  54. </template>
  55. </el-menu>
  56. </el-scrollbar>
  57. </el-aside>
  58. <el-container>
  59. <el-header>
  60. <div class="header-left">
  61. <el-button v-if="isMobile" type="text" class="hamburger-btn" @click="toggleSidebar">
  62. <i :class="sidebarVisible ? 'el-icon-s-unfold' : 'el-icon-s-fold'"></i>
  63. </el-button>
  64. </div>
  65. <div class="header-right">
  66. <el-badge :value="unreadMessageCount" :hidden="unreadMessageCount === 0" class="msg-badge">
  67. <el-button type="text" class="msg-btn" @click="handleMessageClick" icon="el-icon-bell"></el-button>
  68. </el-badge>
  69. <el-button v-if="hasPerm('service:*')" type="text" class="invite-code-btn" @click="showInviteCode" icon="el-icon-share">
  70. 邀请码
  71. </el-button>
  72. <el-dropdown trigger="click" @command="handleProfileCommand">
  73. <span class="el-dropdown-link username">
  74. {{ displayUserLabel }}<i class="el-icon-arrow-down el-icon--right"></i>
  75. </span>
  76. <el-dropdown-menu slot="dropdown">
  77. <el-dropdown-item command="profile" icon="el-icon-user">个人信息</el-dropdown-item>
  78. <el-dropdown-item command="password" icon="el-icon-key">修改密码</el-dropdown-item>
  79. <el-dropdown-item command="logout" icon="el-icon-switch-button" divided>退出登录</el-dropdown-item>
  80. </el-dropdown-menu>
  81. </el-dropdown>
  82. </div>
  83. <!-- 邀请码 dialog -->
  84. <el-dialog title="我的邀请码" :visible.sync="inviteCodeVisible" width="500px" :close-on-click-modal="false">
  85. <div v-loading="inviteCodeLoading">
  86. <div v-if="inviteCodeData" class="invite-code-content">
  87. <div class="invite-code-section">
  88. <div class="invite-code-label">团队邀请码</div>
  89. <div class="invite-code-value">
  90. <span class="code-text">{{ inviteCodeData.code || '无' }}</span>
  91. <el-button size="mini" type="primary" @click="copyCode(inviteCodeData.code)" plain>复制</el-button>
  92. </div>
  93. <div class="invite-code-desc">
  94. 家庭用户通过此码加入您的团队
  95. </div>
  96. </div>
  97. </div>
  98. <div v-else-if="!inviteCodeLoading" class="no-invite-code">
  99. <i class="el-icon-warning-outline"></i>
  100. <p>暂无邀请码,请先生成</p>
  101. <el-button type="primary" @click="generateInviteCode">生成邀请码</el-button>
  102. </div>
  103. </div>
  104. </el-dialog>
  105. </el-header>
  106. <!-- 个人信息 dialog -->
  107. <el-dialog title="个人信息" :visible.sync="profileDialogVisible" width="400px">
  108. <el-form :model="profileForm" label-width="80px">
  109. <el-form-item label="用户名">
  110. <el-input v-model="profileForm.username" disabled></el-input>
  111. </el-form-item>
  112. <el-form-item label="真实姓名">
  113. <el-input v-model="profileForm.realName" disabled></el-input>
  114. </el-form-item>
  115. <el-form-item label="昵称">
  116. <el-input v-model="profileForm.nickname"></el-input>
  117. </el-form-item>
  118. <el-form-item label="手机号">
  119. <el-input v-model="profileForm.phone"></el-input>
  120. </el-form-item>
  121. <el-form-item label="邮箱">
  122. <el-input v-model="profileForm.email"></el-input>
  123. </el-form-item>
  124. </el-form>
  125. <span slot="footer">
  126. <el-button @click="profileDialogVisible = false">取消</el-button>
  127. <el-button type="primary" @click="confirmUpdateInfo" :loading="submitting">保存</el-button>
  128. </span>
  129. </el-dialog>
  130. <!-- 修改密码 dialog -->
  131. <el-dialog title="修改密码" :visible.sync="passwordDialogVisible" width="400px">
  132. <el-form :model="passwordForm" :rules="passwordRules" ref="passwordForm" label-width="100px">
  133. <el-form-item label="原密码" prop="oldPassword">
  134. <el-input v-model="passwordForm.oldPassword" type="password" show-password></el-input>
  135. </el-form-item>
  136. <el-form-item label="新密码" prop="newPassword">
  137. <el-input v-model="passwordForm.newPassword" type="password" show-password></el-input>
  138. </el-form-item>
  139. <el-form-item label="确认密码" prop="confirmPassword">
  140. <el-input v-model="passwordForm.confirmPassword" type="password" show-password></el-input>
  141. </el-form-item>
  142. </el-form>
  143. <span slot="footer">
  144. <el-button @click="passwordDialogVisible = false">取消</el-button>
  145. <el-button type="primary" @click="confirmChangePassword" :loading="submitting">确定</el-button>
  146. </span>
  147. </el-dialog>
  148. <el-main>
  149. <div class="main-wrapper">
  150. <!-- 白名单缓存列表页组件:进入编辑/详情返回时保留筛选条件、页码、勾选等状态(见 ListStateMixin) -->
  151. <keep-alive :include="cachedPages">
  152. <router-view />
  153. </keep-alive>
  154. </div>
  155. </el-main>
  156. </el-container>
  157. </el-container>
  158. </template>
  159. <script>
  160. import { getAdminInfo, changePassword } from '@/api/auth'
  161. import { updateAdminInfo } from '@/api/admin'
  162. import { getMyInviteCode } from '@/api/guide'
  163. import { getUnreadMessageCount } from '@/api/teacherMessage'
  164. import { getEffectivePermissions, hasPermission, getRoleLabel } from '@/utils/permissions'
  165. import { getUserMenus } from '@/api/menu'
  166. export default {
  167. data() {
  168. return {
  169. menuItems: [
  170. // ===== 1. 首页 (ALL) =====
  171. { path: '/dashboard', label: '首页', icon: 'el-icon-s-home', perm: 'dashboard' },
  172. // ===== 2. 家庭运营 (family:*) =====
  173. { title: '家庭运营', icon: 'el-icon-s-custom', perm: 'family:*',
  174. children: [
  175. { path: '/families', label: '家庭列表', icon: 'el-icon-s-custom', perm: 'family:list,family:read,family:bound' },
  176. { path: '/children', label: '孩子管理', icon: 'el-icon-user-solid', perm: 'family:children,family:read,family:bound' },
  177. { path: '/points', label: '积分管理', icon: 'el-icon-s-finance', perm: 'family:points' },
  178. { path: '/points-log', label: '积分记录', icon: 'el-icon-document', perm: 'family:points,family:bound' },
  179. { path: '/wishes', label: '心愿管理', icon: 'el-icon-star-off', perm: 'family:wishes' },
  180. { path: '/rewards', label: '奖励管理', icon: 'el-icon-s-goods', perm: 'reward:list' },
  181. { path: '/family-metric-agg-config', label: '汇总方式配置', icon: 'el-icon-s-operation', perm: 'family:list' },
  182. ]},
  183. // ===== 3. 方案中心 (plan:*) =====
  184. { title: '方案中心', icon: 'el-icon-notebook-2', perm: 'plan:*',
  185. children: [
  186. { path: '/health-plan-manage', label: '健康方案管理', icon: 'el-icon-first-aid-kit', perm: 'plan:health' },
  187. { path: '/assessment-plan-manage', label: '测评方案管理', icon: 'el-icon-edit', perm: 'plan:assessment' },
  188. ]},
  189. // ===== 4. 任务中心 (task:*) =====
  190. { title: '任务中心', icon: 'el-icon-s-order', perm: 'task:*,task:read',
  191. children: [
  192. { path: '/tasks', label: '任务列表', icon: 'el-icon-s-order', perm: 'task:list' },
  193. { path: '/task-templates', label: '任务模板', icon: 'el-icon-document', perm: 'task:templates' },
  194. { path: '/growth-task', label: '成长任务管理', icon: 'el-icon-s-management', perm: 'task:growth' },
  195. ]},
  196. // ===== 5. 审核中心(归集:服务角色申请/活动审核/退款/提现) =====
  197. { title: '审核中心', icon: 'el-icon-s-check', perm: 'audit',
  198. children: [
  199. { path: '/review-center', label: '审核中心总览', icon: 'el-icon-s-check', perm: 'audit' },
  200. { path: '/activity-review', label: '活动审核', icon: 'el-icon-document-checked', perm: 'audit:activity' },
  201. { path: '/pending-refund', label: '待退款管理', icon: 'el-icon-warning', perm: 'audit:refund' },
  202. { path: '/family-earnings-withdraw', label: '收益提现审核', icon: 'el-icon-document-checked', perm: 'audit:withdraw' },
  203. ]},
  204. // ===== 5. 商城营销 (commerce:*) =====
  205. { title: '商城营销', icon: 'el-icon-s-goods', perm: 'commerce:*',
  206. children: [
  207. { path: '/product-manage', label: '商品管理', icon: 'el-icon-s-goods', perm: 'commerce:products,commerce:self' },
  208. { path: '/inventory', label: '库存管理', icon: 'el-icon-document', perm: 'inventory:self' },
  209. { path: '/order-manage', label: '订单管理', icon: 'el-icon-s-order', perm: 'commerce:orders,order:self' },
  210. { path: '/ecom-supplier', label: '供应商管理', icon: 'el-icon-s-shop', perm: 'commerce:supplier' },
  211. { path: '/product-profit-rate', label: '产品利润率', icon: 'el-icon-data-line', perm: 'finance:profit-rate' },
  212. { path: '/product-ppoint', label: 'P点配置', icon: 'el-icon-data-line', perm: 'commerce:ppoint' },
  213. { path: '/coupon', label: '优惠券管理', icon: 'el-icon-ticket', perm: 'commerce:coupon' },
  214. { path: '/coupon-grant-log', label: '发券记录', icon: 'el-icon-document', perm: 'commerce:coupon' },
  215. { path: '/coupon-gift-transfers', label: '会员券转赠记录', icon: 'el-icon-present', perm: 'commerce:coupon' },
  216. { path: '/discount-rules', label: '限时折扣管理', icon: 'el-icon-timer', perm: 'commerce:discount' },
  217. { path: '/promotion', label: '推广管理', icon: 'el-icon-s-marketing', perm: 'commerce:promotion' },
  218. { path: '/home-banner-manage', label: '首页广告栏', icon: 'el-icon-picture', perm: 'marketing:promotion' },
  219. { path: '/family-earnings', label: '家庭收益', icon: 'el-icon-s-money', perm: 'finance:family-earnings' },
  220. ]},
  221. // ===== 6. 知识中心 (articles:*) =====
  222. { title: '知识中心', icon: 'el-icon-document', perm: 'articles:*,knowledge:read',
  223. children: [
  224. { path: '/article-categories', label: '知识分类', icon: 'el-icon-folder', perm: 'articles:categories' },
  225. { path: '/article-manage', label: '知识管理', icon: 'el-icon-document', perm: 'articles:manage' },
  226. { path: '/comment-review', label: '评论审核', icon: 'el-icon-chat-dot-round', perm: 'articles:manage' },
  227. { path: '/knowledge-tags', label: '知识标签', icon: 'el-icon-price-tag', perm: 'articles:categories' },
  228. { path: '/knowledge-base', label: '知识库', icon: 'el-icon-reading', perm: 'knowledge:base' },
  229. { path: '/knowledge-base/unified', label: '统一知识库', icon: 'el-icon-notebook-2', perm: 'knowledge:base' },
  230. { path: '/vector-knowledge', label: '向量知识库', icon: 'el-icon-data-line', perm: 'knowledge:base' },
  231. ]},
  232. // ===== 6.5 活动管理(activity:*,活动审核已移入审核中心) =====
  233. { title: '活动管理', icon: 'el-icon-date', perm: 'activity:*', children: [
  234. { path: '/activities', label: '活动列表', icon: 'el-icon-date', perm: 'activity:list,activity:self' },
  235. { path: '/activity-registration-review', label: '活动报名审核', icon: 'el-icon-document-checked', perm: 'activity:registration' },
  236. { path: '/activity-checkin-manage', label: '活动签到审核', icon: 'el-icon-time', perm: 'activity:checkin' },
  237. { path: '/poster-template-manage', label: '海报模板管理', icon: 'el-icon-picture', perm: 'activity:poster_template' },
  238. ]},
  239. // ===== 7. 健康饮食 (health:*,报告管理/代传报告挂载,顺序对齐方案最终菜单树) =====
  240. { title: '健康饮食', icon: 'el-icon-first-aid-kit', perm: 'health:*',
  241. children: [
  242. { path: '/report-management', label: '报告管理', icon: 'el-icon-document', perm: 'health:reports' },
  243. { path: '/report-proxy-upload', label: '代传报告', icon: 'el-icon-upload', perm: 'health:reports' },
  244. { path: '/report-parse-status', label: '解析进度', icon: 'el-icon-data-line', perm: 'health:reports' },
  245. { path: '/health-indicators', label: '健康指标', icon: 'el-icon-data-line', perm: 'health:indicators' },
  246. { path: '/health-checkins', label: '健康打卡', icon: 'el-icon-s-order', perm: 'health:checkins' },
  247. { path: '/emotion-alert', label: '情绪告警', icon: 'el-icon-warning', perm: 'health:checkins' },
  248. { path: '/nutrition-mappings', label: '营养素映射', icon: 'el-icon-connection', perm: 'health:mappings' },
  249. { path: '/foods', label: '食材管理', icon: 'el-icon-apple', perm: 'diet:foods' },
  250. { path: '/recipes', label: '食谱管理', icon: 'el-icon-dish', perm: 'diet:recipes' },
  251. { path: '/seasonal-foods', label: '应季食材', icon: 'el-icon-apple', perm: 'diet:foods' },
  252. { path: '/nutrition-products', label: '营养产品', icon: 'el-icon-first-aid-kit', perm: 'health:products' },
  253. { path: '/energy-sandbox', label: '五维能量', icon: 'el-icon-data-line', perm: 'health:energy' },
  254. ]},
  255. // ===== 8. 报告解析系统 (config:report-parser,LangGraph 管理归入) =====
  256. { title: '报告解析系统', icon: 'el-icon-cpu', perm: 'config:report-parser',
  257. children: [
  258. { path: '/report-types', label: '报告类型管理', icon: 'el-icon-collection', perm: 'config:report-parser' },
  259. { path: '/report-parser-import', label: '解析器导入', icon: 'el-icon-upload2', perm: 'config:report-parser' },
  260. { path: '/report-unknown-clusters', label: '未知报告审核', icon: 'el-icon-question', perm: 'config:report-parser' },
  261. { path: '/report-auto-learn', label: '报告自学习', icon: 'el-icon-magic-stick', perm: 'config:report-parser' },
  262. { path: '/report-collector-trainer', label: '报告采集训练', icon: 'el-icon-film', perm: 'config:report-parser' },
  263. { path: '/report-template', label: '报告模板管理', icon: 'el-icon-setting', perm: 'config:report-parser' },
  264. { path: '/langgraph-admin', label: 'LangGraph 管理', icon: 'el-icon-cpu', perm: 'config:report-parser' },
  265. ]},
  266. // ===== 9. 规划师培训认证 (planner:cert) =====
  267. { title: '规划师认证', icon: 'el-icon-certificate', perm: 'planner:cert',
  268. children: [
  269. { path: '/planner-cert-categories', label: '学习种类管理', icon: 'el-icon-folder', perm: 'planner:cert' },
  270. { path: '/planner-cert-courses', label: '线上课程管理', icon: 'el-icon-s-goods', perm: 'planner:cert' },
  271. { path: '/planner-cert-offline', label: '线下课程映射', icon: 'el-icon-data-line', perm: 'planner:cert' },
  272. { path: '/planner-cert-exams', label: '考核题库管理', icon: 'el-icon-document', perm: 'planner:cert' },
  273. { path: '/planner-cert-board', label: '规划师认证看板', icon: 'el-icon-chart-bar', perm: 'planner:cert' },
  274. ]},
  275. { title: '家庭服务', icon: 'el-icon-s-custom', perm: 'service:*',
  276. children: [
  277. { path: '/my-families', label: '我的家庭', icon: 'el-icon-s-custom', perm: 'service:family' },
  278. { path: '/teacher-team', label: '我的团队', icon: 'el-icon-s-custom', perm: 'service:team' },
  279. ]},
  280. { title: '业务管理', icon: 'el-icon-s-marketing', perm: 'biz:*',
  281. children: [
  282. { path: '/teacher-packages', label: '任务模板管理', icon: 'el-icon-s-goods', perm: 'biz:packages' },
  283. { path: '/teacher-orders', label: '订单佣金', icon: 'el-icon-s-order', perm: 'biz:orders' },
  284. ]},
  285. // ===== 测评咨询(测评管理/订单/待分配规划师已从系统配置移入) =====
  286. { title: '测评咨询', icon: 'el-icon-edit', perm: 'assessment:*,assessment:read',
  287. children: [
  288. { path: '/assessment-admin', label: '测评管理', icon: 'el-icon-edit', perm: 'assessment:manage' },
  289. { path: '/assessment-orders', label: '测评订单', icon: 'el-icon-s-order', perm: 'assessment:orders' },
  290. { path: '/assessment-assign', label: '待分配规划师', icon: 'el-icon-user', perm: 'assessment:assign' },
  291. { path: '/teacher-assessment', label: 'DAN测评', icon: 'el-icon-edit', perm: 'assessment:dan' },
  292. { path: '/teacher-consult', label: '家长咨询', icon: 'el-icon-chat-dot-round', perm: 'assessment:consult' },
  293. { path: '/growth-records', label: '成长记录', icon: 'el-icon-document', perm: 'growth:records' },
  294. { path: '/growth-plans', label: '成长计划', icon: 'el-icon-document', perm: 'growth:plans' },
  295. ]},
  296. // ===== 9. 系统配置 (system:*,权限拆分 system:base/config:member/config:dimension/config:health) =====
  297. { title: '系统配置', icon: 'el-icon-s-tools', perm: 'system:*',
  298. children: [
  299. // --- 基础管理 ---
  300. { title: '基础管理', icon: 'el-icon-s-tools', perm: 'system:base',
  301. children: [
  302. { path: '/sys-config', label: '系统配置', icon: 'el-icon-s-tools', perm: 'system:base' },
  303. { path: '/exercise-type-config', label: '运动类型配置', icon: 'el-icon-s-grid', perm: 'system:base' },
  304. { path: '/guide-config', label: '引导配置', icon: 'el-icon-setting', perm: 'system:base' },
  305. { path: '/users', label: '用户管理', icon: 'el-icon-user', perm: 'system:users' },
  306. { path: '/menu-manage', label: '菜单管理', icon: 'el-icon-menu', perm: 'system:menu' },
  307. { path: '/operation-logs', label: '操作日志', icon: 'el-icon-s-order', perm: 'system:logs' },
  308. { path: '/membership-center', label: '会员中心', icon: 'el-icon-s-custom', perm: 'config:member' },
  309. { path: '/badge-manage', label: '勋章管理', icon: 'el-icon-medal', perm: 'config:member' },
  310. { path: '/virtual-goods-config', label: '虚拟支付道具', icon: 'el-icon-goods', perm: 'config:member' },
  311. { path: '/gates', label: '关卡配置', icon: 'el-icon-key', perm: 'system:base' },
  312. { path: '/system-prompt', label: '系统提示词', icon: 'el-icon-chat-line-square', perm: 'system:base' },
  313. { path: '/file-manage', label: '文件管理', icon: 'el-icon-files', perm: 'system:base' },
  314. { path: '/admin/asset-library', label: '素材库', icon: 'el-icon-picture-outline', perm: 'system:base' },
  315. ]},
  316. // --- 配置中心(统一配置中心 service_config;W0.2 双配置中心合并后单一入口) ---
  317. { title: '配置中心', icon: 'el-icon-setting', perm: 'config:dimension',
  318. children: [
  319. { path: '/config-center', label: '配置中心', icon: 'el-icon-setting', perm: 'config:dimension' },
  320. { path: '/dimension-config', label: '维度配置', icon: 'el-icon-data-line', perm: 'config:dimension' },
  321. ]},
  322. // --- 供应商体系 ---
  323. { title: '供应商体系', icon: 'el-icon-s-management', perm: 'system:supply',
  324. children: [
  325. { path: '/supply-system', label: '供应商体系', icon: 'el-icon-s-management', perm: 'system:supply' },
  326. ]},
  327. // --- 供应商管理 ---
  328. { title: '供应商管理', icon: 'el-icon-s-shop', perm: 'supply:manage',
  329. children: [
  330. { path: '/supply-manage', label: '供应商管理', icon: 'el-icon-s-shop', perm: 'supply:manage' },
  331. { path: '/supplier-products', label: '商品管理', icon: 'el-icon-s-goods', perm: 'supply:manage' },
  332. ]},
  333. // --- 健康配置(能量规则/行为/周期性服务已从健康饮食移入;术语统一:五维能量配置) ---
  334. { title: '健康配置', icon: 'el-icon-first-aid-kit', perm: 'config:health',
  335. children: [
  336. { path: '/health-norm-config', label: '健康常模', icon: 'el-icon-data-line', perm: 'config:health' },
  337. { path: '/health-data-source', label: '健康数据源', icon: 'el-icon-data-line', perm: 'config:health' },
  338. { path: '/health-energy-config', label: '五维能量配置', icon: 'el-icon-data-line', perm: 'config:health' },
  339. { path: '/energy-rule', label: '能量规则管理', icon: 'el-icon-setting', perm: 'config:health' },
  340. { path: '/energy-behavior-config', label: '能量行为配置', icon: 'el-icon-edit-outline', perm: 'config:health' },
  341. { path: '/periodic-service-config', label: '周期性服务配置', icon: 'el-icon-refresh', perm: 'config:health' },
  342. { path: '/indicator-correlations', label: '指标关联配置', icon: 'el-icon-connection', perm: 'config:health' },
  343. { path: '/indicator-mappings', label: '指标映射管理', icon: 'el-icon-sort', perm: 'config:health' },
  344. ]},
  345. // --- 人生维度 ---
  346. { title: '人生维度', icon: 'el-icon-s-custom', perm: 'config:dimension',
  347. children: [
  348. { path: '/zodiac-configs', label: '星座配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  349. { path: '/bazi-configs', label: '八字配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  350. { path: '/blood-type-configs', label: '血型配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  351. { path: '/innate-portrait-config', label: '先天画像权重配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  352. { path: '/numsoul-detail-config', label: '数字能量配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  353. ]},
  354. // --- 虚拟团队 ---
  355. { title: '虚拟团队', icon: 'el-icon-s-custom', perm: 'system:base',
  356. children: [
  357. { path: '/virtual-teams', label: '虚拟团队', icon: 'el-icon-s-custom', perm: 'system:base' },
  358. ]},
  359. // --- 组织管理(平台运营创建组织;org_admin 由路由守卫分流到自身组织大屏) ---
  360. { path: '/org', label: '组织管理', icon: 'el-icon-office-building', perm: 'system:org' },
  361. ]},
  362. ],
  363. // 需要保持列表状态的页面组件 name(进入编辑/详情返回时保留筛选、页码、勾选)。
  364. // 接入方式:把组件 name 加进数组,并在该页面混入 ListStateMixin(见 src/mixins/ListStateMixin.js)
  365. cachedPages: ['Activities', 'ActivityReview', 'AssetLibrary', 'ArticleAudit', 'ArticleManage', 'AssessmentAssign', 'AssessmentOrders', 'AssessmentProducts', 'ButlerAssignments', 'ButlerAudit', 'CfValueManage', 'Children', 'CommentReview', 'CouponGrantLog', 'CouponManagement', 'DanExecution', 'DanSettlement', 'DataSourceConfig', 'DiscountRuleManagement', 'EcomSupplierManage', 'EmotionAlertManage', 'EnergyRuleManagement', 'Families', 'FamilyEarningsWithdraw', 'FileManage', 'Foods', 'GatesManage', 'GrowthTaskManagement', 'GuideAudit', 'GuideFamilyTask', 'HealthPlanManage', 'HealthReports', 'HomeBannerManage', 'IndicatorCorrelations', 'IndicatorMappings', 'InventoryManage', 'KnowledgeManage', 'MembershipCenter', 'NutritionistAudit', 'NutritionProducts', 'OperationLogs', 'OrchestrationFlow', 'OrderManage', 'PackageAudit', 'PendingRefund', 'PendingRefundAudit', 'Points', 'PointsLog', 'ProductManage', 'ProductPpointManage', 'ProductProfitRate', 'ProfileManagement', 'PromotionManagement', 'ProxyReport', 'ProxyReportUpload', 'PurchaseManagement', 'RecommendationRules', 'ReportManagement', 'ReportParseStatus', 'Rewards', 'SubscriptionManagement', 'SupplierProductManage', 'SupplyManageList', 'SupplySystemList', 'SysConfig', 'SystemPromptManagement', 'Tasks', 'TaskTemplates', 'TeacherConsult', 'TeacherOrders', 'Users', 'VectorKnowledgeBase', 'VendorAudit', 'VirtualTeamList', 'Wishes', 'WithdrawAudit'],
  366. menuLoadFailed: false,
  367. profileDialogVisible: false,
  368. passwordDialogVisible: false,
  369. submitting: false,
  370. profileForm: {
  371. nickname: '',
  372. phone: '',
  373. email: '',
  374. username: '',
  375. realName: ''
  376. },
  377. passwordForm: {
  378. oldPassword: '',
  379. newPassword: '',
  380. confirmPassword: ''
  381. },
  382. inviteCodeVisible: false,
  383. inviteCodeLoading: false,
  384. inviteCodeData: null,
  385. unreadMessageCount: 0,
  386. isMobile: window.innerWidth <= 768,
  387. sidebarVisible: window.innerWidth > 768,
  388. passwordRules: {
  389. oldPassword: [
  390. { required: true, message: '请输入原密码', trigger: 'blur' }
  391. ],
  392. newPassword: [
  393. { required: true, message: '请输入新密码', trigger: 'blur' },
  394. { min: 6, message: '密码长度不能少于6位', trigger: 'blur' }
  395. ],
  396. confirmPassword: [
  397. { required: true, message: '请确认新密码', trigger: 'blur' },
  398. {
  399. validator: (rule, value, callback) => {
  400. if (value !== this.passwordForm.newPassword) {
  401. callback(new Error('两次输入密码不一致'))
  402. } else {
  403. callback()
  404. }
  405. },
  406. trigger: 'blur'
  407. }
  408. ]
  409. }
  410. }
  411. },
  412. computed: {
  413. activeMenu() {
  414. return this.$route.path
  415. },
  416. // 菜单去重(B-7:按 title/path 去重,修复侧边栏菜单重复渲染 bug)
  417. effectiveMenuItems() {
  418. return this.dedupeMenuItems(this.menuItems)
  419. },
  420. currentRole() {
  421. return localStorage.getItem('role') || 'admin'
  422. },
  423. vendorType() {
  424. return localStorage.getItem('vendorType') || ''
  425. },
  426. effectivePerms() {
  427. // 菜单按当前登录身份隔离(登录时选择的身份),多角色账号不再默认并集展示
  428. return getEffectivePermissions([this.currentRole])
  429. },
  430. displayRoles() {
  431. const rolesStr = localStorage.getItem('roles')
  432. const roles = rolesStr ? JSON.parse(rolesStr) : [this.currentRole]
  433. return roles.map(function(r) { return getRoleLabel(r) }).join(' / ')
  434. },
  435. displayUserLabel() {
  436. const adminName = localStorage.getItem('adminName')
  437. if (adminName) {
  438. return adminName + ' (' + this.displayRoles + ')'
  439. }
  440. return this.displayRoles
  441. }
  442. },
  443. watch: {
  444. '$route'() {
  445. if (this.isMobile) {
  446. this.sidebarVisible = false
  447. }
  448. }
  449. },
  450. mounted() {
  451. // 清除可能的 beforeunload 处理,防止页面刷新弹出"离开网站?"提示
  452. window.onbeforeunload = null
  453. // 响应式监听
  454. this.handleResize = this.handleResize.bind(this)
  455. window.addEventListener('resize', this.handleResize)
  456. // 有消息权限(老师/营养师角色)才加载未读数,管理员不调用
  457. if (hasPermission(this.effectivePerms, 'messages') && this.currentRole !== 'admin') {
  458. this.fetchUnreadCount()
  459. }
  460. // 从后端加载菜单(/api/admin/menu/tree),失败则使用硬编码菜单
  461. this.fetchMenu()
  462. },
  463. beforeDestroy() {
  464. window.removeEventListener('resize', this.handleResize)
  465. },
  466. methods: {
  467. /**
  468. * 菜单去重:同层级内按 (title || path) + path 组合键去重,递归处理 children
  469. * 防止后端动态菜单与硬编码/全量菜单数据重叠时侧边栏重复渲染
  470. */
  471. dedupeMenuItems(items) {
  472. if (!items || items.length === 0) return items
  473. const seen = {}
  474. const result = []
  475. for (let i = 0; i < items.length; i++) {
  476. const it = items[i]
  477. const key = (it.title || '') + '|' + (it.path || '') + '|' + (it.label || '')
  478. if (seen[key]) continue
  479. seen[key] = true
  480. if (it.children && it.children.length > 0) {
  481. const copy = Object.assign({}, it)
  482. copy.children = this.dedupeMenuItems(it.children)
  483. result.push(copy)
  484. } else {
  485. result.push(it)
  486. }
  487. }
  488. return result
  489. },
  490. hasPerm(required) {
  491. return hasPermission(this.effectivePerms, required)
  492. },
  493. getMenuIndex(item) {
  494. return item.path === '/dashboard' && this.currentRole === 'teacher'
  495. ? '/teacher-dashboard'
  496. : item.path
  497. },
  498. handleMenuSelect(index) {
  499. if (index && index.startsWith('/')) {
  500. this.$router.push(index)
  501. }
  502. if (this.isMobile) {
  503. this.sidebarVisible = false
  504. }
  505. },
  506. toggleSidebar() {
  507. this.sidebarVisible = !this.sidebarVisible
  508. },
  509. handleResize() {
  510. const mobile = window.innerWidth <= 768
  511. if (mobile !== this.isMobile) {
  512. this.isMobile = mobile
  513. if (!mobile) {
  514. this.sidebarVisible = true
  515. } else {
  516. this.sidebarVisible = false
  517. }
  518. }
  519. },
  520. async fetchMenu() {
  521. try {
  522. var res = await getUserMenus()
  523. if (res.code === 200 && res.data && res.data.length > 0) {
  524. this.menuItems = this.buildMenuItems(res.data)
  525. this.menuLoadFailed = false
  526. } else {
  527. this.menuLoadFailed = true
  528. }
  529. } catch (e) {
  530. this.menuLoadFailed = true
  531. console.error('菜单加载失败', e)
  532. }
  533. },
  534. buildMenuItems(nodes) {
  535. var result = []
  536. for (var i = 0; i < nodes.length; i++) {
  537. var n = nodes[i]
  538. var item = {}
  539. if (n.path) {
  540. item.path = n.path
  541. item.label = n.label || n.title || ''
  542. item.icon = n.icon || ''
  543. item.perm = n.perm || ''
  544. } else {
  545. item.title = n.title || ''
  546. item.label = n.label || ''
  547. item.icon = n.icon || ''
  548. item.perm = n.perm || ''
  549. }
  550. if (n.children && n.children.length > 0) {
  551. item.children = this.buildMenuItems(n.children)
  552. }
  553. result.push(item)
  554. }
  555. return result
  556. },
  557. handleProfileCommand(command) {
  558. if (command === 'profile') {
  559. this.loadAdminInfo()
  560. this.profileDialogVisible = true
  561. } else if (command === 'password') {
  562. this.passwordForm = { oldPassword: '', newPassword: '', confirmPassword: '' }
  563. this.passwordDialogVisible = true
  564. } else if (command === 'logout') {
  565. this.handleLogout()
  566. }
  567. },
  568. async loadAdminInfo() {
  569. try {
  570. const res = await getAdminInfo()
  571. this.profileForm = {
  572. nickname: res.data.nickname || '',
  573. phone: res.data.phone || '',
  574. email: res.data.email || '',
  575. username: res.data.username || '',
  576. realName: res.data.realName || ''
  577. }
  578. } catch (e) {
  579. this.$message.error('加载个人信息失败')
  580. }
  581. },
  582. async confirmUpdateInfo() {
  583. this.submitting = true
  584. try {
  585. await updateAdminInfo({
  586. nickname: this.profileForm.nickname,
  587. phone: this.profileForm.phone,
  588. email: this.profileForm.email
  589. })
  590. if (this.profileForm.nickname) {
  591. localStorage.setItem('adminName', this.profileForm.nickname)
  592. }
  593. this.$message.success('保存成功')
  594. this.profileDialogVisible = false
  595. } catch (e) {
  596. this.$message.error(e.message || '保存失败')
  597. } finally {
  598. this.submitting = false
  599. }
  600. },
  601. async confirmChangePassword() {
  602. this.$refs.passwordForm.validate(async (valid) => {
  603. if (!valid) return
  604. this.submitting = true
  605. try {
  606. await changePassword({
  607. oldPassword: this.passwordForm.oldPassword,
  608. newPassword: this.passwordForm.newPassword
  609. })
  610. this.$message.success('密码修改成功')
  611. this.passwordDialogVisible = false
  612. } catch (e) {
  613. this.$message.error(e.message || '密码修改失败')
  614. } finally {
  615. this.submitting = false
  616. }
  617. })
  618. },
  619. async showInviteCode() {
  620. this.inviteCodeVisible = true
  621. this.inviteCodeLoading = true
  622. this.inviteCodeData = null
  623. try {
  624. const res = await getMyInviteCode()
  625. if (res.data) {
  626. this.inviteCodeData = res.data
  627. }
  628. } catch (e) {
  629. this.$message.error('获取邀请码失败')
  630. } finally {
  631. this.inviteCodeLoading = false
  632. }
  633. },
  634. async generateInviteCode() {
  635. this.inviteCodeLoading = true
  636. try {
  637. const res = await getMyInviteCode()
  638. if (res.data) {
  639. this.inviteCodeData = res.data
  640. this.$message.success('邀请码已生成')
  641. }
  642. } catch (e) {
  643. this.$message.error('生成邀请码失败')
  644. } finally {
  645. this.inviteCodeLoading = false
  646. }
  647. },
  648. copyCode(code) {
  649. if (!code) return
  650. const input = document.createElement('input')
  651. input.value = code
  652. document.body.appendChild(input)
  653. input.select()
  654. document.execCommand('copy')
  655. document.body.removeChild(input)
  656. this.$message.success('已复制邀请码')
  657. },
  658. async fetchUnreadCount() {
  659. try {
  660. const res = await getUnreadMessageCount()
  661. if (res.data !== undefined) {
  662. this.unreadMessageCount = res.data || 0
  663. }
  664. } catch (e) {
  665. // silent: not critical
  666. }
  667. },
  668. handleMessageClick() {
  669. this.$router.push('/teacher-messages')
  670. },
  671. handleLogout() {
  672. // 不使用 modal 遮罩(全局 .v-modal { display:none } 会与 $confirm 的遮罩冲突)
  673. this.$confirm('确定要退出登录吗?', '提示', {
  674. confirmButtonText: '确定',
  675. cancelButtonText: '取消',
  676. type: 'warning',
  677. modal: false,
  678. customClass: 'cfc-logout-confirm'
  679. }).then(() => {
  680. localStorage.removeItem('token')
  681. localStorage.removeItem('role')
  682. localStorage.removeItem('roles')
  683. localStorage.removeItem('adminId')
  684. localStorage.removeItem('adminName')
  685. this.$router.push('/login')
  686. })
  687. }
  688. }
  689. }
  690. </script>
  691. <style>
  692. /* 全局防御:防止 Element UI 弹窗或组件残留 DOM 产生遮罩覆盖 */
  693. .v-modal {
  694. display: none !important;
  695. }
  696. .layout-container {
  697. height: 100vh;
  698. }
  699. .el-aside {
  700. background-color: #001529;
  701. overflow: visible;
  702. display: flex;
  703. flex-direction: column;
  704. }
  705. .logo {
  706. height: 60px;
  707. line-height: 60px;
  708. text-align: center;
  709. color: var(--adm-bg-container);
  710. font-size: 20px;
  711. font-weight: bold;
  712. background-color: #001529;
  713. flex-shrink: 0;
  714. }
  715. /* 侧边栏滚动条样式 */
  716. .sidebar-scrollbar-wrap {
  717. height: calc(100vh - 60px) !important;
  718. overflow-x: hidden !important;
  719. overflow-y: auto !important;
  720. }
  721. .sidebar-scrollbar-wrap .el-scrollbar__view {
  722. height: 100%;
  723. }
  724. .sidebar-scrollbar-wrap::-webkit-scrollbar {
  725. width: 6px;
  726. }
  727. .sidebar-scrollbar-wrap::-webkit-scrollbar-track {
  728. background: #001529;
  729. }
  730. .sidebar-scrollbar-wrap::-webkit-scrollbar-thumb {
  731. background: #4a5568;
  732. border-radius: 2px;
  733. }
  734. .sidebar-scrollbar-wrap::-webkit-scrollbar-thumb:hover {
  735. background: #5a6578;
  736. }
  737. .el-header {
  738. background-color: var(--adm-bg-container);
  739. box-shadow: 0 1px 4px rgba(0,21,41,.08);
  740. display: flex;
  741. justify-content: space-between;
  742. align-items: center;
  743. padding: 0 24px;
  744. }
  745. .header-right {
  746. display: flex;
  747. align-items: center;
  748. gap: 12px;
  749. margin-left: auto;
  750. }
  751. .username {
  752. color: #606266;
  753. }
  754. .invite-code-btn {
  755. color: var(--adm-primary);
  756. font-size: 14px;
  757. }
  758. .invite-code-btn:hover {
  759. color: #4F46E5;
  760. }
  761. .msg-badge {
  762. margin-right: 4px;
  763. }
  764. .msg-badge .el-badge__content.is-fixed {
  765. top: 10px;
  766. right: 6px;
  767. }
  768. .msg-btn {
  769. font-size: 18px;
  770. color: #606266;
  771. padding: 4px;
  772. }
  773. .msg-btn:hover {
  774. color: var(--adm-primary);
  775. }
  776. .invite-code-content {
  777. padding: 8px 0;
  778. }
  779. .invite-code-section {
  780. background: var(--adm-bg-header);
  781. border: 1px solid var(--adm-border-split);
  782. border-radius: 8px;
  783. padding: 24px;
  784. text-align: center;
  785. }
  786. .invite-code-label {
  787. font-size: 14px;
  788. color: var(--adm-text-45);
  789. margin-bottom: 12px;
  790. }
  791. .invite-code-value {
  792. display: flex;
  793. align-items: center;
  794. justify-content: center;
  795. gap: 12px;
  796. margin-bottom: 8px;
  797. }
  798. .code-text {
  799. font-size: 28px;
  800. font-weight: 700;
  801. letter-spacing: 6px;
  802. color: var(--adm-text-88);
  803. font-family: monospace;
  804. }
  805. .no-invite-code {
  806. text-align: center;
  807. padding: 24px;
  808. color: var(--adm-text-45);
  809. }
  810. .no-invite-code i {
  811. font-size: 48px;
  812. margin-bottom: 12px;
  813. }
  814. .no-invite-code p {
  815. margin-bottom: 16px;
  816. }
  817. .el-main {
  818. background-color: #f0f2f5;
  819. padding: 24px;
  820. position: relative;
  821. z-index: 1;
  822. display: flex;
  823. flex-direction: column;
  824. min-height: 0;
  825. overflow-y: auto;
  826. }
  827. .main-wrapper {
  828. flex: 1;
  829. display: flex;
  830. flex-direction: column;
  831. min-height: 0;
  832. }
  833. /* ========== 全局 .admin-page 样式 ========== */
  834. /* 所有后台维护页面根元素使用此 class,使页面内容充满可视区 */
  835. .admin-page {
  836. flex: 1;
  837. display: flex;
  838. flex-direction: column;
  839. min-height: 0;
  840. }
  841. /* 当 admin-page 的直接子元素是 el-card 时让卡片自动填充 */
  842. .admin-page > .el-card {
  843. flex: 1;
  844. display: flex;
  845. flex-direction: column;
  846. min-height: 0;
  847. }
  848. .admin-page > .el-card .el-card__body {
  849. flex: 1;
  850. display: flex;
  851. flex-direction: column;
  852. min-height: 0;
  853. padding: 20px;
  854. }
  855. /* 当 admin-page > div > el-card(如 ArticleManage 的嵌套 div) */
  856. .admin-page > div:only-child {
  857. flex: 1;
  858. display: flex;
  859. flex-direction: column;
  860. min-height: 0;
  861. }
  862. .admin-page > div:only-child > .el-card {
  863. flex: 1;
  864. display: flex;
  865. flex-direction: column;
  866. min-height: 0;
  867. }
  868. .admin-page > div:only-child > .el-card .el-card__body {
  869. flex: 1;
  870. display: flex;
  871. flex-direction: column;
  872. min-height: 0;
  873. padding: 20px;
  874. }
  875. /* ========== 响应式:侧边栏折叠 ========== */
  876. @media (max-width: 768px) {
  877. .sidebar-overlay {
  878. position: fixed;
  879. top: 0;
  880. left: 0;
  881. right: 0;
  882. bottom: 0;
  883. background: rgba(0, 0, 0, 0.4);
  884. z-index: 1001;
  885. }
  886. .sidebar-mobile {
  887. position: fixed !important;
  888. top: 0;
  889. left: 0;
  890. height: 100vh !important;
  891. z-index: 1002;
  892. transition: transform 0.25s ease;
  893. transform: translateX(-100%);
  894. }
  895. .sidebar-mobile.sidebar-open {
  896. transform: translateX(0);
  897. }
  898. .sidebar-mobile.sidebar-closed {
  899. transform: translateX(-100%);
  900. }
  901. .header-left {
  902. display: flex;
  903. align-items: center;
  904. }
  905. .hamburger-btn {
  906. font-size: 20px;
  907. color: #606266;
  908. padding: 8px;
  909. }
  910. .hamburger-btn:hover {
  911. color: var(--adm-primary);
  912. }
  913. .el-header {
  914. padding: 0 10px !important;
  915. }
  916. .el-main {
  917. padding: 12px !important;
  918. }
  919. .admin-page > .el-card .el-card__body {
  920. padding: 12px !important;
  921. }
  922. .admin-page > div:only-child > .el-card .el-card__body {
  923. padding: 12px !important;
  924. }
  925. .username {
  926. font-size: 14px;
  927. }
  928. /* el-table 小屏字号 */
  929. .el-table {
  930. font-size: 12px;
  931. }
  932. .el-table .cell {
  933. padding-left: 4px !important;
  934. padding-right: 4px !important;
  935. }
  936. /* 表格横向滚动优化 */
  937. .el-table {
  938. min-width: 600px !important;
  939. table-layout: auto !important;
  940. }
  941. .el-table__body-wrapper {
  942. overflow-x: auto !important;
  943. -webkit-overflow-scrolling: touch;
  944. }
  945. /* 搜索表单:form-item 换行 */
  946. .el-form-item--inline {
  947. display: block !important;
  948. margin-bottom: 12px !important;
  949. }
  950. .el-form-item--inline .el-form-item__content {
  951. display: flex !important;
  952. width: 100% !important;
  953. margin-left: 0 !important;
  954. }
  955. .el-form-item--inline .el-form-item__label {
  956. display: block !important;
  957. text-align: left !important;
  958. margin-bottom: 4px !important;
  959. }
  960. /* 搜索表单中 el-input/el-select 宽度 100% */
  961. .el-form-item--inline .el-input,
  962. .el-form-item--inline .el-select,
  963. .el-form-item--inline .el-date-editor {
  964. width: 100% !important;
  965. }
  966. /* 文章编辑等复杂表单 */
  967. .el-form--inline .el-form-item {
  968. display: block !important;
  969. }
  970. .el-form--inline .el-form-item__content {
  971. display: block !important;
  972. width: 100% !important;
  973. margin-left: 0 !important;
  974. }
  975. .el-form--inline .el-form-item__label {
  976. text-align: left !important;
  977. display: block !important;
  978. }
  979. /* 通用:卡片内容紧凑 */
  980. .stat-card {
  981. margin-bottom: 12px !important;
  982. }
  983. }
  984. /* 桌面端隐藏 header-left(无汉堡按钮) */
  985. @media (min-width: 769px) {
  986. .header-left {
  987. display: none;
  988. }
  989. }
  990. .menu-load-failed {
  991. padding: 24px 16px;
  992. text-align: center;
  993. color: var(--adm-sidebar-text-muted);
  994. }
  995. .menu-load-failed .el-icon-warning-outline {
  996. font-size: 28px;
  997. color: var(--adm-warning);
  998. }
  999. .menu-load-failed-title {
  1000. margin: 8px 0 0;
  1001. font-size: 14px;
  1002. font-weight: 600;
  1003. color: var(--adm-sidebar-text);
  1004. }
  1005. .menu-load-failed-sub {
  1006. margin: 4px 0 0;
  1007. font-size: 12px;
  1008. color: var(--adm-sidebar-text-muted);
  1009. }
  1010. </style>