East 3 lat temu
rodzic
commit
66b3c006a0

+ 86 - 0
src/utils/chenApi.js

@@ -9,6 +9,92 @@
 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: 'post',
+    data: data
+  })
+}
+
+/** 车辆档案添加黑名单 **/
+export function addCarBlack(data) {
+  return axios({
+    url: 'video/car/addCarBlackList',
+    method: 'post',
+    data: data
+  })
+}
+
+/** 添加 白黑 名单 **/
+export function addWandB(data) {
+  return axios({
+    url: '/video/car/ShowUnSendCar',
+    method: 'post',
+    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({

+ 395 - 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,25 @@
       :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" type="success" @click="addWhite(1)">添加白名单</el-button>
+          <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" type="success" @click="addWhite(2)">添加黑名单</el-button>
+          <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,9 +65,25 @@
           </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>
+      <template #carHandle="scope">
+        <el-button v-if="scope.row.carNum" size="mini" @click="addBase(scope.row.carNum)">添加到车辆档案</el-button>
+      </template>
       <template v-slot:originalPicPath="slotProps">
         <img
           :src="slotProps.row.originalPicPath"
@@ -86,6 +120,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">
@@ -124,6 +174,18 @@
         </el-button>
       </span>
     </el-dialog>
+    <el-dialog :title="showType ? '添加黑名单' : '添加白名单' " :visible.sync="isWhite" width="50%">
+      <new-table :title="''"
+        :listData="abList"
+                 :tableItems="abItems"
+                 :shows="abShows" @selectionChange="selectionChange"></new-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="isWhite = false">取 消</el-button>
+        <el-button type="primary" @click="clickCar">
+          确 定
+        </el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -144,6 +206,7 @@ import {
   getCarWashVideo,
   getCarDrying,
   getCarDryingTemp,
+  getCarList, addCarWhite, addCarBlack, showCarWhite, addCarBase, showCarBlack, delCarWhite, delCarBlack, delCarBase, addWandB
 } from "../../utils/chenApi";
 import { timeDate } from "../../utils/index";
 import { mapState } from "vuex";
@@ -164,9 +227,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 +251,82 @@ 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,
+      isWhite: false,
+      // 白黑名单
+      abList: [],
+      abItems: [
+        {
+          prop: 'carId',
+          label: '车辆编号',
+          minWidth: '120',
+          slotName: 'carId'
+        },
+        {
+          prop: 'carNum',
+          label: '车牌号',
+          minWidth: '120',
+          slotName: 'carNum'
+        },
+      ],
+      abShows: {
+        showIndex: false,
+        showSelect: true
+      },
+      selectList: [],
     };
   },
+  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 +335,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 +360,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 +424,227 @@ 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(res.errMsg);
+          }
+        })
+      } else if(num === 2) {
+        addCarBlack({carId: row.carId}).then(res => {
+          if(res.code == 200) {
+            this.$message.success('加入黑名单成功');
+            this.getCarList();
+          } else {
+            this.$message.error(res.errMsg);
+          }
+        })
+      } 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(res.errMsg);
+          }
+        })
+      }
+    },
+    // 新增车辆
+    add() {
+      this.isFile = true;
+      this.showType = false;
+    },
+
+    // 添加白名单
+    addWhite(num) {
+      this.isWhite = true;
+      let params = {
+        pageNum: 1,
+        pageSize: 200
+      }
+      if(num === 1) {
+        params.draw = 4;
+        this.showType = false;
+      } else {
+        this.showType = true;
+        params.draw = 5;
+      }
+      addWandB(params).then(res => {
+        if(res.code == 200) {
+          const result = JSON.parse(res.result);
+          this.abList = result.data.pageData;
+        } else {
+          this.$message.error(res.errMsg);
+        }
+      })
+    },
+    clickCar() {
+      if(this.selectList.length > 0) {
+        let params = {};
+        let arr = [];
+        this.selectList.forEach(item => {
+          arr.push(item.carId)
+        })
+        params.carIdList = arr;
+        if(this.showType) {
+          // 黑名单
+          addCarBlack(params).then(res => {
+            if(res.code == 200) {
+              this.$message.success('添加成功!');
+              this.ShowCarBlack();
+            } else {
+              this.$message.error(res.errMsg)
+            }
+            this.isWhite = false;
+          })
+        } else {
+          addCarWhite(params).then(res => {
+            if(res.code == 200) {
+              this.$message.success('添加成功!');
+              this.ShowCarWhite();
+            } else {
+              this.$message.error(res.errMsg)
+            }
+            this.isWhite = false;
+          })
+        }
+      } else {
+        this.$message.error('请选择要添加的车辆!');
+      }
+    },
+    // 选择
+    selectionChange(item) {
+      this.selectList = item;
+    },
+    // 档案编辑
+    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(res.errMsg);
+              }
+            })
+          }
+        } 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;
+        }
+      })
+    },
+    // 黑名单列表
+    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;
+        } else {
+          this.$message.error(res.errMsg);
+        }
+      })
+    },
+    // 移除黑白名单
+    del(row, num) {
+      let params = {
+        carIdList: [row.carId]
+      }
+      if(num === 1) {
+        delCarWhite(params).then(res => {
+          if(res.code == 200) {
+            this.$message.success('移出白名单成功!');
+            this.ShowCarWhite();
+          } else {
+            this.$message.error(res.errMsg)
+          }
+        })
+      } else {
+        delCarBlack(params).then(res => {
+          if(res.code == 200) {
+            this.$message.success('移出黑名单成功!');
+            this.ShowCarBlack();
+          } else {
+            this.$message.error(res.errMsg)
+          }
+        })
+      }
+    },
+
+    // 车辆通行添加到车辆档案
+    addBase(id) {
+      let params = {
+        carNum: id
+      }
+      addCarBase(params).then(res => {
+        if(res.code == 200) {
+          this.$message.success('添加成功!');
+        } else {
+          this.$message.error(res.errMsg);
+        }
+      })
+    },
     // 车辆洗消
     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>
@@ -69,7 +69,7 @@
         <img
           :src="slotProps.row.recordImage"
           alt="人员门禁"
-          width="100"
+          width="50px"
           @click="clickImg(slotProps.row.recordImage)"
         />
       </template>
@@ -171,6 +171,8 @@ export default {
       tableShows: {},
       // table的翻页
       total: 0,
+      total1: 0,
+      isTotal: false,
       size: 20,
       pageNum: 1,
       selectId: "",
@@ -180,7 +182,7 @@ export default {
       dialogVisible: false, // 图片放大,也不知道得多老眼昏花,这么大的图片还要再大
       imgUrl: "", // 点击图片后放大的图片路径
       recordData: {}, // 进出统计
-      loading: false,
+      loading: true,
     };
   },
   mounted() {
@@ -237,12 +239,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()),
@@ -258,8 +258,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) => {
@@ -300,6 +298,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;
+        }
       });
     },
     // 档案管理

+ 74 - 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',
@@ -52,9 +78,14 @@ const tableItems1 = [
     minWidth: '150',
     slotName: 'parkingLot'
   },
+  {
+    label: '操作',
+    minWidth: '120',
+    slotName: 'carHandle'
+  }
 ]
 
-const tableItems2 = [
+const tableItems3 = [
   {
     prop: 'alarmDate',
     label: '时间',
@@ -86,7 +117,7 @@ const tableItems2 = [
   }
 ]
 
-const tableItems3 = [
+const tableItems4 = [
   {
     prop: 'eventTime',
     label: '发生时间',
@@ -106,7 +137,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

+ 23 - 0
src/views/SystemAdmin/AuthAdmin.vue

@@ -195,6 +195,8 @@ export default {
       commitKeys: [],
       selectedKeys: [],
       menuTreeData: [],
+      // 判断是否点击权限的复选框
+      isKey: false,
     };
   },
   methods: {
@@ -302,6 +304,7 @@ export default {
     },
 
     onCheck(checkedKeys, info) {
+      this.isKey = true;
       this.checkedKeys = checkedKeys;
       this.commitKeys = checkedKeys.concat(info.halfCheckedKeys);
     },
@@ -355,6 +358,26 @@ export default {
           this.selectList = [];
         }
       );
+      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 {
+        this.dialogLimits = false;
+      }
     },
     init() {
       // 后端分页