vue2-client 1.18.53 → 1.18.55
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/XForm.vue +17 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +4 -1
- package/src/base-client/components/common/XFormTable/demo.vue +11 -4
- package/src/base-client/components/common/XTable/XTable.vue +0 -12
- package/src/components/xScrollBox/index.vue +19 -8
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -516,6 +516,23 @@ export default {
|
|
|
516
516
|
},
|
|
517
517
|
setForm(obj) {
|
|
518
518
|
this.form = Object.assign(this.form, obj)
|
|
519
|
+
},
|
|
520
|
+
/**
|
|
521
|
+
* 主动触发表单提交
|
|
522
|
+
* 用于 queryTable 等场景,确保走相同的数据处理流程
|
|
523
|
+
* @param {Object} conditionParams - 额外的查询条件参数
|
|
524
|
+
*/
|
|
525
|
+
submitForm(conditionParams = {}) {
|
|
526
|
+
// 备份一下 form 这个函数传递的 condition 仅临时用一下
|
|
527
|
+
// 如果要实质修改 form 从其他地方赋值
|
|
528
|
+
const _from = JSON.parse(JSON.stringify(this.form))
|
|
529
|
+
// 将外部参数合并到表单中
|
|
530
|
+
if (Object.keys(conditionParams).length > 0) {
|
|
531
|
+
this.form = Object.assign({}, this.form, conditionParams)
|
|
532
|
+
}
|
|
533
|
+
// 调用现有的 onSubmit 方法,触发 emit
|
|
534
|
+
this.onSubmit()
|
|
535
|
+
this.form = _from
|
|
519
536
|
}
|
|
520
537
|
},
|
|
521
538
|
mounted() {
|
|
@@ -1032,7 +1032,10 @@ export default {
|
|
|
1032
1032
|
if (this.tableShowMode === 'popup') {
|
|
1033
1033
|
this.formQueryLoading = true
|
|
1034
1034
|
}
|
|
1035
|
-
|
|
1035
|
+
// 调用 XForm 的 submitForm 方法
|
|
1036
|
+
// 这会触发 emit 'onSubmit',然后走现有的 onSearchSubmit 逻辑
|
|
1037
|
+
// 最终通过 setQueryForm → refresh → loadData 进行数据处理
|
|
1038
|
+
this.$refs.xForm.submitForm(conditionParams)
|
|
1036
1039
|
},
|
|
1037
1040
|
/**
|
|
1038
1041
|
* 向外暴露 resetForm 函数
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a-card :bordered="false">
|
|
3
|
+
<div style="margin-bottom: 16px">
|
|
4
|
+
<a-button type="primary" @click="handleCustomQuery">查询 XianFeng 数据</a-button>
|
|
5
|
+
</div>
|
|
3
6
|
<x-form-table
|
|
4
7
|
title="示例表单"
|
|
5
8
|
:queryParamsName="queryParamsName"
|
|
@@ -14,10 +17,9 @@
|
|
|
14
17
|
:defaultQueryForm="{
|
|
15
18
|
s_f_user_name: '张三'
|
|
16
19
|
}"
|
|
17
|
-
serviceName="af-
|
|
20
|
+
serviceName="af-revenue"
|
|
18
21
|
ref="xFormTable"
|
|
19
22
|
></x-form-table>
|
|
20
|
-
<div style="height: 100px; width: 100%; background-color: #f0f2f5"></div>
|
|
21
23
|
</a-card>
|
|
22
24
|
</template>
|
|
23
25
|
|
|
@@ -32,7 +34,7 @@ export default {
|
|
|
32
34
|
data() {
|
|
33
35
|
return {
|
|
34
36
|
// 查询配置文件名
|
|
35
|
-
queryParamsName: '
|
|
37
|
+
queryParamsName: 'ChargeCenterQueryUserCRUD',
|
|
36
38
|
// 查询配置左侧tree
|
|
37
39
|
xTreeConfigName: 'addressType',
|
|
38
40
|
// 新增表单固定值
|
|
@@ -51,7 +53,12 @@ export default {
|
|
|
51
53
|
},
|
|
52
54
|
|
|
53
55
|
methods: {
|
|
54
|
-
|
|
56
|
+
handleCustomQuery() {
|
|
57
|
+
this.$refs.xFormTable.queryTable({
|
|
58
|
+
uf_f_alias: 'XianFeng',
|
|
59
|
+
uf_f_card_id: '10500030'
|
|
60
|
+
})
|
|
61
|
+
},
|
|
55
62
|
rowDblClick(record) {
|
|
56
63
|
console.log('rowDblClick', record)
|
|
57
64
|
},
|
|
@@ -1220,18 +1220,6 @@ export default {
|
|
|
1220
1220
|
// 如果要实质修改 form 需要在 x-form 中赋值
|
|
1221
1221
|
const _from = JSON.parse(JSON.stringify(this.form))
|
|
1222
1222
|
this.form = Object.assign(_from, conditionParams)
|
|
1223
|
-
for (const key of Object.keys(this.form)) {
|
|
1224
|
-
if (this.form[key] === null || this.form[key] === '') {
|
|
1225
|
-
this.form[key] = undefined
|
|
1226
|
-
}
|
|
1227
|
-
// 树形选择框重置后会重置为[undefined],查询时为[null]
|
|
1228
|
-
if (
|
|
1229
|
-
Array.isArray(this.form[key]) &&
|
|
1230
|
-
(this.form[key].length === 0 || this.form[key][0] === null || this.form[key][0] === undefined)
|
|
1231
|
-
) {
|
|
1232
|
-
this.form[key] = undefined
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
1223
|
await this.refresh(true)
|
|
1236
1224
|
this.form = _from
|
|
1237
1225
|
},
|
|
@@ -5,21 +5,32 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
+
import { isMicroAppEnv } from '@vue2-client/utils/microAppUtils'
|
|
9
|
+
|
|
8
10
|
export default {
|
|
9
11
|
name: 'XScrollBox',
|
|
10
|
-
data
|
|
12
|
+
data() {
|
|
11
13
|
return {
|
|
12
14
|
scrollBoxRef: null
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
17
|
computed: {
|
|
16
18
|
// 判断当前是否为 blank 模式
|
|
17
|
-
isBlankMode
|
|
19
|
+
isBlankMode() {
|
|
18
20
|
return process.env.VUE_APP_SINGLE_PAPER === 'TRUE'
|
|
19
21
|
},
|
|
20
|
-
computedStyle
|
|
22
|
+
computedStyle() {
|
|
21
23
|
if (this.isBlankMode) {
|
|
22
|
-
// blank
|
|
24
|
+
// blank 模式下,如果是微应用环境,使用父级 CSS 变量
|
|
25
|
+
if (isMicroAppEnv()) {
|
|
26
|
+
return {
|
|
27
|
+
height: 'var(--parent-scroll-height, 100%)',
|
|
28
|
+
maxHeight: 'var(--parent-scroll-height, 100%)',
|
|
29
|
+
minHeight: 'var(--parent-scroll-height, 100%)',
|
|
30
|
+
overflow: 'auto'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// 非微应用环境使用 100%
|
|
23
34
|
return {
|
|
24
35
|
height: '100%',
|
|
25
36
|
maxHeight: '100%',
|
|
@@ -36,7 +47,7 @@ export default {
|
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
49
|
},
|
|
39
|
-
mounted
|
|
50
|
+
mounted() {
|
|
40
51
|
// 获取滚动容器引用
|
|
41
52
|
this.scrollBoxRef = this.$el
|
|
42
53
|
},
|
|
@@ -45,7 +56,7 @@ export default {
|
|
|
45
56
|
* 滚动到顶部
|
|
46
57
|
* @param {boolean} smooth - 是否平滑滚动,默认 true
|
|
47
58
|
*/
|
|
48
|
-
scrollToTop
|
|
59
|
+
scrollToTop(smooth = true) {
|
|
49
60
|
if (this.scrollBoxRef) {
|
|
50
61
|
this.scrollBoxRef.scrollTo({
|
|
51
62
|
top: 0,
|
|
@@ -61,7 +72,7 @@ export default {
|
|
|
61
72
|
* @param {number} left - 水平位置,默认 0
|
|
62
73
|
* @param {boolean} smooth - 是否平滑滚动,默认 true
|
|
63
74
|
*/
|
|
64
|
-
scrollTo
|
|
75
|
+
scrollTo(top, left = 0, smooth = true) {
|
|
65
76
|
if (this.scrollBoxRef) {
|
|
66
77
|
this.scrollBoxRef.scrollTo({
|
|
67
78
|
top,
|
|
@@ -75,7 +86,7 @@ export default {
|
|
|
75
86
|
* 获取当前滚动位置
|
|
76
87
|
* @returns {Object} - { scrollTop, scrollLeft }
|
|
77
88
|
*/
|
|
78
|
-
getScrollPosition
|
|
89
|
+
getScrollPosition() {
|
|
79
90
|
if (this.scrollBoxRef) {
|
|
80
91
|
return {
|
|
81
92
|
scrollTop: this.scrollBoxRef.scrollTop,
|
|
@@ -55,13 +55,13 @@ routerResource.example = {
|
|
|
55
55
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
|
56
56
|
// component: () => import('@vue2-client/base-client/components/his/HChart/demo.vue'),
|
|
57
57
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
58
|
-
|
|
58
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue')
|
|
59
59
|
// component: () => import('@vue2-client/base-client/components/common/ImagePreviewModal/demo.vue'),
|
|
60
60
|
// component: () => import('@vue2-client/components/xScrollBox/example.vue'),
|
|
61
61
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
62
62
|
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
|
63
63
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
|
64
|
-
component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue')
|
|
64
|
+
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue')
|
|
65
65
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
66
66
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
67
67
|
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|