Layout.vue 43 KB

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