vue2-client 1.14.12 → 1.14.14
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/XFormTable.vue +4 -0
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +5 -0
- package/src/base-client/components/common/XTable/XTable.vue +5 -0
- package/src/base-client/components/common/XTable/XTableWrapper.vue +5 -0
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +1 -0
- package/src/base-client/components/his/XSidebar/XSidebar.vue +3 -3
- package/src/base-client/components/his/XTitle/README.md +113 -0
- package/src/base-client/components/his/XTitle/XTitle.vue +159 -41
- package/src/components/STable/index.js +12 -0
- package/src/router/async/router.map.js +2 -2
- package/src/utils/map-utils.js +47 -47
package/package.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
@editButtonStateDataClick="editButtonStateDataClick"
|
|
83
83
|
@importExcelOk="importExcelOk"
|
|
84
84
|
@rowClick="handleRowClick"
|
|
85
|
+
@beforeDataChange="beforeDataChange"
|
|
85
86
|
@expand="onExpand">
|
|
86
87
|
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
|
87
88
|
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
@@ -824,6 +825,9 @@ export default {
|
|
|
824
825
|
handleRowClick (record) {
|
|
825
826
|
this.$emit('rowClick', record)
|
|
826
827
|
},
|
|
828
|
+
beforeDataChange (record) {
|
|
829
|
+
this.$emit('beforeDataChange', record)
|
|
830
|
+
},
|
|
827
831
|
onExpand (expanded, record) {
|
|
828
832
|
this.$emit('expand', expanded, record)
|
|
829
833
|
}
|
|
@@ -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
|
+
}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
:serverName="cell.serviceName"
|
|
35
35
|
v-on="getEventHandlers(cell)"
|
|
36
36
|
@hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
|
|
37
|
+
@beforeDataChange="beforeDataChange"
|
|
37
38
|
@rowClick="handleRowClick"
|
|
38
39
|
@onExpand="onExpand"
|
|
39
40
|
:queryParamsName="cell.slotConfig"
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
:serverName="cell.serviceName"
|
|
72
73
|
v-on="getEventHandlers(cell)"
|
|
73
74
|
@hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
|
|
75
|
+
@beforeDataChange="beforeDataChange"
|
|
74
76
|
@rowClick="handleRowClick"
|
|
75
77
|
@onExpand="onExpand"
|
|
76
78
|
:queryParamsName="cell.slotConfig"
|
|
@@ -220,6 +222,9 @@ export default {
|
|
|
220
222
|
handleRowClick (record) {
|
|
221
223
|
this.$emit('rowClick', record)
|
|
222
224
|
},
|
|
225
|
+
beforeDataChange (record) {
|
|
226
|
+
this.$emit('beforeDataChange', record)
|
|
227
|
+
},
|
|
223
228
|
onExpand (expanded, record) {
|
|
224
229
|
this.$emit('expand', expanded, record)
|
|
225
230
|
},
|
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
<x-table-wrapper
|
|
153
153
|
ref="table"
|
|
154
154
|
@rowClick="handleRowClick"
|
|
155
|
+
@beforeDataChange="beforeDataChange"
|
|
155
156
|
@expand="onExpand">
|
|
156
157
|
<template slot="expandedRowRender">
|
|
157
158
|
<!-- 列扩展栅格 -->
|
|
@@ -257,6 +258,7 @@
|
|
|
257
258
|
<x-table-wrapper
|
|
258
259
|
ref="selectedDataTable"
|
|
259
260
|
:load-selected-data="true"
|
|
261
|
+
@beforeDataChange="beforeDataChange"
|
|
260
262
|
@rowClick="handleRowClick">
|
|
261
263
|
</x-table-wrapper>
|
|
262
264
|
</a-modal>
|
|
@@ -1332,6 +1334,9 @@ export default {
|
|
|
1332
1334
|
handleRowClick (record) {
|
|
1333
1335
|
this.$emit('rowClick', record)
|
|
1334
1336
|
},
|
|
1337
|
+
beforeDataChange (record) {
|
|
1338
|
+
this.$emit('beforeDataChange', record)
|
|
1339
|
+
},
|
|
1335
1340
|
onExpand (expanded, record) {
|
|
1336
1341
|
this.$emit('expand', expanded, record)
|
|
1337
1342
|
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
:setScrollYHeight="tableContext.setScrollYHeight"
|
|
19
19
|
:selectRowMode="tableContext.selectRowMode"
|
|
20
20
|
:size="tableContext.tableSize"
|
|
21
|
+
@beforeDataChange="beforeDataChange"
|
|
21
22
|
@expand="onExpand"
|
|
22
23
|
@rowClick="handleRowClick"
|
|
23
24
|
>
|
|
@@ -152,6 +153,7 @@
|
|
|
152
153
|
:selectRowMode="tableContext.selectRowMode"
|
|
153
154
|
:size="tableContext.tableSize"
|
|
154
155
|
@rowClick="handleRowClick"
|
|
156
|
+
@beforeDataChange="beforeDataChange"
|
|
155
157
|
>
|
|
156
158
|
<template
|
|
157
159
|
v-for="(item, c_index) in tableContext.tableColumns"
|
|
@@ -297,6 +299,9 @@ export default {
|
|
|
297
299
|
handleRowClick (record) {
|
|
298
300
|
this.$emit('rowClick', record)
|
|
299
301
|
},
|
|
302
|
+
beforeDataChange (record) {
|
|
303
|
+
this.$emit('beforeDataChange', record)
|
|
304
|
+
},
|
|
300
305
|
onExpand (expanded, record) {
|
|
301
306
|
this.$emit('expand', expanded, record)
|
|
302
307
|
},
|
|
@@ -132,14 +132,14 @@ export default {
|
|
|
132
132
|
currentCol = currentCol.parentNode
|
|
133
133
|
}
|
|
134
134
|
if (currentCol) {
|
|
135
|
-
//
|
|
135
|
+
// 更新当前列的宽度
|
|
136
136
|
const drawerWidth = isOpen ? 33.3 : 2
|
|
137
137
|
// 强制更新样式
|
|
138
138
|
currentCol.style.cssText = `
|
|
139
139
|
flex: 0 0 ${drawerWidth}% !important;
|
|
140
140
|
max-width: ${drawerWidth}% !important;
|
|
141
141
|
transition: all 0.3s;`
|
|
142
|
-
//
|
|
142
|
+
// 触发XTab组件重新计算宽度
|
|
143
143
|
this.$nextTick(() => {
|
|
144
144
|
const tabComponent = this.$el.querySelector('.ant-tabs')
|
|
145
145
|
if (tabComponent) {
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
window.dispatchEvent(new Event('resize'))
|
|
148
148
|
}
|
|
149
149
|
})
|
|
150
|
-
//
|
|
150
|
+
// 更新其他列宽度
|
|
151
151
|
otherCols.forEach((col, index) => {
|
|
152
152
|
if (index < this.mainWithData.length) {
|
|
153
153
|
const widthValue = isOpen ? this.mainWithData[index].min : this.mainWithData[index].max
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# XTitle 组件
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
XTitle 是一个多功能的标题组件,可以显示标题文本或按钮,支持自定义下划线样式、颜色和宽度。
|
|
6
|
+
|
|
7
|
+
## 功能特点
|
|
8
|
+
|
|
9
|
+
- 支持显示标题或按钮
|
|
10
|
+
- 支持为标题添加下划线
|
|
11
|
+
- 支持自定义下划线颜色
|
|
12
|
+
- 支持自定义宽度
|
|
13
|
+
- 支持点击事件触发
|
|
14
|
+
|
|
15
|
+
## 使用方法
|
|
16
|
+
|
|
17
|
+
### 基本用法
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<x-title query-params-name="我的标题-title"></x-title>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 配置参数格式
|
|
24
|
+
|
|
25
|
+
XTitle 组件通过一个字符串参数进行配置
|
|
26
|
+
|
|
27
|
+
各部分说明:
|
|
28
|
+
|
|
29
|
+
1. `标题文本`: 显示的文本内容
|
|
30
|
+
2. `类型`: 可选值为 `title` 或 `button`
|
|
31
|
+
3. `点击事件名`: 点击时触发的事件名称
|
|
32
|
+
4. `线条`: 设置为 `line` 时显示下划线
|
|
33
|
+
5. `颜色`: 下划线的颜色(如 `red`、`#FF0000`)
|
|
34
|
+
6. `宽度`: 组件宽度,单位为像素(如 `800`)
|
|
35
|
+
|
|
36
|
+
## 使用示例
|
|
37
|
+
|
|
38
|
+
### 1. 基本标题
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<x-title query-params-name="患者信息-title"></x-title>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. 带下划线的标题
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<x-title query-params-name="患者信息-title--line"></x-title>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. 自定义下划线颜色和宽度
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<x-title query-params-name="患者信息-title--line-red-800"></x-title>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4. 带点击事件的标题
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<x-title query-params-name="患者信息-title-showPatient-line" @showPatient="handleShowPatient"></x-title>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 5. 按钮模式
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<x-title query-params-name="提交-button-submit" @submit="handleSubmit"></x-title>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 事件
|
|
69
|
+
|
|
70
|
+
当组件类型为 `button` 或在标题配置中设置了点击事件名时,点击组件会触发相应的事件。
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<template>
|
|
74
|
+
<x-title query-params-name="提交-button-submit" @submit="handleSubmit"></x-title>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script>
|
|
78
|
+
export default {
|
|
79
|
+
methods: {
|
|
80
|
+
handleSubmit() {
|
|
81
|
+
// 处理提交逻辑
|
|
82
|
+
console.log('提交按钮被点击');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 样式自定义
|
|
90
|
+
|
|
91
|
+
组件内部样式已预设,但可以通过父级样式或特定类名进行覆盖:
|
|
92
|
+
|
|
93
|
+
```vue
|
|
94
|
+
<template>
|
|
95
|
+
<div class="custom-container">
|
|
96
|
+
<x-title query-params-name="自定义标题-title"></x-title>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<style scoped>
|
|
101
|
+
.custom-container :deep(.x-title) {
|
|
102
|
+
font-size: 20px;
|
|
103
|
+
color: blue;
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 注意事项
|
|
109
|
+
|
|
110
|
+
1. 当未指定类型时,默认为 `title` 类型
|
|
111
|
+
2. 线条颜色需要是合法的 CSS 颜色值
|
|
112
|
+
3. 宽度值必须是数字,单位为像素
|
|
113
|
+
4. 组件默认宽度为 100%,设置自定义宽度时会覆盖此值
|
|
@@ -1,62 +1,180 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<div class="x-title-container">
|
|
3
|
+
<div
|
|
4
|
+
v-if="config.type === 'title'"
|
|
5
|
+
class="x-title"
|
|
6
|
+
:class="{ 'with-underline': config.line === 'line' }">
|
|
7
|
+
<span>{{ config.label }}</span>
|
|
8
|
+
<div
|
|
9
|
+
v-if="config.line === 'line'"
|
|
10
|
+
class="underline"
|
|
11
|
+
:style="getLineStyle()">
|
|
12
|
+
</div>
|
|
4
13
|
</div>
|
|
14
|
+
<div v-else-if="config.type === 'button'" class="x-button-container">
|
|
15
|
+
<a-button type="primary" @click="handleClick">{{ config.label }}</a-button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
5
18
|
</template>
|
|
6
19
|
|
|
7
20
|
<script>
|
|
8
21
|
export default {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
name: 'XTitle',
|
|
23
|
+
props: {
|
|
24
|
+
queryParamsName: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data () {
|
|
30
|
+
return {
|
|
31
|
+
config: {
|
|
32
|
+
label: '',
|
|
33
|
+
type: 'title',
|
|
34
|
+
clickName: '',
|
|
35
|
+
line: '',
|
|
36
|
+
color: '',
|
|
37
|
+
lineLength: ''
|
|
19
38
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
created () {
|
|
42
|
+
this.getData(this.queryParamsName)
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
getData (data) {
|
|
46
|
+
if (!data) return
|
|
47
|
+
|
|
48
|
+
// 检查是否包含分隔符
|
|
49
|
+
if (data.includes('-')) {
|
|
50
|
+
const parts = data.split('-')
|
|
51
|
+
|
|
52
|
+
// 根据部分数量设置配置
|
|
53
|
+
if (parts.length >= 6) {
|
|
54
|
+
// 包含颜色和线长度
|
|
55
|
+
this.config = {
|
|
56
|
+
label: parts[0],
|
|
57
|
+
type: parts[1],
|
|
58
|
+
clickName: parts[2],
|
|
59
|
+
line: parts[3],
|
|
60
|
+
color: parts[4],
|
|
61
|
+
lineLength: parts[5]
|
|
62
|
+
}
|
|
63
|
+
} else if (parts.length === 5) {
|
|
64
|
+
// 只包含颜色
|
|
65
|
+
this.config = {
|
|
66
|
+
label: parts[0],
|
|
67
|
+
type: parts[1],
|
|
68
|
+
clickName: parts[2],
|
|
69
|
+
line: parts[3],
|
|
70
|
+
color: parts[4],
|
|
71
|
+
lineLength: ''
|
|
72
|
+
}
|
|
73
|
+
} else if (parts.length === 4) {
|
|
74
|
+
this.config = {
|
|
75
|
+
label: parts[0],
|
|
76
|
+
type: parts[1],
|
|
77
|
+
clickName: parts[2],
|
|
78
|
+
line: parts[3],
|
|
79
|
+
color: '',
|
|
80
|
+
lineLength: ''
|
|
81
|
+
}
|
|
82
|
+
} else if (parts.length === 3) {
|
|
83
|
+
this.config = {
|
|
84
|
+
label: parts[0],
|
|
85
|
+
type: parts[1],
|
|
86
|
+
clickName: parts[2],
|
|
87
|
+
line: '',
|
|
88
|
+
color: '',
|
|
89
|
+
lineLength: ''
|
|
90
|
+
}
|
|
91
|
+
} else if (parts.length === 2) {
|
|
92
|
+
this.config = {
|
|
93
|
+
label: parts[0],
|
|
94
|
+
type: parts[1],
|
|
95
|
+
clickName: '',
|
|
96
|
+
line: '',
|
|
97
|
+
color: '',
|
|
98
|
+
lineLength: ''
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
this.config = {
|
|
102
|
+
label: data,
|
|
103
|
+
type: 'title',
|
|
104
|
+
clickName: '',
|
|
105
|
+
line: '',
|
|
106
|
+
color: '',
|
|
107
|
+
lineLength: ''
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
// 没有分隔符,按原来的方式处理
|
|
112
|
+
this.config = {
|
|
113
|
+
label: data,
|
|
114
|
+
type: 'title',
|
|
115
|
+
clickName: '',
|
|
116
|
+
line: '',
|
|
117
|
+
color: '',
|
|
118
|
+
lineLength: ''
|
|
30
119
|
}
|
|
120
|
+
}
|
|
31
121
|
},
|
|
32
|
-
|
|
33
|
-
|
|
122
|
+
handleClick () {
|
|
123
|
+
if (this.config.clickName) {
|
|
124
|
+
this.$emit(this.config.clickName)
|
|
125
|
+
}
|
|
34
126
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
127
|
+
getLineStyle () {
|
|
128
|
+
const style = {}
|
|
129
|
+
|
|
130
|
+
// 设置线条颜色
|
|
131
|
+
if (this.config.color) {
|
|
132
|
+
style.backgroundColor = this.config.color
|
|
133
|
+
} else {
|
|
134
|
+
style.backgroundColor = '#5D5C5C'
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 设置线条宽度
|
|
138
|
+
if (this.config.lineLength) {
|
|
139
|
+
style.width = this.config.lineLength + 'px'
|
|
140
|
+
} else {
|
|
141
|
+
style.width = '800'
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return style
|
|
39
145
|
}
|
|
40
146
|
}
|
|
147
|
+
}
|
|
41
148
|
</script>
|
|
149
|
+
|
|
42
150
|
<style scoped>
|
|
151
|
+
.x-title-container {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
}
|
|
156
|
+
|
|
43
157
|
.x-title {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
158
|
+
font-size: 18px;
|
|
159
|
+
font-weight: bold;
|
|
160
|
+
height: 26px;
|
|
161
|
+
width: 100%;
|
|
162
|
+
text-align: left;
|
|
163
|
+
font-family: "Source Han Sans", sans-serif;
|
|
164
|
+
color: #5D5C5C;
|
|
165
|
+
position: relative;
|
|
51
166
|
}
|
|
52
167
|
|
|
53
|
-
.
|
|
54
|
-
|
|
168
|
+
.underline {
|
|
169
|
+
position: absolute;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
left: 0;
|
|
172
|
+
height: 1px;
|
|
173
|
+
width: 100%;
|
|
174
|
+
background-color: #5D5C5C;
|
|
55
175
|
}
|
|
56
176
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
background-color: #5D5C5C;
|
|
60
|
-
margin: 13px 0;
|
|
177
|
+
.x-button-container {
|
|
178
|
+
text-align: right;
|
|
61
179
|
}
|
|
62
180
|
</style>
|
|
@@ -187,6 +187,18 @@ export default {
|
|
|
187
187
|
(this.sortOrder && { sortOrder: this.sortOrder }) || {},
|
|
188
188
|
{ ...filters }
|
|
189
189
|
)
|
|
190
|
+
|
|
191
|
+
// 在加载新数据前,将当前数据传递给父组件
|
|
192
|
+
if (this.localDataSource && this.localDataSource.length > 0) {
|
|
193
|
+
// 变化前的数据: oldData, 分页信息: pagination, 过滤条件: filters, 排序信息: sorter
|
|
194
|
+
this.$emit('beforeDataChange', {
|
|
195
|
+
oldData: this.localDataSource,
|
|
196
|
+
pagination: this.localPagination,
|
|
197
|
+
filters: filters,
|
|
198
|
+
sorter: sorter
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
|
|
190
202
|
const result = this.data(parameter)
|
|
191
203
|
// 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data
|
|
192
204
|
// eslint-disable-next-line
|
|
@@ -59,7 +59,7 @@ routerResource.example = {
|
|
|
59
59
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
60
60
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
61
61
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
62
|
-
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
62
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
63
63
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
|
64
64
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
65
65
|
// component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
|
|
@@ -74,7 +74,7 @@ routerResource.example = {
|
|
|
74
74
|
// component: () => import('@vue2-client/components/g2Charts/demo.vue'),
|
|
75
75
|
// component: () => import('@vue2-client/pages/LogicCallExample/index.vue'),
|
|
76
76
|
// component: () => import('@vue2-client/components/FilePreview/FilePreviewDemo.vue'),
|
|
77
|
-
|
|
77
|
+
component: () => import('@vue2-client/pages/ReportGrid/index.vue'),
|
|
78
78
|
}
|
|
79
79
|
// routerResource.example = () =>
|
|
80
80
|
// import('@vue2-client/pages/Example')
|
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 }
|