tangning 2 年之前
父節點
當前提交
312f80f9eb
共有 2 個文件被更改,包括 11 次插入5 次删除
  1. 5 5
      src/store/modules/permission.ts
  2. 6 0
      src/views/account/overview/AddModal.vue

+ 5 - 5
src/store/modules/permission.ts

@@ -27,7 +27,7 @@ import { intersection } from 'lodash-es';
 
 interface PermissionState {
   // Permission code list
-  permCodeList: string[] ;
+  permCodeList: string[];
   // Whether the route has been dynamically added
   isDynamicAddedRoute: boolean;
   // To trigger a menu update
@@ -70,7 +70,7 @@ export const usePermissionStore = defineStore({
     setPermCodeList(codeList: string[]) {
       this.permCodeList = codeList;
     },
-    getCheckPerm(value:string|string[]): boolean{
+    getCheckPerm(value: string | string[]): boolean {
       const permCodeList = this.permCodeList;
       if (!value) {
         return false;
@@ -78,7 +78,7 @@ export const usePermissionStore = defineStore({
       if (!isArray(value)) {
         return permCodeList?.includes(value);
       }
-      return (intersection(value, permCodeList)).length > 0;
+      return intersection(value, permCodeList).length > 0;
     },
     setBackMenuList(list: Menu[]) {
       this.backMenuList = list;
@@ -104,7 +104,7 @@ export const usePermissionStore = defineStore({
     },
     async changePermissionCode() {
       const codeList = await getPermCode();
-      const permsList = codeList.map(ele => ele.perms)
+      const permsList = codeList.map((ele) => ele.perms);
       this.setPermCodeList(permsList);
     },
     async buildRoutesAction(): Promise<AppRouteRecordRaw[]> {
@@ -195,7 +195,7 @@ export const usePermissionStore = defineStore({
           let routeList: AppRouteRecordRaw[] = [];
           try {
             routeList = (await getMenuList()) as AppRouteRecordRaw[];
-            this.changePermissionCode();
+            await this.changePermissionCode();
           } catch (error) {
             console.error(error);
           }

+ 6 - 0
src/views/account/overview/AddModal.vue

@@ -203,6 +203,12 @@
             },
           },
           {
+            field: 'incrementTypeId',
+            componentProps: {
+              disabled: data.id ? true : false,
+            },
+          },
+          {
             field: 'projectNum',
             ifShow: data.useType == '4',
           },