Bladeren bron

企业菜单

Xiao_123 11 maanden geleden
bovenliggende
commit
c31d7dd4b7

+ 81 - 0
src/layout/company/side.vue

@@ -0,0 +1,81 @@
+<template>
+  <div>
+    <v-list class="side-box" color="primary">
+      <template v-for="(item, index) in list">
+        <template v-if="!item.children.length">
+          <v-list-item
+            :key="`${item.name}_${index}`"
+            active-class="active"
+            color="primary"
+            :href="item.path"
+            :to="item.path"
+            rounded="shaped"
+            :prepend-icon="item.icon"
+            :title="item.title"
+          >
+          </v-list-item>
+        </template>
+        <v-list-group
+          v-else
+          color="primary"
+          rounded="shaped"
+          :key="`${item.name}_${index}`"
+          :value="route.path.indexOf(item.name) > -1"
+          :prepend-icon="item.icon"
+        >
+          <template v-slot:activator="{ props }">
+            <v-list-item v-bind="props" :title="item.title"></v-list-item>
+          </template>
+          <v-list-item
+            v-for="(val, index) in item.children"
+            :key="index"
+            color="primary"
+            :href="val.path"
+            style="padding-left: 40px;"
+            :to="val.path"
+            :title="val.title"
+            rounded="shaped"
+            :value="val.title"
+          ></v-list-item>
+        </v-list-group>
+      </template>
+    </v-list>
+  </div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-side'})
+import { computed } from 'vue'
+import { useRoute } from 'vue-router'
+import enterpriseRoute from '@/router/modules/enterprise'
+
+const route = useRoute()
+const list = computed(() => {
+  return getList(enterpriseRoute)
+})
+
+const getList = (arr, obj = []) => {
+  arr.forEach(element => {
+    if (element.show) return
+    const data = {}
+    data.title = element?.meta?.title
+    data.enName = element?.meta?.enName
+    data.icon = element?.meta?.icon
+    data.name = element?.name
+    data.path = element?.path
+    data.children = []
+    if (element?.children) {
+      getList(element.children, data.children)
+    }
+    obj.push(data)
+  })
+  return obj
+}
+</script>
+
+<style scoped lang="scss">
+.side-box {
+  width: 250px;
+  height: 100%;
+}
+</style>

+ 7 - 4
src/layout/enterprise.vue

@@ -2,17 +2,19 @@
   <div class="parent" @click="layoutClick">
     <Headers class="headers"></Headers>
     <div class="content">
-      <router-view></router-view>
+      <side></side>
+      <div class="pa-3">
+        <router-view></router-view>
+      </div>
     </div>
-    <Footers class="mt-10"></Footers>
     <Slider v-if="whiteList.indexOf(router.currentRoute.value.path) === -1" class="slider"></Slider>
   </div>
 </template>
 
 <script setup>
 import Headers from './company/navBar.vue'
-import Footers from './personal/footer.vue'
 import Slider from './company/slider.vue'
+import side from './company/side.vue'
 import { useSharedState } from '@/store/sharedState'
 import { useRouter } from 'vue-router'
 defineOptions({ name: 'enterprise-layout-index' })
@@ -49,7 +51,8 @@ const layoutClick = () => {
   z-index: 999;
 }
 .content {
-  min-height: calc(100vh - (48px + 225px));
+  display: flex;
   margin-top: 50px;
+  height: calc(100vh - 48px);
 }
 </style>

+ 101 - 5
src/router/modules/enterprise.js

@@ -3,15 +3,111 @@ import Layout from '@/layout/enterprise.vue'
 
 const enterprise = [
   {
-    path: '/enterprise/home',
+    path: '/enterprise/talentPool',
     component: Layout,
+    name: 'talentPool',
+    meta: {
+      title: '人才库',
+      enName: 'Talent Pool',
+      icon: 'mdi-account-multiple'
+    },
     children: [
       {
-        path: '/enterprise/home',
-        component: () => import('@/views/Home/enterprise'),
+        path: '/enterprise/talentPool',
+        show: true,
+        component: () => import('@/views/enterprise/talentPool/index.vue')
+      }
+    ]
+  },
+  {
+    path: '/enterprise/statistics',
+    component: Layout,
+    name: 'enterpriseStatistics',
+    meta: {
+      title: '统计分析',
+      enName: 'Statistics',
+      icon: 'mdi-chart-arc'
+    },
+    children: [
+      // {
+      //   path: '/enterprise/statistics',
+      //   show: true,
+      //   component: () => import('@/views/enterprise/statistics/index.vue')
+      // },
+      {
+        path: '/enterprise/statistics/overallAnalysis',
         meta: {
-          title: '首页'
-        }
+          title: '整体分析'
+        },
+        component: () => import('@/views/enterprise/statistics/overallAnalysis.vue')
+      }
+    ]
+  },
+  {
+    path: '/enterprise/position',
+    component: Layout,
+    name: 'jobManagement',
+    meta: {
+      title: '职位管理',
+      enName: 'Job Management',
+      icon: 'mdi-format-list-bulleted-square'
+    },
+    children: [
+      {
+        path: '/enterprise/position',
+        show: true,
+        component: () => import('@/views/enterprise/positionManagement/index.vue')
+      }
+    ]
+  },
+  {
+    path: '/enterprise/communication',
+    component: Layout,
+    name: 'Communication',
+    meta: {
+      title: '沟通',
+      enName: 'Communication',
+      icon: 'mdi-bell-outline'
+    },
+    children: [
+      {
+        path: '/enterprise/communication',
+        show: true,
+        component: () => import('@/views/enterprise/communication/index.vue')
+      }
+    ]
+  },
+  {
+    path: '/enterprise/infoManagement',
+    component: Layout,
+    name: 'infoManagement',
+    meta: {
+      title: '信息管理',
+      enName: 'Info Management',
+      icon: 'mdi-list-box'
+    },
+    children: [
+      {
+        path: '/enterprise/infoManagement',
+        show: true,
+        component: () => import('@/views/enterprise/infoManagement/index.vue')
+      }
+    ]
+  },
+  {
+    path: '/enterprise/systemManagement',
+    component: Layout,
+    name: 'systemManagement',
+    meta: {
+      title: '系统管理',
+      enName: 'System Management',
+      icon: 'mdi-tune'
+    },
+    children: [
+      {
+        path: '/enterprise/systemManagement',
+        show: true,
+        component: () => import('@/views/enterprise/systemManagement/index.vue')
       }
     ]
   }

+ 11 - 0
src/views/enterprise/communication/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>沟通</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-communication'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/infoManagement/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>企业资料管理</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-info-management'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/positionManagement/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>职位管理</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'formPage'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/statistics/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>统计分析</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-statistics'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/statistics/overallAnalysis.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>整体分析</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'overallAnalysis'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/systemManagement/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>系统管理</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-system-management'})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 11 - 0
src/views/enterprise/talentPool/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>人才库</div>
+</template>
+
+<script setup>
+defineOptions({ name: 'enterprise-talent-pool'})
+</script>
+
+<style scoped lang="scss">
+
+</style>