East 3 lat temu
rodzic
commit
fb51b92e30

+ 4 - 2
src/components/newTable/NewTable.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-18 16:30:17
- * @LastEditTime: 2021-12-21 14:34:47
+ * @LastEditTime: 2021-12-21 16:56:35
  * @LastEditors: Please set LastEditors
  * @Description: 表格的封装
  * @FilePath: \hyyfClient\src\components\NewTable.vue
@@ -119,7 +119,9 @@ export default {
     listData: {
       handler() {
         this.$nextTick(() => {
-          this.$refs["table"].bodyWrapper.scrollTop = 0;
+          if (this.$refs["table"]) {
+            this.$refs["table"].bodyWrapper.scrollTop = 0;
+          }
         });
       },
       deep: true,

+ 13 - 9
src/utils/chenApi.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-18 13:40:39
- * @LastEditTime: 2021-12-21 10:50:09
+ * @LastEditTime: 2021-12-21 16:49:12
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \hyyfClient\src\utils\chenApi.js
@@ -173,7 +173,7 @@ export function getTheSales(params) {
 // 重量详情
 export function getDayWeight(params) {
   return axios({
-    url: 'http://120.27.234.126:8010/produce/weight/getBatchWeightOnPage2',
+    url: '/produce/weight/getBatchWeightOnPage2',
     method: 'get',
     params: params
   })
@@ -181,7 +181,7 @@ export function getDayWeight(params) {
 // 近七次
 export function getDaysQuery(params) {
   return axios({
-    url: 'http://120.27.234.126:8010/produce/weight/getWeightLastNtimes',
+    url: '/produce/weight/getWeightLastNtimes',
     method: 'get',
     params: params
   })
@@ -189,7 +189,7 @@ export function getDaysQuery(params) {
 // 本月
 export function getMonthQuery(params) {
   return axios({
-    url: 'http://120.27.234.126:8010/produce/weight/getWeightInOneMonth',
+    url: '/produce/weight/getWeightInOneMonth',
     method: 'get',
     params: params
   })
@@ -197,7 +197,7 @@ export function getMonthQuery(params) {
 // 指定时间
 export function getQuery(params) {
   return axios({
-    url: 'http://120.27.234.126:8010/produce/weight/getWeight',
+    url: '/produce/weight/getWeight',
     method: 'get',
     params: params
   })
@@ -318,7 +318,6 @@ export function getDeviceSummer(params) {
   })
 }
 // 设备列表
-// FIXME: 卓哥接口还没放到服务器上
 export function getDeviceList(params) {
   return axios({
     url: '/admin/farm/device/listDevice',
@@ -328,7 +327,6 @@ export function getDeviceList(params) {
 }
 
 // 设备新增
-// FIXME: 卓哥接口还没放到服务器上
 export function postDeviceAdd(params) {
   return axios({
     url: '/admin/farm/device/newDevice',
@@ -338,7 +336,6 @@ export function postDeviceAdd(params) {
 }
 
 // 设备编辑
-// FIXME: 卓哥接口还没放到服务器上
 export function postDeviceEdit(params) {
   return axios({
     url: '/admin/farm/device/editDevice',
@@ -348,7 +345,6 @@ export function postDeviceEdit(params) {
 }
 
 // 设备删除
-// FIXME: 卓哥接口还没放到服务器上
 export function postDeviceDel(params) {
   return axios({
     url: '/admin/farm/device/removeDevice',
@@ -356,3 +352,11 @@ export function postDeviceDel(params) {
     params: params
   })
 }
+
+export function postPerson(params) {
+  return axios({
+    url: '/video/person/getPersonOpenDoorFail',
+    method: 'post',
+    data: params
+  })
+}

+ 2 - 3
src/views/Alarm/EventRem.vue

@@ -13,7 +13,7 @@
         <img
           :src="scope.row.alarmPicture"
           @click="clickImg(scope.row.alarmPicture)"
-          alt="车辆通行"
+          alt="事件提醒"
           width="140"
         />
       </template>
@@ -94,8 +94,7 @@ export default {
         },
       ],
       title: "数据列表",
-      list: [
-      ],
+      list: [],
       tableItems: [
         {
           prop: "alarmDate",

+ 73 - 41
src/views/Alarm/ViolationUser.vue

@@ -14,11 +14,16 @@
       :tableItems="tableItems"
       :shows="tableShows"
     >
-<!--      <template #right>-->
-<!--        <el-button size="mini" type="primary">导出数据</el-button>-->
-<!--      </template>-->
-      <template #img="scope">
-        <img :src="scope.row.img" alt="" />
+      <!--      <template #right>-->
+      <!--        <el-button size="mini" type="primary">导出数据</el-button>-->
+      <!--      </template>-->
+      <template #recordImage="scope">
+        <img
+          :src="scope.row.recordImage"
+          @click="clickImg(scope.row.recordImage)"
+          alt="人员照片"
+          width="140"
+        />
       </template>
       <template #handler="scope">
         <el-button type="text" @click="open(scope.row)">加入白名单</el-button>
@@ -30,6 +35,19 @@
       @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>
 
@@ -38,10 +56,11 @@ import { mapState } from "vuex";
 import XForm from "@/components/XForm";
 import NewTable from "@/components/newTable/NewTable";
 import TableFooter from "@/components/TableFooter";
+import { postPerson } from "@/utils/chenApi.js";
 export default {
   name: "ViolationUser",
   computed: {
-    ...mapState(["color"]),
+    ...mapState(["color", "ip"]),
   },
   components: {
     XForm,
@@ -50,7 +69,7 @@ export default {
   },
   data() {
     return {
-      day: 2,
+      day: 1,
       selectItems: [
         {
           id: 3,
@@ -60,20 +79,6 @@ export default {
           col: 1,
         },
         {
-          id: 4,
-          type: "text",
-          text: "本周",
-          value: 2,
-          col: 1,
-        },
-        {
-          id: 5,
-          type: "text",
-          text: "本月",
-          value: 3,
-          col: 1,
-        },
-        {
           id: 6,
           type: "datepicker",
           placeholder: [],
@@ -92,33 +97,22 @@ export default {
       list: [],
       tableItems: [
         {
-          prop: "time",
+          prop: "swingTime",
           label: "时间",
           minWidth: "100",
-          slotName: "time",
+          slotName: "swingTime",
         },
         {
-          prop: "img",
+          prop: "recordImage",
           label: "照片",
           minWidth: "100",
-          slotName: "img",
+          slotName: "recordImage",
         },
         {
-          prop: "location",
-          label: "位置",
+          prop: "deviceName",
+          label: "进入区域",
           minWidth: "100",
-          slotName: "location",
-        },
-        {
-          prop: "content",
-          label: "事件",
-          minWidth: "100",
-          slotName: "content",
-        },
-        {
-          label: "操作",
-          minWidth: "100",
-          slotName: "handler",
+          slotName: "deviceName",
         },
       ],
       tableShows: {
@@ -128,6 +122,9 @@ export default {
       total: 0,
       pageNum: 1,
       pageSize: 20,
+      form: {},
+      dialogVisible: false,
+      imgUrl: "", // 点击图片后放大的图片路径
     };
   },
   methods: {
@@ -141,12 +138,47 @@ export default {
       this.pageNum = val;
       this.init();
     },
-    init() {},
+    init() {
+      const params = {
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        startSwingTime: this.form.time ? this.form.time[0] : "",
+        endSwingTime: this.form.time ? this.form.time[1] : "",
+      };
+      console.log(this.form.time);
+      postPerson(params).then((res) => {
+        if (res.code === 0) {
+          this.total = parseInt(res.total);
+          this.list = res.data.data.pageData;
+          this.list.forEach((item) => {
+            item.recordImage = `${this.ip}/video/picture/get?alarmPicture=${item.recordImage}`;
+          });
+        }
+      });
+    },
     setDay(data) {
       this.day = data.type;
+      this.form.time = [];
+      this.init();
+    },
+    onClickType(val) {
+      this.day = 0;
+      this.form.time = val.data.value1;
+      if (!this.form.time) {
+        this.$message.warning("请选择时间再查询");
+        return;
+      }
+      this.init();
     },
-    onClickType() {},
     open() {},
+    // 点击图片放大
+    clickImg(url) {
+      this.dialogVisible = true;
+      this.imgUrl = url;
+    },
+  },
+  mounted() {
+    this.init();
   },
 };
 </script>