From a4e06ccd3cd976fbe4eef99e188d42ec9f3ad054 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 08 Apr 2021 09:32:05 +0800
Subject: [PATCH] 样式修改

---
 src/views/policeTracking/policeTracking.vue |  111 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 94 insertions(+), 17 deletions(-)

diff --git a/src/views/policeTracking/policeTracking.vue b/src/views/policeTracking/policeTracking.vue
index 60726c5..3372671 100644
--- a/src/views/policeTracking/policeTracking.vue
+++ b/src/views/policeTracking/policeTracking.vue
@@ -144,6 +144,16 @@
                 </el-form-item>
               </el-col>
               <el-col span="12">
+                <el-form-item label="历史视频">
+                  <el-button type="primary" @click.stop="oldVideoSatart = true"
+                    >视频播放
+                  </el-button>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row>
+              <el-col span="12">
                 <el-form-item label="备注">
                   <el-input
                     disabled="true"
@@ -156,6 +166,7 @@
           </el-form>
 
           <div
+            v-if="form.jtype != 2"
             style="margin-top: 20px"
             role="tab"
             aria-expanded="true"
@@ -174,17 +185,18 @@
                 <i class="el-icon-document avue-group__icon"></i>
                 <h1 class="avue-group__title">人员信息</h1>
                 <el-button
-                  @click="onSubmit('通知保安')"
-                  type="danger"
+                  @click="onSubmit('通知' + ensureNames, 1), (flag = false)"
                   size="small"
                   style="position: absolute; right: 0"
+                  :disabled="!flag"
+                  :type="!flag ? 'info' : 'danger'"
                   >通 知</el-button
                 >
               </div>
             </div>
           </div>
 
-          <el-card>
+          <el-card v-if="form.jtype != 2">
             <el-table
               ref="multipleTable"
               :data="tableData"
@@ -193,7 +205,12 @@
               @selection-change="handleSelectionChange"
               max-height="240"
             >
-              <el-table-column v-if="false" type="selection" width="55" align="center">
+              <el-table-column
+                v-if="flag"
+                type="selection"
+                width="55"
+                align="center"
+              >
               </el-table-column>
 
               <el-table-column
@@ -463,7 +480,7 @@
           <el-row :align="center" style="margin-top: 40px">
             <el-col :offset="10">
               <el-button
-                @click="onSubmit('处理完成')"
+                @click="onSubmit('处理完成', 2)"
                 :disabled="form.jtype == 2 ? true : false"
                 :type="form.jtype == 2 ? 'info' : 'danger'"
                 >处理完成</el-button
@@ -478,11 +495,32 @@
       <iframe
         id="mapDiv"
         ref="mapDiv"
-        src="https://web.byisf.com/map/index.html?openid=ClientManagement"
+        :src="baseUrl"
         frameborder="0"
         width="100%"
         height="100%"
       ></iframe>
+
+      <el-dialog
+        class="old-video-dialog-box"
+        width="100%"
+        title="历史回放"
+        :visible.sync="oldVideoSatart"
+        :close-on-press-escape="false"
+        :close-on-click-modal="false"
+        @close="vaddress = ''"
+        append-to-body
+      >
+        <video
+          :src="vaddress"
+          muted="muted"
+          autoplay="autoplay"
+          loop
+          id="old_video"
+          style="width: 100%; height: 100%; object-fit: fill"
+          controls
+        ></video>
+      </el-dialog>
     </el-col>
   </el-row>
 </template>
@@ -491,8 +529,10 @@
 import axios from "axios";
 
 export default {
+  inject: ["reload"],
   data() {
     return {
+      flag: true,
       selectOptions: [],
       receivingList: [],
       security: {
@@ -564,21 +604,32 @@
       },
       tableData: [],
       multipleSelection: [],
+      ensureNames: "",
+      baseUrl: "",
+      oldVideoSatart: false,
+      vaddress: null,
     };
   },
   created() {
     this.form = this.$route.query;
+    this.vaddress = this.form.vaddress;
     this.getReceivingAlarm();
+    this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}&pid=${this.form.deptId}&deptId=${this.form.deptId}&oneId=${this.form.oneId}`;
   },
   mounted() {
     this.getList();
+
+    this.$refs.mapDiv.onload = () => {
+      window.frames[0].init("AlertSecurity", {
+        x: this.form.jd,
+        y: this.form.wd,
+      });
+    };
   },
   updated() {
-    
-
     var arr = [];
     this.tableData.forEach((item) => {
-      if (item.roleName == "管理员") {
+      if (item.id == this.form.oneId) {
         arr.push(item);
       }
     });
@@ -693,7 +744,7 @@
           currenS,
       };
     },
-    onSubmit(zc) {
+    onSubmit(zc, jtype) {
       var that = this;
       axios
         .post(
@@ -702,7 +753,7 @@
           {
             params: {
               jid: this.form.id,
-              jtype: 2,
+              jtype: jtype,
               rid: this.form.alarmId,
               bz: this.form.bz,
               snumber: this.form.alarmId,
@@ -713,7 +764,9 @@
           }
         )
         .then(function (res) {
-          if (res.msg == "修改成功") {
+          that.getReceivingAlarm();
+
+          if (jtype == 2) {
             var arr = [];
             that.$store.state.tags.tagList.forEach((item) => {
               if (item.value != that.$store.state.tags.tag.value) {
@@ -723,7 +776,6 @@
             that.$store.state.tags.tagList = arr;
             that.$router.go(-1);
           }
-          that.getReceivingAlarm();
         });
     },
 
@@ -737,16 +789,30 @@
 
     getList() {
       var that = this;
-      // .post("/api/blade-jfpts/alarm/alarm/queryBa", {}, {})
       axios
-        .get("/api/blade-user/page?current=1&size=9999&deptId=&work_status=")
+        .get(`/api/blade-user/pages?current=1&size=9999&work_status=&deptId=${that.form.deptId}`)
         .then(function (res) {
           that.tableData = [];
-          console.log(res);
           var i = 0;
+
           res.data.data.records.forEach((item) => {
-            if (item.roleName == "处警员" || item.roleName == "管理员") {
+            if (item.id == that.form.oneId) {
               that.tableData.push({
+                id: item.id,
+                ind: (i += 1),
+                name: item.name,
+                phone: item.phone,
+                online_status: item.online_status == 1 ? "在线" : "掉线",
+                roleName: item.roleName + "(负责人)",
+                tenantName: item.tenantName,
+              });
+            }
+          });
+
+          res.data.data.records.forEach((item) => {
+            if (item.roleName == "处警员" && item.id != that.form.oneId) {
+              that.tableData.push({
+                id: item.id,
                 ind: (i += 1),
                 name: item.name,
                 phone: item.phone,
@@ -760,6 +826,17 @@
     },
 
     handleSelectionChange(val) {
+      this.ensureNames = "";
+      val.forEach((item, index) => {
+        if (index == val.length - 1) {
+          this.ensureNames += item.name;
+          this.ensureNames += "。";
+        } else {
+          this.ensureNames += item.name;
+          this.ensureNames += "、";
+        }
+      });
+
       this.multipleSelection = val;
     },
 

--
Gitblit v1.9.3