AppLayout.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. <template>
  2. <div class="layout-wrapper" :class="{ 'full-screen': isFullScreen }" :style="isSpecialBg ? backgroundStyle : {}">
  3. <!-- 背景层 - 关键修改 -->
  4. <div v-if="isSpecialBg" class="background-layer"></div>
  5. <!-- Header 部分(透明背景) -->
  6. <el-header class="layout-header" v-if="!isFullScreen" :class="{ 'transparent-header': isSpecialBg }">
  7. <div class="logo-title-row">
  8. <img src="@/assets/logo.png" alt="Logo" class="logo" />
  9. <div class="title-and-user">
  10. <span class="project-name" :class="{ 'light-text': isSpecialBg }">
  11. 区域土壤重金属污染风险评估
  12. </span>
  13. <!-- 用户信息 - 在select-city页面隐藏 -->
  14. <div class="user-info-row" v-if="!isSelectCity">
  15. <span class="welcome-text" :class="{ 'light-text': isSpecialBg }">
  16. 欢迎{{
  17. tokenStore.token.loginType === "admin" ? "管理员" : "用户"
  18. }}登录成功
  19. </span>
  20. <el-dropdown>
  21. <span class="el-dropdown-link">
  22. <el-avatar :size="40" :class="{ 'light-avatar-border': isSpecialBg }"
  23. src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
  24. </span>
  25. <template #dropdown>
  26. <el-dropdown-menu>
  27. <el-dropdown-item disabled>用户名:{{ userInfo.name }}</el-dropdown-item>
  28. <el-dropdown-item divided @click="handleLogout">退出登录</el-dropdown-item>
  29. </el-dropdown-menu>
  30. </template>
  31. </el-dropdown>
  32. </div>
  33. </div>
  34. </div>
  35. </el-header>
  36. <!-- Tab 区域(不加背景图) -->
  37. <div class="tabs-row" v-if="!isFullScreen">
  38. <el-tabs v-if="showTabs" v-model="activeName" class="demo-tabs" :style="tabStyle" @tab-click="handleClick">
  39. <el-tab-pane v-for="tab in tabs" :key="tab.name" :name="tab.name">
  40. <template #label>
  41. <i :class="['tab-icon', tab.icon]"></i>
  42. <span class="tab-label-text">{{ tab.label }}</span>
  43. </template>
  44. </el-tab-pane>
  45. </el-tabs>
  46. <div v-else class="single-tab" @click="handleClick(tabs[0], $event)">
  47. <i :class="['tab-icon', tabs[0].icon]"></i>
  48. <span class="tab-label-text">{{ tabs[0].label }}</span>
  49. </div>
  50. </div>
  51. <!-- 主体区域 -->
  52. <el-container class="layout-main-container">
  53. <!-- 侧边栏(不加背景图) -->
  54. <el-aside v-if="showAside && showTabs" class="layout-aside">
  55. <component :is="AsideComponent" :activeTab="activeName" :showTabs="showTabs" />
  56. </el-aside>
  57. <!-- 内容区域(透明背景) -->
  58. <el-main class="layout-content-wrapper" :style="mainStyle">
  59. <div class="scrollable-content" :class="{ 'transparent-scroll': isSpecialBg }">
  60. <div :class="{ 'select-city-container': isSelectCity }">
  61. <RouterView />
  62. </div>
  63. </div>
  64. </el-main>
  65. </el-container>
  66. </div>
  67. </template>
  68. <script setup lang="ts">
  69. import { ref, reactive, computed, watch, defineAsyncComponent } from "vue";
  70. import { useRouter, useRoute } from "vue-router";
  71. import { useTokenStore } from "@/stores/mytoken";
  72. import { ElMessageBox, ElMessage } from "element-plus";
  73. import { logout } from "@/API/users";
  74. const router = useRouter();
  75. const route = useRoute();
  76. const tokenStore = useTokenStore();
  77. const currentBgImage = ref("");
  78. // 定义需要背景图的特殊路由和对应图片文件名
  79. const bgRouteMap: Record<string, string> = {
  80. // 添加灌溉水相关页面的背景图
  81. "/samplingMethodDevice1": "irrigation.jpg",
  82. "/irriSampleData": "irrigation.jpg",
  83. "/csSampleData": "irrigation.jpg",
  84. "/irriInputFlux": "irrigation.jpg",
  85. // 添加大农产品投入相关页面的背景图
  86. "/farmInputSamplingDesc": "agricultural_input.png",
  87. "/prodInputFlux": "agricultural_input.png",
  88. // 添加大气干湿沉降相关页面的背景图
  89. "/AtmosDepositionSamplingDesc": "atmospheric_deposition.png",
  90. "/heavyMetalEnterprise": "atmospheric_deposition.png",
  91. "/airSampleData": "atmospheric_deposition.png",
  92. "/airInputFlux": "atmospheric_deposition.png",
  93. //添加籽粒移除相关页面的背景图
  94. "/samplingDesc1": "rain_removal.png",
  95. "/grainRemovalInputFlux": "rain_removal.png",
  96. //添加秸秆移除相关页面的背景图
  97. "/samplingDesc2": "straw-removal.png",
  98. "/strawRemovalInputFlux": "straw-removal.png",
  99. //添加地下渗漏相关页面的背景图
  100. "/samplingDesc3": "subsurface-leakage.jpg",
  101. "/subsurfaceLeakageInputFlux": "subsurface-leakage.jpg",
  102. //添加地表径流相关页面的背景图
  103. "/samplingDesc4": "surface-runoff.jpg",
  104. "/surfaceRunoffInputFlux": "surface-runoff.jpg",
  105. "/totalInputFlux": "background.jpg",
  106. "/totalOutputFlux": "background.jpg",
  107. "/netFlux": "background.jpg",
  108. "/currentYearConcentration": "background.jpg",
  109. "/TotalCadmiumPrediction": "background.jpg",
  110. "/EffectiveCadmiumPrediction": "background.jpg",
  111. "/CropCadmiumPrediction": "background.jpg",
  112. "/cropRiskAssessment": "background.jpg",
  113. "/farmlandQualityAssessment": "background.jpg",
  114. "/Calculation": "background.jpg",
  115. "/SoilAcidReductionIterativeEvolution": "background.jpg",
  116. "/AcidNeutralizationModel": "background.jpg",
  117. "/SoilAcidificationIterativeEvolution": "background.jpg",
  118. "/TraditionalFarmingRisk": "background.jpg",
  119. "/HeavyMetalCadmiumControl": "background.jpg",
  120. "/SoilAcidificationControl": "background.jpg",
  121. "/DetectionStatistics": "background.jpg",
  122. "/FarmlandPollutionStatistics": "background.jpg",
  123. "/PlantingRiskStatistics": "background.jpg",
  124. };
  125. // 当前是否为特殊背景图页面
  126. const isSpecialBg = computed(() => Object.keys(bgRouteMap).includes(route.path));
  127. function getBgImageUrl(): string {
  128. const bgFile = bgRouteMap[route.path];
  129. console.log("根据路径查找背景文件名:", bgFile);
  130. if (bgFile) {
  131. try {
  132. const url = `url(${new URL(`../../assets/bg/background.jpg`, import.meta.url).href})`;
  133. return url;
  134. } catch (error) {
  135. console.error("加载背景图失败:", error);
  136. return "";
  137. }
  138. }
  139. return "";
  140. }
  141. // 监听路由变化更新背景图,并打印日志
  142. watch(
  143. () => route.path,
  144. (newPath) => {
  145. currentBgImage.value = getBgImageUrl();
  146. console.log(`[背景图更新] 当前路径: ${newPath}, 背景图: ${currentBgImage.value}`);
  147. },
  148. { immediate: true }
  149. );
  150. // 背景图样式 - 关键修改
  151. const backgroundStyle = computed(() => {
  152. return {
  153. backgroundImage: currentBgImage.value,
  154. backgroundSize: 'cover',
  155. backgroundPosition: 'center',
  156. backgroundRepeat: 'no-repeat',
  157. backgroundAttachment: 'fixed'
  158. };
  159. });
  160. // 是否为全屏页面
  161. const isFullScreen = computed(() => route.meta.fullScreen === true);
  162. // 判断是否是select-city页面
  163. const isSelectCity = computed(() => route.path === "/select-city");
  164. // Tab 配置
  165. const tabs = computed(() => {
  166. if (tokenStore.token.loginType === "admin") {
  167. return [
  168. {
  169. name: "dataManagement",
  170. label: "数据管理",
  171. icon: "el-icon-folder",
  172. routes: [
  173. "/soilAcidReductionData",
  174. "/soilAcidificationData",
  175. "/AdminRegionData",
  176. "/SoilAssessmentUnitData",
  177. "/SoilHeavyMetalData",
  178. "/CropHeavyMetalData",
  179. "/LandUseTypeData",
  180. "/ClimateInfoData",
  181. "/GeographicEnvInfoData",
  182. ],
  183. },
  184. {
  185. name: "infoManagement",
  186. label: "信息管理",
  187. icon: "el-icon-document",
  188. routes: ["/IntroductionUpdate"],
  189. },
  190. {
  191. name: "modelManagement",
  192. label: "模型管理及配置",
  193. icon: "el-icon-cpu",
  194. routes: [
  195. "/CadmiumPredictionModel",
  196. "/EffectiveCadmiumModel",
  197. "/Admin/RiceRiskModel",
  198. "/AdminModelSelection",
  199. "/Admin/thres",
  200. "/Admin/ModelTrain",
  201. "/Admin/WheatRiskModel",
  202. "/Admin/VegetableRiskModel",
  203. ],
  204. },
  205. {
  206. name: "userManagement",
  207. label: "用户管理",
  208. icon: "el-icon-user",
  209. routes: ["/UserManagement", "/UserRegistration"],
  210. },
  211. ];
  212. } else {
  213. return [
  214. {
  215. name: "shuJuKanBan",
  216. label: "数据看板",
  217. icon: "el-icon-data-analysis",
  218. routes: ["/shuJuKanBan"],
  219. },
  220. {
  221. name: "introduction",
  222. label: "软件简介",
  223. icon: "el-icon-info-filled",
  224. routes: ["/SoilPro", "/Overview", "/ResearchFindings", "/Unit"],
  225. },
  226. {
  227. name: "HmOutFlux",
  228. label: "重金属输入通量",
  229. icon: "el-icon-refresh",
  230. routes: [
  231. "/samplingMethodDevice1",
  232. "/irriSampleData",
  233. "/csSampleData",
  234. "/irriInputFlux",
  235. "/farmInputSamplingDesc",
  236. "/prodInputFlux",
  237. "/AtmosDepositionSamplingDesc",
  238. "/heavyMetalEnterprise",
  239. "/airSampleData",
  240. "/airInputFlux",
  241. ],
  242. },
  243. {
  244. name: "hmInFlux",
  245. label: "重金属输出通量",
  246. icon: "el-icon-refresh",
  247. routes: [
  248. "/samplingDesc1",
  249. "/grainRemovalInputFlux",
  250. "/samplingDesc2",
  251. "/strawRemovalInputFlux",
  252. "/samplingDesc3",
  253. "/subsurfaceLeakageInputFlux",
  254. "/samplingDesc4",
  255. "/surfaceRunoffInputFlux",
  256. ],
  257. },
  258. {
  259. name: "mapView",
  260. label: "地图展示",
  261. icon: "el-icon-map-location",
  262. routes: ["/mapView"],
  263. },
  264. {
  265. name: "cadmiumPrediction",
  266. label: "土壤污染物含量预测",
  267. icon: "el-icon-c-scale-to-original",
  268. routes: [
  269. "/totalInputFlux",
  270. "/TotalCadmiumPrediction",
  271. "/totalOutputFlux",
  272. "/netFlux",
  273. "/currentYearConcentration",
  274. "/EffectiveCadmiumPrediction",
  275. "CropCadmiumPrediction",
  276. ],
  277. },
  278. {
  279. name: "cropRiskAssessment",
  280. label: "作物风险评估",
  281. icon: "el-icon-warning",
  282. routes: ["/cropRiskAssessment"],
  283. },
  284. {
  285. name: "farmlandQualityAssessment",
  286. label: "耕地质量评估",
  287. icon: "el-icon-rank",
  288. routes: ["/farmlandQualityAssessment"],
  289. },
  290. {
  291. name: "soilAcidificationPrediction",
  292. label: "土壤酸化预测",
  293. icon: "el-icon-magic-stick",
  294. routes: ["/Calculation", "/AcidNeutralizationModel"],
  295. },
  296. {
  297. name: "scenarioSimulation",
  298. label: "情景模拟",
  299. icon: "el-icon-s-operation",
  300. routes: [
  301. "/TraditionalFarmingRisk",
  302. "/HeavyMetalCadmiumControl",
  303. "/SoilAcidificationControl",
  304. ],
  305. },
  306. {
  307. name: "dataStatistics",
  308. label: "数据统计",
  309. icon: "el-icon-pie-chart",
  310. routes: [
  311. "/DetectionStatistics",
  312. "/FarmlandPollutionStatistics",
  313. "/PlantingRiskStatistics",
  314. ],
  315. },
  316. ].filter(tab => !["shuJuKanBan", "mapView", "introduction"].includes(tab.name));
  317. }
  318. });
  319. // 当前激活 tab
  320. const activeName = ref(tabs.value[0]?.name || "");
  321. const showTabs = computed(() => tabs.value.length > 1);
  322. const tabStyle = computed(() =>
  323. tabs.value.length === 1 ? { width: "100%", justifyContent: "center" } : {}
  324. );
  325. let hasNavigated = false;
  326. watch(
  327. () => activeName.value,
  328. (newTab) => {
  329. const tab = tabs.value.find((t) => t.name === newTab);
  330. const targetPath = tab?.routes?.[0];
  331. if (!hasNavigated) {
  332. hasNavigated = true;
  333. return;
  334. }
  335. if (tab && targetPath && router.currentRoute.value.path !== targetPath) {
  336. router.push({ path: targetPath });
  337. }
  338. },
  339. { immediate: true }
  340. );
  341. // 点击切换 tab
  342. const handleClick = (tab: any, event: Event) => {
  343. activeAsideTab.value = tab.props.name;
  344. };
  345. // 动态加载侧边栏组件
  346. const AsideComponent = computed(() => {
  347. if (
  348. ["parameterConfig", "dataManagement", "infoManagement", "modelManagement", "userManagement"]
  349. .includes(activeName.value)
  350. ) {
  351. return defineAsyncComponent(() => import("./AppAsideForTab2.vue"));
  352. } else {
  353. return defineAsyncComponent(() => import("./AppAside.vue"));
  354. }
  355. });
  356. // 是否显示侧边栏
  357. const showAside = computed(() => {
  358. return (
  359. !isFullScreen.value &&
  360. activeName.value !== "mapView" &&
  361. activeName.value !== "cropRiskAssessment" &&
  362. activeName.value !== "farmlandQualityAssessment"
  363. );
  364. });
  365. const activeAsideTab = ref(activeName.value || "");
  366. const userInfo = reactive({ name: tokenStore.token.name || "未登录" });
  367. const handleLogout = async () => {
  368. try {
  369. await ElMessageBox.confirm("确定要退出登录吗?", "提示", {
  370. confirmButtonText: "确定",
  371. cancelButtonText: "取消",
  372. type: "warning",
  373. });
  374. await logout();
  375. tokenStore.clearToken();
  376. ElMessage.success("退出成功");
  377. router.push("/login");
  378. } catch {
  379. ElMessage.info("已取消退出");
  380. }
  381. };
  382. // 内容区样式
  383. const mainStyle = computed(() => {
  384. return {
  385. padding: ["mapView", "infoManagement"].includes(activeName.value) ? "0" : "20px",
  386. overflow: "hidden",
  387. };
  388. });
  389. </script>
  390. <style>
  391. /* 隐藏所有滚动条 */
  392. *::-webkit-scrollbar {
  393. display: none;
  394. /* Chrome, Safari, Opera */
  395. }
  396. * {
  397. -ms-overflow-style: none;
  398. /* IE and Edge */
  399. scrollbar-width: none;
  400. /* Firefox */
  401. }
  402. /* 整体布局容器 */
  403. .layout-wrapper {
  404. display: flex;
  405. flex-direction: column;
  406. height: 100vh;
  407. overflow: hidden;
  408. position: relative;
  409. background-color: #f5f7fa;
  410. /* 默认背景色 */
  411. }
  412. /* 背景层 - 关键修改 */
  413. .background-layer {
  414. position: absolute;
  415. top: 0;
  416. left: 0;
  417. width: 100%;
  418. height: 100%;
  419. z-index: 0;
  420. background-size: cover;
  421. background-position: center;
  422. background-repeat: no-repeat;
  423. filter: brightness(0.8);
  424. }
  425. /* 全屏页面特殊处理 */
  426. .layout-wrapper.full-screen {
  427. background: none;
  428. min-height: 100vh;
  429. }
  430. /* 特殊背景页面的Header样式 */
  431. .transparent-header {
  432. background: transparent !important;
  433. backdrop-filter: blur(2px);
  434. /* 添加轻微模糊效果增强可读性 */
  435. }
  436. /* 特殊背景页面的文字颜色 */
  437. .light-text {
  438. color: #ffffff !important;
  439. /* 白色文字 */
  440. text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  441. /* 文字阴影增强可读性 */
  442. }
  443. /* 特殊背景页面的头像边框 */
  444. .light-avatar-border {
  445. border: 2px solid #ffffff !important;
  446. /* 白色边框 */
  447. }
  448. /* 内容区域在特殊背景页面透明 */
  449. .transparent-scroll {
  450. background-color: transparent !important;
  451. }
  452. /* Header 样式 */
  453. .layout-header {
  454. height: 150px;
  455. display: flex;
  456. align-items: center;
  457. justify-content: space-between;
  458. color: #333;
  459. /* 深色文字 */
  460. flex-shrink: 0;
  461. position: relative;
  462. z-index: 2;
  463. /* 确保在背景层上方 */
  464. background-color: white;
  465. /* 默认背景色 */
  466. }
  467. .logo-title-row {
  468. display: flex;
  469. align-items: center;
  470. gap: 24px;
  471. width: 100%;
  472. }
  473. .title-and-user {
  474. display: flex;
  475. flex-direction: column;
  476. flex: 1;
  477. }
  478. /* 用户信息区域 */
  479. .user-info-row {
  480. display: flex;
  481. align-items: center;
  482. justify-content: flex-end;
  483. gap: 24px;
  484. color: #333;
  485. /* 深色文字 */
  486. padding-top: 1px;
  487. position: static;
  488. z-index: 1;
  489. }
  490. .welcome-text {
  491. font-size: 28px;
  492. font-weight: 500;
  493. color: #333 !important;
  494. /* 深色文字 */
  495. }
  496. /* Tab 区域 - 不透明 */
  497. .tabs-row {
  498. height: 48px;
  499. display: flex;
  500. justify-content: center;
  501. align-items: center;
  502. padding: 0 24px;
  503. background: linear-gradient(to right, #1092d8, #02c3ad);
  504. border-bottom: none !important;
  505. flex-shrink: 0;
  506. position: relative;
  507. z-index: 2;
  508. /* 确保在背景层上方 */
  509. }
  510. /* el-tabs 外层容器 */
  511. .demo-tabs {
  512. height: 48px !important;
  513. display: flex;
  514. align-items: center;
  515. width: 100%;
  516. padding: 0 !important;
  517. margin: 0 !important;
  518. border-bottom: none !important;
  519. }
  520. /* 清除滑块条和底部线条 */
  521. .el-tabs__nav-wrap::after,
  522. .el-tabs__active-bar {
  523. display: none !important;
  524. height: 0 !important;
  525. border: none !important;
  526. }
  527. .el-tabs__nav-scroll {
  528. padding: 0 !important;
  529. margin: 0 !important;
  530. }
  531. /* Tabs 单项样式 */
  532. .el-tabs__item {
  533. height: 48px !important;
  534. line-height: 48px !important;
  535. display: flex !important;
  536. align-items: center;
  537. justify-content: center;
  538. padding: 0 20px !important;
  539. font-size: 20px;
  540. font-weight: 600;
  541. border-radius: 10px;
  542. transition: all 0.2s ease-in-out;
  543. background-color: transparent;
  544. position: relative;
  545. z-index: 1;
  546. }
  547. /* 激活 Tab */
  548. .el-tabs__item.is-active {
  549. background-color: #2a53ba;
  550. color: #ffffff;
  551. font-weight: 700;
  552. box-shadow: 0 4px 16px rgba(26, 188, 156, 0.4);
  553. z-index: 2;
  554. }
  555. /* 鼠标悬停 */
  556. .el-tabs__item:hover {
  557. background-color: #455a64;
  558. color: #ffffff;
  559. }
  560. /* 图标样式 */
  561. .tab-icon {
  562. font-size: 24px;
  563. margin-right: 4px;
  564. color: inherit;
  565. }
  566. /* 文字样式 */
  567. .tab-label-text {
  568. font-size: 20px;
  569. color: inherit;
  570. line-height: 1;
  571. display: inline-block;
  572. }
  573. .logo {
  574. height: 60px;
  575. }
  576. .project-name {
  577. font-size: 48px;
  578. font-weight: bold;
  579. margin-top: 30px;
  580. color: #333;
  581. /* 深色文字 */
  582. }
  583. .layout-main-container {
  584. flex: 1;
  585. display: flex;
  586. overflow: hidden;
  587. min-height: 0;
  588. position: relative;
  589. z-index: 1;
  590. /* 确保在背景层上方 */
  591. }
  592. /* 侧边栏 - 白色背景 */
  593. .layout-aside {
  594. width: 360px;
  595. background: linear-gradient(to bottom, #B7F1FC, #FFF8F0);
  596. border-right: 1px solid;
  597. overflow-y: auto;
  598. color: #000000;
  599. padding-top: 8px;
  600. height: 100%;
  601. position: relative;
  602. z-index: 2;
  603. /* 确保在背景层上方 */
  604. }
  605. /* 隐藏侧边栏滚动条 */
  606. .layout-aside::-webkit-scrollbar {
  607. display: none;
  608. }
  609. .layout-aside .el-menu-item,
  610. .layout-aside .el-sub-menu__title {
  611. font-size: 18px;
  612. font-weight: 500;
  613. color: #000000;
  614. background-color: transparent;
  615. transition: all 0.2s ease;
  616. border-radius: 6px;
  617. padding: 12px 16px !important;
  618. }
  619. .layout-aside .el-menu-item:hover,
  620. .layout-aside .el-sub-menu__title:hover {
  621. background-color: rgba(16, 146, 216, 0.1);
  622. color: #1092d8;
  623. }
  624. .layout-aside .el-menu-item.is-active,
  625. .layout-aside .el-sub-menu__title.is-active {
  626. background: linear-gradient(to right, #1092d8, #02c3ad);
  627. color: #000000 !important;
  628. border-radius: 8px;
  629. font-weight: 600;
  630. box-shadow: 0 2px 8px rgba(16, 146, 216, 0.25);
  631. }
  632. .layout-content-wrapper {
  633. flex: 1;
  634. overflow: hidden;
  635. display: flex;
  636. flex-direction: column;
  637. position: relative;
  638. }
  639. /* 强制重置 el-tabs header 高度/边距/背景/阴影,避免背景层穿透错位 */
  640. .el-tabs__header.is-top {
  641. height: 48px !important;
  642. margin: 0 !important;
  643. padding: 0 !important;
  644. border: none !important;
  645. background: transparent !important;
  646. box-shadow: none !important;
  647. z-index: 0 !important;
  648. }
  649. /* 全屏页面特殊处理 */
  650. .layout-wrapper.full-screen .layout-main-container {
  651. height: 100vh;
  652. }
  653. .scrollable-content {
  654. flex: 1;
  655. overflow: auto;
  656. padding: 0 20px;
  657. box-sizing: border-box;
  658. background-color: white;
  659. /* 默认背景色 */
  660. }
  661. .scrollable-content.transparent-scroll {
  662. background-color: transparent;
  663. }
  664. </style>