vue2-client 1.14.29 → 1.14.30
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/AddressSearchCombobox/AddressSearchCombobox.vue +95 -55
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/his/XTitle/README.md +1 -1
- package/src/utils/map-utils.js +47 -47
- package/src/utils/request.js +2 -1
package/package.json
CHANGED
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
title="地址选择"
|
|
30
30
|
@ok="selected"
|
|
31
31
|
:zIndex="m_index"
|
|
32
|
-
:destroyOnClose="true"
|
|
32
|
+
:destroyOnClose="true"
|
|
33
|
+
width="70%"
|
|
34
|
+
>
|
|
33
35
|
<div class="certain-category-search-wrapper">
|
|
34
36
|
<a-auto-complete
|
|
35
37
|
style="right: 0px;width: 90%;z-index:2;margin-top:2%;"
|
|
@@ -189,15 +191,92 @@ export default {
|
|
|
189
191
|
radius: 500 // 范围,默认:500
|
|
190
192
|
})
|
|
191
193
|
this.map.addControl(new (aMap).ToolBar()) // 初始化工具插件
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
|
|
195
|
+
// 等待地图加载完成
|
|
196
|
+
this.map.on('complete', () => {
|
|
197
|
+
// 获取地图中心点
|
|
198
|
+
const center = this.map.getCenter()
|
|
199
|
+
|
|
200
|
+
// 创建标记对象 - 使用默认样式
|
|
201
|
+
this.marker = new (aMap).Marker({
|
|
202
|
+
position: [center.lng, center.lat], // 使用地图中心点作为初始位置
|
|
203
|
+
map: this.map // 直接在地图创建时添加标记
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
// 获取中心点地址信息
|
|
207
|
+
this.geocoder.getAddress(center, (status, result) => {
|
|
208
|
+
if (status === 'complete' && result.info === 'OK') {
|
|
209
|
+
const addressComponent = result.regeocode.addressComponent
|
|
210
|
+
this.divisions.province = addressComponent.province
|
|
211
|
+
this.divisions.city = addressComponent.city
|
|
212
|
+
this.divisions.district = addressComponent.district
|
|
213
|
+
this.divisions.township = addressComponent.township
|
|
214
|
+
this.divisions.towncode = addressComponent.towncode
|
|
215
|
+
this.divisions.street = addressComponent.street
|
|
216
|
+
|
|
217
|
+
// 获取小区信息
|
|
218
|
+
if (result.regeocode.aois && result.regeocode.aois.length) {
|
|
219
|
+
this.divisions.area = result.regeocode.aois[0].name
|
|
220
|
+
} else if (result.regeocode.pois && result.regeocode.pois.length) {
|
|
221
|
+
this.divisions.area = result.regeocode.pois[0].name
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
|
|
225
|
+
|
|
226
|
+
if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
|
|
227
|
+
this.readOnlyDivisions = true
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
this.addressObj.address = result.regeocode.formattedAddress
|
|
231
|
+
this.addressObj.lng_lat = `${center.lng},${center.lat}`
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
// 添加地图点击事件
|
|
237
|
+
this.map.on('click', (e) => {
|
|
238
|
+
const lnglat = e.lnglat
|
|
239
|
+
this.curPosition = lnglat
|
|
240
|
+
|
|
241
|
+
// 更新标记位置
|
|
242
|
+
this.marker.setPosition([lnglat.lng, lnglat.lat])
|
|
243
|
+
|
|
244
|
+
// 将地图中心移动到点击位置
|
|
245
|
+
this.map.setCenter([lnglat.lng, lnglat.lat])
|
|
246
|
+
|
|
247
|
+
// 获取点击位置的地址信息
|
|
248
|
+
this.geocoder.getAddress(lnglat, (status, result) => {
|
|
249
|
+
if (status === 'complete' && result.info === 'OK') {
|
|
250
|
+
const addressComponent = result.regeocode.addressComponent
|
|
251
|
+
this.divisions.province = addressComponent.province
|
|
252
|
+
this.divisions.city = addressComponent.city
|
|
253
|
+
this.divisions.district = addressComponent.district
|
|
254
|
+
this.divisions.township = addressComponent.township
|
|
255
|
+
this.divisions.towncode = addressComponent.towncode
|
|
256
|
+
this.divisions.street = addressComponent.street
|
|
257
|
+
|
|
258
|
+
// 获取小区信息
|
|
259
|
+
if (result.regeocode.aois && result.regeocode.aois.length) {
|
|
260
|
+
this.divisions.area = result.regeocode.aois[0].name
|
|
261
|
+
} else if (result.regeocode.pois && result.regeocode.pois.length) {
|
|
262
|
+
this.divisions.area = result.regeocode.pois[0].name
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
this.divisions.str = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
|
|
266
|
+
|
|
267
|
+
if (this.divisions.str && result.regeocode.formattedAddress.startsWith(this.divisions.str)) {
|
|
268
|
+
this.readOnlyDivisions = true
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (!this.searchFlag) {
|
|
272
|
+
this.addressObj.address = result.regeocode.formattedAddress
|
|
273
|
+
this.addressObj.lng_lat = `${lnglat.lng},${lnglat.lat}`
|
|
274
|
+
} else {
|
|
275
|
+
this.searchFlag = false
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
})
|
|
201
280
|
},
|
|
202
281
|
onSelect (value) {
|
|
203
282
|
// 选中地址后不触发更新坐标
|
|
@@ -214,7 +293,11 @@ export default {
|
|
|
214
293
|
const label = labelMatch ? labelMatch[1].trim() : null
|
|
215
294
|
this.addressObj.address = this.mergeAddressAndLabel(this.addressObj.address, label)
|
|
216
295
|
this.addressObj.lng_lat = coordinatesMatch ? coordinatesMatch[1] : ''
|
|
217
|
-
|
|
296
|
+
|
|
297
|
+
// 更新地图中心和标记位置
|
|
298
|
+
const [lng, lat] = this.addressObj.lng_lat.split(',')
|
|
299
|
+
this.map.setCenter([lng, lat])
|
|
300
|
+
this.marker.setPosition([lng, lat])
|
|
218
301
|
},
|
|
219
302
|
mergeAddressAndLabel (address, label = '') {
|
|
220
303
|
// 从地址的末尾开始匹配标签的开头部分
|
|
@@ -337,53 +420,10 @@ export default {
|
|
|
337
420
|
GetGDMap(this.gaode_secret_key, this.gaode_key).then(aMap => {
|
|
338
421
|
this.initMap(aMap)
|
|
339
422
|
this.mapAutocomplete = new (aMap).AutoComplete({
|
|
340
|
-
// city 限定城市,默认全国
|
|
341
423
|
city: '全国',
|
|
342
424
|
dragEnable: true,
|
|
343
425
|
animateEnable: false
|
|
344
426
|
})
|
|
345
|
-
this.positionPicker = new window.AMapUI.PositionPicker({
|
|
346
|
-
mode: 'dragMap',
|
|
347
|
-
map: this.map
|
|
348
|
-
})
|
|
349
|
-
this.positionPicker.on('success', (positionResult) => {
|
|
350
|
-
console.log(positionResult)
|
|
351
|
-
console.log(positionResult.position)
|
|
352
|
-
this.curPosition = positionResult.position
|
|
353
|
-
// 设置 行政区划信息
|
|
354
|
-
if (positionResult?.regeocode?.addressComponent) {
|
|
355
|
-
const { addressComponent } = positionResult?.regeocode
|
|
356
|
-
this.divisions.province = addressComponent.province
|
|
357
|
-
this.divisions.city = addressComponent.city
|
|
358
|
-
this.divisions.district = addressComponent.district
|
|
359
|
-
this.divisions.township = addressComponent.township
|
|
360
|
-
this.divisions.towncode = addressComponent.towncode
|
|
361
|
-
this.divisions.street = addressComponent.street
|
|
362
|
-
// 试着获取小区
|
|
363
|
-
if (positionResult?.regeocode?.aois && positionResult?.regeocode?.aois.length) {
|
|
364
|
-
// 取第一个当做小区
|
|
365
|
-
this.divisions.area = positionResult?.regeocode?.aois[0]?.name
|
|
366
|
-
} else if (positionResult?.regeocode?.pois && positionResult?.regeocode?.pois.length) {
|
|
367
|
-
// 取第一个当做小区
|
|
368
|
-
this.divisions.area = positionResult?.regeocode?.pois[0]?.name
|
|
369
|
-
}
|
|
370
|
-
this.divisions.str =
|
|
371
|
-
`${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`
|
|
372
|
-
}
|
|
373
|
-
if (this.divisions.str && positionResult.address.startsWith(this.divisions.str)) {
|
|
374
|
-
// 如果 省市区信息和获取到的地址的前缀一致 那么省市区前缀禁止修改只能修改后面的 通过 onchange事件拦截
|
|
375
|
-
this.readOnlyDivisions = true
|
|
376
|
-
}
|
|
377
|
-
if (!this.searchFlag) {
|
|
378
|
-
this.addressObj.address = positionResult.address
|
|
379
|
-
this.addressObj.lng_lat = `${positionResult.position.lng},${positionResult.position.lat}`
|
|
380
|
-
} else {
|
|
381
|
-
this.searchFlag = false
|
|
382
|
-
}
|
|
383
|
-
})
|
|
384
|
-
this.positionPicker.on('fail', function (positionResult) {
|
|
385
|
-
})
|
|
386
|
-
this.positionPicker.start()
|
|
387
427
|
})
|
|
388
428
|
})
|
|
389
429
|
}
|
|
@@ -396,7 +436,7 @@ export default {
|
|
|
396
436
|
#addressSearchCombobox_map {
|
|
397
437
|
margin: 1% 0;
|
|
398
438
|
width: 100%;
|
|
399
|
-
height:
|
|
439
|
+
height: 600px;
|
|
400
440
|
text-align: center
|
|
401
441
|
}
|
|
402
442
|
|
|
@@ -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
|
+
}
|
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/src/utils/request.js
CHANGED
|
@@ -160,7 +160,8 @@ function loadInterceptors () {
|
|
|
160
160
|
if (['post'].includes(config.method.toLowerCase()) && v4SessionKey &&
|
|
161
161
|
!config.url.includes('/logic/openapi/') &&
|
|
162
162
|
!config.url.includes('devApi') &&
|
|
163
|
-
!config.url.includes('auth/login')
|
|
163
|
+
!config.url.includes('auth/login') &&
|
|
164
|
+
config.url.includes('api/af-')) {
|
|
164
165
|
if (config.data && !(config.data instanceof FormData)) {
|
|
165
166
|
config.data = {
|
|
166
167
|
encrypted: EncryptUtil.AESEncryptCBC(config.data, v4SessionKey)
|