{"remainingRequest":"/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/components/view_mapview.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/view_mapview.vue","mtime":1732857533167},{"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":315532800000},{"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":1655715099000}],"contextDependencies":[],"result":["\nimport map_arcgis from \"@/components/map_arcGIS.vue\";\nexport default {\n inject: [\"reload\"],\n name: \"view-mapview\",\n props: [\"view\", \"info\", \"openParams\", \"showtype\", \"includeDisplayType\"],\n components: {\n map_arcgis,\n },\n data: function () {\n return {\n center: {\n lng: 113.261503,\n lat: 23.131377,\n },\n zoom: 14,\n isActive: false,\n currentMapType: \"BMAP_NORMAL_MAP\",\n currentLongitude: \"\",\n currentLatitude: \"\",\n keyword: \"\",\n location: \"\",\n show: false,\n markerPoint: {},\n markerAdress: \"\",\n adressTitle: \"\",\n adressContent: \"\",\n markerHidden: true,\n viewDataList: \"\",\n markerList: [],\n localDetail: \"\",\n id: \"\",\n pendingContentH: \"\",\n pendingContentW: \"\",\n row_count: \"\",\n wayValue: false,\n tableData: [],\n currentShowId: \"\",\n radio: \"地图\",\n isReadonly: false,\n };\n },\n\n mounted() {\n let view = this.view;\n if (view.mapType != \"arcgis\") {\n let iType = this.includeDisplayType;\n if (\n view.readonly ||\n (iType &&\n (iType == Constant.PermissionType_READONLY ||\n iType == Constant.PermissionType_DISABLED))\n ) {\n //只读或者包含元素为只读,视图都要只读\n this.isReadonly = true;\n }\n this.getData();\n this.$nextTick(function () {\n if (this.$refs.mapView) {\n this.pendingContentH =\n document.documentElement.clientHeight -\n this.$refs.mapView.getBoundingClientRect().top;\n this.pendingContentW =\n document.getElementsByClassName(\"map-view\")[0].offsetWidth + \"px\";\n }\n });\n }\n },\n methods: {\n handleClick() {\n this.wayValue = !this.wayValue;\n },\n delMarker(item) {\n let docIds = [];\n docIds.push(item.id);\n this.$confirm(this.$t(\"msg.delConfirm\"), this.$t(\"tip\"), {\n confirmButtonText: this.$t(\"msg.confirm\"),\n cancelButtonText: this.$t(\"btns.cancel\"),\n type: \"warning\",\n })\n .then(() => {\n this.$api.batchRemoveDocuments(this.openParams.appId, docIds, {\n onSucess: (res) => {\n if (res.data.errcode == 0) {\n this.$notify({\n title: this.$t(\"success\"),\n message: \"\",\n type: \"success\",\n });\n this.getData();\n }\n },\n });\n })\n .catch(() => {});\n },\n reloadListView() {\n this.getData();\n },\n change() {},\n handleBtn(type, item) {\n let params = {\n linkType: \"00\",\n appId: this.openParams.appId,\n active: true,\n name: this.$t(\"view.mapview\"),\n actionContent: item.onActionForm,\n refreshId: this.openParams.id,\n };\n this.$emit(\"add-tab\", params);\n },\n getData() {\n // debugger\n let view = this.view;\n let currentLocation = view.town + view.city + view.province;\n if (!currentLocation) {\n this.zoom = 4;\n }\n let that = this;\n setTimeout(() => {\n var ls = new BMap.LocalSearch(\"北京\", {\n renderOptions: {\n map: \"\",\n autoViewport: true,\n selectFirstResult: false,\n },\n });\n ls.search(currentLocation);\n ls.setSearchCompleteCallback(function (rs) {\n console.log(rs);\n if (rs.Hr) {\n let point = rs.Hr[0].point;\n that.center = {\n lng: point.lng,\n lat: point.lat,\n };\n }\n });\n\n console.log(\n this.openParams.appId,\n this.view.id,\n \"_____________________\"\n );\n\n this.$api.getViewData(\n this.openParams.appId,\n this.view.id,\n {},\n {},\n {\n onSucess: (res) => {\n let viewData = res.data.data;\n this.row_count = viewData.row_count;\n // let map = new BMap.Map();\n // let myGeo = new BMap.Geocoder();\n let view = this.view;\n console.log(\n view,\n viewData,\n \"###################################\"\n );\n\n let jk = \"\",\n wk = \"\";\n\n try {\n for (let j = 0; j < view.columns.length; j++) {\n if (view.columns[j].fieldName == \"ATTENDANCESITELONGITUDE\") {\n jk = view.columns[j].id;\n }\n if (view.columns[j].fieldName == \"ATTENDANCESITELATITUDE\") {\n wk = view.columns[j].id;\n }\n }\n\n if (jk && wk) {\n for (let j = 0; j < viewData.data.length; j++) {\n viewData.data[j].local = {\n lng: viewData.data[j].items[jk].value,\n lat: viewData.data[j].items[wk].value,\n };\n }\n }\n } catch (error) {\n console.log(error);\n }\n\n this.$nextTick(() => {\n setTimeout(() => {\n this.viewDataList = viewData;\n console.log(\n this.viewDataList,\n \"###############%@#%@#%@#%@#%#@\"\n );\n this.$forceUpdate();\n }, 2000);\n });\n },\n }\n );\n }, 500);\n },\n\n //地图定位精确方法\n /**\n * WGS84转GCj02\n * @param lng\n * @param lat\n * @returns {*[]}\n */\n wgs84togcj02(lng, lat) {\n let that = this;\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n let PI = 3.1415926535897932384626;\n let a = 6378245.0;\n let ee = 0.00669342162296594323;\n if (that.out_of_china(lng, lat)) {\n return [lng, lat];\n } else {\n let dlat = that.transformlat(lng - 105.0, lat - 35.0);\n let dlng = that.transformlng(lng - 105.0, lat - 35.0);\n let radlat = (lat / 180.0) * PI;\n let magic = Math.sin(radlat);\n magic = 1 - ee * magic * magic;\n let sqrtmagic = Math.sqrt(magic);\n dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtmagic)) * PI);\n dlng = (dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);\n let mglat = lat + dlat;\n let mglng = lng + dlng;\n return [mglng, mglat];\n }\n },\n /**\n * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换\n * 即谷歌、高德 转 百度\n * @param lng\n * @param lat\n * @returns {*[]}\n */\n gcj02tobd09(lng, lat) {\n // let that = this\n let x_PI = (3.14159265358979324 * 3000.0) / 180.0;\n // let PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n let z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);\n let theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);\n let bd_lng = z * Math.cos(theta) + 0.0065;\n let bd_lat = z * Math.sin(theta) + 0.006;\n return [bd_lng, bd_lat];\n },\n\n transformlat(lng, lat) {\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n let PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n let ret =\n -100.0 +\n 2.0 * lng +\n 3.0 * lat +\n 0.2 * lat * lat +\n 0.1 * lng * lat +\n 0.2 * Math.sqrt(Math.abs(lng));\n ret +=\n ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) *\n 2.0) /\n 3.0;\n ret +=\n ((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) *\n 2.0) /\n 3.0;\n ret +=\n ((160.0 * Math.sin((lat / 12.0) * PI) +\n 320 * Math.sin((lat * PI) / 30.0)) *\n 2.0) /\n 3.0;\n return ret;\n },\n\n transformlng(lng, lat) {\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n let PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n let ret =\n 300.0 +\n lng +\n 2.0 * lat +\n 0.1 * lng * lng +\n 0.1 * lng * lat +\n 0.1 * Math.sqrt(Math.abs(lng));\n ret +=\n ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) *\n 2.0) /\n 3.0;\n ret +=\n ((20.0 * Math.sin(lng * PI) + 40.0 * Math.sin((lng / 3.0) * PI)) *\n 2.0) /\n 3.0;\n ret +=\n ((150.0 * Math.sin((lng / 12.0) * PI) +\n 300.0 * Math.sin((lng / 30.0) * PI)) *\n 2.0) /\n 3.0;\n return ret;\n },\n\n /**\n * 判断是否在国内,不在国内则不做偏移\n * @param lng\n * @param lat\n * @returns {boolean}\n */\n out_of_china(lng, lat) {\n return (\n lng < 72.004 || lng > 137.8347 || lat < 0.8293 || lat > 55.8271 || false\n );\n },\n\n handler({ BMap, map }) {\n this.center.lng = 113.261503;\n this.center.lat = 23.131377;\n this.zoom = 9;\n },\n zoomEnd(e) {\n console.log(e);\n this.zoom = e.target.getZoom();\n },\n //右键放大\n enlargeMap(e) {\n this.center = {\n lng: e.point.lng,\n lat: e.point.lat,\n };\n this.zoom = this.zoom + 2;\n if (this.zoom >= 19) {\n this.zoom = 19;\n }\n console.log(this.zoom);\n },\n //右键缩小\n reduceMap(e) {\n this.center = {\n lng: e.point.lng,\n lat: e.point.lat,\n };\n this.zoom = this.zoom - 2;\n if (this.zoom <= 0) {\n this.zoom = 1;\n }\n },\n setSign(e) {\n let mLng = e.point.lng,\n mLat = e.point.lat;\n this.setMark(mLng, mLat);\n },\n cancelSign({ BMap, map }) {\n //有问题,隐藏\n this.markerHidden = false;\n console.log(BMap);\n console.log(map);\n },\n infoWindowClose() {\n this.currentShowId = \"\";\n // this.show = false;\n },\n infoWindowOpen(id) {\n this.currentShowId = id;\n this.show = true;\n },\n getDbclickInfo(e) {\n let mLng = e.point.lng,\n mLat = e.point.lat;\n this.setMark(mLng, mLat);\n },\n normalMap() {\n if (this.currentMapType == \"BMAP_HYBRID_MAP\") {\n this.currentMapType = \"BMAP_NORMAL_MAP\";\n }\n },\n mixMap() {\n if (this.currentMapType == \"BMAP_NORMAL_MAP\") {\n this.currentMapType = \"BMAP_HYBRID_MAP\";\n }\n },\n searchLocation() {\n this.location = this.keyword;\n },\n searchBox(e) {\n this.isActive = !this.isActive;\n console.log(e);\n },\n Delete(id) {\n let that = this;\n console.log(\"删除\", id);\n let arr = [];\n arr.push(id);\n this.$api.batchRemoveDocuments(this.openParams.appId, arr, {\n onSucess: () => {\n Toast({\n message: this.$t(\"msg.es\"),\n iconClass: \"fa fa-check fa-2x\",\n });\n that.reload();\n },\n });\n },\n },\n};\n",null]}