vue2-client 1.17.32 → 1.17.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/assets/svg/female.svg +1 -1
- package/src/assets/svg/male.svg +1 -1
- package/src/base-client/components/common/HIS/HButtons/HButtons.vue +491 -491
- package/src/base-client/components/common/HIS/HFormGroup/index.js +3 -3
- package/src/base-client/components/common/HIS/HTab/HTab.vue +443 -443
- package/src/base-client/components/common/XCollapse/XCollapse.vue +833 -833
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XTimeline/XTimeline.vue +477 -477
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +705 -705
- package/src/base-client/components/his/XList/XList.vue +938 -938
- package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +354 -354
- package/src/base-client/components/his/XTitle/XTitle.vue +314 -314
- package/src/base-client/components/his/XTreeRows/XTreeRows.vue +341 -341
- package/src/base-client/components/his/threeTestOrders/editor.vue +113 -113
- package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -45
- package/src/router/async/router.map.js +2 -2
- package/src/theme/global.less +4 -4
- package/src/utils/map-utils.js +47 -47
- package/src-base-client/components/common/HIS/HForm/HForm.vue +0 -347
- package/src-base-client/components/common/XCollapse/XCollapse.vue +0 -0
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 根据实际部署环境修改 editor.html 的路径 -->
|
|
3
|
-
<iframe
|
|
4
|
-
src="/his/editor/editor.html"
|
|
5
|
-
width="100%"
|
|
6
|
-
height="800"
|
|
7
|
-
frameborder="0"
|
|
8
|
-
@load="onIframeLoad"
|
|
9
|
-
ref="editorIframe">
|
|
10
|
-
</iframe>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup>
|
|
14
|
-
|
|
15
|
-
import { ref, onBeforeUnmount } from 'vue'
|
|
16
|
-
|
|
17
|
-
const editorIframe = ref(null)
|
|
18
|
-
const checkEditorTimer = ref(null)
|
|
19
|
-
const checkCount = ref(0)
|
|
20
|
-
const editor = ref(null)
|
|
21
|
-
const iframeWindow = ref(null)
|
|
22
|
-
// 对外暴露的获取editor方法
|
|
23
|
-
const getEditor = () => {
|
|
24
|
-
if (editor.value) {
|
|
25
|
-
return editor.value
|
|
26
|
-
}
|
|
27
|
-
if (iframeWindow.value && iframeWindow.value.editor) {
|
|
28
|
-
editor.value = iframeWindow.value.editor
|
|
29
|
-
return editor.value
|
|
30
|
-
}
|
|
31
|
-
if (editorIframe.value && editorIframe.value.contentWindow && editorIframe.value.contentWindow.editor) {
|
|
32
|
-
editor.value = editorIframe.value.contentWindow.editor
|
|
33
|
-
return editor.value
|
|
34
|
-
}
|
|
35
|
-
return null
|
|
36
|
-
}
|
|
37
|
-
// 创建体温单方法
|
|
38
|
-
const createVitalSigns = (data) => {
|
|
39
|
-
const editorObj = getEditor()
|
|
40
|
-
if (!editorObj) {
|
|
41
|
-
throw new Error('editor对象未初始化,无法创建体温单')
|
|
42
|
-
}
|
|
43
|
-
if (typeof editorObj.createVitalSigns === 'function') {
|
|
44
|
-
return editorObj.createVitalSigns(data)
|
|
45
|
-
} else {
|
|
46
|
-
throw new Error('editor对象未包含createVitalSigns方法')
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 检查editor对象是否已初始化
|
|
51
|
-
const startEditorCheck = (frameWindow, iframe) => {
|
|
52
|
-
if (checkEditorTimer.value) {
|
|
53
|
-
clearInterval(checkEditorTimer.value)
|
|
54
|
-
}
|
|
55
|
-
checkCount.value = 0
|
|
56
|
-
checkEditorTimer.value = setInterval(() => {
|
|
57
|
-
checkCount.value++
|
|
58
|
-
try {
|
|
59
|
-
const editorObj = frameWindow.editor
|
|
60
|
-
if (editorObj && typeof editorObj.createVitalSigns === 'function') {
|
|
61
|
-
clearInterval(checkEditorTimer.value)
|
|
62
|
-
editor.value = editorObj
|
|
63
|
-
// 将editor对象暴露到全局
|
|
64
|
-
window.iframeEditor = editorObj
|
|
65
|
-
window.iframeWindow = frameWindow
|
|
66
|
-
// 触发事件
|
|
67
|
-
emit('editor-ready', editorObj)
|
|
68
|
-
emit('load', { target: iframe, editor: editorObj })
|
|
69
|
-
// 发送消息通知
|
|
70
|
-
window.parent.postMessage({ type: 'editorReady' }, '*')
|
|
71
|
-
}
|
|
72
|
-
} catch (err) {
|
|
73
|
-
console.error('检查editor对象时出错:', err)
|
|
74
|
-
}
|
|
75
|
-
if (checkCount.value >= 20) {
|
|
76
|
-
clearInterval(checkEditorTimer.value)
|
|
77
|
-
console.error('Editor 对象加载失败')
|
|
78
|
-
}
|
|
79
|
-
}, 500)
|
|
80
|
-
}
|
|
81
|
-
// iframe加载完成的处理
|
|
82
|
-
const onIframeLoad = (e) => {
|
|
83
|
-
const iframe = e.target
|
|
84
|
-
const frameWindow = iframe.contentWindow
|
|
85
|
-
iframeWindow.value = frameWindow
|
|
86
|
-
if (!frameWindow) {
|
|
87
|
-
console.error('无法访问 iframe 内容')
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
// 关闭文书工具栏
|
|
91
|
-
iframe.contentWindow.editor.option.toolbar = false
|
|
92
|
-
startEditorCheck(frameWindow, iframe)
|
|
93
|
-
}
|
|
94
|
-
// 组件销毁前清理
|
|
95
|
-
onBeforeUnmount(() => {
|
|
96
|
-
if (checkEditorTimer.value) {
|
|
97
|
-
clearInterval(checkEditorTimer.value)
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
// 暴露方法给父组件
|
|
101
|
-
defineExpose({ getEditor, createVitalSigns })
|
|
102
|
-
|
|
103
|
-
// 定义事件
|
|
104
|
-
const emit = defineEmits(['editor-ready', 'load'])
|
|
105
|
-
</script>
|
|
106
|
-
|
|
107
|
-
<style scoped>
|
|
108
|
-
iframe {
|
|
109
|
-
border: none;
|
|
110
|
-
width: 100%;
|
|
111
|
-
min-height: 800px;
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 根据实际部署环境修改 editor.html 的路径 -->
|
|
3
|
+
<iframe
|
|
4
|
+
src="/his/editor/editor.html"
|
|
5
|
+
width="100%"
|
|
6
|
+
height="800"
|
|
7
|
+
frameborder="0"
|
|
8
|
+
@load="onIframeLoad"
|
|
9
|
+
ref="editorIframe">
|
|
10
|
+
</iframe>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
|
|
15
|
+
import { ref, onBeforeUnmount } from 'vue'
|
|
16
|
+
|
|
17
|
+
const editorIframe = ref(null)
|
|
18
|
+
const checkEditorTimer = ref(null)
|
|
19
|
+
const checkCount = ref(0)
|
|
20
|
+
const editor = ref(null)
|
|
21
|
+
const iframeWindow = ref(null)
|
|
22
|
+
// 对外暴露的获取editor方法
|
|
23
|
+
const getEditor = () => {
|
|
24
|
+
if (editor.value) {
|
|
25
|
+
return editor.value
|
|
26
|
+
}
|
|
27
|
+
if (iframeWindow.value && iframeWindow.value.editor) {
|
|
28
|
+
editor.value = iframeWindow.value.editor
|
|
29
|
+
return editor.value
|
|
30
|
+
}
|
|
31
|
+
if (editorIframe.value && editorIframe.value.contentWindow && editorIframe.value.contentWindow.editor) {
|
|
32
|
+
editor.value = editorIframe.value.contentWindow.editor
|
|
33
|
+
return editor.value
|
|
34
|
+
}
|
|
35
|
+
return null
|
|
36
|
+
}
|
|
37
|
+
// 创建体温单方法
|
|
38
|
+
const createVitalSigns = (data) => {
|
|
39
|
+
const editorObj = getEditor()
|
|
40
|
+
if (!editorObj) {
|
|
41
|
+
throw new Error('editor对象未初始化,无法创建体温单')
|
|
42
|
+
}
|
|
43
|
+
if (typeof editorObj.createVitalSigns === 'function') {
|
|
44
|
+
return editorObj.createVitalSigns(data)
|
|
45
|
+
} else {
|
|
46
|
+
throw new Error('editor对象未包含createVitalSigns方法')
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 检查editor对象是否已初始化
|
|
51
|
+
const startEditorCheck = (frameWindow, iframe) => {
|
|
52
|
+
if (checkEditorTimer.value) {
|
|
53
|
+
clearInterval(checkEditorTimer.value)
|
|
54
|
+
}
|
|
55
|
+
checkCount.value = 0
|
|
56
|
+
checkEditorTimer.value = setInterval(() => {
|
|
57
|
+
checkCount.value++
|
|
58
|
+
try {
|
|
59
|
+
const editorObj = frameWindow.editor
|
|
60
|
+
if (editorObj && typeof editorObj.createVitalSigns === 'function') {
|
|
61
|
+
clearInterval(checkEditorTimer.value)
|
|
62
|
+
editor.value = editorObj
|
|
63
|
+
// 将editor对象暴露到全局
|
|
64
|
+
window.iframeEditor = editorObj
|
|
65
|
+
window.iframeWindow = frameWindow
|
|
66
|
+
// 触发事件
|
|
67
|
+
emit('editor-ready', editorObj)
|
|
68
|
+
emit('load', { target: iframe, editor: editorObj })
|
|
69
|
+
// 发送消息通知
|
|
70
|
+
window.parent.postMessage({ type: 'editorReady' }, '*')
|
|
71
|
+
}
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error('检查editor对象时出错:', err)
|
|
74
|
+
}
|
|
75
|
+
if (checkCount.value >= 20) {
|
|
76
|
+
clearInterval(checkEditorTimer.value)
|
|
77
|
+
console.error('Editor 对象加载失败')
|
|
78
|
+
}
|
|
79
|
+
}, 500)
|
|
80
|
+
}
|
|
81
|
+
// iframe加载完成的处理
|
|
82
|
+
const onIframeLoad = (e) => {
|
|
83
|
+
const iframe = e.target
|
|
84
|
+
const frameWindow = iframe.contentWindow
|
|
85
|
+
iframeWindow.value = frameWindow
|
|
86
|
+
if (!frameWindow) {
|
|
87
|
+
console.error('无法访问 iframe 内容')
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
// 关闭文书工具栏
|
|
91
|
+
iframe.contentWindow.editor.option.toolbar = false
|
|
92
|
+
startEditorCheck(frameWindow, iframe)
|
|
93
|
+
}
|
|
94
|
+
// 组件销毁前清理
|
|
95
|
+
onBeforeUnmount(() => {
|
|
96
|
+
if (checkEditorTimer.value) {
|
|
97
|
+
clearInterval(checkEditorTimer.value)
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
// 暴露方法给父组件
|
|
101
|
+
defineExpose({ getEditor, createVitalSigns })
|
|
102
|
+
|
|
103
|
+
// 定义事件
|
|
104
|
+
const emit = defineEmits(['editor-ready', 'load'])
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style scoped>
|
|
108
|
+
iframe {
|
|
109
|
+
border: none;
|
|
110
|
+
width: 100%;
|
|
111
|
+
min-height: 800px;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'ExceptionQuery',
|
|
4
|
-
components: {
|
|
5
|
-
XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue')
|
|
6
|
-
},
|
|
7
|
-
props: {
|
|
8
|
-
currUserInfo: {
|
|
9
|
-
type: Object,
|
|
10
|
-
default: () => undefined
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
mounted () {
|
|
14
|
-
this.$refs.xFormTable.refresh(true)
|
|
15
|
-
},
|
|
16
|
-
data () {
|
|
17
|
-
return {
|
|
18
|
-
// 查询配置名称
|
|
19
|
-
queryParamsName: 'ExceptionRecordQueryCRUD',
|
|
20
|
-
fixedQueryForm: { ex_f_userfiles_id: this.currUserInfo.f_userfiles_id },
|
|
21
|
-
// 新增表单固定值
|
|
22
|
-
fixedAddForm: {},
|
|
23
|
-
// 是否显示详情抽屉
|
|
24
|
-
detailVisible: false,
|
|
25
|
-
// 当前记录
|
|
26
|
-
record: {}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<template>
|
|
33
|
-
<a-card :bordered="false">
|
|
34
|
-
<x-form-table
|
|
35
|
-
title="异常查询"
|
|
36
|
-
:queryParamsName="queryParamsName"
|
|
37
|
-
:fixedQueryForm="fixedQueryForm"
|
|
38
|
-
ref="xFormTable">
|
|
39
|
-
</x-form-table>
|
|
40
|
-
</a-card>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<style scoped>
|
|
44
|
-
|
|
45
|
-
</style>
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'ExceptionQuery',
|
|
4
|
+
components: {
|
|
5
|
+
XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue')
|
|
6
|
+
},
|
|
7
|
+
props: {
|
|
8
|
+
currUserInfo: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => undefined
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
mounted () {
|
|
14
|
+
this.$refs.xFormTable.refresh(true)
|
|
15
|
+
},
|
|
16
|
+
data () {
|
|
17
|
+
return {
|
|
18
|
+
// 查询配置名称
|
|
19
|
+
queryParamsName: 'ExceptionRecordQueryCRUD',
|
|
20
|
+
fixedQueryForm: { ex_f_userfiles_id: this.currUserInfo.f_userfiles_id },
|
|
21
|
+
// 新增表单固定值
|
|
22
|
+
fixedAddForm: {},
|
|
23
|
+
// 是否显示详情抽屉
|
|
24
|
+
detailVisible: false,
|
|
25
|
+
// 当前记录
|
|
26
|
+
record: {}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<a-card :bordered="false">
|
|
34
|
+
<x-form-table
|
|
35
|
+
title="异常查询"
|
|
36
|
+
:queryParamsName="queryParamsName"
|
|
37
|
+
:fixedQueryForm="fixedQueryForm"
|
|
38
|
+
ref="xFormTable">
|
|
39
|
+
</x-form-table>
|
|
40
|
+
</a-card>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
|
|
45
|
+
</style>
|
|
@@ -53,8 +53,8 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
|
|
|
53
53
|
routerResource.example = {
|
|
54
54
|
path: 'example',
|
|
55
55
|
name: '示例主页面',
|
|
56
|
-
component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
57
|
-
|
|
56
|
+
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
57
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
58
58
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
59
59
|
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
|
60
60
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
package/src/theme/global.less
CHANGED
|
@@ -47,7 +47,7 @@ ol {
|
|
|
47
47
|
.ant-table-tbody {
|
|
48
48
|
// 成功样式 - 绿色 (#52c41a)
|
|
49
49
|
.ant-table-row-success {
|
|
50
|
-
background-color: rgba(82, 196, 26, 0.2);
|
|
50
|
+
background-color: rgba(82, 196, 26, 0.2) !important;
|
|
51
51
|
|
|
52
52
|
&:hover {
|
|
53
53
|
background-color: rgba(82, 196, 26, 0.3);
|
|
@@ -73,7 +73,7 @@ ol {
|
|
|
73
73
|
|
|
74
74
|
// 警告样式 - 黄色 (#faad14)
|
|
75
75
|
.ant-table-row-warning {
|
|
76
|
-
background-color: rgba(250, 173, 20, 0.1) ;
|
|
76
|
+
background-color: rgba(250, 173, 20, 0.1) !important;
|
|
77
77
|
|
|
78
78
|
&:hover {
|
|
79
79
|
background-color: rgba(250, 173, 20, 0.15) ;
|
|
@@ -99,7 +99,7 @@ ol {
|
|
|
99
99
|
|
|
100
100
|
// 错误样式 - 红色 (#f5222f)
|
|
101
101
|
.ant-table-row-error {
|
|
102
|
-
background-color: rgba(245, 34, 47, 0.1) ;
|
|
102
|
+
background-color: rgba(245, 34, 47, 0.1) !important;
|
|
103
103
|
|
|
104
104
|
&:hover {
|
|
105
105
|
background-color: rgba(245, 34, 47, 0.15) ;
|
|
@@ -125,7 +125,7 @@ ol {
|
|
|
125
125
|
|
|
126
126
|
// 魔法样式 - 紫色
|
|
127
127
|
.ant-table-row-magic {
|
|
128
|
-
background-color: rgba(114, 46, 209, 0.1) ;
|
|
128
|
+
background-color: rgba(114, 46, 209, 0.1) !important;
|
|
129
129
|
|
|
130
130
|
&:hover {
|
|
131
131
|
background-color: rgba(114, 46, 209, 0.15) ;
|
package/src/utils/map-utils.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
-
let Amap
|
|
3
|
-
async function GetGDMap (secretKey, key) {
|
|
4
|
-
if (!Amap) {
|
|
5
|
-
window._AMapSecurityConfig = {
|
|
6
|
-
securityJsCode: secretKey
|
|
7
|
-
}
|
|
8
|
-
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
-
AMapLoader.reset()
|
|
10
|
-
Amap = await AMapLoader.load({
|
|
11
|
-
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
-
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
-
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
-
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
-
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
-
AMapUI: {
|
|
17
|
-
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
-
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
return Amap
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function getGDMap (address) {
|
|
26
|
-
new (await GetGDMap()).Geocoder({
|
|
27
|
-
radius: 500 // 范围,默认:500
|
|
28
|
-
}).getLocation(address, function (status, result) {
|
|
29
|
-
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
-
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
-
} else {
|
|
32
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
-
throw new Error('根据经纬度查询地址失败')
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function GetLocation (address) {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
try {
|
|
41
|
-
resolve(getGDMap(address))
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
export { GetGDMap, GetLocation }
|
|
1
|
+
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
+
let Amap
|
|
3
|
+
async function GetGDMap (secretKey, key) {
|
|
4
|
+
if (!Amap) {
|
|
5
|
+
window._AMapSecurityConfig = {
|
|
6
|
+
securityJsCode: secretKey
|
|
7
|
+
}
|
|
8
|
+
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
+
AMapLoader.reset()
|
|
10
|
+
Amap = await AMapLoader.load({
|
|
11
|
+
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
+
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
+
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
+
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
+
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
+
AMapUI: {
|
|
17
|
+
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
+
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
return Amap
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function getGDMap (address) {
|
|
26
|
+
new (await GetGDMap()).Geocoder({
|
|
27
|
+
radius: 500 // 范围,默认:500
|
|
28
|
+
}).getLocation(address, function (status, result) {
|
|
29
|
+
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
+
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
+
} else {
|
|
32
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
+
throw new Error('根据经纬度查询地址失败')
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function GetLocation (address) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
try {
|
|
41
|
+
resolve(getGDMap(address))
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
export { GetGDMap, GetLocation }
|