南昌市物联网技防平台-前端
Administrator
2021-05-07 14e02654e0545ee69456d64aef2f35c7c219d708
src/views/policeTracking/policeTracking.vue
@@ -22,151 +22,151 @@
            </div>
          </div>
          <el-form
            :model="form"
            label-position="right"
            size="mini"
            class="policeForm"
            label-width="100px"
            style="
              background: #fff;
              margin-top: 20px;
              margin-left: 10px;
              margin-right: 10px;
              height: calc(100% - 40px);
              width: calc(100% - 20px);
            "
          >
            <el-row>
              <el-col span="12">
                <el-form-item label="报警人">
                  <el-input
                    disabled="true"
                    v-model="form.galarmPeople"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="报警人电话">
                  <el-input
                    disabled="true"
                    v-model="form.phoneNumber"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="负责人">
                  <el-input
                    disabled="true"
                    v-model="form.oneContacts"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="负责人电话">
                  <el-input
                    disabled="true"
                    v-model="form.onePhone"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="省份" class="cityClassParams">
                  <avue-form :option="itemOption" v-model="form"></avue-form>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="事发地址">
                  <el-input
                    disabled="true"
                    v-model="form.place"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="警情类型">
                  <el-input
                    disabled="true"
                    v-model="form.waringType"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="设备编号">
                  <el-input
                    disabled="true"
                    v-model="form.deviceNumber"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="接警人">
                  <el-input
                    disabled="true"
                    v-model="form.alarmPeople"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="报警内容">
                  <el-input
                    disabled="true"
                    v-model="form.content"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="报警时间">
                  <el-input
                    disabled="true"
                    v-model="form.alarmTime"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="历史视频">
                  <el-button type="primary" @click.stop="oldOpenVideo"
                    >视频播放
                  </el-button>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="备注">
                  <el-input
                    disabled="true"
                    v-model="form.bz"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <el-card>
            <el-form
              :model="form"
              label-position="right"
              size="mini"
              class="policeForm"
              label-width="100px"
              style="
                background: #fff;
                margin-top: 20px;
                margin-left: 10px;
                margin-right: 10px;
                height: calc(100% - 40px);
                width: calc(100% - 20px);
              "
            >
              <el-row>
                <el-col span="12">
                  <el-form-item label="报警人">
                    <el-input
                      disabled="true"
                      v-model="form.galarmPeople"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="报警人电话">
                    <el-input
                      disabled="true"
                      v-model="form.phoneNumber"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="负责人">
                    <el-input
                      disabled="true"
                      v-model="form.oneContacts"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="负责人电话">
                    <el-input
                      disabled="true"
                      v-model="form.onePhone"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="省份" class="cityClassParams">
                    <avue-form :option="itemOption" v-model="form"></avue-form>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="事发地址">
                    <el-input
                      disabled="true"
                      v-model="form.place"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="警情类型">
                    <el-input
                      disabled="true"
                      v-model="form.waringType"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="设备编号">
                    <el-input
                      disabled="true"
                      v-model="form.deviceNumber"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="接警人">
                    <el-input
                      disabled="true"
                      v-model="form.alarmPeople"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="报警内容">
                    <el-input
                      disabled="true"
                      v-model="form.content"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="报警时间">
                    <el-input
                      disabled="true"
                      v-model="form.alarmTime"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="历史视频">
                    <el-button type="primary" @click.stop="oldOpenVideo"
                      >视频播放
                    </el-button>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="备注">
                    <el-input
                      :disabled="form.securityArr.length > 0"
                      v-model="form.bz"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-card>
          <div
            v-if="form.jtype != 2"
            style="margin-top: 20px"
            role="tab"
            aria-expanded="true"
@@ -185,18 +185,20 @@
                <i class="el-icon-document avue-group__icon"></i>
                <h1 class="avue-group__title">人员信息</h1>
                <el-button
                  @click="onSubmit('通知' + ensureNames, 1), (flag = false)"
                  @click="
                    onSubmit('通知' + ensureNames, ensureId), (flag = false)
                  "
                  size="small"
                  style="position: absolute; right: 0"
                  :disabled="!flag"
                  :type="!flag ? 'info' : 'danger'"
                  :disabled="form.securityArr.length > 0"
                  :type="form.securityArr.length > 0 ? 'info' : 'danger'"
                  >通 知</el-button
                >
              </div>
            </div>
          </div>
          <el-card v-if="form.jtype != 2">
          <el-card>
            <el-table
              ref="multipleTable"
              :data="tableData"
@@ -206,7 +208,7 @@
              max-height="240"
            >
              <el-table-column
                v-if="flag"
                v-if="!(form.securityArr.length > 0)"
                type="selection"
                width="55"
                align="center"
@@ -247,10 +249,11 @@
                align="center"
              >
              </el-table-column>
              <el-table-column
                prop="roleName"
                label="所属角色"
                width="100"
                prop="status"
                label="通知状态"
                width="120"
                align="center"
              >
              </el-table-column>
@@ -329,158 +332,141 @@
            </div>
          </div>
          <el-form
            :model="security"
            label-position="right"
            size="mini"
            label-width="100px"
            style="
              background: #fff;
              margin-top: 20px;
              margin-left: 10px;
              margin-right: 10px;
              height: calc(100% - 40px);
              width: calc(100% - 20px);
            "
          >
            <el-row>
              <el-col span="12">
                <el-form-item label="人员编号">
                  <el-input
                    disabled="true"
                    v-model="security.snumber"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="人员名称">
                  <el-input
                    disabled="true"
                    v-model="security.sname"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col span="12">
                <el-form-item label="联系电话">
                  <el-input
                    disabled="true"
                    v-model="security.phone"
                    autocomplete="off"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <el-row :gutter="20">
            <el-col :span="16">
              <div class="grid-content bg-purple"></div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple"></div>
            </el-col>
          </el-row>
          <div class="demo-image__placeholder">
            <div
              role="tab"
              aria-expanded="true"
              aria-controls="el-collapse-content-823"
              aria-describedby="el-collapse-content-823"
          <el-card>
            <el-form
              :model="form"
              label-position="right"
              size="mini"
              label-width="100px"
              style="
                background: #fff;
                margin-top: 20px;
                margin-left: 10px;
                margin-right: 10px;
                height: calc(100% - 40px);
                width: calc(100% - 20px);
              "
            >
              <div
                role="button"
                tabindex="0"
                class="el-collapse-item__header focusing is-active"
              >
                <div class="avue-group__header avue-group">
                  <i class="el-icon-s-order avue-group__icon"></i>
                  <h1 class="avue-group__title">警情反馈</h1>
                </div>
              </div>
            </div>
            <el-input
              disabled="true"
              type="textarea"
              v-model="security.describe"
              autocomplete="off"
            ></el-input>
              <el-row>
                <el-col span="12">
                  <el-form-item label="人员编号">
                    <el-input
                      disabled="true"
                      v-model="form.baname"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col span="12">
                  <el-form-item label="人员名称">
                    <el-input
                      disabled="true"
                      v-model="form.baid"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="联系电话">
                    <el-input
                      disabled="true"
                      v-model="form.baphone"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-card>
            <div class="block">
              <div
                style="margin-top: 20px"
                role="tab"
                aria-expanded="true"
                aria-controls="el-collapse-content-823"
                aria-describedby="el-collapse-content-823"
              >
                <div
                  role="button"
                  tabindex="0"
                  class="el-collapse-item__header focusing is-active"
                >
                  <div class="avue-group__header avue-group">
                    <i class="el-icon-camera-solid avue-group__icon"></i>
                    <h1 class="avue-group__title">现场图片</h1>
                  </div>
                </div>
              </div>
              <el-card class="scene-image-box">
                <el-image
                  v-for="(item, index) in imgSrc"
                  :key="index"
                  :src="item"
                  :preview-src-list="srcList"
                  v-show="imgSrc.length > 0"
                ></el-image>
                <span v-show="imgSrc.length == 0">暂无现场图片</span>
              </el-card>
            </div>
            <div class="block">
              <div
                style="margin-top: 20px"
                role="tab"
                aria-expanded="true"
                aria-controls="el-collapse-content-823"
                aria-describedby="el-collapse-content-823"
              >
                <div
                  role="button"
                  tabindex="0"
                  class="el-collapse-item__header focusing is-active"
                >
                  <div class="avue-group__header avue-group">
                    <i class="el-icon-video-camera-solid avue-group__icon"></i>
                    <h1 class="avue-group__title">现场视频</h1>
                  </div>
                </div>
              </div>
              <div>
                <video
                  :src="feedbackVideo"
                  style="width: 100%; height: 100%; object-fit: fill"
                  controls
                  v-show="feedbackVideo != ''"
                ></video>
                <span v-show="feedbackVideo == ''">暂无现场视频</span>
          <div
            style="margin-top: 20px"
            role="tab"
            aria-expanded="true"
            aria-controls="el-collapse-content-823"
            aria-describedby="el-collapse-content-823"
          >
            <div
              role="button"
              tabindex="0"
              class="el-collapse-item__header focusing is-active"
            >
              <div class="avue-group__header avue-group">
                <i class="el-icon-s-order avue-group__icon"></i>
                <h1 class="avue-group__title">警情反馈</h1>
              </div>
            </div>
          </div>
          <el-row :align="center" style="margin-top: 40px">
            <el-col :offset="10">
              <el-button
                @click="onSubmit('处理完成', 2)"
                :disabled="form.jtype == 2 ? true : false"
                :type="form.jtype == 2 ? 'info' : 'danger'"
                >处理完成</el-button
              >
            </el-col>
          </el-row>
          <el-card>
            <el-input
              disabled="true"
              type="textarea"
              v-model="security.result"
              autocomplete="off"
            ></el-input>
          </el-card>
          <div
            style="margin-top: 20px"
            role="tab"
            aria-expanded="true"
            aria-controls="el-collapse-content-823"
            aria-describedby="el-collapse-content-823"
          >
            <div
              role="button"
              tabindex="0"
              class="el-collapse-item__header focusing is-active"
            >
              <div class="avue-group__header avue-group">
                <i class="el-icon-camera-solid avue-group__icon"></i>
                <h1 class="avue-group__title">现场图片</h1>
              </div>
            </div>
          </div>
          <el-card class="scene-image-box">
            <el-image
              v-for="(item, index) in imgSrc"
              :key="index"
              :src="item"
              :preview-src-list="srcList"
              v-show="imgSrc.length > 0"
            ></el-image>
            <span v-show="imgSrc.length == 0">暂无现场图片</span>
          </el-card>
          <div
            style="margin-top: 20px"
            role="tab"
            aria-expanded="true"
            aria-controls="el-collapse-content-823"
            aria-describedby="el-collapse-content-823"
          >
            <div
              role="button"
              tabindex="0"
              class="el-collapse-item__header focusing is-active"
            >
              <div class="avue-group__header avue-group">
                <i class="el-icon-video-camera-solid avue-group__icon"></i>
                <h1 class="avue-group__title">现场视频</h1>
              </div>
            </div>
          </div>
          <el-card>
            <video
              :src="feedbackVideo"
              style="width: 200px; height: 200px; object-fit: fill"
              controls
              v-show="feedbackVideo != ''"
            ></video>
            <span v-show="feedbackVideo == ''">暂无现场视频</span>
          </el-card>
        </el-card>
      </div>
    </el-col>
@@ -508,8 +494,8 @@
        <video
          :src="vaddress"
          muted="muted"
          autoplay="autoplay"
          loop
          autoplay="autoplay"
          id="old_video"
          style="width: 100%; height: 100%; object-fit: fill"
          controls
@@ -523,7 +509,7 @@
<script>
import axios from "axios";
import { getclient } from "@/api/real/real";
import { getList, getclient } from "@/api/real/real";
export default {
  inject: ["reload"],
  data() {
@@ -589,6 +575,7 @@
      tableData: [],
      multipleSelection: [],
      ensureNames: "",
      ensureId: "",
      baseUrl: "",
      oldVideoSatart: false,
      vaddress: null,
@@ -598,12 +585,12 @@
  },
  created() {
    this.form = this.$route.query;
    this.updatedPageData();
    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.getAudios();
    this.getImgAndVideo();
    this.$refs.mapDiv.onload = () => {
@@ -620,7 +607,10 @@
        arr.push(item);
      }
    });
    this.toggleSelection(arr);
    if (this.form.jtype != 2) {
      this.toggleSelection(arr);
    }
  },
  methods: {
    getDate() {
@@ -731,38 +721,34 @@
          currenS,
      };
    },
    onSubmit(zc, jtype) {
    onSubmit(zc, ensureId) {
      var that = this;
      var subData = {
        jid: this.form.id,
        jtype: 1,
        rid: this.form.alarmId,
        bz: this.form.bz,
        snumber: this.form.alarmId,
        sname: this.form.alarmPeople,
        deviceNumber:this.form.deviceNumber,
        zc: zc,
        zctime: this.getDate().current,
      };
      if (ensureId && ensureId != "") {
        subData.securityArr = ensureId;
      }
      axios
        .post(
          "/api/blade-jfpts/alarm/alarm/updateJtype",
          {},
          {
            params: {
              jid: this.form.id,
              jtype: jtype,
              rid: this.form.alarmId,
              bz: this.form.bz,
              snumber: this.form.alarmId,
              sname: this.form.alarmPeople,
              zc: zc,
              zctime: this.getDate().current,
            },
            params: subData,
          }
        )
        .then(function (res) {
          that.getReceivingAlarm();
          if (jtype == 2) {
            var arr = [];
            that.$store.state.tags.tagList.forEach((item) => {
              if (item.value != that.$store.state.tags.tag.value) {
                arr.push(item);
              }
            });
            that.$store.state.tags.tagList = arr;
            that.$router.go(-1);
          }
          that.updatedPageData();
        });
    },
@@ -776,49 +762,105 @@
    getList() {
      var that = this;
      var deptid = that.form.deptId.slice(0,19);//报错deptId格式不对liu.2021.5.7
      axios
        .get(
          `/api/blade-user/pages?current=1&size=9999&work_status=&deptId=${that.form.deptId}`
          `/api/blade-user/pages?current=1&size=9999&work_status=&deptId=${deptid}`
        )
        .then(function (res) {
          that.tableData = [];
          var i = 0;
          res.data.data.records.forEach((item) => {
            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,
              });
            }
          });
          if (that.form.securityArr.length > 0) {
            res.data.data.records.forEach((item) => {
              if (item.id == that.form.securityId) {
                that.tableData.push({
                  id: item.id,
                  ind: (i += 1),
                  name: item.name,
                  phone: item.phone,
                  online_status: item.online_status == 1 ? "在线" : "掉线",
                  status: "已接警",
                  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,
                online_status: item.online_status == 1 ? "在线" : "掉线",
                roleName: item.roleName,
                tenantName: item.tenantName,
              });
            }
          });
            res.data.data.records.forEach((item) => {
              if (
                item.roleName == "处警员" &&
                that.form.securityArr.indexOf(item.id) != -1 &&
                item.id != that.form.securityId
              ) {
                that.tableData.push({
                  id: item.id,
                  ind: (i += 1),
                  name: item.name,
                  phone: item.phone,
                  online_status: item.online_status == 1 ? "在线" : "掉线",
                  status: "已通知",
                  tenantName: item.tenantName,
                });
              } else if (
                item.roleName == "处警员" &&
                that.form.securityArr.indexOf(item.id) == -1 &&
                item.id != that.form.securityId
              ) {
                that.tableData.push({
                  id: item.id,
                  ind: (i += 1),
                  name: item.name,
                  phone: item.phone,
                  online_status: item.online_status == 1 ? "在线" : "掉线",
                  status: "未通知",
                  tenantName: item.tenantName,
                });
              }
            });
          console.log(that.tableData, 789, 10)
            that.tableData.forEach((item) => {
              if (item.id == that.form.oneId) {
                item.status += "(负责人)";
              }
            });
          } else {
            res.data.data.records.forEach((item) => {
              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 ? "在线" : "掉线",
                  status: "未通知(负责人)",
                  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,
                  online_status: item.online_status == 1 ? "在线" : "掉线",
                  status: "未通知",
                  tenantName: item.tenantName,
                });
              }
            });
          }
        });
    },
    handleSelectionChange(val) {
      this.ensureNames = "";
      this.ensureId = "";
      val.forEach((item, index) => {
        this.ensureId += item.id;
        this.ensureId += ",";
        if (index == val.length - 1) {
          this.ensureNames += item.name;
          this.ensureNames += "。";
@@ -862,14 +904,16 @@
          jid: this.form.id,
        },
      }).then((resdata) => {
        if (resdata.data.data[0].List.length > 0)
          this.security = resdata.data.data[0].List[0];
        if (resdata.data.data[0].tp.length > 0) {
          this.imgSrc = resdata.data.data[0].tp;
          this.srcList = resdata.data.data[0].tp;
        }
        if (resdata.data.data[0].sp.length > 0) {
          this.feedbackVideo = resdata.data.data[0].sp[0];
        if (resdata.data.data.length > 0) {
          if (resdata.data.data[0].List.length > 0)
            this.security = resdata.data.data[0].List[0];
          if (resdata.data.data[0].tp.length > 0) {
            this.imgSrc = resdata.data.data[0].tp;
            this.srcList = resdata.data.data[0].tp;
          }
          if (resdata.data.data[0].sp.length > 0) {
            this.feedbackVideo = resdata.data.data[0].sp[0];
          }
        }
      });
    },
@@ -880,7 +924,20 @@
          this.vaddress = res.data.data.vaddress;
        }
        this.oldVideoSatart = true;
        console.log(this.oldVideoSatart);
      });
    },
    updatedPageData() {
      var that = this;
      axios({
        method: "get",
        url: "/api/blade-jfpts/alarm/alarm/page",
        params: {
          id: that.form.id,
        },
      }).then(function (res) {
        that.form = res.data.data.records[0];
        that.getList();//报错deptId格式不对liu.2021.5.7
      });
    },
  },
@@ -929,4 +986,8 @@
    }
  }
}
#old_video::-webkit-media-controls-timeline {
  display: block;
}
</style>