{"remainingRequest":"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\\RiverInfo.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\RiverInfo.vue","mtime":1684458238606},{"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":["//\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\r\nimport RiverInfoModel from './module/RiverInfoModel.vue'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport gisMap from '@/api/frontScreen/gisMap.js'\r\nimport riversway from '@/views/frontScreens/js/riversway.js'\r\nimport riversway2 from '@/views/frontScreens/js/riversway2.js'\r\nimport riversway3 from '@/views/frontScreens/js/riversway3.js'\r\nimport riversCodeMap from '@/views/frontScreens/js/riversCodeMap.js'\r\nimport riversName1 from '@/views/frontScreens/js/riversName1.js'\r\nimport riversName2 from '@/views/frontScreens/js/riversName2.js'\r\nimport riversName3 from '@/views/frontScreens/js/riversName3.js'\r\nimport riverLine from '@/views/frontScreens/js/waterlines/polyline'\r\nimport riverPolygon from '@/views/frontScreens/js/waterlines/polygon'\r\nimport riverPoint from '@/views/frontScreens/js/waterlines/point'\r\nimport {gisCompMixin} from '@/mixins/gisCompMixin.js'\r\nexport default {\r\n name: 'RiverInfo',\r\n components: {RiverInfoModel},\r\n mixins: [gisCompMixin],\r\n data() {\r\n return {\r\n // 指定坐标字段\r\n lg: 'rvInsideStartLoc',\r\n lt: 'rvInsideStartLong',\r\n modelName: 'RiverInfoModel',\r\n isInitMarkers: false,\r\n LayerGroup: null, // layerGroup 收集用于切换删除\r\n markerslayer: [], //集合标点的layer 收集用于切换删除\r\n form: {\r\n rvName: '',\r\n rvGrad: []\r\n },\r\n\t params:{},\r\n iconUrl: require('./../../../../assets/img/gis_riverInfo.png'),\r\n filterData: [],\r\n originData: [\r\n {\r\n rvName: '河流1',\r\n rvGrad: '1 级',\r\n startLong: '106.60618',\r\n startLat: '29.87268',\r\n id: 1,\r\n children: [\r\n {\r\n rvName: '河流11',\r\n rvGrad: '2 级',\r\n startLong: '106.61663',\r\n startLat: '29.92665',\r\n id: 11\r\n }\r\n ]\r\n },\r\n {\r\n rvName: '河流2',\r\n rvGrad: '2 级',\r\n startLong: '106.45848',\r\n startLat: '29.66765',\r\n id: 2,\r\n children: [\r\n {\r\n rvName: '河流3',\r\n rvGrad: '3 级',\r\n startLong: '106.38834',\r\n startLat: '29.86642',\r\n id: 3\r\n },\r\n {\r\n rvName: '河流4',\r\n rvGrad: '4 级',\r\n startLong: '106.43615',\r\n startLat: '29.84204',\r\n id: 4\r\n },\r\n {\r\n rvName: '河流5',\r\n rvGrad: '1 级',\r\n startLong: '106.44186',\r\n startLat: '29.82033',\r\n id: 5\r\n }\r\n ]\r\n }\r\n ],\r\n showInfo: false,\r\n sectionMarker: null, // 标记点\r\n label: null, // 标记点名称\r\n hljb: [],\r\n currentPoint: {\r\n rvName: ''\r\n },\r\n infoWin: null,\r\n riverOverlay: null,\r\n riverLineOverlay: null,\r\n riverPolygonOverlay: null,\r\n riverPointOverlay: null,\r\n riverLineOverlay2:null,\r\n riverLineOverlay3:null,\r\n singleRiverOverlay:null\r\n }\r\n },\r\n created() {\r\n this.hljb = dictUtils.getDictItemsFromCache('hljb')\r\n\r\n },\r\n mounted() {\r\n this.$nextTick(() => {\r\n this.initWaterlines()\r\n\t this.getBaseFindAll()\r\n // this.initMarkers()\r\n })\r\n },\r\n methods: {\r\n customClear() {\r\n if(this.singleRiverOverlay){\r\n this.map.removeLayer(this.singleRiverOverlay)\r\n }\r\n if (this.riverPolygonOverlay) {\r\n this.map.removeLayer(this.riverPolygonOverlay)\r\n }\r\n if (this.riverLineOverlay) {\r\n this.map.removeLayer(this.riverLineOverlay)\r\n }\r\n if(this.riverLineOverlay2){\r\n this.map.removeLayer(this.riverLineOverlay2)\r\n }\r\n if(this.riverLineOverlay3){\r\n this.map.removeLayer(this.riverLineOverlay3)\r\n }\r\n },\r\n\tgetBaseFindAll(){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tgisMap.baseFindAll(this.params,res=>{\r\n\t\t\t\tif(res.state){\r\n\t\t\t\t\tthis.filterData = res.value\r\n\t\t\t\t\tresolve()\r\n\t\t\t\t}\r\n\t\t\t\treject()\r\n\t\t\t})\r\n\t\t})\r\n\t\t\r\n\t},\r\n\trvGrad(val){\r\n\t\tlet name\r\n\t\tthis.hljb.forEach(e => {\r\n\t\t\tif (e.value == val) {\r\n\t\t\t\tname = e.name\r\n\t\t\t}\r\n\t\t})\r\n\t\treturn name\r\n\t},\r\n async changeSearch(val) {\r\n\t\tthis.params.rvName=val\r\n\t\tawait this.getBaseFindAll()\r\n\r\n },\r\n\tasync hljbChange(val){\r\n\t\tthis.params.rvGradList=val\r\n\t\tawait this.getBaseFindAll()\r\n\t},\r\n initWaterlines() {\r\n // this.initRiver()\r\n this.initRiverLine()\r\n // this.initRiverPolygon()\r\n this.initRiverPoint()\r\n },\r\n clearWaterlines() {\r\n if (this.sectionMarker) {\r\n this.map.removeLayer(this.sectionMarker)\r\n this.sectionMarker = null\r\n }\r\n if (this.riverPointOverlay) {\r\n this.LayerGroup.clearLayers();\r\n }\r\n if (this.riverLineOverlay) {\r\n this.map.removeLayer(this.riverLineOverlay)\r\n }\r\n if(this.riverLineOverlay2){\r\n this.map.removeLayer(this.riverLineOverlay2)\r\n }\r\n if(this.riverLineOverlay3){\r\n this.map.removeLayer(this.riverLineOverlay3)\r\n }\r\n if(this.singleRiverOverlay){\r\n this.map.removeLayer(this.singleRiverOverlay)\r\n }\r\n },\r\n rowClick(row) {\r\n console.log(row)\r\n this.clearWaterlines()\r\n this.patchRiver(row)\r\n this.currentPoint = row\r\n let latlng = this.createdLngLat(row[this.lt], row[this.lg])\r\n this.drawMarker(latlng, row, false)\r\n this.map.setView(this.sectionMarker.getLatLng(), 14)\r\n // 定位到河流起始点 但是地图等级太高天地图无法显示\r\n // let bounds = L.latLngBounds([\r\n // this.sectionMarker.getLatLng(),\r\n // [row.rvInsideEndLoc, row.rvInsideEndLong]\r\n // ])\r\n // //定位到矩形\r\n // this.map.fitBounds(bounds);\r\n },\r\n patchRiver(row){\r\n let riversFileCode = riversCodeMap.nameMap[row.code];\r\n let riversFile\r\n if(riversFileCode == 1){\r\n riversFile = riversName1\r\n }else if(riversFileCode == 2){\r\n riversFile = riversName2\r\n }else if(riversFileCode == 3){\r\n riversFile = riversName3\r\n }else{\r\n return\r\n }\r\n let rivers = riversFile.features\r\n let river = rivers.filter(item=>item.properties.code == row.code)\r\n this.drawRiver(river, row)\r\n },\r\n drawRiver(river, row) {\r\n let myStyle = {\r\n color: '#409eff',\r\n weight: 2,\r\n opacity: 1,\r\n fillColor: '#409eff',\r\n fillOpacity: 1\r\n }\r\n this.singleRiverOverlay = new L.geoJSON(river, {\r\n style: myStyle\r\n })\r\n this.map.addLayer(this.singleRiverOverlay)\r\n this.singleRiverOverlay.bringToFront()\r\n \r\n },\r\n initRiver() {\r\n let countries = []\r\n this.LayerGroup = []\r\n this.markerslayer = []\r\n countries = riverway.features\r\n let myStyle = {\r\n color: '#409eff',\r\n weight: 1,\r\n opacity: 0.5,\r\n fillColor: '#409eff',\r\n fillOpacity: 0.6\r\n }\r\n this.riverOverlay = new L.geoJSON(countries, {\r\n style: myStyle\r\n })\r\n this.markerslayer.push(this.riverOverlay)\r\n this.LayerGroup = new L.layerGroup(this.markerslayer)\r\n this.map.addLayer(this.LayerGroup)\r\n this.map.addLayer(this.riverOverlay)\r\n this.riverOverlay.bringToFront()\r\n },\r\n initRiverPoint() {\r\n let countries = []\r\n this.LayerGroup = []\r\n this.markerslayer = []\r\n countries = riverPoint.features\r\n countries.forEach(item => {\r\n let latlng = new L.LatLng(\r\n item.geometry.coordinates[1],\r\n item.geometry.coordinates[0]\r\n )\r\n const label = new L.divIcon({\r\n html: `
${item.properties.Name}
`,\r\n className: 'my-divIcon',\r\n iconSize: 40\r\n })\r\n this.riverPointOverlay = new L.marker(latlng, {\r\n icon: label\r\n })\r\n this.markerslayer.push(this.riverPointOverlay)\r\n this.LayerGroup = new L.layerGroup(this.markerslayer)\r\n this.map.addLayer(this.LayerGroup)\r\n\r\n this.map.addLayer(this.riverPointOverlay)\r\n \r\n })\r\n },\r\n initRiverPolygon() {\r\n let countries = []\r\n countries = riverPolygon.features\r\n\r\n let myStyle = {\r\n color: '#006ced',\r\n weight: 1,\r\n opacity: 0.5,\r\n fillColor: '#006ced',\r\n fillOpacity: 0.7\r\n }\r\n this.riverPolygonOverlay = new L.geoJSON(countries, {\r\n style: myStyle\r\n })\r\n this.map.addLayer(this.riverPolygonOverlay)\r\n this.riverPolygonOverlay.bringToFront()\r\n },\r\n initRiverLine() {\r\n let countries = [];\r\n let countries2 = [];\r\n let countries3 = [];\r\n // countries = riverLine.features\r\n countries = riversway.features\r\n countries2 = riversway2.features\r\n countries3 = riversway3.features\r\n let myStyle = {\r\n color: '#409eff',\r\n weight: 2,\r\n opacity: 1,\r\n fillColor: '#409eff',\r\n fillOpacity: 1\r\n }\r\n this.riverLineOverlay = new L.geoJSON(countries, {\r\n style: myStyle\r\n })\r\n this.riverLineOverlay2 = new L.geoJSON(countries2, {\r\n style: myStyle\r\n })\r\n this.riverLineOverlay3 = new L.geoJSON(countries3, {\r\n style: myStyle\r\n })\r\n this.map.addLayer(this.riverLineOverlay)\r\n this.map.addLayer(this.riverLineOverlay2)\r\n this.map.addLayer(this.riverLineOverlay3)\r\n this.riverLineOverlay.bringToFront()\r\n this.riverLineOverlay2.bringToFront()\r\n this.riverLineOverlay3.bringToFront()\r\n },\r\n initMarkers() {\r\n this.filterData.forEach(item => {\r\n let latlng = this.createdLngLat(item[this.lt], item[this.lg])\r\n this.drawMarker(latlng, item, true)\r\n if (item.children && item.children.length) {\r\n item.children.forEach(subRiver => {\r\n let latlng = this.createdLngLat(\r\n subRiver[this.lt],\r\n subRiver[this.lg]\r\n )\r\n this.drawMarker(latlng, subRiver, true)\r\n })\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}