From ad22bccdb0bd1cee5d038b56f4d23a560c368e27 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 03 Nov 2021 20:21:20 +0800
Subject: [PATCH] +活动
---
src/api/home/home.js | 44
src/components/map/drawFence.js | 80 +
src/views/activitys/activitys.vue | 652 ++++++++
vue.config.js | 3
src/router/views/index.js | 1030 ++++++------
src/views/activitys/real.vue | 1506 +++++++++++++++++++
src/views/wel/openUp.vue | 286 +++
src/components/map/tip.vue | 25
src/styles/element-ui.scss | 13
src/store/modules/dict.js | 17
src/api/activitys/activitys.js | 50
src/views/wel/home.vue | 182 ++
src/store/getters.js | 2
src/components/map/main.vue | 637 +++++--
14 files changed, 3,796 insertions(+), 731 deletions(-)
diff --git a/src/api/activitys/activitys.js b/src/api/activitys/activitys.js
new file mode 100644
index 0000000..4a7d4a6
--- /dev/null
+++ b/src/api/activitys/activitys.js
@@ -0,0 +1,50 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+ return request({
+ url: '/api/taskqd/list',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+export const remove = (ids) => {
+ return request({
+ url: '/api/taskqd/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
+}
+
+export const add = (row) => {
+ return request({
+ url: '/api/taskqd/save',
+ method: 'post',
+ data: row
+ })
+}
+
+export const update = (row) => {
+ return request({
+ url: '/api/taskqd/update',
+ method: 'post',
+ data: row
+ })
+}
+
+export const getclient = (id) => {
+ return request({
+ url: '/api/alarm/alarm/detail',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+}
+
diff --git a/src/api/home/home.js b/src/api/home/home.js
index db38fbc..8944fab 100644
--- a/src/api/home/home.js
+++ b/src/api/home/home.js
@@ -27,4 +27,48 @@
url: '/api/blade-user/getUserDistrictTypeCount',
method: 'get'
})
+}
+
+export const getOpenup = (current, size, params) => {
+ return request({
+ url: '/api/blade-user/page',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+//漂浮能量
+export const getRain = (params) => {
+ return request({
+ url: '/api/energy/list',
+ method: 'get',
+ params: {
+ ...params
+ }
+ })
+}
+//当前树能量
+export const getAnergy = (params) => {
+ return request({
+ url: '/api/energyTree/selectNum',
+ method: 'get',
+ params: {
+ ...params
+ }
+ })
+}
+
+//浇灌树
+export const getAddtree = (params) => {
+ return request({
+ url: '/api/energy/updateEnergyId',
+ method: 'post',
+ params: {
+ ...params
+ }
+ })
}
\ No newline at end of file
diff --git a/src/components/map/drawFence.js b/src/components/map/drawFence.js
new file mode 100644
index 0000000..a5c76a0
--- /dev/null
+++ b/src/components/map/drawFence.js
@@ -0,0 +1,80 @@
+import ol from "ol";
+class drawFence {
+ constructor(props) {
+ //这里初始化class的时候需要传map对象进来
+ this.map = props;
+ this.source;
+ this.fenceLayer;
+ this.draw;
+ //样式
+ this.fenceStyle = new ol.style.Style({
+ fill: new ol.style.Fill({
+ color: 'rgba(255, 255, 255, 0.2)'
+ }),
+ stroke: new ol.style.Stroke({
+ color: '#ffcc33',
+ width: 2
+ }),
+ image: new ol.style.Circle({
+ radius: 7,
+ fill: new ol.style.Fill({
+ color: '#ffcc33'
+ })
+ })
+ })
+ this.init()
+ }
+ init() {
+ //临时图层的数据源
+ this.source = new ol.source.Vector();
+ //新建临时图层,并设置临时图层渲染各种要素的样式
+ this.fenceLayer = new ol.layer.Vector({
+ source: this.source,
+ style: this.fenceStyle
+ });
+ this.map.addLayer(this.fenceLayer)
+ }
+ drawingEnd(evt) {
+ let geo = evt.feature.getGeometry()
+ let type = geo.getType(); //获取类型
+ console.log(geo)
+ //根据不同的类型执行不同的操作
+ const handle = {
+ 'Circle': () => {
+ //获取中心点和半径
+ let center = geo.getCenter()
+ let radius = geo.getRadius()
+ console.log(center, radius)
+ },
+ 'Polygon': () => {
+ //获取坐标点
+ let points = geo.getCoordinates()
+ console.log(points)
+ },
+ 'LineString': () => {
+ let points = geo.getCoordinates()
+ console.log(points)
+ }
+ }
+ if (handle[type]) handle[type]()
+ this.closeDraw()
+ }
+ closeDraw() {
+ this.map.removeInteraction(this.draw);
+ }
+ //画图
+ drawingFence(type) {
+ this.draw = new ol.interaction.Draw({
+ source: this.source, //设置要素源,绘制结束后将绘制的要素添加到临时图层
+ type: type, //绘制的类型
+ });
+ this.map.addInteraction(this.draw);
+ const that = this;
+ //绘图结束事件回调
+ this.draw.on('drawend', function (evt) {
+ that.drawingEnd(evt)
+ });
+ }
+}
+
+export default drawFence;
\ No newline at end of file
diff --git a/src/components/map/main.vue b/src/components/map/main.vue
index ca8f3fb..3585e8f 100644
--- a/src/components/map/main.vue
+++ b/src/components/map/main.vue
@@ -7,228 +7,483 @@
* @LastEditTime: 2021-04-24 11:59:43
-->
<template>
- <div id="map"
- style="height: 100%"></div>
+ <div id="map" style="height: 100%">
+ <div class="controlMap">
+ <el-button-group>
+ <el-button
+ type="primary"
+ icon="el-icon-edit"
+ @click="getTypeSelected"
+ :disabled="beginDraw"
+ >{{ butTitle }}</el-button
+ >
+ <el-button
+ type="primary"
+ :disabled="!beginDraw"
+ @click="stopDraw"
+ icon="el-icon-delete"
+ >取消</el-button
+ >
+ <!-- <el-button type="primary" icon="el-icon-share"></el-button>
+ <el-button type="primary" icon="el-icon-delete"></el-button> -->
+ </el-button-group>
+ </div>
+ <tip v-show="showTip" :title="tipTitle" :position="position"></tip>
+ </div>
</template>
<script>
- import OLCesium from 'olcs/OLCesium.js'
- import 'ol/ol.css'
- import OlView from 'ol/View.js'
- import XYZ from 'ol/source/XYZ'
- import OlLayerTile from 'ol/layer/Tile.js'
- import OlMap from 'ol/Map.js'
+import OLCesium from "olcs/OLCesium.js";
+import "ol/ol.css";
+import OlView from "ol/View.js";
+import XYZ from "ol/source/XYZ";
+import OlLayerTile from "ol/layer/Tile.js";
+import OlMap from "ol/Map.js";
+import tip from "./tip.vue";
+import {
+ // eslint-disable-next-line no-unused-vars
+ defaults as OlControlDefaults,
+ defaults,
+ // 全屏控件
+ FullScreen,
+ // 比例尺控件
+ ScaleLine,
+ // 缩放滚动条控件
+ // eslint-disable-next-line no-unused-vars
+ ZoomSlider,
+ // 鼠标位置控件
+ // eslint-disable-next-line no-unused-vars
+ MousePosition,
+ // -地图属性控件
+ Attribution,
+ // 鹰眼控件
+ // eslint-disable-next-line no-unused-vars
+ OverviewMap,
+ // 缩放到范围控件
+ // eslint-disable-next-line no-unused-vars
+ ZoomToExtent,
+ Rotate,
+} from "ol/control.js";
- import {
- // eslint-disable-next-line no-unused-vars
- defaults as OlControlDefaults,
- defaults,
- // 全屏控件
- FullScreen,
- // 比例尺控件
- ScaleLine,
- // 缩放滚动条控件
- // eslint-disable-next-line no-unused-vars
- ZoomSlider,
- // 鼠标位置控件
- // eslint-disable-next-line no-unused-vars
- MousePosition,
- // -地图属性控件
- Attribution,
- // 鹰眼控件
- // eslint-disable-next-line no-unused-vars
- OverviewMap,
- // 缩放到范围控件
- // eslint-disable-next-line no-unused-vars
- ZoomToExtent,
- Rotate
+import VectorLayer from "ol/layer/Vector";
+import VectorSource from "ol/source/Vector";
- } from 'ol/control.js'
+import { OSM, TileWMS, Vector } from "ol/source";
+import Draw from "ol/interaction/Draw";
- import VectorLayer from 'ol/layer/Vector'
- import VectorSource from 'ol/source/Vector'
+import Feature from "ol/Feature.js";
+import Point from "ol/geom/Point.js";
+import LineString from "ol/geom/LineString.js";
+import { Icon, Style, Fill, Stroke } from "ol/style.js";
- import Feature from 'ol/Feature.js'
- import Point from 'ol/geom/Point.js'
- import LineString from 'ol/geom/LineString.js'
- import {Icon, Style, Fill, Stroke} from 'ol/style.js'
+// import drawFence from "./drawFence";
- export default {
- name: 'Map',
- data() {
- return {
- gunAddlayer: new VectorLayer({ // 图标图层
- zIndex: 22,
- source: new VectorSource()
- }),
- peopleAddlayer: new VectorLayer({ // 图标图层
- zIndex: 22,
- source: new VectorSource()
- }),
- carAddlayer: new VectorLayer({ // 图标图层
- zIndex: 22,
- source: new VectorSource()
- }),
- peopleLineAddlayer: new VectorLayer({ // 图标图层
- zIndex: 22,
- source: new VectorSource()
- }),
- }
- },
- mounted() {
- const ol2d = new OlMap({
- layers: [
- new OlLayerTile({
- zIndex: 4,
- title: '影像',
- source: new XYZ({
- url: 'https://webmap-tile.sf-express.com/MapTileService/rt?fetchtype=static&x={x}&y={y}&z={z}&project=sfmap&pic_size=256&pic_type=png8&data_name=361100&data_format=merged-dat&data_type=normal' // 行政区划
- })
+export default {
+ name: "Map",
+ components: {
+ tip,
+ },
+ data() {
+ return {
+ gunAddlayer: new VectorLayer({
+ // 图标图层
+ zIndex: 22,
+ source: new VectorSource(),
+ }),
+ peopleAddlayer: new VectorLayer({
+ // 图标图层
+ zIndex: 22,
+ source: new VectorSource(),
+ }),
+ carAddlayer: new VectorLayer({
+ // 图标图层
+ zIndex: 22,
+ source: new VectorSource(),
+ }),
+ peopleLineAddlayer: new VectorLayer({
+ // 图标图层
+ zIndex: 22,
+ source: new VectorSource(),
+ }),
+
+ // 存储新增点,线,面,数据的地方
+ // polygonData: [],
+ // polygonFlag: false,
+ // editToolbar: null,
+ // addPolygonEntitys: null,
+
+ typeSelected: "LineString",
+ drawLayer: null,
+ draw: null,
+ coordinates: [],
+ coordinatesStr: "",
+ beginDraw: false,
+ butTitle: "开始绘画",
+ view: "",
+ // map: null,
+
+ showTip: false,
+ tipTitle: "",
+ position: {
+ w: 200,
+ h: 10,
+ },
+ };
+ },
+ mounted() {
+ const ol2d = new OlMap({
+ layers: [
+ new OlLayerTile({
+ zIndex: 4,
+ title: "影像",
+ source: new XYZ({
+ url: "https://webmap-tile.sf-express.com/MapTileService/rt?fetchtype=static&x={x}&y={y}&z={z}&project=sfmap&pic_size=256&pic_type=png8&data_name=361100&data_format=merged-dat&data_type=normal", // 行政区划
}),
- // new OlLayerTile({
- // zIndex: 5,
- // title: '道路+中文注记',
- // source: new XYZ({
- // url: 'http://t3.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0' // 注记
- // })
- // })
- ],
+ }),
+ // new OlLayerTile({
+ // zIndex: 5,
+ // title: '道路+中文注记',
+ // source: new XYZ({
+ // url: 'http://t3.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0' // 注记
+ // })
+ // })
+ ],
- // 注意地图控件的写法
- controls: defaults().extend([
- // new FullScreen(),
- // new ScaleLine(),
- // new MousePosition(),
- // new Rotate(),
- // new Attribution()
- ]),
- target: 'map',
- view: new OlView({
- center: [0, 0],
- zoom: 2,
- projection: 'EPSG:4326'
- })
- })
- window.ol2d = ol2d
+ // 注意地图控件的写法
+ controls: defaults().extend([
+ // new FullScreen(),
+ // new ScaleLine(),
+ // new MousePosition(),
+ // new Rotate(),
+ // new Attribution()
+ ]),
+ target: "map",
+ view: new OlView({
+ center: [0, 0],
+ zoom: 2,
+ projection: "EPSG:4326",
+ }),
+ });
+ window.ol2d = ol2d;
- var view = ol2d.getView()
+ var view = ol2d.getView();
- // view.setCenter([115.85883507433789, 28.708432053474827])
- //
- // view.setZoom(13)
+ // view.setCenter([115.85883507433789, 28.708432053474827])
+ view.setCenter([115.9032747077233, 28.67433116990186]);
- const ol3d = new OLCesium({map: window.ol2d})
- window.ol3d = ol3d
+ //
+ view.setZoom(13);
+ this.view = view;
+ const ol3d = new OLCesium({ map: window.ol2d });
+ window.ol3d = ol3d;
- ol2d.addLayer(this.gunAddlayer)
- ol2d.addLayer(this.peopleAddlayer)
- ol2d.addLayer(this.carAddlayer)
- ol2d.addLayer(this.peopleLineAddlayer)
- // this.addLines()
+ ol2d.addLayer(this.gunAddlayer);
+ ol2d.addLayer(this.peopleAddlayer);
+ ol2d.addLayer(this.carAddlayer);
+ ol2d.addLayer(this.peopleLineAddlayer);
+ // this.addLines()
+
+ //监听鼠标位置
+ var that = this;
+ //
+ that.addNewLine();
+ },
+ methods: {
+ goTudefault(x, y) {
+ this.view.setCenter([x, y]);
+ this.view.setZoom(14.5);
},
- methods: {
- init3D(val) {
- window.ol3d.setEnabled(val)
- },
- addEntitys(item, icon, scale, name, type) {
- const iconFeature = new Feature({
- geometry: new Point([Number(item.LGTD), Number(item.LTTD)]),
- name: name,
- attributes: item
- })
+ init3D(val) {
+ window.ol3d.setEnabled(val);
+ },
+ addEntitys(item, icon, scale, name, type) {
+ const iconFeature = new Feature({
+ geometry: new Point([Number(item.LGTD), Number(item.LTTD)]),
+ name: name,
+ attributes: item,
+ });
- const iconStyle = new Style({
- // text: new Text({ // 字体, 未成功, 浪费许多时间
- // font: 'Normal ' + 12 + 'px ' + 'iconfont',
- // text: "\e645",
- // fill: new Fill({ color: "green" }),
- // }),
+ const iconStyle = new Style({
+ // text: new Text({ // 字体, 未成功, 浪费许多时间
+ // font: 'Normal ' + 12 + 'px ' + 'iconfont',
+ // text: "\e645",
+ // fill: new Fill({ color: "green" }),
+ // }),
- image: new Icon({
- scale: scale,
- opacity: 1,
- src: icon
- // src: require('../../assets/Mark.png')
- })
+ image: new Icon({
+ scale: scale,
+ opacity: 1,
+ src: icon,
+ // src: require('../../assets/Mark.png')
+ }),
- // new CircleStyle({ // 普通样式
- // radius: 6,
- // fill: new Fill({
- // color: 'rgba(200, 155, 155, 0.8)'
- // }),
- // stroke: new Stroke({
- // color: 'black',
- // width: 0.3,
- // })
- // }),
- })
+ // new CircleStyle({ // 普通样式
+ // radius: 6,
+ // fill: new Fill({
+ // color: 'rgba(200, 155, 155, 0.8)'
+ // }),
+ // stroke: new Stroke({
+ // color: 'black',
+ // width: 0.3,
+ // })
+ // }),
+ });
- iconFeature.setStyle(iconStyle)
+ iconFeature.setStyle(iconStyle);
- this[type].getSource().addFeature(iconFeature)
- },
+ this[type].getSource().addFeature(iconFeature);
+ },
- addLines(ringId) {
- var that = this;
- if (ringId != null && ringId != "") {
- $.ajax({
- url: "api/routeIn/routein/selectList",
- type: "post",
- data: {
- "id": ringId
- },
- dataType: 'JSON',
- success: function (data) {
- that.peopleLineAddlayer.getSource().clear()
- var entityData = '';
- var entityArr = [];
- entityData = data.data[0].routeInfo.match(/\(([^)]*)\)/);
+ addLines(ringId) {
+ var that = this;
+ if (ringId != null && ringId != "") {
+ $.ajax({
+ url: "api/routeIn/routein/selectList",
+ type: "post",
+ data: {
+ id: ringId,
+ },
+ dataType: "JSON",
+ success: function (data) {
+ that.peopleLineAddlayer.getSource().clear();
+ var entityData = "";
+ var entityArr = [];
+ entityData = data.data[0].routeInfo.match(/\(([^)]*)\)/);
- // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
- if (entityData && entityData != '') {
- entityData = entityData[1].split(',');
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != "") {
+ entityData = entityData[1].split(",");
- for (var j = 0; j < entityData.length; j++) {
- entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
- }
-
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([
+ Number(entityData[j].split(" ")[0]),
+ Number(entityData[j].split(" ")[1]),
+ ]);
}
+ }
+ var lineCoords = entityArr; // 线里点的集合
- var lineCoords = entityArr;// 线里点的集合
+ var view = ol2d.getView();
+ view.setCenter([
+ lineCoords[Math.ceil(entityArr.length / 2)][0],
+ lineCoords[Math.ceil(entityArr.length / 2)][1],
+ ]);
+ view.setZoom(14.5);
- var view = ol2d.getView()
- view.setCenter([lineCoords[Math.ceil(entityArr.length / 2 )][0], lineCoords[Math.ceil(entityArr.length / 2 )][1]])
- view.setZoom(14.5)
+ // 要素
+ // var lineCoords = [[featureInfo.lineString[0][0],featureInfo.lineString[0][0]],[featureInfo.lineString(0),featureInfo.lineString(0)]];
+ var feature_LineString = new Feature({
+ geometry: new LineString(lineCoords),
+ });
- // 要素
- // var lineCoords = [[featureInfo.lineString[0][0],featureInfo.lineString[0][0]],[featureInfo.lineString(0),featureInfo.lineString(0)]];
- var feature_LineString = new Feature({
- geometry: new LineString(lineCoords)
- });
-
-
- feature_LineString.setStyle(new Style({
+ feature_LineString.setStyle(
+ new Style({
//填充色
fill: new Fill({
- color: 'rgba(255, 255, 255, 0.2)'
+ color: "rgba(255, 255, 255, 0.2)",
}),
//边线颜色
stroke: new Stroke({
- color: 'rgb(252, 94, 32)',
- width: 5
- })
- }))
- that.peopleLineAddlayer.getSource().addFeature(feature_LineString)
- },
- error: function (data) {
- // 请求失败函数
- console.log(data);
- }
- });
- }
-
-
+ color: "rgb(252, 94, 32)",
+ width: 5,
+ }),
+ })
+ );
+ that.peopleLineAddlayer.getSource().addFeature(feature_LineString);
+ that.butTitle = "修改绘画";
+ },
+ error: function (data) {
+ // 请求失败函数
+ console.log(data);
+ },
+ });
}
- }
- }
+ },
+ addNewLine() {
+ this.map = ol2d;
+ // console.log(ol2d, 1);
+ // console.log(drawFence, 2);
+ // var d = new drawFence(ol2d);
+ // console.log(d);
+
+ // 添加一个绘制的线使用的layer
+ this.drawLayer = new VectorLayer({
+ //layer所对应的source
+ source: new Vector(),
+ });
+ //把layer加入到地图中
+ this.map.addLayer(this.drawLayer);
+ },
+ getTypeSelected() {
+ this.beginDraw = true;
+ this.draw && this.map.removeInteraction(this.draw);
+ this.peopleLineAddlayer.getSource().clear();
+ //再根据typeSelect的值绘制新的Interaction
+ this.addInteraction();
+ },
+ stopDraw() {
+ this.showTip = false;
+ this.draw && this.map.removeInteraction(this.draw);
+ this.beginDraw = false;
+ this.tipTitle = "";
+ this.$store.commit("setRotesData", ""); //用vuex传最终数据
+ },
+ setTipPosition(x, y, n, m) {
+ this.position.w = x + n;
+ this.position.h = y + m;
+ },
+ addInteraction() {
+ this.tipTitle = "单击左键或右键开始绘画";
+ $("#map")
+ .off("mousemove")
+ .mousemove(function (e) {
+ if (!that.showTip) {
+ that.showTip = true;
+ }
+ that.setTipPosition(e.offsetX, e.offsetY, 10, 10);
+ // console.log(e.clientX);
+ // console.log(e.offsetX);
+ // console.log(e.pageX);
+ // console.log(e.screenX);
+ // console.log("================================");
+ });
+
+ this.coordinates = [];
+ let value = this.typeSelected,
+ that = this;
+
+ if (value !== "None") {
+ this.draw = new Draw({
+ source: this.drawLayer.getSource(),
+ type: this.typeSelected,
+ style: new Style({
+ stroke: new Stroke({
+ color: "red",
+ width: 3,
+ }),
+ }),
+ coordinate: function (res) {
+ //画线中的点
+ that.coordinates.push(res.coordinate_);
+ that.tipTitle = "可继续,或选择最终位置双击结束";
+ // console.log(res.coordinate_, 123456);
+ },
+ coordinateOver: function (res) {
+ // 结束绘画 处理数据
+ // console.log(that.doData(that.coordinates));
+ let d = that.doData(that.coordinates);
+ that.addLinesDraw(d);
+ // console.log(d);
+ // console.log(that.$store);
+ that.$store.commit("setRotesData", d); //用vuex传最终数据
+ // that.coordinatesStr = that.doData(that.coordinates);
+ },
+ });
+ this.map.addInteraction(this.draw);
+ }
+ },
+ doData(val) {
+ // ` routeInfo: "
+ // LINESTRING(
+ // 115.875489096939 28.7179278611352
+ // ,115.8794051221 28.7176267680684
+ // ,115.879340749084 28.7143052776491
+ // ,115.878879409134 28.7140324026424
+ // ,115.875220876038 28.7150580325974
+ // ,115.875489096939 28.7179466794231
+ // ,115.875489096939 28.7179466794231
+ // )"
+ // `
+ let str = "LINESTRING(";
+ for (let k = 0; k < val.length; k++) {
+ str += `${val[k][0]} ${val[k][1]}`;
+ if (k != val.length - 1) {
+ str += ",";
+ }
+ }
+ str += ")";
+ return str;
+ },
+ addLinesDraw(val) {
+ var that = this;
+ // if (ringId != null && ringId != "") {
+ // $.ajax({
+ // url: "api/routeIn/routein/selectList",
+ // type: "post",
+ // data: {
+ // id: ringId,
+ // },
+ // dataType: "JSON",
+ // success: function (data) {
+ that.peopleLineAddlayer.getSource().clear();
+ var entityData = "";
+ var entityArr = [];
+ entityData = val.match(/\(([^)]*)\)/);
+
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != "") {
+ entityData = entityData[1].split(",");
+
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([
+ Number(entityData[j].split(" ")[0]),
+ Number(entityData[j].split(" ")[1]),
+ ]);
+ }
+ }
+
+ var lineCoords = entityArr; // 线里点的集合
+
+ var view = ol2d.getView();
+ view.setCenter([
+ lineCoords[Math.ceil(entityArr.length / 2)][0],
+ lineCoords[Math.ceil(entityArr.length / 2)][1],
+ ]);
+ view.setZoom(14.5);
+
+ // 要素
+ // var lineCoords = [[featureInfo.lineString[0][0],featureInfo.lineString[0][0]],[featureInfo.lineString(0),featureInfo.lineString(0)]];
+ var feature_LineString = new Feature({
+ geometry: new LineString(lineCoords),
+ });
+
+ feature_LineString.setStyle(
+ new Style({
+ //填充色
+ fill: new Fill({
+ color: "rgba(255, 255, 255, 0.2)",
+ }),
+ //边线颜色
+ stroke: new Stroke({
+ color: "rgb(252, 94, 32)",
+ width: 5,
+ }),
+ })
+ );
+ that.peopleLineAddlayer.getSource().addFeature(feature_LineString);
+ if (that.draw != null) {
+ that.beginDraw = false;
+ that.butTitle = "重新绘画";
+ that.draw.controlDrawing(true);
+ that.tipTitle = "已结束绘画,点击重新绘画清除上次内容并开始绘画";
+ $("#map").unbind("mousemove");
+ // setTimeout(() => {
+ this.tipTitle = "";
+ this.showTip = false;
+ }
+ },
+ },
+};
</script>
+
+<style scoped lang="scss">
+#map {
+ position: relative;
+ .controlMap {
+ position: absolute;
+ top: 10px;
+ left: calc(50% - 80px);
+ z-index: 2 !important;
+ }
+}
+</style>
\ No newline at end of file
diff --git a/src/components/map/tip.vue b/src/components/map/tip.vue
new file mode 100644
index 0000000..d9006f8
--- /dev/null
+++ b/src/components/map/tip.vue
@@ -0,0 +1,25 @@
+<template>
+ <div
+ class="mapTip"
+ :style="{ top: position.h + 'px', left: position.w + 'px' }"
+ >
+ {{ title }}
+ </div>
+</template>
+
+<script>
+export default {
+ props: ["title", "position"],
+};
+</script>
+
+<style lang="scss" scoped>
+.mapTip {
+ background-color: rgb(168, 168, 168);
+ padding: 5px;
+ border: 1px solid #000;
+ position: absolute;
+ z-index: 10 !important;
+ border-radius: 5px;
+}
+</style>
\ No newline at end of file
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 2ff4bbb..0a4f4c6 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -11,7 +11,7 @@
i18n: 'dashboard'
},
component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/wel/home')
+ import( /* webpackChunkName: "views" */ '@/views/wel/home')
}, {
path: 'dashboard',
name: '控制台',
@@ -24,518 +24,532 @@
}]
},
- // {
- // path: '/wel',
- // component: Layout,
- // redirect: '/wel/index',
- // children: [{
- // path: 'index',
- // name: '首页',
- // meta: {
- // i18n: 'dashboard'
- // },
- // component: () =>
- // import ( /* webpackChunkName: "views" */ '@/views/home/home')
- // }, {
- // path: 'dashboard',
- // name: '控制台',
- // meta: {
- // i18n: 'dashboard',
- // menu: false,
- // },
- // component: () =>
- // import ( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
- // }]
- // },
- {
- path: '/distribution',
- component: Layout,
- redirect: '/distribution/index',
- children: [{
- path: 'index',
- name: '警情分发处置',
- meta: {
- i18n: 'distribution'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/distribution/index')
- }]
- },
- {
- path: '/test',
- component: Layout,
- kby:true,
- redirect: '/test/index',
- children: [{
- path: 'index',
- name: '测试页',
- meta: {
- i18n: 'test'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/util/test')
- }]
+// {
+// path: '/wel',
+// component: Layout,
+// redirect: '/wel/index',
+// children: [{
+// path: 'index',
+// name: '首页',
+// meta: {
+// i18n: 'dashboard'
+// },
+// component: () =>
+// import ( /* webpackChunkName: "views" */ '@/views/home/home')
+// }, {
+// path: 'dashboard',
+// name: '控制台',
+// meta: {
+// i18n: 'dashboard',
+// menu: false,
+// },
+// component: () =>
+// import ( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
+// }]
+// },
+{
+ path: '/distribution',
+ component: Layout,
+ redirect: '/distribution/index',
+ children: [{
+ path: 'index',
+ name: '警情分发处置',
+ meta: {
+ i18n: 'distribution'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/distribution/index')
+ }]
+},
+{
+ path: '/test',
+ component: Layout,
+ kby: true,
+ redirect: '/test/index',
+ children: [{
+ path: 'index',
+ name: '测试页',
+ meta: {
+ i18n: 'test'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/util/test')
+ }]
+}, {
+ path: '/dict-horizontal',
+ component: Layout,
+ redirect: '/dict-horizontal/index',
+ children: [{
+ path: 'index',
+ name: '字典管理',
+ meta: {
+ i18n: 'dict'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
+ }]
+}, {
+ path: '/dict-vertical',
+ component: Layout,
+ redirect: '/dict-vertical/index',
+ children: [{
+ path: 'index',
+ name: '字典管理',
+ meta: {
+ i18n: 'dict'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
+ }]
+}, {
+ path: '/info',
+ component: Layout,
+ redirect: '/info/index',
+ children: [{
+ path: 'index',
+ name: '个人信息',
+ meta: {
+ i18n: 'info'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/system/userinfo')
+ }]
+},
+{
+ path: '/real',
+ component: Layout,
+ redirect: '/real/video',
+ children: [{
+ path: 'video',
+ name: '视频',
+ meta: {
+ i18n: 'real'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/Video/video')
}, {
- path: '/dict-horizontal',
- component: Layout,
- redirect: '/dict-horizontal/index',
- children: [{
- path: 'index',
- name: '字典管理',
- meta: {
- i18n: 'dict'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
- }]
+ path: 'history/:historyId',
+ name: '设备历史',
+ meta: {
+ i18n: 'real'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/realTimePolice/realHistory')
+ }]
+},
+{
+ path: '/welcomeData',
+ component: Layout,
+ redirect: '/welcomeData/data',
+ children: [{
+ path: 'data',
+ name: '数据模式',
+ meta: {
+ i18n: 'data'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/data')
}, {
- path: '/dict-vertical',
- component: Layout,
- redirect: '/dict-vertical/index',
- children: [{
- path: 'index',
- name: '字典管理',
- meta: {
- i18n: 'dict'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
- }]
+ path: 'map',
+ name: '地图模式',
+ meta: {
+ i18n: 'map'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/map')
}, {
- path: '/info',
- component: Layout,
- redirect: '/info/index',
- children: [{
- path: 'index',
- name: '个人信息',
- meta: {
- i18n: 'info'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/system/userinfo')
- }]
- },
- {
- path: '/real',
- component: Layout,
- redirect: '/real/video',
- children: [{
- path: 'video',
- name: '视频',
- meta: {
- i18n: 'real'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/Video/video')
- }, {
- path: 'history/:historyId',
- name: '设备历史',
- meta: {
- i18n: 'real'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/realTimePolice/realHistory')
- }]
- },
- {
- path: '/welcomeData',
- component: Layout,
- redirect: '/welcomeData/data',
- children: [{
- path: 'data',
- name: '数据模式',
- meta: {
- i18n: 'data'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/data')
- }, {
- path: 'map',
- name: '地图模式',
- meta: {
- i18n: 'map'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/map')
- }, {
- path: 'card',
- name: '卡片模式',
- meta: {
- i18n: 'card'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/card')
- }]
- },
+ path: 'card',
+ name: '卡片模式',
+ meta: {
+ i18n: 'card'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/supervisoryConsole/card')
+ }]
+},
- {
- path: '/work/process/leave',
- component: Layout,
- redirect: '/work/process/leave/form',
- children: [{
- path: 'form/:processDefinitionId',
- name: '请假流程',
- meta: {
- i18n: 'work'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/form')
- }, {
- path: 'handle/:taskId/:processInstanceId/:businessId',
- name: '处理请假流程',
- meta: {
- i18n: 'work'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/handle')
- }, {
- path: 'detail/:processInstanceId/:businessId',
- name: '请假流程详情',
- meta: {
- i18n: 'work'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
- }]
- },
- {
- path: '/realTimePolice',
- component: Layout,
- redirect: '/realTimePolice/index',
- children: [{
- path: 'index',
- name: '任务下发',
- meta: {
- i18n: 'real'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/realTimePolice/real')
- }]
+{
+ path: '/work/process/leave',
+ component: Layout,
+ redirect: '/work/process/leave/form',
+ children: [{
+ path: 'form/:processDefinitionId',
+ name: '请假流程',
+ meta: {
+ i18n: 'work'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/work/process/leave/form')
}, {
- path: '/examination',
- component: Layout,
- redirect: '/examination/index',
- children: [{
- path: 'index',
- name: '资格审查',
- meta: {
- i18n: 'index'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/examination/examination')
- }]
- },
- {
- path: '/home',
- component: Layout,
- redirect: '/home/index',
- children: [{
- path: 'index',
- name: '研判洞察',
- meta: {
- i18n: 'home'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/home/home')
- }]
- },
- {
- path: '/attendance',
- component: Layout,
- redirect: '/attendance/attendance',
- children: [{
- path: 'index',
- name: '考勤管理',
- meta: {
- i18n: 'attendance'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/attendance/attendance')
- }]
- },
- {
- path: '/clientManagement',
- component: Layout,
- redirect: '/clientManagement/clientManagement',
- children: [{
+ path: 'handle/:taskId/:processInstanceId/:businessId',
+ name: '处理请假流程',
+ meta: {
+ i18n: 'work'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/work/process/leave/handle')
+ }, {
+ path: 'detail/:processInstanceId/:businessId',
+ name: '请假流程详情',
+ meta: {
+ i18n: 'work'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
+ }]
+},
+{
+ path: '/realTimePolice',
+ component: Layout,
+ redirect: '/realTimePolice/index',
+ children: [{
+ path: 'index',
+ name: '任务下发',
+ meta: {
+ i18n: 'real'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/realTimePolice/real')
+ }]
+}, {
+ path: '/examination',
+ component: Layout,
+ redirect: '/examination/index',
+ children: [{
+ path: 'index',
+ name: '资格审查',
+ meta: {
+ i18n: 'index'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/examination/examination')
+ }]
+},
+{
+ path: '/home',
+ component: Layout,
+ redirect: '/home/index',
+ children: [{
+ path: 'index',
+ name: '研判洞察',
+ meta: {
+ i18n: 'home'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/home/home')
+ }]
+},
+{
+ path: '/attendance',
+ component: Layout,
+ redirect: '/attendance/attendance',
+ children: [{
+ path: 'index',
+ name: '考勤管理',
+ meta: {
+ i18n: 'attendance'
+ },
+ component: () =>
+ 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: '/suser',
- component: Layout,
- redirect: '/suser',
- children: [{
- path: 'index',
- name: '业主管理',
- meta: {
- i18n: 'suser'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/system/cs')
- }]
- }, {
- path: '/policeTracking',
- component: Layout,
- redirect: '/policeTracking/track',
- children: [{
- path: 'track',
- name: '任务追踪',
- meta: {
- i18n: 'track'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/policeTracking/policeTracking')
- }]
- }, {
- path: '/healthcode',
- component: Layout,
- redirect: '/healthcode/healthcodePage',
- children: [{
- path: 'healthcodePage',
- name: '健康码',
- meta: {
- i18n: 'healthcode'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/healthcode/healthcode')
- }]
- }, {
- path: '/animalHeat',
- component: Layout,
- redirect: '/animalHeat/animalHeatPage',
- children: [{
- path: 'animalHeatPage',
- name: '体温检测',
- meta: {
- i18n: 'animalHeat'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/animalHeat/animalHeat')
- }]
- }, {
- path: '/comment',
- component: Layout,
- peixun: true,
- redirect: '/comment/index',
- children: [{
- path: 'index',
- name: '评论审核',
- meta: {
- i18n: 'comment'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/comment/comment')
- }]
- }, {
- path: '/article',
- component: Layout,
- peixun: true,
- redirect: '/article/index',
- children: [{
- path: 'index',
- name: '资讯管理',
- meta: {
- i18n: 'article'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/article/article')
- }]
- }, {
- path: '/feedbackReport',
- component: Layout,
- redirect: '/feedbackReport/index',
- children: [{
- path: 'index',
- name: '事件上报',
- meta: {
- i18n: 'feedbackReport'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/feedbackReport/feedbackReport')
- }]
- },
- {
- path: '/chatgroup',
- component: Layout,
- redirect: 'chatgroup',
- children: [{
- path: 'index',
- name: '群管理',
- meta: {
- i18n: 'chatgroup'
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/chatrg/chatgroup')
- }]
- },
- {
- path: '/alarm',
- component: Layout,
- redirect: '/alarm/alarmPage',
- children: [{
- path: 'alarmPage',
- name: '实时警情',
- meta: {
- i18n: 'alarm'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/alarm/alarm')
- }]
- }, {
- path: '/parcel',
- component: Layout,
- redirect: '/parcel/index',
- children: [{
- path: 'index',
- name: '安检包裹',
- meta: {
- i18n: 'parcel'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/parcel/parcel')
- }]
- }, {
- path: '/parcelKind',
- component: Layout,
- redirect: '/parcelKind/index',
- children: [{
- path: 'index',
- name: '违禁品',
- meta: {
- i18n: 'parcelKind'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/parcel/parcelKind')
- }]
- }, {
- path: '/dataL',
- component: Layout,
- redirect: '/dataL/dataL',
- children: [{
- path: 'dataL',
- name: '详情页',
- meta: {
- i18n: 'dataL'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/dataL/dataL')
- }]
- }, { //路由占位
- path: '/dataL',
- redirect: '/dataL/hFive',
- component: Layout,
- children: [{
- path: 'hFive',
- name: '提交激活路口',
- meta: {
- i18n: 'dataL'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/dataL/hFive')
- }]
- },
- {
- path: '/patrolManagement',
- redirect: '/policeInformationDistribution/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '巡逻管理',
- meta: {
- i18n: 'policeInformationDistribution'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/policeInformationDistribution/patrolManagement')
- }]
- }, {
- path: '/security',
- redirect: '/security/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '保安管理',
- meta: {
- i18n: 'policeInformationDistribution'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/security/security')
- }]
- }, {
- path: '/report',
- redirect: '/report/reportConfiguration',
- component: Layout,
- children: [{
- path: 'reportConfiguration',
- name: '报表配置',
- meta: {
- i18n: 'report'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/report/reportConfiguration')
- }]
- }, {
- path: '/report',
- redirect: '/report/announcementReport',
- component: Layout,
- children: [{
- path: 'announcementReport',
- name: '公告报表',
- meta: {
- i18n: 'report'
- },
- component: () =>
- import ( /* webpackChunkName: "views" */ '@/views/report/announcementReport')
- }]
- },
- {
- path: '/real-popup',
- redirect: '/real-popup/kongbai',
- component: Layout,
- children: [{
- path: 'kongbai',
- name: '首页',
- meta: {
- i18n: 'report'
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/components/real-popup/kongbai')
- }]
- },
- {
- path: '/role',
- redirect: '/role/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '权限管理',
- meta: {
- i18n: 'index'
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/authority/role')
- }]
- },
- {
- path: '/zc',
- redirect: '/zc/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '注册审核',
- meta: {
- i18n: 'index'
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/zc/zc')
- }]
- }
+ path: 'index',
+ name: '设备管理',
+ meta: {
+ i18n: 'clientManagement'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/clientManagement/clientManagement')
+ }]
+},
+{
+ path: '/suser',
+ component: Layout,
+ redirect: '/suser',
+ children: [{
+ path: 'index',
+ name: '业主管理',
+ meta: {
+ i18n: 'suser'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/system/cs')
+ }]
+}, {
+ path: '/policeTracking',
+ component: Layout,
+ redirect: '/policeTracking/track',
+ children: [{
+ path: 'track',
+ name: '任务追踪',
+ meta: {
+ i18n: 'track'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/policeTracking/policeTracking')
+ }]
+}, {
+ path: '/healthcode',
+ component: Layout,
+ redirect: '/healthcode/healthcodePage',
+ children: [{
+ path: 'healthcodePage',
+ name: '健康码',
+ meta: {
+ i18n: 'healthcode'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/healthcode/healthcode')
+ }]
+}, {
+ path: '/animalHeat',
+ component: Layout,
+ redirect: '/animalHeat/animalHeatPage',
+ children: [{
+ path: 'animalHeatPage',
+ name: '体温检测',
+ meta: {
+ i18n: 'animalHeat'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/animalHeat/animalHeat')
+ }]
+}, {
+ path: '/comment',
+ component: Layout,
+ peixun: true,
+ redirect: '/comment/index',
+ children: [{
+ path: 'index',
+ name: '评论审核',
+ meta: {
+ i18n: 'comment'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/comment/comment')
+ }]
+}, {
+ path: '/article',
+ component: Layout,
+ peixun: true,
+ redirect: '/article/index',
+ children: [{
+ path: 'index',
+ name: '资讯管理',
+ meta: {
+ i18n: 'article'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/article/article')
+ }]
+}, {
+ path: '/feedbackReport',
+ component: Layout,
+ redirect: '/feedbackReport/index',
+ children: [{
+ path: 'index',
+ name: '事件上报',
+ meta: {
+ i18n: 'feedbackReport'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/feedbackReport/feedbackReport')
+ }]
+},
+{
+ path: '/chatgroup',
+ component: Layout,
+ redirect: 'chatgroup',
+ children: [{
+ path: 'index',
+ name: '群管理',
+ meta: {
+ i18n: 'chatgroup'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/chatrg/chatgroup')
+ }]
+},
+{
+ path: '/alarm',
+ component: Layout,
+ redirect: '/alarm/alarmPage',
+ children: [{
+ path: 'alarmPage',
+ name: '实时警情',
+ meta: {
+ i18n: 'alarm'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/alarm/alarm')
+ }]
+}, {
+ path: '/parcel',
+ component: Layout,
+ redirect: '/parcel/index',
+ children: [{
+ path: 'index',
+ name: '安检包裹',
+ meta: {
+ i18n: 'parcel'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/parcel/parcel')
+ }]
+}, {
+ path: '/parcelKind',
+ component: Layout,
+ redirect: '/parcelKind/index',
+ children: [{
+ path: 'index',
+ name: '违禁品',
+ meta: {
+ i18n: 'parcelKind'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/parcel/parcelKind')
+ }]
+}, {
+ path: '/dataL',
+ component: Layout,
+ redirect: '/dataL/dataL',
+ children: [{
+ path: 'dataL',
+ name: '详情页',
+ meta: {
+ i18n: 'dataL'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/dataL/dataL')
+ }]
+}, { //路由占位
+ path: '/dataL',
+ redirect: '/dataL/hFive',
+ component: Layout,
+ children: [{
+ path: 'hFive',
+ name: '提交激活路口',
+ meta: {
+ i18n: 'dataL'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/dataL/hFive')
+ }]
+},
+{
+ path: '/patrolManagement',
+ redirect: '/policeInformationDistribution/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '巡逻管理',
+ meta: {
+ i18n: 'policeInformationDistribution'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/policeInformationDistribution/patrolManagement')
+ }]
+}, {
+ path: '/security',
+ redirect: '/security/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '保安管理',
+ meta: {
+ i18n: 'policeInformationDistribution'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/security/security')
+ }]
+}, {
+ path: '/report',
+ redirect: '/report/reportConfiguration',
+ component: Layout,
+ children: [{
+ path: 'reportConfiguration',
+ name: '报表配置',
+ meta: {
+ i18n: 'report'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/report/reportConfiguration')
+ }]
+}, {
+ path: '/report',
+ redirect: '/report/announcementReport',
+ component: Layout,
+ children: [{
+ path: 'announcementReport',
+ name: '公告报表',
+ meta: {
+ i18n: 'report'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/report/announcementReport')
+ }]
+},
+{
+ path: '/real-popup',
+ redirect: '/real-popup/kongbai',
+ component: Layout,
+ children: [{
+ path: 'kongbai',
+ name: '首页',
+ meta: {
+ i18n: 'report'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/components/real-popup/kongbai')
+ }]
+},
+{
+ path: '/role',
+ redirect: '/role/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '权限管理',
+ meta: {
+ i18n: 'index'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/authority/role')
+ }]
+},
+{
+ path: '/zc',
+ redirect: '/zc/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '注册审核',
+ meta: {
+ i18n: 'index'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/zc/zc')
+ }]
+}
+ , {
+ path: '/activitys',
+ component: Layout,
+ redirect: '/activitys/index',
+ children: [{
+ path: 'index',
+ name: '活动下发',
+ meta: {
+ i18n: 'real'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/activitys/real')
+ }]
+},
]
diff --git a/src/store/getters.js b/src/store/getters.js
index 4d948c4..d1191ff 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -27,5 +27,7 @@
logsFlag: (state, getters) => getters.logsLen === 0,
flowRoutes: state => state.dict.flowRoutes,
dataLa: state => state.dataL.dataLa,
+
+ rotesData: state => state.dict.rotesData,//地图画线数据
}
export default getters
diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js
index 837dbe6..afbbdae 100644
--- a/src/store/modules/dict.js
+++ b/src/store/modules/dict.js
@@ -1,15 +1,16 @@
-import {getStore, setStore} from '@/util/store'
+import { getStore, setStore } from '@/util/store'
-import {getDictionary} from '@/api/system/dict'
+import { getDictionary } from '@/api/system/dict'
const dict = {
state: {
- flowRoutes: getStore({name: 'flowRoutes'}) || {},
+ flowRoutes: getStore({ name: 'flowRoutes' }) || {},
+ rotesData: false,
},
actions: {
- FlowRoutes({commit}) {
+ FlowRoutes({ commit }) {
return new Promise((resolve, reject) => {
- getDictionary({code: 'flow'}).then(res => {
+ getDictionary({ code: 'flow' }).then(res => {
commit('SET_FLOW_ROUTES', res.data.data);
resolve();
}).catch(error => {
@@ -17,6 +18,7 @@
})
})
},
+
},
mutations: {
SET_FLOW_ROUTES: (state, data) => {
@@ -26,8 +28,11 @@
routeValue: item.remark,
};
});
- setStore({name: 'flowRoutes', content: state.flowRoutes})
+ setStore({ name: 'flowRoutes', content: state.flowRoutes })
},
+ setRotesData(state, data) {
+ state.rotesData = data;
+ }
}
};
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index 1ea4d1e..703e87d 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -435,3 +435,16 @@
.el-message-box__title {
color: #fff !important;
}
+
+//时间选择器颜色
+.el-date-picker__header-label {
+ color: #fff !important;
+}
+
+.el-time-spinner__item {
+ color: rgb(197, 197, 197) !important;
+}
+
+.el-time-spinner__item.active:not(.disabled) {
+ color: #fff !important;
+}
diff --git a/src/views/activitys/activitys.vue b/src/views/activitys/activitys.vue
new file mode 100644
index 0000000..2f2fb6c
--- /dev/null
+++ b/src/views/activitys/activitys.vue
@@ -0,0 +1,652 @@
+<template>
+ <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"
+ :row-style="rowStyle"
+ row-class-name="tabFontSize"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <template slot-scope="{ row }" slot="jtype">
+ <el-tag>{{
+ row.jtype == "0" ? "未处理" : row.jtype == "1" ? "处理中" : "已处理"
+ }}</el-tag>
+ </template>
+
+ <template slot-scope="{ row }" slot="cid">
+ <el-tag
+ >{{
+ row.cid == "1" ? "事件发生" : row.cid == "3" ? "是" : "事件恢复"
+ }}
+ </el-tag>
+ </template>
+
+ <template slot-scope="{ type, size, row }" slot="menu">
+ <el-button
+ icon="el-icon-video-camera-solid"
+ :size="size"
+ :type="type"
+ @click.stop="handleStart(row)"
+ >实时视频
+ </el-button>
+ <el-button
+ icon="el-icon-video-camera-solid"
+ :size="size"
+ :type="type"
+ @click.stop="oldStartVideo(row)"
+ >查看历史
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-drawer
+ title="我是标题"
+ append-to-body="true"
+ :visible.sync="qwe"
+ :direction="direction"
+ >
+ <iframe
+ src="http://www.baidu.com"
+ frameborder="0"
+ width="100%"
+ height="600px"
+ ></iframe>
+ </el-drawer>
+
+ <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>
+ </basic-container>
+</template>
+
+<script>
+import { getList, remove, update, add, getclient } from "@/api/real/real";
+import { mapGetters } from "vuex";
+
+export default {
+ data() {
+ return {
+ qwe: false,
+ direction: "rtl",
+ form: {},
+ query: {},
+ dateTime: [],
+ historyId: this.$route.params.historyId,
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ selectionList: [],
+ option: {
+ height: "auto",
+ indexLabel: "序号",
+ calcHeight: 54,
+ menuWidth: 240,
+ size: "mini",
+ border: false,
+ //stripe:true,
+ labelWidth: "100",
+ dialogWidth: 950,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 3,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "警情类型",
+ prop: "waringType",
+ search: false,
+ searchSpan: 3,
+ width: 130,
+ className: "waringTypeClass",
+ searchPlaceholder: "请选择",
+ type: "select",
+ props: {
+ label: "dictValue",
+ value: "dictValue",
+ },
+ //cascaderItem: ["city", "district"],
+ dicUrl:
+ "/api/blade-system/dict-biz/child-list?parentId=1356523651644043266",
+ },
+ {
+ label: "报警时间",
+ type: "datetime",
+ width: 160,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ prop: "alarmTime",
+ },
+ {
+ label: "报警时间",
+ prop: "releaseTimeRange",
+ type: "datetime",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ searchRange: true,
+ searchSpan: 5,
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ search: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "报警内容",
+ prop: "content",
+ },
+ {
+ label: "报警人",
+ prop: "galarmPeople",
+ },
+ {
+ label: "联系电话",
+ prop: "phoneNumber",
+ width: 130,
+ },
+ {
+ label: "事发地址",
+ width: 200,
+ prop: "place",
+ },
+ {
+ label: "设备编号",
+ width: 130,
+ addDisabled: true,
+ prop: "deviceNumber",
+ value: this.historyId,
+ },
+ {
+ label: "警情状态",
+ search: true,
+ searchSpan: 3,
+ slot: true,
+ searchPlaceholder: "",
+ prop: "jtype",
+ type: "select",
+ dicData: [
+ {
+ label: "未处理",
+ value: "0",
+ },
+ {
+ label: "处理中",
+ value: "1",
+ },
+ {
+ label: "已处理",
+ value: "2",
+ },
+ ],
+ },
+ {
+ label: "行政区",
+ prop: "province",
+ placeholder: "行政区",
+ type: "select",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ cascaderItem: ["city", "district"],
+ dicUrl: "/api/blade-system/region/select",
+ span: 6,
+ className: "cityClass1",
+ hide: true,
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "地市",
+ prop: "city",
+ type: "select",
+ searchPlaceholder: "地市",
+ placeholder: "地市",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 3,
+ labelWidth: "0",
+ className: "cityClass2",
+ hide: true,
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "区县",
+ searchSpan: 2,
+ searchLabelWidth: 1,
+ searchPlaceholder: "区县",
+ placeholder: "区县",
+ prop: "district",
+ type: "select",
+ props: {
+ label: "name",
+ value: "code",
+ },
+ dicUrl: "/api/blade-system/region/select?code={{key}}",
+ span: 3,
+ labelWidth: "0",
+ className: "cityClass3",
+ hide: true,
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "警情状态",
+ searchSpan: 3,
+ prop: "cid",
+ width: 100,
+ hide: true,
+ slot: true,
+ type: "select",
+ dicData: [
+ {
+ label: "事件发生",
+ value: "1",
+ },
+ {
+ label: "事件恢复",
+ value: "3",
+ },
+ ],
+ },
+ {
+ label: "接警人",
+ prop: "alarmPeople",
+ },
+ {
+ label: "接警时间",
+ type: "datetime",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ width: 160,
+ prop: "jjTime",
+ },
+ ],
+ },
+ data: [],
+ oldVideoSatart: false,
+ vaddress: null,
+ };
+ },
+ computed: {
+ ...mapGetters(["permission", "flowRoutes"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(null, false),
+ viewBtn: this.vaildData(this.permission.real_view, false),
+ delBtn: this.vaildData(null, false),
+ editBtn: this.vaildData(null, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ created() {
+ this.dateTime = this.getDate();
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ add(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ row.coordinate = "";
+ 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)) {
+ getclient(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 = {}) {
+ params.deviceNumber = this.historyId;
+ const { releaseTimeRange } = this.query;
+ let values = {
+ ...params,
+ };
+ if (releaseTimeRange) {
+ values = {
+ ...params,
+ beginTime: releaseTimeRange[0],
+ endTime: releaseTimeRange[1],
+ ...this.query,
+ };
+ values.releaseTimeRange = null;
+ }
+ this.loading = true;
+ getList(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ data.records.forEach((item) =>
+ item.waringType == "紧急求救" ? (item.waringType = "一键求助") : ""
+ );
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
+ 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();
+
+ return {
+ 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",
+ },
+ };
+ },
+ getBZdata() {
+ var params = {
+ beginTime: this.dateTime.week.beginTime,
+ endTime: this.dateTime.week.endTime,
+ };
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ getBYdata() {
+ var params = {
+ beginTime: this.dateTime.month.beginTime,
+ endTime: this.dateTime.month.endTime,
+ };
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ getQBdata() {
+ var params = {};
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ rowStyle({ row, column, rowIndex }) {
+ if (row.jtype == "0") {
+ return {
+ color: "#ff2727",
+ };
+ } else if (row.jtype == "1") {
+ return {
+ color: "#15a2fe",
+ };
+ } else {
+ return {
+ color: "#000000",
+ };
+ }
+ },
+ handleStart(row) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "视频") {
+ arr.push(item);
+ }
+ });
+ this.$store.state.tags.tagList = arr;
+ this.$router.push({
+ path: `/real/video/`,
+ query: row,
+ });
+ },
+ handleAdd11() {
+ this.qwe = true;
+ },
+ oldStartVideo(row) {
+ this.vaddress = row.vaddress;
+ this.oldVideoSatart = true;
+ },
+ },
+};
+</script>
+
+<style>
+.old-video-dialog-box {
+ position: absolute !important;
+ top: 0px !important;
+ left: 0px !important;
+ right: 0px !important;
+ bottom: 0px !important;
+ margin: auto !important;
+ width: 720px !important;
+ z-index: 2200 !important;
+}
+
+.old-video-dialog-box .el-dialog {
+ position: absolute !important;
+ top: 0 !important;
+ left: 0 !important;
+ right: 0 !important;
+ bottom: 0 !important;
+ margin: auto !important;
+ height: 558px;
+ border-radius: 10px 10px 10px 10px;
+}
+
+.old-video-dialog-box .el-dialog .el-dialog__header {
+ padding-top: 10px;
+}
+
+.old-video-dialog-box .el-dialog .el-dialog__body {
+ padding: 10px !important;
+ height: calc(100% - 44px);
+ box-sizing: border-box;
+}
+
+.tabFontSize {
+ font-size: 15px;
+}
+</style>
diff --git a/src/views/activitys/real.vue b/src/views/activitys/real.vue
new file mode 100644
index 0000000..75e30ca
--- /dev/null
+++ b/src/views/activitys/real.vue
@@ -0,0 +1,1506 @@
+<template>
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :table-loading="loading"
+ :before-open="beforeOpen"
+ :data="data"
+ :page.sync="page"
+ ref="crud"
+ @row-del="rowDel"
+ v-model="form"
+ :permission="permissionList"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ :row-style="rowStyle"
+ :search.sync="search"
+ row-class-name="tabFontSize"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ @row-click="rowClick"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ v-show="true"
+ size="mini"
+ icon="el-icon-delete"
+ plain
+ v-if="permission.real_delete"
+ @click="handleDelete"
+ >删 除
+ </el-button>
+ </template>
+
+ <template slot="menuLeft">
+ <el-button
+ v-bind:class="activeClass == 0 ? 'btn-color' : ''"
+ size="mini"
+ @click="getBRdata(0)"
+ >本日
+ </el-button>
+ <el-button
+ v-bind:class="activeClass == 1 ? 'btn-color' : ''"
+ size="mini"
+ @click="getBRdata(1)"
+ >本周
+ </el-button>
+ <el-button
+ v-bind:class="activeClass == 2 ? 'btn-color' : ''"
+ size="mini"
+ @click="getBRdata(2)"
+ >本月
+ </el-button>
+ <el-button
+ v-bind:class="activeClass == 3 ? 'btn-color' : ''"
+ size="mini"
+ @click="getQBdata(3)"
+ >全部
+ </el-button>
+ </template>
+
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="mini"
+ plain
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ <el-button
+ type="warning"
+ size="mini"
+ plain
+ icon="el-icon-pie-chart"
+ @click="handleExportStatis"
+ >导出报表
+ </el-button>
+ </template>
+
+ <template slot-scope="{ row }" slot="jtype">
+ <el-tag
+ >{{
+ row.jtype == "0" || row.jtype == ""
+ ? "未派发"
+ : row.jtype == "1" &&
+ (row.securityId == null || row.securityId == "")
+ ? "未接收"
+ : row.jtype == "1" &&
+ (row.securityId != null || row.securityId != "")
+ ? "已接收"
+ : "已处置"
+ }}
+ </el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="cid">
+ <el-tag
+ >{{
+ row.cid == "1" ? "事件发生" : row.cid == "3" ? "是" : "事件恢复"
+ }}
+ </el-tag>
+ </template>
+
+ <template slot-scope="{ type, size, row }" slot="menu">
+ <el-button
+ v-if="row.jtype == 0 || row.jtype == 0 || row.jtype == ''"
+ icon="el-icon-s-order"
+ :size="size"
+ :type="type"
+ @click.stop="PoliceTracking(row)"
+ >派发
+ </el-button>
+ </template>
+
+ <template slot-scope="{ type, disabled }" slot="lineForm">
+ <div class="mapClassMain" style="width: 860px; height: 400px">
+ <Map ref="modalForm" />
+ </div>
+ </template>
+ </avue-crud>
+
+ <real-popup ref="realPopupView"></real-popup>
+ <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
+ <iframe
+ id="mapDiv"
+ ref="mapDiv"
+ src="/map/index.html?openid=ClientManagement&ISinit=1"
+ frameborder="0"
+ width="100%"
+ height="100%"
+ ></iframe>
+ </el-drawer>
+ </basic-container>
+</template>
+
+<script>
+import {
+ getList,
+ remove,
+ update,
+ add,
+ getclient,
+} from "@/api/activitys/activitys";
+import { mapGetters } from "vuex";
+import AvueMap from "avue-plugin-map";
+
+export default {
+ data() {
+ return {
+ showMap: false,
+ hls: "",
+ videoSource: "",
+ activeClass: 3,
+ form: {},
+ query: {},
+ search: {},
+ dateTime: [],
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ selectionList: [],
+ option: {
+ height: "auto",
+ indexLabel: "序号",
+ calcHeight: 54,
+ labelWidth: "100",
+ size: "mini",
+ border: false,
+ //stripe:true,
+ menuWidth: 260,
+ dialogWidth: 950,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 3,
+ align: "center",
+ index: true,
+ viewBtn: true,
+ selection: true,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "任务标题",
+ prop: "rname",
+ search: false,
+ searchSpan: 3,
+ span: 12,
+ rules: [
+ {
+ required: true,
+ message: "请选择报警时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "任务封面",
+ prop: "url",
+ // align:'center',
+ width: 80,
+ type: "upload",
+ listType: "picture-img",
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ url: "link",
+ },
+ // hide: true,
+ span: 12,
+ },
+ {
+ label: "下发时间",
+ type: "datetime",
+ prop: "time",
+ width: 160,
+ span: 12,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ rules: [
+ {
+ required: true,
+ message: "请选择报警时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ // {
+ // label: "报警时间",
+ // prop: "releaseTimeRange",
+ // type: "datetime",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // searchValue: [this.getStartTime(), this.getEndTime()],
+ // searchRange: true,
+ // searchSpan: 5,
+ // hide: true,
+ // addDisplay: false,
+ // editDisplay: false,
+ // viewDisplay: false,
+ // search: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入时间",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "任务内容",
+ prop: "content",
+ span: 24,
+ },
+ // {
+ // label: "地址",
+ // prop: "place",
+ // span: 10,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择地址",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ // {
+ // label: null,
+ // prop: "map",
+ // labelWidth: "0",
+ // searchSpan: 0,
+ // maxlength: 0,
+ // hide: true,
+ // span: 2,
+ // // display:false,
+ // component: "AvueMap",
+ // },
+ // {
+ // label: "经度",
+ // hide: true,
+ // prop: "jd",
+ // searchSpan: 2,
+ // width: "100",
+ // labelWidth: "120",
+ // formatter: (row, value, label, column) => {
+ // return (value = value.substring(0, 11));
+ // },
+ // span: 7,
+ // },
+ // {
+ // label: "纬度",
+ // labelWidth: "45",
+ // hide: true,
+ // prop: "wd",
+ // formatter: (row, value, label, column) => {
+ // return (value = value.substring(0, 10));
+ // },
+ // span: 5,
+ // },
+ {
+ label: "省份",
+ prop: "province",
+ search: true,
+ width: 100,
+ searchSpan: 2,
+ searchLabelWidth: 45,
+ placeholder: "省份",
+ type: "select",
+ value: "36",
+ 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: 100,
+ searchPlaceholder: "地市",
+ placeholder: "地市",
+ searchLabelWidth: 1,
+ value: "3601",
+ 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: 100,
+ 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: "任务状态",
+ prop: "rtype",
+ type: "select",
+ span: 6,
+ value: "0",
+ dicData: [
+ {
+ label: "任务开始",
+ value: "0",
+ },
+ {
+ label: "正在进行",
+ value: "1",
+ },
+ {
+ label: "任务结束",
+ value: "2",
+ },
+ ],
+ // label: "任务状态",
+ // searchSpan: 3,
+ // width: 96,
+ // search: true,
+ // slot: true,
+ // value: "0",
+ // searchPlaceholder: "请选择",
+ // prop: "rtype",
+ // type: "select",
+ // dicData: [
+ // {
+ // label: "任务开始",
+ // value: "0",
+ // },
+ // {
+ // label: "正在进行",
+ // value: "1",
+ // },
+ // {
+ // label: "任务结束",
+ // value: "2",
+ // },
+ // ],
+ },
+ // {
+ // label: "派发人",
+ // prop: "alarmPeople",
+ // width: 90,
+ // addDisplay: false,
+ // editDisplay: false,
+ // },
+ {
+ label: "积分数值",
+ prop: "integral",
+ type: "number",
+ // multiple: true,
+ // dicUrl: "/api/catalogs/catalogs/getBigTree",
+ // props: {
+ // label: "title",
+ // },
+ span: 6,
+ width: 72,
+ // hide: true,
+ minRows: 1,
+ value: 1,
+ // leafOnly: "",
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "接收人数",
+ prop: "jnum",
+ type: "number",
+ // multiple: true,
+ // dicUrl: "/api/catalogs/catalogs/getBigTree",
+ // props: {
+ // label: "title",
+ // },
+ width: 72,
+ // hide: true,
+ minRows: 1,
+ value: 1,
+ // leafOnly: "",
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: true,
+ },
+ // {
+ // label: "巡逻路线",
+ // prop: "xllx",
+ // hide: true,
+ // display: true,
+ // type: "tree",
+ // dicUrl: "/api/routeIn/routein/tree",
+ // props: {
+ // label: "title",
+ // },
+ // addDisplay: true,
+ // },
+ {
+ label: "请在下方地图中,建立路径!",
+ labelWidth: "0",
+ className: "mapClass",
+ prop: "haveMap",
+ hide: true,
+ display: true,
+ rules: [
+ {
+ required: true,
+ message: "请在下方地图中,建立路径!",
+ trigger: "blur",
+ },
+ ],
+ addDisabled: true,
+ editDisabled: true,
+ // value: "", //赋值不上去,舍弃
+ // type: "tree",
+ // dicUrl: "/api/routeIn/routein/tree",
+ // props: {
+ // label: "title",
+ // },
+ },
+ {
+ label: "路线展示",
+ labelWidth: "0",
+ prop: "line",
+ className: "mapClass",
+ hide: true,
+ display: true,
+ span: 24,
+ formslot: true,
+ addDisplay: true,
+ },
+ ],
+ },
+ data: [],
+ recorder: null,
+ peopleList: [],
+ // rotesData: "",
+ };
+ },
+ watch: {
+ "form.map": {
+ // form是表单或者表格绑定的数据集,v-model='form'
+ handler(val) {
+ var that = this;
+ if (val) {
+ //重新加载一次页面详情数据,解决新的省市区无法写入问题
+ //判断是新增还是修改
+ if (that.isEdit) {
+ getclient(this.form.id).then((res) => {
+ // that.province = res.data.data.province;
+ // that.city = res.data.data.city;
+ // that.district = res.data.data.district;
+ });
+ }
+
+ //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
+ if (val.formattedAddress == "") {
+ return;
+ }
+
+ //经纬度替换
+ this.form.wd = val.latitude;
+ this.form.jd = val.longitude;
+
+ var address = val.formattedAddress.toString();
+ if (address.search("县") != -1) {
+ this.form.place = address.substring(
+ address.indexOf("县") + 1,
+ address.length
+ );
+ }
+ if (address.search("区") != -1) {
+ this.form.place = address.substring(
+ address.indexOf("区") + 1,
+ address.length
+ );
+ }
+ //写入新的省市区
+ that.form.province = val.addressComponent.province;
+ if (val.addressComponent.city == "") {
+ that.form.city = val.addressComponent.province;
+ } else {
+ that.form.city = val.addressComponent.city;
+ }
+ that.form.district = val.addressComponent.district;
+ } else {
+ that.form.map = {
+ formattedAddress: "",
+ latitude: 28.699957,
+ longitude: 115.862118,
+ };
+ }
+ },
+ immediate: true,
+ },
+ // "form.alarmType": {
+ // handler(val) {
+ // // var xllx = this.findObject(this.option.column, "xllx");
+ // var xllxzs = this.findObject(this.option.column, "xllxzs");
+ // if (val === "巡逻任务") {
+ // // xllx.display = true;
+ // xllxzs.display = true;
+ // // xllx.rules = [
+ // // {
+ // // required: true,
+ // // message: "请选择巡逻路线",
+ // // trigger: "blur",
+ // // },
+ // // ];
+ // } else {
+ // // xllx.display = false;
+ // xllxzs.display = false;
+ // // xllx.rules = [];
+ // }
+ // },
+ // immediate: true,
+ // },
+ "form.line": {
+ handler(val) {
+ if (val) {
+ this.getxllx(val);
+ }
+ },
+ immediate: true,
+ },
+ rotesData() {
+ // console.log(this.rotesData, "rotesDatarotesDatarotesData");
+ if (this.rotesData) {
+ // var haveMap = (this.option.column[9].value = "已选择路径!");
+ // haveMap.value = "已选择路径!";
+ // console.log(haveMap);
+ this.form["line"] = this.rotesData;
+ this.form["haveMap"] = "已绘制路径!";
+ } else {
+ this.form["line"] = "";
+ this.form["haveMap"] = "";
+ }
+ },
+ },
+ computed: {
+ ...mapGetters(["permission", "flowRoutes", "rotesData"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.real_add, false),
+ viewBtn: this.vaildData(null, false),
+ delBtn: this.vaildData(this.permission.real_delete, false),
+ editBtn: this.vaildData(this.permission.real_edit, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ created() {
+ this.dateTime = this.getDate();
+ },
+ mounted() {
+ var xb = JSON.parse(window.sessionStorage.getItem("sjsb"));
+ var data = this.$route.query;
+ if (xb == 1) {
+ this.form = data;
+ this.openAdd();
+ window.sessionStorage.removeItem("sjsb");
+ }
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ // console.log(row);
+ // return;
+ let d = {
+ line: row.line, //路线
+ rname: row.rname, //标题
+ url: row.url, //封面
+ time: row.time, //下发时间
+ province: row.$province, //省
+ city: row.$city, //城市
+ district: row.$district, //区县
+ jnum: row.jnum, //接收总数
+ integral: row.integral + "", //积分
+ content: row.content, //内容
+ rtype: row.rtype, //任务状态
+ };
+ console.log(d);
+ // done();
+ // return;
+ add(d).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ }
+ );
+ return;
+ // console.log(row, "rowrowrowrowrow");
+ // console.log(this.rotesData, "rowrowrowrowrow");
+ // if (!this.rotesData) {
+ // this.$message({
+ // message: "未绘制地图路径,请重试",
+ // type: "warning",
+ // });
+ // done();
+ // return;
+ // }
+ // done();
+ //结束后 需要把vuex中路径清除
+ // that.$store.commit("setRotesData", false);
+ // return;
+ if (typeof row.securityArr != "string") {
+ var security = "";
+ row.securityArr.forEach((item) => {
+ security = security + item + ",";
+ });
+ row.securityArr = security.substring(0, security.length - 1);
+ }
+ var userId = JSON.parse(
+ window.localStorage.getItem("群防群控后台管理系统-userInfo")
+ ).content.nick_name;
+
+ if (row.jtype != "2") {
+ if (row.securityArr == "" || row.securityArr == null) {
+ row.jtype = "0";
+ row.alarmPeople = "";
+ } else {
+ row.jtype = "1";
+ //已派发保安
+ }
+ }
+ row.alarmPeople = userId;
+
+ add(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ }
+ );
+ },
+ getxllx(val) {
+ var that = this;
+ if (this.$refs.modalForm == undefined) {
+ setTimeout(function () {
+ that.$refs.modalForm.addLinesDraw(val);
+ }, 1500);
+ } else {
+ that.$refs.modalForm.addLinesDraw(val);
+ }
+ },
+ rowUpdate(row, index, done, loading) {
+ // var userId = JSON.parse(
+ // window.localStorage.getItem("群防群控后台管理系统-userInfo")
+ // ).content.nick_name;
+ // if (typeof row.securityArr != "string") {
+ // var security = "";
+ // row.securityArr.forEach((item) => {
+ // security = security + item + ",";
+ // });
+ // row.securityArr = security.substring(0, security.length - 1);
+ // }
+ // if (row.jtype != "2") {
+ // if (row.securityArr == "" || row.securityArr == null) {
+ // row.jtype = "0";
+ // row.alarmPeople = "";
+ // } else {
+ // row.jtype = "1";
+ // //已派发保安
+ // }
+ // }
+ // row.alarmPeople = userId;
+ // row.coordinate = "";
+ // console.log(row);
+ // row.province = row.$province; //省
+ // row.city = row.$city; //城市
+ // row.district = row.$district; //区县
+ // return;
+ update(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (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.activeClass = 3;
+ //清空搜索框中的内容
+ this.query = {};
+ //清空this.$route.query
+ this.$router.push({ query: {} });
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ //清空this.$route.query
+ this.$router.push({ query: {} });
+ 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) {
+ // console.log(type);
+ // if (["edit", "view"].includes(type)) {
+ // getclient(this.form.id).then((res) => {
+ // this.form = res.data.data;
+ // });
+ // }
+ // console.log(this.form);
+ if (this.form.line != "" && this.form != undefined) {
+ this.form["haveMap"] = "已绘制路径!";
+ } else {
+ this.form["haveMap"] = "";
+ }
+ 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 (
+ // this.$route.query.waringType &&
+ // this.$route.query != undefined &&
+ // this.$route.query != null &&
+ // this.$route.query != ""
+ // ) {
+ // if (
+ // this.$route.query.status != undefined &&
+ // this.$route.query.status != null &&
+ // this.$route.query.status == ""
+ // ) {
+ // this.activeClass = this.$route.query.status;
+ // this.page.currentPage = 1;
+ // if (this.$route.query.status == 0) {
+ // params = {
+ // waringType: this.$route.query.waringType,
+ // beginTime: this.dateTime.day.beginTime,
+ // endTime: this.dateTime.day.endTime,
+ // };
+ // } else if (this.$route.query.status == 1) {
+ // params = {
+ // waringType: this.$route.query.waringType,
+ // beginTime: this.dateTime.week.beginTime,
+ // endTime: this.dateTime.week.endTime,
+ // };
+ // } else if (this.$route.query.status == 2) {
+ // params = {
+ // waringType: this.$route.query.waringType,
+ // beginTime: this.dateTime.month.beginTime,
+ // endTime: this.dateTime.month.endTime,
+ // };
+ // }
+ // } else {
+ // this.activeClass = 0;
+ // this.page.currentPage = 1;
+ // params = {
+ // waringType: this.$route.query.waringType,
+ // beginTime: this.dateTime.day.beginTime,
+ // endTime: this.dateTime.day.endTime,
+ // };
+ // }
+
+ // if (
+ // this.$route.query.startTime != undefined &&
+ // this.$route.query.startTime != null &&
+ // this.$route.query.startTime != ""
+ // ) {
+ // params = {
+ // waringType: this.$route.query.waringType,
+ // beginTime: this.$route.query.startTime,
+ // endTime: this.$route.query.endTime,
+ // };
+ // }
+ // }
+ // if (releaseTimeRange) {
+ // values = {
+ // ...params,
+ // beginTime: releaseTimeRange[0],
+ // endTime: releaseTimeRange[1],
+ // ...this.query,
+ // };
+ // values.releaseTimeRange = null;
+ // } else {
+ // values = {
+ // ...params,
+ // ...this.query,
+ // };
+ // }
+
+ // if (this.$route.query.timeDesc) {
+ // values = {
+ // ...params,
+ // timeDesc: this.$route.query.timeDesc,
+ // ...this.query,
+ // };
+ // }
+
+ // this.loading = true;
+ getList(page.currentPage, page.pageSize).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+
+ data.records.sort((a, b) => {
+ return a.jtype - b.jtype;
+ });
+
+ this.data = data.records;
+
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
+ 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,
+ };
+ },
+ getBRdata(e) {
+ this.activeClass = e;
+ this.query = {};
+ this.$router.push({ query: {} });
+ var today = new Date();
+ var params = {};
+
+ if (e == 0) {
+ params = {
+ beginTime: this.showToDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.releaseTimeRange = [
+ this.showToDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ if (e == 1) {
+ params = {
+ beginTime: this.showWeekFirstDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.releaseTimeRange = [
+ this.showWeekFirstDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ if (e == 2) {
+ params = {
+ beginTime: this.showMonthFirstDay(today) + " 00:00:00",
+ endTime: this.showToDay(today) + " 23:59:59",
+ };
+ //修改搜索框中的值
+ this.search.releaseTimeRange = [
+ this.showMonthFirstDay(today) + " 00:00:00",
+ this.showToDay(today) + " 23:59:59",
+ ];
+ }
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ //本日
+ showToDay(Nowdate) {
+ var M = Number(Nowdate.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ var day = Nowdate.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return Nowdate.getFullYear() + "-" + M + "-" + day;
+ },
+
+ //本周第一天
+ showWeekFirstDay(Nowdate) {
+ var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay() - 1) * 86400000);
+ var M = Number(WeekFirstDay.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ var day = WeekFirstDay.getDate();
+ if (day < 10) {
+ day = "0" + day;
+ }
+ return WeekFirstDay.getFullYear() + "-" + M + "-" + day;
+ },
+
+ //本月第一天
+ showMonthFirstDay(Nowdate) {
+ var MonthFirstDay = new Date(
+ Nowdate.getFullYear(),
+ Nowdate.getMonth(),
+ 1
+ );
+ var M = Number(MonthFirstDay.getMonth()) + 1;
+ if (M < 10) {
+ M = "0" + M;
+ }
+ return (
+ MonthFirstDay.getFullYear() +
+ "-" +
+ M +
+ "-" +
+ "0" +
+ MonthFirstDay.getDate()
+ );
+ },
+ getBZdata(e) {
+ this.activeClass = e;
+ var params = {
+ beginTime: this.dateTime.week.beginTime,
+ endTime: this.dateTime.week.endTime,
+ };
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ getBYdata(e) {
+ this.activeClass = e;
+ var params = {
+ beginTime: this.dateTime.month.beginTime,
+ endTime: this.dateTime.month.endTime,
+ };
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ getQBdata(e) {
+ this.search.releaseTimeRange = ["", ""];
+ this.activeClass = e;
+ var params = {};
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ rowStyle({ row, column, rowIndex }) {
+ if (row.jtype == "0") {
+ return {
+ color: "#ff2727",
+ };
+ } else if (row.jtype == "1") {
+ return {
+ color: "#15a2fe",
+ };
+ } else {
+ return {
+ color: "#000000",
+ };
+ }
+ },
+ handleStart(row) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "视频") {
+ arr.push(item);
+ }
+ });
+ this.$store.state.tags.tagList = arr;
+ this.$router.push({
+ path: `/real/video/`,
+ query: row,
+ });
+ },
+ handleHistory(row) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "设备历史") {
+ arr.push(item);
+ }
+ });
+ this.$store.state.tags.tagList = arr;
+ this.$router.push({ path: `/real/history/${row.deviceNumber}` });
+ },
+ handleMap(row) {
+ this.showMap = true;
+ this.$nextTick(() => {
+ this.$refs.mapDiv.onload = () => {
+ window.frames[0].init("ClientManagement", {
+ x: row.jd,
+ y: row.wd,
+ clientID: row.deviceNumber,
+ });
+ };
+ });
+ },
+ 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.$refs.realPopupView.onItemGetParentData(row);
+ },
+
+ beginTimeOrEndTime(time) {
+ var beginTime = new Date(time);
+
+ var endTime = new Date(new Date(time).valueOf() - 1000 * 60 * 60 * 3);
+
+ var beginY = beginTime.getFullYear();
+
+ var beginM =
+ beginTime.getMonth() + 1 < 10
+ ? "0" + (beginTime.getMonth() + 1)
+ : beginTime.getMonth() + 1;
+
+ var beginD =
+ beginTime.getDate() < 10
+ ? "0" + beginTime.getDate()
+ : beginTime.getDate();
+
+ var beginH =
+ beginTime.getHours() < 10
+ ? "0" + beginTime.getHours()
+ : beginTime.getHours();
+
+ var beginm =
+ beginTime.getMinutes() < 10
+ ? "0" + beginTime.getMinutes()
+ : beginTime.getMinutes();
+
+ var begins =
+ beginTime.getSeconds() < 10
+ ? "0" + beginTime.getSeconds()
+ : beginTime.getSeconds();
+
+ var endY = endTime.getFullYear();
+
+ var endM =
+ endTime.getMonth() + 1 < 10
+ ? "0" + (endTime.getMonth() + 1)
+ : endTime.getMonth() + 1;
+
+ var endD =
+ endTime.getDate() < 10 ? "0" + endTime.getDate() : endTime.getDate();
+
+ var endH =
+ endTime.getHours() < 10 ? "0" + endTime.getHours() : endTime.getHours();
+
+ var endm =
+ endTime.getMinutes() < 10
+ ? "0" + endTime.getMinutes()
+ : endTime.getMinutes();
+
+ var ends =
+ endTime.getSeconds() < 10
+ ? "0" + endTime.getSeconds()
+ : endTime.getSeconds();
+ return {
+ begin: beginY + beginM + beginD + beginH + beginm + begins,
+ end: endY + endM + endD + endH + endm + ends,
+ };
+ },
+
+ PoliceTracking(row) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "任务追踪") {
+ arr.push(item);
+ }
+ });
+ this.$store.state.tags.tagList = arr;
+ //警情追踪
+ this.$router.push({ path: "/policeTracking/track", query: row });
+ },
+ //打开新增窗体
+ openAdd() {
+ this.$refs.crud.rowAdd();
+ },
+
+ //数据导出
+ handleExport() {
+ this.$confirm("是否导出实时警情数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(
+ `/api/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() {
+ 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}`);
+ },
+ rowClick(val) {
+ //行点击事件
+ //警情追踪
+ this.PoliceTracking(val);
+ },
+ },
+};
+</script>
+
+<style>
+.el-card__body .waringTypeClass {
+ width: 12%;
+}
+
+.mapClass div label {
+ display: none;
+}
+
+.mapClassMain {
+ padding-left: 25px !important;
+}
+
+.cityreal2 div label,
+.cityreal3 div label {
+ display: none;
+}
+
+/*页面样式*/
+.el-card__body .cityreal1 {
+ width: 150px;
+ padding-right: 0px !important;
+}
+
+.el-card__body .cityreal2 {
+ width: 100px;
+ padding-left: 10px !important;
+ padding-right: 0px !important;
+}
+
+.el-card__body .cityreal3 {
+ width: 100px;
+ padding-left: 10px !important;
+ padding-right: 0px !important;
+}
+
+/*新增窗体样式*/
+.el-dialog .cityreal1 {
+ width: 216px;
+ padding-right: 0px !important;
+}
+
+.el-dialog .cityreal2 {
+ width: 130px;
+ padding-left: 10px !important;
+ padding-right: 10px !important;
+}
+
+.el-dialog .cityreal3 {
+ width: 105px;
+ padding-left: 0px !important;
+ padding-right: 0px !important;
+}
+
+.cityClassParams .avue-form__group.avue-form__group--flex {
+ display: flex;
+ justify-content: space-between;
+}
+
+.cityClassParams .cityClassSelect {
+ flex: 1;
+ margin: 0 !important;
+ padding-left: 0px !important;
+ padding-right: 0px !important;
+}
+
+.cityClassParams .cityClassSelect:nth-child(2) {
+ margin: 0 10px !important;
+}
+
+.cityClassParams .cityClassSelect .el-form-item {
+ margin-bottom: 0px !important;
+}
+
+.cityClassParams .cityClassSelect .el-form-item .el-input__inner {
+ height: 28px !important;
+ line-height: 28px !important;
+}
+
+.cityClass2 div label {
+ display: none;
+}
+
+.cityClass3 div label {
+ display: none;
+}
+
+.old-video-dialog {
+ position: absolute !important;
+ top: 0 !important;
+ left: auto !important;
+ right: 0px !important;
+ bottom: 0 !important;
+ margin: auto !important;
+ height: 100% !important;
+ width: 476px !important;
+}
+
+.old-video-dialog .el-dialog {
+ position: absolute !important;
+ top: 0 !important;
+ left: 0 !important;
+ right: 0 !important;
+ bottom: 0 !important;
+ margin: auto !important;
+ margin-top: 15vh !important;
+ height: 538px;
+}
+
+.old-video-dialog .el-dialog .el-dialog__body {
+ height: calc(100% - 54px);
+ box-sizing: border-box;
+}
+
+.el-button.btn-color {
+ color: rgb(255, 255, 255);
+ background-color: rgb(64, 158, 255);
+ border-color: rgb(64, 158, 255);
+}
+
+.tabFontSize {
+ font-size: 15px;
+}
+</style>
diff --git a/src/views/wel/home.vue b/src/views/wel/home.vue
index eff8227..3c059ab 100644
--- a/src/views/wel/home.vue
+++ b/src/views/wel/home.vue
@@ -13,7 +13,12 @@
</div>
<div id="on_three_yjy">
<div>
- <div v-for="(item, index) in leftUp.slice(0, 3)" :key="index">
+ <div
+ v-for="(item, index) in leftUp.slice(0, 3)"
+ :key="index"
+ class="openUp"
+ @click="openUp(item)"
+ >
<div>
<img :src="item.img" alt="" /><span>{{
item.value
@@ -23,7 +28,12 @@
</div>
</div>
<div>
- <div v-for="(item, index) in leftUp.slice(3, 6)" :key="index">
+ <div
+ v-for="(item, index) in leftUp.slice(3, 6)"
+ :key="index"
+ class="openUp"
+ @click="openUp(item)"
+ >
<div>
<img :src="item.img" alt="" /><span>{{
item.value
@@ -46,12 +56,12 @@
v-for="(o, i) in rainArr"
:key="i"
:class="['rain rain-' + (i += 1)]"
- @click="rainFun(i, o)"
+ @click="rainFun(o.id, o.num)"
>
- {{ o }}<text>g</text>
+ {{ o.num }}<text>g</text>
</div>
</div>
-
+ <!-- {{ during }} -->
<div>
<img
:src="'/img/tree-' + stages + '.png'"
@@ -86,6 +96,15 @@
</el-row>
</div>
</el-card>
+ <el-dialog
+ title="提示"
+ :visible.sync="dialogVisibleOpenUp"
+ width="80%"
+ :modal-append-to-body="false"
+ top="2vh"
+ >
+ <openUp :id="openUpId"></openUp>
+ </el-dialog>
</el-row>
</template>
@@ -93,15 +112,26 @@
import * as echarts from "echarts";
import geojson from "@/geojson/nanchang.json";
-import { getList, getSevenDaty, getLeftUp, getMapData } from "@/api/home/home";
-
+import {
+ getList,
+ getSevenDaty,
+ getLeftUp,
+ getMapData,
+ getRain,
+ getAnergy,
+ getAddtree,
+} from "@/api/home/home";
+import openUp from "./openUp.vue";
export default {
data() {
return {
rainArr: [28, 63, 5, 902, 650, 99, 102, 104, 106, 108, 222, 555],
stages: 1,
treemove: false,
- during: 100, // 阶段阈值 1、小树[100以下](during > votes ) ,2、中树[100及以上 并且小于1000](during <= votes && oldest > votes)
+ during: 1, // 阶段阈值 1、小树[100以下](during > votes ) ,2、中树[100及以上 并且小于1000](during <= votes && oldest > votes)
+ fristD: 100, //中树阶层
+ secondD: 1500, //大树阶层
+ groundtime: 0, //生长延时时间
plussNum: 1, // 加值数量(默认1)
pluss: false, // 水滴值+1动画开关
@@ -113,7 +143,13 @@
leftUp: [],
OurNumLeftUp: "",
+
+ dialogVisibleOpenUp: false, //打开弹窗--群防群控队伍
+ openUpId: "",
};
+ },
+ components: {
+ openUp,
},
created() {},
mounted() {
@@ -125,8 +161,41 @@
// this.createMapJson();
this.getLeftUp(); // 左上角数据
this.getMapDataMethod(); // 左上角数据
+
+ this.getNowRain();
+ this.getNowAnergy();
+ },
+ watch: {
+ during() {
+ // setTimeout(() => {
+ this.plussNum = 1;
+ this.pluss = false;
+ this.wateroff = true;
+ this.watercss = false;
+ this.treemove = false;
+
+ // 小树阶段
+ if (this.during > this.fristD) {
+ this.stages = 1;
+ }
+ // 中树阶段
+ if (this.during < this.secondD && this.during >= this.fristD) {
+ this.stages = 2;
+ }
+ // 大树阶段
+ if (this.during >= this.secondD) {
+ this.stages = 3;
+ }
+ // }, this.groundtime);
+ },
},
methods: {
+ //打开弹窗--群防群控队伍
+ openUp(val) {
+ // console.log(val);
+ this.openUpId = val.id;
+ this.dialogVisibleOpenUp = true;
+ },
getMapDataMethod() {
getMapData().then((res) => {
this.createMapJson(res.data.data);
@@ -152,13 +221,27 @@
: item.region == "警务辅助队伍"
? "/img/jfd.png"
: "";
+ let id =
+ item.region == "治保会队伍"
+ ? "1424615693403414529"
+ : item.region == "内保干部队伍"
+ ? "1424615773594312705"
+ : item.region == "治安巡防队伍"
+ ? "1424615835435130881"
+ : item.region == "信息员队伍"
+ ? "1424615909959524354"
+ : item.region == "保安员队伍"
+ ? "1424615972718895106"
+ : item.region == "警务辅助队伍"
+ ? "1424616047083905026"
+ : "";
this.leftUp.push({
name: item.region,
img: img,
value: item.num,
+ id: id,
});
});
- console.log(d);
});
},
getDataSevenDaty() {
@@ -172,7 +255,7 @@
}
// console.log(d, t);
- console.log(nyt);
+ // console.log(nyt);
that.onTwoEcharts(d, nyt, t);
});
},
@@ -331,7 +414,7 @@
data.push(d[k].num);
datax.push(d[k].region);
}
- console.log(res, 243423);
+ // console.log(res, 243423);
var option = {
tooltip: {
@@ -507,7 +590,7 @@
},
createMapJson(data2) {
- console.log(data2);
+ // console.log(data2);
var ds = {
东湖区: {},
西湖区: {},
@@ -540,7 +623,7 @@
}
}
}
- console.log(ds);
+ // console.log(ds);
var myChart = echarts.init(document.getElementById("draw_yjy"));
//geoCoordMap把所有可能出现的城市加到数组里面
@@ -930,7 +1013,35 @@
myChart.setOption(optionXyMap01);
});
},
-
+ //获取当前漂浮雨量
+ getNowRain() {
+ this.rainArr = [];
+ let d = {
+ type: 1,
+ identification: 1,
+ };
+ getRain(d).then((res) => {
+ const data = res.data.data.records;
+ for (let k in data) {
+ this.rainArr.push({
+ id: +data[k].id,
+ identification: +data[k].identification,
+ num: +data[k].num,
+ });
+ }
+ });
+ },
+ //获取当前树能量
+ getNowAnergy() {
+ let d = {
+ identification: 1,
+ },
+ that = this;
+ getAnergy(d).then((res) => {
+ // console.log(res.data, 2);
+ that.during = res.data.data;
+ });
+ },
// 设置树的大小,恢复动画
setTree(time = 4000) {
setTimeout(() => {
@@ -941,15 +1052,15 @@
this.treemove = false;
// 小树阶段
- if (this.during > 200) {
+ if (this.during > this.fristD) {
this.stages = 1;
}
// 中树阶段
- if (this.during <= 1500 && this.during > 200) {
+ if (this.during <= this.secondD && this.during > this.fristD) {
this.stages = 2;
}
// 大树阶段
- if (this.during > 1500) {
+ if (this.during > this.secondD) {
this.stages = 3;
}
}, time);
@@ -957,16 +1068,32 @@
// 收取雨滴的动画
rainFun(i, o) {
- this.plussNum = o;
+ // this.plussNum = o;
- this.during += this.plussNum;
+ // this.during += this.plussNum;
- this.pluss = true;
- this.treemove = true;
- setTimeout(() => {
- this.rainArr.splice((i -= 1), 1);
- }, 1000);
- this.setTree(2000);
+ // this.pluss = true;
+ // this.treemove = true;
+ // setTimeout(() => {
+ // this.rainArr.splice((i -= 1), 1);
+ // }, 1000);
+ // this.setTree(2000);
+ let d = {
+ id: i, // id
+ identification: 1, //用户
+ num: o, // 值
+ },
+ that = this;
+ getAddtree(d).then((res) => {
+ that.pluss = true;
+ that.treemove = true;
+ setTimeout(() => {
+ that.getNowRain();
+ that.getNowAnergy();
+ }, 1000);
+ // that.groundtime = 3000;
+ // that.setTree(2000);
+ });
},
// 点击树的动画
@@ -1380,4 +1507,9 @@
display: inline;
padding-left: 2px;
}
+
+//群防群控队伍 鼠标放上去成手势
+.openUp {
+ cursor: pointer;
+}
</style>
diff --git a/src/views/wel/openUp.vue b/src/views/wel/openUp.vue
new file mode 100644
index 0000000..56ea740
--- /dev/null
+++ b/src/views/wel/openUp.vue
@@ -0,0 +1,286 @@
+<template>
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :table-loading="loading"
+ :data="data"
+ :page.sync="page"
+ :permission="permissionList"
+ :before-open="beforeOpen"
+ v-model="form"
+ ref="crud"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ @row-del="rowDel"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ </avue-crud>
+ </basic-container>
+</template>
+
+<script>
+import { getOpenup } from "@/api/home/home";
+import { mapGetters } from "vuex";
+
+export default {
+ props: ["id"],
+ watch: {
+ id() {
+ this.searchReset();
+ },
+ },
+ data() {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ selectionList: [],
+ option: {
+ height: "525px",
+ calcHeight: 54,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 4,
+ border: true,
+ index: true,
+ viewBtn: true,
+ menu: false,
+ selection: true,
+ headerAlign: "center",
+ align: "center",
+ dialogClickModal: false,
+ column: [
+ // {
+ // label: "账号",
+ // search: true,
+ // searchSpan: 4,
+ // display: false,
+ // disabled: true,
+ // prop: "account",
+ // },
+ {
+ label: "姓名",
+ display: false,
+ searchSpan: 4,
+ searchLabelWidth: 55,
+ search: true,
+ disabled: true,
+ prop: "realName",
+ },
+ {
+ label: "性别",
+ display: false,
+ searchSpan: 4,
+ // search: true,
+ disabled: true,
+ prop: "sex",
+ type: "select",
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ ],
+ },
+ {
+ label: "身份证",
+ disabled: true,
+ display: false,
+ searchLabelWidth: 70,
+ search: true,
+ prop: "cardid",
+ },
+ {
+ label: "手机号码",
+ disabled: true,
+ display: false,
+ prop: "phone",
+ },
+ {
+ label: "辖区",
+ prop: "jurisdiction",
+ // type: "tree",
+ // dicUrl: "/api/blade-system/dept/selectInfo",
+ // props: {
+ // label: "title",
+ // value: "value"
+ // },
+ },
+ {
+ label: "部门",
+ prop: "deptName",
+ // type: "tree",
+ // dicUrl: "/api/blade-system/dept/selectInfo",
+ // props: {
+ // label: "title",
+ // value: "value"
+ // },
+ },
+ ],
+ },
+ data: [],
+ };
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.zc_add, false),
+ viewBtn: this.vaildData(this.permission.zc_view, true),
+ delBtn: this.vaildData(this.permission.zc_delete, false),
+ editBtn: this.vaildData(this.permission.zc_edit, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ handleEdit(row, index) {
+ this.$refs.crud.rowEdit(row, index);
+ },
+ rowSave(row, done, loading) {
+ add(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ window.console.log(error);
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ update(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ console.log(error);
+ }
+ );
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ 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();
+ },
+ 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();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ this.loading = true;
+ params["deptId"] = this.id;
+ getOpenup(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query)
+ ).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
+ },
+};
+</script>
+
+<style>
+</style>
diff --git a/vue.config.js b/vue.config.js
index 53d4bb1..18fa031 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -40,7 +40,8 @@
// target: 'http://192.168.0.114:82/',
// target: 'http://192.168.0.111:83/',
//target: 'http://localhost:82/',
- target: 'http://223.82.109.183:2082/api/',
+ // target: 'http://223.82.109.183:2082/api/',
+ target: 'http://192.168.0.107:85/',//唐
//target: 'http://localhost:83/',
//target: 'https://web.byisf.com/api/',
//远程演示服务地址,可用于直接启动项目
--
Gitblit v1.9.3