vue2-client 1.8.228 → 1.8.230
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/public/index.html +1 -1
- package/src/base-client/components/common/LowCodePageRender/editorPageRender.vue +2 -1
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +269 -0
- package/src/base-client/components/common/XDescriptions/demo.vue +50 -0
- package/src/base-client/components/common/XFormGroup/XFormGroup.vue +81 -60
- package/src/pages/Example/index.vue +3 -1
- package/src/pages/lowCode/lowCodeEditor.vue +122 -2
- package/vue.config.js +2 -2
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<noscript>
|
|
16
16
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
17
17
|
</noscript>
|
|
18
|
-
<div id="popContainer" class="beauty-scroll" style="height:
|
|
18
|
+
<div id="popContainer" class="beauty-scroll" style="height: 100%; overflow-y: auto">
|
|
19
19
|
<div id="app"></div>
|
|
20
20
|
</div>
|
|
21
21
|
<!-- require cdn assets js -->
|
|
@@ -376,7 +376,8 @@ export default {
|
|
|
376
376
|
false,
|
|
377
377
|
true
|
|
378
378
|
)
|
|
379
|
-
runLogic(eachEvent.logicName, param, eachEvent.serviceName)
|
|
379
|
+
runLogic(eachEvent.logicName, param, eachEvent.serviceName)
|
|
380
|
+
.then(res => { logicCallBackFunction(this.componentsMap, res) })
|
|
380
381
|
} else if (eachEvent.eventType === 'changeProps') {
|
|
381
382
|
const targetConfig = lowcodeUtils.getComponentConfig(eachEvent.target, this.pageConfig.page)
|
|
382
383
|
targetConfig.props[eachEvent.targetKey] = data
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a-row id="XDescriptionGroup" :gutter="24">
|
|
3
|
+
<a-col :span="4" v-if="showLeftTab && realData.length">
|
|
4
|
+
<a-tabs tab-position="left" @change="scrollToGroup">
|
|
5
|
+
<template v-for="(item,index) in realData">
|
|
6
|
+
<a-tab-pane
|
|
7
|
+
:tab="item.title"
|
|
8
|
+
:key="index"
|
|
9
|
+
v-if="item.title">
|
|
10
|
+
</a-tab-pane>
|
|
11
|
+
</template>
|
|
12
|
+
</a-tabs>
|
|
13
|
+
</a-col>
|
|
14
|
+
<a-col :span="showLeftTab ? 20 : 24" class="descriptionsGroupContext">
|
|
15
|
+
<div
|
|
16
|
+
class="descriptions-item"
|
|
17
|
+
:ref="`descriptions-item-${index}`"
|
|
18
|
+
:key="index"
|
|
19
|
+
v-for="(realDataItem, index) in realData">
|
|
20
|
+
<template v-if="!loadError">
|
|
21
|
+
<!-- 带有子的详情 -->
|
|
22
|
+
<template
|
|
23
|
+
v-if="realDataItem.title && groups[realDataItem.title]?.type ==='array'"
|
|
24
|
+
>
|
|
25
|
+
<div class="ant-descriptions-title">{{ realDataItem.title }}</div>
|
|
26
|
+
<div class="descriptions-array-item">
|
|
27
|
+
<a-descriptions
|
|
28
|
+
v-for="(arrayItem,arrayIndex) in realDataItem.column"
|
|
29
|
+
:column="isMobile ? 1 : column"
|
|
30
|
+
size="small"
|
|
31
|
+
:key="arrayIndex"
|
|
32
|
+
:title="arrayItem.title">
|
|
33
|
+
{{ arrayItem }}
|
|
34
|
+
<template v-for="(item, index) in arrayItem.column">
|
|
35
|
+
<!-- 大多数情况 循环下 空值省略不展示,todo 后期可能加配置处理 -->
|
|
36
|
+
<a-descriptions-item
|
|
37
|
+
:key="index"
|
|
38
|
+
v-if="item.value"
|
|
39
|
+
:label="item.key">
|
|
40
|
+
{{ formatText(item.value) }}
|
|
41
|
+
</a-descriptions-item>
|
|
42
|
+
</template>
|
|
43
|
+
</a-descriptions>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<a-descriptions
|
|
47
|
+
v-else-if="realDataItem.title"
|
|
48
|
+
:column="isMobile ? 1 : column"
|
|
49
|
+
size="small"
|
|
50
|
+
:title="realDataItem.title">
|
|
51
|
+
<a-descriptions-item
|
|
52
|
+
v-for="(item, index) in realDataItem.column"
|
|
53
|
+
:key="index"
|
|
54
|
+
:label="item.key">
|
|
55
|
+
{{ formatText(item.value) }}
|
|
56
|
+
</a-descriptions-item>
|
|
57
|
+
</a-descriptions>
|
|
58
|
+
</template>
|
|
59
|
+
</div>
|
|
60
|
+
</a-col>
|
|
61
|
+
</a-row>
|
|
62
|
+
</template>
|
|
63
|
+
<script>
|
|
64
|
+
|
|
65
|
+
import { mapState } from 'vuex'
|
|
66
|
+
import { getRealKeyData } from '@vue2-client/utils/formatter'
|
|
67
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
68
|
+
import lowcodeComponentMixin from '@vue2-client/utils/lowcode/lowcodeComponentMixin'
|
|
69
|
+
import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
name: 'XDescriptionsGroup',
|
|
73
|
+
components: {
|
|
74
|
+
XAddNativeForm
|
|
75
|
+
},
|
|
76
|
+
mixins: [lowcodeComponentMixin],
|
|
77
|
+
props: {
|
|
78
|
+
// 内容
|
|
79
|
+
data: {
|
|
80
|
+
type: Object,
|
|
81
|
+
required: true,
|
|
82
|
+
default: undefined
|
|
83
|
+
},
|
|
84
|
+
// 展示列配置 格式 {title:[{key,name}]} {描述列表标题:[{字段名,字段中文名}]}
|
|
85
|
+
// {
|
|
86
|
+
// "groups": {
|
|
87
|
+
// "表具信息": {
|
|
88
|
+
// "f_gasbrand": "气表品牌"
|
|
89
|
+
// },
|
|
90
|
+
// "客户信息": {
|
|
91
|
+
// "f_userinfo_code": "用户编号"
|
|
92
|
+
// },
|
|
93
|
+
// "设备信息":{
|
|
94
|
+
// "type": "array",
|
|
95
|
+
// "value": {
|
|
96
|
+
// "f_devices_num": "设备数量",
|
|
97
|
+
// "f_devices_type": "设备类型",
|
|
98
|
+
// },
|
|
99
|
+
// "key": "devices"
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// }
|
|
103
|
+
configName: {
|
|
104
|
+
type: String,
|
|
105
|
+
required: true,
|
|
106
|
+
default: ''
|
|
107
|
+
},
|
|
108
|
+
// 配置所属命名空间
|
|
109
|
+
serviceName: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: process.env.VUE_APP_SYSTEM_NAME
|
|
112
|
+
},
|
|
113
|
+
// 每列显示数量
|
|
114
|
+
column: {
|
|
115
|
+
type: Number,
|
|
116
|
+
default: 3
|
|
117
|
+
},
|
|
118
|
+
// 处理 key tuf_f_userinfo_id -> f_userinfo_id
|
|
119
|
+
getRealData: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
// 是否展示左侧tab
|
|
124
|
+
showLeftTab: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
created () {
|
|
130
|
+
this.initConfig()
|
|
131
|
+
},
|
|
132
|
+
data () {
|
|
133
|
+
return {
|
|
134
|
+
// 加载状态
|
|
135
|
+
loading: false,
|
|
136
|
+
loadError: false,
|
|
137
|
+
realData: [],
|
|
138
|
+
// 获取到的配置组
|
|
139
|
+
groups: {}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
computed: {
|
|
143
|
+
...mapState('setting', { isMobile: 'isMobile' })
|
|
144
|
+
},
|
|
145
|
+
methods: {
|
|
146
|
+
initConfig () {
|
|
147
|
+
this.loading = true
|
|
148
|
+
if (this.configName) {
|
|
149
|
+
this.getConfig()
|
|
150
|
+
} else {
|
|
151
|
+
this.loading = false
|
|
152
|
+
this.loadError = true
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
scrollToGroup (index) {
|
|
156
|
+
const groupElement = this.$refs[`descriptions-item-${index}`][0]
|
|
157
|
+
if (groupElement) {
|
|
158
|
+
groupElement.scrollIntoView({ behavior: 'smooth' })
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
getConfig () {
|
|
162
|
+
getConfigByName(this.configName, this.serviceName, (res) => {
|
|
163
|
+
if (res.groups) {
|
|
164
|
+
this.groups = res.groups
|
|
165
|
+
this.realData = Object.keys(res.groups).map((h) => {
|
|
166
|
+
const hObj = res.groups[h]
|
|
167
|
+
const dataItem = {}
|
|
168
|
+
dataItem.title = h
|
|
169
|
+
dataItem.column = []
|
|
170
|
+
if (hObj.type && hObj.type === 'array') {
|
|
171
|
+
// 从data 取出数组
|
|
172
|
+
const arrayData = this.data[hObj.key]
|
|
173
|
+
const arrayDataItem = arrayData.map((item, index) => {
|
|
174
|
+
const arrayItem = {
|
|
175
|
+
title: `${h} ${index + 1}`,
|
|
176
|
+
column: Object.keys(hObj.value).map((key) => {
|
|
177
|
+
return {
|
|
178
|
+
key: hObj.value[key],
|
|
179
|
+
value: item[key]
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
// 如果所有 value 都是空的 return null todo 后期可能做成配置
|
|
184
|
+
const isAllNull = arrayItem.column.every((item) => {
|
|
185
|
+
return item.value === null || item.value === ''
|
|
186
|
+
})
|
|
187
|
+
return isAllNull ? null : arrayItem
|
|
188
|
+
}).filter((item) => item)
|
|
189
|
+
if (arrayDataItem.length) {
|
|
190
|
+
dataItem.column = arrayDataItem
|
|
191
|
+
return dataItem
|
|
192
|
+
} else {
|
|
193
|
+
return null
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
const tempData = Object.keys(hObj).map((key) => {
|
|
197
|
+
// 如果是数组形态
|
|
198
|
+
return { key: hObj[key], value: this.getRealKeyData(this.data, key) }
|
|
199
|
+
})
|
|
200
|
+
// 如果所有 value 都是空的 return null todo 后期可能做成配置
|
|
201
|
+
const isAllNull = tempData.every((item) => {
|
|
202
|
+
return item.value === null || item.value === ''
|
|
203
|
+
})
|
|
204
|
+
if (isAllNull) {
|
|
205
|
+
return null
|
|
206
|
+
} else {
|
|
207
|
+
dataItem.column = tempData
|
|
208
|
+
return dataItem
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}).filter((item) => item)
|
|
212
|
+
console.log(this.realData)
|
|
213
|
+
} else {
|
|
214
|
+
this.loading = false
|
|
215
|
+
this.loadError = true
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
},
|
|
219
|
+
// 文字格式化
|
|
220
|
+
formatText (value) {
|
|
221
|
+
return value || '--'
|
|
222
|
+
},
|
|
223
|
+
getRealKeyData (data, key) {
|
|
224
|
+
if (this.getRealData) {
|
|
225
|
+
return getRealKeyData(data)[key] || ''
|
|
226
|
+
} else {
|
|
227
|
+
return this.data[key] || ''
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
watch: {
|
|
232
|
+
content: {
|
|
233
|
+
handler () {
|
|
234
|
+
this.initConfig()
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
configName: {
|
|
238
|
+
handler () {
|
|
239
|
+
this.initConfig()
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
serviceName: {
|
|
243
|
+
handler () {
|
|
244
|
+
this.initConfig()
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
</script>
|
|
250
|
+
|
|
251
|
+
<style lang="less" scoped>
|
|
252
|
+
#XDescriptionGroup {
|
|
253
|
+
height: 100%;
|
|
254
|
+
:deep(.ant-descriptions-title) {
|
|
255
|
+
color: @primary-color;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.descriptions-item {
|
|
259
|
+
margin-bottom: 8px;
|
|
260
|
+
}
|
|
261
|
+
.descriptions-array-item{
|
|
262
|
+
padding-left: 1rem;
|
|
263
|
+
}
|
|
264
|
+
.descriptionsGroupContext {
|
|
265
|
+
height: 100%;
|
|
266
|
+
overflow-y: scroll;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import XDescriptionsGroup from '@vue2-client/base-client/components/common/XDescriptions/XDescriptionsGroup.vue'
|
|
3
|
+
import { runLogic } from '@vue2-client/services/api/common'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Demo',
|
|
7
|
+
components: { XDescriptionsGroup },
|
|
8
|
+
data () {
|
|
9
|
+
return {
|
|
10
|
+
visible: false,
|
|
11
|
+
userinfo: {
|
|
12
|
+
f_userinfo_code: '143400000003',
|
|
13
|
+
f_gasbrand: '测试表品牌'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
open () {
|
|
19
|
+
runLogic('querySingleUserDetail', {
|
|
20
|
+
f_userinfo_code: '143400000003'
|
|
21
|
+
}, 'af-revenue').then(res => {
|
|
22
|
+
this.userinfo = res
|
|
23
|
+
this.visible = true
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div>
|
|
32
|
+
<a-button @click="open">
|
|
33
|
+
展开详情
|
|
34
|
+
</a-button>
|
|
35
|
+
<a-drawer
|
|
36
|
+
title="描述列表详情"
|
|
37
|
+
placement="right"
|
|
38
|
+
width="65vw"
|
|
39
|
+
:body-style="{height:'92%'}"
|
|
40
|
+
:visible="visible"
|
|
41
|
+
@close="()=>{visible = false}"
|
|
42
|
+
>
|
|
43
|
+
<x-descriptions-group config-name="用户详情描述列表" :showLeftTab="true" :data="userinfo" service-name="af-revenue"/>
|
|
44
|
+
</a-drawer>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style scoped lang="less">
|
|
49
|
+
|
|
50
|
+
</style>
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="groups.length ? 'XFormGroupClass' : ''">
|
|
3
|
-
<a-empty v-if="
|
|
4
|
-
<a-
|
|
5
|
-
<a-
|
|
6
|
-
<a-
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<a-
|
|
20
|
-
<span
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
<a-empty v-if="loadingErr" description="配置走丢了"/>
|
|
4
|
+
<a-spin v-else tip="正在努力加载。。。" :spinning="spinning" wrapperClassName="heigth100">
|
|
5
|
+
<a-row :gutter="24" style="height:100%">
|
|
6
|
+
<a-col :span="3" v-if="showLeftTab && groups.length">
|
|
7
|
+
<a-tabs tab-position="left" @change="scrollToGroup">
|
|
8
|
+
<template v-for="(item,index) in groups">
|
|
9
|
+
<a-tab-pane
|
|
10
|
+
:tab="item.describe"
|
|
11
|
+
:key="index"
|
|
12
|
+
v-if="item.describe">
|
|
13
|
+
</a-tab-pane>
|
|
14
|
+
</template>
|
|
15
|
+
</a-tabs>
|
|
16
|
+
</a-col>
|
|
17
|
+
<a-col :span="showLeftTab ? 21 : 24" class="formGroupContext">
|
|
18
|
+
<div class="group-item" :ref="`group-${index}`" :key="index" v-for="(item, index) in groups">
|
|
19
|
+
<a-row :style="{marginTop: index === 0 ? '':'8px'}">
|
|
20
|
+
<a-col :span="5">
|
|
21
|
+
<span class="xFormGroupTitle">{{ item.describe }}</span>
|
|
22
|
+
</a-col>
|
|
23
|
+
</a-row>
|
|
24
|
+
<template v-if="item.formGroupType === 'slot'">
|
|
25
|
+
<slot :name="item.slotName" :data="allFormData" :index="index">
|
|
26
|
+
<a-empty :description="`[${item.describe}:${item.slotName}]插槽没有使用`"/>
|
|
27
|
+
</slot>
|
|
28
|
+
</template>
|
|
29
|
+
<x-add-native-form @x-form-item-emit-func="emitFunc" v-else :ref="`nativeForm-${index}`"/>
|
|
30
|
+
</div>
|
|
31
|
+
</a-col>
|
|
32
|
+
</a-row>
|
|
33
|
+
</a-spin>
|
|
32
34
|
</div>
|
|
33
35
|
</template>
|
|
34
36
|
|
|
35
37
|
<script>
|
|
36
38
|
import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
|
|
37
|
-
import { parseConfig } from '@vue2-client/services/api/common'
|
|
38
39
|
|
|
39
40
|
export default {
|
|
40
41
|
name: 'XFormGroup',
|
|
@@ -53,11 +54,13 @@ export default {
|
|
|
53
54
|
showSubmitBtn: false,
|
|
54
55
|
loading: false,
|
|
55
56
|
allFormData: {},
|
|
57
|
+
businessType: {},
|
|
56
58
|
env: 'prod',
|
|
59
|
+
spinning: true,
|
|
60
|
+
loadingErr: false
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
mounted () {
|
|
60
|
-
this.initView()
|
|
61
64
|
},
|
|
62
65
|
props: {},
|
|
63
66
|
watch: {},
|
|
@@ -75,26 +78,36 @@ export default {
|
|
|
75
78
|
* @param serviceName 服务名
|
|
76
79
|
* @param env 环境
|
|
77
80
|
* @param showLeftTab 是否展示左侧索引页
|
|
81
|
+
* @param businessType 新增还是修改
|
|
78
82
|
*/
|
|
79
83
|
init ({
|
|
80
84
|
groups,
|
|
81
85
|
modifyModelData = {},
|
|
82
86
|
serviceName = process.env.VUE_APP_SYSTEM_NAME,
|
|
83
87
|
env = 'prod',
|
|
84
|
-
showLeftTab = false
|
|
88
|
+
showLeftTab = false,
|
|
89
|
+
businessType = '新增'
|
|
85
90
|
}) {
|
|
86
|
-
Object.assign(this, { groups, modifyModelData, serviceName, env, showLeftTab })
|
|
91
|
+
Object.assign(this, { groups, modifyModelData, serviceName, env, showLeftTab, businessType })
|
|
87
92
|
this.initView()
|
|
88
93
|
},
|
|
89
94
|
// 初始化组件
|
|
90
95
|
initView () {
|
|
96
|
+
this.spinning = true
|
|
97
|
+
const promises = []
|
|
91
98
|
for (let i = 0; i < this.groups.length; i++) {
|
|
92
|
-
this.initData(i)
|
|
99
|
+
promises.push(this.initData(i))
|
|
93
100
|
}
|
|
101
|
+
Promise.all(promises).then(() => {
|
|
102
|
+
this.spinning = false
|
|
103
|
+
}).catch(() => {
|
|
104
|
+
this.loadingErr = true
|
|
105
|
+
this.spinning = false
|
|
106
|
+
})
|
|
94
107
|
},
|
|
95
108
|
getNativeFormRef (group) {
|
|
96
109
|
return this.groups.map((item, index) => {
|
|
97
|
-
if (item.
|
|
110
|
+
if (item.groupName === group) {
|
|
98
111
|
return this.$refs[`nativeForm-${index}`][0]
|
|
99
112
|
} else {
|
|
100
113
|
return null
|
|
@@ -102,34 +115,34 @@ export default {
|
|
|
102
115
|
}).filter(ref => ref !== null)
|
|
103
116
|
},
|
|
104
117
|
initData (index) {
|
|
118
|
+
// 定义当前表单配置
|
|
119
|
+
const res = this.groups[index]
|
|
105
120
|
// 如果是插槽组件
|
|
106
|
-
|
|
107
|
-
if (this.groups[index]?.formGroupType === 'slot') {
|
|
121
|
+
if (res?.formGroupType === 'slot') {
|
|
108
122
|
// 组织插槽表单的结果
|
|
109
|
-
this.allFormData[
|
|
123
|
+
this.allFormData[res.slotName] = {}
|
|
110
124
|
return
|
|
111
125
|
}
|
|
112
126
|
// 组织native表单存储的结果
|
|
113
|
-
this.allFormData[
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
})
|
|
127
|
+
this.allFormData[res.groupName] = {}
|
|
128
|
+
this.formList.push(res)
|
|
129
|
+
let modifyModelData = {}
|
|
130
|
+
if (this.modifyModelData[res.groupName]) {
|
|
131
|
+
modifyModelData = { data: this.modifyModelData[res.groupName] }
|
|
132
|
+
}
|
|
133
|
+
const params = {
|
|
134
|
+
layout: res.xAddFormLayout,
|
|
135
|
+
formItems: res.formJson,
|
|
136
|
+
showSubmitBtn: false,
|
|
137
|
+
serviceName: this.serviceName,
|
|
138
|
+
modifyModelData: modifyModelData,
|
|
139
|
+
fixedAddForm: modifyModelData.data,
|
|
140
|
+
businessType: this.businessType,
|
|
141
|
+
...res
|
|
142
|
+
}
|
|
143
|
+
params.showSubmitBtn = false
|
|
144
|
+
this.$nextTick(() => {
|
|
145
|
+
this.$refs[`nativeForm-${index}`][0].init(params)
|
|
133
146
|
})
|
|
134
147
|
},
|
|
135
148
|
scrollToGroup (index) {
|
|
@@ -149,10 +162,10 @@ export default {
|
|
|
149
162
|
let pass = true
|
|
150
163
|
const promises = this.groups.map((item, index) => {
|
|
151
164
|
const nativeFormRef = this.$refs[`nativeForm-${index}`] ? this.$refs[`nativeForm-${index}`][0] : undefined
|
|
152
|
-
if ((item.
|
|
165
|
+
if ((item.groupName || item.slotName) && nativeFormRef && typeof nativeFormRef.asyncSubmit === 'function') {
|
|
153
166
|
// 如果 ref 存在 asyncSubmit 方法,则调用 asyncSubmit 方法
|
|
154
167
|
return nativeFormRef.asyncSubmit().then(res => {
|
|
155
|
-
this.allFormData[item.slotName || item.
|
|
168
|
+
this.allFormData[item.slotName || item.groupName] = res.realForm
|
|
156
169
|
}).catch(_err => {
|
|
157
170
|
pass = false
|
|
158
171
|
this.scrollToGroup(index)
|
|
@@ -184,6 +197,14 @@ export default {
|
|
|
184
197
|
.XFormGroupClass {
|
|
185
198
|
height: 100%;
|
|
186
199
|
|
|
200
|
+
.heigth100 {
|
|
201
|
+
height: 100%;
|
|
202
|
+
|
|
203
|
+
:deep(.ant-spin-container) {
|
|
204
|
+
height: 100%;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
187
208
|
.xFormGroupTitle {
|
|
188
209
|
font-size: 15px;
|
|
189
210
|
font-weight: bold;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="test">
|
|
3
|
+
<!-- 修改 import 路径展示不同的组件 Demo -->
|
|
3
4
|
<demo></demo>
|
|
4
5
|
</div>
|
|
5
6
|
</template>
|
|
6
7
|
|
|
7
8
|
<script>
|
|
8
9
|
import XReport from '@vue2-client/base-client/components/common/XReport'
|
|
9
|
-
import Demo from '@vue2-client/base-client/components/common/XFormGroup/demo.vue'
|
|
10
|
+
// import Demo from '@vue2-client/base-client/components/common/XFormGroup/demo.vue'
|
|
11
|
+
import Demo from '@vue2-client/base-client/components/common/XDescriptions/demo.vue'
|
|
10
12
|
|
|
11
13
|
export default {
|
|
12
14
|
name: 'Example',
|
|
@@ -394,10 +394,11 @@
|
|
|
394
394
|
@ok="() => { showLogicCallBackEditor = false}"
|
|
395
395
|
@cancel="() => { showLogicCallBackEditor = false}"
|
|
396
396
|
:visible="showLogicCallBackEditor">
|
|
397
|
-
<a-popover title="参数说明" style="margin-
|
|
397
|
+
<a-popover title="参数说明" style="margin-bottom: 5%">
|
|
398
398
|
<template slot="content">
|
|
399
399
|
<p>该方法有以下几个参数:</p>
|
|
400
400
|
<p>componentsMap:所有组件注册的Map</p>
|
|
401
|
+
<p>responseData:后端的返回值</p>
|
|
401
402
|
</template>
|
|
402
403
|
<a-button type="primary">
|
|
403
404
|
参数说明
|
|
@@ -427,7 +428,7 @@ import LowCodePageOrganization from '@vue2-client/base-client/components/common/
|
|
|
427
428
|
// 函数编辑器显示的模板
|
|
428
429
|
const JSEventFunctionTemplate = 'function(eventType, data, targetKey, sourceVM, targetVM) {\n \n return {\n "eventType": eventType,\n "data": data,\n "targetKey": targetKey\n }\n}'
|
|
429
430
|
const LogicParamFunctionTemplate = 'function(componentData, data) {\n \n return {\n \n }\n}'
|
|
430
|
-
const LogicCallBackFunctionTemplate = 'function(componentsMap) {\n \n}'
|
|
431
|
+
const LogicCallBackFunctionTemplate = 'function(componentsMap, responseData) {\n \n}'
|
|
431
432
|
|
|
432
433
|
export default {
|
|
433
434
|
components: {
|
|
@@ -877,6 +878,7 @@ export default {
|
|
|
877
878
|
// 事件编辑器中,事件类型改变
|
|
878
879
|
handleEventEditorEventTypeChange (type) {
|
|
879
880
|
this.eventEditorContent.eventType = type
|
|
881
|
+
this.logicParamTransferDataSource = []
|
|
880
882
|
// 如果事件为运行Logic将组件加入穿梭框
|
|
881
883
|
if (type === 'runLogic') {
|
|
882
884
|
this.config.page.forEach(page => {
|
|
@@ -1136,6 +1138,124 @@ export default {
|
|
|
1136
1138
|
this.supportedEventType = [...lowcodeComponentMixin.supportedEventType]
|
|
1137
1139
|
// 深拷贝外侧传来的配置
|
|
1138
1140
|
this.config = JSON.parse(JSON.stringify(this.originalConfig))
|
|
1141
|
+
// this.config = {
|
|
1142
|
+
// page: [
|
|
1143
|
+
// {
|
|
1144
|
+
// id: 'KB',
|
|
1145
|
+
// type: 'page',
|
|
1146
|
+
// title: '111',
|
|
1147
|
+
// body: [
|
|
1148
|
+
// [
|
|
1149
|
+
// {
|
|
1150
|
+
// type: 'XFormTable',
|
|
1151
|
+
// span: 12,
|
|
1152
|
+
// id: 'XFormTable_BV6Nwk',
|
|
1153
|
+
// selected: false,
|
|
1154
|
+
// props: {
|
|
1155
|
+
// queryParamsName: '',
|
|
1156
|
+
// serviceName: ''
|
|
1157
|
+
// },
|
|
1158
|
+
// selfEvent: [
|
|
1159
|
+
// 'action'
|
|
1160
|
+
// ]
|
|
1161
|
+
// },
|
|
1162
|
+
// {
|
|
1163
|
+
// type: 'XAddNativeForm',
|
|
1164
|
+
// span: 12,
|
|
1165
|
+
// id: 'XAddNativeForm_ekihTp',
|
|
1166
|
+
// selected: false,
|
|
1167
|
+
// props: {
|
|
1168
|
+
// configNameForLowCode: '',
|
|
1169
|
+
// systemNameForLowCode: ''
|
|
1170
|
+
// },
|
|
1171
|
+
// selfEvent: [
|
|
1172
|
+
// 'onSubmit'
|
|
1173
|
+
// ]
|
|
1174
|
+
// }
|
|
1175
|
+
// ],
|
|
1176
|
+
// [
|
|
1177
|
+
// {
|
|
1178
|
+
// type: 'XTreeOne',
|
|
1179
|
+
// span: 12,
|
|
1180
|
+
// id: 'XTreeOne_szu7Al',
|
|
1181
|
+
// selected: false
|
|
1182
|
+
// },
|
|
1183
|
+
// {
|
|
1184
|
+
// type: 'XDescriptions',
|
|
1185
|
+
// span: 12,
|
|
1186
|
+
// id: 'XDescriptions_DTkbEg',
|
|
1187
|
+
// selected: false,
|
|
1188
|
+
// props: {
|
|
1189
|
+
// title: '111',
|
|
1190
|
+
// content: {
|
|
1191
|
+
// c_f_user_phone: '2323',
|
|
1192
|
+
// c_f_total_fee: 33356,
|
|
1193
|
+
// c_f_address: '22',
|
|
1194
|
+
// c_f_meterlen: 2,
|
|
1195
|
+
// c_f_bank_card_number: '23',
|
|
1196
|
+
// c_f_create_user: '超级管理员',
|
|
1197
|
+
// c_f_customer: '23',
|
|
1198
|
+
// c_f_balance: 33356,
|
|
1199
|
+
// c_f_create_date: '2024-06-23 21:31:24',
|
|
1200
|
+
// c_f_operator_date: '2024-06-23 21:31:24',
|
|
1201
|
+
// c_f_total_times: 2,
|
|
1202
|
+
// c_f_user_name: '23',
|
|
1203
|
+
// c_f_comments: '323',
|
|
1204
|
+
// c_id: 39,
|
|
1205
|
+
// c_f_operatorid: '15',
|
|
1206
|
+
// c_f_operator: '超级管理员',
|
|
1207
|
+
// c_f_orgid: '9'
|
|
1208
|
+
// },
|
|
1209
|
+
// configName: 'Unit_Desc_Config',
|
|
1210
|
+
// serviceName: 'af-revenue',
|
|
1211
|
+
// getRealData: true
|
|
1212
|
+
// },
|
|
1213
|
+
// selfEvent: []
|
|
1214
|
+
// }
|
|
1215
|
+
// ]
|
|
1216
|
+
// ]
|
|
1217
|
+
// },
|
|
1218
|
+
// {
|
|
1219
|
+
// id: 'Fg',
|
|
1220
|
+
// type: 'page',
|
|
1221
|
+
// title: '22',
|
|
1222
|
+
// body: [
|
|
1223
|
+
// [
|
|
1224
|
+
// {
|
|
1225
|
+
// type: 'container',
|
|
1226
|
+
// span: 4,
|
|
1227
|
+
// id: 'container_ir2gR2',
|
|
1228
|
+
// selected: false
|
|
1229
|
+
// },
|
|
1230
|
+
// {
|
|
1231
|
+
// type: 'container',
|
|
1232
|
+
// span: 10,
|
|
1233
|
+
// id: 'container_xIRHGg'
|
|
1234
|
+
// },
|
|
1235
|
+
// {
|
|
1236
|
+
// type: 'container',
|
|
1237
|
+
// span: 10,
|
|
1238
|
+
// id: 'container_PT9n3Q'
|
|
1239
|
+
// }
|
|
1240
|
+
// ],
|
|
1241
|
+
// [
|
|
1242
|
+
// {
|
|
1243
|
+
// type: 'container',
|
|
1244
|
+
// span: 18,
|
|
1245
|
+
// id: 'container_q04vQr',
|
|
1246
|
+
// selected: false
|
|
1247
|
+
// },
|
|
1248
|
+
// {
|
|
1249
|
+
// type: 'container',
|
|
1250
|
+
// span: 6,
|
|
1251
|
+
// id: 'container_MKwNvz',
|
|
1252
|
+
// selected: false
|
|
1253
|
+
// }
|
|
1254
|
+
// ]
|
|
1255
|
+
// ]
|
|
1256
|
+
// }
|
|
1257
|
+
// ]
|
|
1258
|
+
// }
|
|
1139
1259
|
this.refreshOrganization()
|
|
1140
1260
|
}
|
|
1141
1261
|
}
|
package/vue.config.js
CHANGED
|
@@ -44,8 +44,8 @@ module.exports = {
|
|
|
44
44
|
// changeOrigin: true
|
|
45
45
|
// },
|
|
46
46
|
'/api/af-revenue/logic/openapi/': {
|
|
47
|
-
|
|
48
|
-
target:
|
|
47
|
+
pathRewrite: { '^/api/af-revenue/logic/openapi/': '/logic/' },
|
|
48
|
+
target: 'http://127.0.0.1:9026',
|
|
49
49
|
changeOrigin: true
|
|
50
50
|
},
|
|
51
51
|
'/api/af-revenue': {
|