vue2-client 1.9.112 → 1.9.113
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/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +1 -0
- package/package.json +1 -1
- package/src/base-client/components/common/XCheckList/XCheckList.vue +106 -0
- package/src/base-client/components/common/XCheckList/XCheckListDemo.vue +41 -0
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +2 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +11 -2
- package/src/components/STable/index.js +1 -1
- package/src/router/async/router.map.js +1 -0
|
@@ -34,6 +34,7 @@ this.openDialog('xxx', 5, {}, {}, {})
|
|
|
34
34
|
- getTableData() 获取全部数据
|
|
35
35
|
- setTableData(data) 设置表格内数据
|
|
36
36
|
- Object.assign(this.fixedQueryForm, data) 给查询条件传值
|
|
37
|
+
- Object.assign(this.fixedAddForm, data) 给新增时赋固定内容
|
|
37
38
|
- getPrimaryData (rows) 返回主表不带别名的数据
|
|
38
39
|
- pushPrimaryData (rows) 把不带主表别名的数据放到数据区
|
|
39
40
|
- setFixedQueryForm (data) 设置固定条件,主表别名不用加
|
package/package.json
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-row :gutter="[16, 16]">
|
|
4
|
+
<a-col
|
|
5
|
+
v-for="(item, index) in items"
|
|
6
|
+
:key="index"
|
|
7
|
+
:span="8"
|
|
8
|
+
style="display: flex; align-items: center;"
|
|
9
|
+
>
|
|
10
|
+
<a-checkbox
|
|
11
|
+
v-model="item.checked"
|
|
12
|
+
@change="updateSelection(item)"
|
|
13
|
+
>
|
|
14
|
+
{{ item.label }} <!-- 显示 label -->
|
|
15
|
+
</a-checkbox>
|
|
16
|
+
</a-col>
|
|
17
|
+
</a-row>
|
|
18
|
+
<div style="margin-top: 20px;">
|
|
19
|
+
<a-button type="primary" @click="logSelection">打印选中结果</a-button>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="selectedItems.length">
|
|
22
|
+
<h3>选中的项目:</h3>
|
|
23
|
+
<ul>
|
|
24
|
+
<li v-for="(item, index) in selectedItems" :key="index">
|
|
25
|
+
{{ item.label }} <!-- 显示选中的 label -->
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: 'CheckboxGrid',
|
|
35
|
+
data () {
|
|
36
|
+
return {
|
|
37
|
+
serviceName: undefined,
|
|
38
|
+
// 每个选项包含 label 和 value
|
|
39
|
+
items: [
|
|
40
|
+
{ label: '选项 1', value: 'Value 1', checked: false },
|
|
41
|
+
{ label: '选项 2', value: 'Value 2', checked: false },
|
|
42
|
+
{ label: '选项 3', value: 'Value 3', checked: false },
|
|
43
|
+
{ label: '选项 4', value: 'Value 4', checked: false },
|
|
44
|
+
{ label: '选项 5', value: 'Value 5', checked: false },
|
|
45
|
+
{ label: '选项 6', value: 'Value 6', checked: false },
|
|
46
|
+
{ label: '选项 7', value: 'Value 7', checked: false },
|
|
47
|
+
{ label: '选项 8', value: 'Value 8', checked: false },
|
|
48
|
+
{ label: '选项 9', value: 'Value 9', checked: false },
|
|
49
|
+
],
|
|
50
|
+
// 存储选中的项的 value
|
|
51
|
+
selectedItems: [],
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
init (params) {
|
|
56
|
+
const {
|
|
57
|
+
serviceName,
|
|
58
|
+
// 可选内容
|
|
59
|
+
options
|
|
60
|
+
} = params
|
|
61
|
+
this.serviceName = serviceName
|
|
62
|
+
// 给options的每一项添加checked:false
|
|
63
|
+
this.items = options.map(option => ({
|
|
64
|
+
...option,
|
|
65
|
+
checked: false
|
|
66
|
+
}))
|
|
67
|
+
},
|
|
68
|
+
// 更新选中的项
|
|
69
|
+
updateSelection (item) {
|
|
70
|
+
if (item.checked) {
|
|
71
|
+
// 如果勾选,存储 item (包括 label 和 value)
|
|
72
|
+
this.selectedItems.push(item)
|
|
73
|
+
} else {
|
|
74
|
+
// 如果取消勾选,移除 item
|
|
75
|
+
const index = this.selectedItems.findIndex(i => i.value === item.value)
|
|
76
|
+
if (index > -1) {
|
|
77
|
+
this.selectedItems.splice(index, 1)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
// 打印选中项的 label
|
|
82
|
+
logSelection () {
|
|
83
|
+
// 打印选中项的 label
|
|
84
|
+
console.log(this.selectedItems.map(item => item.value))
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style scoped>
|
|
91
|
+
.two-column-checklist {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between; /* 自动调整两列间距 */
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.column {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
gap: 5px; /* 控制每一项的间距 */
|
|
100
|
+
width: 48%; /* 使两列宽度适中,留出间距 */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.item {
|
|
104
|
+
margin-bottom: 0; /* 避免额外的间距 */
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<x-check-list ref="xCheckList"></x-check-list>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import XCheckList from './XCheckList.vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'XCheckListDemo',
|
|
12
|
+
components: {
|
|
13
|
+
XCheckList
|
|
14
|
+
},
|
|
15
|
+
data () {
|
|
16
|
+
return {}
|
|
17
|
+
},
|
|
18
|
+
mounted () {
|
|
19
|
+
// 模拟接口返回的配置数据
|
|
20
|
+
const mockResponse = {
|
|
21
|
+
leftItems: [
|
|
22
|
+
{ value: 'left1', label: '左项1' },
|
|
23
|
+
{ value: 'left2', label: '左项2' },
|
|
24
|
+
{ value: 'left3', label: '左项3' }
|
|
25
|
+
],
|
|
26
|
+
rightItems: [
|
|
27
|
+
{ value: 'right1', label: '右项1' },
|
|
28
|
+
{ value: 'right2', label: '右项2' },
|
|
29
|
+
{ value: 'right3', label: '右项3' }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 模拟接口回调
|
|
34
|
+
this.$refs.xCheckList.init({
|
|
35
|
+
leftItems: mockResponse.leftItems,
|
|
36
|
+
rightItems: mockResponse.rightItems
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
methods: {}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
<template v-else-if="cell.type === 'slot'">
|
|
35
35
|
<template
|
|
36
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation'].includes(cell.slotType)">
|
|
36
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list'].includes(cell.slotType)">
|
|
37
37
|
<component
|
|
38
38
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
39
39
|
:key="cellIndex"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</template>
|
|
74
74
|
<template v-else-if="cell.type === 'slot'">
|
|
75
75
|
<template
|
|
76
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation'].includes(cell.slotType)">
|
|
76
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list'].includes(cell.slotType)">
|
|
77
77
|
<component
|
|
78
78
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
79
79
|
:key="cellIndex"
|
|
@@ -477,6 +477,7 @@ export default {
|
|
|
477
477
|
XButtons: () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
|
|
478
478
|
XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
|
|
479
479
|
XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
|
|
480
|
+
XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
|
|
480
481
|
},
|
|
481
482
|
props: {
|
|
482
483
|
// 每一行的配置
|
|
@@ -661,6 +662,14 @@ export default {
|
|
|
661
662
|
})
|
|
662
663
|
}, this.env === 'dev')
|
|
663
664
|
}
|
|
665
|
+
if (cell.slotType === 'x-check-list') {
|
|
666
|
+
getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
|
|
667
|
+
this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
|
|
668
|
+
serviceName: cell.serviceName,
|
|
669
|
+
...res,
|
|
670
|
+
})
|
|
671
|
+
}, this.env === 'dev')
|
|
672
|
+
}
|
|
664
673
|
},
|
|
665
674
|
|
|
666
675
|
// 对于嵌套情况,对colSpan重新分配
|
|
@@ -335,7 +335,7 @@ export default {
|
|
|
335
335
|
props.pagination = false
|
|
336
336
|
// 自定义底部汇总插槽组件
|
|
337
337
|
const pagination = (
|
|
338
|
-
<a-row type={'flex'} justify={'start'} style={{ marginTop: '8px'
|
|
338
|
+
<a-row type={'flex'} justify={'start'} style={{ marginTop: '8px' }}>
|
|
339
339
|
<a-col flex="1" style={{
|
|
340
340
|
alignItems: 'center',
|
|
341
341
|
display: 'flex',
|
|
@@ -94,6 +94,7 @@ routerResource.example = {
|
|
|
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'),
|
|
96
96
|
// component: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue'),
|
|
97
|
+
// component: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
|
|
97
98
|
meta: {
|
|
98
99
|
// 菜单中不显示
|
|
99
100
|
invisible: true,
|