tangning 1 năm trước cách đây
mục cha
commit
3abb78aadc
2 tập tin đã thay đổi với 26 bổ sung12 xóa
  1. 12 0
      src/api/operate/index.ts
  2. 14 12
      src/views/productOperation/modal/PowersModal.vue

+ 12 - 0
src/api/operate/index.ts

@@ -72,6 +72,7 @@ enum Api {
   caseRelease = '/service/manage/case/isShow',
   caseWithdraw = '/service/manage/case/release',
   getAuthList = '/service/manage/jy/sceneUserAuth/getAuthList',
+  getAuthType = '/service/manage/jy/sceneUserAuth/getAuthType',
   getByRyId = '/service/manage/jy/user/getByRyId',
   addAuth = '/service/manage/jy/sceneUserAuth/addAuth',
   setAuthType = '/service/manage/jy/sceneUserAuth/setAuthType',
@@ -499,6 +500,17 @@ export const getAuthList = (params) =>
     },
   });
 
+// 根据场景码获取授权用户列表
+export const getAuthType = (params) =>
+  defHttp.post<Result>({
+    url: Api.getAuthType,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
 // 根据警员ID获取用户列表
 export const getByRyId = (params) =>
   defHttp.post<Result>({

+ 14 - 12
src/views/productOperation/modal/PowersModal.vue

@@ -52,7 +52,7 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import detailModal from './detailModal.vue';
   import { usePermissionStore } from '/@/store/modules/permission';
-  import { getAuthList, setAuthType, delAuth } from '/@/api/operate';
+  import { getAuthList, getAuthType, setAuthType, delAuth } from '/@/api/operate';
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
   import { useUserStore } from '/@/store/modules/user';
   import dayjs from 'dayjs';
@@ -129,14 +129,14 @@
         searchInfo: {
           num: numRef,
         },
-        afterFetch: (T) => {
-          let { authType } = getRawDataSource();
-          setFieldsValue({
-            authType,
-          });
-          fileFlow.showList = authType ? false : true;
-          return T;
-        },
+        // afterFetch: (T) => {
+        //   let { authType } = getRawDataSource();
+        //   setFieldsValue({
+        //     authType,
+        //   });
+        //   fileFlow.showList = authType ? false : true;
+        //   return T;
+        // },
         showTableSetting: true,
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
@@ -145,7 +145,7 @@
         fetchSetting: {
           pageField: 'pageNum',
           sizeField: 'pageSize',
-          listField: 'pageInfo.list',
+          listField: 'list',
           totalField: 'total',
         },
       });
@@ -184,14 +184,16 @@
         data && onDataReceive(data);
       });
 
-      function onDataReceive(data) {
+      async function onDataReceive(data) {
         modelRef.value = data;
         numRef.value = data.num;
-        console.log('num', numRef.value);
         reload();
         resetFields();
+        const { authType } = await getAuthType({num:numRef.value});;
+        fileFlow.showList = authType ? false : true;
         setFieldsValue({
           type: data.sceneName,
+          authType,
         });
         updateSchema({
           field: 'authType',