vue2-client 1.14.76 → 1.14.80
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/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +207 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +211 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +212 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +212 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +731 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +748 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +748 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +1071 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +1078 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +1077 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +1077 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +1077 -0
- package/package.json +1 -1
- package/src/base-client/components/common/XAddReport/XAddReport.vue +6 -1
- package/src/base-client/components/common/XReportGrid/XReport.vue +28 -5
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +19 -2
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +2 -2
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.json +3 -3
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.vue +46 -30
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaireDemo.vue +15 -4
- package/src/pages/addressSelect/addressDemo.vue +24 -0
- package/src/pages/addressSelect/index.vue +259 -0
- package/src/router/async/router.map.js +1 -0
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
width="80%"
|
|
7
7
|
height="60%"
|
|
8
8
|
okText="提交"
|
|
9
|
+
:footer="showButtons ? undefined : null"
|
|
9
10
|
@cancel="close"
|
|
10
11
|
@ok="onSubmit"
|
|
11
12
|
v-bind="attr">
|
|
@@ -67,6 +68,8 @@ export default {
|
|
|
67
68
|
outEnv: {},
|
|
68
69
|
// 外部传递来的 modal 参数
|
|
69
70
|
attr: {},
|
|
71
|
+
// 是否显示对话框按钮
|
|
72
|
+
showButtons: true,
|
|
70
73
|
}
|
|
71
74
|
},
|
|
72
75
|
provide () {
|
|
@@ -110,13 +113,15 @@ export default {
|
|
|
110
113
|
selectedId = null,
|
|
111
114
|
outEnv = {},
|
|
112
115
|
mixinData = {},
|
|
113
|
-
attr = {}
|
|
116
|
+
attr = {},
|
|
117
|
+
showButtons = true,
|
|
114
118
|
} = params
|
|
115
119
|
this.configName = configName
|
|
116
120
|
this.serverName = serverName
|
|
117
121
|
this.displayOnly = displayOnly
|
|
118
122
|
this.visible = true
|
|
119
123
|
this.attr = attr
|
|
124
|
+
this.showButtons = showButtons
|
|
120
125
|
// 有选中项,给选中项赋值
|
|
121
126
|
if (selectedId) {
|
|
122
127
|
this.selectedId = selectedId
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
type: String,
|
|
86
86
|
default: undefined,
|
|
87
87
|
},
|
|
88
|
-
//
|
|
88
|
+
// 本地配置,调试用
|
|
89
89
|
localConfig: {
|
|
90
90
|
type: Object,
|
|
91
91
|
default: undefined,
|
|
@@ -244,7 +244,8 @@ export default {
|
|
|
244
244
|
currUser: this.currUser,
|
|
245
245
|
getGlobalData: this.getGlobalData,
|
|
246
246
|
setGlobalData: this.setGlobalData,
|
|
247
|
-
findComponentByName: this.findComponentByName
|
|
247
|
+
findComponentByName: this.findComponentByName,
|
|
248
|
+
closeAddReport: this.closeAddReport,
|
|
248
249
|
}
|
|
249
250
|
},
|
|
250
251
|
methods: {
|
|
@@ -284,6 +285,27 @@ export default {
|
|
|
284
285
|
listClick (data) {
|
|
285
286
|
this.$emit('listClick', data)
|
|
286
287
|
},
|
|
288
|
+
closeAddReport () {
|
|
289
|
+
if (this.$refs.xAddReport) {
|
|
290
|
+
this.$refs.xAddReport.close()
|
|
291
|
+
}
|
|
292
|
+
let parent = this.$parent
|
|
293
|
+
while (parent) {
|
|
294
|
+
if (parent.$refs && parent.$refs.xAddReport) {
|
|
295
|
+
const addReportRefs = parent.$refs.xAddReport
|
|
296
|
+
if (Array.isArray(addReportRefs)) {
|
|
297
|
+
addReportRefs.forEach(ref => {
|
|
298
|
+
if (ref && typeof ref.close === 'function') {
|
|
299
|
+
ref.close()
|
|
300
|
+
}
|
|
301
|
+
})
|
|
302
|
+
} else if (typeof addReportRefs.close === 'function') {
|
|
303
|
+
addReportRefs.close()
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
parent = parent.$parent
|
|
307
|
+
}
|
|
308
|
+
},
|
|
287
309
|
slotRendered () {
|
|
288
310
|
if (this.config?.mountedFunction) {
|
|
289
311
|
let func = this.config.mountedFunction
|
|
@@ -402,7 +424,7 @@ export default {
|
|
|
402
424
|
* @param outEnv 其他传递给打开窗口的数据
|
|
403
425
|
* @param attr 传递给Modal弹框用的信息
|
|
404
426
|
*/
|
|
405
|
-
openDialog (configName, selectedId, mixinData, outEnv = {}, attr = {}) {
|
|
427
|
+
openDialog (configName, selectedId, mixinData, outEnv = {}, attr = {}, showButtons = true) {
|
|
406
428
|
console.log('openDialog', configName, selectedId)
|
|
407
429
|
this.$refs.xAddReport.init({
|
|
408
430
|
configName: configName,
|
|
@@ -410,6 +432,7 @@ export default {
|
|
|
410
432
|
mixinData: mixinData,
|
|
411
433
|
outEnv: outEnv,
|
|
412
434
|
attr,
|
|
435
|
+
showButtons: showButtons
|
|
413
436
|
})
|
|
414
437
|
},
|
|
415
438
|
openDrawer (configName, selectedId, mixinData, outEnv = {}, attr = {}) {
|
|
@@ -455,7 +478,7 @@ export default {
|
|
|
455
478
|
targetData = targetData[path]
|
|
456
479
|
}
|
|
457
480
|
}
|
|
458
|
-
//
|
|
481
|
+
// 将修改的数据,添加update = true属性
|
|
459
482
|
targetData.update = true
|
|
460
483
|
})
|
|
461
484
|
return tempData
|
|
@@ -723,7 +746,7 @@ export default {
|
|
|
723
746
|
titleCellFlag = false
|
|
724
747
|
firstSubLine = false
|
|
725
748
|
}
|
|
726
|
-
// 保存上一个的colspan
|
|
749
|
+
// 保存上一个的colspan保持生成的格子与原格式一致
|
|
727
750
|
preColSpan = cell.colSpan
|
|
728
751
|
})
|
|
729
752
|
|
|
@@ -216,7 +216,7 @@ export default {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
inject: ['openDialog', 'emitEvent', 'registerComponent', 'setColSpanByName', 'setGlobalData', 'getGlobalData', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser', 'isWidget', 'findComponentByName'],
|
|
219
|
+
inject: ['openDialog', 'emitEvent', 'registerComponent', 'setColSpanByName', 'setGlobalData', 'getGlobalData', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser', 'isWidget', 'findComponentByName', 'closeAddReport'],
|
|
220
220
|
methods: {
|
|
221
221
|
getWindow,
|
|
222
222
|
isMicroAppEnv,
|
|
@@ -659,7 +659,24 @@ export default {
|
|
|
659
659
|
continue
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
}
|
|
662
|
+
},
|
|
663
|
+
closeAddReport () {
|
|
664
|
+
// 获取所有 xAddReport 组件实例
|
|
665
|
+
const addReportRefs = this.$parent.$refs.xAddReport
|
|
666
|
+
if (addReportRefs) {
|
|
667
|
+
// 如果是数组,遍历关闭所有实例
|
|
668
|
+
if (Array.isArray(addReportRefs)) {
|
|
669
|
+
addReportRefs.forEach(ref => {
|
|
670
|
+
if (ref && typeof ref.close === 'function') {
|
|
671
|
+
ref.close()
|
|
672
|
+
}
|
|
673
|
+
})
|
|
674
|
+
} else if (typeof addReportRefs.close === 'function') {
|
|
675
|
+
// 如果是单个实例,直接关闭
|
|
676
|
+
addReportRefs.close()
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
},
|
|
663
680
|
},
|
|
664
681
|
beforeMount () {
|
|
665
682
|
if (this.useOssForImg) {
|
|
@@ -291,10 +291,10 @@ export default {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
// 拿取多于模板中的数据
|
|
294
|
-
const diff = Object.fromEntries(
|
|
294
|
+
const diff = this.bindObject? Object.fromEntries(
|
|
295
295
|
Object.entries(this.bindObject)
|
|
296
296
|
.filter(([key]) => !(key in this.editorRef.getBindObject()))
|
|
297
|
-
)
|
|
297
|
+
) : {}
|
|
298
298
|
this.codeData = {...this.codeData,...diff}
|
|
299
299
|
this.changeMode()
|
|
300
300
|
this.fileUrl = fileUrl
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"content": [
|
|
7
7
|
{
|
|
8
8
|
"key":"", //单行记录的标识
|
|
9
|
-
"
|
|
9
|
+
"style":"",//居中方式
|
|
10
10
|
"item": [
|
|
11
11
|
{
|
|
12
12
|
"type":"",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
|
-
//常量取值
|
|
22
|
-
type [radio,
|
|
21
|
+
//常量取值 checkBox多选
|
|
22
|
+
type [radio,selectionBox,text,input,time,describe]
|
|
23
23
|
justifyContent = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around']
|
|
24
24
|
|
|
25
25
|
"results": [{
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
<template v-else-if="column.type === 'radio'">
|
|
28
28
|
<x-radio
|
|
29
|
+
:class="['column-item']"
|
|
29
30
|
:key="`row-${index}-item-${idx}`"
|
|
30
31
|
:queryParamsName="column.configName"
|
|
31
32
|
@change="handleChange($event,column,index)">
|
|
32
33
|
</x-radio>
|
|
33
34
|
</template>
|
|
34
35
|
<template v-else-if="column.type === 'time'">
|
|
35
|
-
<x-time-select
|
|
36
|
+
<x-time-select :key="`row-${index}-item-${idx}`" :class="['column-item']" @change="handleChange($event,column,index)" :queryParamsName="column.configName">
|
|
36
37
|
</x-time-select>
|
|
37
38
|
</template>
|
|
38
39
|
<template v-else-if="column.type === 'text'">
|
|
@@ -88,10 +89,6 @@ export default {
|
|
|
88
89
|
async getData (queryParamsName) {
|
|
89
90
|
const that = this
|
|
90
91
|
getConfigByName(queryParamsName, 'af-his', res => {
|
|
91
|
-
if (!res.config.split) {
|
|
92
|
-
res.config.split = true
|
|
93
|
-
}
|
|
94
|
-
that.config = res.config
|
|
95
92
|
that.config = {
|
|
96
93
|
...that.config,
|
|
97
94
|
...res.config
|
|
@@ -116,11 +113,18 @@ export default {
|
|
|
116
113
|
this.mapping.push(this.results.length)
|
|
117
114
|
value.row_key = fields.key
|
|
118
115
|
this.results.push(value)
|
|
116
|
+
} else {
|
|
117
|
+
this.mapping.push(undefined)
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
})
|
|
122
121
|
},
|
|
123
122
|
refreshList (param) {
|
|
123
|
+
// 清空当前数据和映射关系
|
|
124
|
+
this.data = []
|
|
125
|
+
this.results = []
|
|
126
|
+
this.mapping = []
|
|
127
|
+
this.results = []
|
|
124
128
|
this.getData(this.queryParamsName, param)
|
|
125
129
|
},
|
|
126
130
|
// 行数据排量方式
|
|
@@ -136,15 +140,12 @@ export default {
|
|
|
136
140
|
const resultIndex = this.mapping[rowIndex]
|
|
137
141
|
if (resultIndex === undefined) return
|
|
138
142
|
if (column.type === 'selectionBox') {
|
|
139
|
-
this.results[resultIndex] = e.target.checked
|
|
143
|
+
this.results[resultIndex][column.key] = e.target.checked
|
|
140
144
|
} else if (column.type === 'input') {
|
|
141
|
-
this.results[resultIndex] = column.value
|
|
145
|
+
this.results[resultIndex][column.key] = column.value
|
|
146
|
+
} else if (column.type === 'radio' || column.type === 'time') {
|
|
147
|
+
this.results[resultIndex][column.key] = e
|
|
142
148
|
}
|
|
143
|
-
console.log('mapping', this.mapping)
|
|
144
|
-
console.log('results', this.results)
|
|
145
|
-
console.log('handleChange', column)
|
|
146
|
-
console.log('handleChange', e)
|
|
147
|
-
console.log('handleChange', rowIndex)
|
|
148
149
|
}
|
|
149
150
|
},
|
|
150
151
|
watch: {
|
|
@@ -162,42 +163,56 @@ export default {
|
|
|
162
163
|
</script>
|
|
163
164
|
|
|
164
165
|
<style scoped>
|
|
166
|
+
|
|
165
167
|
.list-wrapper {
|
|
166
|
-
|
|
167
|
-
overflow-y: auto;
|
|
168
|
-
padding-right: 2px;
|
|
168
|
+
border: 1px solid #f0f0f0;
|
|
169
169
|
}
|
|
170
|
-
|
|
171
170
|
.list-container {
|
|
172
171
|
width: 100%;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
|
|
176
|
-
.list-wrapper
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
174
|
+
/** 自定义滚动条样式
|
|
175
|
+
.list-wrapper {
|
|
176
|
+
max-height: 240px;
|
|
177
|
+
overflow-y: auto;
|
|
178
|
+
padding-right: 2px;
|
|
179
|
+
}
|
|
180
|
+
.list-wrapper::-webkit-scrollbar {
|
|
181
|
+
width: 6px;
|
|
182
|
+
}
|
|
184
183
|
|
|
185
|
-
.list-wrapper::-webkit-scrollbar-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
.list-wrapper::-webkit-scrollbar-thumb {
|
|
185
|
+
background-color: #d9d9d9;
|
|
186
|
+
border-radius: 3px;
|
|
187
|
+
}
|
|
188
188
|
|
|
189
|
+
.list-wrapper::-webkit-scrollbar-track {
|
|
190
|
+
background-color: #f0f0f0;
|
|
191
|
+
}
|
|
192
|
+
*/
|
|
189
193
|
/* header样式 */
|
|
190
194
|
.list-wrapper ::v-deep .ant-list-header {
|
|
191
195
|
background-color: #F4F4F4; /* 自定义背景色 */
|
|
192
196
|
display: flex;
|
|
193
197
|
justify-content: center;
|
|
194
198
|
}
|
|
195
|
-
|
|
199
|
+
.list-wrapper ::v-deep .x-radio-item {
|
|
200
|
+
margin-bottom: 0;
|
|
201
|
+
}
|
|
202
|
+
.list-wrapper ::v-deep .x-radio-item-container{
|
|
203
|
+
padding: 0;
|
|
204
|
+
}
|
|
205
|
+
.list-wrapper ::v-deep span.ant-radio + *{
|
|
206
|
+
padding: 0;
|
|
207
|
+
}
|
|
208
|
+
.list-wrapper ::v-deep .x-time-select {
|
|
209
|
+
width: auto !important;
|
|
210
|
+
}
|
|
196
211
|
/*每一行的整体样式*/
|
|
197
212
|
.row-item{
|
|
198
213
|
display: flex;
|
|
199
|
-
flex-wrap: wrap;
|
|
200
214
|
align-items: center;
|
|
215
|
+
padding: 2px;
|
|
201
216
|
}
|
|
202
217
|
/*行中每一列的数据*/
|
|
203
218
|
.column-item{
|
|
@@ -212,4 +227,5 @@ export default {
|
|
|
212
227
|
.item-input{
|
|
213
228
|
flex: 1;
|
|
214
229
|
}
|
|
230
|
+
|
|
215
231
|
</style>
|
|
@@ -2,22 +2,33 @@
|
|
|
2
2
|
import XQuestionnaire from './XQuestionnaire.vue'
|
|
3
3
|
import XRadio from '../XRadio/XRadio.vue'
|
|
4
4
|
export default {
|
|
5
|
-
name: '
|
|
5
|
+
name: 'XQuestionnaireDemo',
|
|
6
6
|
components: {
|
|
7
7
|
XQuestionnaire,
|
|
8
8
|
XRadio
|
|
9
9
|
},
|
|
10
10
|
data () {
|
|
11
11
|
return {
|
|
12
|
-
|
|
12
|
+
queryParamsName2: 'surgeryRiskAssessConfig2',
|
|
13
|
+
queryParamsName3: 'surgeryRiskAssessConfig3',
|
|
14
|
+
queryParamsName4: 'surgeryRiskAssessConfig4'
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
</script>
|
|
17
19
|
|
|
18
20
|
<template>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
+
<div style="display: flex">
|
|
22
|
+
|
|
23
|
+
<x-questionnaire :queryParamsName="queryParamsName2">
|
|
24
|
+
</x-questionnaire>
|
|
25
|
+
|
|
26
|
+
<x-questionnaire :queryParamsName="queryParamsName3">
|
|
27
|
+
</x-questionnaire>
|
|
28
|
+
|
|
29
|
+
<x-questionnaire :queryParamsName="queryParamsName4">
|
|
30
|
+
</x-questionnaire>
|
|
31
|
+
</div>
|
|
21
32
|
</template>
|
|
22
33
|
|
|
23
34
|
<style scoped>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 测试界面——测试地址选择新增组件-->
|
|
3
|
+
<div>
|
|
4
|
+
<a-button @click="open">打开选择地址弹窗</a-button>
|
|
5
|
+
<address-select :addressShow="showDialog"/>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import AddressSelect from '@/pages/addressSelect'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
components: { AddressSelect },
|
|
14
|
+
data: () => ({
|
|
15
|
+
showDialog: false
|
|
16
|
+
}),
|
|
17
|
+
methods: {
|
|
18
|
+
open () {
|
|
19
|
+
console.log('打开选择地址弹窗')
|
|
20
|
+
this.showDialog = true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable'
|
|
3
|
+
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
4
|
+
import { mapState } from 'vuex'
|
|
5
|
+
export default {
|
|
6
|
+
components: {
|
|
7
|
+
XFormTable
|
|
8
|
+
},
|
|
9
|
+
props: {
|
|
10
|
+
addressShow: {
|
|
11
|
+
required: true,
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
watch: {
|
|
17
|
+
addressShow (val) {
|
|
18
|
+
this.selectAddressVisible = val
|
|
19
|
+
},
|
|
20
|
+
'form.f_address_type' (newVal, oldVal) {
|
|
21
|
+
this.onAddressTypeChange(newVal, oldVal)
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
selectAddressVisible: false,
|
|
27
|
+
addAddressFlag: false,
|
|
28
|
+
form: {
|
|
29
|
+
f_address_type: '',
|
|
30
|
+
f_residential_area_id: '',
|
|
31
|
+
f_residential_area: '',
|
|
32
|
+
f_iscity: ''
|
|
33
|
+
},
|
|
34
|
+
addressModel: [
|
|
35
|
+
{
|
|
36
|
+
expression: '{f_building}楼号{f_unit}单元{f_floor}楼层{f_room}门牌号',
|
|
37
|
+
label: '城市',
|
|
38
|
+
value: '城市'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
expression: '{f_building}组{f_unit}号',
|
|
42
|
+
label: '乡镇',
|
|
43
|
+
value: '乡镇'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
expression: '{f_address}',
|
|
47
|
+
label: '自定义',
|
|
48
|
+
value: '自定义'
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
labelCol: { span: 4 },
|
|
52
|
+
wrapperCol: { span: 20 },
|
|
53
|
+
formItems: [],
|
|
54
|
+
areaList: [],
|
|
55
|
+
signContractVisible: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
selAddress (record) {
|
|
60
|
+
// 给表单赋值
|
|
61
|
+
const form = {
|
|
62
|
+
f_address: record.tua_f_address,
|
|
63
|
+
f_address_id: record.tua_id
|
|
64
|
+
}
|
|
65
|
+
console.log('选择了地址是', form)
|
|
66
|
+
this.$emit('selAddress', form)
|
|
67
|
+
this.selectAddressVisible = false
|
|
68
|
+
},
|
|
69
|
+
addAddress () {
|
|
70
|
+
// 获取地址模式配置
|
|
71
|
+
getConfigByName('addressTypeDic', 'af-revenue', (res) => {
|
|
72
|
+
// 地址模式赋值
|
|
73
|
+
if (res.value?.length) {
|
|
74
|
+
this.addressModel = res.value
|
|
75
|
+
}
|
|
76
|
+
// 赋值默认地址模式
|
|
77
|
+
this.form = { f_address_type: this.addressModel[0].value }
|
|
78
|
+
this.addAddressFlag = true
|
|
79
|
+
this.addAddressMsg = '添加地址'
|
|
80
|
+
this.onAddressTypeChange()
|
|
81
|
+
})
|
|
82
|
+
},
|
|
83
|
+
onAddressTypeChange (newVal, oldVal) {
|
|
84
|
+
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
85
|
+
Object.keys(this.form).forEach(key => {
|
|
86
|
+
if (key.endsWith('_suffix')) {
|
|
87
|
+
this.form[key] = ''
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
if (selectedModel) {
|
|
91
|
+
const matches = selectedModel.expression.match(/{(.*?)}([^{}]*)(?={|$)/g)
|
|
92
|
+
this.formItems = matches.map(item => {
|
|
93
|
+
const value = item.match(/{(.*?)}/)[1]
|
|
94
|
+
const label = item.replace(/{.*?}/, '').trim()
|
|
95
|
+
// 处理后缀
|
|
96
|
+
this.form[`${value}_suffix`] = label
|
|
97
|
+
return {
|
|
98
|
+
label: label || (value === 'f_address' ? '' : value), // 如果存在后面的文字,就使用后面的文字作为 label,否则使用原来的值
|
|
99
|
+
value: `${value}`
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
handleSearch (value) {
|
|
105
|
+
this.getAreaList(value)
|
|
106
|
+
},
|
|
107
|
+
getAreaList (value) {
|
|
108
|
+
console.log('搜索小区', this.currUser.orgid)
|
|
109
|
+
runLogic('getAreaListByName', {
|
|
110
|
+
orgId: this.currUser.orgid,
|
|
111
|
+
name: value
|
|
112
|
+
}, 'af-revenue').then(res => {
|
|
113
|
+
console.log(res)
|
|
114
|
+
this.areaList = res
|
|
115
|
+
})
|
|
116
|
+
},
|
|
117
|
+
handleChange (value) {
|
|
118
|
+
this.form.f_residential_area = this.areaList.find(item => item.value === value).label
|
|
119
|
+
console.log(this.form.f_residential_area)
|
|
120
|
+
},
|
|
121
|
+
addressSubmit () {
|
|
122
|
+
if (!this.form.f_residential_area) {
|
|
123
|
+
this.$message.warning('请选择小区')
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
this.deleteAddressData()
|
|
127
|
+
runLogic('addAddress', Object.assign({}, this.form, {
|
|
128
|
+
f_address: this.generateAddressString()
|
|
129
|
+
}, {
|
|
130
|
+
orgid: this.currUser.orgid,
|
|
131
|
+
f_orgid: this.currUser.orgid,
|
|
132
|
+
f_orgname: this.currUser.orgs,
|
|
133
|
+
f_depid: this.currUser.depids,
|
|
134
|
+
f_depname: this.currUser.deps,
|
|
135
|
+
f_operatorid: this.currUser.id,
|
|
136
|
+
f_operator: this.currUser.name,
|
|
137
|
+
f_filialeid: this.currUser.orgid
|
|
138
|
+
}), 'af-revenue').then(res => {
|
|
139
|
+
if (res) {
|
|
140
|
+
this.$message.success(`${this.addAddressMsg}成功`)
|
|
141
|
+
this.addAddressFlag = false
|
|
142
|
+
this.refresh()
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
// 删除 addressData 中存在 addressModel 不存在的字段
|
|
147
|
+
deleteAddressData () {
|
|
148
|
+
// 目前只需要检查这几个key
|
|
149
|
+
const keys = ['f_building', 'f_unit', 'f_floor', 'f_room']
|
|
150
|
+
Object.keys(this.form).forEach(key => {
|
|
151
|
+
if (keys.includes(key) && !this.formItems.some(item => item.value === key)) {
|
|
152
|
+
this.form[key] = ''
|
|
153
|
+
this.form[`${key}_suffix`] = ''
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
generateAddressString () {
|
|
158
|
+
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
159
|
+
if (selectedModel) {
|
|
160
|
+
let addressString = selectedModel.expression
|
|
161
|
+
this.formItems.forEach(item => {
|
|
162
|
+
const value = this.form[item.value]
|
|
163
|
+
addressString = addressString.replace(`{${item.value}}`, value)
|
|
164
|
+
})
|
|
165
|
+
return addressString
|
|
166
|
+
}
|
|
167
|
+
return ''
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
computed: {
|
|
171
|
+
inputWidth () {
|
|
172
|
+
if (this.formItems.length === 1) {
|
|
173
|
+
return '85%'
|
|
174
|
+
}
|
|
175
|
+
return this.formItems.length ? `${65 / this.formItems.length}%` : '85%'
|
|
176
|
+
},
|
|
177
|
+
...mapState('account', { currUser: 'user' }),
|
|
178
|
+
...mapState('setting', { isMobile: 'isMobile' })
|
|
179
|
+
},
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<template>
|
|
185
|
+
<div>
|
|
186
|
+
<!-- 地址弹出框 -->
|
|
187
|
+
<a-modal
|
|
188
|
+
v-model="selectAddressVisible"
|
|
189
|
+
:dialog-style="{ top: '30px' }"
|
|
190
|
+
:bodyStyle="{height:'70vh',overflowY:'scroll'}"
|
|
191
|
+
:destroy-on-close="true"
|
|
192
|
+
:z-index="1002"
|
|
193
|
+
title="选择地址"
|
|
194
|
+
:footer="null"
|
|
195
|
+
width="80vw">
|
|
196
|
+
<x-form-table
|
|
197
|
+
title="选择地址"
|
|
198
|
+
queryParamsName="userfiles_sel_address"
|
|
199
|
+
@action="selAddress"
|
|
200
|
+
serviceName="af-revenue"
|
|
201
|
+
:extraHeight="225"
|
|
202
|
+
ref="selAddressXFormTable">
|
|
203
|
+
<template #leftButton="{selectedRows}">
|
|
204
|
+
<a-button
|
|
205
|
+
type="primary"
|
|
206
|
+
:disabled="selectedRows?.length !== 1"
|
|
207
|
+
@click="selAddress(selectedRows[0])"> 选择地址</a-button>
|
|
208
|
+
<a-button
|
|
209
|
+
type="primary"
|
|
210
|
+
@click="addAddress"> 新建地址
|
|
211
|
+
</a-button>
|
|
212
|
+
</template>
|
|
213
|
+
</x-form-table>
|
|
214
|
+
</a-modal>
|
|
215
|
+
<!-- 添加地址 -->
|
|
216
|
+
<a-modal
|
|
217
|
+
v-model="addAddressFlag"
|
|
218
|
+
:dialog-style="{ top: '30px' }"
|
|
219
|
+
:z-index="1005"
|
|
220
|
+
@ok="addressSubmit"
|
|
221
|
+
@cancel="addAddressFlag = false"
|
|
222
|
+
title="新增地址信息"
|
|
223
|
+
:destroyOnClose="true">
|
|
224
|
+
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
225
|
+
<a-form-model-item label="小区">
|
|
226
|
+
<a-select
|
|
227
|
+
show-search
|
|
228
|
+
placeholder="请选择小区"
|
|
229
|
+
option-filter-prop="children"
|
|
230
|
+
@search="handleSearch"
|
|
231
|
+
style="width: 200px"
|
|
232
|
+
@change="handleChange"
|
|
233
|
+
>
|
|
234
|
+
<a-select-option v-for="item in areaList" :value="item.value" :key="item">
|
|
235
|
+
{{ item.label }}
|
|
236
|
+
</a-select-option>
|
|
237
|
+
</a-select>
|
|
238
|
+
</a-form-model-item>
|
|
239
|
+
<a-form-model-item label="地址类型">
|
|
240
|
+
<a-radio-group v-model="form.f_address_type">
|
|
241
|
+
<a-radio :value="item.value" v-for="(item, index) in addressModel" :key="index">
|
|
242
|
+
{{ item.label }}
|
|
243
|
+
</a-radio>
|
|
244
|
+
</a-radio-group>
|
|
245
|
+
</a-form-model-item>
|
|
246
|
+
<a-form-model-item label="详细地址">
|
|
247
|
+
<div v-for="(item, index) in formItems" :key="index" style="display: inline;white-space: nowrap">
|
|
248
|
+
<a-input v-model="form[item.value]" style="display: inline;" :style="{ width: inputWidth }"/>
|
|
249
|
+
<span>{{ item.label }}</span>
|
|
250
|
+
</div>
|
|
251
|
+
</a-form-model-item>
|
|
252
|
+
</a-form-model>
|
|
253
|
+
</a-modal>
|
|
254
|
+
</div>
|
|
255
|
+
</template>
|
|
256
|
+
|
|
257
|
+
<style>
|
|
258
|
+
|
|
259
|
+
</style>
|
|
@@ -55,6 +55,7 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
|
|
|
55
55
|
routerResource.example = {
|
|
56
56
|
path: 'example',
|
|
57
57
|
name: '示例主页面',
|
|
58
|
+
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
|
58
59
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
|
59
60
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
60
61
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|