vue2-client 1.14.34 → 1.14.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/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +144 -153
- package/src/base-client/components/his/XShiftSchedule/dome.vue +8 -2
- package/src/base-client/components/his/threeTestOrders/dome.vue +17 -0
- package/src/base-client/components/his/threeTestOrders/textBox.vue +22 -29
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +1 -1
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +101 -27
- package/src/utils/map-utils.js +47 -47
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import AmapPointRendering from './AmapPointRendering'
|
|
2
|
-
|
|
3
|
-
export default AmapPointRendering
|
|
1
|
+
import AmapPointRendering from './AmapPointRendering'
|
|
2
|
+
|
|
3
|
+
export default AmapPointRendering
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import XDetailsView from './XDetailsView'
|
|
2
|
-
|
|
3
|
-
export default XDetailsView
|
|
1
|
+
import XDetailsView from './XDetailsView'
|
|
2
|
+
|
|
3
|
+
export default XDetailsView
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import XFormGroupDetails from './XFormGroupDetails'
|
|
2
|
-
|
|
3
|
-
export default XFormGroupDetails
|
|
1
|
+
import XFormGroupDetails from './XFormGroupDetails'
|
|
2
|
+
|
|
3
|
+
export default XFormGroupDetails
|
|
@@ -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
|
+
}
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
:columns="columns"
|
|
4
4
|
:data-source="data"
|
|
5
5
|
:rowSelection="rowSelection"
|
|
6
|
-
|
|
6
|
+
:scroll="{ y: '75vh' }">
|
|
7
7
|
<span slot="time" class="time-title">
|
|
8
|
-
<span
|
|
9
|
-
<span>下</span>
|
|
10
|
-
<span>晚</span>
|
|
8
|
+
<span v-for="(item, index) in configData.timePeriod" :key=index>{{item}}</span>
|
|
11
9
|
</span>
|
|
12
10
|
<template slot="Monday" slot-scope="text, record">
|
|
13
11
|
<div class="time-title">
|
|
@@ -45,108 +43,100 @@
|
|
|
45
43
|
</div>
|
|
46
44
|
</template>
|
|
47
45
|
<template slot="sk_limit" slot-scope="text, record">
|
|
48
|
-
<a-input-number id="inputNumber" v-model="record.sk_limit" :min="
|
|
46
|
+
<a-input-number id="inputNumber" v-model="record.sk_limit" :min="configData.sk_limitMin" :max="configData.sk_limitMax" />
|
|
49
47
|
</template>
|
|
50
48
|
</a-table>
|
|
51
49
|
</template>
|
|
52
50
|
<script>
|
|
53
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
54
|
-
|
|
55
|
-
const columns = [
|
|
56
|
-
{
|
|
57
|
-
title: '科室',
|
|
58
|
-
dataIndex: 'dept',
|
|
59
|
-
key: 'dept',
|
|
60
|
-
scopedSlots: { customRender: 'dept' },
|
|
61
|
-
align: 'center'
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
title: '人员',
|
|
65
|
-
dataIndex: 'personnel',
|
|
66
|
-
key: 'personnel',
|
|
67
|
-
align: 'center'
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
title: '职位',
|
|
71
|
-
dataIndex: 'position',
|
|
72
|
-
key: 'position',
|
|
73
|
-
align: 'center'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
title: '上/下/晚',
|
|
77
|
-
dataIndex: 'time',
|
|
78
|
-
key: 'time',
|
|
79
|
-
scopedSlots: { customRender: 'time' },
|
|
80
|
-
align: 'center'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
title: '周一',
|
|
84
|
-
key: 'Monday',
|
|
85
|
-
dataIndex: 'Monday',
|
|
86
|
-
scopedSlots: { customRender: 'Monday' },
|
|
87
|
-
align: 'center'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
title: '周二',
|
|
91
|
-
key: 'Tuesday',
|
|
92
|
-
dataIndex: 'Tuesday',
|
|
93
|
-
scopedSlots: { customRender: 'Tuesday' },
|
|
94
|
-
align: 'center'
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
title: '周三',
|
|
98
|
-
key: 'Wednesday',
|
|
99
|
-
dataIndex: 'Wednesday',
|
|
100
|
-
scopedSlots: { customRender: 'Wednesday' },
|
|
101
|
-
align: 'center'
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
title: '周四',
|
|
105
|
-
key: 'Thursday',
|
|
106
|
-
dataIndex: 'Thursday',
|
|
107
|
-
scopedSlots: { customRender: 'Thursday' },
|
|
108
|
-
align: 'center'
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
title: '周五',
|
|
112
|
-
key: 'Friday',
|
|
113
|
-
dataIndex: 'Friday',
|
|
114
|
-
scopedSlots: { customRender: 'Friday' },
|
|
115
|
-
align: 'center'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
title: '周六',
|
|
119
|
-
key: 'Saturday',
|
|
120
|
-
dataIndex: 'Saturday',
|
|
121
|
-
scopedSlots: { customRender: 'Saturday' },
|
|
122
|
-
align: 'center'
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
title: '周日',
|
|
126
|
-
key: 'Sunday',
|
|
127
|
-
dataIndex: 'Sunday',
|
|
128
|
-
scopedSlots: { customRender: 'Sunday' },
|
|
129
|
-
align: 'center'
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
title: '排班数',
|
|
133
|
-
key: 'sk_limit',
|
|
134
|
-
dataIndex: 'sk_limit',
|
|
135
|
-
scopedSlots: { customRender: 'sk_limit' },
|
|
136
|
-
align: 'center'
|
|
137
|
-
}
|
|
138
|
-
]
|
|
51
|
+
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
139
52
|
|
|
140
53
|
export default {
|
|
141
54
|
data () {
|
|
142
55
|
return {
|
|
143
56
|
data: [],
|
|
144
|
-
|
|
145
|
-
|
|
57
|
+
// 列配置
|
|
58
|
+
columns: [],
|
|
59
|
+
// 列名
|
|
60
|
+
columnNames: [],
|
|
146
61
|
// 选中的行键值集合
|
|
147
62
|
selectedRows: [],
|
|
148
63
|
// 选中的行信息集合
|
|
149
|
-
selectedRowKeys: []
|
|
64
|
+
selectedRowKeys: [],
|
|
65
|
+
// 原始数据备份
|
|
66
|
+
originalData: [],
|
|
67
|
+
// 配置参数
|
|
68
|
+
configData: {},
|
|
69
|
+
// 排班时间表
|
|
70
|
+
shiftTable: [
|
|
71
|
+
{
|
|
72
|
+
title: '周一',
|
|
73
|
+
key: 'Monday',
|
|
74
|
+
dataIndex: 'Monday',
|
|
75
|
+
scopedSlots: { customRender: 'Monday' },
|
|
76
|
+
align: 'center'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: '周二',
|
|
80
|
+
key: 'Tuesday',
|
|
81
|
+
dataIndex: 'Tuesday',
|
|
82
|
+
scopedSlots: { customRender: 'Tuesday' },
|
|
83
|
+
align: 'center'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: '周三',
|
|
87
|
+
key: 'Wednesday',
|
|
88
|
+
dataIndex: 'Wednesday',
|
|
89
|
+
scopedSlots: { customRender: 'Wednesday' },
|
|
90
|
+
align: 'center'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: '周四',
|
|
94
|
+
key: 'Thursday',
|
|
95
|
+
dataIndex: 'Thursday',
|
|
96
|
+
scopedSlots: { customRender: 'Thursday' },
|
|
97
|
+
align: 'center'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: '周五',
|
|
101
|
+
key: 'Friday',
|
|
102
|
+
dataIndex: 'Friday',
|
|
103
|
+
scopedSlots: { customRender: 'Friday' },
|
|
104
|
+
align: 'center'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: '周六',
|
|
108
|
+
key: 'Saturday',
|
|
109
|
+
dataIndex: 'Saturday',
|
|
110
|
+
scopedSlots: { customRender: 'Saturday' },
|
|
111
|
+
align: 'center'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '周日',
|
|
115
|
+
key: 'Sunday',
|
|
116
|
+
dataIndex: 'Sunday',
|
|
117
|
+
scopedSlots: { customRender: 'Sunday' },
|
|
118
|
+
align: 'center'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: '排班数',
|
|
122
|
+
key: 'sk_limit',
|
|
123
|
+
dataIndex: 'sk_limit',
|
|
124
|
+
scopedSlots: { customRender: 'sk_limit' },
|
|
125
|
+
align: 'center'
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
props: {
|
|
131
|
+
// 配置名
|
|
132
|
+
queryParamsName: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: ''
|
|
135
|
+
},
|
|
136
|
+
// 服务名
|
|
137
|
+
serviceName: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: 'af-his'
|
|
150
140
|
}
|
|
151
141
|
},
|
|
152
142
|
computed: {
|
|
@@ -159,9 +149,7 @@ export default {
|
|
|
159
149
|
}
|
|
160
150
|
}
|
|
161
151
|
},
|
|
162
|
-
mounted () {
|
|
163
|
-
this.init()
|
|
164
|
-
},
|
|
152
|
+
mounted () {},
|
|
165
153
|
methods: {
|
|
166
154
|
handleShiftChange (day, index, record) {
|
|
167
155
|
// 找到当前记录在data中的索引
|
|
@@ -174,75 +162,78 @@ export default {
|
|
|
174
162
|
this.$set(record[day], index, newValue)
|
|
175
163
|
// 同步更新data中的数据
|
|
176
164
|
this.$set(this.data[dataIndex][day], index, newValue)
|
|
177
|
-
console.log('当前操作的行数据:', this.data[dataIndex])
|
|
178
165
|
},
|
|
179
166
|
onSelectChange (selectedRowKeys, selectedRows) {
|
|
180
167
|
this.selectedRowKeys = selectedRowKeys
|
|
181
168
|
this.selectedRows = selectedRows
|
|
182
|
-
console.log('selectedRows changed: ', selectedRows)
|
|
183
169
|
},
|
|
184
170
|
// 获取选中的行数据
|
|
185
171
|
getSelectedRowData () {
|
|
186
172
|
return this.selectedRows
|
|
187
173
|
},
|
|
188
|
-
|
|
174
|
+
// 获取全部数据
|
|
175
|
+
getAllTable () {
|
|
189
176
|
return this.data
|
|
190
177
|
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
]
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
]
|
|
240
|
-
}
|
|
241
|
-
return scheduleData
|
|
242
|
-
})
|
|
243
|
-
}
|
|
178
|
+
// 初始化数据
|
|
179
|
+
async init (queryParamsName) {
|
|
180
|
+
getConfigByName(queryParamsName, this.serviceName, result => {
|
|
181
|
+
this.configData = result
|
|
182
|
+
runLogic(result.dataSource, {}, this.serviceName).then(res => {
|
|
183
|
+
this.columns = []
|
|
184
|
+
this.columns = JSON.parse(JSON.stringify(this.configData.columns))
|
|
185
|
+
for (let i = 0; i < this.shiftTable.length; i++) {
|
|
186
|
+
this.columns.push(this.shiftTable[i])
|
|
187
|
+
}
|
|
188
|
+
if (res && Array.isArray(res)) {
|
|
189
|
+
const weekDays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
|
|
190
|
+
const shifts = ['am', 'pm', 'evening']
|
|
191
|
+
let key = 0
|
|
192
|
+
this.data = res.map(item => {
|
|
193
|
+
const scheduleData = {
|
|
194
|
+
key: key++
|
|
195
|
+
}
|
|
196
|
+
this.configData.columnsName.forEach(columnName => { scheduleData[columnName] = item[columnName] })
|
|
197
|
+
weekDays.forEach(day => {
|
|
198
|
+
scheduleData[day.charAt(0).toUpperCase() + day.slice(1)] = shifts.map(shift => item[`f_${day}_${shift}`] === '1' ? 1 : 0)
|
|
199
|
+
})
|
|
200
|
+
return scheduleData
|
|
201
|
+
})
|
|
202
|
+
// 保存原始数据
|
|
203
|
+
this.originalData = JSON.parse(JSON.stringify(this.data))
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
},
|
|
208
|
+
// 查询数据函数
|
|
209
|
+
filterTableData (filters) {
|
|
210
|
+
if (!filters || Object.keys(filters).length === 0) {
|
|
211
|
+
// 如果没有过滤条件,恢复原始数据
|
|
212
|
+
this.data = JSON.parse(JSON.stringify(this.originalData))
|
|
213
|
+
return
|
|
214
|
+
}
|
|
215
|
+
// 从原始数据开始过滤
|
|
216
|
+
this.data = this.originalData.filter(item => {
|
|
217
|
+
// 检查每一项是否满足所有过滤条件
|
|
218
|
+
return Object.entries(filters).every(([key, value]) => {
|
|
219
|
+
// 如果过滤值是字符串,进行模糊匹配
|
|
220
|
+
if (typeof value === 'string') {
|
|
221
|
+
return item[key] && item[key].toString().toLowerCase().includes(value.toLowerCase())
|
|
222
|
+
}
|
|
223
|
+
// 如果过滤值是数字,进行精确匹配
|
|
224
|
+
return item[key] === value
|
|
225
|
+
})
|
|
244
226
|
})
|
|
245
227
|
}
|
|
228
|
+
},
|
|
229
|
+
watch: {
|
|
230
|
+
queryParamsName: {
|
|
231
|
+
handler (newValue) {
|
|
232
|
+
this.init(newValue)
|
|
233
|
+
},
|
|
234
|
+
deep: true,
|
|
235
|
+
immediate: true
|
|
236
|
+
}
|
|
246
237
|
}
|
|
247
238
|
}
|
|
248
239
|
</script>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<XShiftSchedule
|
|
2
|
+
<XShiftSchedule
|
|
3
|
+
:query-params-name="queryParamsName"
|
|
4
|
+
:service-name="serviceName"
|
|
5
|
+
>
|
|
3
6
|
</XShiftSchedule>
|
|
4
7
|
</template>
|
|
5
8
|
|
|
@@ -12,7 +15,10 @@ export default {
|
|
|
12
15
|
XShiftSchedule
|
|
13
16
|
},
|
|
14
17
|
data () {
|
|
15
|
-
return {
|
|
18
|
+
return {
|
|
19
|
+
queryParamsName: 'schedulingRuleConfigurationConfig',
|
|
20
|
+
serviceName: 'af-his'
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
}
|
|
18
24
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ThreeTestOrders from './threeTestOrders.vue'
|
|
3
|
+
export default {
|
|
4
|
+
components: {
|
|
5
|
+
ThreeTestOrders
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<three-test-orders>
|
|
12
|
+
</three-test-orders>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style scoped lang="less">
|
|
16
|
+
|
|
17
|
+
</style>
|
|
@@ -101,44 +101,37 @@ const resetForm = () => {
|
|
|
101
101
|
formErrors.value = {}
|
|
102
102
|
|
|
103
103
|
const today = new Date().toISOString().split('T')[0]
|
|
104
|
-
const isBaby = props.modalType === 'baby'
|
|
105
104
|
|
|
106
105
|
// 重置所有字段
|
|
107
|
-
formData.id = props.id
|
|
106
|
+
formData.id = props.id
|
|
108
107
|
formData.name = ''
|
|
109
108
|
formData.inDate = today
|
|
110
109
|
formData.diag = ''
|
|
111
|
-
formData.dept =
|
|
110
|
+
formData.dept = ''
|
|
112
111
|
formData.bed = ''
|
|
113
112
|
formData.medicalNo = ''
|
|
114
113
|
formData.begin = today
|
|
115
114
|
formData.operateDate = ''
|
|
116
|
-
formData.notes =
|
|
117
|
-
formData.sex = '
|
|
118
|
-
formData.weight =
|
|
119
|
-
formData.heart = '
|
|
120
|
-
formData.tempType =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
formData.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
formData.
|
|
127
|
-
formData.
|
|
128
|
-
formData.
|
|
129
|
-
formData.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
formData.
|
|
133
|
-
formData.
|
|
134
|
-
formData.
|
|
135
|
-
formData.
|
|
136
|
-
formData.data5 = '2,4,5,3,3,3,2,,2'
|
|
137
|
-
formData.data6 = '167cm,,,,,,,,,164cm'
|
|
138
|
-
formData.data7 = '95kg,,,,,90kg'
|
|
139
|
-
formData.data8 = '青霉素,'
|
|
140
|
-
formData.data9 = '测试,'
|
|
141
|
-
formData.pain = '2,2,4,5,8,8,9|2,6|3,,,4,4,4'
|
|
115
|
+
formData.notes = ''
|
|
116
|
+
formData.sex = ''
|
|
117
|
+
formData.weight = ''
|
|
118
|
+
formData.heart = ''
|
|
119
|
+
formData.tempType = ''
|
|
120
|
+
formData.temperature = ''
|
|
121
|
+
formData.physicalcool = ''
|
|
122
|
+
formData.breath = ''
|
|
123
|
+
formData.sphygmus = ''
|
|
124
|
+
formData.labels = ''
|
|
125
|
+
formData.data1 = ''
|
|
126
|
+
formData.data2 = ''
|
|
127
|
+
formData.data3 = ''
|
|
128
|
+
formData.data4 = ''
|
|
129
|
+
formData.data5 = ''
|
|
130
|
+
formData.data6 = ''
|
|
131
|
+
formData.data7 = ''
|
|
132
|
+
formData.data8 = ''
|
|
133
|
+
formData.data9 = ''
|
|
134
|
+
formData.pain = ''
|
|
142
135
|
}
|
|
143
136
|
|
|
144
137
|
// 处理JSON字符串数据
|
|
@@ -123,39 +123,54 @@
|
|
|
123
123
|
<div style="text-align: center">
|
|
124
124
|
<a-radio-group style="margin-top: 20px">
|
|
125
125
|
<a-space>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<p>{{ nextBtnTitle }}</p>
|
|
129
|
-
</template>
|
|
126
|
+
<!-- 动态按钮渲染 -->
|
|
127
|
+
<template v-if="buttonGroup && buttonGroup.actionArr">
|
|
130
128
|
<a-button
|
|
131
|
-
v-
|
|
132
|
-
:
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
v-for="(button, index) in buttonGroup.actionArr"
|
|
130
|
+
:key="index"
|
|
131
|
+
v-show="checkButtonVisible(button)"
|
|
132
|
+
:type="button.type ? button.type : 'default'"
|
|
133
|
+
@click="handleCustomButtonClick(button)"
|
|
135
134
|
>
|
|
136
|
-
|
|
137
|
-
<a-icon type="right"/>
|
|
135
|
+
{{ button.text }}
|
|
138
136
|
</a-button>
|
|
139
|
-
</
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
</template>
|
|
138
|
+
<!-- 原有的按钮逻辑 -->
|
|
139
|
+
<template>
|
|
140
|
+
<a-popover v-if="operationType === 'submit'">
|
|
141
|
+
<template slot="content">
|
|
142
|
+
<p>{{ nextBtnTitle }}</p>
|
|
143
|
+
</template>
|
|
144
|
+
<a-button
|
|
145
|
+
v-show="!lastStep"
|
|
146
|
+
:disabled="!showNextBtn && !stepDone"
|
|
147
|
+
type="primary"
|
|
148
|
+
@click="nextClick"
|
|
149
|
+
>
|
|
150
|
+
提交
|
|
151
|
+
<a-icon type="right"/>
|
|
152
|
+
</a-button>
|
|
153
|
+
</a-popover>
|
|
154
|
+
<a-popover v-else :title="stepNextBtnTitle">
|
|
155
|
+
<template slot="content">
|
|
156
|
+
<p v-for="(item,index) in stepNextBtnText" :key="index">{{ item }}</p>
|
|
157
|
+
</template>
|
|
158
|
+
<a-button
|
|
159
|
+
v-if="showStepNextBtn && !lastStep"
|
|
160
|
+
type="primary"
|
|
161
|
+
@click="stepNextClick"
|
|
162
|
+
>
|
|
163
|
+
跳跃
|
|
164
|
+
</a-button>
|
|
165
|
+
</a-popover>
|
|
144
166
|
<a-button
|
|
145
|
-
v-
|
|
167
|
+
v-show="lastStep"
|
|
146
168
|
type="primary"
|
|
147
|
-
@click="
|
|
169
|
+
@click="lastStepNextClick"
|
|
148
170
|
>
|
|
149
|
-
|
|
171
|
+
确认完工
|
|
150
172
|
</a-button>
|
|
151
|
-
</
|
|
152
|
-
<a-button
|
|
153
|
-
v-show="lastStep"
|
|
154
|
-
type="primary"
|
|
155
|
-
@click="lastStepNextClick"
|
|
156
|
-
>
|
|
157
|
-
确认完工
|
|
158
|
-
</a-button>
|
|
173
|
+
</template>
|
|
159
174
|
</a-space>
|
|
160
175
|
</a-radio-group>
|
|
161
176
|
</div>
|
|
@@ -220,6 +235,9 @@ import WorkFlowTimeline from './WorkFlowTimeline.vue'
|
|
|
220
235
|
import { FileItem, ImageItem } from '@vue2-client/components/FileImageItem'
|
|
221
236
|
import WorkflowListResolution from './WorkflowListResolution'
|
|
222
237
|
import { commonApi } from '@vue2-client/services/api'
|
|
238
|
+
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
239
|
+
import * as util from '@vue2-client/utils/util'
|
|
240
|
+
import { getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
|
|
223
241
|
|
|
224
242
|
export default {
|
|
225
243
|
name: 'WorkFlowHandle',
|
|
@@ -350,7 +368,9 @@ export default {
|
|
|
350
368
|
// 是否需要选择人员
|
|
351
369
|
needSelectPerson: true,
|
|
352
370
|
// 下一环节人员信息
|
|
353
|
-
chargePerson: {}
|
|
371
|
+
chargePerson: {},
|
|
372
|
+
// 动态按钮配置
|
|
373
|
+
buttonGroup: null
|
|
354
374
|
}
|
|
355
375
|
},
|
|
356
376
|
async mounted () {
|
|
@@ -410,6 +430,21 @@ export default {
|
|
|
410
430
|
this.formCompletedDataPreview = null
|
|
411
431
|
this.operationType = 'submit'
|
|
412
432
|
},
|
|
433
|
+
async showQueryFormItemFunc () {
|
|
434
|
+
if (this.attr.showQueryFormItemFunc) {
|
|
435
|
+
const obj = executeStrFunctionByContext(this, this.attr.showQueryFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode])
|
|
436
|
+
// 判断是 bool 还是 obj 兼容
|
|
437
|
+
if (typeof obj === 'boolean') {
|
|
438
|
+
this.show = obj
|
|
439
|
+
} else if (obj && typeof obj === 'object') {
|
|
440
|
+
// obj 是一个对象,并且不是数组
|
|
441
|
+
this.show = obj?.show
|
|
442
|
+
this.readOnly = obj?.readOnly
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
this.show = true
|
|
446
|
+
}
|
|
447
|
+
},
|
|
413
448
|
// 获取单个步骤的定义
|
|
414
449
|
getSingleStepDefine (name) {
|
|
415
450
|
for (const step of this.stepsDefine) {
|
|
@@ -677,6 +712,13 @@ export default {
|
|
|
677
712
|
},
|
|
678
713
|
// 加载完成
|
|
679
714
|
resolveStep () {
|
|
715
|
+
// 获取当前步骤的按钮组配置
|
|
716
|
+
const currentStep = this.stepsDefine[this.currentStepId - 1]
|
|
717
|
+
if (currentStep && currentStep.properties && currentStep.properties.buttonGroup) {
|
|
718
|
+
this.buttonGroup = currentStep.properties.buttonGroup
|
|
719
|
+
} else {
|
|
720
|
+
this.buttonGroup = null
|
|
721
|
+
}
|
|
680
722
|
this.loading = false
|
|
681
723
|
},
|
|
682
724
|
// 流程图组件给当前组件传值用,stepNo为用户点击的非当前步骤
|
|
@@ -928,6 +970,38 @@ export default {
|
|
|
928
970
|
if (this.chargePersonOptions.length === 1) {
|
|
929
971
|
this.checkedChargePerson = this.chargePersonOptions[0].value
|
|
930
972
|
}
|
|
973
|
+
},
|
|
974
|
+
// 处理动态按钮点击
|
|
975
|
+
handleCustomButtonClick (button) {
|
|
976
|
+
try {
|
|
977
|
+
// 执行自定义函数
|
|
978
|
+
if (button.func) {
|
|
979
|
+
const result = executeStrFunctionByContext(this, button.func, [this.details, this.$refs.xAddForm.form, util, runLogic, getConfigByNameAsync])
|
|
980
|
+
if (result) {
|
|
981
|
+
// 如果返回true,执行对应的操作
|
|
982
|
+
if (button.text === '提交') {
|
|
983
|
+
this.nextClick()
|
|
984
|
+
} else if (button.text === '取消') {
|
|
985
|
+
this.$emit('cancel')
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
} catch (error) {
|
|
990
|
+
console.error('执行自定义按钮函数失败:', error)
|
|
991
|
+
this.$message.error('执行操作失败')
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
// 检查按钮是否显示
|
|
995
|
+
checkButtonVisible (button) {
|
|
996
|
+
try {
|
|
997
|
+
if (button.customFunction) {
|
|
998
|
+
return executeStrFunctionByContext(this, button.customFunction, [this.details, this.$refs.xAddForm.form, util, runLogic, getConfigByNameAsync])
|
|
999
|
+
}
|
|
1000
|
+
return true
|
|
1001
|
+
} catch (error) {
|
|
1002
|
+
console.error('执行按钮显示函数失败:', error)
|
|
1003
|
+
return false
|
|
1004
|
+
}
|
|
931
1005
|
}
|
|
932
1006
|
},
|
|
933
1007
|
watch: {}
|
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 }
|