刘洋 2 년 전
부모
커밋
bf1d070e1f
5개의 변경된 파일149개의 추가작업 그리고 16개의 파일을 삭제
  1. 96 0
      src/modules/analysis/nav/index.vue
  2. 2 2
      src/modules/analysis/personnel-statistics/index.vue
  3. 13 13
      src/modules/bootstrap/login/index.vue
  4. 6 1
      src/router/analysis.ts
  5. 32 0
      src/store/layout.ts

+ 96 - 0
src/modules/analysis/nav/index.vue

@@ -0,0 +1,96 @@
+<template>
+  <div class="full nav-page">
+    <div class="flex flex-wrap">
+      <div class="radius-base m-b-base m-r-base nav-card">决策分析</div>
+      <router-link v-show="hasPermissions('/analysis/monitoring')" to="/analysis/monitoring">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">监控</div>
+          </div>
+        </div>
+      </router-link>
+      <router-link v-show="hasPermissions('/analysis/statistics')" to="/analysis/statistics">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">统计</div>
+          </div>
+        </div>
+      </router-link>
+      <router-link v-show="hasPermissions('/analysis/personnel-statistics')" to="/analysis/personnel-statistics">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">人员数据统计</div>
+          </div>
+        </div>
+      </router-link>
+      <router-link v-show="hasPermissions('/analysis/personnel-compare')" to="/analysis/personnel-compare">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">人员对比</div>
+          </div>
+        </div>
+      </router-link>
+      <router-link v-show="hasPermissions('/analysis/marking-progress')" to="/analysis/marking-progress">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">评卷进度统计</div>
+          </div>
+        </div>
+      </router-link>
+      <router-link v-show="hasPermissions('/analysis/group-monitoring')" to="/analysis/group-monitoring">
+        <div class="radius-base fill-blank m-b-base m-r-base nav-item">
+          <div class="full-w">
+            <img class="nav-img" src="@img/科目管理.png" alt="" />
+            <div class="m-t-extra-base nav-title">小组长监控</div>
+          </div>
+        </div>
+      </router-link>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts" name="QualityNav">
+/** 质量统计导航页 */
+import useNavPermissions from '@/hooks/useNavPermissions'
+
+const { hasPermissions } = useNavPermissions()
+</script>
+
+<style scoped lang="scss">
+.nav-page {
+  padding: 80px 80px 0 80px;
+  .nav-card {
+    width: 410px;
+    height: 180px;
+    background: url(@img/nav-page-card.png) no-repeat center center / cover;
+    padding: 32px;
+    font-size: 22px;
+    color: $color--white;
+  }
+  .nav-item {
+    width: 200px;
+    height: 180px;
+    text-align: center;
+    display: flex;
+    place-items: center;
+    cursor: pointer;
+    &:hover {
+      box-shadow: 0px 0px 8px $ShadowColor;
+    }
+    .nav-img {
+      width: 64px;
+      height: 64px;
+    }
+    .nav-title {
+      color: $PrimaryPlusFontColor;
+      font-size: $MediumFont;
+      font-weight: bold;
+    }
+  }
+}
+</style>

+ 2 - 2
src/modules/analysis/personnel-statistics/index.vue

@@ -158,9 +158,9 @@ const data = computed<ExtractApiResponse<'getStatisticsByGroup'>>(() => {
           total.push(...(cur.markerDetails || []))
           total.push(...(cur.markerDetails || []))
           return total
           return total
         }, [] as ExtractApiResponse<'getStatisticsByGroup'>)
         }, [] as ExtractApiResponse<'getStatisticsByGroup'>)
-        .sort((a, b) => a.markerId - b.markerId)
+        .sort((a: any, b: any) => a.markerId - b.markerId)
         .concat(totalIndex >= 0 ? groupList[totalIndex] : [])
         .concat(totalIndex >= 0 ? groupList[totalIndex] : [])
-    : groupList.sort((a, b) => (a.markingGroupNumber as number) - (b.markingGroupNumber as number))
+    : groupList.sort((a: any, b: any) => (a.markingGroupNumber as number) - (b.markingGroupNumber as number))
 })
 })
 
 
 /** 刷新按钮 */
 /** 刷新按钮 */

+ 13 - 13
src/modules/bootstrap/login/index.vue

@@ -131,19 +131,19 @@ function loginSuccess(loginInfo: ExtractApiResponse<'userLogin'>) {
       if (!loginInfo.needRealName) {
       if (!loginInfo.needRealName) {
         mainStore.getMyUserInfo()
         mainStore.getMyUserInfo()
       }
       }
-      let next = loginInfo.needRealName
-        ? { name: 'InitUserName' }
-        : loginInfo.role === 'MARKER'
-        ? { name: 'MarkingMark' }
-        : { path: renderMenus[0].path || '/' }
-      replace(next)
-      // replace({
-      //   name: loginInfo.needRealName
-      //     ? 'InitUserName'
-      //     : loginInfo.role === 'MARKER'
-      //     ? 'MarkingMark'
-      //     : 'AnalysisMonitoring',
-      // })
+      // let next = loginInfo.needRealName
+      //   ? { name: 'InitUserName' }
+      //   : loginInfo.role === 'MARKER'
+      //   ? { name: 'MarkingMark' }
+      //   : { path: renderMenus[0].path || '/' }
+      // replace(next)
+      replace({
+        name: loginInfo.needRealName
+          ? 'InitUserName'
+          : loginInfo.role === 'MARKER'
+          ? 'MarkingMark'
+          : 'AnalysisMonitoring',
+      })
     } else {
     } else {
       replace({ name: 'CheckExam' })
       replace({ name: 'CheckExam' })
     }
     }

+ 6 - 1
src/router/analysis.ts

@@ -6,7 +6,7 @@ const routes: RouteRecordRaw[] = [
     name: 'Analysis',
     name: 'Analysis',
     path: '/analysis',
     path: '/analysis',
     component: MainLayout,
     component: MainLayout,
-    redirect: '/analysis/monitoring',
+    // redirect: '/analysis/monitoring',
     meta: {
     meta: {
       label: '决策分析',
       label: '决策分析',
       menu: true,
       menu: true,
@@ -15,6 +15,11 @@ const routes: RouteRecordRaw[] = [
       sort: 1,
       sort: 1,
     },
     },
     children: [
     children: [
+      {
+        name: 'AnalysisNav',
+        path: '',
+        component: () => import('@/modules/analysis/nav/index.vue'),
+      },
       {
       {
         name: 'AnalysisMonitoring',
         name: 'AnalysisMonitoring',
         path: 'monitoring',
         path: 'monitoring',

+ 32 - 0
src/store/layout.ts

@@ -103,11 +103,43 @@ const useMainLayoutStore = defineStore<
     async getRenderMenuList() {
     async getRenderMenuList() {
       try {
       try {
         const privilege = await useFetch('getUserPrivilege').fetch()
         const privilege = await useFetch('getUserPrivilege').fetch()
+        console.log('privilege:', privilege)
+        // privilege.forEach((node: any) => {
+        //   if (node.code === 'analysis') {
+        //     node.privilegeUri = '/analysis/monitoring'
+        //     this.menuList.forEach((item: any) => {
+        //       if (item.index === 'analysis') {
+        //         item.path = '/analysis/monitoring'
+        //       }
+        //     })
+        //   }
+        // })
+        // if (!privilege.find((item) => item.code === 'analysis')) {
+        //   privilege.push({
+        //     code: 'analysis',
+        //     id: 1000,
+        //     name: '决策分析',
+        //     nodeCode: 'analysis',
+        //     nodeId: '1000',
+        //     nodeName: '决策分析',
+        //     parentId: -1,
+        //     parentNodeId: '-1',
+        //     privilegeType: 'MENU',
+        //     privilegeUri: '/analysis/nav',
+        //   })
+        //   this.menuList.forEach((item: any) => {
+        //     if (item.index === 'analysis') {
+        //       item.path = '/analysis/nav'
+        //     }
+        //   })
+        // }
         this.permBtnCodes = privilege
         this.permBtnCodes = privilege
           .filter((node) => {
           .filter((node) => {
             return node.privilegeType === 'BUTTON'
             return node.privilegeType === 'BUTTON'
           })
           })
           .map((item) => item.code)
           .map((item) => item.code)
+        console.log('this.menuList:', this.menuList)
+
         this.renderMenus = this.menuList.reduce((menus, menu) => {
         this.renderMenus = this.menuList.reduce((menus, menu) => {
           return menus.concat(filterPrivilege(menu, privilege) || [])
           return menus.concat(filterPrivilege(menu, privilege) || [])
         }, [] as MainLayoutStore.MenuItem[])
         }, [] as MainLayoutStore.MenuItem[])