{"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/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":1734060504774},{"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/es6.regexp.search\";\nimport gcoord from \"gcoord\";\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: map_arcgis\n },\n data: function data() {\n return {\n mapType: 'tianditu',\n tiandiMap: null,\n windowInfo: null,\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 mounted: function mounted() {\n var view = this.view;\n if (view.mapType != \"arcgis\") {\n var iType = this.includeDisplayType;\n if (view.readonly || iType && (iType == Constant.PermissionType_READONLY || iType == Constant.PermissionType_DISABLED)) {\n //只读或者包含元素为只读,视图都要只读\n this.isReadonly = true;\n }\n this.getData();\n this.$nextTick(function () {\n if (this.$refs.mapView) {\n this.pendingContentH = document.documentElement.clientHeight - this.$refs.mapView.getBoundingClientRect().top;\n this.pendingContentW = document.getElementsByClassName(\"map-view\")[0].offsetWidth + \"px\";\n }\n });\n }\n },\n methods: {\n // 天地图初始化\n initTiandiMap: function initTiandiMap() {\n this.tiandiMap = new T.Map('mapDiv');\n var lnglat = new T.LngLat(116.40969, 39.89945);\n this.tiandiMap.centerAndZoom(lnglat, 12);\n var control = new T.Control.Zoom();\n control.setPosition(T_ANCHOR_BOTTOM_RIGHT);\n this.tiandiMap.addControl(control);\n this.addTiandiMarker();\n },\n // 添加天地图marker\n addTiandiMarker: function addTiandiMarker() {\n var _this2 = this;\n var data_info = this.viewDataList.data;\n var _loop = function _loop(i) {\n var local = data_info[i].local;\n var result = gcoord.transform([local.lng, local.lat],\n // 经纬度坐标\n gcoord.BD09,\n // 当前坐标系\n gcoord.WGS84 // 目标坐标系\n );\n var marker = new T.Marker(new T.LngLat(result[0], result[1]));\n _this2.tiandiMap.addOverLay(marker);\n var _this = _this2;\n marker.addEventListener(\"click\", function (e) {\n _this.windowInfo = data_info[i];\n _this.$refs.winInfoRef.style.display = 'block';\n var point = e.lnglat;\n var markerInfoWin = new T.InfoWindow(_this.$refs.winInfoRef, {\n offset: new T.Point(0, -30)\n });\n _this.tiandiMap.openInfoWindow(markerInfoWin, point);\n });\n };\n for (var i = 0; i < data_info.length; i++) {\n _loop(i);\n }\n },\n // 定位\n locationFn: function locationFn() {\n var lo = new T.Geolocation();\n lo.getCurrentPosition(function (e) {\n if (this.getStatus() == 0) {}\n if (this.getStatus() == 1) {}\n });\n },\n handleClick: function handleClick() {\n this.wayValue = !this.wayValue;\n },\n delMarker: function delMarker(item) {\n var _this3 = this;\n var 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 }).then(function () {\n _this3.$api.batchRemoveDocuments(_this3.openParams.appId, docIds, {\n onSucess: function onSucess(res) {\n if (res.data.errcode == 0) {\n _this3.$notify({\n title: _this3.$t(\"success\"),\n message: \"\",\n type: \"success\"\n });\n _this3.getData();\n }\n }\n });\n }).catch(function () {});\n },\n reloadListView: function reloadListView() {\n this.getData();\n },\n change: function change() {},\n handleBtn: function handleBtn(type, item) {\n var 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: function getData() {\n var _this4 = this;\n // debugger\n var view = this.view;\n var currentLocation = view.town + view.city + view.province;\n if (!currentLocation) {\n this.zoom = 4;\n }\n var that = this;\n setTimeout(function () {\n if (_this4.mapType !== 'tianditu') {\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 if (rs.Hr) {\n var point = rs.Hr[0].point;\n that.center = {\n lng: point.lng,\n lat: point.lat\n };\n }\n });\n }\n _this4.$api.getViewData(_this4.openParams.appId, _this4.view.id, {}, {}, {\n onSucess: function onSucess(res) {\n var viewData = res.data.data;\n _this4.row_count = viewData.row_count;\n // let map = new BMap.Map();\n // let myGeo = new BMap.Geocoder();\n var view = _this4.view;\n var jk = \"\",\n wk = \"\";\n try {\n for (var 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 if (jk && wk) {\n for (var _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 if (_this4.mapType === 'tianditu') {\n _this4.viewDataList = viewData;\n _this4.initTiandiMap();\n } else {\n _this4.$nextTick(function () {\n setTimeout(function () {\n _this4.viewDataList = viewData;\n _this4.$forceUpdate();\n }, 2000);\n });\n }\n }\n });\n }, 500);\n },\n //地图定位精确方法\n /**\n * WGS84转GCj02\n * @param lng\n * @param lat\n * @returns {*[]}\n */\n wgs84togcj02: function wgs84togcj02(lng, lat) {\n var that = this;\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n var PI = 3.1415926535897932384626;\n var a = 6378245.0;\n var ee = 0.00669342162296594323;\n if (that.out_of_china(lng, lat)) {\n return [lng, lat];\n } else {\n var dlat = that.transformlat(lng - 105.0, lat - 35.0);\n var dlng = that.transformlng(lng - 105.0, lat - 35.0);\n var radlat = lat / 180.0 * PI;\n var magic = Math.sin(radlat);\n magic = 1 - ee * magic * magic;\n var 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 var mglat = lat + dlat;\n var 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: function gcj02tobd09(lng, lat) {\n // let that = this\n var x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n // let PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n var z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);\n var theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);\n var bd_lng = z * Math.cos(theta) + 0.0065;\n var bd_lat = z * Math.sin(theta) + 0.006;\n return [bd_lng, bd_lat];\n },\n transformlat: function transformlat(lng, lat) {\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n var PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));\n ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;\n ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0;\n ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0;\n return ret;\n },\n transformlng: function transformlng(lng, lat) {\n // let x_PI = 3.14159265358979324 * 3000.0 / 180.0;\n var PI = 3.1415926535897932384626;\n // let a = 6378245.0;\n // let ee = 0.00669342162296594323;\n var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));\n ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;\n ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0;\n ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0;\n return ret;\n },\n /**\n * 判断是否在国内,不在国内则不做偏移\n * @param lng\n * @param lat\n * @returns {boolean}\n */\n out_of_china: function out_of_china(lng, lat) {\n return lng < 72.004 || lng > 137.8347 || lat < 0.8293 || lat > 55.8271 || false;\n },\n handler: function handler(_ref) {\n var BMap = _ref.BMap,\n map = _ref.map;\n this.center.lng = 113.261503;\n this.center.lat = 23.131377;\n this.zoom = 9;\n },\n zoomEnd: function zoomEnd(e) {\n this.zoom = e.target.getZoom();\n },\n //右键放大\n enlargeMap: function 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 },\n //右键缩小\n reduceMap: function 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: function setSign(e) {\n var mLng = e.point.lng,\n mLat = e.point.lat;\n this.setMark(mLng, mLat);\n },\n cancelSign: function cancelSign(_ref2) {\n var BMap = _ref2.BMap,\n map = _ref2.map;\n //有问题,隐藏\n this.markerHidden = false;\n },\n infoWindowClose: function infoWindowClose() {\n this.currentShowId = \"\";\n // this.show = false;\n },\n infoWindowOpen: function infoWindowOpen(id) {\n this.currentShowId = id;\n this.show = true;\n },\n getDbclickInfo: function getDbclickInfo(e) {\n var mLng = e.point.lng,\n mLat = e.point.lat;\n this.setMark(mLng, mLat);\n },\n normalMap: function normalMap() {\n if (this.currentMapType == \"BMAP_HYBRID_MAP\") {\n this.currentMapType = \"BMAP_NORMAL_MAP\";\n this.tiandiMap.setMapType(window.TMAP_NORMAL_MAP);\n }\n },\n mixMap: function mixMap() {\n if (this.currentMapType == \"BMAP_NORMAL_MAP\") {\n this.currentMapType = \"BMAP_HYBRID_MAP\";\n this.tiandiMap.setMapType(window.TMAP_HYBRID_MAP);\n }\n },\n searchLocation: function searchLocation() {\n this.location = this.keyword;\n },\n searchBox: function searchBox(e) {\n this.isActive = !this.isActive;\n },\n Delete: function Delete(id) {\n var _this5 = this;\n var that = this;\n var arr = [];\n arr.push(id);\n this.$api.batchRemoveDocuments(this.openParams.appId, arr, {\n onSucess: function onSucess() {\n Toast({\n message: _this5.$t(\"msg.es\"),\n iconClass: \"fa fa-check fa-2x\"\n });\n that.reload();\n }\n });\n }\n }\n};",null]}