vue2-client 1.15.104 → 1.15.106
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
CHANGED
@@ -67,7 +67,7 @@
|
|
67
67
|
<template v-if="panel.type === 'picture'">
|
68
68
|
<img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
|
69
69
|
</template>
|
70
|
-
<template v-else-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', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card','x-tree-rows'].includes(panel.type)">
|
70
|
+
<template v-else-if="['x-form-table','x-simple-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', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card','x-tree-rows'].includes(panel.type)">
|
71
71
|
<component
|
72
72
|
:is="getComponentName(panel.type)"
|
73
73
|
:ref="`dynamicComponent_${ panel.type }_${ panelIndex }`"
|
@@ -116,7 +116,8 @@ export default {
|
|
116
116
|
XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
|
117
117
|
XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
|
118
118
|
XTextCard: () => import('@vue2-client/base-client/components/his/XTextCard/XTextCard.vue'),
|
119
|
-
XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue')
|
119
|
+
XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue'),
|
120
|
+
XSimpleTable: () => import('@vue2-client/base-client/components/his/XSimpleTable/XSimpleTable.vue')
|
120
121
|
},
|
121
122
|
data () {
|
122
123
|
return {
|
@@ -4,7 +4,7 @@
|
|
4
4
|
:columns="columns"
|
5
5
|
:data-source="data"
|
6
6
|
:rowSelection="rowSelection"
|
7
|
-
:scroll="{ y: '
|
7
|
+
:scroll="{ y: height == null? '70%' : height }">
|
8
8
|
<span slot="time" class="time-title">
|
9
9
|
<span v-for="(item, index) in configData.timePeriod" :key="index">{{ item }}</span>
|
10
10
|
</span>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</a-table>
|
28
28
|
</div>
|
29
29
|
<div v-else-if="pattern == 'form'">
|
30
|
-
<a-table :columns="columns" :data-source='data' :row-selection="rowSelection" bordered :scroll="{ y: '
|
30
|
+
<a-table :columns="columns" :data-source='data' :row-selection="rowSelection" bordered :scroll="{ y: height == null? '70%' : height }">
|
31
31
|
<template v-for="(n, i) in inputColumns" :slot="n.dataIndex" slot-scope="text, record">
|
32
32
|
<div class="a-div" :key="i">
|
33
33
|
<a-input
|
@@ -52,6 +52,8 @@ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
52
52
|
export default {
|
53
53
|
data () {
|
54
54
|
return {
|
55
|
+
// 高度
|
56
|
+
height: '70%',
|
55
57
|
// 输入框数据
|
56
58
|
inputData: [],
|
57
59
|
// 模式
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="table-container" :style="{ height: tableHeight }">
|
3
|
+
<a-table
|
4
|
+
:columns="processedColumns"
|
5
|
+
:dataSource="tableData"
|
6
|
+
:pagination="false"
|
7
|
+
:bordered="false"
|
8
|
+
:rowKey="rowKey"
|
9
|
+
:scroll="{ y: scrollY }"
|
10
|
+
/>
|
11
|
+
</div>
|
12
|
+
</template>
|
13
|
+
|
14
|
+
<script>
|
15
|
+
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
16
|
+
|
17
|
+
export default {
|
18
|
+
props: {
|
19
|
+
queryParamsName: String,
|
20
|
+
rowKey: {
|
21
|
+
type: String,
|
22
|
+
default: 'id'
|
23
|
+
},
|
24
|
+
parameter: {
|
25
|
+
type: Object,
|
26
|
+
default: () => ({})
|
27
|
+
}
|
28
|
+
},
|
29
|
+
data () {
|
30
|
+
return {
|
31
|
+
columns: [],
|
32
|
+
tableData: [],
|
33
|
+
tableHeight: 'auto', // 默认高度
|
34
|
+
scrollY: undefined
|
35
|
+
}
|
36
|
+
},
|
37
|
+
watch: {
|
38
|
+
queryParamsName: {
|
39
|
+
immediate: true,
|
40
|
+
handler (val) {
|
41
|
+
val && this.init(val, this.parameter)
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
computed: {
|
46
|
+
processedColumns () {
|
47
|
+
return this.columns.map(column => ({
|
48
|
+
...column,
|
49
|
+
customHeaderCell: column.headerStyle
|
50
|
+
? () => ({ style: column.headerStyle })
|
51
|
+
: undefined
|
52
|
+
}))
|
53
|
+
}
|
54
|
+
},
|
55
|
+
methods: {
|
56
|
+
init (config, parameterData) {
|
57
|
+
getConfigByName(config, 'af-his', res => {
|
58
|
+
// 从配置中获取表格高度
|
59
|
+
this.tableHeight = res.tableHeight || '400px' // 默认400px
|
60
|
+
this.columns = res.columns || []
|
61
|
+
|
62
|
+
runLogic(res.logicName, parameterData, 'af-his').then(result => {
|
63
|
+
this.tableData = result.map((item, index) => ({
|
64
|
+
...item,
|
65
|
+
key: item[this.rowKey] || `row_${index}`
|
66
|
+
}))
|
67
|
+
|
68
|
+
this.$nextTick(() => {
|
69
|
+
this.scrollY = this.tableHeight
|
70
|
+
})
|
71
|
+
})
|
72
|
+
})
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
</script>
|
77
|
+
|
78
|
+
<style scoped>
|
79
|
+
/* 表格容器 */
|
80
|
+
.table-container {
|
81
|
+
overflow: hidden;
|
82
|
+
display: flex;
|
83
|
+
flex-direction: column;
|
84
|
+
}
|
85
|
+
|
86
|
+
/* 基础无边框样式 */
|
87
|
+
/deep/ .ant-table {
|
88
|
+
border: none !important;
|
89
|
+
flex: 1;
|
90
|
+
display: flex;
|
91
|
+
flex-direction: column;
|
92
|
+
}
|
93
|
+
|
94
|
+
/deep/ .ant-table-content {
|
95
|
+
flex: 1;
|
96
|
+
display: flex;
|
97
|
+
flex-direction: column;
|
98
|
+
}
|
99
|
+
|
100
|
+
/deep/ .ant-table-body {
|
101
|
+
flex: 1;
|
102
|
+
overflow-y: auto !important;
|
103
|
+
}
|
104
|
+
|
105
|
+
/deep/ .ant-table-tbody > tr > td {
|
106
|
+
border-bottom: none !important;
|
107
|
+
padding: 6px !important;
|
108
|
+
}
|
109
|
+
|
110
|
+
/deep/ .ant-table-thead > tr > th {
|
111
|
+
border-bottom: none !important;
|
112
|
+
background: none !important;
|
113
|
+
padding: 8px 6px !important;
|
114
|
+
position: sticky;
|
115
|
+
top: 0;
|
116
|
+
z-index: 1;
|
117
|
+
background-color: white !important;
|
118
|
+
}
|
119
|
+
</style>
|