vue2-client 1.15.105 → 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
@@ -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
|
// 模式
|
@@ -1,11 +1,14 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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>
|
9
12
|
</template>
|
10
13
|
|
11
14
|
<script>
|
@@ -26,7 +29,9 @@ export default {
|
|
26
29
|
data () {
|
27
30
|
return {
|
28
31
|
columns: [],
|
29
|
-
tableData: []
|
32
|
+
tableData: [],
|
33
|
+
tableHeight: 'auto', // 默认高度
|
34
|
+
scrollY: undefined
|
30
35
|
}
|
31
36
|
},
|
32
37
|
watch: {
|
@@ -38,7 +43,6 @@ export default {
|
|
38
43
|
}
|
39
44
|
},
|
40
45
|
computed: {
|
41
|
-
// 只处理headerStyle的列配置
|
42
46
|
processedColumns () {
|
43
47
|
return this.columns.map(column => ({
|
44
48
|
...column,
|
@@ -51,12 +55,8 @@ export default {
|
|
51
55
|
methods: {
|
52
56
|
init (config, parameterData) {
|
53
57
|
getConfigByName(config, 'af-his', res => {
|
54
|
-
//
|
55
|
-
//
|
56
|
-
// title: '项目名称',
|
57
|
-
// dataIndex: 'name',
|
58
|
-
// headerStyle: { color: '#1890ff', fontWeight: 'bold' }
|
59
|
-
// }]
|
58
|
+
// 从配置中获取表格高度
|
59
|
+
this.tableHeight = res.tableHeight || '400px' // 默认400px
|
60
60
|
this.columns = res.columns || []
|
61
61
|
|
62
62
|
runLogic(res.logicName, parameterData, 'af-his').then(result => {
|
@@ -64,6 +64,10 @@ export default {
|
|
64
64
|
...item,
|
65
65
|
key: item[this.rowKey] || `row_${index}`
|
66
66
|
}))
|
67
|
+
|
68
|
+
this.$nextTick(() => {
|
69
|
+
this.scrollY = this.tableHeight
|
70
|
+
})
|
67
71
|
})
|
68
72
|
})
|
69
73
|
}
|
@@ -72,17 +76,44 @@ export default {
|
|
72
76
|
</script>
|
73
77
|
|
74
78
|
<style scoped>
|
79
|
+
/* 表格容器 */
|
80
|
+
.table-container {
|
81
|
+
overflow: hidden;
|
82
|
+
display: flex;
|
83
|
+
flex-direction: column;
|
84
|
+
}
|
85
|
+
|
75
86
|
/* 基础无边框样式 */
|
76
87
|
/deep/ .ant-table {
|
77
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;
|
78
98
|
}
|
99
|
+
|
100
|
+
/deep/ .ant-table-body {
|
101
|
+
flex: 1;
|
102
|
+
overflow-y: auto !important;
|
103
|
+
}
|
104
|
+
|
79
105
|
/deep/ .ant-table-tbody > tr > td {
|
80
106
|
border-bottom: none !important;
|
81
107
|
padding: 6px !important;
|
82
108
|
}
|
109
|
+
|
83
110
|
/deep/ .ant-table-thead > tr > th {
|
84
111
|
border-bottom: none !important;
|
85
112
|
background: none !important;
|
86
113
|
padding: 8px 6px !important;
|
114
|
+
position: sticky;
|
115
|
+
top: 0;
|
116
|
+
z-index: 1;
|
117
|
+
background-color: white !important;
|
87
118
|
}
|
88
119
|
</style>
|