shuishen
2021-04-22 48d7249fc672823beddb321a3ca7ea57cb3e4d21
src/views/realTimePolice/real.vue
@@ -1,9 +1,3 @@
/*
 * @Author: Morpheus
 * @Date: 2021-03-17 15:21:33
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-04-09 09:59:32
 */
<template>
  <basic-container>
    <avue-crud
@@ -66,9 +60,25 @@
          @click="getQBdata(3)"
          >全部
        </el-button>
        <span>
          <Legend :datas="datalistLIU"></Legend>
        </span>
      </template>
      <template slot="menuLeft">
        <el-button
          type="warning"
          size="mini"
          plain
          icon="el-icon-download"
          @click="handleExport"
          >导出
        </el-button>
        <el-button
          type="warning"
          size="small"
          plain
          icon="el-icon-pie-chart"
          @click="handleExportStatis"
          >导出报表
        </el-button>
      </template>
      <template slot-scope="{ row }" slot="jtype">
@@ -400,7 +410,7 @@
    </el-drawer>
  </basic-container>
</template>
<script>
import { getList, remove, update, add, getclient } from "@/api/real/real";
import { mapGetters } from "vuex";
@@ -411,30 +421,9 @@
import Recorder from "js-audio-recorder";
import Legend from '../../components/liu-legend/Legend'
export default {
  components:{
      Legend,
    },
  data() {
    return {
      //legend-liu数据
      datalistLIU:[
                {
                    color: 'rgb(233, 39, 25)',
                    text: '未处理'
                },
                {
                    color: 'rgb(17, 198, 253)',
                    text: '处理中'
                },
                {
                    color: 'black',
                    text: '已处理'
                }
            ],
      showMap: false,
      hls: "",
      videoSource: "",
@@ -502,6 +491,7 @@
            type: "datetime",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchValue: [this.getStartTime(), this.getEndTime()],
            searchRange: true,
            searchSpan: 5,
            hide: true,
@@ -787,7 +777,10 @@
    },
    searchReset() {
      this.activeClass = 3;
      //清空搜索框中的内容
      this.query = {};
      //清空this.$route.query
      this.$router.push({ query: {} });
      this.onLoad(this.page);
    },
    searchChange(params, done) {
@@ -1135,6 +1128,26 @@
        };
      });
    },
    getStartTime() {
      if (
        this.$route.query.startTime != undefined &&
        this.$route.query.startTime != null &&
        this.$route.query.startTime != ""
      ) {
        return this.$route.query.startTime;
      }
      return "";
    },
    getEndTime() {
      if (
        this.$route.query.endTime != undefined &&
        this.$route.query.endTime != null &&
        this.$route.query.endTime != ""
      ) {
        return this.$route.query.endTime;
      }
      return "";
    },
    handleManage(row) {
      this.form = row;
      this.peopleList = [
@@ -1169,13 +1182,13 @@
        .then(function () {
          that.dialogTableVisible = false;
          // axios({
          //   method: "post",
          //   url: `/api/blade-jfpts/rvideo/stop`,
          //   params: {
          //     jid: row.id,
          //   },
          // }).then((resdata) => {});
          axios({
            method: "post",
            url: `/api/blade-jfpts/rvideo/stop`,
            params: {
              jid: row.id,
            },
          }).then((resdata) => {});
          that.onLoad(that.page, that.query);
          that.$router.push({
@@ -1372,6 +1385,7 @@
          "Content-Type": "application/json;",
        },
      });
      var that = this;
      newCallAxios
@@ -1393,6 +1407,31 @@
          var newbolb = new Blob([blob], { type: "audio/pcm" });
          var fileOfBlob = new File([newbolb], new Date().getTime() + ".pcm");
          formData.append("file", fileOfBlob);
          var wavBlob = that.recorder.getWAVBlob();
          var wavformData = new FormData();
          var wavform = new File([wavBlob], new Date().getTime() + ".wav");
          wavformData.append("file", wavform);
          console.log(
            wavBlob,
            wavform,
            wavformData,
            wavformData.entries(),
            132
          );
          axios({
            method: "post",
            url: "/api/blade-jfpts/xlfeedback/xlfeedback/put-objecty",
            data: wavformData,
            params: {
              jid: that.form.id,
            },
          }).then((resdata) => {
            console.log(resdata);
          });
          newCallAxios
            .post(`/api_control`, blob, {
              params: {
@@ -1426,10 +1465,51 @@
      Recorder.getPermission().then(() => {});
      this.videoConversationReal = true;
    },
    //数据导出
    handleExport() {
      this.$confirm("是否导出实时警情数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        window.open(
          `/api/blade-jfpts/alarm/alarm/export-alarm?beginTime=${this.$route.query.startTime}&endTime=${this.$route.query.endTime}&waringType=${this.$route.query.waringType}&timeDesc=${this.$route.query.timeDesc}`
        );
      });
    },
    //数据报表导出
    handleExportStatis() {
      this.$confirm("是否导出实时警情报表数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        let beginTime =
          this.$route.query.startTime == undefined
            ? ""
            : this.$route.query.startTime;
        let endTime =
          this.$route.query.endTime == undefined
            ? ""
            : this.$route.query.endTime;
        let waringType =
          this.$route.query.waringType == undefined
            ? ""
            : this.$route.query.waringType;
        let timeDesc =
          this.$route.query.timeDesc == undefined
            ? ""
            : this.$route.query.timeDesc;
        window.open(
          `https://web.byisf.com/api/blade-report/ureport/preview?_u=blade-alarm.statis.ureport.xml&beginTime=${beginTime}&endTime=${endTime}&waringType=${waringType}&timeDesc=${timeDesc}`
        );
        //window.open(`http://localhost:8108/ureport/excel?_u=blade-alarm.statis.ureport.xml&beginTime=${beginTime}&endTime=${endTime}&waringType=${waringType}&timeDesc=${timeDesc}`);
      });
    }
  },
};
</script>
<style>
.el-card__body .waringTypeClass {
  width: 12%;
@@ -1544,4 +1624,4 @@
.tabFontSize {
  font-size: 15px;
}
</style>
</style>