tangning 2 years ago
parent
commit
ab6acb7d23

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

@@ -60,6 +60,7 @@ enum Api {
   getByRyId = '/service/manage/jy/user/getByRyId',
   addAuth = '/service/manage/jy/sceneUserAuth/addAuth',
   delAuth = '/service/manage/jy/sceneUserAuth/delAuth',
+  checkAuthOther = '/service/manage/jy/sceneUserAuth/checkAuthOther',
 }
 
 /**
@@ -502,6 +503,17 @@ export const addAuth = (params) =>
   });
 
 // 根据警员ID获取用户列表
+export const checkAuthOtherApi = (params) =>
+  defHttp.post<Result>({
+    url: Api.checkAuthOther,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+// 根据警员ID获取用户列表
 export const delAuth = (params) =>
   defHttp.post<Result>({
     url: Api.delAuth,

+ 1 - 1
src/views/productOperation/cameraScene.vue

@@ -31,7 +31,7 @@
                 onClick: handlegotoEdit.bind(null, record),
               },{
                 label: '权限',
-                disabled:!(record.status == 1 || record.status == -2),
+                disabled: !record.isAuth,
                 ifShow:getTypeCheckPerm('scenes-powers') && tableType != 3,
                 onClick: handlePowers.bind(null, record),
               },{

+ 2 - 3
src/views/productOperation/modal/PowersModal.vue

@@ -83,7 +83,7 @@
           title: '浏览权限',
           dataIndex: 'lookAuth',
           customRender: ({ record }) => {
-            return record.lookAuth == 1 ? '不限时间' : `${record.lookEndTime} 截止`;
+            return record.lookAuth == 1 ? '不限时间' : record.lookAuth == 0 ? '无权' : `${record.lookEndTime} 截止`;
           },
           width: 180,
         },
@@ -91,7 +91,7 @@
           title: '编辑权限',
           dataIndex: 'editAuth',
           customRender: ({ record }) => {
-            return record.editAuth == 1 ? '不限时间' : `${record.editEndTime} 截止`;
+            return record.editAuth == 1 ? '不限时间' : record.editAuth == 0 ? '无权' : `${record.editEndTime} 截止`;
           },
           width: 180,
         },
@@ -123,7 +123,6 @@
             authType,
           });
           fileFlow.showList = authType ? false : true;
-          console.log('modelRef.value.num', getRawDataSource(), T);
           return T;
         },
         showTableSetting: true,

+ 5 - 2
src/views/productOperation/modal/detailModal.vue

@@ -25,7 +25,7 @@
   import { companyAdd, companyUpdate } from '/@/api/customer';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
-  import { getByRyId, addAuth } from '/@/api/operate';
+  import { getByRyId, addAuth, checkAuthOtherApi } from '/@/api/operate';
   import { useModalInner } from '/@/components/Modal';
   import dayjs from 'dayjs';
 
@@ -220,11 +220,13 @@
 
       onMounted(() => {});
       let addListFunc = () => {};
-      const [register, { closeModal }] = useModalInner((data) => {
+      const [register, { closeModal }] = useModalInner(async (data) => {
         onSearch('');
+        let checkAuthOther = await checkAuthOtherApi({ num: data.num });
         if (data) {
           title.value = data.id ? '编辑授权' : '新增授权';
           modelRef.value = data.id ? true : false;
+          console.log('checkAuthOther', checkAuthOther);
           setFieldsValue({
             ...data,
             isEmpower:[data.canAuthLook?0:'',data.canEditLook?1:'']
@@ -234,6 +236,7 @@
         }
         updateSchema([
           { field: 'isEmpower', ifShow: data.isAuthor == 1 },
+          { field: 'isAuthor', componentProps: { disabled: !checkAuthOther} },
           { field: 'editEndTime', ifShow: data.editAuth == 2 },
           { field: 'lookEndTime', ifShow: data.lookAuth == 2 },
         ]);