Ver Fonte

bug fix

zhangjie há 2 anos atrás
pai
commit
1ef3278840

+ 1 - 1
src/features/allAnalysis/AllAnalysis2.vue

@@ -160,7 +160,7 @@ const columns = [
   },
   {
     title: "样本数",
-    dataIndex: "paperName",
+    dataIndex: "totalCount",
     sorter: true,
   },
   {

+ 1 - 1
src/features/allAnalysis/ScoreRate.vue

@@ -179,7 +179,7 @@ async function fetchData() {
     v.scoreRangeTotal = acc;
     return v;
   });
-  console.log(res.data);
+  // console.log(res.data);
   courses = res.data;
 }
 

+ 1 - 1
src/features/projectManagement/ProjectManagement.vue

@@ -89,7 +89,7 @@
             >
               重新计算
             </a-button>
-            <a-popover placement="bottom">
+            <a-popover placement="bottom" trigger="click">
               <template #content>
                 <div class="tw-flex tw-flex-col">
                   <a-button

+ 11 - 2
src/features/userManagement/UserManagement.vue

@@ -203,7 +203,7 @@ import { watch, onMounted, ref, reactive, toRaw, h } from "vue";
 const store = useMainStore();
 store.currentLocation = "基础管理 / 用户管理";
 
-let rootOrgId = $ref(undefined as unknown as number);
+let rootOrgId = $ref<null | number>(null);
 let role = $ref(undefined as unknown as string);
 let loginName = $ref("");
 let name = $ref("");
@@ -226,6 +226,7 @@ async function clickSearch() {
 watch(() => [pageNo, pageSize], fetchData);
 
 async function fetchData() {
+  if (!rootOrgId) return;
   const res = await getUserList({
     loginName,
     name,
@@ -301,7 +302,7 @@ const columns = [
 ];
 
 onMounted(async () => {
-  rootOrgId = store.userInfo.rootOrgId;
+  rootOrgId = store.isSuperAdmin ? null : store.userInfo.rootOrgId;
   await search();
 });
 
@@ -375,6 +376,10 @@ function handleResetUsers(ids: number[]) {
 /** <handleImport> */
 let importModalVisible = $ref<boolean>(false);
 async function handleImport() {
+  if (!rootOrgId) {
+    void message.error("请先选择结构");
+    return;
+  }
   const files = (document.querySelector("#file-input") as HTMLInputElement)
     .files;
   const fileToImport = files && files[0];
@@ -403,6 +408,10 @@ async function handleImport() {
 /** </handleImport> */
 
 async function handleExport() {
+  if (!rootOrgId) {
+    void message.error("请先选择结构");
+    return;
+  }
   await exportUsers({ rootOrgId, name, loginName, role, enable });
   void message.success({ content: "导出成功" });
 }

+ 37 - 30
src/router/index.ts

@@ -1,10 +1,30 @@
 import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
 import Login from "@/features/login/Login.vue";
 import Layout from "@/components/Layout.vue";
+import PageError404 from "@/components/PageError404.vue";
 import { getToken } from "@/auth/auth";
 import { isNil } from "lodash-es";
 import { useMainStore } from "@/store";
 
+// components
+import RoutOrg from '@/features/rootOrg/RootOrg.vue';
+import AuthManagement from "@/features/authManagement/AuthManagement.vue";
+import RootOrgEdit from "@/features/rootOrg/RootOrgEdit.vue";
+import SubOrg from "@/features/subOrg/SubOrg.vue";
+import RoleManagement from "@/features/roleManagement/RoleManagement.vue";
+import UserManagement from "@/features/userManagement/UserManagement.vue";
+import UserPrivilege from "@/features/userManagement/UserPrivilege.vue";
+import CourseManagement from "@/features/courseManagement/CourseManagement.vue";
+// project
+import ProjectManagement from "@/features/projectManagement/ProjectManagement.vue";
+import ProjectDataManagement from "@/features/projectDataManagement/ProjectDataManagement.vue";
+import ProjectParamsManagement from "@/features/projectParamsManagement/ProjectParamsManagement.vue";
+import ProjectPapersManagement from "@/features/projectPapersManagement/ProjectPapersManagement.vue";
+import PaperAnalysis from "@/features/paperAnalysis/PaperAnalysis.vue";
+import AllAnalysis2 from "@/features/allAnalysis/AllAnalysis2.vue";
+import ProjectCompareManagement from "@/features/projectCompareManagement/ProjectCompareManagement.vue";
+import ProjectCompareDetail2 from "@/features/projectCompareDetail/ProjectCompareDetail2.vue";
+
 const routes = [
   { path: "/", redirect: "/login" },
   { path: "/login", component: Login, name: "Login" },
@@ -13,36 +33,35 @@ const routes = [
     children: [
       {
         path: "rootOrg",
-        component: () => import("@/features/rootOrg/RootOrg.vue"),
+        component: RoutOrg,
       },
       {
         path: "auth",
-        component: () => import("@/features/authManagement/AuthManagement.vue"),
+        component: AuthManagement,
       },
       {
         path: "rootOrg/edit/:orgId",
-        component: () => import("@/features/rootOrg/RootOrgEdit.vue"),
+        component: RootOrgEdit,
       },
       {
         path: "subOrg",
-        component: () => import("@/features/subOrg/SubOrg.vue"),
+        component: SubOrg,
       },
       {
         path: "role",
-        component: () => import("@/features/roleManagement/RoleManagement.vue"),
+        component: RoleManagement,
       },
       {
         path: "user",
-        component: () => import("@/features/userManagement/UserManagement.vue"),
+        component: UserManagement,
       },
       {
         path: "user/privilege/:userId",
-        component: () => import("@/features/userManagement/UserPrivilege.vue"),
+        component: UserPrivilege,
       },
       {
         path: "course",
-        component: () =>
-          import("@/features/courseManagement/CourseManagement.vue"),
+        component: CourseManagement,
       },
     ],
     component: Layout,
@@ -52,47 +71,35 @@ const routes = [
     children: [
       {
         path: "projectManagement",
-        component: () =>
-          import("@/features/projectManagement/ProjectManagement.vue"),
+        component: ProjectManagement,
       },
       {
         path: "datasource/:projectId",
-        component: () =>
-          import("@/features/projectDataManagement/ProjectDataManagement.vue"),
+        component: ProjectDataManagement,
       },
       {
         path: "params/:projectId",
-        component: () =>
-          import(
-            "@/features/projectParamsManagement/ProjectParamsManagement.vue"
-          ),
+        component: ProjectParamsManagement,
       },
       {
         path: "papers/:projectId",
-        component: () =>
-          import(
-            "@/features/projectPapersManagement/ProjectPapersManagement.vue"
-          ),
+        component: ProjectPapersManagement,
       },
       {
         path: ":projectId/paperAnalysis/:paperId",
-        component: () => import("@/features/paperAnalysis/PaperAnalysis.vue"),
+        component: PaperAnalysis,
       },
       {
         path: "allAnalysis/:projectId",
-        component: () => import("@/features/allAnalysis/AllAnalysis2.vue"),
+        component: AllAnalysis2,
       },
       {
         path: "projectCompareManagement",
-        component: () =>
-          import(
-            "@/features/projectCompareManagement/ProjectCompareManagement.vue"
-          ),
+        component: ProjectCompareManagement,
       },
       {
         path: "projectCompareDetail",
-        component: () =>
-          import("@/features/projectCompareDetail/ProjectCompareDetail2.vue"),
+        component: ProjectCompareDetail2,
       },
     ],
     component: Layout,
@@ -100,7 +107,7 @@ const routes = [
   {
     path: "/:pathMatch(.*)*",
     name: "NotFound",
-    component: () => import("@/components/PageError404.vue"),
+    component: PageError404,
   },
 ] as RouteRecordRaw[];