East 3 年 前
コミット
4c3477fb71

+ 1 - 1
src/components/bioSafety/QueryConditions.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-18 10:40:12
- * @LastEditTime: 2021-11-18 10:23:12
+ * @LastEditTime: 2021-11-18 15:18:17
  * @LastEditors: Please set LastEditors
  * @Description: 查询条件组件
  * @FilePath: \hyyfClient\src\components\bioSafety\QueryConditions.vue

+ 38 - 0
src/utils/chenApi.js

@@ -0,0 +1,38 @@
+/*
+ * @Author: your name
+ * @Date: 2021-11-18 13:40:39
+ * @LastEditTime: 2021-11-18 17:49:02
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \hyyfClient\src\utils\chenApi.js
+ */
+import axios from './http';
+
+/** 生物安全 */
+/* 获取门禁所有 */
+export function getFaceGuardTotal(data) {
+  return axios({
+    url: 'http://192.168.1.171:9987/person/get_person_record_totalpage',
+    method: 'post',
+    data: data
+  })
+}
+
+/* 车辆管理 - 车辆通行 */
+export function getCarPassage(data) {
+  return axios({
+    url: 'http://192.168.1.171:9987/car/get_car_record',
+    method: 'get',
+    params: data
+  })
+}
+
+/* 车辆管理 - 车辆洗消 */
+export function getCarWash(params) {
+  return axios({
+    url: 'http://192.168.1.171:9987/accident/accident_record_xixiao',
+    method: 'post',
+    data: params
+  })
+}
+

+ 99 - 6
src/views/BioSafety/CarAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-13 17:52:31
- * @LastEditTime: 2021-09-26 14:23:00
+ * @LastEditTime: 2021-11-18 19:37:02
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\CarAdmin.vue
@@ -36,6 +36,15 @@
           </div>
         </template>
       </template>
+      <template v-slot:carNum="slotProps">
+        {{ slotProps.row.carNum? slotProps.row.carNum: '未识别' }}
+      </template>
+      <template v-slot:originalPicPath="slotProps">
+        <img :src="slotProps.row.originalPicPath" @click="clickImg(slotProps.row.originalPicPath)"  alt="车辆通行" width="120"/>
+      </template>
+      <template v-slot:handler="slotProps">
+        <el-button size="mini" @click="clickEvent(slotProps.row)">黑名单</el-button>
+      </template>
     </new-table>
     <table-footer
       :totals="total"
@@ -43,6 +52,16 @@
       @sizeChange="sizeChange"
       @pageChange="pageChange">
     </table-footer>
+    <el-dialog
+      title="车辆图片"
+      :visible.sync="dialogVisible"
+      width="50%">
+      <img :src="imgUrl"  alt="车辆通行" width="100%"/>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -55,6 +74,8 @@ import TableFooter from "../../components/TableFooter";
 import { formItems, propFormData } from './carAdmin/queryCondition.config'
 import { titles, tableItems, tableShows } from './carAdmin/table.config'
 
+import { getCarPassage, getCarWash } from '../../utils/chenApi'
+
 export default {
   name: "CarAdmin",
   components: {
@@ -66,11 +87,11 @@ export default {
   data() {
     return {
       btnNames: [ // 按钮情况
-        { id: 1, name: '车辆档案' },
+        { id: 1, name: '车辆通行' },
         { id: 2, name: '车辆洗消' },
         { id: 3, name: '车辆烘干' }
       ],
-      btnSelected: 1, // 选中的按钮
+      btnSelected: 2, // 选中的按钮
       formItems: [], // 传给 QueryCondition 组件的 formItems
       propFormData: {}, // 传给 QueryCondition 组件的 propFormData
       title: '', // 传给 BioTable 组件的 title
@@ -81,7 +102,10 @@ export default {
       total: 0,
       size: 20,
       pageNum: 1,
-      selectId: ''
+      selectId: '',
+      params: {},
+      dialogVisible: false,
+      imgUrl: '' // 点击图片后放大的图片路径
     }
   },
   mounted() {
@@ -90,6 +114,11 @@ export default {
     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()
+      }
   },
   methods: {
     getBtnSelected(id) {
@@ -98,20 +127,39 @@ export default {
       this.propFormData = propFormData[id - 1]
       this.title = titles[id - 1]
       this.tableItems = tableItems[id - 1]
+      if (this.btnSelected === 1) {
+        this.carPassage()
+      } else if (this.btnSelected === 2) {
+        this.carWash()
+      }
     },
     // 获取查询条件
     handleQuery(params) {
       console.log(params)
+      this.params = params
+      if (this.btnSelected === 1) {
+        this.carPassage()
+      } else if (this.btnSelected === 2) {
+        this.carWash()
+      }
     },
     // 修改size
     sizeChange(val) {
       this.size = val;
-      this.init();
+      if (this.btnSelected === 1) {
+        this.carPassage()
+      } else if (this.btnSelected === 2) {
+        this.carWash()
+      }
     },
     // 修改页数
     pageChange(val) {
       this.pageNum= val;
-      this.init();
+      if (this.btnSelected === 1) {
+        this.carPassage()
+      } else if (this.btnSelected === 2) {
+        this.carWash()
+      }
     },
     init() {
       let params = {
@@ -121,6 +169,51 @@ export default {
       }
       console.log(params)
       // 获取后端数据
+    },
+    // 车辆通行 查询
+    carPassage() {
+      let queryParams = {
+        pageNum: this.pageNum,
+        pageSize: this.size,
+        carNum: this.params.name || undefined
+      }
+      getCarPassage(queryParams).then(res => {
+        console.log('res:', JSON.parse(res.result))
+        const result = JSON.parse(res.result)
+        this.listData = result.data.pageData
+        this.listData.forEach(item => {
+          item.originalPicPath = `https://36.26.62.70:447/evo-apigw/${item.originalPicPath}`
+          item.devChnName = item.devChnName.split('_')[0]
+        })
+        this.total = parseInt(result.data.totalRows)
+      })
+    },
+    // 点击图片放大
+    clickImg(url) {
+      this.dialogVisible = true
+      this.imgUrl = url
+    },
+    // 车辆洗消
+    carWash() {
+      let queryParams = {
+        pageNum: this.pageNum,
+        pageSize: this.size,
+        alarmStartDateString: this.params.time[0] + ' 00:00:00',
+        alarmEndDateString: this.params.time[1] + ' 23:59:59',
+        nodeCodeList: ["1002871$1$0$0", "1002872$1$0$0", "1002873$1$0$0"],
+        deviceCategory: 1,
+        alarmType: 303,
+        dbType: 0
+      }
+      getCarWash(queryParams).then(res => {
+        console.log('res:', JSON.parse(res.result))
+        const result = JSON.parse(res.result)
+        this.listData = result.data.pageData
+      })
+    },
+    // 车辆洗消 - 按钮
+    clickEvent(row) {
+      console.log(row)
     }
   },
 }

+ 53 - 23
src/views/BioSafety/PersonAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-16 11:27:35
- * @LastEditTime: 2021-11-18 11:23:40
+ * @LastEditTime: 2021-11-18 16:22:13
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\PersonAdmin.vue
@@ -38,6 +38,9 @@
           </div>
         </template>
       </template>
+      <template v-slot:recordImage="slotProps">
+        <img :src="slotProps.row.recordImage"  alt="人员门禁" width="100"/>
+      </template>
     </new-table>
     <table-footer
       :totals="total"
@@ -57,6 +60,7 @@ import TableFooter from "../../components/TableFooter"
 import { formItems, propFormData } from './personAdmin/queryCondition.config'
 import { titles, tableItems, tableShows } from './personAdmin/table.config'
 import { getFaceToken, getFaceGuard } from '../../utils/api'
+import { getFaceGuardTotal } from '../../utils/chenApi'
 
 export default {
   name: "PersonAdmin",
@@ -73,7 +77,7 @@ export default {
         { id: 2, name: '人脸门禁' },
         { id: 3, name: '赶猪监管' }
       ],
-      btnSelected: 1, // 选中的按钮
+      btnSelected: 2, // 选中的按钮
       formItems: [], // 传给 QueryCondition 组件的 formItems
       propFormData: {}, // 传给 QueryCondition 组件的 propFormData
       title: '', // 传给 BioTable 组件的 title
@@ -84,7 +88,8 @@ export default {
       total: 0,
       size: 20,
       pageNum: 1,
-      selectId: ''
+      selectId: '',
+      params: {}
     }
   },
   mounted() {
@@ -93,7 +98,6 @@ export default {
     this.title = titles[this.btnSelected - 1]
     this.tableItems = tableItems[this.btnSelected - 1]
     this.tableShows = tableShows
-    this.handleQuery()
   },
   methods: {
     // 获取选中的按钮情况
@@ -106,34 +110,25 @@ export default {
     },
     // 获取查询条件
     handleQuery(params) {
-      console.log(params)
-      let queryParams = {
-        pageNum: this.pageNum,
-        pageSize: this.size,
-        // startSwingTime: params.time[0] + ' 00:00:00',
-        // endSwingTime: params.time[1] + ' 23:59:59',
-        startSwingTime: '2021-11-17 00:00:00',
-        endSwingTime: '2021-11-18 23:59:59',
-        openType: 61 // 进门,刷脸
+      this.params = params
+      if (this.btnSelected === 2) {
+        this.faceGuard()
+        this.faceGuardTotal()
       }
-      getFaceGuard(queryParams).then(async (res) => {
-        console.log('res:', res)
-        console.log(JSON.parse(res.result))
-        // 结果是 JSON 格式
-        this.listData = JSON.parse(res.result).data.pageData
-        const token = await getFaceToken()
-        console.log('token:', token)
-      })
     },
     // 修改size
     sizeChange(val) {
       this.size = val;
-      this.init();
+      if (this.btnSelected === 2) {
+        this.faceGuard()
+      }
     },
     // 修改页数
     pageChange(val) {
       this.pageNum= val;
-      this.init();
+      if (this.btnSelected === 2) {
+        this.faceGuard()
+      }
     },
     init() {
       let params = {
@@ -143,6 +138,41 @@ export default {
       }
       console.log(params)
       // 获取后端数据
+    },
+    // 人脸门禁的查询
+    faceGuard() {
+      let queryParams = {
+        pageNum: this.pageNum,
+        pageSize: this.size,
+        personName: this.params.name || undefined,
+        startSwingTime: this.params.time[0] + ' 00:00:00',
+        endSwingTime: this.params.time[1] + ' 23:59:59',
+        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
+        const { token } = await getFaceToken()
+        this.listData.forEach(item => {
+          item.channelName = item.channelName.split('人脸门禁')[0]
+          item.recordImage = `https://36.26.62.70:447/evo-pic/${item.recordImage}?token=${token}&oss_addr=172.16.3.223:8925`
+        })
+        console.log('token:', token)
+      })
+    },
+    faceGuardTotal() {
+      let queryParams = {
+        personName: this.params.name || undefined,
+        startSwingTime: this.params.time[0] + ' 00:00:00',
+        endSwingTime: this.params.time[1] + ' 23:59:59',
+        openType: 61 // 进门,刷脸
+      }
+      getFaceGuardTotal(queryParams).then(res => {
+        console.log('total:', JSON.parse(res.result))
+        this.total = JSON.parse(res.result).data
+      })
     }
   },
 }

+ 2 - 2
src/views/BioSafety/carAdmin/queryCondition.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-18 15:19:29
- * @LastEditTime: 2021-09-26 14:20:47
+ * @LastEditTime: 2021-11-18 16:28:11
  * @LastEditors: Please set LastEditors
  * @Description: 筛选条件的 formItems 和 propFormData
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\queryCondition.config.js
@@ -10,7 +10,7 @@ const formItems1 = [
   {
     type: 'input',
     label: '输入搜索:',
-    placeholder: '请输入姓名/车牌号',
+    placeholder: '请输入完整车牌号',
     field: 'name'
   }
 ]

+ 36 - 47
src/views/BioSafety/carAdmin/table.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-18 16:06:51
- * @LastEditTime: 2021-09-26 14:30:52
+ * @LastEditTime: 2021-11-18 19:37:40
  * @LastEditors: Please set LastEditors
  * @Description: 表格的配置
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\table.config.js
@@ -10,84 +10,73 @@ export const titles = ['车辆档案', '门禁记录', '人员列表']
 
 const tableItems1 = [
   {
-    prop: 'serialNumber',
-    label: '编号',
-    minWidth: '100',
-    slotName: 'serialNumber'
+    prop: 'capTimeStr',
+    label: '时间',
+    minWidth: '120',
+    slotName: 'capTimeStr'
   },
   {
-    prop: 'photo',
+    prop: 'originalPicPath',
     label: '车辆图片',
     minWidth: '150',
-    slotName: 'photo'
+    slotName: 'originalPicPath'
   },
   {
-    prop: 'numPlate',
-    label: '车牌号',
+    prop: 'carDirectStr',
+    label: '方向',
     minWidth: '150',
-    slotName: 'numPlate'
+    slotName: 'carDirectStr'
   },
   {
-    prop: 'driver',
-    label: '驾驶人',
+    prop: 'devChnName',
+    label: '区域',
     minWidth: '150',
-    slotName: 'driver'
+    slotName: 'devChnName'
   },
   {
-    prop: 'usage',
-    label: '用途',
+    prop: 'carNum',
+    label: '车牌号',
     minWidth: '150',
-    slotName: 'usage'
-  },
-  {
-    prop: 'status',
-    label: '状态',
-    minWidth: '100',
-    slotName: 'status'
+    slotName: 'carNum'
   },
   {
-    prop: 'blacklist',
-    label: '黑名单',
+    prop: 'parkingCarColor',
+    label: '车辆颜色',
     minWidth: '150',
-    slotName: 'blacklist'
+    slotName: 'parkingCarColor'
   },
   {
-    label: '操作',
+    prop: 'parkingLot',
+    label: '所属停车场',
     minWidth: '150',
-    slotName: 'handler'
-  }
+    slotName: 'parkingLot'
+  },
 ]
 
 const tableItems2 = [
   {
-    prop: 'place',
-    label: '洗消地点',
-    minWidth: '100',
-    slotName: 'place'
-  },
-  {
-    prop: 'photo',
-    label: '车辆图片',
+    prop: 'alarmDate',
+    label: '时间',
     minWidth: '150',
-    slotName: 'photo'
+    slotName: 'alarmDate'
   },
   {
-    prop: 'startTime',
-    label: '开始时间',
-    minWidth: '150',
-    slotName: 'startTime'
+    prop: 'alarmPosition',
+    label: '地点',
+    minWidth: '100',
+    slotName: 'alarmPosition'
   },
   {
-    prop: 'status',
-    label: '状态',
+    prop: 'alarmPicture',
+    label: '车辆图片',
     minWidth: '150',
-    slotName: 'status'
+    slotName: 'alarmPicture'
   },
   {
-    prop: 'endTime',
-    label: '结束时间',
+    prop: 'alarmTypeName',
+    label: '类型',
     minWidth: '150',
-    slotName: 'endTime'
+    slotName: 'alarmTypeName'
   },
   {
     label: '操作',

+ 3 - 3
src/views/BioSafety/personAdmin/table.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-18 16:06:51
- * @LastEditTime: 2021-11-18 13:28:18
+ * @LastEditTime: 2021-11-18 14:32:36
  * @LastEditors: Please set LastEditors
  * @Description: 表格的配置
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\table.config.js
@@ -80,13 +80,13 @@ const tableItems2 = [
   {
     prop: 'personName',
     label: '姓名',
-    minWidth: '60',
+    minWidth: '120',
     slotName: 'personName'
   },
   {
     prop: 'channelName',
     label: '进入区域',
-    width: '120',
+    minWidth: '120',
     slotName: 'channelName'
   }
 ]