From 0fa8466c126ad7f46f6e6a96c8542edaf022e22d Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Mon, 26 Jul 2021 15:36:27 +0800
Subject: [PATCH] 推送110问题修复
---
src/views/InstallClent/installClent.vue | 453 +++++++++++++++
src/views/realTimePolice/real.vue | 173 +++++
src/api/installClent/installClent.js | 58 +
src/router/views/index.js | 32
src/views/policeTracking/policeTracking.vue | 1068 +++++++++++++++++++----------------
src/api/real/real.js | 8
6 files changed, 1,290 insertions(+), 502 deletions(-)
diff --git a/src/api/installClent/installClent.js b/src/api/installClent/installClent.js
new file mode 100644
index 0000000..8a069e7
--- /dev/null
+++ b/src/api/installClent/installClent.js
@@ -0,0 +1,58 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/page_az',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+export const getDetail = (id) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/selectInfo',
+ method: 'post',
+ params: {
+ id
+ }
+ })
+}
+
+export const remove = (ids) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
+}
+
+export const add = (row) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/save',
+ method: 'post',
+ data: row
+ })
+}
+
+export const update = (row) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/update',
+ method: 'post',
+ data: row
+ })
+}
+
+export const getChartData = (row) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/getChartData',
+ method: 'get',
+ data: row
+ })
+}
+
diff --git a/src/api/real/real.js b/src/api/real/real.js
index 887f715..281c15f 100644
--- a/src/api/real/real.js
+++ b/src/api/real/real.js
@@ -48,3 +48,11 @@
})
}
+export const getChartData = (row) => {
+ return request({
+ url: '/api/blade-jfpts/alarm/alarm/getChartData',
+ method: 'get',
+ data: row
+ })
+}
+
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 5f743da..f320081 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -230,21 +230,21 @@
import ( /* webpackChunkName: "views" */ '@/views/attendance/attendance')
}]
},
- {
- path: '/clientManagement',
- component: Layout,
- redirect: '/clientManagement/clientManagement',
- children: [{
-
- path: 'index',
- name: '设备管理',
- meta: {
- i18n: 'clientManagement'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/clientManagement/clientManagement')
- }]
- },
+ // {
+ // path: '/clientManagement',
+ // component: Layout,
+ // redirect: '/clientManagement/clientManagement',
+ // children: [{
+ //
+ // path: 'index',
+ // name: '设备管理',
+ // meta: {
+ // i18n: 'clientManagement'
+ // },
+ // component: () =>
+ // import ( /* webpackChunkName: "views" */ '@/views/clientManagement/clientManagement')
+ // }]
+ // },
{
path: '/equipmentInfo',
component: Layout,
@@ -448,4 +448,4 @@
-]
\ No newline at end of file
+]
diff --git a/src/views/InstallClent/installClent.vue b/src/views/InstallClent/installClent.vue
new file mode 100644
index 0000000..1762a2f
--- /dev/null
+++ b/src/views/InstallClent/installClent.vue
@@ -0,0 +1,453 @@
+<template>
+ <div>
+ <basic-container>
+ <avue-crud :option="option"
+ :table-loading="loading"
+ :data="data"
+ :page.sync="page"
+ ref="crud"
+ @row-del="rowDel"
+ v-model="form"
+ :permission="permissionList"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ :before-open="beforeOpen"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ v-show="switchChartType == 0">
+ <template slot="menuLeft">
+ <el-button type="danger"
+ size="small"
+ icon="el-icon-delete"
+ plain
+ v-if="permission.installClent_delete"
+ @click="handleDelete">删 除
+ </el-button>
+
+ <el-button type="success"
+ size="small"
+ icon="el-icon-s-marketing"
+ @click="switchChart">图 表
+ </el-button>
+
+ </template>
+
+ <template slot-scope="{ row }" slot="jtype">
+ <el-tag
+ >{{
+ row.jtype == "0" ? "未安装" : row.jtype == "2" ? "已安装" : "未安装"
+ }}
+ </el-tag>
+ </template>
+
+ </avue-crud>
+
+ <el-row v-show="switchChartType == 1">
+ <el-button type="success"
+ size="small"
+ icon="el-icon-s-marketing"
+ @click="switchChart">表 格
+ </el-button>
+ <div class="alarmTypePro">
+ <div id="alarmTypeProEcharts"></div>
+ <div class="alarmTypeTotal">
+ <div class="numAlarmType"><span>{{alarmTypeTotal}}</span></div>
+ </div>
+ </div>
+ </el-row>
+ </basic-container>
+ </div>
+
+</template>
+
+<script>
+ import {getList, remove, update, add, getDetail, getChartData} from "@/api/installClent/installClent";
+ import {mapGetters} from "vuex";
+ // import echarts from 'echarts'
+
+ export default {
+ data() {
+ return {
+ form: {},
+ query: {},
+ switchChartType: 0,
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
+ },
+ selectionList: [],
+ option: {
+ height: 'auto',
+ calcHeight: 60,
+ dialogWidth: 950,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ excelBtn: false,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "安装时间",
+ type: "datetime",
+ width: 160,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ prop: "alarmTime",
+ },
+ {
+ label: "安装人员",
+ search: true,
+ searchSpan: 4,
+ prop: "alarmPeople",
+ width: 90,
+ },
+ {
+ label: "联系方式",
+ prop: "phoneNumber",
+ width: 110,
+ },
+ {
+ label: "任务地址",
+ prop: "place",
+ },
+ {
+ label: "任务描述",
+ prop: "bz",
+ },
+ {
+ label: "设备编号",
+ searchSpan: 3,
+ width: 130,
+ prop: "deviceNumber",
+ },
+ {
+ label: "省份",
+ prop: "province",
+ search: true,
+ searchSpan: 2,
+ width: 130,
+ searchLabelWidth: 45,
+ placeholder: "省份",
+ type: "select",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ cascaderItem: ["city", "district"],
+ dicUrl: "/api/blade-system/region/select",
+ span: 6,
+ className: "cityreal1",
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "地市",
+ prop: "city",
+ type: "select",
+ width: 130,
+ searchPlaceholder: "地市",
+ placeholder: "地市",
+ searchLabelWidth: 1,
+ searchSpan: 2,
+ search: true,
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 3,
+ labelWidth: "0",
+ className: "cityreal2",
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "区县",
+ searchSpan: 2,
+ searchLabelWidth: 1,
+ width: 130,
+ searchPlaceholder: "区县",
+ placeholder: "区县",
+ search: true,
+ prop: "district",
+ type: "select",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 3,
+ labelWidth: "0",
+ className: "cityreal3",
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "任务状态",
+ searchSpan: 3,
+ width: 96,
+ search: true,
+ slot: true,
+ searchPlaceholder: "请选择",
+ prop: "jtype",
+ type: "select",
+ dicData: [
+ {
+ label: "未安装",
+ value: "0",
+ },
+ {
+ label: "已安装",
+ value: "2",
+ },
+ ],
+ },
+ ]
+ },
+ data: []
+ };
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.installClent_add, false),
+ viewBtn: this.vaildData(this.permission.installClent_view, false),
+ delBtn: this.vaildData(this.permission.installClent_delete, false),
+ editBtn: this.vaildData(this.permission.installClent_edit, false)
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ }
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ row.waringType = "安装任务";
+ add(row).then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+ rowUpdate(row, index, done, loading) {
+ update(row).then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ this.selectionList = [];
+ this.$refs.crud.toggleSelection();
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail(this.form.id).then(res => {
+ this.form = res.data.data;
+ });
+ }
+ done();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ const {releaseTimeRange} = this.query;
+ let values = {
+ ...params,
+ };
+ if (releaseTimeRange) {
+ values = {
+ ...params,
+ releaseTime_datege: releaseTimeRange[0],
+ releaseTime_datelt: releaseTimeRange[1],
+ ...this.query
+ };
+ values.releaseTimeRange = null;
+ }
+ this.loading = true;
+ getList(page.currentPage, page.pageSize, values).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ }
+ , switchChart() {
+ var that = this;
+ //图表切换
+ if (this.switchChartType == 1) {
+ this.switchChartType = 0;
+ } else {
+ this.switchChartType = 1;
+ setTimeout(function () {
+ that.getChartData();
+ }, 0);
+ }
+ }, getChartData() {
+ var that = this;
+ getChartData(null).then(res => {
+ var data = res.data.data;
+ var sum = 0;
+ for (let i = 0; i < data.length; i++) {
+ sum += data[i].value;
+ }
+ var option = {
+ title: [
+ {
+ text: sum,
+ subtext: "安装任务总数",
+ textStyle: {
+ fontSize: 36,
+ fontWeight: "normal",
+ color: "#393939",
+ },
+ subtextStyle: {
+ fontSize: 16,
+ color: "#434343",
+ },
+ textAlign: "center",
+ x: "49%",
+ y: "39%",
+ },
+ ],
+ color:['#29c194','#F48F57', 'green'],
+ tooltip: {
+ trigger: 'item'
+ },
+ legend: {
+ orient: 'vertical',
+ left: 'right',
+ },
+ series: [
+ {
+ name: '任务状态',
+ type: "pie",
+ radius: ["46%", "66%"],
+ data: data,
+ label: {
+ normal: {
+ show: false,
+ },
+ },
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ // let echarts = require('echarts');
+ let myChart = that.$echarts.init(document.getElementById('alarmTypeProEcharts'));
+ myChart.setOption(option);
+ });
+
+ },
+ }
+ };
+</script>
+
+<style>
+ .alarmTypePro {
+ background-color: #ffffff;
+ width: 98.6%;
+ height: 450px;
+ position: relative;
+ left: 0.8%;
+ top: 9.5%;
+ }
+
+</style>
diff --git a/src/views/policeTracking/policeTracking.vue b/src/views/policeTracking/policeTracking.vue
index 619bfae..b304be0 100644
--- a/src/views/policeTracking/policeTracking.vue
+++ b/src/views/policeTracking/policeTracking.vue
@@ -147,7 +147,7 @@
<el-col span="12">
<el-form-item label="历史视频">
<el-button type="primary" @click.stop="oldOpenVideo"
- >视频播放
+ >视频播放
</el-button>
</el-form-item>
</el-col>
@@ -192,7 +192,8 @@
style="position: absolute; right: 0"
:disabled="form.securityArr.length > 0"
:type="form.securityArr.length > 0 ? 'info' : 'danger'"
- >通 知</el-button
+ >通 知
+ </el-button
>
</div>
</div>
@@ -467,6 +468,29 @@
></video>
<span v-show="feedbackVideo == ''">暂无现场视频</span>
</el-card>
+
+ <el-row class="trackButton">
+ <el-button type="success" @click="EndPolice">警情结束</el-button>
+
+ <el-popover
+ style="padding-left: 10px"
+ placement="top"
+ width="250"
+ v-model="visible">
+ <el-input
+ type="textarea"
+ :rows="5"
+ placeholder="请输入驳回理由"
+ v-model="textarea">
+ </el-input>
+ <div style="text-align: right; margin: 20px 0 0 0">
+ <el-button size="mini" type="text" @click="visible = false,textarea=''">取消</el-button>
+ <el-button type="primary" size="mini" @click="rejected">确定</el-button>
+ </div>
+ <el-button type="warning" slot="reference">反馈驳回</el-button>
+ </el-popover>
+ </el-row>
+
</el-card>
</div>
</el-col>
@@ -508,511 +532,585 @@
</template>
<script>
-import axios from "axios";
-import { getList, getclient } from "@/api/real/real";
-export default {
- inject: ["reload"],
- data() {
- return {
- flag: true,
- selectOptions: [],
- receivingList: [],
- security: {},
- imgSrc: [],
- srcList: [],
- form: {},
- itemOption: {
- menuBtn: false,
- column: [
- {
- disabled: true,
- row: false,
- prop: "province",
- type: "select",
- placeholder: "省份",
- props: {
- label: "name",
- value: "code",
- },
- cascaderItem: ["city", "district"],
- dicUrl: "/api/blade-system/region/select",
- span: 1,
- labelWidth: "0",
- className: "cityClassSelect",
- },
- {
- disabled: true,
- row: false,
- prop: "city",
- type: "select",
- placeholder: "地市",
- props: {
- label: "name",
- value: "code",
- },
- dicUrl: "/api/blade-system/region/select?code={{key}}",
- span: 1,
- labelWidth: "0",
- className: "cityClassSelect",
- },
- {
- disabled: true,
- row: false,
- prop: "district",
- type: "select",
- placeholder: "区县",
- props: {
- label: "name",
- value: "code",
- },
- dicUrl: "/api/blade-system/region/select?code={{key}}",
- span: 1,
- labelWidth: "0",
- className: "cityClassSelect",
- },
- ],
- },
- tableData: [],
- multipleSelection: [],
- ensureNames: "",
- ensureId: "",
- baseUrl: "",
- oldVideoSatart: false,
- vaddress: null,
- audios: [],
- feedbackVideo: "",
- };
- },
- created() {
- this.form = this.$route.query;
- if (
- !(
- this.form.securityArr &&
- this.form.securityArr != null &&
- this.form.securityArr != undefined &&
- this.form.securityArr.length > 0
- )
- ) {
- this.form.securityArr = [];
- }
- 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.getAudios();
- this.getImgAndVideo();
- this.$refs.mapDiv.onload = () => {
- window.frames[1].init("AlertSecurity", {
- x: this.form.jd,
- y: this.form.wd,
- });
- };
- },
- updated() {
- var arr = [];
- this.tableData.forEach((item) => {
- if (item.id == this.form.oneId) {
- arr.push(item);
- }
- });
+ import axios from "axios";
+ import {getList, getclient} from "@/api/real/real";
- if (this.form.jtype != 2) {
- this.toggleSelection(arr);
- }
- },
- methods: {
- getDate() {
- // 当前时间
- var timestamp = Date.parse(new Date());
- var serverDate = new Date(timestamp);
-
- // 本周周一的时间
- var mondayTime =
- timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
- var mondayData = new Date(mondayTime);
- //年
- var mondayY = mondayData.getFullYear();
- //月
- var mondayM =
- mondayData.getMonth() + 1 < 10
- ? "0" + (mondayData.getMonth() + 1)
- : mondayData.getMonth() + 1;
- //日
- var mondayD =
- mondayData.getDate() < 10
- ? "0" + mondayData.getDate()
- : mondayData.getDate();
- // 当前时间
- var currentData = new Date(timestamp);
- //年
- var currentY = currentData.getFullYear();
- //月
- var currentM =
- currentData.getMonth() + 1 < 10
- ? "0" + (currentData.getMonth() + 1)
- : currentData.getMonth() + 1;
- //日
- var currentD =
- currentData.getDate() < 10
- ? "0" + currentData.getDate()
- : currentData.getDate();
- //时
- var currenH =
- currentData.getHours() < 10
- ? "0" + currentData.getHours()
- : currentData.getHours();
- //分
- var currenM =
- currentData.getMinutes() < 10
- ? "0" + currentData.getMinutes()
- : currentData.getMinutes();
- //秒
- var currenS =
- currentData.getSeconds() < 10
- ? "0" + currentData.getSeconds()
- : currentData.getSeconds();
-
+ export default {
+ inject: ["reload"],
+ data() {
return {
- day: {
- beginTime: currentY + "-" + currentM + "-" + currentD + " 00:00:00",
- endTime:
- currentY +
- "-" +
- currentM +
- "-" +
- currentD +
- " " +
- currenH +
- ":" +
- currenM +
- ":00",
+ flag: true,
+ selectOptions: [],
+ receivingList: [],
+ security: {},
+ imgSrc: [],
+ srcList: [],
+ textarea: "",
+ visible: false,
+ form: {},
+ itemOption: {
+ menuBtn: false,
+ column: [
+ {
+ disabled: true,
+ row: false,
+ prop: "province",
+ type: "select",
+ placeholder: "省份",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ cascaderItem: ["city", "district"],
+ dicUrl: "/api/blade-system/region/select",
+ span: 1,
+ labelWidth: "0",
+ className: "cityClassSelect",
+ },
+ {
+ disabled: true,
+ row: false,
+ prop: "city",
+ type: "select",
+ placeholder: "地市",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 1,
+ labelWidth: "0",
+ className: "cityClassSelect",
+ },
+ {
+ disabled: true,
+ row: false,
+ prop: "district",
+ type: "select",
+ placeholder: "区县",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 1,
+ labelWidth: "0",
+ className: "cityClassSelect",
+ },
+ ],
},
- week: {
- beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00",
- endTime:
- currentY +
- "-" +
- currentM +
- "-" +
- currentD +
- " " +
- currenH +
- ":" +
- currenM +
- ":00",
- },
- month: {
- beginTime: mondayY + "-" + mondayM + "-01 00:00:00",
- endTime:
- currentY +
- "-" +
- currentM +
- "-" +
- currentD +
- " " +
- currenH +
- ":" +
- currenM +
- ":00",
- },
- current:
- currentY +
- "-" +
- currentM +
- "-" +
- currentD +
- " " +
- currenH +
- ":" +
- currenM +
- ":" +
- currenS,
+ tableData: [],
+ multipleSelection: [],
+ ensureNames: "",
+ ensureId: "",
+ baseUrl: "",
+ oldVideoSatart: false,
+ vaddress: null,
+ audios: [],
+ feedbackVideo: "",
};
},
- 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,
+ created() {
+ this.form = this.$route.query;
+ if (
+ !(
+ this.form.securityArr &&
+ this.form.securityArr != null &&
+ this.form.securityArr != undefined &&
+ this.form.securityArr.length > 0
+ )
+ ) {
+ this.form.securityArr = [];
+ }
+ 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.getAudios();
+ this.getImgAndVideo();
+ this.$refs.mapDiv.onload = () => {
+ window.frames[1].init("AlertSecurity", {
+ x: this.form.jd,
+ y: this.form.wd,
+ });
};
- if (ensureId && ensureId != "") {
- subData.securityArr = ensureId;
- }
- axios
- .post(
- "/api/blade-jfpts/alarm/alarm/updateJtype",
- {},
- {
- params: subData,
- }
- )
- .then(function (res) {
- that.getReceivingAlarm();
-
- that.updatedPageData();
- });
},
-
- getReceivingAlarm() {
- axios
- .get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`)
- .then((res) => {
- this.receivingList = res.data.data.records;
- });
- },
-
- 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=${deptid}`
- )
- .then(function (res) {
- that.tableData = [];
- var i = 0;
- console.log(that.form, 89);
- if (
- that.form.securityArr &&
- that.form.securityArr != null &&
- that.form.securityArr != undefined &&
- 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 == "处警员" &&
- 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,
- });
- }
- });
-
- 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 += "。";
- } else {
- this.ensureNames += item.name;
- this.ensureNames += "、";
+ updated() {
+ var arr = [];
+ this.tableData.forEach((item) => {
+ if (item.id == this.form.oneId) {
+ arr.push(item);
}
});
- this.multipleSelection = val;
- },
-
- toggleSelection(rows) {
- if (rows) {
- rows.forEach((row) => {
- this.$refs.multipleTable.toggleRowSelection(row);
- });
- } else {
- this.$refs.multipleTable.clearSelection();
+ if (this.form.jtype != 2) {
+ this.toggleSelection(arr);
}
},
-
- getAudios() {
- axios({
- method: "get",
- url: "/api/blade-jfpts/avideo/list",
- params: {
+ methods: {
+ rejected() {
+ //反馈打回
+ this.visible = false;
+ var that = this;
+ var subData = {
jid: this.form.id,
- },
- }).then((resdata) => {
- if (resdata.data.data.records.length > 0)
- this.audios = resdata.data.data.records;
- });
- },
-
- getImgAndVideo() {
- axios({
- method: "post",
- url: "/api/blade-jfpts/feedback/feedback/selectFeedEdit",
- params: {
- jid: this.form.id,
- },
- }).then((resdata) => {
- 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];
- }
- }
- });
- },
-
- oldOpenVideo() {
- getclient(this.form.id).then((res) => {
- if (res.data.data.vaddress != "") {
- this.vaddress = res.data.data.vaddress;
- }
- this.oldVideoSatart = true;
- });
- },
-
- 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];
- if (
- !(
- that.form.securityArr &&
- that.form.securityArr != null &&
- that.form.securityArr != undefined &&
- that.form.securityArr.length > 0
+ jtype: 1,
+ rid: this.form.alarmId,
+ // bz: this.form.bz,
+ snumber: this.form.alarmId,
+ sname: this.form.alarmPeople,
+ deviceNumber: this.form.deviceNumber,
+ zc: "反馈驳回,理由:" + this.textarea,
+ zctime: this.getDate().current,
+ };
+ axios
+ .post(
+ "/api/blade-jfpts/alarm/alarm/updateJtype",
+ {},
+ {
+ params: subData,
+ }
)
- ) {
- that.form.securityArr = [];
+ .then(function (res) {
+ that.getReceivingAlarm();
+ that.$message({
+ message: '操作成功',
+ type: 'success'
+ });
+ });
+ },
+ EndPolice() {
+ //结束警情
+ var that = this;
+ var subData = {
+ jid: this.form.id,
+ jtype: 2,
+ rid: this.form.alarmId,
+ // bz: this.form.bz,
+ snumber: this.form.alarmId,
+ sname: this.form.alarmPeople,
+ deviceNumber: this.form.deviceNumber,
+ zc: "结束警情",
+ zctime: this.getDate().current,
+ };
+ axios
+ .post(
+ "/api/blade-jfpts/alarm/alarm/updateJtype",
+ {},
+ {
+ params: subData,
+ }
+ )
+ .then(function (res) {
+ that.getReceivingAlarm();
+ that.$message({
+ message: '操作成功',
+ type: 'success'
+ });
+ });
+ },
+ getDate() {
+ // 当前时间
+ var timestamp = Date.parse(new Date());
+ var serverDate = new Date(timestamp);
+
+ // 本周周一的时间
+ var mondayTime =
+ timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
+ var mondayData = new Date(mondayTime);
+ //年
+ var mondayY = mondayData.getFullYear();
+ //月
+ var mondayM =
+ mondayData.getMonth() + 1 < 10
+ ? "0" + (mondayData.getMonth() + 1)
+ : mondayData.getMonth() + 1;
+ //日
+ var mondayD =
+ mondayData.getDate() < 10
+ ? "0" + mondayData.getDate()
+ : mondayData.getDate();
+ // 当前时间
+ var currentData = new Date(timestamp);
+ //年
+ var currentY = currentData.getFullYear();
+ //月
+ var currentM =
+ currentData.getMonth() + 1 < 10
+ ? "0" + (currentData.getMonth() + 1)
+ : currentData.getMonth() + 1;
+ //日
+ var currentD =
+ currentData.getDate() < 10
+ ? "0" + currentData.getDate()
+ : currentData.getDate();
+ //时
+ var currenH =
+ currentData.getHours() < 10
+ ? "0" + currentData.getHours()
+ : currentData.getHours();
+ //分
+ var currenM =
+ currentData.getMinutes() < 10
+ ? "0" + currentData.getMinutes()
+ : currentData.getMinutes();
+ //秒
+ var currenS =
+ currentData.getSeconds() < 10
+ ? "0" + currentData.getSeconds()
+ : currentData.getSeconds();
+
+ return {
+ day: {
+ beginTime: currentY + "-" + currentM + "-" + currentD + " 00:00:00",
+ endTime:
+ currentY +
+ "-" +
+ currentM +
+ "-" +
+ currentD +
+ " " +
+ currenH +
+ ":" +
+ currenM +
+ ":00",
+ },
+ week: {
+ beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00",
+ endTime:
+ currentY +
+ "-" +
+ currentM +
+ "-" +
+ currentD +
+ " " +
+ currenH +
+ ":" +
+ currenM +
+ ":00",
+ },
+ month: {
+ beginTime: mondayY + "-" + mondayM + "-01 00:00:00",
+ endTime:
+ currentY +
+ "-" +
+ currentM +
+ "-" +
+ currentD +
+ " " +
+ currenH +
+ ":" +
+ currenM +
+ ":00",
+ },
+ current:
+ currentY +
+ "-" +
+ currentM +
+ "-" +
+ currentD +
+ " " +
+ currenH +
+ ":" +
+ currenM +
+ ":" +
+ currenS,
+ };
+ },
+ 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;
}
- that.getList(); //报错deptId格式不对liu.2021.5.7
- });
+ axios
+ .post(
+ "/api/blade-jfpts/alarm/alarm/updateJtype",
+ {},
+ {
+ params: subData,
+ }
+ )
+ .then(function (res) {
+ that.getReceivingAlarm();
+
+ that.updatedPageData();
+ });
+ },
+
+ getReceivingAlarm() {
+ axios
+ .get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`)
+ .then((res) => {
+ this.receivingList = res.data.data.records;
+ });
+ },
+
+ 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=${deptid}`
+ )
+ .then(function (res) {
+ that.tableData = [];
+ var i = 0;
+ console.log(that.form, 89);
+ if (
+ that.form.securityArr &&
+ that.form.securityArr != null &&
+ that.form.securityArr != undefined &&
+ 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 == "处警员" &&
+ 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,
+ });
+ }
+ });
+
+ 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 += "。";
+ } else {
+ this.ensureNames += item.name;
+ this.ensureNames += "、";
+ }
+ });
+
+ this.multipleSelection = val;
+ },
+
+ toggleSelection(rows) {
+ if (rows) {
+ rows.forEach((row) => {
+ this.$refs.multipleTable.toggleRowSelection(row);
+ });
+ } else {
+ this.$refs.multipleTable.clearSelection();
+ }
+ },
+
+ getAudios() {
+ axios({
+ method: "get",
+ url: "/api/blade-jfpts/avideo/list",
+ params: {
+ jid: this.form.id,
+ },
+ }).then((resdata) => {
+ if (resdata.data.data.records.length > 0)
+ this.audios = resdata.data.data.records;
+ });
+ },
+
+ getImgAndVideo() {
+ axios({
+ method: "post",
+ url: "/api/blade-jfpts/feedback/feedback/selectFeedEdit",
+ params: {
+ jid: this.form.id,
+ },
+ }).then((resdata) => {
+ 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];
+ }
+ }
+ });
+ },
+
+ oldOpenVideo() {
+ getclient(this.form.id).then((res) => {
+ if (res.data.data.vaddress != "") {
+ this.vaddress = res.data.data.vaddress;
+ }
+ this.oldVideoSatart = true;
+ });
+ },
+
+ 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];
+ if (
+ !(
+ that.form.securityArr &&
+ that.form.securityArr != null &&
+ that.form.securityArr != undefined &&
+ that.form.securityArr.length > 0
+ )
+ ) {
+ that.form.securityArr = [];
+ }
+ that.getList(); //报错deptId格式不对liu.2021.5.7
+ });
+ },
},
- },
-};
+ };
</script>
<style scoped lang="scss">
-.el-col {
- height: calc(100% - 5px);
-}
-
-.trackClass {
- height: 100%;
- overflow: auto;
- overflow-x: hidden;
-}
-
-.receiving-alarm-box {
- line-height: 32px !important;
- height: 200px;
- overflow-y: auto;
- .el-card__body {
- padding: 0 10px !important;
+ .el-col {
+ height: calc(100% - 5px);
}
-}
-.audios-box,
-.scene-image-box {
- line-height: 32px !important;
- height: auto;
- max-height: 200px;
- overflow-y: auto;
- .el-card__body {
- display: flex;
- padding: 0 10px !important;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
- .x-audio-wrap.inline {
- margin: 10px;
- }
- .el-image {
- margin: 10px;
- width: 160px;
- height: 80px;
+ .trackClass {
+ height: 100%;
+ overflow: auto;
+ overflow-x: hidden;
+ }
+
+ .receiving-alarm-box {
+ line-height: 32px !important;
+ height: 200px;
+ overflow-y: auto;
+
+ .el-card__body {
+ padding: 0 10px !important;
}
}
-}
-#old_video::-webkit-media-controls-timeline {
- display: block;
-}
+ .audios-box,
+ .scene-image-box {
+ line-height: 32px !important;
+ height: auto;
+ max-height: 200px;
+ overflow-y: auto;
+
+ .el-card__body {
+ display: flex;
+ padding: 0 10px !important;
+ flex-wrap: wrap;
+ justify-content: center;
+ align-items: center;
+
+ .x-audio-wrap.inline {
+ margin: 10px;
+ }
+
+ .el-image {
+ margin: 10px;
+ width: 160px;
+ height: 80px;
+ }
+ }
+ }
+
+ #old_video::-webkit-media-controls-timeline {
+ display: block;
+ }
+
+ .trackButton {
+ padding-top: 30px;
+ padding-bottom: 20px;
+ text-align: center;
+ }
</style>
diff --git a/src/views/realTimePolice/real.vue b/src/views/realTimePolice/real.vue
index 9fc9eb1..688fe7e 100644
--- a/src/views/realTimePolice/real.vue
+++ b/src/views/realTimePolice/real.vue
@@ -22,6 +22,7 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
+ v-show="switchChartType == 0"
>
<template slot="menuLeft">
<el-button
@@ -79,6 +80,11 @@
icon="el-icon-pie-chart"
@click="handleExportStatis"
>导出报表
+ </el-button>
+ <el-button type="success"
+ size="mini"
+ icon="el-icon-s-marketing"
+ @click="switchChart">图 表
</el-button>
</template>
@@ -146,6 +152,19 @@
</el-button>
</template>
</avue-crud>
+
+ <el-row v-show="switchChartType == 1">
+ <el-button type="success"
+ size="small"
+ icon="el-icon-s-marketing"
+ @click="switchChart">表 格
+ </el-button>
+ <div class="alarmTypeEcharts">
+ <div id="alarmTypeProEcharts"></div>
+ <div id="alarmEcharts"></div>
+ </div>
+ </el-row>
+
<real-popup ref="realPopupView"></real-popup>
<el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
<iframe
@@ -161,7 +180,7 @@
</template>
<script>
- import {getList, remove, update, add, getclient} from "@/api/real/real";
+ import {getList, remove, update, add, getclient,getChartData} from "@/api/real/real";
import {mapGetters} from "vuex";
export default {
@@ -171,6 +190,7 @@
hls: "",
videoSource: "",
activeClass: 3,
+ switchChartType: "0",
form: {},
query: {},
search: {},
@@ -1027,12 +1047,153 @@
`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}`);
+ }
+ , switchChart() {
+ var that = this;
+ //图表切换
+ if (this.switchChartType == 1) {
+ this.switchChartType = 0;
+ } else {
+ this.switchChartType = 1;
+ setTimeout(function () {
+ that.getData();
+ that.getDataBs();
+ }, 0);
+ }
+ }, getData() {
+ var that = this;
+ getChartData(null).then(res => {
+ var data = res.data.data;
+ var sum = 0;
+ for (let i = 0; i < data.length; i++) {
+ sum += data[i].value;
+ }
+ var option = {
+ title: [
+ {
+ text: sum,
+ subtext: "安装任务总数",
+ textStyle: {
+ fontSize: 36,
+ fontWeight: "normal",
+ color: "#393939",
+ },
+ subtextStyle: {
+ fontSize: 16,
+ color: "#434343",
+ },
+ textAlign: "center",
+ x: "49%",
+ y: "39%",
+ },
+ ],
+ color:['#29c194','#F48F57', 'green'],
+ tooltip: {
+ trigger: 'item'
+ },
+ legend: {
+ orient: 'vertical',
+ left: 'right',
+ },
+ series: [
+ {
+ name: '任务状态',
+ type: "pie",
+ radius: ["46%", "66%"],
+ data: data,
+ label: {
+ normal: {
+ show: false,
+ },
+ },
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ // let echarts = require('echarts');
+ let myChart = that.$echarts.init(document.getElementById('alarmTypeProEcharts'));
+ myChart.setOption(option);
+ });
+ },
+ getDataBs() {
+ var that = this;
+ getChartData(null).then(res => {
+ var data = res.data.data;
+ var sum = 0;
+ for (let i = 0; i < data.length; i++) {
+ sum += data[i].value;
+ }
+ var option = {
+ title: [
+ {
+ text: sum,
+ subtext: "安装任务总数",
+ textStyle: {
+ fontSize: 36,
+ fontWeight: "normal",
+ color: "#393939",
+ },
+ subtextStyle: {
+ fontSize: 16,
+ color: "#434343",
+ },
+ textAlign: "center",
+ x: "49%",
+ y: "39%",
+ },
+ ],
+ color:['#29c194','#F48F57', 'green'],
+ tooltip: {
+ trigger: 'item'
+ },
+ legend: {
+ orient: 'vertical',
+ left: 'right',
+ },
+ series: [
+ {
+ name: '任务状态',
+ type: "pie",
+ radius: ["46%", "66%"],
+ data: data,
+ label: {
+ normal: {
+ show: false,
+ },
+ },
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ // let echarts = require('echarts');
+ let myChart = that.$echarts.init(document.getElementById('alarmEcharts'));
+ myChart.setOption(option);
+ });
},
},
};
</script>
<style>
+ #alarmEcharts {
+ width: 30%;
+ height: 450px;
+ position: relative;
+ left: 20%;
+ }
+
.el-card__body .waringTypeClass {
width: 12%;
}
@@ -1147,4 +1308,14 @@
.tabFontSize {
font-size: 15px;
}
+
+ .alarmTypeEcharts{
+ display: flex;
+ background-color: #ffffff;
+ width: 98.6%;
+ height: 450px;
+ position: relative;
+ left: 0.8%;
+ top: 9.5%;
+ }
</style>
--
Gitblit v1.9.3