xsh há 3 anos atrás
pai
commit
b6b5738f98

+ 77 - 0
src/utils/chenApi.js

@@ -9,6 +9,83 @@
 import axios from './http';
 
 /** 生物安全 */
+/** 车辆档案列表 **/
+export function getCarList(data) {
+  return axios({
+    url: '/video/car/geCarList',
+    method: 'get',
+    params: data
+  })
+}
+/** 新增车辆档案 **/
+export function addCarBase(data) {
+  return axios({
+    url: '/video/car/addCarBase',
+    method: 'get',
+    params: data
+  })
+}
+/** 车辆档案删除 **/
+export function delCarBase(data) {
+  return axios({
+    url: '/video/car/deleteFromCarBase',
+    method: 'post',
+    data: data
+  })
+}
+/** 车辆档案添加白名单 **/
+export function addCarWhite(data) {
+  return axios({
+    url: 'video/car/addCarWhiteList',
+    method: 'get',
+    params: data
+  })
+}
+
+/** 车辆档案添加黑名单 **/
+export function addCarBlack(data) {
+  return axios({
+    url: 'video/car/addCarBlackList',
+    method: 'get',
+    params: data
+  })
+}
+
+/** 车辆档案白名单 **/
+export function showCarWhite(data) {
+  return axios({
+    url: 'video/car/ShowCarWhiteList',
+    method: 'get',
+    params: data
+  })
+}
+
+/** 车辆档案黑名单 **/
+export function showCarBlack(data) {
+  return axios({
+    url: 'video/car/ShowCarBlackList',
+    method: 'get',
+    params: data
+  })
+}
+
+/** 移出白名单 **/
+export function delCarWhite(data) {
+  return axios({
+    url: 'video/car/deleteFromCarWhiteList',
+    method: 'post',
+    data: data
+  })
+}
+
+/** 移出黑名单 **/
+export function delCarBlack(data) {
+  return axios({
+    url: 'video/car/deleteFromCarBlackList',
+    method: 'post',
+    data: data
+  })
+}
 /* 获取门禁所有 - 人脸门禁 +  */
 export function getFaceGuardTotal(data) {
   return axios({

+ 273 - 35
src/views/BioSafety/CarAdmin.vue

@@ -17,6 +17,7 @@
 
     <!-- 筛选条件 -->
     <query-conditions
+      v-if="btnSelected === 2 || btnSelected === 3"
       :formItems="formItems"
       :propFormData="propFormData"
       :defaultEmit="true"
@@ -30,8 +31,23 @@
       :listData="listData"
       :tableItems="tableItems"
       :shows="tableShows"
-      :height="475"
+      :height="600"
     >
+      <template #right>
+        <template v-if="btnSelected === 1">
+          <el-button size="mini" @click="add" type="primary">新增车辆</el-button>
+          <el-button size="mini" @click="btnSelected = 5" type="success">查看白名单</el-button>
+          <el-button size="mini" @click="btnSelected = 6" type="warning">查看黑名单</el-button>
+        </template>
+        <template v-if="btnSelected === 5">
+          <el-button size="mini" @click="btnSelected = 1" type="primary">查看车辆档案</el-button>
+          <el-button size="mini" @click="btnSelected = 6" type="warning">查看黑名单</el-button>
+        </template>
+        <template v-if="btnSelected === 6">
+          <el-button size="mini" @click="btnSelected = 1" type="primary">查看车辆档案</el-button>
+          <el-button size="mini" @click="btnSelected = 5" type="success">查看白名单</el-button>
+        </template>
+      </template>
       <!-- <template v-slot:right>
         <template>
         <div>共{{ total }}辆车</div>
@@ -47,6 +63,19 @@
           </div>
         </template>
       </template> -->
+      <!--  白名单操作    -->
+      <template #whiteHandle="scope">
+        <el-button size="mini" type="primary" @click="del(scope.row, 1)">移出白名单</el-button>
+      </template>
+      <template #blackHandle="scope">
+        <el-button size="mini" type="primary" @click="del(scope.row, 2)">移出黑名单</el-button>
+      </template>
+      <!--  车辆档案操作    -->
+      <template #handle="scope">
+        <el-button size="mini" type="success" @click="onJoin(scope.row, 1)">加入白名单</el-button>
+        <el-button size="mini" type="warning" @click="onJoin(scope.row, 2)">加入黑名单</el-button>
+        <el-button size="mini" type="danger" @click="onJoin(scope.row, 3)">删除</el-button>
+      </template>
       <template v-slot:carNum="slotProps">
         {{ slotProps.row.carNum ? slotProps.row.carNum : "未识别" }}
       </template>
@@ -86,6 +115,22 @@
       @pageChange="pageChange"
     >
     </table-footer>
+    <el-dialog :title="'车辆档案新增'" :visible.sync="isFile" width="50%">
+      <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px">
+        <el-form-item prop="carId" label="车辆编号" v-if="showType">
+          <el-input v-model="form.carId" disabled></el-input>
+        </el-form-item>
+        <el-form-item prop="carNum" label="车牌号">
+          <el-input v-model="form.carNum"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="reset">取 消</el-button>
+        <el-button type="primary" @click="submitForm('ruleForm')">
+          确 定
+        </el-button>
+      </span>
+    </el-dialog>
     <el-dialog title="车辆图片" :visible.sync="dialogVisible" width="50%">
       <img :src="imgUrl" alt="车辆通行" width="100%" />
       <span slot="footer" class="dialog-footer">
@@ -144,6 +189,7 @@ import {
   getCarWashVideo,
   getCarDrying,
   getCarDryingTemp,
+  getCarList, addCarWhite, addCarBlack, showCarWhite, addCarBase, showCarBlack, delCarWhite, delCarBlack, delCarBase
 } from "../../utils/chenApi";
 import { timeDate } from "../../utils/index";
 import { mapState } from "vuex";
@@ -164,9 +210,10 @@ export default {
     return {
       btnNames: [
         // 按钮情况
-        { id: 1, name: "车辆通行" },
-        { id: 2, name: "车辆洗消" },
-        { id: 3, name: "车辆烘干" },
+        { id: 1, name: '车辆档案'},
+        { id: 2, name: "车辆通行" },
+        { id: 3, name: "车辆洗消" },
+        { id: 4, name: "车辆烘干" },
       ],
       btnSelected: 1, // 选中的按钮
       formItems: [], // 传给 QueryCondition 组件的 formItems
@@ -187,42 +234,60 @@ export default {
       rtsp: "", // 车辆回放的地址
       tempVisible: false, // 车辆烘干 - 查看温度详情
       tempChartData: {},
+      isFile: false,
+      form: {
+        carId: '',
+        carNum: '',
+      },
+      rules: {
+        carId: [{ required: true, message: '请输入车辆编号', trigger: 'blur' }],
+        carNum: [{ required: true, message: '请输入车牌号', trigger: 'blur' }]
+      },
+      showType: false,
     };
   },
+  watch: {
+    btnSelected(newVal) {
+      this.pageNum = 1;
+      this.listData = [];
+      this.formItems = formItems[this.btnSelected - 1];
+      this.propFormData = propFormData[this.btnSelected - 1];
+      this.title = titles[this.btnSelected - 1];
+      this.tableItems = tableItems[this.btnSelected - 1];
+      if (newVal === 1) {
+        // 档案
+        this.getCarList()
+      } else if (newVal === 2) {
+        // 车辆通行
+        this.carPassage();
+      } else if (newVal === 3) {
+        // 车辆洗消
+        this.carWash();
+      } else if(newVal=== 4){
+        // 车辆烘干
+        this.carDrying();
+      } else if(newVal === 5) {
+        // 白名单
+        this.ShowCarWhite()
+      } else {
+        // 黑名单
+        this.ShowCarBlack()
+      }
+    }
+  },
   mounted() {
     this.formItems = formItems[this.btnSelected - 1];
     this.propFormData = propFormData[this.btnSelected - 1];
-    console.log(this.propFormData);
     this.title = titles[this.btnSelected - 1];
     this.tableItems = tableItems[this.btnSelected - 1];
     this.tableShows = tableShows;
-    if (this.btnSelected === 1) {
-      this.carPassage();
-    } else if (this.btnSelected === 2) {
-      this.carWash();
-    } else {
-      this.carDrying();
-    }
+    // 档案
+    this.getCarList()
+
   },
   methods: {
     getBtnSelected(id) {
       this.btnSelected = id;
-      this.formItems = formItems[id - 1];
-      this.propFormData = propFormData[id - 1];
-      this.title = titles[id - 1];
-      this.tableItems = tableItems[id - 1];
-      this.pageNum = 1;
-      this.listData = [];
-      this.params = {};
-      console.log("1111");
-      if (this.btnSelected === 1) {
-        this.carPassage();
-      } else if (this.btnSelected === 2) {
-        this.carWash();
-        this.carWashTotal();
-      } else {
-        this.carDrying();
-      }
     },
     // 获取查询条件
     handleQuery(params) {
@@ -231,12 +296,23 @@ export default {
 
       this.listData = [];
       if (this.btnSelected === 1) {
-        this.carPassage();
+        // 档案
+        this.getCarList()
       } else if (this.btnSelected === 2) {
+        // 车辆通行
+        this.carPassage();
+      } else if (this.btnSelected === 3) {
+        // 车辆洗消
         this.carWash();
-        this.carWashTotal();
-      } else {
+      } else if(this.btnSelected === 4){
+        // 车辆烘干
         this.carDrying();
+      } else if(this.btnSelected === 5) {
+        // 白名单
+        this.ShowCarWhite()
+      } else {
+        // 黑名单
+        this.ShowCarBlack()
       }
     },
     // 修改size
@@ -245,22 +321,46 @@ export default {
       this.pageNum = 1;
       this.listData = [];
       if (this.btnSelected === 1) {
-        this.carPassage();
+        // 档案
+        this.getCarList()
       } else if (this.btnSelected === 2) {
+        // 车辆通行
+        this.carPassage();
+      } else if (this.btnSelected === 3) {
+        // 车辆洗消
         this.carWash();
-      } else {
+      } else if(this.btnSelected === 4){
+        // 车辆烘干
         this.carDrying();
+      } else if(this.btnSelected === 5) {
+        // 白名单
+        this.ShowCarWhite();
+      } else {
+        // 黑名单
+        this.ShowCarBlack();
       }
     },
     // 修改页数
     pageChange(val) {
       this.pageNum = val;
       if (this.btnSelected === 1) {
-        this.carPassage();
+        // 档案
+        this.getCarList()
       } else if (this.btnSelected === 2) {
+        // 车辆通行
+        this.carPassage();
+      } else if (this.btnSelected === 3) {
+        // 车辆洗消
         this.carWash();
-      } else {
+      } else if(this.btnSelected === 4){
+        // 车辆烘干
         this.carDrying();
+      } else if(this.btnSelected === 5) {
+        // 白名单
+        this.ShowCarWhite();
+      } else {
+        // 黑名单
+        this.ShowCarBlack();
       }
     },
     // 车辆通行 查询
@@ -285,6 +385,144 @@ export default {
       this.dialogVisible = true;
       this.imgUrl = url;
     },
+    // 车辆档案
+    getCarList() {
+      let params = {
+        pageNum: this.pageNum,
+        pageSize: this.size
+      }
+      getCarList(params).then(res => {
+        if(res.code == 200) {
+          const result = JSON.parse(res.result);
+          this.total = parseInt(result.data.totalRows);
+          this.listData = result.data.pageData;
+        }
+      })
+    },
+    // 档案操作
+    onJoin(row, num) {
+      if(num === 1) {
+        addCarWhite({carId: row.carId}).then(res => {
+          if(res.code == 200) {
+            this.$message.success('加入白名单成功');
+            this.getCarList();
+          } else {
+            this.$message.error('加入白名单失败');
+          }
+        })
+      } else if(num === 2) {
+        addCarBlack({carId: row.carId}).then(res => {
+          if(res.code == 200) {
+            this.$message.success('加入黑名单成功');
+            this.getCarList();
+          } else {
+            this.$message.error('加入黑名单失败');
+          }
+        })
+      } else if(num === 3) {
+        // 删除
+        let params = {
+          carIdList: [row.carId]
+        }
+        delCarBase(params).then(res => {
+          if(res.code == 200) {
+            this.$message.success('删除成功');
+            this.getCarList()
+          } else {
+            this.$message.error('删除失败')
+          }
+        })
+      }
+    },
+    // 新增车辆
+    add() {
+      this.isFile = true;
+      this.showType = false;
+    },
+    // 档案编辑
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          if(this.showType) {
+            // 编辑
+
+          } else {
+            let params = {
+              carNum: this.form.carNum
+            }
+            addCarBase(params).then(res => {
+              if(res.code == 200) {
+                this.reset();
+                this.$message.success('添加成功');
+                this.getCarList();
+              } else {
+                this.$message.error('添加失败');
+              }
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 重置
+    reset() {
+      this.isFile = false;
+      this.showType = false;
+      this.form = {
+        carNum: '',
+        carId: ''
+      }
+    },
+    // 白名单列表
+    ShowCarWhite() {
+      let params = {
+        pageNum: this.pageNum,
+        pageSize: this.size
+      }
+      showCarWhite(params).then(res => {
+        if(res.code == 200) {
+          const result = JSON.parse(res.result);
+          this.total = parseInt(result.data.totalRows);
+          this.listData = result.data.pageData;
+          console.log(this.listData);
+        }
+      })
+    },
+    // 黑名单列表
+    ShowCarBlack() {
+      let params = {
+        pageNum: this.pageNum,
+        pageSize: this.size
+      }
+      showCarBlack(params).then(res => {
+        if(res.code == 200) {
+          const result = JSON.parse(res.result);
+          this.total = parseInt(result.data.totalRows);
+          this.listData = result.data.pageData;
+        }
+      })
+    },
+    // 移除黑白名单
+    del(row, num) {
+      let params = {
+        carIdList: [row.carId]
+      }
+      if(num === 1) {
+        delCarWhite(params).then(res => {
+          if(res.code == 200) {
+            this.ShowCarWhite();
+          }
+        })
+      } else {
+        delCarBlack(params).then(res => {
+          if(res.code == 200) {
+            this.ShowCarBlack();
+          }
+        })
+      }
+    },
     // 车辆洗消
     carWash() {
       if (!this.params.time) {

+ 9 - 7
src/views/BioSafety/PersonAdmin.vue

@@ -25,7 +25,7 @@
         element-loading-spinner="el-icon-loading"
         element-loading-background="rgba(0, 0, 0, 0.8)"
       >
-        <chart-electro :total="total"></chart-electro>
+        <chart-electro :total="total1"></chart-electro>
         <cost-histogram v-bind="recordData"></cost-histogram>
       </div>
     </board>
@@ -66,7 +66,7 @@
         <img
           :src="slotProps.row.recordImage"
           alt="人员门禁"
-          width="100"
+          width="50px"
           @click="clickImg(slotProps.row.recordImage)"
         />
       </template>
@@ -160,6 +160,8 @@ export default {
       tableShows: {},
       // table的翻页
       total: 0,
+      total1: 0,
+      isTotal: false,
       size: 20,
       pageNum: 1,
       selectId: "",
@@ -169,7 +171,7 @@ export default {
       dialogVisible: false, // 图片放大,也不知道得多老眼昏花,这么大的图片还要再大
       imgUrl: "", // 点击图片后放大的图片路径
       recordData: {}, // 进出统计
-      loading: false,
+      loading: true,
     };
   },
   mounted() {
@@ -226,12 +228,10 @@ export default {
         pageSize: this.size,
         searchStr: this.keyword,
       };
-      console.log(params);
       // 获取后端数据
     },
     // 人脸门禁的查询 + 近 7 小时进出统计
     faceGuard() {
-      this.loading = true;
       if (!this.params.time) {
         this.params.time = [
           timeDate(new Date().getTime()),
@@ -247,8 +247,6 @@ export default {
         openType: 61, // 进门,刷脸
       };
       getFaceGuard(queryParams).then(async (res) => {
-        console.log("res:", res);
-        console.log(JSON.parse(res.result));
         // 结果是 JSON 格式
         this.listData = JSON.parse(res.result).data.pageData;
         this.listData.forEach((item) => {
@@ -289,6 +287,10 @@ export default {
       getFaceGuardTotal(queryParams).then((res) => {
         console.log("total:", JSON.parse(res.result));
         this.total = JSON.parse(res.result).data;
+        if(this.isTotal === false) {
+          this.total1 = JSON.parse(res.result).data;
+          this.isTotal = true;
+        }
       });
     },
     // 档案管理

+ 69 - 4
src/views/BioSafety/carAdmin/table.config.js

@@ -7,10 +7,36 @@
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\table.config.js
  */
 // export const titles = ['车辆档案', '门禁记录', '设备列表']
-export const titles = ['', '', '']
+export const titles = ['车辆档案记录', '车辆通行记录', '车辆洗消记录', "车辆烘干记录", '白名单记录', '黑名单记录']
 
 const tableItems1 = [
   {
+    prop: 'carId',
+    label: '车辆编号',
+    minWidth: '120',
+    slotName: 'carId'
+  },
+  // {
+  //   prop: '',
+  //   label: '车辆图片',
+  //   minWidth: '120',
+  //   slotName: ''
+  // }
+  {
+    prop: 'carNum',
+    label: '车牌号',
+    minWidth: '120',
+    slotName: 'carNum'
+  },
+  {
+    label: '操作',
+    minWidth: '120',
+    slotName: 'handle'
+  }
+
+]
+const tableItems2 = [
+  {
     prop: 'capTimeStr',
     label: '时间',
     minWidth: '120',
@@ -54,7 +80,7 @@ const tableItems1 = [
   },
 ]
 
-const tableItems2 = [
+const tableItems3 = [
   {
     prop: 'alarmDate',
     label: '时间',
@@ -86,7 +112,7 @@ const tableItems2 = [
   }
 ]
 
-const tableItems3 = [
+const tableItems4 = [
   {
     prop: 'eventTime',
     label: '发生时间',
@@ -106,7 +132,46 @@ const tableItems3 = [
   }
 ]
 
-export const tableItems = [tableItems1, tableItems2, tableItems3]
+const tableItems5 = [
+  {
+    prop: 'carId',
+    label: '车辆编号',
+    minWidth: '120',
+    slotName: 'carId'
+  },
+  {
+    prop: 'carNum',
+    label: '车牌号',
+    minWidth: '120',
+    slotName: 'carNum'
+  },
+  {
+    label: '操作',
+    minWidth: '120',
+    slotName: 'whiteHandle'
+  }
+];
+
+const tableItems6 = [
+  {
+    prop: 'carId',
+    label: '车辆编号',
+    minWidth: '120',
+    slotName: 'carId'
+  },
+  {
+    prop: 'carNum',
+    label: '车牌号',
+    minWidth: '120',
+    slotName: 'carNum'
+  },
+  {
+    label: '操作',
+    minWidth: '120',
+    slotName: 'blackHandle'
+  }
+];
+export const tableItems = [tableItems1, tableItems2, tableItems3, tableItems4, tableItems5, tableItems6]
 
 export const tableShows = {
   showIndex: false, showSelect: false

+ 21 - 13
src/views/SystemAdmin/AuthAdmin.vue

@@ -189,6 +189,8 @@ export default {
       commitKeys: [],
       selectedKeys: [],
       menuTreeData: [],
+      // 判断是否点击权限的复选框
+      isKey: false,
     }
   },
   methods: {
@@ -294,6 +296,7 @@ export default {
     },
 
     onCheck(checkedKeys, info) {
+      this.isKey = true;
       this.checkedKeys = checkedKeys;
       this.commitKeys = checkedKeys.concat(info.halfCheckedKeys)
     },
@@ -332,21 +335,26 @@ export default {
     // 权限分配保存
     limitSave() {
       // this.selectList = this.$refs.tree.getCheckedKeys();
-      let menuIds;
-      if(this.commitKeys.length > 0) {
-        menuIds = this.commitKeys.join(',');
+      if(this.isKey) {
+        let menuIds;
+        if(this.commitKeys.length > 0) {
+          menuIds = this.commitKeys.join(',');
+        } else {
+          menuIds = '';
+        }
+        saveGroupMenu( {groupId: this.selectId, menuIds: menuIds})
+            .then(res => {
+              if(res.code === 10001) {
+                this.$message.success(res.message);
+              }
+              this.selectId = '';
+              this.dialogLimits = false;
+              this.selectList = [];
+            });
       } else {
-        menuIds = '';
+        this.dialogLimits = false;
       }
-      saveGroupMenu( {groupId: this.selectId, menuIds: menuIds})
-          .then(res => {
-            if(res.code === 10001) {
-              this.$message.success(res.message);
-            }
-            this.selectId = '';
-            this.dialogLimits = false;
-            this.selectList = [];
-          });
+
     },
     init() {
       // 后端分页