fanghuisheng 3 gadi atpakaļ
vecāks
revīzija
e5e6db1c5a

+ 1 - 0
src/assets/css/index.scss

@@ -107,6 +107,7 @@ div:focus {
     width: calc(100% - 40px);
     // height: 100%;
     margin: 20px;
+    margin-top: 70px;
     background: #fff;
     min-height: calc(100vh - 140px)
 }

+ 16 - 13
src/layouts/IndexLayout/components/RightTop.vue

@@ -32,11 +32,6 @@
               </a-link>
             </template>
           </template>
-          <bread-crumbs
-            v-else
-            class="breadcrumb"
-            :list="breadCrumbs"
-          ></bread-crumbs>
         </div>
       </div>
       <div class="indexlayout-top-menu-right">
@@ -51,15 +46,15 @@
         <!-- <select-lang class="indexlayout-top-selectlang" /> -->
       </div>
     </div>
-
-    <right-tab-nav v-if="tabNavEnable" :routeItem="routeItem">
-      <div v-if="topNavEnable" class="indexlayout-right-top-bot">
-        <div class="indexlayout-right-top-bot-home">
-          <i class="el-icon-s-home"></i>
-        </div>
-        <bread-crumbs class="breadcrumb" :list="breadCrumbs"></bread-crumbs>
+    <bread-crumbs class="breadcrumb breadcrumb_top" :list="breadCrumbs"></bread-crumbs>
+    <!-- <div v-if="topNavEnable" class="indexlayout-right-top-bot">
+      <div class="indexlayout-right-top-bot-home">
+        <i class="el-icon-s-home"></i>
       </div>
-    </right-tab-nav>
+      <bread-crumbs class="breadcrumb" :list="breadCrumbs"></bread-crumbs>
+    </div> -->
+
+    <right-tab-nav v-if="tabNavEnable" :routeItem="routeItem"></right-tab-nav>
   </div>
 </template>
 <script lang="ts">
@@ -143,6 +138,14 @@ export default defineComponent({
 </script>
 <style lang="scss">
 @import "../../../assets/css/global.scss";
+
+.breadcrumb_top{
+  background: #fff;
+  height: 50px;
+  line-height: 50px;
+  padding-left: 20px;
+}
+
 #indexlayout-right-top {
   width: 100%;
   height: ($headerHeight + $headerBreadcrumbHeight + $headerTabNavHeight);

+ 135 - 124
src/layouts/IndexLayout/index.vue

@@ -1,59 +1,59 @@
 <template>
-    <div id="indexlayout">
-        <left
-          :collapsed="collapsed"
-          :topNavEnable="topNavEnable"
-          :belongTopMenu="belongTopMenu"
-          :defaultActive="defaultActive"
-          :menuData="permissionMenuData"
-        >
-        </left>
-
-        <div
-          id="indexlayout-right"
-          :class="{'fiexd-header': headFixed}"
-        >
-
-            <right-top
-              :collapsed="collapsed"
-              :tabNavEnable="tabNavEnable"
-              :topNavEnable="topNavEnable"
-              :belongTopMenu="belongTopMenu"
-              :toggleCollapsed="toggleCollapsed"
-              :breadCrumbs="breadCrumbs"
-              :menuData="permissionMenuData"
-              :routeItem="routeItem"
-            >              
-            </right-top>
-
-            <div class="indexlayout-right-main">
-                <permission :roles="routeItem.roles">
-                  <router-view></router-view>
-                </permission>
-            </div>
-
-        </div>
-
-        <settings></settings>
-
+  <div id="indexlayout">
+    <left
+      :collapsed="collapsed"
+      :topNavEnable="topNavEnable"
+      :belongTopMenu="belongTopMenu"
+      :defaultActive="defaultActive"
+      :menuData="permissionMenuData"
+    >
+    </left>
+
+    <div id="indexlayout-right" :class="{ 'fiexd-header': headFixed }">
+      <right-top
+        :collapsed="collapsed"
+        :tabNavEnable="tabNavEnable"
+        :topNavEnable="topNavEnable"
+        :belongTopMenu="belongTopMenu"
+        :toggleCollapsed="toggleCollapsed"
+        :breadCrumbs="breadCrumbs"
+        :menuData="permissionMenuData"
+        :routeItem="routeItem"
+      >
+      </right-top>
+
+      <div class="indexlayout-right-main">
+        <permission :roles="routeItem.roles">
+          <router-view></router-view>
+        </permission>
+      </div>
     </div>
+    <bread-crumbs class="breadcrumb" :list="breadCrumbs"></bread-crumbs>
+    <settings></settings>
+  </div>
 </template>
 <script lang="ts">
 import { defineComponent, computed, ComputedRef } from "vue";
-import { useStore } from 'vuex';
-import { useRoute } from 'vue-router';
-import { StateType as GlobalStateType } from '@/store/global';
+import { useStore } from "vuex";
+import { useRoute } from "vue-router";
+import { StateType as GlobalStateType } from "@/store/global";
 import { StateType as UserStateType } from "@/store/user";
-import { 
-  vueRoutes, RoutesDataItem, getRouteItem, getSelectLeftMenuPath, 
-  formatRoutePathTheParents, getRouteBelongTopMenu, getBreadcrumbRoutes, 
-  BreadcrumbType, getPermissionMenuData
-} from '@/utils/routes';
-import useTitle from '@/composables/useTitle';
-import IndexLayoutRoutes from './routes';
-import Permission from '@/components/Permission/index.vue';
-import Left from './components/Left.vue';
-import RightTop from './components/RightTop.vue';
+import {
+  vueRoutes,
+  RoutesDataItem,
+  getRouteItem,
+  getSelectLeftMenuPath,
+  formatRoutePathTheParents,
+  getRouteBelongTopMenu,
+  getBreadcrumbRoutes,
+  BreadcrumbType,
+  getPermissionMenuData,
+} from "@/utils/routes";
+import useTitle from "@/composables/useTitle";
+import IndexLayoutRoutes from "./routes";
+import Permission from "@/components/Permission/index.vue";
+import Left from "./components/Left.vue";
+import RightTop from "./components/RightTop.vue";
 import Settings from "./components/Settings.vue";
 
 interface IndexLayoutSetupData {
@@ -70,82 +70,93 @@ interface IndexLayoutSetupData {
 }
 
 export default defineComponent({
-    name: 'IndexLayout',
-    components: {
-        Permission,
-        Left,
-        RightTop,
-        Settings
-    },
-    setup(): IndexLayoutSetupData {
-        const store = useStore<{
-            global: GlobalStateType;
-            user: UserStateType;
-        }>(); 
-        const route = useRoute();
-
-
-        // 所有菜单路由
-        const menuData: RoutesDataItem[] = vueRoutes(IndexLayoutRoutes);      
-
-        // 当前路由 item
-        const routeItem = computed<RoutesDataItem>(()=> getRouteItem(route.path, menuData));
-
-        // 有权限的菜单
-        const permissionMenuData = computed<RoutesDataItem[]>(()=> getPermissionMenuData(store.state.user.currentUser.roles, menuData));
-
-        // 当前路由的顶部菜单path
-        const belongTopMenu = computed<string>(()=>getRouteBelongTopMenu(routeItem.value))
-
-        // 当前路由的父路由path[]
-        const routeParentPaths = computed<string[]>(()=>formatRoutePathTheParents(routeItem.value.path));
-
-        // 收缩左侧
-        const collapsed = computed<boolean>(()=> store.state.global.collapsed);
-        const toggleCollapsed = (): void => {
-          store.commit('global/changeLayoutCollapsed', !collapsed.value);
-        }
-
-        // 右侧顶部tabNav是否开启
-        const tabNavEnable = computed<boolean>(()=> store.state.global.tabNavEnable);
-
-        // 右侧顶部导航是否开启
-        const topNavEnable = computed<boolean>(()=> store.state.global.topNavEnable);
-
-        // 右侧顶部是否固定
-        const headFixed = computed<boolean>(()=> store.state.global.headFixed);
-
-
-        // 左侧选择的菜单
-        const defaultActive = computed<string>(()=> getSelectLeftMenuPath(routeItem.value));
-
-
-        // 面包屑导航
-        const breadCrumbs = computed<BreadcrumbType[]>(() => getBreadcrumbRoutes(routeItem.value,routeParentPaths.value, menuData));
-
-        // 设置title
-        useTitle(routeItem);
-
-        
-        return {
-          collapsed,
-          toggleCollapsed,
-          tabNavEnable,
-          topNavEnable,
-          belongTopMenu,
-          headFixed, 
-          defaultActive,
-          breadCrumbs,
-          permissionMenuData,
-          routeItem
-        }
-
-
-    }
-})
+  name: "IndexLayout",
+  components: {
+    Permission,
+    Left,
+    RightTop,
+    Settings,
+  },
+  setup(): IndexLayoutSetupData {
+    const store =
+      useStore<{
+        global: GlobalStateType;
+        user: UserStateType;
+      }>();
+    const route = useRoute();
+
+    // 所有菜单路由
+    const menuData: RoutesDataItem[] = vueRoutes(IndexLayoutRoutes);
+
+    // 当前路由 item
+    const routeItem = computed<RoutesDataItem>(() =>
+      getRouteItem(route.path, menuData)
+    );
+
+    // 有权限的菜单
+    const permissionMenuData = computed<RoutesDataItem[]>(() =>
+      getPermissionMenuData(store.state.user.currentUser.roles, menuData)
+    );
+
+    // 当前路由的顶部菜单path
+    const belongTopMenu = computed<string>(() =>
+      getRouteBelongTopMenu(routeItem.value)
+    );
+
+    // 当前路由的父路由path[]
+    const routeParentPaths = computed<string[]>(() =>
+      formatRoutePathTheParents(routeItem.value.path)
+    );
+
+    // 收缩左侧
+    const collapsed = computed<boolean>(() => store.state.global.collapsed);
+    const toggleCollapsed = (): void => {
+      store.commit("global/changeLayoutCollapsed", !collapsed.value);
+    };
+
+    // 右侧顶部tabNav是否开启
+    const tabNavEnable = computed<boolean>(
+      () => store.state.global.tabNavEnable
+    );
+
+    // 右侧顶部导航是否开启
+    const topNavEnable = computed<boolean>(
+      () => store.state.global.topNavEnable
+    );
+
+    // 右侧顶部是否固定
+    const headFixed = computed<boolean>(() => store.state.global.headFixed);
+
+    // 左侧选择的菜单
+    const defaultActive = computed<string>(() =>
+      getSelectLeftMenuPath(routeItem.value)
+    );
+
+    // 面包屑导航
+    const breadCrumbs = computed<BreadcrumbType[]>(() =>
+      getBreadcrumbRoutes(routeItem.value, routeParentPaths.value, menuData)
+    );
+
+    // 设置title
+    useTitle(routeItem);
+
+    return {
+      collapsed,
+      toggleCollapsed,
+      tabNavEnable,
+      topNavEnable,
+      belongTopMenu,
+      headFixed,
+      defaultActive,
+      breadCrumbs,
+      permissionMenuData,
+      routeItem,
+    };
+  },
+});
 </script>
 <style lang="scss">
-@import '../../assets/css/variables.scss';
+@import "../../assets/css/variables.scss";
 #indexlayout {
   display: flex;
   height: 100vh;

+ 52 - 25
src/layouts/IndexLayout/locales/zh-CN.ts

@@ -5,29 +5,56 @@ export default {
   'index-layout.menu.alarmManage': '告警管理',
   'index-layout.menu.siteManage': '站点管理',
 
-  'index-layout.menu.stationManage':'台区管理',
-  'index-layout.menu.stationManage.EditArticle':'站点列表',
-  'index-layout.menu.stationManage.Articleindex':'所有台区',
-
-  'index-layout.menu.deviceManage':'设备管理',
-  'index-layout.menu.deviceManage.powerEquip':'电力监测设备',
-  'index-layout.menu.deviceManage.videoEquip':'视频监测设备',
-  'index-layout.menu.deviceManage.communicateEquip':'通信设备',
-  'index-layout.menu.deviceManage.channelList':'通道列表',
-  'index-layout.menu.deviceManage.attribTemplate':'属性模板',
-
-  'index-layout.menu.dataManage':'数据管理',
-  'index-layout.menu.dataManage.sameAnalysis':'同比分析报表',
-  'index-layout.menu.dataManage.chainAnalysis':'环比分析报表',
-  'index-layout.menu.dataManage.handOpera':'手动抄表',
-  'index-layout.menu.dataManage.energyReport':'用能月报',
-  'index-layout.menu.dataManage.demandAnalysis':'需量分析',
-  'index-layout.menu.dataManage.consumConfig':'能耗分析配置',
-
-
-
-    'index-layout.menu.roles': '权限验证',
-      'index-layout.menu.roles.all': '用户都有权限',
-        'index-layout.menu.roles.user': 'Users有权限',
-          'index-layout.menu.roles.test': 'Tests有权限',
+  'index-layout.menu.stationManage': '台区管理',
+  'index-layout.menu.stationManage.EditArticle': '站点列表',
+  'index-layout.menu.stationManage.Articleindex': '所有台区',
+
+  'index-layout.menu.deviceManage': '设备管理',
+  'index-layout.menu.deviceManage.powerEquip': '电力监测设备',
+  'index-layout.menu.deviceManage.videoEquip': '视频监测设备',
+  'index-layout.menu.deviceManage.communicateEquip': '通信设备',
+  'index-layout.menu.deviceManage.channelList': '通道列表',
+  'index-layout.menu.deviceManage.attribTemplate': '属性模板',
+
+  'index-layout.menu.dataManage': '数据管理',
+  'index-layout.menu.dataManage.sameAnalysis': '同比分析报表',
+  'index-layout.menu.dataManage.chainAnalysis': '环比分析报表',
+  'index-layout.menu.dataManage.handOpera': '手动抄表',
+  'index-layout.menu.dataManage.energyReport': '用能月报',
+  'index-layout.menu.dataManage.demandAnalysis': '需量分析',
+  'index-layout.menu.dataManage.consumConfig': '能耗分析配置',
+
+
+  'index-layout.menu.powerQuality': '电能质量',
+  'index-layout.menu.powerQuality.sameAnalysis': '谐波报表',
+  'index-layout.menu.powerQuality.chainAnalysis': '实时监测',
+  'index-layout.menu.powerQuality.handOpera': '评估报告',
+  'index-layout.menu.powerQuality.energyReport': '三相不平衡分析',
+
+  'index-layout.menu.monthReport': '月度报告',
+
+  'index-layout.menu.planOutage': '计划停电',
+
+  'index-layout.menu.patrolManage': '巡检管理',
+  'index-layout.menu.patrolManage.patrolPlan': '巡检计划',
+  'index-layout.menu.patrolManage.patrolRecord': '巡检记录',
+  'index-layout.menu.patrolManage.patrolContent': '巡检内容',
+  'index-layout.menu.patrolManage.checkEntries': '检查条目',
+
+  'index-layout.menu.operManage': '运维管理',
+  'index-layout.menu.operManage.siteAchives': '现场档案',
+  'index-layout.menu.operManage.defectManage': '缺陷管理',
+  'index-layout.menu.operManage.workManage': '工单管理',
+  'index-layout.menu.operManage.operStatistics': '运维统计',
+  'index-layout.menu.operManage.workStatistics': '工作量统计',
+
+  'index-layout.menu.systemManage': '系统管理',
+  'index-layout.menu.systemManage.userManage': '用户管理',
+  'index-layout.menu.systemManage.rolePermission': '权限管理',
+
+
+  'index-layout.menu.roles': '权限验证',
+  'index-layout.menu.roles.all': '用户都有权限',
+  'index-layout.menu.roles.user': 'Users有权限',
+  'index-layout.menu.roles.test': 'Tests有权限',
 };

+ 78 - 39
src/layouts/IndexLayout/routes.ts

@@ -43,9 +43,14 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
     ]
   },
 
-
-
-
+  /**
+   * deviceManage 设备管理
+   * powerEquip 电力监测设备
+   * videoEquip 视频监测设备
+   * communicateEquip 通信设备
+   * channelList 通道列表
+   * attribTemplate 属性模板
+   */
   {
     icon: 'deviceManage',
     title: 'index-layout.menu.deviceManage',
@@ -81,8 +86,15 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
     ]
   },
 
-
-
+  /**
+   * dataManage 数据管理
+   * sameAnalysis 同比分析报表
+   * chainAnalysis 环比分析报表
+   * handOpera 手动抄表
+   * energyReport 用能月报
+   * demandAnalysis 需量分析
+   * consumConfig 能耗分析配置
+   */
   {
     icon: 'dataManage',
     title: 'index-layout.menu.dataManage',
@@ -123,53 +135,76 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
       }
     ]
   },
+
+
+  /**
+   * powerQuality 电能质量
+   * harmonicReport 谐波报表
+   * realTimeMonitoring 实时监测
+   * asseReport 评估报告
+   * unbalanceAnalysis 三相不平衡分析
+   */
   {
-    title: '电能质量',
+    title: 'index-layout.menu.powerQuality',
     icon: 'powerQuality',
     path: '/powerQuality',
     component: BlankLayout,
     redirect: '/powerQuality/harmonicReport',
     children: [
       {
-        title: '谐波报表',
+        title: 'index-layout.menu.powerQuality.harmonicReport',
         path: 'harmonicReport',
         component: () => import('@/views/powerQuality/harmonicReport/index.vue'),
       },
       {
-        title: '实时监测',
+        title: 'index-layout.menu.powerQuality.realTimeMonitoring',
         path: 'realTimeMonitoring',
-        name: 'realTimeMonitoring',
         component: () => import('@/views/powerQuality/realTimeMonitoring/index.vue'),
       },
       {
-        title: '评估报告',
+        title: 'index-layout.menu.powerQuality.asseReport',
         path: 'asseReport',
-        name: 'asseReport',
         component: () => import('@/views/powerQuality/asseReport/index.vue'),
       },
       {
-        title: '三相不平衡分析',
+        title: 'index-layout.menu.powerQuality.unbalanceAnalysis',
         path: 'unbalanceAnalysis',
-        name: 'unbalanceAnalysis',
         component: () => import('@/views/powerQuality/unbalanceAnalysis/index.vue'),
       },
 
     ]
   },
+
+
+  /**
+   * monthReport 月度报告
+   */
   {
     icon: 'monthReport',
-    title: '月度报告',
+    title: 'index-layout.menu.monthReport',
     path: '/monthReport',
     component: () => import('@/views/monthReport/index.vue'),
   },
+
+  /**
+  * planOutage 计划停电
+  */
   {
     icon: 'planOutage',
-    title: '计划停电',
+    title: 'index-layout.menu.planOutage',
     path: '/planOutage',
     component: () => import('@/views/planOutage/index.vue'),
   },
+
+  /**
+   * patrolManage 巡检管理
+   * patrolPlan 巡检计划
+   * patrolRecord 巡检记录
+   * patrolContent 巡检内容
+   * checkEntries 检查条目
+   */
   {
-    title: '巡检管理',
+    title: 'index-layout.menu.patrolManage',
     icon: 'patrolManage',
     path: '/patrolManage',
     component: BlankLayout,
@@ -177,33 +212,42 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
     name: 'patrolManage',
     children: [
       {
-        title: '巡检计划',
+        title: 'index-layout.menu.patrolManage.patrolPlan',
         path: 'patrolPlan',
         name: 'patrolPlan',
         component: () => import('@/views/patrolManage/patrolPlan/index.vue'),
       },
       {
-        title: '巡检记录',
+        title: 'index-layout.menu.patrolManage.patrolRecord',
         path: 'patrolRecord',
         name: 'patrolRecord',
         component: () => import('@/views/patrolManage/patrolRecord/index.vue'),
       },
       {
-        title: '巡检内容',
+        title: 'index-layout.menu.patrolManage.patrolContent',
         path: 'patrolContent',
         name: 'patrolContent',
         component: () => import('@/views/patrolManage/patrolContent/index.vue'),
       },
       {
-        title: '检查条目',
+        title: 'index-layout.menu.patrolManage.checkEntries',
         path: 'checkEntries',
         name: 'checkEntries',
         component: () => import('@/views/patrolManage/checkEntries/index.vue'),
       },
     ]
   },
+
+  /**
+   * operManage 运维管理
+   * siteAchives 现场档案
+   * defectManage 缺陷管理
+   * workManage 工单管理
+   * operStatistics 运维统计
+   * workStatistics 工作量统计
+   */
   {
-    title: '运维管理',
+    title: 'index-layout.menu.operManage',
     icon: 'operManage',
     path: '/operManage',
     component: BlankLayout,
@@ -211,67 +255,62 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
     name: 'operManage',
     children: [
       {
-        title: '现场档案',
+        title: 'index-layout.menu.operManage.siteAchives',
         path: 'siteAchives',
-        name: 'siteAchives',
         component: () => import('@/views/operManage/siteAchives/index.vue'),
       },
       {
-        title: '缺陷管理',
+        title: 'index-layout.menu.operManage.defectManage',
         path: 'defectManage',
-        name: 'defectManage',
         component: () =>
           import('@/views/operManage/defectManage/index.vue'),
       },
       {
-        title: '工单管理',
+        title: 'index-layout.menu.operManage.workManage',
         path: 'workManage',
-        name: 'workManage',
         component: () =>
           import('@/views/operManage/workManage/index.vue'),
       },
       {
-        title: '运维统计',
+        title: 'index-layout.menu.operManage.operStatistics',
         path: 'operStatistics',
-        name: 'operStatistics',
         component: () => import('@/views/operManage/operStatistics/index.vue'),
       },
       {
-        title: '工作量统计',
+        title: 'index-layout.menu.operManage.workStatistics',
         path: 'workStatistics',
-        name: 'workStatistics',
         component: () => import('@/views/operManage/workStatistics/index.vue'),
       },
 
     ]
   },
 
+  /** 
+   * systemManage 系统管理
+   * userManage 用户管理
+   * rolePermission 权限管理
+   */
   {
-    title: '系统管理',
+    title: 'index-layout.menu.systemManage',
     icon: 'systemManage',
     path: '/systemManage',
     component: BlankLayout,
     redirect: '/systemManage/userManage',
-    name: 'systemManage',
     children: [
       {
-        title: '用户管理',
+        title: 'index-layout.menu.systemManage.userManage',
         path: 'userManage',
-        name: 'userManage',
         component: () => import('@/views/systemManage/userManage/index.vue'),
       },
       {
-        title: '权限管理',
+        title: 'index-layout.menu.systemManage.rolePermission',
         path: 'rolePermission',
-        name: 'rolePermission',
         component: () => import('@/views/systemManage/rolePermission/index.vue'),
       },
     ]
   },
 
 
-
-
   {
     icon: 'permissions',
     title: 'index-layout.menu.roles',