vue2-client 1.8.366 → 1.8.369
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/XDetailsView/XDetailsView.vue +1 -1
- package/src/base-client/components/common/XTree/XTreePro.vue +2 -1
- package/src/base-client/components/common/XTreeOne/XTreeOnePro.vue +12 -0
- package/src/pages/XReportGridView/XReport.vue +2 -2
- package/src/pages/XReportGridView/XReportDemo.vue +1 -1
- package/src/pages/XReportGridView/XReportTrGroup.vue +22 -3
- package/src/pages/XTab/XTab.vue +44 -26
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<!-- 详情区域 -->
|
|
18
18
|
<div class="row">
|
|
19
19
|
<div class="content">
|
|
20
|
-
<a-descriptions :column="desColumn"
|
|
20
|
+
<a-descriptions :column="desColumn" style="padding-left: 2%">
|
|
21
21
|
<slot name="descriptionsContent" :details="details"/>
|
|
22
22
|
</a-descriptions>
|
|
23
23
|
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<a-col span="16" :offset="2">
|
|
6
6
|
<span>{{ config.title }}</span>
|
|
7
7
|
</a-col>
|
|
8
|
-
<a-col span="
|
|
8
|
+
<a-col span="1" :offset="2" v-if="treeDisplaySwitch">
|
|
9
9
|
<a-icon :type="treeDisplayConfig.showTree? 'caret-down':'caret-left'" :style="{color: treeDisplayConfig.buttonColor}" @click="treeDisplayConfig.showTree=!treeDisplayConfig.showTree"/>
|
|
10
10
|
</a-col>
|
|
11
11
|
</a-row>
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
:item-size="40"
|
|
51
51
|
:auto-expand-parent="true"
|
|
52
52
|
@check-change="handleCheckChange"
|
|
53
|
+
@node-click="handleNodeClick"
|
|
53
54
|
:filter-node-method="filterNode"
|
|
54
55
|
:props="props"
|
|
55
56
|
>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:serviceName="serviceName"
|
|
9
9
|
:env="env"
|
|
10
10
|
:countVisible="countVisible"
|
|
11
|
+
@action="action"
|
|
11
12
|
@treeOnChecked="treeOnChecked"
|
|
12
13
|
@itemChecked="itemChecked"
|
|
13
14
|
ref="xtree"
|
|
@@ -84,6 +85,17 @@
|
|
|
84
85
|
mounted () {
|
|
85
86
|
},
|
|
86
87
|
methods: {
|
|
88
|
+
/**
|
|
89
|
+
* 详情按钮事件
|
|
90
|
+
* @param record 本条数据
|
|
91
|
+
* @param id 数据标识
|
|
92
|
+
* @param actionType 操作类型
|
|
93
|
+
* @param fun 向上级传递的事件
|
|
94
|
+
*/
|
|
95
|
+
action (record, id, actionType, fun = 'action') {
|
|
96
|
+
this.$emit(fun, record, id, actionType)
|
|
97
|
+
this.$lowCodeEmit(fun, record)
|
|
98
|
+
},
|
|
87
99
|
treeOnChecked (checkedKeys, deepNodes, deepKeys) {
|
|
88
100
|
this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
|
|
89
101
|
},
|
|
@@ -129,7 +129,7 @@ export default {
|
|
|
129
129
|
// 只做展示
|
|
130
130
|
displayOnly: {
|
|
131
131
|
type: Boolean,
|
|
132
|
-
default:
|
|
132
|
+
default: true
|
|
133
133
|
},
|
|
134
134
|
// 表格没有边距
|
|
135
135
|
noPadding: {
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
149
149
|
// 是否展示保存按钮
|
|
150
150
|
showSaveButton: {
|
|
151
151
|
type: Boolean,
|
|
152
|
-
default:
|
|
152
|
+
default: false
|
|
153
153
|
},
|
|
154
154
|
// 是否将组件注册到外层提供的容器中,方便外侧统一保存
|
|
155
155
|
registerMap: {
|
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
:span="cell.colSpan ? cell.colSpan * 2 : undefined">
|
|
13
13
|
<!-- 插槽渲染 -->
|
|
14
14
|
<template v-if="cell.type === 'slot'">
|
|
15
|
-
<
|
|
15
|
+
<template v-if="cell.slotType === 'x-form-table'">
|
|
16
|
+
<component :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)" :key="cellIndex" :serviceName="cell.serviceName" :queryParamsName="cell.slotConfig" />
|
|
17
|
+
</template>
|
|
18
|
+
</template>
|
|
19
|
+
<!-- button 按钮渲染 -->
|
|
20
|
+
<template v-else-if="cell.type === 'button'">
|
|
21
|
+
<a-button @[cell.eventType]="() => executeCustomFunction(cell.customFunction)">
|
|
22
|
+
{{ cell.buttonName }}
|
|
23
|
+
</a-button>
|
|
16
24
|
</template>
|
|
17
25
|
<template v-else-if="cell.type === 'column'">
|
|
18
26
|
<template v-if="cell.customFunction">
|
|
@@ -459,10 +467,21 @@ export default {
|
|
|
459
467
|
}
|
|
460
468
|
},
|
|
461
469
|
methods: {
|
|
462
|
-
|
|
470
|
+
executeCustomFunction (funcStr) {
|
|
471
|
+
try {
|
|
472
|
+
// 使用 Function 构造器创建函数
|
|
473
|
+
// eslint-disable-next-line no-new-func
|
|
474
|
+
const func = new Function('return ' + funcStr)()
|
|
475
|
+
// 执行函数
|
|
476
|
+
func.call(this)
|
|
477
|
+
} catch (error) {
|
|
478
|
+
console.error('Error executing custom function:', error)
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
getComponentName (queryParamsName, serviceName, componentName) {
|
|
463
482
|
// const config = await getConfigByName(queryParamsName, serviceName)
|
|
464
483
|
// const componentName = config.$globalProp.type
|
|
465
|
-
return
|
|
484
|
+
return componentName
|
|
466
485
|
},
|
|
467
486
|
updateImg (data) {
|
|
468
487
|
this.$emit('updateImg', data)
|
package/src/pages/XTab/XTab.vue
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<a-tabs
|
|
3
|
+
<a-tabs default-active-key="0">
|
|
4
4
|
<a-tab-pane
|
|
5
5
|
v-for="(tab, index) in config"
|
|
6
6
|
:key="index"
|
|
7
7
|
:tab="tab.title"
|
|
8
|
-
:keyProp="'key'"
|
|
9
8
|
>
|
|
10
9
|
<component :is="tab.slotType" :key="index" :serviceName="tab.serviceName" :queryParamsName="tab.slotConfig" />
|
|
11
10
|
</a-tab-pane>
|
|
@@ -14,49 +13,68 @@
|
|
|
14
13
|
</template>
|
|
15
14
|
|
|
16
15
|
<script>
|
|
17
|
-
import { Tabs, Button } from 'ant-design-vue'
|
|
18
16
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
19
17
|
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
20
18
|
|
|
21
19
|
export default {
|
|
22
20
|
name: 'XTab',
|
|
21
|
+
components: {
|
|
22
|
+
XFormTable,
|
|
23
|
+
},
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
activeKey: 0,
|
|
27
|
+
// 配置
|
|
28
|
+
config: undefined,
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
initConfig () {
|
|
33
|
+
if (this.configName) {
|
|
34
|
+
this.getConfig()
|
|
35
|
+
} else if (this.localConfig) {
|
|
36
|
+
this.config = this.localConfig.data
|
|
37
|
+
console.log('>>>> this.config: ', JSON.stringify(this.config))
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
getConfig () {
|
|
41
|
+
getConfigByName(this.configName, this.serverName, res => {
|
|
42
|
+
this.config = res.data
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
},
|
|
23
46
|
props: {
|
|
24
47
|
// 配置名
|
|
25
48
|
configName: {
|
|
26
49
|
type: String,
|
|
27
|
-
|
|
50
|
+
default: undefined
|
|
28
51
|
},
|
|
29
52
|
serverName: {
|
|
30
53
|
type: String,
|
|
31
|
-
|
|
32
|
-
}
|
|
54
|
+
default: undefined
|
|
55
|
+
},
|
|
56
|
+
// 本地配置,调试用
|
|
57
|
+
localConfig: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: undefined
|
|
60
|
+
},
|
|
33
61
|
},
|
|
34
62
|
watch: {
|
|
35
63
|
configName: {
|
|
36
64
|
deep: true,
|
|
37
65
|
immediate: true,
|
|
38
66
|
handler (val) {
|
|
39
|
-
|
|
40
|
-
getConfigByName(this.configName, this.serverName, res => {
|
|
41
|
-
this.config = res.data
|
|
42
|
-
})
|
|
43
|
-
}
|
|
67
|
+
this.initConfig()
|
|
44
68
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
activeKey: '1',
|
|
56
|
-
// 配置
|
|
57
|
-
config: undefined,
|
|
58
|
-
}
|
|
69
|
+
},
|
|
70
|
+
// 如果本地配置更改了,重新初始化
|
|
71
|
+
localConfig: {
|
|
72
|
+
deep: true,
|
|
73
|
+
immediate: true,
|
|
74
|
+
handler (val) {
|
|
75
|
+
this.initConfig()
|
|
76
|
+
}
|
|
77
|
+
},
|
|
59
78
|
},
|
|
60
|
-
methods: {},
|
|
61
79
|
}
|
|
62
80
|
</script>
|