Преглед на файлове

Merge branch 'V0.0.6_iot' of http://10.87.21.221:8000/jzyd_yyds/soc_web into V0.0.6_iot

wubiyu преди 1 година
родител
ревизия
f2c5c56f8a

+ 8 - 0
src/api/iot/videoDiagnosis.js

@@ -16,3 +16,11 @@ export function detail(hostCode, channelCode) {
     method: "get",
   });
 }
+
+// 查询详情
+export function integrity(hostCode, channelCode,date) {
+  return request({
+    url: `/iot/VideoDiagnosis/web/integrity/${hostCode}/${channelCode}/${date}`,
+    method: "get",
+  });
+}

+ 112 - 0
src/views/iot/sensorData/dialog.detail.vue

@@ -0,0 +1,112 @@
+<template>
+  <DialogCom
+    title="上报历史"
+    :visible.sync="isShow"
+    class="g-dialog-select-safe-check"
+    :close-on-click-modal="false"
+    width="55%"
+    top="10vh"
+    append-to-body
+  >
+    <div class="el-dialog-div" style="margin-bottom:20px">
+      <g-search-table
+        ref="st"
+        url="/iot/sensor/find/log"
+        method="post"
+        :search-data="search"
+        :pageable="true"
+        :select="true"
+        :select-default="selectList"
+        :drag="false"
+        @select="onSelect"
+      >
+        <!-- 搜索 -->
+        <template slot="searchs">
+          <el-form-item class="searchTitle" label="上报时间">
+            <DataRangePicker
+              v-model="search.dateRange"
+              key="daterange"
+              type="daterange"
+              :clearable="timeClearable"
+            />
+          </el-form-item>
+        </template>
+
+        <!-- 表格 -->
+        <template slot="columns">
+          <el-table-column label="设备名称" align="center" prop="deviceName" width="300"/>
+          <el-table-column label="上报时间" prop="info" width="300"/>
+          <el-table-column label="上报内容" prop="updateTime" width="300"/>
+        </template>
+      </g-search-table>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="onHide">关 闭</el-button>
+    </div>
+  </DialogCom>
+</template>
+<script>
+import GSearchTable from "@/components/table/gx.search.table.vue";
+import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
+
+export default {
+  components: {GSearchTable, DataRangePicker},
+  data() {
+    return {
+      isShow: false,
+      selectList: [],
+      search: null,
+      timeClearable: true,
+    };
+  },
+  computed: {},
+  watch: {
+    orgId(newval) {
+      this.search.orgId = newval;
+    },
+    dateRange(newval) {
+      this.search.dateRange = newval;
+    },
+  },
+  props: {
+    defaultSelect: {
+      type: Array
+    },
+    orgId: {},
+    dateRange: [],
+  },
+  methods: {
+    show(row) {
+      this.search = this.initSearchData(row);
+      this.isShow = true;
+      this.selectList = this.defaultSelect;
+    },
+    onHide() {
+      this.isShow = false;
+    },
+    onSelect(item) {
+      this.selectList = item;
+    },
+    initSearchData(row) {
+      let data = {"deviceCode": row.deviceCode, "orgId": row.orgId, "dateRange": []};
+      return data;
+    },
+    emptySearch() {
+      return {
+        deviceCode: null,
+        orgId: this.$store.getters.orgId,
+      };
+    },
+
+  },
+  mounted() {
+
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-dialog-div {
+  overflow: auto;
+}
+</style>

+ 26 - 15
src/views/iot/sensorData/index.vue

@@ -26,7 +26,14 @@
                   v-model="queryParams.deviceName"
                   clearable
                   placeholder="请输入关键字"
-                  @keyup.enter.native="handleQuery"
+                  @keyup.enter.native="handleQuery"/>
+              </el-form-item>
+              <el-form-item class="searchTitle" label="上报时间">
+                <DataRangePicker
+                  v-model="queryParams.dateRange"
+                  key="daterange"
+                  type="daterange"
+                  :clearable="timeClearable"
                 />
               </el-form-item>
             </el-form>
@@ -72,7 +79,7 @@
 
           <el-table
             v-loading="loading"
-            :data="taskList"
+            :data="dataList"
             border
             height="600"
             size="small"
@@ -82,12 +89,13 @@
             <el-table-column label="设备类型" align="center" prop="categoryType"/>
             <el-table-column label="所属机构" align="center" prop="orgName" width="220"/>
             <el-table-column label="上报时间" align="center" prop="updateTime" width="220"/>
-            <el-table-column label="上报内容" align="center" prop="info" width="220" show-overflow-tooltip="true"/>
+            <el-table-column label="上报内容" align="center" prop="info" width="220" show-overflow-tooltip="showOverflowTooltip"/>
             <el-table-column
               label="操作"
-              fixed="right"
-              width="300"
               align="center"
+              fixed="right"
+              width="200"
+              class-name="small-padding fixed-width"
             >
               <template slot-scope="scope">
                 <el-button
@@ -100,7 +108,7 @@
               </template>
             </el-table-column>
           </el-table>
-          <dialog-info ref="infoDialog" @success="refresh(true)"></dialog-info>
+          <DetailDialog ref="detailDialog" @success="refresh(true)"></DetailDialog>
           <pagination
             v-show="total > 0"
             :total="total"
@@ -116,11 +124,12 @@
 
 <script>
 import { list } from "@/api/iot/sensorData";
+import  DetailDialog  from "./dialog.detail.vue";
 import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
 import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
 import { mapGetters } from "vuex";
 export default {
-  components: { OrgTree, DataRangePicker },
+  components: { OrgTree, DataRangePicker,DetailDialog },
   name: "Task",
   dicts: ["sys_org_type"],
   data() {
@@ -148,13 +157,15 @@ export default {
         dateRange: [],
         checkSub: true,
       },
-      selectedOrgName: "",
       // 表单参数
       form: {},
       // 表单校验
       rules: {},
+      timeClearable: true,
+      showOverflowTooltip:true,
+      dateRange:[],
+      dataList:[],
 
-      orgName: "",
     };
   },
   created() {
@@ -162,14 +173,14 @@ export default {
     this.getList();
   },
   computed: {
-    ...mapGetters(["orgId", "orgName"]),
+    ...mapGetters(["orgId"]),
   },
   methods: {
     /** 查询列表 */
     getList() {
       this.loading = true;
       list(this.queryParams).then((response) => {
-        this.taskList = response.rows;
+        this.dataList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
@@ -230,7 +241,7 @@ export default {
       this.queryParams.orgId = this.orgId;
       this.selectedOrgName = this.orgName;
       this.queryParams.checkSub = true;
-      this.queryParams.dateRange = ["", ""];
+      this.queryParams.dateRange = [];
       this.queryParams.planStartTime = null;
       this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
       this.handleQuery();
@@ -238,11 +249,11 @@ export default {
 
     /** 修改按钮操作 */
     lookView(row) {
-      this.$refs["infoDialog"].show(row.id, {});
+      this.$refs["detailDialog"].show(row);
     },
 
     /** 导出按钮操作 */
-    // handleExport() {
+     handleExport() {
     //   console.log(this);
     //   this.download(
     //     "core/retrievalTask/export",
@@ -253,7 +264,7 @@ export default {
     //       this.selectedOrgName
     //     }-${this.$tab.getCurrentTabName()}-${dayjs().format("YYYYMMDD")}.xlsx`
     //   );
-    // },
+     },
   },
 };
 </script>

+ 0 - 0
src/views/resumption/protection/dialog.edit.vue → src/views/iot/subSystem/dialog.edit.vue


+ 1 - 1
src/views/resumption/protection/dialog.history.vue → src/views/iot/subSystem/dialog.history.vue

@@ -65,7 +65,7 @@
               label="报警控制器状态"
               align="center"
               ><template slot-scope="r">
-                {{ getLabel(statusDict, r.row.status) }}
+                {{ getLabel(statusDict, r.row.status,"未知") }}
               </template></el-table-column
             >
             <el-table-column

+ 17 - 0
src/views/resumption/protection/index.vue → src/views/iot/subSystem/index.vue

@@ -167,6 +167,15 @@
               width="150"
               v-if="columns[4].visible"
             >
+              <template slot-scope="r">
+                <span v-if="r.row.statusUpdateTime != null">
+                  {{
+                    r.row.statusUpdatorName
+                      ? r.row.statusUpdatorName
+                      : "自动获取"
+                  }}
+                </span>
+              </template>
             </el-table-column>
             <el-table-column
               align="center"
@@ -176,6 +185,14 @@
               v-if="columns[5].visible"
             >
             </el-table-column>
+            <el-table-column
+              align="center"
+              prop="statusChangeTime"
+              label="布撤防时间"
+              width="150"
+              v-if="columns[5].visible"
+            >
+            </el-table-column>
             <el-table-column align="center" label="操作">
               <template slot-scope="r">
                 <!-- <el-button

+ 12 - 2
src/views/iot/videoDiagnosis/Calendar.vue

@@ -7,7 +7,10 @@
       :is-expanded="layout.isExpanded"
       :attributes="attrs"
       :min-date="startDate ? new Date(startDate) : new Date()"
-      :max-date="new Date()"
+      :max-date="new Date()"    
+      v-model="selectedDate"
+      @dayclick="onSelect"
+
     />
   </div>
 </template>
@@ -18,6 +21,7 @@ export default {
   name: "Calendar",
   data() {
     return {
+      selectedDate:this.defaultSelectedDate,
       layout: {
         columns: 3,
         rows: 2,
@@ -100,6 +104,9 @@ export default {
       isRequired: true,
       type: Array,
     },
+    defaultSelectedDate:{
+      type:Object
+    }
   },
   computed: {
     calendarWidth() {
@@ -120,7 +127,7 @@ export default {
       handler: function (v) {
         this.setLayout(v);
       },
-    },
+    },    
   },
   mounted() {
     this.init();
@@ -149,6 +156,9 @@ export default {
         this.layout.rows = Math.ceil(diff / 3);
       }
     },
+    onSelect(data){
+      this.$emit("select",data.date)
+    }
   },
 };
 </script>

+ 6 - 4
src/views/iot/videoDiagnosis/ProgressBar.vue

@@ -105,8 +105,10 @@ export default {
             prevEnd = endStamp;
           }
 
-          this.clearCanvas();
-          this.initCanvas();
+          if (this.ctx) {
+            this.clearCanvas();
+            this.initCanvas();
+          }
         }
       },
     },
@@ -142,7 +144,7 @@ export default {
           }
         }
 
-        this.lostVideo=lostVideo;
+        this.lostVideo = lostVideo;
       },
     },
     // startTime(){ //不用
@@ -308,7 +310,7 @@ export default {
     },
     // 清除画布
     clearCanvas: function () {
-      this.ctx.clearRect(0, 0, this.canvasW, this.canvasH);
+      this.ctx && this.ctx.clearRect(0, 0, this.canvasW, this.canvasH);
     },
     // 获取鼠标x位置
     get_cursor_x_position: function (e) {

+ 46 - 26
src/views/iot/videoDiagnosis/detail.vue

@@ -146,7 +146,7 @@
         border
         :label-style="labelStyle"
         :contentStyle="content_style"
-        v-if="data.integrity == null || data.integrity.state == null"
+        v-if="integrity == null || integrity.state == null"
       >
         <el-descriptions-item label="检测结果"> 未知 </el-descriptions-item>
       </el-descriptions>
@@ -159,18 +159,18 @@
           :contentStyle="content_style"
         >
           <el-descriptions-item label="检测结果">{{
-            getLabel(videoIntegrityState, data.integrity.state)
+            getLabel(videoIntegrityState, integrity.state)
           }}</el-descriptions-item>
           <el-descriptions-item label="录像日期">{{
-            dayjs(data.integrity.recordDate).format("YYYY年M月D日")
+            dayjs(integrity.recordDate).format("YYYY年M月D日")
           }}</el-descriptions-item>
           <el-descriptions-item label="丢失时长">{{
-            data.integrity.loseDuration == 0
+            integrity.loseDuration == 0
               ? "未丢失"
-              : data.integrity.loseDuration + "分钟"
+              : integrity.loseDuration + "分钟"
           }}</el-descriptions-item>
           <el-descriptions-item label="更新时间">{{
-            dayjs(data.integrity.updateTime).format("YYYY年M月D日H时m分")
+            dayjs(integrity.updateTime).format("YYYY年M月D日H时m分")
           }}</el-descriptions-item>
         </el-descriptions>
         <el-descriptions :column="1">
@@ -193,7 +193,6 @@
                 <i class="legend" style="background-color: red"></i>
                 <span>无录像</span>
               </li>
-              
             </ul>
           </el-descriptions-item>
         </el-descriptions>
@@ -294,6 +293,7 @@
             :full="data.storage.fullDates"
             :paritialLoss="data.storage.partialLossDates"
             :allLoss="data.storage.allLostDates"
+            @select="onSelectDate"
           ></Calendar>
         </div>
       </div>
@@ -310,6 +310,7 @@ import Calendar from "./Calendar.vue";
 import dayjs from "dayjs";
 import { detail } from "@/api/iot/videoDiagnosis.js";
 import { getLabel } from "@/views/commonOption.js";
+import { integrity } from "@/api/iot/videoDiagnosis";
 
 export default {
   components: { TimeLine, ProgressBar, Calendar },
@@ -318,10 +319,11 @@ export default {
       src: "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
       isShow: false,
       data: {},
+      integrity: {},
       id: null,
       // playVideoObj: {}, //选中的正在播放的录像
       timeCells: [], //录像时间块
-      lostData:[], //不存在视频的时间块
+      lostData: [], //不存在视频的时间块
       // start_timestamp: new Date().getTime() - 5 * 60 * 60 * 1000, //刻度轴开始时间
       labelStyle: {
         color: "#000",
@@ -344,34 +346,52 @@ export default {
     async show(hostCode, channelCode) {
       detail(hostCode, channelCode).then((r) => {
         let data = r.data;
-
+        data.hostCode=hostCode;
+        data.channelCode=channelCode;
         // this.data.storage.fullDates=["2024-02-15","2024-02-16","2024-02-17","2024-02-18","2024-02-19"]
         // this.data.storage.partialLossDates=["2024-02-5","2024-02-6","2024-02-7","2024-02-8","2024-02-9"]
         // this.data.storage.allLostDates=["2024-02-10","2024-02-11","2024-02-12","2024-02-13","2024-02-14"]
-        if (data.integrity && data.integrity.recordDate) {
-          let recordDateStr = dayjs(data.integrity.recordDate).format(
-            "YYYY-MM-DD"
-          );
-          if (data.integrity.checks) {
-            this.timeCells = data.integrity.checks.map(
-              (d) =>({beginTime: `${recordDateStr} ${d.st}`,endTime: `${recordDateStr} ${d.et}`})
-            );
-          }
-
-          if (data.integrity.losts) {
-            this.lostData = data.integrity.losts.map(
-              (d) =>({beginTime: `${recordDateStr} ${d.st}`,endTime: `${recordDateStr} ${d.et}`})
-            );
-          }
-        }
-
+        this.handleInterity(data.integrity);
         this.data = data;
         this.isShow = true;
       });
     },
+    getIntegrity(hostCode, channelCode, date) {
+      integrity(hostCode, channelCode, dayjs(date).format("YYYY-MM-DD")).then((r) => {
+        
+        this.handleInterity(r.data);
+      });
+    },
+    handleInterity(integrity) {
+      this.integrity = integrity;
+      let timeCells = [];
+      let lostData = [];
+      if (integrity && integrity.recordDate) {
+        let recordDateStr = dayjs(integrity.recordDate).format("YYYY-MM-DD");
+        if (integrity.checks) {
+          timeCells = integrity.checks.map((d) => ({
+            beginTime: `${recordDateStr} ${d.st}`,
+            endTime: `${recordDateStr} ${d.et}`,
+          }));
+        }
+
+        if (integrity.losts) {
+          lostData = integrity.losts.map((d) => ({
+            beginTime: `${recordDateStr} ${d.st}`,
+            endTime: `${recordDateStr} ${d.et}`,
+          }));
+        }
+      }
+
+      this.timeCells = timeCells;
+      this.lostData = lostData;
+    },
     onHide() {
       this.isShow = false;
     },
+    onSelectDate(date) {
+      this.getIntegrity(this.data.hostCode,this. data.channelCode, date);
+    },
   },
 };
 </script>