Przeglądaj źródła

1、人脸下发日志

slowslo 4 lat temu
rodzic
commit
7570aba463

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

@@ -195,7 +195,7 @@
   //抓拍记录
   import snapForm from "../form/snap.vue"
   //日志记录
-  import logForm from "../form/log.vue"
+  import logForm from "../form/authlog.vue"
   //
   import {
     getList2 as getSnapList,

+ 156 - 0
src/views/smartaccess/form/authlog.vue

@@ -0,0 +1,156 @@
+<template>
+  <div>
+    <el-dialog title="下发日志" :visible.sync="deviceShow" :destroy-on-close="true" center :append-to-body="true" :modal-append-to-body="true" width="55%">
+      <div style="display:flex;margin:6px;flex-wrap: wrap;overflow: hidden;">
+        <el-tag size="mini" type="info" style="margin:4px" class="animate__animated animate__fadeInDown animate__faster" @close="close(item)" closable v-for="(item,index) in selectionList" :key="index">{{item.name}}</el-tag>
+      </div>
+      <avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
+        :before-open="beforeOpen" v-model="form" ref="crud"
+        @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+        @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange">
+        <template slot="authStatus" scope="{row}">
+          <el-tag v-if="row.authStatus===1">待处理</el-tag>
+          <el-tag v-if="row.authStatus===2" type="danger">失败</el-tag>
+          <el-tag v-if="row.authStatus===3" type="success">成功</el-tag>
+        </template>
+
+      </avue-crud>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {getList,} from "@/api/estate/authorizerecords";
+  export default {
+    data() {
+      return {
+        deviceShow:false,
+        form: {},
+        query: {},
+        userData:{},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height: 'auto',
+          calcHeight: 60,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: false,
+          delBtn: false,
+          editBtn: false,
+          selection: true,
+          menu: false,
+          addBtn: false,
+          align: 'center',
+          dialogClickModal: false,
+          column: [
+            {
+              label: "设备名称",
+              prop: "deviceName",
+              search: true,
+              overHidden: true,
+              searchSpan:6,
+            },
+            {
+              label: "设备序列号",
+              prop: "deviceSerialNum",
+              search: true,
+              searchLabelWidth:110,
+              searchSpan:12,
+              width: 160,
+            },
+            {
+              label: "设备位置",
+              prop: "deviceAddress",
+            },
+            {
+              label: "指令名称",
+              prop: "authCmd",
+              editDisplay: false,
+              addDisplay: false,
+              width:120,
+            },
+            {
+              label: "下发状态",
+              prop: "authStatus",
+              editDisplay: false,
+              addDisplay: false,
+              width: 90,
+              slot: true,
+              dicData:[
+                {
+                  label: "待处理",
+                  value: 1
+                },
+                {
+                  label: "成功",
+                  value: 2
+                },
+                {
+                  label: "失败",
+                  value: 3
+                }
+              ],
+            },
+            {
+              label: "下发结果",
+              prop: "authRespMsg",
+              editDisplay: false,
+              addDisplay: false
+            },
+          ]
+        },
+        data: []
+      };
+    },
+    methods: {
+      showDialog(data){
+        console.log("进入页面",data)
+        let page = {
+          pageSize: this.size,
+          currentPage: this.current,
+        };
+        this.userData=data;
+        this.fetchList(page, {});
+        this.deviceShow=true;
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      fetchList(page, params) {
+        this.loading = true;
+        params.userId = this.userData.id;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+        })
+      },
+      onLoad(page, params = {}) {
+        this.fetchList(page, params)
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 0 - 234
src/views/smartaccess/form/log.vue

@@ -1,234 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="日志" :visible.sync="deviceShow" :destroy-on-close="true" center :append-to-body="true" :modal-append-to-body="true" width="55%">
-      <div style="display:flex;margin:6px;flex-wrap: wrap;overflow: hidden;">
-        <el-tag size="mini" type="info" style="margin:4px" class="animate__animated animate__fadeInDown animate__faster" @close="close(item)" closable v-for="(item,index) in selectionList" :key="index">{{item.name}}</el-tag>
-      </div>
-      <avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
-        :before-open="beforeOpen" v-model="form" ref="crud"
-        @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
-        @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange">
-<!--        <template slot="menuLeft">-->
-<!--          <el-button @click="deleteFace" size="mini" type="danger" v-if="$isNotEmpty(selectionList)">确认下发</el-button>-->
-<!--&lt;!&ndash;          <div style="display:flex;margin:6px;flex-wrap: wrap;overflow: hidden;">&ndash;&gt;-->
-<!--          <el-tag size="mini" type="info" style="margin:4px" class="animate__animated animate__fadeInDown animate__faster" @close="close(item)" closable v-for="(item,index) in selectionList" :key="index">{{item.deviceName}}</el-tag>-->
-<!--&lt;!&ndash;          </div>&ndash;&gt;-->
-<!--        </template>-->
-<!--        <template slot="deviceStatus" slot-scope="{row}">-->
-<!--          <el-tag v-if="row.deviceStatus === 0" type="danger">离线</el-tag>-->
-<!--          <el-tag v-if="row.deviceStatus === 1" type="success">在线</el-tag>-->
-<!--        </template>-->
-      </avue-crud>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import {
-    getList,
-  } from "@/api/estate/authorizerecords";
-  // import {
-  //   mapGetters
-  // } from "vuex";
-  // import {deepClone} from "@/util/util.js";
-  export default {
-    data() {
-      return {
-        deviceShow:false,
-        form: {},
-        query: {},
-        userData:{},
-        loading: true,
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
-        },
-        selectionList: [],
-        option: {
-          height: 'auto',
-          calcHeight: 60,
-          tip: false,
-          searchShow: true,
-          searchMenuSpan: 6,
-          border: true,
-          index: true,
-          viewBtn: false,
-          delBtn: false,
-          editBtn: false,
-          selection: true,
-          reserveSelection: true,
-          menu: false,
-          addBtn: false,
-          align: 'center',
-          dialogClickModal: false,
-          column: [
-            {
-              label: "设备名称",
-              prop: "deviceName",
-              search: true,
-              overHidden: true,
-            },
-            {
-              label: "设备序列号",
-              prop: "deviceSerialNum",
-              search: true,
-              hide: true,
-              width: 200,
-            },
-            {
-              label: "授权指令名称",
-              prop: "authCmd",
-              width: 160,
-              editDisplay: false,
-              addDisplay: false,
-            },
-            {
-              label: "授权状态",
-              prop: "authStatus",
-              width: 100,
-              editDisplay: false,
-              addDisplay: false,
-              dicData:[
-                {
-                  label: "待处理",
-                  value: 1
-                },
-                {
-                  label: "成功",
-                  value: 2
-                },
-                {
-                  label: "失败",
-                  value: 3
-                }
-              ],
-            },
-            {
-              label: "授权响应信息",
-              prop: "authRespMsg",
-              width: 100,
-              editDisplay: false,
-              addDisplay: false
-            },
-          ]
-        },
-        data: []
-      };
-    },
-    // computed: {
-    //   ...mapGetters(["permission"]),
-    //   permissionList() {
-    //     return {
-    //       addBtn: this.vaildData(this.permission.doordevice_add, false),
-    //       viewBtn: this.vaildData(this.permission.doordevice_view, false),
-    //       delBtn: this.vaildData(this.permission.doordevice_delete, false),
-    //       editBtn: this.vaildData(this.permission.doordevice_edit, false)
-    //     };
-    //   },
-    //   ids() {
-    //     let ids = [];
-    //     this.selectionList.forEach(ele => {
-    //       ids.push(ele.id);
-    //     });
-    //     return ids.join(",");
-    //   }
-    // },
-
-    // watch: {
-    //
-    // },
-    methods: {
-      // deleteFace(){
-      //   let deviceIdList=this.selectionList.map(item=>item.id);
-      //   let params ={
-      //     deviceIds: deviceIdList.join(","),
-      //     userId: this.userData.id,
-      //     userType: this.userData.userType
-      //   };
-      //   deleteFace(params).then(res =>{
-      //     this.deviceShow = false;
-      //     this.$message({
-      //       type: "success",
-      //       message: "操作成功!"
-      //     });
-      //   });
-      // },
-      showDialog(data){
-        console.log("进入页面",data)
-        // if (data.imgError===true) {
-        //   this.$message.error('下发失败,人脸照片加载错误')
-        //   return
-        // }
-        let page = {
-          pageSize: this.size,
-          currentPage: this.current,
-        };
-        this.userData=data;
-        this.fetchList(page, {});
-        this.deviceShow=true;
-      },
-      // beforeOpen(done, type) {
-      //   if (["edit", "view"].includes(type)) {
-      //     getDetail(this.form.id).then(res => {
-      //       this.form = res.data.data;
-      //     });
-      //   }
-      //   done();
-      // },
-      searchReset() {
-        this.query = {};
-        this.onLoad(this.page);
-      },
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, params);
-        done();
-      },
-      // selectionChange(list) {
-      //   this.selectionList = list;
-      // },
-      // selectionClear() {
-      //   this.selectionList = [];
-      //   this.$refs.crud.toggleSelection();
-      // },
-      // close(data){
-      //   let arr=[]
-      //   this.selectionList.forEach((item,index)=>{
-      //     if (data.id==item.id) {
-      //       arr.push(item)
-      //       this.selectionList.splice(index,1)
-      //     }
-      //   })
-      //   console.log(this.selectionList);
-      //   this.$refs.crud.toggleSelection(arr);
-      // },
-      // currentChange(currentPage) {
-      //   this.page.currentPage = currentPage;
-      // },
-      // sizeChange(pageSize) {
-      //   this.page.pageSize = pageSize;
-      // },
-      refreshChange() {
-        this.onLoad(this.page, this.query);
-      },
-      fetchList(page, params) {
-        this.loading = true;
-        params.userId = this.userData.id;
-        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-          const data = res.data.data;
-          this.page.total = data.total;
-          this.data = data.records;
-          this.loading = false;
-        })
-      },
-      onLoad(page, params = {}) {
-        this.fetchList(page, params)
-      }
-    }
-  };
-</script>
-
-<style>
-</style>