Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue
| | |
| | | * @Version: 1.0 |
| | | * @Author: yangsx |
| | | * @Date: 2019-12-09 19:01:40 |
| | | * @LastEditors: song |
| | | * @LastEditTime: 2021-02-25 13:59:29 |
| | | * @LastEditors: yangsx |
| | | * @LastEditTime: 2019-12-14 14:44:57 |
| | | */ |
| | | define([ |
| | | "dojo", |
| | | "dojo/_base/declare", |
| | | "dojo/_base/lang", |
| | | "base/BaseWidget", |
| | | "dojo/text!widgets/SecurityMap/template.html", |
| | | "dojo/text!widgets/securityMap/template.html", |
| | | "base/AppEvent", |
| | | "base/ConfigData", |
| | | "widgets/realTimePolice/config", |
| | | "widgets/securityMap/config", |
| | | "dojo/dom", |
| | | "dojo/dom-construct", |
| | | "dojo/dom-attr", |
| | |
| | | "esri/tasks/query", |
| | | "esri/tasks/QueryTask", |
| | | "esri/Color", |
| | | "esri/toolbars/edit", |
| | | "esri/graphic", |
| | | "esri/geometry/Point", |
| | | "esri/geometry/Polyline", |
| | | "esri/geometry/Polygon", |
| | | "esri/geometry/Extent", |
| | | "esri/tasks/FeatureSet", |
| | | "esri/renderers/HeatmapRenderer", |
| | | "esri/symbols/SimpleLineSymbol", |
| | |
| | | "esri/layers/ImageParameters", |
| | | "esri/geometry/geometryEngine", |
| | | "esri/dijit/PopupTemplate", |
| | | "widgets/SecurityMap/FlareClusterLayer_v3", |
| | | "dojo/domReady!", |
| | | "widgets/realTimePolice/LayUIDataTable" |
| | | "widgets/securityMap/FlareClusterLayer_v3", |
| | | "dojo/domReady!" |
| | | ], function( |
| | | dojo, |
| | | declare, |
| | |
| | | Query, |
| | | QueryTask, |
| | | Color, |
| | | Edit, |
| | | Graphic, |
| | | Point, |
| | | Polyline, |
| | | Polygon, |
| | | Extent, |
| | | FeatureSet, |
| | | HeatmapRenderer, |
| | | SimpleLineSymbol, |
| | |
| | | var Widget = declare([BaseWidget], { |
| | | widgetName: "SecurityMap", |
| | | label: "处警队伍管理", |
| | | |
| | | templateString: template, |
| | | _map: null, |
| | | objThis: null, |
| | | // 现场图层 |
| | | _siteLayer: new GraphicsLayer(), |
| | | layuiLayer: null, |
| | | layuiLadate: null, |
| | |
| | | // 保留添加实体图层的变量 |
| | | addEntitys: null, |
| | | entitysData: [], |
| | | |
| | | // 是否派发保安的 文字 |
| | | treatmentIndex: null, |
| | | securityFlag: false, |
| | | editParentInd: null, |
| | | |
| | | // 存储新增点,线,面,数据的地方 |
| | | polygonData: [], |
| | | polygonFlag: false, |
| | | editToolbar: null, |
| | | addPolygonEntitys: null, |
| | | |
| | | // 所有的面图层 |
| | | entityPolygonAll: null, |
| | | |
| | | // 用来存储区域名称 |
| | | globalRegionName: null, |
| | | |
| | | // 用来区域得最大最小经纬度 |
| | | currentDrawing: [], |
| | | |
| | | // 巡逻区域或者巡逻路线的描述 |
| | | routeOrRegionDescribe: null, |
| | |
| | | peopleRealName: null, |
| | | pepleRealId: null, |
| | | |
| | | //存放聚合实体 |
| | | clusterLayer: null, |
| | | constructor: function(options, srcRefNode) { |
| | | debugger; |
| | | console.log("option=" + options); |
| | | this._map = options.map; |
| | | objThis = this; |
| | | |
| | | |
| | | this.addEntitys = new GraphicsLayer({ id: 'addEntitys' }); |
| | | this.addEntitys = new GraphicsLayer({ |
| | | id: 'addEntitys' |
| | | }); |
| | | |
| | | // 添加点面线的图层 |
| | | this.addPolygonEntitys = new GraphicsLayer({ id: 'addPolygonEntitys' }); |
| | | this.addPolygonEntitys = new GraphicsLayer({ |
| | | id: 'addPolygonEntitys' |
| | | }); |
| | | // 添加所有图层的地方 |
| | | this.entityPolygonAll = new GraphicsLayer({ id: 'entityPolygonAll' }); |
| | | this.entityPolygonAll = new GraphicsLayer({ |
| | | id: 'entityPolygonAll' |
| | | }); |
| | | |
| | | |
| | | this._map.addLayer(this.addEntitys); |
| | |
| | | this._map.addLayer(this.addPolygonEntitys); |
| | | this._map.addLayer(this.entityPolygonAll); |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | startup: function() { |
| | | |
| | | objThis._map.addLayer(objThis._siteLayer); |
| | | var that = this; |
| | | // 保安出警管理表格中点击事件 |
| | | $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'input').on('click', 'input', function(event) { |
| | | event.stopPropagation(); |
| | | var lgtd = Number($(this).parent().parent().attr('lgtd')); |
| | | var lttd = Number($(this).parent().parent().attr('lttd')); |
| | | var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 })); //根据输入坐标信息找地图上的点 |
| | | that.newElectronicFenceId = null; |
| | | that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大 |
| | | var graphic = that.entityPolygonAll.graphics; |
| | | for (var i = 0; i < graphic.length; i++) { |
| | | if (graphic[i].objId.id == $(this).attr('resultid')) { |
| | | if (graphic[i].geometry.rings[0].length > 0) { |
| | | that.polygonFlag = false; |
| | | that.electronicFence(); |
| | | that.activateToolbar(graphic[i]); |
| | | } else { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('请开始划分电子围栏'); |
| | | }) |
| | | that.polygonFlag = true; |
| | | that.newElectronicFenceId = graphic[i].objId; |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr').on('click', 'tr', function(event) { |
| | | event.stopPropagation(); |
| | | var lgtd = Number($(this).attr('lgtd')); |
| | | var lttd = Number($(this).attr('lttd')); |
| | | var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 })); //根据输入坐标信息找地图上的点 |
| | | |
| | | that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大 |
| | | |
| | | var snumber = $(this).attr('term-snumber'); |
| | | |
| | | var url = './popup/html/personnel-information-management.html?id=' + code; |
| | | layui.use('layer', function() { |
| | | that.layuiLayer = layui.layer; |
| | | that.layuiLayer.config({ |
| | | extend: 'myskin/personnel-information-management.css' |
| | | }); |
| | | that.layuiLayer.close(that.layuiLayer.index); |
| | | that.layuiLayer.open({ |
| | | title: '保安人员信息', |
| | | type: 2, |
| | | shadeClose: true, |
| | | shade: false, |
| | | maxmin: false, //开启最大化最小化按钮 |
| | | area: ['400px', '220px'], |
| | | offset: 'auto', |
| | | skin: 'personnel-information-management', |
| | | content: url, |
| | | closeBtn: 1, |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //根据key 取value值 |
| | | getQueryStringByKey: function(key) { |
| | | return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1]; |
| | | }, |
| | | |
| | | //页面打开后,获取参数数据 |
| | | open: function() { |
| | | var that = this; |
| | | debugger; |
| | | $.ajax({ |
| | | url: '/api/blade-jfpts/alarm/alarm/listAll?', |
| | | type: 'get', |
| | | dataType: 'JSON', |
| | | success: function(data) { |
| | | var datas = data.data; |
| | | for (var i = 0; i < datas.length; i++) { |
| | | datas[i].x = Number(datas[i].jd); |
| | | datas[i].y = Number(datas[i].wd); |
| | | } |
| | | debugger; |
| | | that.flareClusterLayer(datas); |
| | | } |
| | | }); |
| | | |
| | | var lgtd = that.getQueryStringByKey('jd'); |
| | | var lttd = that.getQueryStringByKey('wd'); |
| | | that.addPoint(that.addEntitys, lgtd, lttd, './images/security.png'); |
| | | }, |
| | | |
| | | |
| | | close: function() { |
| | | |
| | | }, |
| | | // 获取当前时间,以及昨天现在的时间 |
| | | getTime: function getTime() { |
| | | var timestamp = Date.parse(new Date()); |
| | | |
| | | // 鼠标点击事件 |
| | | clickHand: function() {}, |
| | | // 当前时间 |
| | | var currentTime = new Date(timestamp); |
| | | // 年 |
| | | var currentY = currentTime.getFullYear(); |
| | | // 月 |
| | | var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1; |
| | | // 日 |
| | | var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate(); |
| | | // 时 |
| | | var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours(); |
| | | // 分 |
| | | var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes(); |
| | | // 明天 |
| | | var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000); |
| | | // 年 |
| | | var tomorrowY = tomorrowTime.getFullYear(); |
| | | // 月 |
| | | var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1; |
| | | // 日 |
| | | var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate(); |
| | | // 时 |
| | | var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours(); |
| | | // 分 |
| | | var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes(); |
| | | return { |
| | | current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd, |
| | | tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd, |
| | | month: currentM + currentD |
| | | }; |
| | | }, |
| | | |
| | | // 创建实体图层 |
| | | createEntitys: function(entitys, entityContent, name, item, lgtd, lttd, outlineColors) { |
| | | |
| | | var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 33, 48); |
| | | symbol.name = name; |
| | | var pt = new Point(lgtd, lttd, new esri.SpatialReference({ |
| | | wkid: 4326 |
| | | })); |
| | | pt.entityData = item; |
| | | var graphic = new esri.Graphic(pt, symbol); |
| | | entitys.add(graphic); |
| | | |
| | | |
| | | entityContent.push(item); |
| | | }, |
| | | |
| | | addPoint: function(entitys, lgtd, lttd, img) { |
| | | var symbol = new esri.symbol.PictureMarkerSymbol(img, 33, 48); |
| | | var pt = new Point(lgtd, lttd, new SpatialReference({ |
| | | wkid: 4326 |
| | | })); |
| | | var graphic = new esri.Graphic(pt, symbol); |
| | | entitys.add(graphic); |
| | | }, |
| | | |
| | | addPoints: function(entitys, lgtd, lttd, img) { |
| | | var symbol = new esri.symbol.PictureMarkerSymbol(img, 33, 48); |
| | | var pt = new Point(lgtd, lttd, new SpatialReference({ |
| | | wkid: 4326 |
| | | })); |
| | | var graphic = new esri.Graphic(pt, symbol); |
| | | entitys.add(graphic); |
| | | }, |
| | | |
| | | //聚合图层事件 |
| | | flareClusterLayer: function(datas) { |
| | | debugger; |
| | | |
| | | console.log(1); |
| | | |
| | | var that = this; |
| | | |
| | |
| | | //init the layer, more options are available and explained in the cluster layer constructor |
| | | that.clusterLayer = new FlareClusterLayer({ |
| | | id: "flare-cluster-layer", |
| | | spatialReference: new esri.SpatialReference({ "wkid": 4326 }), |
| | | spatialReference: new esri.SpatialReference({ |
| | | "wkid": 4326 |
| | | }), |
| | | subTypeFlareProperty: "facilityType", |
| | | singleFlareTooltipProperty: "name", |
| | | displaySubTypeFlares: true, |
| | |
| | | preClustered: preClustered, |
| | | clusterRatio: 75, |
| | | clusterAreaDisplay: areaDisplayMode, |
| | | clusteringBegin: function() { |
| | | console.log("clustering begin"); |
| | | clusteringBegin: function(e) { |
| | | console.log(e, "clustering begin"); |
| | | }, |
| | | clusteringComplete: function() { |
| | | console.log("clustering complete"); |
| | |
| | | }); |
| | | |
| | | //set up a class breaks renderer to render different symbols based on the cluster count. Use the required clusterCount property to break on. |
| | | var defaultSym = new PictureMarkerSymbol("./images/ceshi.png", 32, 32).setOffset(0, 15); |
| | | var defaultSym = new PictureMarkerSymbol("./images/jingbaored.png", 33, 48).setOffset(0, 15); |
| | | var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount"); |
| | | var xlSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 32, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([200, 52, 59, 0.8]), 1), new dojo.Color([250, 65, 74, 0.8])); |
| | | var lgSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 28, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([41, 163, 41, 0.8]), 1), new dojo.Color([51, 204, 51, 0.8])); |
| | | var mdSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 24, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([82, 163, 204, 0.8]), 1), new dojo.Color([102, 204, 255, 0.8])); |
| | | var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8])); |
| | | var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 52, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8])); |
| | | renderer.addBreak(0, 19, smSymbol); |
| | | renderer.addBreak(20, 150, mdSymbol); |
| | | renderer.addBreak(151, 1000, lgSymbol); |
| | |
| | | //set up a popup template |
| | | var template = new PopupTemplate({ |
| | | title: "{name}", |
| | | fieldInfos: [ |
| | | { fieldName: "facilityType", label: "Facility Type", visible: true }, |
| | | { fieldName: "postcode", label: "Post Code", visible: true }, |
| | | { fieldName: "isOpen", label: "Opening Hours", visible: true } |
| | | fieldInfos: [{ |
| | | fieldName: "facilityType", |
| | | label: "Facility Type", |
| | | visible: true |
| | | }, |
| | | { |
| | | fieldName: "postcode", |
| | | label: "Post Code", |
| | | visible: true |
| | | }, |
| | | { |
| | | fieldName: "isOpen", |
| | | label: "Opening Hours", |
| | | visible: true |
| | | } |
| | | ] |
| | | }); |
| | | |
| | |
| | | that._map.removeLayer(that.clusterLayer); |
| | | that.clusterLayer = null; |
| | | } |
| | | |
| | | |
| | | }); |
| | | return Widget; |
| | | }); |
| | |
| | | }, |
| | | //数据导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出体温数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据报表导出 |
| | | handleExportStatis() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出体温数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出健康码数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据报表导出 |
| | | handleExportStatis() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出健康码数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据报表导出 |
| | | handleExportStatis() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出包裹数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出违禁品数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据报表导出 |
| | | handleExportStatis() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出违禁品数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出实时警情数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | }, |
| | | //数据报表导出 |
| | | handleExportStatis() { |
| | | this.$confirm("是否导出用户数据?", "提示", { |
| | | this.$confirm("是否导出实时警情数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap"> |
| | | <iframe id="mapDiv" ref="mapDiv" src="/map/index.html?openid=scurityMap&ISinit=1" frameborder="0" width="100%" |
| | | <!-- <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap"> |
| | | <iframe id="mapDiv" ref="mapDiv" src="/map/index.html?ISinit=1&openid=SecurityMap" frameborder="0" width="100%" |
| | | height="100%"></iframe> |
| | | </el-drawer> --> |
| | | <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap"> |
| | | <iframe |
| | | id="securityMap" |
| | | ref="securityMap" |
| | | :src="baseUrl" |
| | | frameborder="0" |
| | | width="100%" |
| | | height="100%" |
| | | name="securityMap" |
| | | ></iframe> |
| | | </el-drawer> |
| | | </basic-container> |
| | | </template> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | baseUrl:"/map/index.html?ISinit=1", |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | showMap: false, |
| | | showMap: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.showMap = false; |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | |
| | | }); |
| | | }, |
| | | handleMap(row) { |
| | | this.showMap = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.mapDiv.onload = () => { |
| | | |
| | | var that =this; |
| | | that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${row.jd}&wd=${row.wd}`; |
| | | this.showMap=true; |
| | | console.log(this.$refs,111); |
| | | console.log(this.$refs.securityMap,222); |
| | | this.$refs.securityMap.onload = () => { |
| | | if (window.frames[0].init) { |
| | | window.frames[0].init("SecurityMap", { |
| | | x: row.jd, |
| | | y: row.wd, |
| | | code:row.code |
| | | x: row.jd, |
| | | y: row.wd, |
| | | code:row.code |
| | | }); |
| | | }; |
| | | }) |
| | | } else { |
| | | console.log(`没有找到到window.frames[0].init`) |
| | | } |
| | | } |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |