vue2-client 1.9.105 → 1.9.107
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/XForm/XFormItem.vue +16 -2
- package/src/base-client/components/common/XFormGroup/XFormGroup.vue +34 -12
- package/src/base-client/components/common/XFormTable/XFormTable.vue +5 -0
- package/src/base-client/components/common/XFormTable/demo.vue +2 -1
- package/src/base-client/components/common/XTable/XTable.vue +14 -0
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -521,7 +521,7 @@
|
|
|
521
521
|
<template #content>
|
|
522
522
|
<x-form-table
|
|
523
523
|
title="请选择数据"
|
|
524
|
-
:queryParamsName="
|
|
524
|
+
:queryParamsName="queryParamsName"
|
|
525
525
|
:rowSelectMode="true"
|
|
526
526
|
:allowSelectRowNum="1"
|
|
527
527
|
:service-name="serviceName"
|
|
@@ -838,7 +838,16 @@ export default {
|
|
|
838
838
|
}
|
|
839
839
|
},
|
|
840
840
|
computed: {
|
|
841
|
-
...mapState('account', { currUser: 'user' })
|
|
841
|
+
...mapState('account', { currUser: 'user' }),
|
|
842
|
+
queryParamsName () {
|
|
843
|
+
if (this.attr.keyName.startsWith('function')) {
|
|
844
|
+
// 调用异步函数获取内容
|
|
845
|
+
return executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
|
|
846
|
+
} else {
|
|
847
|
+
// 按现有方式处理
|
|
848
|
+
return this.attr.keyName.split('@')[this.attr.keyName.split('@').length - 1]
|
|
849
|
+
}
|
|
850
|
+
}
|
|
842
851
|
},
|
|
843
852
|
watch: {
|
|
844
853
|
attr: {
|
|
@@ -1181,6 +1190,11 @@ export default {
|
|
|
1181
1190
|
return child.child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
1182
1191
|
}
|
|
1183
1192
|
},
|
|
1193
|
+
// 表单项变更函数中调用 控制表单组中表单项组名为 groupName 的表单是否展示
|
|
1194
|
+
// func:x-form-show(显示)/x-form-no-show(不显示)
|
|
1195
|
+
emitShowFormFunc (func, groupName) {
|
|
1196
|
+
this.emitFunc(func, groupName)
|
|
1197
|
+
},
|
|
1184
1198
|
emitFunc (func, data) {
|
|
1185
1199
|
this.$emit('x-form-item-emit-func', func, data, data.model ? this.form[data.model] : this.form)
|
|
1186
1200
|
},
|
|
@@ -9,24 +9,27 @@
|
|
|
9
9
|
<a-tab-pane
|
|
10
10
|
:tab="item.describe"
|
|
11
11
|
:key="index"
|
|
12
|
-
v-if="item.describe">
|
|
12
|
+
v-if="item.describe && formShow[`show${item.groupName}`]">
|
|
13
13
|
</a-tab-pane>
|
|
14
14
|
</template>
|
|
15
15
|
</a-tabs>
|
|
16
16
|
</a-col>
|
|
17
17
|
<a-col :span="showLeftTab ? 21 : 24" class="formGroupContext" ref="formGroupContext">
|
|
18
18
|
<div class="group-item" :ref="`group-${index}`" :key="index" v-for="(item, index) in groups">
|
|
19
|
-
<a-row :style="{ marginTop: index === 0 ? '' : '8px' }">
|
|
19
|
+
<a-row :style="{ marginTop: index === 0 ? '' : '8px' }" v-if="formShow[`show${item.groupName}`]">
|
|
20
20
|
<a-col :span="5">
|
|
21
21
|
<span class="xFormGroupTitle">{{ item.describe }}</span>
|
|
22
22
|
</a-col>
|
|
23
23
|
</a-row>
|
|
24
|
-
<template v-if="item.formGroupType === 'slot'">
|
|
24
|
+
<template v-if="item.formGroupType === 'slot' && formShow[`show${item.groupName}`]">
|
|
25
25
|
<slot :name="item.slotName" :data="allFormData" :index="index">
|
|
26
26
|
<a-empty :description="`[${item.describe}:${item.slotName}]插槽没有使用`"/>
|
|
27
27
|
</slot>
|
|
28
28
|
</template>
|
|
29
|
-
<x-add-native-form
|
|
29
|
+
<x-add-native-form
|
|
30
|
+
@x-form-item-emit-func="emitFunc"
|
|
31
|
+
v-if="item.formGroupType !== 'slot' && formShow[`show${item.groupName}`]"
|
|
32
|
+
:ref="`nativeForm-${index}`"/>
|
|
30
33
|
</div>
|
|
31
34
|
</a-col>
|
|
32
35
|
</a-row>
|
|
@@ -55,6 +58,7 @@ export default {
|
|
|
55
58
|
loading: false,
|
|
56
59
|
allFormData: {},
|
|
57
60
|
businessType: {},
|
|
61
|
+
formShow: {},
|
|
58
62
|
env: 'dev',
|
|
59
63
|
spinning: true,
|
|
60
64
|
loadingErr: false,
|
|
@@ -133,6 +137,7 @@ export default {
|
|
|
133
137
|
this.allFormData[res.slotName] = {}
|
|
134
138
|
return
|
|
135
139
|
}
|
|
140
|
+
this.$set(this.formShow, `show${res.groupName}`, true)
|
|
136
141
|
// 组织native表单存储的结果
|
|
137
142
|
this.allFormData[res.groupName] = {}
|
|
138
143
|
this.formList.push(res)
|
|
@@ -169,16 +174,33 @@ export default {
|
|
|
169
174
|
groupElement.scrollIntoView({ behavior: 'smooth' })
|
|
170
175
|
}
|
|
171
176
|
},
|
|
177
|
+
xFormShow (func, data, index) {
|
|
178
|
+
if (data) {
|
|
179
|
+
this.groups.forEach((item, index) => {
|
|
180
|
+
console.warn('item', item)
|
|
181
|
+
if (data === item.groupName) {
|
|
182
|
+
this.$set(this.formShow, `show${item.groupName}`, func === 'x-form-show')
|
|
183
|
+
if (func === 'x-form-show') {
|
|
184
|
+
this.initData(index)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
},
|
|
172
190
|
// xfromitem 一路传递上来的事件
|
|
173
191
|
emitFunc (func, data, index) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
192
|
+
if (func === 'x-form-show' || func === 'x-form-no-show') {
|
|
193
|
+
this.xFormShow(func, data, index)
|
|
194
|
+
} else {
|
|
195
|
+
let value = null
|
|
196
|
+
try {
|
|
197
|
+
if (data && data.model && this.$refs[`nativeForm-${index}`]) {
|
|
198
|
+
value = this.$refs[`nativeForm-${index}`]?.form[data.model]
|
|
199
|
+
}
|
|
200
|
+
this.$emit(func, data, value)
|
|
201
|
+
} catch (error) { console.error(error) }
|
|
202
|
+
this.$emit('x-form-item-emit-func', func, data, value)
|
|
203
|
+
}
|
|
182
204
|
},
|
|
183
205
|
// 提交表单
|
|
184
206
|
asyncSubmit () {
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
@edit="edit"
|
|
72
72
|
@del="del"
|
|
73
73
|
@rowChoose="rowChoose"
|
|
74
|
+
@customEvent="customEvent"
|
|
74
75
|
@afterDelete="afterDelete"
|
|
75
76
|
@action="action"
|
|
76
77
|
@selectRow="selectRow"
|
|
@@ -334,6 +335,9 @@ export default {
|
|
|
334
335
|
getRealKeyData,
|
|
335
336
|
getConfigByNameAsync,
|
|
336
337
|
getConfigByName,
|
|
338
|
+
customEvent (func) {
|
|
339
|
+
this.$emit(func)
|
|
340
|
+
},
|
|
337
341
|
columnClick (key, value, record) {
|
|
338
342
|
this.$emit('columnClick', key, value, record)
|
|
339
343
|
},
|
|
@@ -456,6 +460,7 @@ export default {
|
|
|
456
460
|
queryParams: setQueryParams ? res : null,
|
|
457
461
|
tableColumns: res.columnJson,
|
|
458
462
|
buttonState: Object.assign(res.buttonState, this.buttonState),
|
|
463
|
+
eventState: res.eventState || {},
|
|
459
464
|
buttonPermissions: res.buttonPermissions,
|
|
460
465
|
editButtonStateData: res.editButtonStateData,
|
|
461
466
|
title: this.title,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:queryParamsName="queryParamsName"
|
|
6
6
|
:fixedAddForm="fixedAddForm"
|
|
7
7
|
@action="action"
|
|
8
|
+
@customSave="$message.warn('customSave')"
|
|
8
9
|
@columnClick="columnClick"
|
|
9
10
|
ref="xFormTable">
|
|
10
11
|
</x-form-table>
|
|
@@ -40,7 +41,7 @@ export default {
|
|
|
40
41
|
data () {
|
|
41
42
|
return {
|
|
42
43
|
// 查询配置文件名
|
|
43
|
-
queryParamsName: '
|
|
44
|
+
queryParamsName: 'ceshiCRUD',
|
|
44
45
|
// 查询配置左侧tree
|
|
45
46
|
// xTreeConfigName: 'addressType',
|
|
46
47
|
// 新增表单固定值
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
<a-col v-show="showLeftOperaBtn">
|
|
5
5
|
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
6
6
|
<a-space>
|
|
7
|
+
<a-button v-if="eventState.customDelete" type="primary" @click="custom('customDelete')">
|
|
8
|
+
<a-icon type="delete"/>删除
|
|
9
|
+
</a-button>
|
|
10
|
+
<a-button v-if="eventState.customSave" type="primary" @click="custom('customSave')">
|
|
11
|
+
<a-icon type="save"/>保存
|
|
12
|
+
</a-button>
|
|
7
13
|
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
8
14
|
<a-button v-if="buttonState.add && buttonRendering('add')" type="primary" @click="add">
|
|
9
15
|
<a-icon type="plus"/>新增
|
|
@@ -419,6 +425,8 @@ export default {
|
|
|
419
425
|
editLoading: false,
|
|
420
426
|
// 按钮状态
|
|
421
427
|
buttonState: {},
|
|
428
|
+
// eventBtnState
|
|
429
|
+
eventState: {},
|
|
422
430
|
// 自定义按钮数组
|
|
423
431
|
editButtonStateData: [],
|
|
424
432
|
// 按钮权限
|
|
@@ -637,6 +645,7 @@ export default {
|
|
|
637
645
|
tableColumns,
|
|
638
646
|
attachGrid,
|
|
639
647
|
buttonState,
|
|
648
|
+
eventState,
|
|
640
649
|
buttonPermissions,
|
|
641
650
|
editButtonStateData = [],
|
|
642
651
|
title,
|
|
@@ -698,6 +707,7 @@ export default {
|
|
|
698
707
|
this.createdQuery = createdQuery
|
|
699
708
|
this.primaryKey = primaryKey
|
|
700
709
|
this.buttonState = buttonState
|
|
710
|
+
this.eventState = eventState
|
|
701
711
|
if (this.localEditMode) {
|
|
702
712
|
this.localEditModeDataSource = []
|
|
703
713
|
this.isLocalDataSourceLoadedExternally = false
|
|
@@ -1030,6 +1040,10 @@ export default {
|
|
|
1030
1040
|
move () {
|
|
1031
1041
|
this.$emit('move')
|
|
1032
1042
|
},
|
|
1043
|
+
// 通用事件业务
|
|
1044
|
+
custom (func) {
|
|
1045
|
+
this.$emit('customEvent', func)
|
|
1046
|
+
},
|
|
1033
1047
|
// 编辑业务
|
|
1034
1048
|
edit (id) {
|
|
1035
1049
|
this.editLoading = true
|
|
@@ -87,9 +87,9 @@ routerResource.example = {
|
|
|
87
87
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
88
88
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
89
89
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
90
|
-
|
|
90
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
92
|
-
component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
92
|
+
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
93
93
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
94
94
|
// component: () => import('@vue2-client/base-client/components/common/XConversation/XConversationDemo.vue'),
|
|
95
95
|
// component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonDemo.vue'),
|