zzw
昨天 f9114ffadfab1c01198dd980c3afb66d0c44a5ea
emergency-repair-web/src/layout/AppLayout.vue
@@ -1,6 +1,6 @@
<template>
  <el-container class="layout">
    <app-header></app-header>
    <app-header :menu-path="activeMenuPath"></app-header>
    <el-container class="layout-body">
      <el-aside width="228px" class="layout-aside">
        <div class="aside-caption">业务导航</div>
@@ -10,7 +10,6 @@
      </el-aside>
      <el-main class="layout-main">
        <div class="mdi-tabbar">
          <div class="mdi-caption"><i class="el-icon-document-copy"></i><span>工作区</span></div>
          <div ref="tabScroll" class="mdi-tabs-scroll">
            <div class="mdi-tabs">
              <div
@@ -66,9 +65,9 @@
}
const REPORT_TITLES = {
  overview: '装备故障总体分析',
  overview: '设备故障总体分析',
  'top-equipment': '故障高发设备Top',
  'by-team': '按T统计',
  'by-team': 'rk_按T统计',
  contractors: '厂家维修情况',
  trend: '年度趋势'
}
@@ -95,6 +94,11 @@
    canCloseOthers() {
      const keepCount = this.activeDoc && this.activeDoc.pinned ? 1 : 2
      return this.openDocs.length > keepCount
    },
    activeMenuPath() {
      const path = this.findMenuPath(this.menus, this.$route.path)
      if (path.length) return path
      return this.$route.meta.title ? [this.$route.meta.title] : []
    }
  },
  watch: {
@@ -146,6 +150,15 @@
        this.openDocs.unshift({ ...HOME_DOC })
      }
    },
    findMenuPath(items, targetPath, trail = []) {
      for (const item of items || []) {
        const nextTrail = [...trail, item.name]
        if (item.url === targetPath) return nextTrail
        const childPath = this.findMenuPath(item.children, targetPath, nextTrail)
        if (childPath.length) return childPath
      }
      return []
    },
    resolveTitle(route) {
      if (route.path.startsWith('/reports/')) {
        return REPORT_TITLES[route.params.type] || route.meta.title || '统计报表'
@@ -157,7 +170,7 @@
      if (path === '/fault/report') return 'el-icon-edit-outline'
      if (path.includes('/approval/') || path === '/fault/review') return 'el-icon-s-check'
      if (path === '/fault/dispatch') return 'el-icon-s-promotion'
      if (path.startsWith('/fault/completion') || path === '/completion/report') return 'el-icon-finished'
      if (path.startsWith('/fault/completion') || path.startsWith('/completion/')) return 'el-icon-finished'
      if (path.startsWith('/acceptance/')) return 'el-icon-circle-check'
      if (path.startsWith('/reports/')) return 'el-icon-data-analysis'
      if (path.startsWith('/system/')) return 'el-icon-setting'
@@ -246,11 +259,12 @@
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mdi-tabbar { display: flex; flex: 0 0 40px; align-items: stretch; height: 40px; padding-top: 5px; border-bottom: 1px solid #cfdae5; background: #e3eaf1; }
.mdi-caption { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 12px; border-right: 1px solid rgba(125, 147, 169, .22); color: #64788d; font-size: 12px; }
.mdi-caption i { color: #2c7fb8; font-size: 15px; }
.mdi-tabs-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.mdi-tabs { display: inline-flex; align-items: flex-end; min-width: 100%; height: 100%; padding: 0 4px; }
.mdi-tabbar { display: flex; flex: 0 0 50px; align-items: stretch; height: 50px; padding-top: 5px; border-bottom: 1px solid #cfdae5; background: #e3eaf1; }
.mdi-tabs-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #9fb1c1 transparent; }
.mdi-tabs-scroll::-webkit-scrollbar { height: 6px; }
.mdi-tabs-scroll::-webkit-scrollbar-track { background: transparent; }
.mdi-tabs-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: #9fb1c1; }
.mdi-tabs { display: inline-flex; align-items: flex-end; min-width: 100%; height: 35px; padding: 0 4px; }
.mdi-tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; max-width: 220px; height: 34px; margin-right: 2px; padding: 0 9px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; color: #5c6f82; background: rgba(255, 255, 255, .42); cursor: pointer; font-size: 13px; user-select: none; }
.mdi-tab:hover { color: #245275; background: rgba(255, 255, 255, .72); }
.mdi-tab.is-active { height: 35px; color: #1f3348; background: #eef2f6; border-color: #cfdae5; box-shadow: inset 0 2px 0 #2c7fb8; }