{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\District.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\District.vue","mtime":1684458238559},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/bbsl-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport towns from \"./../../js/towns\";\nimport DistrictModel from '@/views/frontScreens/components/gisTabComponents/module/DistrictModel';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport gisMap from '@/api/frontScreen/gisMap.js';\nimport { gisCompMixin } from '@/mixins/gisCompMixin.js';\nexport default {\n name: 'district',\n components: {\n DistrictModel: DistrictModel\n },\n mixins: [gisCompMixin],\n data: function data() {\n return {\n form: {\n name: ''\n },\n iconUrl: require(\"./../../../../assets/img/gis_district.png\"),\n districtData: [],\n isInitMarkers: false,\n LayerGroup: null,\n // layerGroup 收集用于切换删除\n markerslayer: [],\n //集合标点的layer 收集用于切换删除\n currentPoint: {},\n params: {\n children: [],\n code: '',\n id: '',\n isParent: '',\n latitude: 0,\n levelCode: 'town',\n levels: [],\n longitude: 0,\n name: '',\n parentId: '',\n pkVal: '',\n sn: 0,\n text: ''\n },\n originData: [{\n code: '1',\n name: '三圣镇',\n local: [29.893282, 106.626127]\n }, {\n code: '2',\n name: '复兴街道',\n local: [29.81363, 106.54764]\n }, {\n code: '3',\n name: '天府镇',\n local: [29.89507, 106.50078]\n }, {\n code: '4',\n name: '水土街道',\n local: [29.81216, 106.49202]\n }, {\n code: '5',\n name: '朝阳街道',\n local: [29.831273, 106.434406]\n }, {\n code: '6',\n name: '柳荫镇',\n local: [29.97067, 106.59883]\n }, {\n code: '7',\n name: '歇马街道',\n local: [29.77261, 106.35246]\n }, {\n code: '8',\n name: '澄江镇',\n local: [29.8744, 106.34989]\n }, {\n code: '9',\n name: '天生街道',\n local: [29.82307, 106.41701]\n }, {\n code: '10',\n name: '施家梁镇',\n local: [29.77235, 106.47099]\n }, {\n code: '11',\n name: '童家溪镇',\n local: [29.6967, 106.43229]\n }, {\n code: '12',\n name: '北温泉街道',\n local: [29.83887, 106.3916]\n }, {\n code: '13',\n name: '龙凤桥街道',\n local: [29.77964, 106.41718]\n }, {\n code: '14',\n name: '静观镇',\n local: [29.89651, 106.56065]\n }, {\n code: '15',\n name: '东阳街道',\n local: [29.86444, 106.43675]\n }, {\n code: '16',\n name: '蔡家岗街道',\n local: [29.729001, 106.463601]\n }, {\n code: '17',\n name: '金刀峡镇',\n local: [30.03387, 106.62094]\n }],\n showInfo: false,\n polygon: null,\n // 单个行政区划多边形\n sectionMarker: null,\n // 行政区划标记点\n label: null,\n // 行政区划标记点名称\n townsPolygon: [],\n // 行政区划多边形集合\n townsPolygonLayer: null,\n // 行政区划多边形layer\n townsPoint: [{\n code: '1',\n name: '三圣镇',\n local: [29.893282, 106.626127]\n }, {\n code: '2',\n name: '复兴镇',\n local: [29.81363, 106.54764]\n }, {\n code: '3',\n name: '天府镇',\n local: [29.89507, 106.50078]\n }, {\n code: '4',\n name: '水土镇',\n local: [29.81216, 106.49202]\n }, {\n code: '5',\n name: '朝阳街道',\n local: [29.831273, 106.434406]\n }, {\n code: '6',\n name: '柳荫镇',\n local: [29.97067, 106.59883]\n }, {\n code: '7',\n name: '歇马镇',\n local: [29.77261, 106.35246]\n }, {\n code: '8',\n name: '澄江镇',\n local: [29.8744, 106.34989]\n }, {\n code: '9',\n name: '天生街道',\n local: [29.82307, 106.41701]\n }, {\n code: '10',\n name: '施家梁镇',\n local: [29.77235, 106.47099]\n }, {\n code: '11',\n name: '童家溪镇',\n local: [29.6967, 106.43229]\n }, {\n code: '12',\n name: '北温泉街道',\n local: [29.83887, 106.3916]\n }, {\n code: '13',\n name: '龙凤桥街道',\n local: [29.77964, 106.41718]\n }, {\n code: '14',\n name: '静观镇',\n local: [29.89651, 106.56065]\n }, {\n code: '15',\n name: '东阳街道',\n local: [29.86444, 106.43675]\n }, {\n code: '16',\n name: '蔡家岗镇',\n local: [29.729001, 106.463601]\n }, {\n code: '17',\n name: '金刀峡镇',\n local: [30.03387, 106.62094]\n }]\n };\n },\n created: function created() {// this.districtData = this.originData\n },\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return _this.getQuerySysAreas();\n\n case 2:\n _this.initMarkers();\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n })));\n },\n methods: {\n customClear: function customClear() {\n if (this.polygon) {\n this.map.removeLayer(this.polygon);\n this.polygon = null;\n }\n\n if (this.townsPolygonLayer) {\n this.map.removeLayer(this.townsPolygonLayer);\n this.townsPolygonLayer = null;\n }\n },\n getQuerySysAreas: function getQuerySysAreas() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n gisMap.querySysAreas(_this2.params, function (res) {\n if (res) {\n _this2.districtData = res;\n resolve();\n }\n\n reject();\n });\n });\n },\n updateMarkers: function updateMarkers() {\n // 获得新的列表数据后清除旧的标点、重新创建地图标点\n this.searchClear = true;\n this.clearMarkers();\n this.searchClear = false;\n this.initMarkers();\n },\n initMarkers: function initMarkers() {\n var _this3 = this;\n\n this.LayerGroup = null;\n this.markerslayer = []; // 画区域\n\n this.townsPolygon = [], // 行政区划多边形集合\n this.townsPolygonLayer = null, // 行政区划多边形layer\n towns.features.forEach(function (item) {\n var points = [];\n item.geometry.coordinates[0].forEach(function (inner) {\n var latLng = L.latLng(inner[1], inner[0]);\n points.push(latLng);\n });\n\n var polygon = _this3.drawPolygons(points, item.color);\n\n _this3.townsPolygon.push(polygon);\n });\n this.townsPolygonLayer = new L.layerGroup(this.townsPolygon);\n this.map.addLayer(this.townsPolygonLayer);\n var icon = this.createdIcon(this.iconUrl); // 画乡镇名称\n\n this.districtData.forEach(function (item) {\n var latlng = new L.LatLng(item.longitude, item.latitude);\n var label = new L.divIcon({\n html: \"
\".concat(item.name, \"
\") + \"\"),\n className: 'my-divIcon',\n iconSize: 60,\n iconAnchor: L.point(8, 12)\n });\n var sectionMarker = new L.marker(latlng, {\n icon: label\n });\n\n _this3.markerslayer.push(sectionMarker);\n\n var infoWin = _this3.infoWindow();\n\n sectionMarker.addEventListener('click', function () {\n _this3.currentPoint = item;\n infoWin.update();\n _this3.showInfo = true; // this.sectionMarker.bindPopup(this.infoWin).openPopup()\n });\n sectionMarker.addEventListener('mouseover', function () {});\n _this3.LayerGroup = new L.layerGroup(_this3.markerslayer);\n\n _this3.map.addLayer(_this3.LayerGroup); // 将标注添加到地图中\n\n\n sectionMarker.addTo(_this3.map).bindPopup(infoWin); // this.map.addLayer(sectionMarker)\n });\n },\n // 创建icon\n createdIcon: function createdIcon(iconUrl) {\n var icon = new L.icon({\n iconUrl: iconUrl,\n iconSize: new L.point(12, 12),\n iconAnchor: new L.point(0, -6)\n });\n return icon;\n },\n drawPolygons: function drawPolygons(points, color) {\n // 创建面对象\n return new L.polygon(points, {\n color: '#f4f7fd',\n weight: 1,\n opacity: 1,\n fillColor: '#409eff',\n fillOpacity: 0.1\n }); //向地图上添加面\n // this.map.addLayer(polygon)\n },\n rowClick: function rowClick(row) {\n // this.currentPoint = row\n this.clearMarkers();\n this.createdLngLat(row);\n },\n changeSearch: function () {\n var _changeSearch = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(val) {\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n this.params.name = val;\n _context2.next = 3;\n return this.getQuerySysAreas();\n\n case 3:\n this.updateMarkers();\n\n if (val) {\n this.createdLngLat(this.districtData[0]);\n } // if (!val) {\n // this.districtData = this.originData\n // return\n // }\n // this.districtData = this.originData.filter(item => item.name == val)\n\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function changeSearch(_x) {\n return _changeSearch.apply(this, arguments);\n }\n\n return changeSearch;\n }(),\n // 多边形绘制\n drawPolygon: function drawPolygon(points) {\n if (this.polygon) {\n this.map.removeLayer(this.polygon);\n this.polygon = null;\n } // 创建面对象\n\n\n this.polygon = L.polygon(points, {\n color: '#f5f5f5',\n weight: 1,\n opacity: 0.5,\n fillColor: '#4db7ff',\n fillOpacity: 0.9\n }); //向地图上添加面\n\n this.map.addLayer(this.polygon);\n },\n infoWindow: function infoWindow() {\n var sContent = this.$refs.DistrictModel.$el;\n var infoWin = new L.popup({\n autoPan: true,\n maxHeight: 300,\n maxWidth: 600,\n minWidth: 300\n }).setContent(sContent);\n return infoWin;\n },\n drawMarker: function drawMarker(latlng, item, name) {\n var _this4 = this;\n\n if (this.sectionMarker) {\n this.map.removeLayer(this.sectionMarker);\n this.sectionMarker = null;\n } // 图片\n\n\n var icon = new L.icon({\n iconUrl: this.iconUrl,\n iconSize: new L.point(12, 12),\n iconAnchor: new L.point(0, -6)\n });\n var label = new L.divIcon({\n html: \"
\".concat(name, \"
\") + \"\"),\n className: 'my-divIcon',\n iconSize: 60,\n iconAnchor: L.point(8, 12)\n });\n this.sectionMarker = new L.marker(latlng, {\n icon: label\n });\n this.infoWin = this.infoWindow();\n this.sectionMarker.addEventListener('click', function () {\n _this4.infoWin.update();\n\n _this4.showInfo = true;\n }); // 将标注添加到地图中\n\n this.sectionMarker.addTo(this.map).bindPopup(this.infoWin); // this.map.addLayer(this.sectionMarker)\n // this.showInfo = true\n },\n createdLngLat: function createdLngLat(row) {\n this.currentPoint = row;\n var markerLocal = [row.longitude, row.latitude];\n var points = [];\n var area = towns.features.filter(function (item) {\n return item.properties.name == row.name;\n });\n area[0].geometry.coordinates[0].forEach(function (item) {\n points.push(new L.LatLng(item[1], item[0]));\n });\n var latlng = new L.LatLng(markerLocal[0], markerLocal[1]); // 创建\n\n this.drawPolygon(points);\n this.drawMarker(latlng, row, row.name);\n }\n }\n};",null]}