Просмотр исходного кода

feat(大屏): 四视图拆为四个独立深色大屏

- 原 4 个 tab(决策层/总体运营/区域运营/供给侧)拆为独立路由 /ops/00~03,可各自投屏
- /ops 重定向到 /ops/00,菜单「数据」子组改为四项
- 大屏改深色主题(深底 #12243D + 深蓝卡片 + 青绿点缀),Element 组件同步适配
- 后端接口零改动,前端按路由过滤指标
Xiaogang Liao 10 часов назад
Родитель
Сommit
89c174e5a1

+ 5 - 1
train-web/src/config/menu-roles.js

@@ -30,7 +30,11 @@ const MENU_ROLES = {
   '/evals': ['admin', 'org', 'lecturer'],
   '/promotions': ['admin', 'org'],
   '/evidence': ['admin', 'org'],
-  '/ops': ['admin', 'org']
+  '/ops': ['admin', 'org'],
+  '/ops/00': ['admin', 'org'],
+  '/ops/01': ['admin', 'org'],
+  '/ops/02': ['admin', 'org'],
+  '/ops/03': ['admin', 'org']
 }
 
 // 各角色默认落点(越权重定向目标)

+ 24 - 2
train-web/src/router/index.js

@@ -199,9 +199,31 @@ const routes = [
       },
       {
         path: 'ops',
-        name: 'OpsDashboard',
+        redirect: '/ops/00'
+      },
+      {
+        path: 'ops/00',
+        name: 'OpsDecision',
+        component: () => import('@/views/OpsDashboard.vue'),
+        meta: { title: '决策层大屏' }
+      },
+      {
+        path: 'ops/01',
+        name: 'OpsOverview',
+        component: () => import('@/views/OpsDashboard.vue'),
+        meta: { title: '总体运营大屏' }
+      },
+      {
+        path: 'ops/02',
+        name: 'OpsRegion',
+        component: () => import('@/views/OpsDashboard.vue'),
+        meta: { title: '区域运营大屏' }
+      },
+      {
+        path: 'ops/03',
+        name: 'OpsSupply',
         component: () => import('@/views/OpsDashboard.vue'),
-        meta: { title: '运营数据大屏' }
+        meta: { title: '供给侧大屏' }
       }
     ]
   }

+ 17 - 5
train-web/src/views/Layout.vue

@@ -197,11 +197,23 @@
             <el-submenu index="health-data" v-if="groupVisible(healthPaths.data)">
               <template slot="title">
                 <i class="el-icon-data-line"></i>
-                <span>数据</span>
+                <span>数据大屏</span>
               </template>
-              <el-menu-item index="/ops" v-if="canSee('/ops')">
+              <el-menu-item index="/ops/00" v-if="canSee('/ops/00')">
+                <i class="el-icon-data-board"></i>
+                <span slot="title">决策层大屏</span>
+              </el-menu-item>
+              <el-menu-item index="/ops/01" v-if="canSee('/ops/01')">
+                <i class="el-icon-data-analysis"></i>
+                <span slot="title">总体运营大屏</span>
+              </el-menu-item>
+              <el-menu-item index="/ops/02" v-if="canSee('/ops/02')">
                 <i class="el-icon-data-line"></i>
-                <span slot="title">运营数据大屏</span>
+                <span slot="title">区域运营大屏</span>
+              </el-menu-item>
+              <el-menu-item index="/ops/03" v-if="canSee('/ops/03')">
+                <i class="el-icon-pie-chart"></i>
+                <span slot="title">供给侧大屏</span>
               </el-menu-item>
             </el-submenu>
           </el-submenu>
@@ -247,7 +259,7 @@ export default {
           '/review/submissions', '/review/cards', '/review/roadmaps', '/scoreboard', '/manual-score'],
         management: ['/orders', '/stats'],
         health: ['/dispatch', '/org', '/practitioners', '/cohorts', '/attendances',
-          '/credits', '/evals', '/promotions', '/evidence', '/ops']
+          '/credits', '/evals', '/promotions', '/evidence', '/ops/00', '/ops/01', '/ops/02', '/ops/03']
       },
       groupLabels: {
         overview: '概览与现场',
@@ -261,7 +273,7 @@ export default {
         people: ['/org', '/practitioners'],
         training: ['/cohorts', '/attendances', '/credits'],
         review: ['/evals', '/promotions', '/evidence'],
-        data: ['/ops']
+        data: ['/ops/00', '/ops/01', '/ops/02', '/ops/03']
       },
       reviewPaths: ['/review/submissions', '/review/cards', '/review/roadmaps']
     }

+ 124 - 114
train-web/src/views/OpsDashboard.vue

@@ -2,15 +2,6 @@
   <div class="ops-page">
     <!-- 内容工具栏 -->
     <div class="toolbar">
-      <div class="toolbar-left">
-        <button
-          v-for="t in viewTabs"
-          :key="t.key"
-          class="chip"
-          :class="{ on: viewKey === t.key }"
-          @click="switchView(t.key)"
-        >{{ t.key }} {{ t.label }}</button>
-      </div>
       <div class="toolbar-right">
         <span class="toolbar-meta">自动刷新 60s</span>
         <span class="toolbar-meta">更新于 {{ generatedAt || '-' }}</span>
@@ -569,13 +560,6 @@ export default {
   name: 'OpsDashboard',
   data: function () {
     return {
-      viewKey: '00',
-      viewTabs: [
-        { key: '00', label: '决策层' },
-        { key: '01', label: '总体运营' },
-        { key: '02', label: '区域运营' },
-        { key: '03', label: '供给侧' }
-      ],
       loading: false,
       generatedAt: '',
       dataStage: '',
@@ -589,6 +573,12 @@ export default {
     }
   },
   computed: {
+    // 当前视图由路由决定(/ops/00 ~ /ops/03),四页独立
+    viewKey: function () {
+      var parts = this.$route.path.split('/')
+      var v = parts[parts.length - 1]
+      return ['00', '01', '02', '03'].indexOf(v) !== -1 ? v : '00'
+    },
     n01: function () { return this.m('n01') || {} },
     n02: function () { return this.m('n02') || {} },
     n03: function () { return this.m('n03') || {} },
@@ -715,9 +705,6 @@ export default {
       if (n >= 60) return 'yellow'
       return 'red'
     },
-    switchView: function (key) {
-      this.viewKey = key
-    },
     reload: function () {
       var self = this
       self.loading = true
@@ -759,19 +746,18 @@ export default {
 
 <style scoped>
 .ops-page {
-  padding-bottom: 16px;
+  background: #12243D;
+  min-height: calc(100vh - 160px);
+  margin: -24px;
+  padding: 24px;
+  color: #C8D6E4;
 }
 .toolbar {
   display: flex;
-  justify-content: space-between;
+  justify-content: flex-end;
   align-items: center;
   margin-bottom: 16px;
 }
-.toolbar-left {
-  display: flex;
-  align-items: center;
-  flex-wrap: wrap;
-}
 .toolbar-right {
   display: flex;
   align-items: center;
@@ -779,32 +765,16 @@ export default {
 }
 .toolbar-meta {
   font-size: 12px;
-  color: #6B7B8C;
-}
-.chip {
-  border: 1px solid #C3D2DF;
-  background: #FFFFFF;
-  color: #3B5A78;
-  font-size: 13px;
-  padding: 6px 18px;
-  border-radius: 4px;
-  cursor: pointer;
-  margin-right: 8px;
-}
-.chip.on {
-  background: #E8F3FC;
-  border-color: #2E6FA8;
-  color: #2E6FA8;
-  font-weight: 600;
+  color: #8FA6BE;
 }
 .view-wrap {
   min-height: 320px;
 }
 .card {
-  background: #FFFFFF;
-  border: 1px solid #DCE7F1;
+  background: #1B3350;
+  border: 1px solid #2A4560;
   border-radius: 8px;
-  box-shadow: 0 2px 10px rgba(30, 58, 95, .06);
+  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
   padding: 16px 20px;
   margin-bottom: 16px;
 }
@@ -818,24 +788,24 @@ export default {
 .card-title {
   font-size: 15px;
   font-weight: 600;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .card-sub {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
 }
 .check-badge {
   margin-left: auto;
   font-size: 12px;
-  color: #0E8A4F;
-  background: #E6F6EE;
-  border: 1px solid #DCE7F1;
+  color: #4ADE80;
+  background: #16382C;
+  border: 1px solid #2A4560;
   border-radius: 4px;
   padding: 2px 8px;
 }
 .check-badge.bad {
-  color: #C0392B;
-  background: #FDE8E8;
+  color: #FF7A6E;
+  background: #3A2020;
 }
 .kpi-row {
   display: flex;
@@ -846,22 +816,22 @@ export default {
 .kpi-card {
   flex: 1;
   min-width: 200px;
-  background: #FFFFFF;
-  border: 1px solid #DCE7F1;
-  border-left: 3px solid #2E6FA8;
+  background: #1B3350;
+  border: 1px solid #2A4560;
+  border-left: 3px solid #5BA8E8;
   border-radius: 8px;
-  box-shadow: 0 2px 10px rgba(30, 58, 95, .06);
+  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
   padding: 14px 18px;
 }
 .kpi-label {
   font-size: 13px;
-  color: #3B5A78;
+  color: #C8D6E4;
 }
 .kpi-num {
   font-size: 30px;
   font-weight: 700;
   font-variant-numeric: tabular-nums;
-  color: #1E3A5F;
+  color: #E4EEF7;
   line-height: 1.25;
   margin-top: 2px;
 }
@@ -872,19 +842,19 @@ export default {
 .kpi-unit {
   font-size: 13px;
   font-weight: 400;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-left: 6px;
 }
 .kpi-note {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-top: 4px;
 }
 .ph-inline {
   font-size: 18px;
-  color: #6B7B8C;
-  background: #F5FAFE;
-  border: 1px dashed #C3D2DF;
+  color: #8FA6BE;
+  background: #152B45;
+  border: 1px dashed #2A4560;
   border-radius: 4px;
   padding: 6px 10px;
   margin-top: 6px;
@@ -924,23 +894,23 @@ export default {
 .q-item {
   flex: 1;
   min-width: 180px;
-  border: 1px solid #DCE7F1;
+  border: 1px solid #2A4560;
   border-radius: 6px;
-  background: #F0F4F9;
+  background: #12243D;
   padding: 10px 14px;
 }
 .q-label {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-bottom: 6px;
 }
 .q-val {
   font-size: 18px;
   font-weight: 600;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .q-val.warn {
-  color: #B9770E;
+  color: #E5A94B;
 }
 .event-row {
   display: flex;
@@ -950,26 +920,26 @@ export default {
 .event-chip {
   display: flex;
   flex-direction: column;
-  border: 1px solid #DCE7F1;
+  border: 1px solid #2A4560;
   border-radius: 6px;
   padding: 6px 12px;
-  background: #F5FAFE;
+  background: #152B45;
 }
 .event-chip.hot {
-  border-color: #B9770E;
-  background: #FEF3E2;
+  border-color: #E5A94B;
+  background: #3A2E1A;
 }
 .ev-name {
   font-size: 12px;
   font-weight: 600;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .event-chip.hot .ev-name {
-  color: #B9770E;
+  color: #E5A94B;
 }
 .ev-val {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-top: 2px;
 }
 .bar-list {
@@ -986,7 +956,7 @@ export default {
   width: 80px;
   flex-shrink: 0;
   font-size: 12px;
-  color: #3B5A78;
+  color: #C8D6E4;
   text-align: right;
   overflow: hidden;
   text-overflow: ellipsis;
@@ -995,14 +965,14 @@ export default {
 .bar-track {
   flex: 1;
   height: 10px;
-  background: #E8F3FC;
+  background: #163A52;
   border-radius: 5px;
   overflow: hidden;
 }
 .bar-fill {
   display: block;
   height: 100%;
-  background: #2E6FA8;
+  background: #5BA8E8;
   border-radius: 5px;
 }
 .bar-fill.teal {
@@ -1013,13 +983,13 @@ export default {
   flex-shrink: 0;
   font-size: 13px;
   font-variant-numeric: tabular-nums;
-  color: #1E3A5F;
+  color: #E4EEF7;
   text-align: right;
 }
 .bar-pct {
   display: block;
   font-size: 11px;
-  color: #6B7B8C;
+  color: #8FA6BE;
 }
 .funnel-list {
   display: flex;
@@ -1035,20 +1005,20 @@ export default {
   width: 68px;
   flex-shrink: 0;
   font-size: 12px;
-  color: #3B5A78;
+  color: #C8D6E4;
   text-align: right;
 }
 .fn-track {
   flex: 1;
   height: 14px;
-  background: #E8F3FC;
+  background: #163A52;
   border-radius: 7px;
   overflow: hidden;
 }
 .fn-fill {
   display: block;
   height: 100%;
-  background: #2E6FA8;
+  background: #5BA8E8;
   border-radius: 7px;
 }
 .fn-num {
@@ -1056,34 +1026,34 @@ export default {
   flex-shrink: 0;
   font-size: 13px;
   font-variant-numeric: tabular-nums;
-  color: #1E3A5F;
+  color: #E4EEF7;
   text-align: right;
 }
 .loss-box {
   margin-top: 12px;
-  border: 1px solid #B9770E;
+  border: 1px solid #E5A94B;
   border-left-width: 3px;
   border-radius: 4px;
-  background: #FEF3E2;
+  background: #3A2E1A;
   padding: 8px 12px;
 }
 .loss-label {
   font-size: 12px;
   font-weight: 600;
-  color: #B9770E;
+  color: #E5A94B;
   margin-right: 8px;
 }
 .loss-text {
   font-size: 12px;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .ph-block {
   display: flex;
   flex-direction: column;
   justify-content: center;
   min-height: 96px;
-  background: #F5FAFE;
-  border: 1px dashed #C3D2DF;
+  background: #152B45;
+  border: 1px dashed #2A4560;
   border-radius: 6px;
   padding: 14px 16px;
 }
@@ -1099,11 +1069,11 @@ export default {
 .ph-text {
   font-size: 15px;
   font-weight: 600;
-  color: #6B7B8C;
+  color: #8FA6BE;
 }
 .ph-sub {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-top: 4px;
 }
 .metric-line {
@@ -1111,25 +1081,25 @@ export default {
   justify-content: space-between;
   align-items: baseline;
   padding: 7px 0;
-  border-bottom: 1px solid #DCE7F1;
+  border-bottom: 1px solid #2A4560;
 }
 .metric-line:last-of-type {
   border-bottom: none;
 }
 .ml-label {
   font-size: 13px;
-  color: #3B5A78;
+  color: #C8D6E4;
 }
 .ml-value {
   font-size: 15px;
   font-weight: 600;
   font-variant-numeric: tabular-nums;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .ml-sub {
   font-size: 12px;
   font-weight: 400;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-left: 6px;
 }
 .rule-list {
@@ -1142,10 +1112,10 @@ export default {
   display: flex;
   align-items: center;
   gap: 6px;
-  border: 1px solid #DCE7F1;
+  border: 1px solid #2A4560;
   border-radius: 6px;
   padding: 6px 12px;
-  background: #F5FAFE;
+  background: #152B45;
 }
 .rule-key {
   font-size: 13px;
@@ -1154,13 +1124,13 @@ export default {
 }
 .rule-label {
   font-size: 12px;
-  color: #3B5A78;
+  color: #C8D6E4;
 }
 .rule-range {
   font-size: 14px;
   font-weight: 700;
   font-variant-numeric: tabular-nums;
-  color: #2E6FA8;
+  color: #5BA8E8;
 }
 .light-row {
   display: flex;
@@ -1173,24 +1143,24 @@ export default {
   height: 10px;
   border-radius: 50%;
   display: inline-block;
-  background: #6B7B8C;
+  background: #8FA6BE;
 }
 .light-dot.green {
-  background: #0E8A4F;
+  background: #4ADE80;
 }
 .light-dot.yellow {
-  background: #B9770E;
+  background: #E5A94B;
 }
 .light-dot.red {
-  background: #C0392B;
+  background: #FF7A6E;
 }
 .light-text {
   font-size: 13px;
-  color: #3B5A78;
+  color: #C8D6E4;
 }
 .rule-note {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
   margin-top: 10px;
   line-height: 1.6;
 }
@@ -1204,14 +1174,14 @@ export default {
   align-items: center;
   flex-wrap: wrap;
   gap: 10px;
-  border-bottom: 1px solid #DCE7F1;
+  border-bottom: 1px solid #2A4560;
   padding-bottom: 8px;
 }
 .load-name {
   width: 150px;
   flex-shrink: 0;
   font-size: 13px;
-  color: #1E3A5F;
+  color: #E4EEF7;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
@@ -1222,29 +1192,69 @@ export default {
   font-size: 14px;
   font-weight: 600;
   font-variant-numeric: tabular-nums;
-  color: #1E3A5F;
+  color: #E4EEF7;
 }
 .load-meta {
   font-size: 12px;
-  color: #6B7B8C;
+  color: #8FA6BE;
 }
 .load-note {
   width: 100%;
   font-size: 12px;
-  color: #B9770E;
+  color: #E5A94B;
 }
 .empty-text {
   padding: 24px 0;
   text-align: center;
   font-size: 13px;
-  color: #6B7B8C;
+  color: #8FA6BE;
 }
 .dict-btn {
-  color: #2E6FA8;
+  color: #5BA8E8;
   padding: 0;
   margin-top: 8px;
 }
 .drawer-body {
   padding: 0 20px 20px;
 }
+/* 深色主题下 Element UI 组件适配 */
+.ops-page ::v-deep .el-button {
+  background: #1B3350;
+  border-color: #2A4560;
+  color: #C8D6E4;
+}
+.ops-page ::v-deep .el-button:hover,
+.ops-page ::v-deep .el-button:focus {
+  background: #163A52;
+  border-color: #5BA8E8;
+  color: #E4EEF7;
+}
+.ops-page ::v-deep .el-button.is-loading {
+  background: #1B3350;
+}
+.ops-page ::v-deep .el-button--text {
+  background: transparent;
+  border-color: transparent;
+  color: #5BA8E8;
+}
+.ops-page ::v-deep .el-dialog,
+.ops-page ::v-deep .el-drawer {
+  background: #1B3350;
+}
+.ops-page ::v-deep .el-dialog__title,
+.ops-page ::v-deep .el-drawer__title {
+  color: #E4EEF7;
+}
+.ops-page ::v-deep .el-table {
+  background: #1B3350;
+  color: #C8D6E4;
+}
+.ops-page ::v-deep .el-table th,
+.ops-page ::v-deep .el-table td {
+  background: #1B3350;
+  border-color: #2A4560;
+}
+.ops-page ::v-deep .el-table__row:hover > td {
+  background: #163A52 !important;
+}
 </style>