{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/views/ElectronicFence.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/views/ElectronicFence.vue","mtime":1750035587540},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/babel.config.js","mtime":1725957645200},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _slicedToArray from \"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/@babel/runtime-corejs2/helpers/esm/slicedToArray.js\";\nimport _defineProperty from \"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { utils, VMap, VTile, VVector, VDraw } from \"v-ol-map\";\nimport \"v-ol-map/lib/v-ol-map.css\";\nimport { Message } from \"element-ui\";\nimport { deleteRailAccess, getRailDetailAccess, searchRailAccess } from \"@/api/security-station-rails-controller\";\nimport electronicFenceEditDialog from \"@/components/electronicFenceEdit.vue\";\nexport default {\n name: \"rail\",\n components: {\n VMap: VMap,\n VTile: VTile,\n VVector: VVector,\n VDraw: VDraw,\n electronicFenceEditDialog: electronicFenceEditDialog\n },\n data: function data() {\n return {\n view: {\n city: \"晋城\",\n zoom: 11\n },\n tileType: \"GD\",\n interactions: {\n DragRotateAndZoom: true,\n doubleClickZoom: false\n },\n controls: {\n zoom: true,\n zoomOptions: {\n className: \"ol-zoom-custom\"\n }\n },\n stationId: \"\",\n mapToolList: [\"fence\", \"tile\"],\n tableData: [],\n originData: [],\n station: {},\n info: {},\n returnWin: {},\n layers: {\n // 驻勤点\n stationLayer: {\n features: [],\n overlay: {\n position: undefined,\n offset: [0, -36]\n }\n },\n pointLayer: {\n features: [],\n style: {\n image: {\n src: require(\"@/assets/images/mapToolbar/框选.png\"),\n scale: 1.2\n }\n }\n },\n // 企业\n companyLayer: {\n features: [],\n overlay: {\n position: undefined,\n offset: [0, -36]\n }\n },\n // 驻勤点人员\n stationEmployeesLayer: {\n features: [],\n overlay: {\n position: undefined,\n offset: [0, -36]\n }\n },\n // 电子围栏\n railLayer: {\n features: [],\n cluster: {\n distance: 110,\n style: {\n circle: {\n radius: 50,\n fill: {\n color: \"#0E71FF\"\n }\n },\n text: {\n font: \"22px Source Han Sans CN-Medium, Source Han Sans CN\",\n fill: {\n color: \"#FFFFFF\"\n }\n }\n }\n },\n style: {\n fill: {\n color: \"rgba(230,162,60,0.2)\"\n },\n stroke: {\n color: \"#E6A23C\",\n width: 2\n }\n },\n overlay: {\n position: undefined,\n offset: [0, -36]\n }\n }\n },\n isElectronicFenceEditDialog: false,\n isElectronicFenceStationDialog: false,\n isElectronicFenceDialog: false,\n isElectronicFencePeople: false,\n electronicFenceData: [],\n electronicFenceInfo: {},\n drawType: \"\",\n electronicFencePeopleList: [],\n peopleStationName: \"\",\n showFenceEdit: true\n };\n },\n methods: {\n clickRail: function clickRail(evt, feature) {\n if (feature) {\n var rails = feature.get(\"features\");\n if (rails && rails.length === 1) {\n this.showRailInfoFromList = false;\n var rail = rails[0];\n var info = rail.get(\"props\");\n this.showRailInfo({\n info: info\n });\n } else {\n if (feature.get(\"props\")) {\n this.showRailInfoFromList = false;\n var _info = feature.get(\"props\");\n this.showRailInfo({\n info: _info\n });\n } else {\n // 如果是聚合点就下钻一级\n var zoom = this.$refs.map.map.getView().getZoom() + 1;\n var center = evt.coordinate;\n this.$refs.map.panTo({\n zoom: zoom,\n center: center\n });\n }\n }\n }\n },\n onRailLayerChange: function onRailLayerChange(features) {\n if (features && features.length === 1) {\n var feature = features[0];\n var type = feature.get(\"type\");\n if (type && !this.showRailInfoFromList) {\n if (type === \"polygon\" || type === \"Polygon\") {\n var geometry = feature.get(\"geometry\");\n // const view = this.$refs.map.map.getView();\n // view.fit(geometry, {\n // duration: 1000,\n // });\n var result = this.$refs.map.calculateCenter(geometry);\n var center = result.center;\n // console.log(coordinates)\n /**\n * @弹框位置转高德转84\n */\n this.layers.railLayer.overlay.position = center;\n } else if (type === \"circle\" || type === \"Circle\") {\n var _geometry = feature.get(\"geometry\");\n // const view = this.$refs.map.map.getView();\n // view.fit(geometry, {\n // duration: 1000,\n // });\n this.layers.railLayer.overlay.position = _geometry.getCenter();\n }\n }\n }\n },\n /**\n * @电子围栏列表\n */\n setFence: function setFence() {\n this.isElectronicFenceDialog = true;\n },\n /**\n * @清空地图\n */\n clearMap: function clearMap() {\n var exclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [\"stationLayer\"];\n for (var layersKey in this.layers) {\n if (!exclude.includes(layersKey)) {\n this.layers[layersKey].features = [];\n }\n }\n this.$refs.map.closeOverlays();\n },\n onChangeLayer: function onChangeLayer(type) {\n // console.log(\"onChangeLayer\", type);\n if (type.indexOf(\"default\") > -1) {\n this.tileType = \"GD\";\n } else {\n this.tileType = \"GD_IMG\";\n }\n },\n hideFenceTable: function hideFenceTable() {\n this.isElectronicFenceEditDialog = false;\n this.isElectronicFenceStationDialog = false;\n this.isElectronicFenceDialog = false;\n },\n electronicFenceCancel: function electronicFenceCancel() {\n this.isElectronicFenceDialog = false;\n },\n /**\n * @新增电子围栏\n */\n addElectronic: function addElectronic() {\n var _this = this;\n this.isElectronicFenceEditDialog = true;\n this.isElectronicFenceDialog = false;\n this.electronicFenceInfo = JSON.parse(JSON.stringify(this.info));\n this.electronicFenceInfo = {};\n this.$nextTick(function () {\n _this.$refs.electronicFenceEdit.updateStation({\n stationName: _this.station.name,\n peopleNum: _this.station.countOfSecurityMan,\n countOfSecurityMan: _this.station.countOfSecurityMan,\n stationId: _this.station.id\n });\n });\n },\n /**\n * @编辑某条电子围栏\n * @param data\n */\n electronicFenceEditFn: function () {\n var _electronicFenceEditFn = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref) {\n var data, rail;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = _ref.data;\n this.showRailInfoFromList = true;\n // this.map.clearMap();\n this.isElectronicFenceDialog = false;\n this.electronicFenceInfo = JSON.parse(JSON.stringify(data));\n this.electronicFenceInfo.time = [this.electronicFenceInfo.beginTime, this.electronicFenceInfo.endTime];\n _context.next = 7;\n return getRailDetailAccess(data.id);\n case 7:\n rail = _context.sent;\n this.info = _objectSpread(_objectSpread({}, rail), this.electronicFenceInfo); // 弹框信息\n\n this.isElectronicFenceEditDialog = true;\n // 显示可编辑围栏区域\n this.showMapEditor(data);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function electronicFenceEditFn(_x) {\n return _electronicFenceEditFn.apply(this, arguments);\n }\n return electronicFenceEditFn;\n }(),\n delElectronic: function delElectronic(data) {\n var _this2 = this;\n var params = {\n id: data.data.id\n };\n deleteRailAccess(params).then(function (res) {\n _this2.$refs[\"electronicFence\"].getRails();\n _this2.$message({\n message: \"删除成功\",\n type: \"success\"\n });\n }).catch(function (err) {});\n },\n electronicFenceEditCancel: function electronicFenceEditCancel() {\n var _this3 = this;\n this.layers.railLayer.features = [];\n this.isElectronicFenceEditDialog = false;\n this.cleanDrawFigure();\n searchRailAccess({\n pageIndex: 1,\n pageSize: 10,\n searchModel: \"Station\",\n stationId: this.stationId\n }).then(function (res) {\n if (res) {\n _this3.electronicFenceData = res;\n } else {\n Message({\n type: \"error\",\n message: \"查询电子围栏信息失败\",\n onClose: function onClose() {\n // window.location = \"https://www.baidu.com\";\n }\n });\n }\n }).catch(function () {\n Message({\n type: \"error\",\n message: \"查询电子围栏信息失败\",\n onClose: function onClose() {\n // window.location = \"https://www.baidu.com\";\n }\n });\n });\n },\n cleanDrawFigure: function cleanDrawFigure() {\n this.drawType = \"\";\n },\n showMapEditor: function showMapEditor(_ref2) {\n var shapeType = _ref2.shapeType,\n shapedLocation = _ref2.shapedLocation;\n switch (shapeType) {\n case \"Circle\":\n // 圆\n this.showCircleEditor(shapedLocation);\n break;\n case \"Polygon\":\n this.showPolygonEditor(shapedLocation);\n break;\n case \"Crib\":\n this.showCribEditor(shapedLocation);\n break;\n }\n },\n showPolygonEditor: function showPolygonEditor(_ref3) {\n var geos = _ref3.geos;\n var list = geos.map(function (item) {\n return [item.lon, item.lat];\n });\n this.layers.railLayer.features = [{\n type: \"polygon\",\n coordinates: list,\n style: this.layers.railLayer.style,\n convert: \"gd-84\"\n }];\n this.$refs.map.flyTo({\n zoom: 13,\n flyZoom: 8,\n center: list[0]\n });\n },\n showCribEditor: function showCribEditor(_ref4) {\n var geos = _ref4.geos;\n var list = geos.map(function (item) {\n return [item.lon, item.lat];\n });\n this.layers.railLayer.features = [{\n type: \"polygon\",\n coordinates: list,\n style: this.layers.railLayer.style,\n convert: \"gd-84\"\n }];\n this.$refs.map.flyTo({\n zoom: 13,\n flyZoom: 8,\n center: list[0]\n });\n },\n showCircleEditor: function showCircleEditor(_ref5) {\n var geos = _ref5.geos,\n radius = _ref5.radius;\n var _geos$map = geos.map(function (item) {\n return [item.lon, item.lat];\n }),\n _geos$map2 = _slicedToArray(_geos$map, 1),\n center = _geos$map2[0];\n this.layers.railLayer.features = [{\n type: \"Circle\",\n center: center,\n radius: radius,\n style: this.layers.railLayer.style,\n convert: \"gd-84\"\n }];\n this.$refs.map.flyTo({\n zoom: 13,\n // flyZoom: 8,\n center: center\n });\n },\n drawRail: function drawRail(type) {\n // this.layers.railLayer.features = []\n this.drawType = type;\n },\n drawend: function drawend(evt, map) {\n var feature = evt.feature;\n this.layers.railLayer.features = []; // 清空上一个电子围栏\n var geometry = feature.getGeometry();\n if (this.drawType === \"Rectangle\" || this.drawType === \"Polygon\") {\n var _geometry$getCoordina = geometry.getCoordinates(),\n _geometry$getCoordina2 = _slicedToArray(_geometry$getCoordina, 1),\n coordinates = _geometry$getCoordina2[0];\n var convertCoordinates = coordinates.map(function (coordinate) {\n return utils.convertCoordinate(coordinate, \"84-gd\");\n });\n var params = {\n geos: convertCoordinates.map(function (item) {\n return {\n lon: item[0],\n lat: item[1]\n };\n })\n };\n this.$refs.electronicFenceEdit.updateGeometry(params);\n } else if (this.drawType === \"Circle\") {\n var center = geometry.getCenter();\n var geoRadius = geometry.getRadius(); // 半径\n var metersPerUnit = map.getView().getProjection().getMetersPerUnit(); // 半径以米为单位\n var radius = (geoRadius * metersPerUnit).toFixed(2);\n var _convertCoordinates = utils.convertCoordinate(center, \"84-gd\");\n var _params = {\n geos: [{\n lon: _convertCoordinates[0],\n lat: _convertCoordinates[1]\n }],\n radius: radius\n };\n this.$refs.electronicFenceEdit.updateGeometry(_params);\n }\n },\n initPosition: function initPosition(pathId) {\n var _this4 = this;\n this.$api.getPointListApi({\n pathId: pathId,\n pageIndex: 1,\n pageSize: 999999\n }, {\n onSucess: function onSucess(res) {\n var list = res.data.data.map(function (item) {\n return [item.longitude, item.latitude];\n });\n _this4.layers.stationLayer.features = [{\n type: \"polyline\",\n coordinates: list,\n convert: \"gd-84\"\n }];\n _this4.layers.pointLayer.features = list.map(function (coord) {\n return {\n type: \"point\",\n coordinates: coord,\n convert: \"gd-84\",\n properties: {\n name: \"\\u7AD9\\u70B9-\".concat(coord.join(','))\n }\n // style: this.layers.pointLayer.style,\n };\n });\n _this4.$refs.map.flyTo({\n zoom: 16,\n flyZoom: 8,\n center: list[0]\n });\n }\n });\n },\n initRail: function initRail(id, radius, isCenter) {\n var _this5 = this;\n this.$api.getRailListApi({\n id: id,\n radius: radius,\n pageIndex: 1,\n pageSize: 999999\n }, {\n onSucess: function onSucess(res) {\n // let list = res.data.data.map(item => [item.longitude, item.latitude]);\n var _res$data$data$map = res.data.data.map(function (item) {\n return [item.longitude, item.latitude];\n }),\n _res$data$data$map2 = _slicedToArray(_res$data$data$map, 1),\n center = _res$data$data$map2[0];\n // this.layers.stationLayer.features = [\n // {\n // type: \"polyline\",\n // coordinates: list,\n // convert: \"gd-84\",\n // },\n // ];\n _this5.layers.pointLayer.features = [{\n type: \"Circle\",\n center: center,\n radius: radius,\n // style: this.layers.railLayer.style,\n convert: \"gd-84\"\n }];\n _this5.$refs.map.flyTo({\n zoom: 13,\n // flyZoom: 8,\n center: center\n });\n }\n });\n }\n },\n mounted: function mounted() {\n var query = this.$route.query;\n if (query && query.pathId) {\n this.showFenceEdit = false;\n this.initPosition(query.pathId);\n } else if (query && query.id) {\n this.showFenceEdit = false;\n this.initRail(query.id, query.radius);\n } else if (query && query.shapeType !== null && query.shapedLocation !== null) {\n this.showMapEditor({\n shapeType: query.shapeType,\n shapedLocation: JSON.parse(decodeURIComponent(query.shapedLocation))\n });\n }\n }\n};",null]}