vue2-client 1.16.35 → 1.16.36
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/base-client/components/common/XFormTable/demo.vue +45 -7
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XWebSocketProgress/index.vue +6 -1
- package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -0
- package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +4 -2
- package/src/utils/map-utils.js +47 -47
- package/vue.config.js +0 -6
package/package.json
CHANGED
@@ -4,8 +4,12 @@
|
|
4
4
|
title="示例表单"
|
5
5
|
:queryParamsName="queryParamsName"
|
6
6
|
:fixedAddForm="fixedAddForm"
|
7
|
+
:x-tree-config-name="xTreeConfigName"
|
7
8
|
:externalSelectedRowKeys="selectedKeys"
|
8
|
-
|
9
|
+
@action="action"
|
10
|
+
@selectRow="selectRow"
|
11
|
+
@columnClick="columnClick"
|
12
|
+
serviceName="af-revenue"
|
9
13
|
ref="xFormTable">
|
10
14
|
</x-form-table>
|
11
15
|
</a-card>
|
@@ -13,18 +17,19 @@
|
|
13
17
|
|
14
18
|
<script>
|
15
19
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
16
|
-
import
|
20
|
+
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
17
21
|
|
18
22
|
export default {
|
19
23
|
name: 'Demo',
|
20
24
|
components: {
|
21
|
-
XFormTable
|
22
|
-
XAddNativeForm
|
25
|
+
XFormTable
|
23
26
|
},
|
24
27
|
data () {
|
25
28
|
return {
|
26
29
|
// 查询配置文件名
|
27
|
-
queryParamsName: '
|
30
|
+
queryParamsName: 'address_management',
|
31
|
+
// 查询配置左侧tree
|
32
|
+
xTreeConfigName: 'addressType',
|
28
33
|
// 新增表单固定值
|
29
34
|
fixedAddForm: {},
|
30
35
|
// 是否显示详情抽屉
|
@@ -39,9 +44,42 @@ export default {
|
|
39
44
|
}
|
40
45
|
}
|
41
46
|
},
|
42
|
-
mounted () {
|
43
|
-
},
|
44
47
|
methods: {
|
48
|
+
test () {
|
49
|
+
this.$refs.xFormTable.setTableData([])
|
50
|
+
},
|
51
|
+
defaultF () {
|
52
|
+
this.$refs.xFormTable.setTableSize('default')
|
53
|
+
},
|
54
|
+
middleF () {
|
55
|
+
this.$refs.xFormTable.setTableSize('middle')
|
56
|
+
},
|
57
|
+
smallF () {
|
58
|
+
this.$refs.xFormTable.setTableSize('small')
|
59
|
+
},
|
60
|
+
columnClick (key, value, record) {
|
61
|
+
microDispatch({
|
62
|
+
type: 'v3route',
|
63
|
+
path: '/bingliguanli/dianzibingliluru',
|
64
|
+
props: { selected: arguments[0].his_f_admission_id }
|
65
|
+
})
|
66
|
+
},
|
67
|
+
action (record, id, actionType) {
|
68
|
+
this.detailVisible = true
|
69
|
+
console.log('触发了详情操作', record, id, actionType)
|
70
|
+
},
|
71
|
+
onClose () {
|
72
|
+
this.detailVisible = false
|
73
|
+
// 关闭详情之后重新查询表单
|
74
|
+
this.$refs.xFormTable.refreshTable(true)
|
75
|
+
},
|
76
|
+
selectRow (selectedRowKeys, selectedRows) {
|
77
|
+
this.selected = {
|
78
|
+
keys: selectedRowKeys,
|
79
|
+
rows: selectedRows
|
80
|
+
}
|
81
|
+
console.log('selectedDemo', this.selected)
|
82
|
+
},
|
45
83
|
},
|
46
84
|
computed: {},
|
47
85
|
}
|
@@ -1,186 +1,186 @@
|
|
1
|
-
// print.js
|
2
|
-
|
3
|
-
export function printElement (elementToPrint) {
|
4
|
-
// 创建一个新的浏览器窗口
|
5
|
-
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
6
|
-
// 设置新窗口的文档内容
|
7
|
-
printWindow.document.write(`
|
8
|
-
<html>
|
9
|
-
<head>
|
10
|
-
<title>Print</title>
|
11
|
-
<style>
|
12
|
-
@page {
|
13
|
-
size: auto;
|
14
|
-
margin: 0mm;
|
15
|
-
}
|
16
|
-
html, body {
|
17
|
-
margin: 0;
|
18
|
-
padding: 0;
|
19
|
-
width: 100%;
|
20
|
-
height: 100%;
|
21
|
-
}
|
22
|
-
#print-container {
|
23
|
-
display: none
|
24
|
-
}
|
25
|
-
.img{
|
26
|
-
width: 95%;
|
27
|
-
height: 180px;
|
28
|
-
object-fit: cover;
|
29
|
-
}
|
30
|
-
.reportMain {
|
31
|
-
text-align: center;
|
32
|
-
margin: 0 auto;
|
33
|
-
font-size: 16px;
|
34
|
-
color: #000;
|
35
|
-
background-color: #fff;
|
36
|
-
padding: 15px;
|
37
|
-
border-radius: 8px;
|
38
|
-
|
39
|
-
.reportTitle {
|
40
|
-
font-weight: bold;
|
41
|
-
}
|
42
|
-
|
43
|
-
.subTitle {
|
44
|
-
display: flex;
|
45
|
-
justify-content: space-between;
|
46
|
-
margin-bottom: 1%;
|
47
|
-
|
48
|
-
.subTitleItems {
|
49
|
-
max-width: 30%;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
.inputsDiv {
|
54
|
-
display: flex;
|
55
|
-
justify-content: space-between;
|
56
|
-
.inputsDivItem {
|
57
|
-
display: flex;
|
58
|
-
align-items: center;
|
59
|
-
padding: 0 4px;
|
60
|
-
white-space: nowrap;
|
61
|
-
.inputsDivItemLabel {
|
62
|
-
padding: 0 4px;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
.reportTable {
|
68
|
-
width: 100%;
|
69
|
-
border-collapse: collapse;
|
70
|
-
table-layout:fixed;
|
71
|
-
word-break:break-all;
|
72
|
-
text-align: center;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
.reportMainForDisplay {
|
76
|
-
text-align: center;
|
77
|
-
margin: 10% auto;
|
78
|
-
font-size: 16px;
|
79
|
-
color: #000;
|
80
|
-
background-color: #fff;
|
81
|
-
padding: 15px;
|
82
|
-
border-radius: 8px;
|
83
|
-
|
84
|
-
.reportTitle {
|
85
|
-
font-weight: bold;
|
86
|
-
}
|
87
|
-
|
88
|
-
.subTitle {
|
89
|
-
display: flex;
|
90
|
-
justify-content: space-between;
|
91
|
-
|
92
|
-
.subTitleItems {
|
93
|
-
max-width: 30%;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
.inputsDiv {
|
98
|
-
display: flex;
|
99
|
-
justify-content: space-around;
|
100
|
-
.inputsDivItem {
|
101
|
-
display: flex;
|
102
|
-
align-items: center;
|
103
|
-
padding: 0 4px;
|
104
|
-
white-space: nowrap;
|
105
|
-
.inputsDivItemLabel {
|
106
|
-
padding: 0 4px;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
.reportTable {
|
112
|
-
width: 100%;
|
113
|
-
border-collapse: collapse;
|
114
|
-
table-layout:fixed;
|
115
|
-
word-break:break-all;
|
116
|
-
}
|
117
|
-
}
|
118
|
-
.reportMainNoPadding {
|
119
|
-
text-align: center;
|
120
|
-
margin: 0 auto;
|
121
|
-
font-size: 16px;
|
122
|
-
color: #000;
|
123
|
-
background-color: #fff;
|
124
|
-
border-radius: 8px;
|
125
|
-
|
126
|
-
.reportTitle {
|
127
|
-
font-weight: bold;
|
128
|
-
}
|
129
|
-
|
130
|
-
.subTitle {
|
131
|
-
display: flex;
|
132
|
-
justify-content: space-between;
|
133
|
-
|
134
|
-
.subTitleItems {
|
135
|
-
max-width: 30%;
|
136
|
-
}
|
137
|
-
}
|
138
|
-
|
139
|
-
.inputsDiv {
|
140
|
-
display: flex;
|
141
|
-
justify-content: space-between;
|
142
|
-
.inputsDivItem {
|
143
|
-
display: flex;
|
144
|
-
align-items: center;
|
145
|
-
padding: 0 4px;
|
146
|
-
white-space: nowrap;
|
147
|
-
.inputsDivItemLabel {
|
148
|
-
padding: 0 4px;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
|
-
.reportTable {
|
154
|
-
width: 100%;
|
155
|
-
border-collapse: collapse;
|
156
|
-
table-layout:fixed;
|
157
|
-
word-break:break-all;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
.tools{
|
161
|
-
position: fixed;
|
162
|
-
right: 2%;
|
163
|
-
text-align: right;
|
164
|
-
width: 60%;
|
165
|
-
cursor: pointer;
|
166
|
-
.toolsItem{
|
167
|
-
width: 15%;
|
168
|
-
margin-right: 3%;
|
169
|
-
display: inline-block;
|
170
|
-
}
|
171
|
-
}
|
172
|
-
</style>
|
173
|
-
</head>
|
174
|
-
<body>
|
175
|
-
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
176
|
-
${elementToPrint.innerHTML}
|
177
|
-
</body>
|
178
|
-
</html>
|
179
|
-
`)
|
180
|
-
// 延迟执行打印,以确保新窗口的内容已加载完成
|
181
|
-
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
182
|
-
setTimeout(() => {
|
183
|
-
printWindow.print() // 调用打印方法
|
184
|
-
printWindow.close()
|
185
|
-
}, 500) // 延迟500毫秒后执行打印
|
186
|
-
}
|
1
|
+
// print.js
|
2
|
+
|
3
|
+
export function printElement (elementToPrint) {
|
4
|
+
// 创建一个新的浏览器窗口
|
5
|
+
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
6
|
+
// 设置新窗口的文档内容
|
7
|
+
printWindow.document.write(`
|
8
|
+
<html>
|
9
|
+
<head>
|
10
|
+
<title>Print</title>
|
11
|
+
<style>
|
12
|
+
@page {
|
13
|
+
size: auto;
|
14
|
+
margin: 0mm;
|
15
|
+
}
|
16
|
+
html, body {
|
17
|
+
margin: 0;
|
18
|
+
padding: 0;
|
19
|
+
width: 100%;
|
20
|
+
height: 100%;
|
21
|
+
}
|
22
|
+
#print-container {
|
23
|
+
display: none
|
24
|
+
}
|
25
|
+
.img{
|
26
|
+
width: 95%;
|
27
|
+
height: 180px;
|
28
|
+
object-fit: cover;
|
29
|
+
}
|
30
|
+
.reportMain {
|
31
|
+
text-align: center;
|
32
|
+
margin: 0 auto;
|
33
|
+
font-size: 16px;
|
34
|
+
color: #000;
|
35
|
+
background-color: #fff;
|
36
|
+
padding: 15px;
|
37
|
+
border-radius: 8px;
|
38
|
+
|
39
|
+
.reportTitle {
|
40
|
+
font-weight: bold;
|
41
|
+
}
|
42
|
+
|
43
|
+
.subTitle {
|
44
|
+
display: flex;
|
45
|
+
justify-content: space-between;
|
46
|
+
margin-bottom: 1%;
|
47
|
+
|
48
|
+
.subTitleItems {
|
49
|
+
max-width: 30%;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
.inputsDiv {
|
54
|
+
display: flex;
|
55
|
+
justify-content: space-between;
|
56
|
+
.inputsDivItem {
|
57
|
+
display: flex;
|
58
|
+
align-items: center;
|
59
|
+
padding: 0 4px;
|
60
|
+
white-space: nowrap;
|
61
|
+
.inputsDivItemLabel {
|
62
|
+
padding: 0 4px;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
.reportTable {
|
68
|
+
width: 100%;
|
69
|
+
border-collapse: collapse;
|
70
|
+
table-layout:fixed;
|
71
|
+
word-break:break-all;
|
72
|
+
text-align: center;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
.reportMainForDisplay {
|
76
|
+
text-align: center;
|
77
|
+
margin: 10% auto;
|
78
|
+
font-size: 16px;
|
79
|
+
color: #000;
|
80
|
+
background-color: #fff;
|
81
|
+
padding: 15px;
|
82
|
+
border-radius: 8px;
|
83
|
+
|
84
|
+
.reportTitle {
|
85
|
+
font-weight: bold;
|
86
|
+
}
|
87
|
+
|
88
|
+
.subTitle {
|
89
|
+
display: flex;
|
90
|
+
justify-content: space-between;
|
91
|
+
|
92
|
+
.subTitleItems {
|
93
|
+
max-width: 30%;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
.inputsDiv {
|
98
|
+
display: flex;
|
99
|
+
justify-content: space-around;
|
100
|
+
.inputsDivItem {
|
101
|
+
display: flex;
|
102
|
+
align-items: center;
|
103
|
+
padding: 0 4px;
|
104
|
+
white-space: nowrap;
|
105
|
+
.inputsDivItemLabel {
|
106
|
+
padding: 0 4px;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
.reportTable {
|
112
|
+
width: 100%;
|
113
|
+
border-collapse: collapse;
|
114
|
+
table-layout:fixed;
|
115
|
+
word-break:break-all;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
.reportMainNoPadding {
|
119
|
+
text-align: center;
|
120
|
+
margin: 0 auto;
|
121
|
+
font-size: 16px;
|
122
|
+
color: #000;
|
123
|
+
background-color: #fff;
|
124
|
+
border-radius: 8px;
|
125
|
+
|
126
|
+
.reportTitle {
|
127
|
+
font-weight: bold;
|
128
|
+
}
|
129
|
+
|
130
|
+
.subTitle {
|
131
|
+
display: flex;
|
132
|
+
justify-content: space-between;
|
133
|
+
|
134
|
+
.subTitleItems {
|
135
|
+
max-width: 30%;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
.inputsDiv {
|
140
|
+
display: flex;
|
141
|
+
justify-content: space-between;
|
142
|
+
.inputsDivItem {
|
143
|
+
display: flex;
|
144
|
+
align-items: center;
|
145
|
+
padding: 0 4px;
|
146
|
+
white-space: nowrap;
|
147
|
+
.inputsDivItemLabel {
|
148
|
+
padding: 0 4px;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
.reportTable {
|
154
|
+
width: 100%;
|
155
|
+
border-collapse: collapse;
|
156
|
+
table-layout:fixed;
|
157
|
+
word-break:break-all;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
.tools{
|
161
|
+
position: fixed;
|
162
|
+
right: 2%;
|
163
|
+
text-align: right;
|
164
|
+
width: 60%;
|
165
|
+
cursor: pointer;
|
166
|
+
.toolsItem{
|
167
|
+
width: 15%;
|
168
|
+
margin-right: 3%;
|
169
|
+
display: inline-block;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
</style>
|
173
|
+
</head>
|
174
|
+
<body>
|
175
|
+
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
176
|
+
${elementToPrint.innerHTML}
|
177
|
+
</body>
|
178
|
+
</html>
|
179
|
+
`)
|
180
|
+
// 延迟执行打印,以确保新窗口的内容已加载完成
|
181
|
+
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
182
|
+
setTimeout(() => {
|
183
|
+
printWindow.print() // 调用打印方法
|
184
|
+
printWindow.close()
|
185
|
+
}, 500) // 延迟500毫秒后执行打印
|
186
|
+
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
style="padding-right: 20px;" />
|
7
7
|
|
8
8
|
<!-- 连接状态指示 -->
|
9
|
-
<div class="connection-status">
|
9
|
+
<div v-if="showConnectionStatus" class="connection-status">
|
10
10
|
<a-tooltip :title="connectionStatusText">
|
11
11
|
<a-badge
|
12
12
|
:status="connectionBadgeStatus"
|
@@ -62,6 +62,11 @@ export default {
|
|
62
62
|
}
|
63
63
|
},
|
64
64
|
computed: {
|
65
|
+
// 是否显示连接状态
|
66
|
+
showConnectionStatus () {
|
67
|
+
return this.progressValue < 100
|
68
|
+
},
|
69
|
+
|
65
70
|
// 连接状态文本
|
66
71
|
connectionStatusText () {
|
67
72
|
if (this.connectionState.isConnected) {
|
@@ -0,0 +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>
|
@@ -36,7 +36,7 @@ import UserException from '@vue2-client/pages/userInfoDetailManage/UserException
|
|
36
36
|
import PriceAdjustments from '@vue2-client/pages/userInfoDetailManage/PriceAdjustments'
|
37
37
|
import uploadFilesHistory from '@vue2-client/pages/userInfoDetailManage/uploadFilesHistory'
|
38
38
|
import InsuranceDetailQuery from '@vue2-client/pages/userInfoDetailManage/InsuranceDetailQuery'
|
39
|
-
|
39
|
+
import ExceptionRecordQuery from '@vue2-client/pages/userInfoDetailManage/ExceptionRecordQuery'
|
40
40
|
export default {
|
41
41
|
name: 'UserInfoDetailQueryTabs',
|
42
42
|
components: {
|
@@ -59,7 +59,8 @@ export default {
|
|
59
59
|
UserException,
|
60
60
|
PriceAdjustments,
|
61
61
|
uploadFilesHistory,
|
62
|
-
InsuranceDetailQuery
|
62
|
+
InsuranceDetailQuery,
|
63
|
+
ExceptionRecordQuery
|
63
64
|
},
|
64
65
|
props: {
|
65
66
|
userInfo: {
|
@@ -112,6 +113,7 @@ export default {
|
|
112
113
|
{ key: '15', label: '价格调整', permission: '价格调整', component: 'PriceAdjustments' },
|
113
114
|
{ key: '16', label: '附件查看', permission: '附件查看', component: 'uploadFilesHistory' },
|
114
115
|
{ key: '17', label: '保险明细', permission: '保险明细', component: 'InsuranceDetailQuery' },
|
116
|
+
{ key: '18', label: '异常查看', permission: '异常查看', component: 'ExceptionRecordQuery', condition: () => this.userInfo?.f_meter_type === '物联网表' },
|
115
117
|
],
|
116
118
|
}
|
117
119
|
},
|
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 }
|
package/vue.config.js
CHANGED
@@ -42,12 +42,6 @@ module.exports = {
|
|
42
42
|
ws: false,
|
43
43
|
changeOrigin: true
|
44
44
|
},
|
45
|
-
'/socket/af-system': {
|
46
|
-
target: 'http://127.0.0.1:9002',
|
47
|
-
ws: true,
|
48
|
-
changeOrigin: true,
|
49
|
-
pathRewrite: { '^/socket/af-system': '/concept-websocket' },
|
50
|
-
},
|
51
45
|
'/revenue-web/api/af-revenue': {
|
52
46
|
pathRewrite: { '^/revenue-web/': '/' },
|
53
47
|
target: v3Server,
|