Layout.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071
  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: '/guide-config', label: '引导配置', icon: 'el-icon-setting', perm: 'system:base' },
  304. { path: '/users', label: '用户管理', icon: 'el-icon-user', perm: 'system:users' },
  305. { path: '/menu-manage', label: '菜单管理', icon: 'el-icon-menu', perm: 'system:menu' },
  306. { path: '/operation-logs', label: '操作日志', icon: 'el-icon-s-order', perm: 'system:logs' },
  307. { path: '/membership-center', label: '会员中心', icon: 'el-icon-s-custom', perm: 'config:member' },
  308. { path: '/badge-manage', label: '勋章管理', icon: 'el-icon-medal', perm: 'config:member' },
  309. { path: '/virtual-goods-config', label: '虚拟支付道具', icon: 'el-icon-goods', perm: 'config:member' },
  310. { path: '/gates', label: '关卡配置', icon: 'el-icon-key', perm: 'system:base' },
  311. { path: '/system-prompt', label: '系统提示词', icon: 'el-icon-chat-line-square', perm: 'system:base' },
  312. { path: '/file-manage', label: '文件管理', icon: 'el-icon-files', perm: 'system:base' },
  313. { path: '/admin/asset-library', label: '素材库', icon: 'el-icon-picture-outline', perm: 'system:base' },
  314. ]},
  315. // --- 配置中心(统一配置中心 service_config;W0.2 双配置中心合并后单一入口) ---
  316. { title: '配置中心', icon: 'el-icon-setting', perm: 'config:dimension',
  317. children: [
  318. { path: '/config-center', label: '配置中心', icon: 'el-icon-setting', perm: 'config:dimension' },
  319. { path: '/dimension-config', label: '维度配置', icon: 'el-icon-data-line', perm: 'config:dimension' },
  320. ]},
  321. // --- 供应商体系 ---
  322. { title: '供应商体系', icon: 'el-icon-s-management', perm: 'system:supply',
  323. children: [
  324. { path: '/supply-system', label: '供应商体系', icon: 'el-icon-s-management', perm: 'system:supply' },
  325. ]},
  326. // --- 供应商管理 ---
  327. { title: '供应商管理', icon: 'el-icon-s-shop', perm: 'supply:manage',
  328. children: [
  329. { path: '/supply-manage', label: '供应商管理', icon: 'el-icon-s-shop', perm: 'supply:manage' },
  330. { path: '/supplier-products', label: '商品管理', icon: 'el-icon-s-goods', perm: 'supply:manage' },
  331. ]},
  332. // --- 健康配置(能量规则/行为/周期性服务已从健康饮食移入;术语统一:五维能量配置) ---
  333. { title: '健康配置', icon: 'el-icon-first-aid-kit', perm: 'config:health',
  334. children: [
  335. { path: '/health-norm-config', label: '健康常模', icon: 'el-icon-data-line', perm: 'config:health' },
  336. { path: '/health-data-source', label: '健康数据源', icon: 'el-icon-data-line', perm: 'config:health' },
  337. { path: '/health-energy-config', label: '五维能量配置', icon: 'el-icon-data-line', perm: 'config:health' },
  338. { path: '/energy-rule', label: '能量规则管理', icon: 'el-icon-setting', perm: 'config:health' },
  339. { path: '/energy-behavior-config', label: '能量行为配置', icon: 'el-icon-edit-outline', perm: 'config:health' },
  340. { path: '/periodic-service-config', label: '周期性服务配置', icon: 'el-icon-refresh', perm: 'config:health' },
  341. { path: '/indicator-correlations', label: '指标关联配置', icon: 'el-icon-connection', perm: 'config:health' },
  342. { path: '/indicator-mappings', label: '指标映射管理', icon: 'el-icon-sort', perm: 'config:health' },
  343. ]},
  344. // --- 人生维度 ---
  345. { title: '人生维度', icon: 'el-icon-s-custom', perm: 'config:dimension',
  346. children: [
  347. { path: '/zodiac-configs', label: '星座配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  348. { path: '/bazi-configs', label: '八字配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  349. { path: '/blood-type-configs', label: '血型配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  350. { path: '/innate-portrait-config', label: '先天画像权重配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  351. { path: '/numsoul-detail-config', label: '数字能量配置', icon: 'el-icon-s-management', perm: 'config:dimension' },
  352. ]},
  353. // --- 虚拟团队 ---
  354. { title: '虚拟团队', icon: 'el-icon-s-custom', perm: 'system:base',
  355. children: [
  356. { path: '/virtual-teams', label: '虚拟团队', icon: 'el-icon-s-custom', perm: 'system:base' },
  357. ]},
  358. // --- 组织管理(平台运营创建组织;org_admin 由路由守卫分流到自身组织大屏) ---
  359. { path: '/org', label: '组织管理', icon: 'el-icon-office-building', perm: 'system:org' },
  360. ]},
  361. ],
  362. // 需要保持列表状态的页面组件 name(进入编辑/详情返回时保留筛选、页码、勾选)。
  363. // 接入方式:把组件 name 加进数组,并在该页面混入 ListStateMixin(见 src/mixins/ListStateMixin.js)
  364. 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'],
  365. menuLoadFailed: false,
  366. profileDialogVisible: false,
  367. passwordDialogVisible: false,
  368. submitting: false,
  369. profileForm: {
  370. nickname: '',
  371. phone: '',
  372. email: '',
  373. username: '',
  374. realName: ''
  375. },
  376. passwordForm: {
  377. oldPassword: '',
  378. newPassword: '',
  379. confirmPassword: ''
  380. },
  381. inviteCodeVisible: false,
  382. inviteCodeLoading: false,
  383. inviteCodeData: null,
  384. unreadMessageCount: 0,
  385. isMobile: window.innerWidth <= 768,
  386. sidebarVisible: window.innerWidth > 768,
  387. passwordRules: {
  388. oldPassword: [
  389. { required: true, message: '请输入原密码', trigger: 'blur' }
  390. ],
  391. newPassword: [
  392. { required: true, message: '请输入新密码', trigger: 'blur' },
  393. { min: 6, message: '密码长度不能少于6位', trigger: 'blur' }
  394. ],
  395. confirmPassword: [
  396. { required: true, message: '请确认新密码', trigger: 'blur' },
  397. {
  398. validator: (rule, value, callback) => {
  399. if (value !== this.passwordForm.newPassword) {
  400. callback(new Error('两次输入密码不一致'))
  401. } else {
  402. callback()
  403. }
  404. },
  405. trigger: 'blur'
  406. }
  407. ]
  408. }
  409. }
  410. },
  411. computed: {
  412. activeMenu() {
  413. return this.$route.path
  414. },
  415. // 菜单去重(B-7:按 title/path 去重,修复侧边栏菜单重复渲染 bug)
  416. effectiveMenuItems() {
  417. return this.dedupeMenuItems(this.menuItems)
  418. },
  419. currentRole() {
  420. return localStorage.getItem('role') || 'admin'
  421. },
  422. vendorType() {
  423. return localStorage.getItem('vendorType') || ''
  424. },
  425. effectivePerms() {
  426. // 菜单按当前登录身份隔离(登录时选择的身份),多角色账号不再默认并集展示
  427. return getEffectivePermissions([this.currentRole])
  428. },
  429. displayRoles() {
  430. const rolesStr = localStorage.getItem('roles')
  431. const roles = rolesStr ? JSON.parse(rolesStr) : [this.currentRole]
  432. return roles.map(function(r) { return getRoleLabel(r) }).join(' / ')
  433. },
  434. displayUserLabel() {
  435. const adminName = localStorage.getItem('adminName')
  436. if (adminName) {
  437. return adminName + ' (' + this.displayRoles + ')'
  438. }
  439. return this.displayRoles
  440. }
  441. },
  442. watch: {
  443. '$route'() {
  444. if (this.isMobile) {
  445. this.sidebarVisible = false
  446. }
  447. }
  448. },
  449. mounted() {
  450. // 清除可能的 beforeunload 处理,防止页面刷新弹出"离开网站?"提示
  451. window.onbeforeunload = null
  452. // 响应式监听
  453. this.handleResize = this.handleResize.bind(this)
  454. window.addEventListener('resize', this.handleResize)
  455. // 有消息权限(老师/营养师角色)才加载未读数,管理员不调用
  456. if (hasPermission(this.effectivePerms, 'messages') && this.currentRole !== 'admin') {
  457. this.fetchUnreadCount()
  458. }
  459. // 从后端加载菜单(/api/admin/menu/tree),失败则使用硬编码菜单
  460. this.fetchMenu()
  461. },
  462. beforeDestroy() {
  463. window.removeEventListener('resize', this.handleResize)
  464. },
  465. methods: {
  466. /**
  467. * 菜单去重:同层级内按 (title || path) + path 组合键去重,递归处理 children
  468. * 防止后端动态菜单与硬编码/全量菜单数据重叠时侧边栏重复渲染
  469. */
  470. dedupeMenuItems(items) {
  471. if (!items || items.length === 0) return items
  472. const seen = {}
  473. const result = []
  474. for (let i = 0; i < items.length; i++) {
  475. const it = items[i]
  476. const key = (it.title || '') + '|' + (it.path || '') + '|' + (it.label || '')
  477. if (seen[key]) continue
  478. seen[key] = true
  479. if (it.children && it.children.length > 0) {
  480. const copy = Object.assign({}, it)
  481. copy.children = this.dedupeMenuItems(it.children)
  482. result.push(copy)
  483. } else {
  484. result.push(it)
  485. }
  486. }
  487. return result
  488. },
  489. hasPerm(required) {
  490. return hasPermission(this.effectivePerms, required)
  491. },
  492. getMenuIndex(item) {
  493. return item.path === '/dashboard' && this.currentRole === 'teacher'
  494. ? '/teacher-dashboard'
  495. : item.path
  496. },
  497. handleMenuSelect(index) {
  498. if (index && index.startsWith('/')) {
  499. this.$router.push(index)
  500. }
  501. if (this.isMobile) {
  502. this.sidebarVisible = false
  503. }
  504. },
  505. toggleSidebar() {
  506. this.sidebarVisible = !this.sidebarVisible
  507. },
  508. handleResize() {
  509. const mobile = window.innerWidth <= 768
  510. if (mobile !== this.isMobile) {
  511. this.isMobile = mobile
  512. if (!mobile) {
  513. this.sidebarVisible = true
  514. } else {
  515. this.sidebarVisible = false
  516. }
  517. }
  518. },
  519. async fetchMenu() {
  520. try {
  521. var res = await getUserMenus()
  522. if (res.code === 200 && res.data && res.data.length > 0) {
  523. this.menuItems = this.buildMenuItems(res.data)
  524. this.menuLoadFailed = false
  525. } else {
  526. this.menuLoadFailed = true
  527. }
  528. } catch (e) {
  529. this.menuLoadFailed = true
  530. console.error('菜单加载失败', e)
  531. }
  532. },
  533. buildMenuItems(nodes) {
  534. var result = []
  535. for (var i = 0; i < nodes.length; i++) {
  536. var n = nodes[i]
  537. var item = {}
  538. if (n.path) {
  539. item.path = n.path
  540. item.label = n.label || n.title || ''
  541. item.icon = n.icon || ''
  542. item.perm = n.perm || ''
  543. } else {
  544. item.title = n.title || ''
  545. item.label = n.label || ''
  546. item.icon = n.icon || ''
  547. item.perm = n.perm || ''
  548. }
  549. if (n.children && n.children.length > 0) {
  550. item.children = this.buildMenuItems(n.children)
  551. }
  552. result.push(item)
  553. }
  554. return result
  555. },
  556. handleProfileCommand(command) {
  557. if (command === 'profile') {
  558. this.loadAdminInfo()
  559. this.profileDialogVisible = true
  560. } else if (command === 'password') {
  561. this.passwordForm = { oldPassword: '', newPassword: '', confirmPassword: '' }
  562. this.passwordDialogVisible = true
  563. } else if (command === 'logout') {
  564. this.handleLogout()
  565. }
  566. },
  567. async loadAdminInfo() {
  568. try {
  569. const res = await getAdminInfo()
  570. this.profileForm = {
  571. nickname: res.data.nickname || '',
  572. phone: res.data.phone || '',
  573. email: res.data.email || '',
  574. username: res.data.username || '',
  575. realName: res.data.realName || ''
  576. }
  577. } catch (e) {
  578. this.$message.error('加载个人信息失败')
  579. }
  580. },
  581. async confirmUpdateInfo() {
  582. this.submitting = true
  583. try {
  584. await updateAdminInfo({
  585. nickname: this.profileForm.nickname,
  586. phone: this.profileForm.phone,
  587. email: this.profileForm.email
  588. })
  589. if (this.profileForm.nickname) {
  590. localStorage.setItem('adminName', this.profileForm.nickname)
  591. }
  592. this.$message.success('保存成功')
  593. this.profileDialogVisible = false
  594. } catch (e) {
  595. this.$message.error(e.message || '保存失败')
  596. } finally {
  597. this.submitting = false
  598. }
  599. },
  600. async confirmChangePassword() {
  601. this.$refs.passwordForm.validate(async (valid) => {
  602. if (!valid) return
  603. this.submitting = true
  604. try {
  605. await changePassword({
  606. oldPassword: this.passwordForm.oldPassword,
  607. newPassword: this.passwordForm.newPassword
  608. })
  609. this.$message.success('密码修改成功')
  610. this.passwordDialogVisible = false
  611. } catch (e) {
  612. this.$message.error(e.message || '密码修改失败')
  613. } finally {
  614. this.submitting = false
  615. }
  616. })
  617. },
  618. async showInviteCode() {
  619. this.inviteCodeVisible = true
  620. this.inviteCodeLoading = true
  621. this.inviteCodeData = null
  622. try {
  623. const res = await getMyInviteCode()
  624. if (res.data) {
  625. this.inviteCodeData = res.data
  626. }
  627. } catch (e) {
  628. this.$message.error('获取邀请码失败')
  629. } finally {
  630. this.inviteCodeLoading = false
  631. }
  632. },
  633. async generateInviteCode() {
  634. this.inviteCodeLoading = true
  635. try {
  636. const res = await getMyInviteCode()
  637. if (res.data) {
  638. this.inviteCodeData = res.data
  639. this.$message.success('邀请码已生成')
  640. }
  641. } catch (e) {
  642. this.$message.error('生成邀请码失败')
  643. } finally {
  644. this.inviteCodeLoading = false
  645. }
  646. },
  647. copyCode(code) {
  648. if (!code) return
  649. const input = document.createElement('input')
  650. input.value = code
  651. document.body.appendChild(input)
  652. input.select()
  653. document.execCommand('copy')
  654. document.body.removeChild(input)
  655. this.$message.success('已复制邀请码')
  656. },
  657. async fetchUnreadCount() {
  658. try {
  659. const res = await getUnreadMessageCount()
  660. if (res.data !== undefined) {
  661. this.unreadMessageCount = res.data || 0
  662. }
  663. } catch (e) {
  664. // silent: not critical
  665. }
  666. },
  667. handleMessageClick() {
  668. this.$router.push('/teacher-messages')
  669. },
  670. handleLogout() {
  671. // 不使用 modal 遮罩(全局 .v-modal { display:none } 会与 $confirm 的遮罩冲突)
  672. this.$confirm('确定要退出登录吗?', '提示', {
  673. confirmButtonText: '确定',
  674. cancelButtonText: '取消',
  675. type: 'warning',
  676. modal: false,
  677. customClass: 'cfc-logout-confirm'
  678. }).then(() => {
  679. localStorage.removeItem('token')
  680. localStorage.removeItem('role')
  681. localStorage.removeItem('roles')
  682. localStorage.removeItem('adminId')
  683. localStorage.removeItem('adminName')
  684. this.$router.push('/login')
  685. })
  686. }
  687. }
  688. }
  689. </script>
  690. <style>
  691. /* 全局防御:防止 Element UI 弹窗或组件残留 DOM 产生遮罩覆盖 */
  692. .v-modal {
  693. display: none !important;
  694. }
  695. .layout-container {
  696. height: 100vh;
  697. }
  698. .el-aside {
  699. background-color: #001529;
  700. overflow: visible;
  701. display: flex;
  702. flex-direction: column;
  703. }
  704. .logo {
  705. height: 60px;
  706. line-height: 60px;
  707. text-align: center;
  708. color: var(--adm-bg-container);
  709. font-size: 20px;
  710. font-weight: bold;
  711. background-color: #001529;
  712. flex-shrink: 0;
  713. }
  714. /* 侧边栏滚动条样式 */
  715. .sidebar-scrollbar-wrap {
  716. height: calc(100vh - 60px) !important;
  717. overflow-x: hidden !important;
  718. overflow-y: auto !important;
  719. }
  720. .sidebar-scrollbar-wrap .el-scrollbar__view {
  721. height: 100%;
  722. }
  723. .sidebar-scrollbar-wrap::-webkit-scrollbar {
  724. width: 6px;
  725. }
  726. .sidebar-scrollbar-wrap::-webkit-scrollbar-track {
  727. background: #001529;
  728. }
  729. .sidebar-scrollbar-wrap::-webkit-scrollbar-thumb {
  730. background: #4a5568;
  731. border-radius: 2px;
  732. }
  733. .sidebar-scrollbar-wrap::-webkit-scrollbar-thumb:hover {
  734. background: #5a6578;
  735. }
  736. .el-header {
  737. background-color: var(--adm-bg-container);
  738. box-shadow: 0 1px 4px rgba(0,21,41,.08);
  739. display: flex;
  740. justify-content: space-between;
  741. align-items: center;
  742. padding: 0 24px;
  743. }
  744. .header-right {
  745. display: flex;
  746. align-items: center;
  747. gap: 12px;
  748. margin-left: auto;
  749. }
  750. .username {
  751. color: #606266;
  752. }
  753. .invite-code-btn {
  754. color: var(--adm-primary);
  755. font-size: 14px;
  756. }
  757. .invite-code-btn:hover {
  758. color: #4F46E5;
  759. }
  760. .msg-badge {
  761. margin-right: 4px;
  762. }
  763. .msg-badge .el-badge__content.is-fixed {
  764. top: 10px;
  765. right: 6px;
  766. }
  767. .msg-btn {
  768. font-size: 18px;
  769. color: #606266;
  770. padding: 4px;
  771. }
  772. .msg-btn:hover {
  773. color: var(--adm-primary);
  774. }
  775. .invite-code-content {
  776. padding: 8px 0;
  777. }
  778. .invite-code-section {
  779. background: var(--adm-bg-header);
  780. border: 1px solid var(--adm-border-split);
  781. border-radius: 8px;
  782. padding: 24px;
  783. text-align: center;
  784. }
  785. .invite-code-label {
  786. font-size: 14px;
  787. color: var(--adm-text-45);
  788. margin-bottom: 12px;
  789. }
  790. .invite-code-value {
  791. display: flex;
  792. align-items: center;
  793. justify-content: center;
  794. gap: 12px;
  795. margin-bottom: 8px;
  796. }
  797. .code-text {
  798. font-size: 28px;
  799. font-weight: 700;
  800. letter-spacing: 6px;
  801. color: var(--adm-text-88);
  802. font-family: monospace;
  803. }
  804. .no-invite-code {
  805. text-align: center;
  806. padding: 24px;
  807. color: var(--adm-text-45);
  808. }
  809. .no-invite-code i {
  810. font-size: 48px;
  811. margin-bottom: 12px;
  812. }
  813. .no-invite-code p {
  814. margin-bottom: 16px;
  815. }
  816. .el-main {
  817. background-color: #f0f2f5;
  818. padding: 24px;
  819. position: relative;
  820. z-index: 1;
  821. display: flex;
  822. flex-direction: column;
  823. min-height: 0;
  824. overflow-y: auto;
  825. }
  826. .main-wrapper {
  827. flex: 1;
  828. display: flex;
  829. flex-direction: column;
  830. min-height: 0;
  831. }
  832. /* ========== 全局 .admin-page 样式 ========== */
  833. /* 所有后台维护页面根元素使用此 class,使页面内容充满可视区 */
  834. .admin-page {
  835. flex: 1;
  836. display: flex;
  837. flex-direction: column;
  838. min-height: 0;
  839. }
  840. /* 当 admin-page 的直接子元素是 el-card 时让卡片自动填充 */
  841. .admin-page > .el-card {
  842. flex: 1;
  843. display: flex;
  844. flex-direction: column;
  845. min-height: 0;
  846. }
  847. .admin-page > .el-card .el-card__body {
  848. flex: 1;
  849. display: flex;
  850. flex-direction: column;
  851. min-height: 0;
  852. padding: 24px;
  853. }
  854. /* 当 admin-page > div > el-card(如 ArticleManage 的嵌套 div) */
  855. .admin-page > div:only-child {
  856. flex: 1;
  857. display: flex;
  858. flex-direction: column;
  859. min-height: 0;
  860. }
  861. .admin-page > div:only-child > .el-card {
  862. flex: 1;
  863. display: flex;
  864. flex-direction: column;
  865. min-height: 0;
  866. }
  867. .admin-page > div:only-child > .el-card .el-card__body {
  868. flex: 1;
  869. display: flex;
  870. flex-direction: column;
  871. min-height: 0;
  872. padding: 24px;
  873. }
  874. /* ========== 响应式:侧边栏折叠 ========== */
  875. @media (max-width: 768px) {
  876. .sidebar-overlay {
  877. position: fixed;
  878. top: 0;
  879. left: 0;
  880. right: 0;
  881. bottom: 0;
  882. background: rgba(0, 0, 0, 0.4);
  883. z-index: 1001;
  884. }
  885. .sidebar-mobile {
  886. position: fixed !important;
  887. top: 0;
  888. left: 0;
  889. height: 100vh !important;
  890. z-index: 1002;
  891. transition: transform 0.25s ease;
  892. transform: translateX(-100%);
  893. }
  894. .sidebar-mobile.sidebar-open {
  895. transform: translateX(0);
  896. }
  897. .sidebar-mobile.sidebar-closed {
  898. transform: translateX(-100%);
  899. }
  900. .header-left {
  901. display: flex;
  902. align-items: center;
  903. }
  904. .hamburger-btn {
  905. font-size: 20px;
  906. color: #606266;
  907. padding: 8px;
  908. }
  909. .hamburger-btn:hover {
  910. color: var(--adm-primary);
  911. }
  912. .el-header {
  913. padding: 0 10px !important;
  914. }
  915. .el-main {
  916. padding: 12px !important;
  917. }
  918. .admin-page > .el-card .el-card__body {
  919. padding: 12px !important;
  920. }
  921. .admin-page > div:only-child > .el-card .el-card__body {
  922. padding: 12px !important;
  923. }
  924. .username {
  925. font-size: 14px;
  926. }
  927. /* el-table 小屏字号 */
  928. .el-table {
  929. font-size: 12px;
  930. }
  931. .el-table .cell {
  932. padding-left: 4px !important;
  933. padding-right: 4px !important;
  934. }
  935. /* 表格横向滚动优化 */
  936. .el-table {
  937. min-width: 600px !important;
  938. table-layout: auto !important;
  939. }
  940. .el-table__body-wrapper {
  941. overflow-x: auto !important;
  942. -webkit-overflow-scrolling: touch;
  943. }
  944. /* 搜索表单:form-item 换行 */
  945. .el-form-item--inline {
  946. display: block !important;
  947. margin-bottom: 12px !important;
  948. }
  949. .el-form-item--inline .el-form-item__content {
  950. display: flex !important;
  951. width: 100% !important;
  952. margin-left: 0 !important;
  953. }
  954. .el-form-item--inline .el-form-item__label {
  955. display: block !important;
  956. text-align: left !important;
  957. margin-bottom: 4px !important;
  958. }
  959. /* 搜索表单中 el-input/el-select 宽度 100% */
  960. .el-form-item--inline .el-input,
  961. .el-form-item--inline .el-select,
  962. .el-form-item--inline .el-date-editor {
  963. width: 100% !important;
  964. }
  965. /* 文章编辑等复杂表单 */
  966. .el-form--inline .el-form-item {
  967. display: block !important;
  968. }
  969. .el-form--inline .el-form-item__content {
  970. display: block !important;
  971. width: 100% !important;
  972. margin-left: 0 !important;
  973. }
  974. .el-form--inline .el-form-item__label {
  975. text-align: left !important;
  976. display: block !important;
  977. }
  978. /* 通用:卡片内容紧凑 */
  979. .stat-card {
  980. margin-bottom: 12px !important;
  981. }
  982. }
  983. /* 桌面端隐藏 header-left(无汉堡按钮) */
  984. @media (min-width: 769px) {
  985. .header-left {
  986. display: none;
  987. }
  988. }
  989. .menu-load-failed {
  990. padding: 24px 16px;
  991. text-align: center;
  992. color: var(--adm-sidebar-text-muted);
  993. }
  994. .menu-load-failed .el-icon-warning-outline {
  995. font-size: 28px;
  996. color: var(--adm-warning);
  997. }
  998. .menu-load-failed-title {
  999. margin: 8px 0 0;
  1000. font-size: 14px;
  1001. font-weight: 600;
  1002. color: var(--adm-sidebar-text);
  1003. }
  1004. .menu-load-failed-sub {
  1005. margin: 4px 0 0;
  1006. font-size: 12px;
  1007. color: var(--adm-sidebar-text-muted);
  1008. }
  1009. </style>