zhuf пре 1 месец
родитељ
комит
6450893f0f
2 измењених фајлова са 287 додато и 281 уклоњено
  1. 11 6
      src/layout/app/components/Sidebar/index.vue
  2. 276 275
      src/router/index.js

+ 11 - 6
src/layout/app/components/Sidebar/index.vue

@@ -2,9 +2,11 @@
   <div class="aside-wrapper">
     <!-- :class="{'has-logo':showLogo}" -->
     <!-- <logo v-if="showLogo" :collapse="isCollapse" /> -->
+    <div class="text-lg text-center py-20px text-blue-600">{{ title }}</div>
     <el-scrollbar class="scrollbar-wrapper">
-      <el-menu class="menu-wrapper" :default-active="activeMenu" :default-openeds="openedMenu" active-text-color="#4351ff"
-        :collapse="SidebarStore.isCollapse" :unique-opened="true" :collapse-transition="false" mode="vertical">
+      <el-menu class="menu-wrapper" :default-active="activeMenu" :default-openeds="openedMenu"
+        active-text-color="#4351ff" :collapse="SidebarStore.isCollapse" :unique-opened="true"
+        :collapse-transition="false" mode="vertical">
         <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
       </el-menu>
     </el-scrollbar>
@@ -13,7 +15,7 @@
 
 <script>
 import { useSidebarStore } from '@/stores/sidebar'
-import { defineComponent } from '@vue/composition-api'
+import { defineComponent, ref } from '@vue/composition-api'
 // import Logo from './Logo.vue'
 import variables from '@/styles/variables.scss'
 import SidebarItem from './SidebarItem.vue'
@@ -26,7 +28,7 @@ export default defineComponent({
       // console.log('route : ', route)
       const { meta, path, matched } = route
       const rootPath = matched[0].path
-      return this.$router.options.routes.filter(item=>item.path === rootPath)//[0].children.filter(item=>!item.meta.hidden)
+      return this.$router.options.routes.filter(item => item.path === rootPath)//[0].children.filter(item=>!item.meta.hidden)
     },
     activeMenu() {
       const route = this.$route
@@ -53,8 +55,11 @@ export default defineComponent({
   },
   setup() {
     const SidebarStore = useSidebarStore()
+    const title = ref(sessionStorage.getItem('appname') || '')
+
     return {
-      SidebarStore
+      SidebarStore,
+      title,
     }
   }
 })
@@ -66,7 +71,7 @@ export default defineComponent({
   width: 100%;
 
   .scrollbar-wrapper {
-    height: 100%;
+    // height: 100%;
     width: 100%;
 
     .el-scrollbar__wrap {

+ 276 - 275
src/router/index.js

@@ -1837,282 +1837,283 @@ const createRouter = () =>
   new Router({
     // mode: 'history', // require service support
     scrollBehavior: () => ({ y: 0 }),
+    routes: allRoutes
     // routes: _routes_
-    routes: [
-      {
-        path: "/",
-        redirect: { name: 'gwglxt' },
-      },
-      {
-        path: "/gwglxt",
-        name: "gwglxt",
-        component: AppLayout,
-        meta: { title: "公文管理", icon: "el-icon-document" },
-        redirect: "/gwglxt/fwng",
-        children: [
-          {
-            path: "/gwglxt/fwng",
-            name: "gwglxt_fwng",
-            component: () => import("@/views/gwglxt/fwng/index.vue"),
-            meta: { title: "发文拟稿" },
-          },
-          {
-            path: "/gwglxt/wdfw",
-            name: "gwglxt_wdfw",
-            component: () => import("@/views/gwglxt/wdfw/index.vue"),
-            meta: { title: "我的发文" },
-          },
-          {
-            path: "/gwglxt/dbfw",
-            name: "gwglxt_dbfw_main",
-            component: MainDefaultLayout,
-            meta: { title: "待办发文" },
-            children: [
-              {
-                path: "",
-                name: "gwglxt_dbfw",
-                component: () => import("@/views/gwglxt/dbfw/index.vue"),
-                meta: { title: "待办发文" },
-                props: true,
-              },
-              {
-                path: "sh/:id",
-                hidden: true,
-                name: "gwglxt_dbfw_sh",
-                component: () => import("@/views/gwglxt/dbfw/sh/index.vue"),
-                meta: { title: "审核" },
-                props: true,
-              },
-              {
-                path: "lsbjjl/:id",
-                hidden: true,
-                name: "gwglxt_dbfw_lsbjjl",
-                component: () => import("@/views/gwglxt/dbfw/lsbjjl/index.vue"),
-                meta: { title: "历史编辑记录" },
-                props: true,
-              },
-              {
-                path: "dzqz/:id",
-                hidden: true,
-                name: "gwglxt_dbfw_dzqz",
-                component: () => import("@/views/gwglxt/dbfw/dzqz/index.vue"),
-                meta: { title: "电子签章" },
-                props: true,
-              },
-            ],
-          },
-          {
-            path: "/gwglxt/gwjh",
-            name: "gwglxt_gwjh",
-            component: () => import("@/views/gwglxt/gwjh/index.vue"),
-            meta: { title: "公文交互" },
-          },
-          {
-            path: "/gwglxt/dygw",
-            name: "gwglxt_dygw",
-            component: () => import("@/views/gwglxt/dygw/index.vue"),
-            meta: { title: "待阅公文" },
-          },
-          {
-            path: "/gwglxt/gwk",
-            name: "gwglxt_gwk_main",
-            component: MainDefaultLayout,
-            meta: { title: "公文库" },
-            children: [
-              {
-                path: "",
-                name: "gwglxt_gwk",
-                component: () => import("@/views/gwglxt/gwk/index.vue"),
-                meta: { title: "公文库" },
-                props: true,
-              },
-              {
-                path: "gwxq/:id",
-                hidden: true,
-                name: "gwglxt_dbfw_gwxq",
-                component: () => import("@/views/gwglxt/gwk/gwxq/index.vue"),
-                meta: { title: "公文详情" },
-                props: true,
-              },
-            ],
-          },
-          {
-            path: "/gwglxt/lcgl",
-            name: "gwglxt_lcgl",
-            component: () => import("@/views/gwglxt/lcgl/index.vue"),
-            meta: { title: "流程管理" },
-          },
-        ],
-      },
-      {
-        path: "/sbcgsq",
-        component: AppLayout,
-        redirect: { name: 'cgxmk' },
-        name: "sbcgsq",
-        meta: { title: "设备采购", icon: "el-icon-document" },
-        children: [
-          {
-            path: "cgxmk",
-            name: "cgxmk",
-            component: () => import("@/views/sbcgsq/cgxmk/index.vue"),
-            meta: {
-              title: "设备项目库",
-              checkList: ["show", "detail"],
-            },
-          },
-          {
-            path: "sbys",
-            name: "sbcgsq_sbys",
-            component: MainDefaultLayout,
-            meta: { title: "设备预算" },
-            children: [
-              {
-                path: "",
-                name: "sbys",
-                component: () => import("@/views/sbcgsq/sbys/index.vue"),
-                meta: {
-                  title: "设备预算",
-                  checkList: ["show", "add", "edit", "delete", "detail"],
-                },
-                props: true,
-              },
-              {
-                path: "xq/:id/:type",
-                hidden: true,
-                name: "sbys_xq",
-                component: () => import("@/views/sbcgsq/sbys/detail.vue"),
-                meta: {
-                  // title: "详情",
-                  checkList: ["show"],
-                },
-                // props: true,
-              },
-            ],
-          },
-          // children: [
-          //   {
-          //     path: "sbys",
-          //     name: "sbcgsq_sbys",
-          //     component: MainDefaultLayout,
-          //     meta: { title: "设备预算" },
-          //     children: [
-          //       {
-          //         path: "cgxmk",
-          //         name: "cgxmk",
-          //         component: () => import("@/views/sbcgsq/cgxmk/index.vue"),
-          //         meta: {
-          //           title: "设备项目库",
-          //           checkList: ["show", "detail"],
-          //         },
-          //       },
-          //       {
-          //         path: "",
-          //         name: "sbys",
-          //         component: () => import("@/views/sbcgsq/sbys/index.vue"),
-          //         meta: {
-          //           title: "设备预算",
-          //           checkList: ["show", "add", "edit", "delete", "detail"],
-          //         },
-          //         props: true,
-          //       },
-          //       {
-          //         path: "xq/:id/:type",
-          //         hidden: true,
-          //         name: "sbys_xq",
-          //         component: () => import("@/views/sbcgsq/sbys/detail.vue"),
-          //         meta: {
-          //           // title: "详情",
-          //           checkList: ["show"],
-          //         },
-          //         // props: true,
-          //       },
-          //     ],
-          //   },
-          {
-            path: "sblxgl",
-            name: "sblxgl",
-            component: () => import("@/views/sbcgsq/sblxgl/index.vue"),
-            meta: {
-              title: "设备类型管理",
-              checkList: ["show", "add", "edit", "delete"],
-            },
-          },
-          {
-            path: "/sbcgsq/bbtj",
-            name: "sbcgsq_bbtj_main",
-            component: MainDefaultLayout,
-            meta: { title: "报表统计" },
-            children: [
-              {
-                path: "",
-                name: "sbcgsq_bbtj",
-                component: () => import("@/views/sbcgsq/bbtj/index.vue"),
-                meta: {
-                  title: "报表统计",
-                  checkList: ["show", "add", "delete", "detail", "export"],
-                },
-                props: true,
-              },
-              {
-                path: "bbxq/:id",
-                hidden: true,
-                name: "sbcgsq_bbtj_bbxq",
-                component: () => import("@/views/sbcgsq/bbtj/detail/detail.vue"),
-                meta: {
-                  title: "报表详情",
-                  checkList: ["show", "edit", "export"],
-                },
-                props: true,
-              },
-            ],
-          },
-          {
-            path: "lcgl",
-            name: "lcgl_main",
-            component: MainDefaultLayout,
-            meta: { title: "流程管理" },
-            children: [
-              {
-                path: "",
-                name: "lcgl",
-                component: () => import("@/views/sbcgsq/lcgl/index.vue"),
-                meta: {
-                  title: "流程管理",
-                  checkList: ["show", "add", "edit", "detail"],
-                },
-                props: true,
-              },
-              {
-                path: "detail/:id",
-                hidden: true,
-                name: "lcgl_detail",
-                component: () => import("@/views/sbcgsq/lcgl/detail.vue"),
-                meta: {
-                  title: "详情",
-                  checkList: ["show", "detail"],
-                },
-                props: true,
-              },
-            ],
-          },
-        ],
-      },
-      {
-        path: "/zzjgyqx",
-        component: AppLayout,
-        name: "zzjgyqx",
-        meta: { title: "组织结构", icon: "el-icon-document" },
-        children: [
-          {
-            path: "",
-            name: "zzjgyqx_main",
-            // component: () => import("@/views/zzjgyqx/index.vue"),
-            component: () => import("@/views/xmgl/qxfp/index.vue"),
-            meta: { title: "组织结构" },
-          },
-        ],
-      },
-    ],
+    // routes: [
+    //   {
+    //     path: "/",
+    //     redirect: { name: 'gwglxt' },
+    //   },
+    //   {
+    //     path: "/gwglxt",
+    //     name: "gwglxt",
+    //     component: AppLayout,
+    //     meta: { title: "公文管理", icon: "el-icon-document" },
+    //     redirect: "/gwglxt/fwng",
+    //     children: [
+    //       {
+    //         path: "/gwglxt/fwng",
+    //         name: "gwglxt_fwng",
+    //         component: () => import("@/views/gwglxt/fwng/index.vue"),
+    //         meta: { title: "发文拟稿" },
+    //       },
+    //       {
+    //         path: "/gwglxt/wdfw",
+    //         name: "gwglxt_wdfw",
+    //         component: () => import("@/views/gwglxt/wdfw/index.vue"),
+    //         meta: { title: "我的发文" },
+    //       },
+    //       {
+    //         path: "/gwglxt/dbfw",
+    //         name: "gwglxt_dbfw_main",
+    //         component: MainDefaultLayout,
+    //         meta: { title: "待办发文" },
+    //         children: [
+    //           {
+    //             path: "",
+    //             name: "gwglxt_dbfw",
+    //             component: () => import("@/views/gwglxt/dbfw/index.vue"),
+    //             meta: { title: "待办发文" },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "sh/:id",
+    //             hidden: true,
+    //             name: "gwglxt_dbfw_sh",
+    //             component: () => import("@/views/gwglxt/dbfw/sh/index.vue"),
+    //             meta: { title: "审核" },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "lsbjjl/:id",
+    //             hidden: true,
+    //             name: "gwglxt_dbfw_lsbjjl",
+    //             component: () => import("@/views/gwglxt/dbfw/lsbjjl/index.vue"),
+    //             meta: { title: "历史编辑记录" },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "dzqz/:id",
+    //             hidden: true,
+    //             name: "gwglxt_dbfw_dzqz",
+    //             component: () => import("@/views/gwglxt/dbfw/dzqz/index.vue"),
+    //             meta: { title: "电子签章" },
+    //             props: true,
+    //           },
+    //         ],
+    //       },
+    //       {
+    //         path: "/gwglxt/gwjh",
+    //         name: "gwglxt_gwjh",
+    //         component: () => import("@/views/gwglxt/gwjh/index.vue"),
+    //         meta: { title: "公文交互" },
+    //       },
+    //       {
+    //         path: "/gwglxt/dygw",
+    //         name: "gwglxt_dygw",
+    //         component: () => import("@/views/gwglxt/dygw/index.vue"),
+    //         meta: { title: "待阅公文" },
+    //       },
+    //       {
+    //         path: "/gwglxt/gwk",
+    //         name: "gwglxt_gwk_main",
+    //         component: MainDefaultLayout,
+    //         meta: { title: "公文库" },
+    //         children: [
+    //           {
+    //             path: "",
+    //             name: "gwglxt_gwk",
+    //             component: () => import("@/views/gwglxt/gwk/index.vue"),
+    //             meta: { title: "公文库" },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "gwxq/:id",
+    //             hidden: true,
+    //             name: "gwglxt_dbfw_gwxq",
+    //             component: () => import("@/views/gwglxt/gwk/gwxq/index.vue"),
+    //             meta: { title: "公文详情" },
+    //             props: true,
+    //           },
+    //         ],
+    //       },
+    //       {
+    //         path: "/gwglxt/lcgl",
+    //         name: "gwglxt_lcgl",
+    //         component: () => import("@/views/gwglxt/lcgl/index.vue"),
+    //         meta: { title: "流程管理" },
+    //       },
+    //     ],
+    //   },
+    //   {
+    //     path: "/sbcgsq",
+    //     component: AppLayout,
+    //     redirect: { name: 'cgxmk' },
+    //     name: "sbcgsq",
+    //     meta: { title: "设备采购", icon: "el-icon-document" },
+    //     children: [
+    //       {
+    //         path: "cgxmk",
+    //         name: "cgxmk",
+    //         component: () => import("@/views/sbcgsq/cgxmk/index.vue"),
+    //         meta: {
+    //           title: "设备项目库",
+    //           checkList: ["show", "detail"],
+    //         },
+    //       },
+    //       {
+    //         path: "sbys",
+    //         name: "sbcgsq_sbys",
+    //         component: MainDefaultLayout,
+    //         meta: { title: "设备预算" },
+    //         children: [
+    //           {
+    //             path: "",
+    //             name: "sbys",
+    //             component: () => import("@/views/sbcgsq/sbys/index.vue"),
+    //             meta: {
+    //               title: "设备预算",
+    //               checkList: ["show", "add", "edit", "delete", "detail"],
+    //             },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "xq/:id/:type",
+    //             hidden: true,
+    //             name: "sbys_xq",
+    //             component: () => import("@/views/sbcgsq/sbys/detail.vue"),
+    //             meta: {
+    //               // title: "详情",
+    //               checkList: ["show"],
+    //             },
+    //             // props: true,
+    //           },
+    //         ],
+    //       },
+    //       // children: [
+    //       //   {
+    //       //     path: "sbys",
+    //       //     name: "sbcgsq_sbys",
+    //       //     component: MainDefaultLayout,
+    //       //     meta: { title: "设备预算" },
+    //       //     children: [
+    //       //       {
+    //       //         path: "cgxmk",
+    //       //         name: "cgxmk",
+    //       //         component: () => import("@/views/sbcgsq/cgxmk/index.vue"),
+    //       //         meta: {
+    //       //           title: "设备项目库",
+    //       //           checkList: ["show", "detail"],
+    //       //         },
+    //       //       },
+    //       //       {
+    //       //         path: "",
+    //       //         name: "sbys",
+    //       //         component: () => import("@/views/sbcgsq/sbys/index.vue"),
+    //       //         meta: {
+    //       //           title: "设备预算",
+    //       //           checkList: ["show", "add", "edit", "delete", "detail"],
+    //       //         },
+    //       //         props: true,
+    //       //       },
+    //       //       {
+    //       //         path: "xq/:id/:type",
+    //       //         hidden: true,
+    //       //         name: "sbys_xq",
+    //       //         component: () => import("@/views/sbcgsq/sbys/detail.vue"),
+    //       //         meta: {
+    //       //           // title: "详情",
+    //       //           checkList: ["show"],
+    //       //         },
+    //       //         // props: true,
+    //       //       },
+    //       //     ],
+    //       //   },
+    //       {
+    //         path: "sblxgl",
+    //         name: "sblxgl",
+    //         component: () => import("@/views/sbcgsq/sblxgl/index.vue"),
+    //         meta: {
+    //           title: "设备类型管理",
+    //           checkList: ["show", "add", "edit", "delete"],
+    //         },
+    //       },
+    //       {
+    //         path: "/sbcgsq/bbtj",
+    //         name: "sbcgsq_bbtj_main",
+    //         component: MainDefaultLayout,
+    //         meta: { title: "报表统计" },
+    //         children: [
+    //           {
+    //             path: "",
+    //             name: "sbcgsq_bbtj",
+    //             component: () => import("@/views/sbcgsq/bbtj/index.vue"),
+    //             meta: {
+    //               title: "报表统计",
+    //               checkList: ["show", "add", "delete", "detail", "export"],
+    //             },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "bbxq/:id",
+    //             hidden: true,
+    //             name: "sbcgsq_bbtj_bbxq",
+    //             component: () => import("@/views/sbcgsq/bbtj/detail/detail.vue"),
+    //             meta: {
+    //               title: "报表详情",
+    //               checkList: ["show", "edit", "export"],
+    //             },
+    //             props: true,
+    //           },
+    //         ],
+    //       },
+    //       {
+    //         path: "lcgl",
+    //         name: "lcgl_main",
+    //         component: MainDefaultLayout,
+    //         meta: { title: "流程管理" },
+    //         children: [
+    //           {
+    //             path: "",
+    //             name: "lcgl",
+    //             component: () => import("@/views/sbcgsq/lcgl/index.vue"),
+    //             meta: {
+    //               title: "流程管理",
+    //               checkList: ["show", "add", "edit", "detail"],
+    //             },
+    //             props: true,
+    //           },
+    //           {
+    //             path: "detail/:id",
+    //             hidden: true,
+    //             name: "lcgl_detail",
+    //             component: () => import("@/views/sbcgsq/lcgl/detail.vue"),
+    //             meta: {
+    //               title: "详情",
+    //               checkList: ["show", "detail"],
+    //             },
+    //             props: true,
+    //           },
+    //         ],
+    //       },
+    //     ],
+    //   },
+    //   {
+    //     path: "/zzjgyqx",
+    //     component: AppLayout,
+    //     name: "zzjgyqx",
+    //     meta: { title: "组织结构", icon: "el-icon-document" },
+    //     children: [
+    //       {
+    //         path: "",
+    //         name: "zzjgyqx_main",
+    //         // component: () => import("@/views/zzjgyqx/index.vue"),
+    //         component: () => import("@/views/xmgl/qxfp/index.vue"),
+    //         meta: { title: "组织结构" },
+    //       },
+    //     ],
+    //   },
+    // ],
   });
 
 const router = createRouter();