Sfoglia il codice sorgente

1、人脸权限下发

slowslo 4 anni fa
parent
commit
0c09fca098

+ 8 - 0
src/api/estate/useraccesspermissions.js

@@ -65,3 +65,11 @@ export const pushFace = (row) => {
     data: row
   })
 }
+
+export const deleteFace = (row) => {
+  return request({
+    url: '/api/cyzh-estate/useraccesspermissions/deleteFace',
+    method: 'post',
+    data: row
+  })
+}

+ 5 - 2
src/components/device-door/device-door.vue

@@ -160,6 +160,7 @@
         let params={
           deviceIds:deviceIds.join(','),
           userId:this.userData.id,
+          userName: this.userData.name,
           userType:this.userData.userType,
           targetType:this.userData.targetType,
           userFace:this.userData.userFace
@@ -173,6 +174,8 @@
           this.$message.error('下发失败,人脸照片加载错误')
           return
         }
+        this.fetchResidentialList({"agencyId": data.agencyId});
+
         this.userData=data
         this.deviceShow=true
       },
@@ -180,8 +183,8 @@
         this.deviceShow=false
       },
       //获取区域
-      async fetchResidentialList() {
-        let res = await getResidentialList(this.current, 5)
+      async fetchResidentialList(params) {
+        let res = await getResidentialList(this.current, 5, params)
         let records = res.data.data.records
         this.residentialList = records
       },

+ 2 - 2
src/views/smartaccess/comps/face-card.vue

@@ -404,8 +404,8 @@
         this.$refs.deviceDoor.showDialog(item)
       },
       //禁用人脸
-      deleteUserFaceFromDevice(id) {
-        this.$refs.formRef.deleteUserFaceFromDevice(id)
+      deleteUserFaceFromDevice(id, deviceIds) {
+        this.$refs.formRef.deleteUserFaceFromDevice(id, deviceIds)
       },
       actived(e) {
         this.resetPageParams()

+ 26 - 9
src/views/smartaccess/form/staff.vue

@@ -31,8 +31,11 @@
     remove,
     update,
     pushUserFace,
-    deleteUserFace
   } from "@/api/enterprise/staff";
+  import {
+    pushFace,
+    deleteFace,
+  } from "@/api/estate/useraccesspermissions";
   export default {
     data() {
       return {
@@ -68,10 +71,12 @@
             },
             action: "/api/blade-resource/oss/endpoint/put-file",
           }],
-          group: [{
+          group: [
+            {
             label: '基本信息',
             prop: 'group1',
-            column: [{
+            column: [
+              {
                 label: '姓名',
                 prop: 'realName',
                 gutter:10,
@@ -141,7 +146,7 @@
                 overHidden: true,
                 remote: true,
                 cascaderItem: ['enterpriseId'],
-                dicUrl: '/api/cyzh-community/agency/list?size=100',
+                dicUrl: '/api/cyzh-community/agency/list?size=100&name={{key}}',
                 dicFormatter: (res) => {
                   return res.data.records;
                 },
@@ -212,8 +217,15 @@
     },
     methods: {
       //下发人脸
-      pushUserFaceToDevice(id) {
-        pushUserFace(id).then(res => {
+      pushUserFaceToDevice(id, userName, deviceIdList) {
+        let params ={
+          userId: id,
+          userName: userName,
+          userType: "QYYG_",
+          targetType: 1,
+          deviceIds: deviceIdList.join(","),
+        }
+        pushFace(params).then(res => {
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -221,14 +233,19 @@
         })
       },
       //禁用人脸
-      deleteUserFaceFromDevice(id) {
+      deleteUserFaceFromDevice(id, deviceIdList) {
         this.$confirm("确定禁用人脸吗?", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           })
           .then(() => {
-            return deleteUserFace(id);
+            let params={
+              deviceIds:deviceIdList.join(','),
+              userId:id,
+              userType:"QYYG_"
+            };
+            return deleteFace(params);
           })
           .then(() => {
             this.$message({
@@ -258,7 +275,7 @@
         update(data).then(() => {
           done();
           this.dialogShow = false;
-          this.$refs.avueForm.resetForm()
+          this.$refs.avueForm.resetForm();
           this.$message({
             type: "success",
             message: "操作成功!"