vue2-client 1.16.22 → 1.16.24

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.
@@ -1,219 +1,219 @@
1
- <script setup lang="ts">
2
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
3
- import { ref, computed } from 'vue'
4
-
5
- const props = defineProps({
6
- // HFormTable特有的属性
7
- tableStyle: {
8
- type: String,
9
- default: 'formtable-col1'
10
- },
11
- // 顶部
12
- topStyle: {
13
- type: String,
14
- default: ''
15
- },
16
- // 分页
17
- paginationStyle: {
18
- type: String,
19
- default: ''
20
- }
21
- })
22
-
23
- // 创建对XFormTable组件的引用
24
- const xFormTableRef = ref()
25
-
26
- // 暴露方法给父组件使用
27
- defineExpose({
28
- // 为了兼容性,保留getXFormTableInstance方法
29
- getXFormTableInstance: () => xFormTableRef.value
30
- })
31
-
32
- // 计算是否使用自定义分页
33
- const isCustomPagination = computed(() => props.tableStyle === 'custom-pagination' || props.paginationStyle === 'custom-pagination')
34
- </script>
35
-
36
- <template>
37
- <div
38
- class="h-form-table-wrapper"
39
- :class="[
40
- `h-form-table-${tableStyle}`,
41
- {
42
- [`h-form-table-${topStyle}`]: ['top-hidden'].includes(topStyle),
43
- [`h-form-table-${paginationStyle}`]: ['pagination-center','custom-pagination'].includes(paginationStyle)
44
- }
45
- ]"
46
- >
47
- <x-form-table
48
- ref="xFormTableRef"
49
- v-bind="$attrs"
50
- :customPagination="isCustomPagination"
51
- v-on="$listeners"
52
- >
53
- <template v-for="(_, name) in $slots" #[name]="slotData">
54
- <slot :name="name" v-bind="slotData" />
55
- </template>
56
- </x-form-table>
57
- </div>
58
- </template>
59
-
60
- <style scoped lang="less">
61
- .h-form-table-wrapper {
62
- // 基础样式
63
- :deep(.table-wrapper) {
64
- .ant-table {
65
- .ant-table-row {
66
- margin: 0px;
67
-
68
- .ant-form-item {
69
- margin: 0px;
70
-
71
- .ant-form-item-control-wrapper {
72
- .ant-form-item-control {
73
- line-height: 0px;
74
-
75
- .ant-select-selection--multiple {
76
- padding-bottom: 2px;
77
- }
78
- }
79
- width: 100%;
80
- }
81
- }
82
- }
83
- font-size: 16px;
84
- }
85
-
86
- .ant-alert-info {
87
- display: none;
88
- }
89
- }
90
-
91
- :deep(.ant-card) {
92
- margin: -10px 0px 29px 0px;
93
- }
94
-
95
- :deep(.ant-btn) {
96
- border: 0px;
97
- box-shadow: none;
98
- padding: 0px;
99
- color: #5D5C5C;
100
- font-weight: bold;
101
- letter-spacing: 0em;
102
- font-size: 18px;
103
- line-height: normal;
104
- font-family: "Source Han Sans";
105
- }
106
-
107
- :deep(.ant-card-body) {
108
- padding: 0 6px;
109
- }
110
-
111
- :deep(.ant-table-small) {
112
- border-width: 0;
113
-
114
- .ant-table-fixed {
115
- border-radius: 0;
116
- border-bottom: 1px solid #f0f0f0;
117
- }
118
- }
119
-
120
- // 表格高度样式
121
- &.h-form-table-height {
122
- :deep(.table-wrapper) {
123
- .ant-select-open ~ .ant-table-content {
124
- height: 500px !important;
125
- }
126
- }
127
- }
128
-
129
- // 表格样式
130
- &.h-form-table-table {
131
- :deep(.ant-table-small .ant-table-fixed-header) {
132
- .ant-table-content {
133
- .ant-table-content {
134
- .ant-table-body {
135
- border-radius: 0 0 4px 4px;
136
- overflow: visible !important;
137
- }
138
- }
139
- }
140
- }
141
- }
142
-
143
- // 隐藏按钮区域
144
- &.h-form-table-button-area-hide {
145
- :deep(.ant-btn) {
146
- display: none;
147
- }
148
-
149
- :deep(.table-wrapper) {
150
- margin-top: -39px;
151
- }
152
- }
153
-
154
- // 顶部区域隐藏(与按钮隐藏一致的视觉需求)
155
- &.h-form-table-top-hidden {
156
- :deep(.ant-btn) {
157
- display: none;
158
- }
159
-
160
- :deep(.table-wrapper) {
161
- margin-top: -39px;
162
- }
163
- }
164
-
165
- // 列样式1
166
- &.h-form-table-formtable-col1 {
167
- :deep(.table-wrapper) {
168
- .ant-row {
169
- .ant-col span {
170
- border: none;
171
- width: auto;
172
- margin-bottom: auto;
173
- }
174
- }
175
-
176
- .ant-table {
177
- .ant-table-body {
178
- .ant-table-fixed colgroup col:nth-child(2) {
179
- width: 50px;
180
- min-width: 50px;
181
- }
182
- }
183
-
184
- .ant-table-header {
185
- .ant-table-fixed colgroup col:nth-child(2) {
186
- width: 50px;
187
- min-width: 50px;
188
- }
189
- }
190
- }
191
- }
192
- }
193
-
194
- // 底部分页居中 & 自定义分页样式(共用样式)
195
- &.h-form-table-bottom-center,
196
- &.h-form-table-custom-pagination {
197
- :deep(.table-wrapper) {
198
- .ant-row-flex-start {
199
- position: relative;
200
- display: flex;
201
- align-items: center;
202
- margin-top: 24px !important;
203
-
204
- // 防止第一个子元素无限拉伸,影响分页居中
205
- > :first-child {
206
- flex: 0 0 auto;
207
- }
208
-
209
- // 将第二个子元素(分页)绝对居中
210
- > :nth-child(2) {
211
- position: absolute;
212
- left: 50%;
213
- transform: translateX(-50%);
214
- }
215
- }
216
- }
217
- }
218
- }
219
- </style>
1
+ <script setup lang="ts">
2
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
3
+ import { ref, computed } from 'vue'
4
+
5
+ const props = defineProps({
6
+ // HFormTable特有的属性
7
+ tableStyle: {
8
+ type: String,
9
+ default: 'formtable-col1'
10
+ },
11
+ // 顶部
12
+ topStyle: {
13
+ type: String,
14
+ default: ''
15
+ },
16
+ // 分页
17
+ paginationStyle: {
18
+ type: String,
19
+ default: ''
20
+ }
21
+ })
22
+
23
+ // 创建对XFormTable组件的引用
24
+ const xFormTableRef = ref()
25
+
26
+ // 暴露方法给父组件使用
27
+ defineExpose({
28
+ // 为了兼容性,保留getXFormTableInstance方法
29
+ getXFormTableInstance: () => xFormTableRef.value
30
+ })
31
+
32
+ // 计算是否使用自定义分页
33
+ const isCustomPagination = computed(() => props.tableStyle === 'custom-pagination' || props.paginationStyle === 'custom-pagination')
34
+ </script>
35
+
36
+ <template>
37
+ <div
38
+ class="h-form-table-wrapper"
39
+ :class="[
40
+ `h-form-table-${tableStyle}`,
41
+ {
42
+ [`h-form-table-${topStyle}`]: ['top-hidden'].includes(topStyle),
43
+ [`h-form-table-${paginationStyle}`]: ['pagination-center','custom-pagination'].includes(paginationStyle)
44
+ }
45
+ ]"
46
+ >
47
+ <x-form-table
48
+ ref="xFormTableRef"
49
+ v-bind="$attrs"
50
+ :customPagination="isCustomPagination"
51
+ v-on="$listeners"
52
+ >
53
+ <template v-for="(_, name) in $slots" #[name]="slotData">
54
+ <slot :name="name" v-bind="slotData" />
55
+ </template>
56
+ </x-form-table>
57
+ </div>
58
+ </template>
59
+
60
+ <style scoped lang="less">
61
+ .h-form-table-wrapper {
62
+ // 基础样式
63
+ :deep(.table-wrapper) {
64
+ .ant-table {
65
+ .ant-table-row {
66
+ margin: 0px;
67
+
68
+ .ant-form-item {
69
+ margin: 0px;
70
+
71
+ .ant-form-item-control-wrapper {
72
+ .ant-form-item-control {
73
+ line-height: 0px;
74
+
75
+ .ant-select-selection--multiple {
76
+ padding-bottom: 2px;
77
+ }
78
+ }
79
+ width: 100%;
80
+ }
81
+ }
82
+ }
83
+ font-size: 16px;
84
+ }
85
+
86
+ .ant-alert-info {
87
+ display: none;
88
+ }
89
+ }
90
+
91
+ :deep(.ant-card) {
92
+ margin: -10px 0px 29px 0px;
93
+ }
94
+
95
+ :deep(.ant-btn) {
96
+ border: 0px;
97
+ box-shadow: none;
98
+ padding: 0px;
99
+ color: #5D5C5C;
100
+ font-weight: bold;
101
+ letter-spacing: 0em;
102
+ font-size: 18px;
103
+ line-height: normal;
104
+ font-family: "Source Han Sans";
105
+ }
106
+
107
+ :deep(.ant-card-body) {
108
+ padding: 0 6px;
109
+ }
110
+
111
+ :deep(.ant-table-small) {
112
+ border-width: 0;
113
+
114
+ .ant-table-fixed {
115
+ border-radius: 0;
116
+ border-bottom: 1px solid #f0f0f0;
117
+ }
118
+ }
119
+
120
+ // 表格高度样式
121
+ &.h-form-table-height {
122
+ :deep(.table-wrapper) {
123
+ .ant-select-open ~ .ant-table-content {
124
+ height: 500px !important;
125
+ }
126
+ }
127
+ }
128
+
129
+ // 表格样式
130
+ &.h-form-table-table {
131
+ :deep(.ant-table-small .ant-table-fixed-header) {
132
+ .ant-table-content {
133
+ .ant-table-content {
134
+ .ant-table-body {
135
+ border-radius: 0 0 4px 4px;
136
+ overflow: visible !important;
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ // 隐藏按钮区域
144
+ &.h-form-table-button-area-hide {
145
+ :deep(.ant-btn) {
146
+ display: none;
147
+ }
148
+
149
+ :deep(.table-wrapper) {
150
+ margin-top: -39px;
151
+ }
152
+ }
153
+
154
+ // 顶部区域隐藏(与按钮隐藏一致的视觉需求)
155
+ &.h-form-table-top-hidden {
156
+ :deep(.ant-btn) {
157
+ display: none;
158
+ }
159
+
160
+ :deep(.table-wrapper) {
161
+ margin-top: -39px;
162
+ }
163
+ }
164
+
165
+ // 列样式1
166
+ &.h-form-table-formtable-col1 {
167
+ :deep(.table-wrapper) {
168
+ .ant-row {
169
+ .ant-col span {
170
+ border: none;
171
+ width: auto;
172
+ margin-bottom: auto;
173
+ }
174
+ }
175
+
176
+ .ant-table {
177
+ .ant-table-body {
178
+ .ant-table-fixed colgroup col:nth-child(2) {
179
+ width: 50px;
180
+ min-width: 50px;
181
+ }
182
+ }
183
+
184
+ .ant-table-header {
185
+ .ant-table-fixed colgroup col:nth-child(2) {
186
+ width: 50px;
187
+ min-width: 50px;
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ // 底部分页居中 & 自定义分页样式(共用样式)
195
+ &.h-form-table-bottom-center,
196
+ &.h-form-table-custom-pagination {
197
+ :deep(.table-wrapper) {
198
+ .ant-row-flex-start {
199
+ position: relative;
200
+ display: flex;
201
+ align-items: center;
202
+ margin-top: 24px !important;
203
+
204
+ // 防止第一个子元素无限拉伸,影响分页居中
205
+ > :first-child {
206
+ flex: 0 0 auto;
207
+ }
208
+
209
+ // 将第二个子元素(分页)绝对居中
210
+ > :nth-child(2) {
211
+ position: absolute;
212
+ left: 50%;
213
+ transform: translateX(-50%);
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ </style>