Commit 9f51a26d by 前端

Merge branch 'change_map' into 'master'

上线合并

See merge request !100
2 parents bb6d3603 ae3aad48
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
}, },
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* @returns * @returns
*/ */
import { http_common } from '@/main' import { http_common } from '@/main'
import { http_province } from '@/main'
const pictureUpload = params => { const pictureUpload = params => {
params.method = "glsx.accounts.biz.common.pictureUpload" params.method = "glsx.accounts.biz.common.pictureUpload"
return http_common({ return http_common({
...@@ -17,6 +18,16 @@ const pictureUpload = params => { ...@@ -17,6 +18,16 @@ const pictureUpload = params => {
noSignAttr: ['file'] noSignAttr: ['file']
}) })
} }
const getProvince = params => {
return http_province({
url: '/nesi/apiRegion/search',
method: 'GET',
data: params,
sign: true
})
}
export default { export default {
pictureUpload pictureUpload,
getProvince
} }
\ No newline at end of file \ No newline at end of file
...@@ -146,22 +146,26 @@ export default { ...@@ -146,22 +146,26 @@ export default {
**/ **/
// 获取省市信息 // 获取省市信息
provinceList() { provinceList() {
var params = {} var params = {
params.subdistrict = this.subdistrict keyword: '中国',
extensions_code: 1
}
params.sub_admin = this.subdistrict
// params.subdistrict = this.subdistrict
let data = '' let data = ''
for (let key in params) { for (let key in params) {
data += '&' + key + '=' + params[key] data += '&' + key + '=' + params[key]
} }
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a` // let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data // let path = 'http://eshield.dev.glsx.com.cn/nesi/apiRegion/search?'
// path = path + data
const path = this.$provinceUrl + data
const pro = fetch(path).then(res => { const pro = fetch(path).then(res => {
return res.json() return res.json()
}) })
if (this.provinceView) { pro.then(r => {
pro.then(r => { this.AllData = JSON.parse(r.data).districts[0].districts
this.AllData = r.districts[0].districts })
})
}
return pro return pro
}, },
// 省市回显 // 省市回显
...@@ -241,7 +245,8 @@ export default { ...@@ -241,7 +245,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.provinceForm.fullAddress && !this.$refs.mapForm.address) { if (this.provinceForm.fullAddress && !this.$refs.mapForm.address) {
this.$refs.mapForm.address = this.provinceForm.fullAddress this.$refs.mapForm.address = this.provinceForm.fullAddress
this.$refs.mapForm.addMarker([this.provinceForm.lng, this.provinceForm.lat]) this.$refs.mapForm.mapInit(this.provinceForm.lng, this.provinceForm.lat)
// this.$refs.mapForm.addMarker([this.provinceForm.lng, this.provinceForm.lat])
} }
}) })
}, },
...@@ -252,7 +257,7 @@ export default { ...@@ -252,7 +257,7 @@ export default {
this.$message.success('请选择地址') this.$message.success('请选择地址')
return return
} }
this.provinceForm.fullAddress = this.$refs.mapForm.address // this.provinceForm.fullAddress = this.$refs.mapForm.address
// 获取选择经纬度 // 获取选择经纬度
let lnglat = this.$refs.mapForm.lnglat let lnglat = this.$refs.mapForm.lnglat
this.provinceForm.lat = lnglat.lat this.provinceForm.lat = lnglat.lat
...@@ -260,7 +265,7 @@ export default { ...@@ -260,7 +265,7 @@ export default {
var mapData = this.$refs.mapForm.geocoderAddress var mapData = this.$refs.mapForm.geocoderAddress
// 赋值省市区名称和code // 赋值省市区名称和code
console.log(this.$refs.mapForm, '\\\\\\') console.log(this.$refs.mapForm, '\\\\\\')
const { city, citycode, province, district, towncode } = mapData.addressComponent const { city, citycode, province, district, towncode } = mapData
if (!this.provinceForm.provinceName) { if (!this.provinceForm.provinceName) {
this.provinceForm.provinceName = province this.provinceForm.provinceName = province
this.provinceForm.cityName = city this.provinceForm.cityName = city
...@@ -272,22 +277,22 @@ export default { ...@@ -272,22 +277,22 @@ export default {
var fullAddress = '' var fullAddress = ''
var provincecode = '' var provincecode = ''
// 为防止打开地图弹框不选择地址点确定按钮无法正确判断地址选择是否正确产生的报错,设置this.addressData.fullAddress来保存上次选择的地址 // 为防止打开地图弹框不选择地址点确定按钮无法正确判断地址选择是否正确产生的报错,设置this.addressData.fullAddress来保存上次选择的地址
if (mapData.addressComponent) { // if (mapData.addressComponent) {
fullAddress = mapData.addressComponent // fullAddress = mapData.addressComponent
provincecode = mapData.adcode // provincecode = mapData.adcode
this.addressData.fullAddress = fullAddress // this.addressData.fullAddress = fullAddress
this.addressData.provincecode = provincecode // this.addressData.provincecode = provincecode
} else { // } else {
fullAddress = this.addressData.fullAddress // fullAddress = this.addressData.fullAddress
provincecode = this.addressData.provincecode // provincecode = this.addressData.provincecode
} // }
// 获取省市 // 获取省市
var provincename = '' var provincename = ''
var cityname = '' var cityname = ''
var town = '' var town = ''
provincename = fullAddress.province provincename = mapData.province
cityname = fullAddress.city ? fullAddress.city : fullAddress.district cityname = mapData.city ? mapData.city : mapData.district
town = fullAddress.district town = mapData.district
// 直辖市需额外判断 // 直辖市需额外判断
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provincename) var municipality = municipalities.find(item => item == provincename)
...@@ -315,6 +320,7 @@ export default { ...@@ -315,6 +320,7 @@ export default {
return return
} }
} }
this.provinceForm.fullAddress = this.$refs.mapForm.address
this.dialogMapVisible = false this.dialogMapVisible = false
// this.subdistrict == 2 ? this.init(province, city) : this.init(province, city, town) // this.subdistrict == 2 ? this.init(province, city) : this.init(province, city, town)
// console.log(this.provinceForm.lat, 'provinceForm') // console.log(this.provinceForm.lat, 'provinceForm')
......
<template> <template>
<div class="map-box" :style="{ height: mapHeight + 'px' }"> <div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div> <div id="mapContainer" style="width: 100%; height: 100%;z-index: 100"></div>
<div class="map-address">{{ address }}</div> <div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%"> <div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select"> <el-input id="input" placeholder="请输入关键字" v-model="input" @keyup.enter.native="searchAddress" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button> <el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input> </el-input>
</div> </div>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</template> </template>
<script> <script>
let map, marker, placeSearch let map, marker, geocoder
export default { export default {
name: 'map', name: 'map',
props: { props: {
...@@ -26,84 +26,116 @@ export default { ...@@ -26,84 +26,116 @@ export default {
input: '', input: '',
address: '', address: '',
lnglat: [], lnglat: [],
geocoderAddress: {} geocoderAddress: {},
mapapi: null
} }
}, },
methods: { methods: {
mapInit() { async mapInit(lng, lat) {
map = new AMap.Map('container', { const mapapi = this.$mapapi
resizeEnable: true, console.log(lng, lat, '==========', this.$mapapi)
zoom: 20 map = await mapapi.invoke('Map', 'mapContainer')
}) mapapi.invoke('centerAndZoom', mapapi.invoke('Point', lng, lat), 15)
AMap.plugin(['AMap.PlaceSearch'], function() { map.enableScrollWheelZoom() // 启用滚轮放大缩小
//构造地点查询类 map.enableAutoResize() // 启用自动适应容器尺寸变化
placeSearch = new AMap.PlaceSearch({ geocoder = mapapi.invoke('Geocoder')
pageSize: 8, // 单页显示结果条数 if (lng && lat) {
pageIndex: 1, // 页码 this.addMarker([lng, lat], true)
citylimit: false, //是否强制限制在设置的城市内搜索 }
// panel: "panel", // 结果列表将在此容器中进行展示。 // 右键菜单
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围 mapapi.invoke('mapAddEventListener', 'click', (e) => {
renderStyle: 'default' console.log(e)
}) this.getAddress(e.point)
}) })
// 添加列表点选监听事件 // map = new AMap.Map('container', {
map.on('click', this.getAddress) // resizeEnable: true,
// zoom: 20
// })
// AMap.plugin(['AMap.PlaceSearch'], function() {
// //构造地点查询类
// placeSearch = new AMap.PlaceSearch({
// pageSize: 8, // 单页显示结果条数
// pageIndex: 1, // 页码
// citylimit: false, //是否强制限制在设置的城市内搜索
// // panel: "panel", // 结果列表将在此容器中进行展示。
// autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
// renderStyle: 'default'
// })
// })
// // 添加列表点选监听事件
// map.on('click', this.getAddress)
}, },
searchAddress() { searchAddress() {
let _this = this const mapapi = this.$mapapi
placeSearch.search(this.input, function(status, result) { console.log(mapapi, 'mapapi')
if (status === 'complete' && result.poiList.pois.length) { mapapi.invoke('getPoint', this.input, res => {
let lnglat = result.poiList.pois[0].location console.log(this.input, res, 'getPoint')
_this.getAddress(lnglat) // this.addMarker(res)
} this.getAddress(res)
}) }, '全国')
// let _this = this
// placeSearch.search(this.input, function(status, result) {
// if (status === 'complete' && result.poiList.pois.length) {
// let lnglat = result.poiList.pois[0].location
// _this.getAddress(lnglat)
// }
// })
}, },
addMarker(lnglat) { addMarker(lnglat, isInit = false) {
let position const mapapi = this.$mapapi
let lnglatXY
console.log(lnglat)
if (lnglat.lng) { if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat] const { lng, lat } = lnglat
lnglatXY = mapapi.invoke('Point', lng, lat)
} else { } else {
position = lnglat lnglatXY = mapapi.invoke('Point', lnglat[0], lnglat[1])
} }
marker = new AMap.Marker({ if (marker) {
icon: new AMap.Icon({ mapapi.invoke('removeOverlay', marker)
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png', }
size: new AMap.Size(27, 34), //图标大小 marker = mapapi.invoke('Marker', lnglatXY, {
imageSize: new AMap.Size(27, 34) icon:mapapi.invoke('Icon', require('@/assets/address.png'), mapapi.invoke('Size', 20, 30))
}),
position: position,
offset: new AMap.Pixel(-10, -10)
}) })
map.add(marker) // if (!isInit) {
map.setFitView() // mapapi.invoke('getLocation', lnglatXY, res => {
// console.log(res, 'getLocation')
// if (res) this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
// })
// }
mapapi.invoke('panTo', lnglatXY)
mapapi.invoke('addOverlay', marker)
}, },
getAddress(e) { getAddress(e) {
console.log(e)
let self = this let self = this
const mapapi = this.$mapapi
let lnglat let lnglat
if (e.type == 'click') { if (e.lng) {
lnglat = e.lnglat const { lng, lat } = e
lnglat = mapapi.invoke('Point', lng, lat)
} else { } else {
let { lng, lat } = e lnglat = mapapi.invoke('Point', e[0], e[1])
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
} }
self.addMarker(lnglat) self.addMarker(lnglat)
AMap.plugin('AMap.Geocoder', () => { geocoder.getLocation(lnglat, res => {
const geocoder = new AMap.Geocoder() console.log(res)
geocoder.getAddress(lnglat, (status, result) => { this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
self.lnglat = lnglat this.geocoderAddress = res.content.address_detail
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
}
})
})
}) })
// AMap.plugin('AMap.Geocoder', () => {
// const geocoder = new AMap.Geocoder()
// geocoder.getAddress(lnglat, (status, result) => {
// self.lnglat = lnglat
// self.address = result.regeocode.formattedAddress
// geocoder.getLocation(self.address, (status, result) => {
// if (status === 'complete' && result.info === 'OK') {
// this.geocoderAddress = result.geocodes[0]
// }
// })
// })
// })
}, },
selectAddress(e) { selectAddress(e) {
//这里获得点选地点的经纬度 //这里获得点选地点的经纬度
...@@ -111,8 +143,8 @@ export default { ...@@ -111,8 +143,8 @@ export default {
} }
}, },
mounted() { created() {
this.mapInit() // this.mapInit()
} }
} }
</script> </script>
......
/* /*
* @Description:
* @Author: huyue
* @Date: 2024-12-30 11:12:18
* @LastEditors: huyue
* @LastEditTime: 2025-01-02 18:48:27
*/
/*
* @Descripttion: * @Descripttion:
* @version: 1.0.0 * @version: 1.0.0
* @Author: limin * @Author: limin
...@@ -12,15 +19,10 @@ import apis from './api' ...@@ -12,15 +19,10 @@ import apis from './api'
import './public-path' import './public-path'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
import VueAMap from "vue-amap"; import GLMapSdk from '@/utils/glsk-mapapi-sdk'
import filters from './utils/filters' //新增过滤器 import filters from './utils/filters' //新增过滤器
Vue.use(VueAMap); Vue.prototype.$mapapi = new GLMapSdk()
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
plugin: ["AMap.PlaceSearch", "AMap.Geocoder", "AMap.Geolocation"],
v: "1.4.15"
});
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
...@@ -31,6 +33,7 @@ export const http = params => Vue.prototype.$http(params) ...@@ -31,6 +33,7 @@ export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
export const http_config = params => Vue.prototype.$http_config(params) export const http_config = params => Vue.prototype.$http_config(params)
export const http_car = params => Vue.prototype.$http_car(params) export const http_car = params => Vue.prototype.$http_car(params)
export const http_province = params => Vue.prototype.$http_province(params)
console.log(http_config) console.log(http_config)
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]); Vue.filter(key, filters[key]);
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-03-02 15:56:07 * @Date: 2022-03-02 15:56:07
* @LastEditTime: 2022-04-27 18:25:20 * @LastEditTime: 2025-01-02 18:46:16
* @LastEditors: huyue * @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\setup\qiankun.js * @FilePath: \scrm-micro-settings\src\setup\qiankun.js
...@@ -27,17 +27,19 @@ let routes = [] ...@@ -27,17 +27,19 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, request_common, request_config, request_car, sign_common } = await fetchConfig(common) const { response, request, sign, secret, request_common, request_config, request_car, sign_common, request_province, provinceUrl } = await fetchConfig(common)
console.log(request) console.log(request)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
console.log(globalState) console.log(globalState)
Vue.prototype.$provinceUrl = provinceUrl
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_config = new common.Http({ response, request: request_config, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_config = new common.Http({ response, request: request_config, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_car = new common.Http({ response, request: request_car, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_car = new common.Http({ response, request: request_car, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_province = new common.Http({ response, signWay: "md5", request: request_province, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) // Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).GlMap=r()}(this,(function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function e(t,r,e){return r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(){n=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",m={};function g(){}function w(){}function b(){}var L={};l(L,c,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(T([])));E&&E!==e&&o.call(E,c)&&(L=E);var j=b.prototype=g.prototype=Object.create(L);function G(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(n,i,a,c){var u=h(t[n],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function O(r,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=h(r,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,i=function e(){for(;++n<r.length;)if(o.call(r,n))return e.value=r[n],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return w.prototype=b,i(j,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},G(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},G(j),l(j,f,"Generator"),l(j,c,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:T(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function o(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof r?r:r+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c={1:"develop",2:"test",3:"production",4:"beta"},u=function(){return e((function t(){var e=this;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t);var o,i,u={env:3,version:3},f=arguments[0];if(arguments.length>1&&(u="object"==a(arguments[0])?arguments[0]:u,f=arguments[1],null!==(o=u)&&void 0!==o&&o.env||(u.env=3),null!==(i=u)&&void 0!==i&&i.version||(u.version=3)),"undefined"!=typeof window){var l=function(){var t,o=(t=n().mark((function t(){var r,o,i,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=map-api-js&env=".concat(c[u.env]));case 3:return r=t.sent,t.next=6,r.json();case 6:o=t.sent,i=Array.from(document.head.getElementsByTagName("script")).some((function(t){return t.src===o.apiUrl})),i?f&&"function"==typeof f&&(e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))):((a=document.createElement("script")).src=o.apiUrl,document.head.appendChild(a),a.onload=function(){e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.error("Failed to fetch configuration:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})),function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}();l()}}),[{key:"invoke",value:function(t){var r,e=Array.prototype.slice.call(arguments,1);return(r=this.GLMap)[t].apply(r,o(e))}},{key:"map",get:function(){return this.GLMap._BMAP}},{key:"mapGL",get:function(){return this.GLMap._BMapGL}}])}();return u}));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!