vue2-client 1.19.97 → 1.19.99
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/HIS/HFormTable/HFormTable.vue +316 -132
- package/src/base-client/components/common/XForm/XFormItem.vue +7 -4
- package/src/base-client/components/common/XMarkdownSectionExtractor/DemoXMarkdownSectionExtractor.vue +163 -0
- package/src/base-client/components/common/XMarkdownSectionExtractor/XMarkdownSectionExtractor.vue +124 -0
- package/src/base-client/components/common/XMarkdownSectionExtractor/bingli.md +63 -0
- package/src/base-client/components/common/XMarkdownSectionExtractor/index.js +6 -0
- package/src/base-client/components/common/XMarkdownSectionExtractor/markdownSectionExtractor.js +359 -0
- package/src/base-client/components/common/XReportGrid/XReport.vue +27 -0
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +12 -3
- package/src/base-client/components/common/XReportGrid/index.md +49 -0
package/package.json
CHANGED
|
@@ -1,199 +1,330 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
3
|
-
import { ref, computed, useAttrs, nextTick } from 'vue'
|
|
3
|
+
import { ref, computed, useAttrs, nextTick, onMounted, onBeforeUnmount } from 'vue'
|
|
4
|
+
|
|
5
|
+
// 常量配置
|
|
6
|
+
const ROW_HEIGHT_DEFAULT = '37px'
|
|
7
|
+
const BOOLEAN_STYLE_KEYS = [
|
|
8
|
+
'button-row-0margin',
|
|
9
|
+
'top-hidden',
|
|
10
|
+
'dialog-style',
|
|
11
|
+
'button-style',
|
|
12
|
+
'header-center',
|
|
13
|
+
'expanded-grid-white',
|
|
14
|
+
'report-mode',
|
|
15
|
+
'listview-hide-selected',
|
|
16
|
+
'min-height-auto'
|
|
17
|
+
]
|
|
18
|
+
const ALLOWED_PAGINATION_STYLES = ['pagination-center', 'custom-pagination']
|
|
19
|
+
const SYNC_DELAY_AFTER_PAGE = 80
|
|
20
|
+
const SYNC_DELAY_RETRY = 60
|
|
21
|
+
const SYNC_DELAY_EXPAND = 20
|
|
22
|
+
|
|
23
|
+
// 选择器常量
|
|
24
|
+
const MAIN_TABLE_SELECTORS = [
|
|
25
|
+
'.ant-table-tbody > tr.ant-table-row',
|
|
26
|
+
'.ant-table-body > table > tbody > tr.ant-table-row'
|
|
27
|
+
]
|
|
28
|
+
const FIXED_TABLE_SELECTORS = [
|
|
29
|
+
'.ant-table-fixed-right .ant-table-tbody > tr',
|
|
30
|
+
'.ant-table-fixed-right .ant-table-body-inner > table > tbody > tr',
|
|
31
|
+
'.ant-table-fixed-right .ant-table-body > table > tbody > tr'
|
|
32
|
+
]
|
|
33
|
+
const MAIN_TBODY_SELECTORS = ['.ant-table-body > table > tbody', '.ant-table-tbody']
|
|
34
|
+
const FIXED_TBODY_SELECTORS = [
|
|
35
|
+
'.ant-table-fixed-right .ant-table-body-inner > table > tbody',
|
|
36
|
+
'.ant-table-fixed-right .ant-table-body > table > tbody',
|
|
37
|
+
'.ant-table-fixed-right .ant-table-tbody'
|
|
38
|
+
]
|
|
39
|
+
const TABLE_BODY_SELECTORS = ['.ant-table-body', '.ant-table-body-inner']
|
|
40
|
+
|
|
41
|
+
// 辅助函数
|
|
42
|
+
const getRowKey = (tr) => tr?.getAttribute?.('data-row-key') || tr?.dataset?.rowKey || ''
|
|
43
|
+
|
|
44
|
+
const cleanRowStyles = (element, isCollapse = false) => {
|
|
45
|
+
if (!element) return
|
|
46
|
+
element.removeAttribute('data-synced-height')
|
|
47
|
+
if (isCollapse) {
|
|
48
|
+
element.style.setProperty('height', '0', 'important')
|
|
49
|
+
element.style.setProperty('min-height', '0', 'important')
|
|
50
|
+
element.style.setProperty('max-height', '0', 'important')
|
|
51
|
+
element.style.setProperty('line-height', '0', 'important')
|
|
52
|
+
element.style.setProperty('overflow', 'hidden', 'important')
|
|
53
|
+
} else {
|
|
54
|
+
element.style.removeProperty('height')
|
|
55
|
+
element.style.removeProperty('min-height')
|
|
56
|
+
element.style.removeProperty('max-height')
|
|
57
|
+
element.style.removeProperty('line-height')
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const cleanCellStyles = (td, isCollapse = false) => {
|
|
62
|
+
if (isCollapse) {
|
|
63
|
+
td.style.setProperty('height', '0', 'important')
|
|
64
|
+
td.style.setProperty('min-height', '0', 'important')
|
|
65
|
+
td.style.setProperty('max-height', '0', 'important')
|
|
66
|
+
td.style.setProperty('line-height', '0', 'important')
|
|
67
|
+
td.style.setProperty('padding', '0', 'important')
|
|
68
|
+
td.style.setProperty('border', 'none', 'important')
|
|
69
|
+
td.style.setProperty('overflow', 'hidden', 'important')
|
|
70
|
+
} else {
|
|
71
|
+
td.style.removeProperty('height')
|
|
72
|
+
td.style.removeProperty('min-height')
|
|
73
|
+
td.style.removeProperty('max-height')
|
|
74
|
+
td.style.removeProperty('line-height')
|
|
75
|
+
td.style.removeProperty('vertical-align')
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const queryFirst = (container, selectors) => {
|
|
80
|
+
for (const sel of selectors) {
|
|
81
|
+
const el = container.querySelector(sel)
|
|
82
|
+
if (el) return el
|
|
83
|
+
}
|
|
84
|
+
return null
|
|
85
|
+
}
|
|
4
86
|
|
|
5
87
|
const props = defineProps({
|
|
6
|
-
// HFormTable特有的属性
|
|
7
88
|
tableStyle: {
|
|
8
89
|
type: String,
|
|
9
90
|
default: 'formtable-col1'
|
|
10
91
|
}
|
|
11
92
|
})
|
|
12
93
|
|
|
13
|
-
// 兼容多种样式配置
|
|
14
94
|
const attrs = useAttrs()
|
|
95
|
+
|
|
15
96
|
const wrapperClassObject = computed(() => {
|
|
16
|
-
const a = attrs
|
|
17
97
|
const classes = {}
|
|
18
98
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'button-row-0margin',
|
|
22
|
-
'top-hidden',
|
|
23
|
-
'dialog-style',
|
|
24
|
-
'button-style',
|
|
25
|
-
'header-center',
|
|
26
|
-
'expanded-grid-white',
|
|
27
|
-
'report-mode',
|
|
28
|
-
// listView模式下隐藏“已选择”按钮
|
|
29
|
-
'listview-hide-selected',
|
|
30
|
-
'min-height-auto'
|
|
31
|
-
]
|
|
32
|
-
for (const key of booleanStyleKeys) {
|
|
33
|
-
const val = a[key]
|
|
99
|
+
for (const key of BOOLEAN_STYLE_KEYS) {
|
|
100
|
+
const val = attrs[key]
|
|
34
101
|
const truthy = val === true || val === '' || val === 'true'
|
|
35
102
|
if (truthy) classes[`h-form-table-${key}`] = true
|
|
36
103
|
}
|
|
37
104
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (paginationAttr && ['pagination-center', 'custom-pagination'].includes(paginationAttr)) {
|
|
105
|
+
const paginationAttr = attrs?.paginationStyle
|
|
106
|
+
if (paginationAttr && ALLOWED_PAGINATION_STYLES.includes(paginationAttr)) {
|
|
41
107
|
classes[`h-form-table-${paginationAttr}`] = true
|
|
42
108
|
}
|
|
43
109
|
return classes
|
|
44
110
|
})
|
|
45
111
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
112
|
+
const wrapperStyleObject = computed(() => {
|
|
113
|
+
const rowHeight = attrs['row-height'] || attrs.rowHeight || ROW_HEIGHT_DEFAULT
|
|
114
|
+
return { '--row-height': rowHeight }
|
|
115
|
+
})
|
|
116
|
+
|
|
49
117
|
const xFormTableRef = ref()
|
|
118
|
+
const wrapperRef = ref()
|
|
50
119
|
|
|
51
|
-
//
|
|
120
|
+
// 状态变量
|
|
52
121
|
let observer = null
|
|
122
|
+
let resizeObserver = null
|
|
123
|
+
let isSyncing = false
|
|
124
|
+
let rafId = 0
|
|
125
|
+
let syncAfterPageChangeTimer = 0
|
|
126
|
+
|
|
127
|
+
const getWrapperEl = () => wrapperRef.value
|
|
128
|
+
|
|
129
|
+
const scheduleSync = () => {
|
|
130
|
+
if (isSyncing) return
|
|
131
|
+
if (rafId) cancelAnimationFrame(rafId)
|
|
132
|
+
rafId = requestAnimationFrame(() => {
|
|
133
|
+
rafId = 0
|
|
134
|
+
syncFixedExpandedHeights()
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const clearAllFixedRowHeights = () => {
|
|
139
|
+
try {
|
|
140
|
+
const wrapper = getWrapperEl()
|
|
141
|
+
if (!wrapper) return
|
|
142
|
+
const fixedRows = wrapper.querySelectorAll(FIXED_TABLE_SELECTORS.join(', '))
|
|
143
|
+
fixedRows.forEach(f => {
|
|
144
|
+
if (!f) return
|
|
145
|
+
cleanRowStyles(f, true)
|
|
146
|
+
f.querySelectorAll('td').forEach(td => cleanCellStyles(td, true))
|
|
147
|
+
})
|
|
148
|
+
} catch (e) {
|
|
149
|
+
console.warn('[HFormTable] clearAllFixedRowHeights error:', e)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const scheduleSyncAfterPageChange = () => {
|
|
154
|
+
clearAllFixedRowHeights()
|
|
155
|
+
if (syncAfterPageChangeTimer) clearTimeout(syncAfterPageChangeTimer)
|
|
156
|
+
syncAfterPageChangeTimer = setTimeout(() => {
|
|
157
|
+
syncAfterPageChangeTimer = 0
|
|
158
|
+
scheduleSync()
|
|
159
|
+
setTimeout(scheduleSync, SYNC_DELAY_RETRY)
|
|
160
|
+
}, SYNC_DELAY_AFTER_PAGE)
|
|
161
|
+
}
|
|
162
|
+
|
|
53
163
|
const setupHeightSync = () => {
|
|
54
164
|
try {
|
|
55
|
-
const wrapper =
|
|
165
|
+
const wrapper = getWrapperEl()
|
|
56
166
|
if (!wrapper || observer) return
|
|
57
167
|
|
|
168
|
+
const mainTable = queryFirst(wrapper, MAIN_TBODY_SELECTORS)
|
|
169
|
+
const fixedTbody = queryFirst(wrapper, FIXED_TBODY_SELECTORS)
|
|
170
|
+
const tableBody = queryFirst(wrapper, TABLE_BODY_SELECTORS)
|
|
171
|
+
|
|
172
|
+
const observerOptions = {
|
|
173
|
+
childList: true,
|
|
174
|
+
subtree: true,
|
|
175
|
+
attributes: true,
|
|
176
|
+
attributeFilter: ['style', 'class']
|
|
177
|
+
}
|
|
178
|
+
|
|
58
179
|
observer = new MutationObserver((mutations) => {
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
180
|
+
if (isSyncing) return
|
|
181
|
+
const hasChildList = mutations.some(m => m.type === 'childList')
|
|
182
|
+
const hasAttr = mutations.some(m =>
|
|
183
|
+
m.type === 'attributes' &&
|
|
184
|
+
(m.attributeName === 'style' || m.attributeName === 'class')
|
|
64
185
|
)
|
|
65
|
-
if (
|
|
66
|
-
|
|
186
|
+
if (hasChildList) {
|
|
187
|
+
scheduleSyncAfterPageChange()
|
|
188
|
+
} else if (hasAttr) {
|
|
189
|
+
scheduleSync()
|
|
67
190
|
}
|
|
68
191
|
})
|
|
69
192
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
attributes: true,
|
|
77
|
-
attributeFilter: ['style', 'class']
|
|
78
|
-
})
|
|
193
|
+
if (mainTable) observer.observe(mainTable, observerOptions)
|
|
194
|
+
if (fixedTbody) observer.observe(fixedTbody, observerOptions)
|
|
195
|
+
|
|
196
|
+
if (!resizeObserver && tableBody && typeof ResizeObserver !== 'undefined') {
|
|
197
|
+
resizeObserver = new ResizeObserver(() => scheduleSync())
|
|
198
|
+
resizeObserver.observe(tableBody)
|
|
79
199
|
}
|
|
80
200
|
} catch (e) {
|
|
81
201
|
console.warn('[HFormTable] setupHeightSync error:', e)
|
|
82
202
|
}
|
|
83
203
|
}
|
|
84
204
|
|
|
85
|
-
// 同步固定列中的"展开行"高度到主表展开行高度,避免错位
|
|
86
205
|
const syncFixedExpandedHeights = () => {
|
|
87
206
|
try {
|
|
88
|
-
const wrapper =
|
|
207
|
+
const wrapper = getWrapperEl()
|
|
89
208
|
if (!wrapper) return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
td.style.removeProperty('height')
|
|
129
|
-
td.style.removeProperty('min-height')
|
|
130
|
-
td.style.removeProperty('max-height')
|
|
131
|
-
td.style.removeProperty('padding')
|
|
132
|
-
td.style.removeProperty('border')
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
}
|
|
209
|
+
if (isSyncing) return
|
|
210
|
+
isSyncing = true
|
|
211
|
+
|
|
212
|
+
const mainRows = Array.from(wrapper.querySelectorAll(MAIN_TABLE_SELECTORS.join(', ')))
|
|
213
|
+
const fixedRows = Array.from(wrapper.querySelectorAll(FIXED_TABLE_SELECTORS.join(', ')))
|
|
214
|
+
|
|
215
|
+
// 只取有 key 的行进行顺序匹配
|
|
216
|
+
const mainRowsList = mainRows.filter(m => getRowKey(m))
|
|
217
|
+
const fixedRowsList = fixedRows.filter(f => getRowKey(f))
|
|
218
|
+
const count = Math.min(mainRowsList.length, fixedRowsList.length)
|
|
219
|
+
|
|
220
|
+
for (let i = 0; i < count; i++) {
|
|
221
|
+
const m = mainRowsList[i]
|
|
222
|
+
const f = fixedRowsList[i]
|
|
223
|
+
const key = getRowKey(m)
|
|
224
|
+
if (!key) continue
|
|
225
|
+
|
|
226
|
+
const h = Math.round(m.getBoundingClientRect().height)
|
|
227
|
+
if (!h) continue
|
|
228
|
+
|
|
229
|
+
const hs = String(h)
|
|
230
|
+
if (f.dataset.syncedHeight === hs) continue
|
|
231
|
+
f.dataset.syncedHeight = hs
|
|
232
|
+
|
|
233
|
+
f.style.cssText = ''
|
|
234
|
+
f.style.setProperty('height', h + 'px', 'important')
|
|
235
|
+
f.style.setProperty('min-height', h + 'px', 'important')
|
|
236
|
+
f.style.setProperty('max-height', h + 'px', 'important')
|
|
237
|
+
f.style.setProperty('line-height', 'normal', 'important')
|
|
238
|
+
|
|
239
|
+
f.querySelectorAll('td').forEach(td => {
|
|
240
|
+
td.style.cssText = ''
|
|
241
|
+
td.style.setProperty('height', h + 'px', 'important')
|
|
242
|
+
td.style.setProperty('min-height', h + 'px', 'important')
|
|
243
|
+
td.style.setProperty('max-height', h + 'px', 'important')
|
|
244
|
+
td.style.setProperty('line-height', 'normal', 'important')
|
|
245
|
+
td.style.setProperty('vertical-align', 'middle', 'important')
|
|
246
|
+
})
|
|
136
247
|
}
|
|
248
|
+
|
|
249
|
+
// 清理无对应主表 key 的固定列行
|
|
250
|
+
const mainKeys = new Set(mainRowsList.map(m => getRowKey(m)))
|
|
251
|
+
fixedRows.forEach(f => {
|
|
252
|
+
const key = getRowKey(f)
|
|
253
|
+
if (!mainKeys.has(key) && f.dataset.syncedHeight) {
|
|
254
|
+
cleanRowStyles(f, true)
|
|
255
|
+
f.querySelectorAll('td').forEach(td => cleanCellStyles(td, true))
|
|
256
|
+
}
|
|
257
|
+
})
|
|
137
258
|
} catch (e) {
|
|
138
259
|
console.warn('[HFormTable] syncFixedExpandedHeights error:', e)
|
|
260
|
+
} finally {
|
|
261
|
+
isSyncing = false
|
|
139
262
|
}
|
|
140
263
|
}
|
|
141
264
|
|
|
142
|
-
const onExpandLog = (
|
|
143
|
-
// 等DOM完成再测量
|
|
265
|
+
const onExpandLog = () => {
|
|
144
266
|
nextTick(() => {
|
|
145
|
-
// 设置实时监听(如果还没设置)
|
|
146
267
|
if (!observer) {
|
|
147
268
|
setupHeightSync()
|
|
148
269
|
}
|
|
149
|
-
|
|
150
|
-
// 立即同步一次(避免第一次展开时错位)
|
|
151
270
|
syncFixedExpandedHeights()
|
|
152
|
-
|
|
153
|
-
// 短延迟再同步一次(应对异步渲染)
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
syncFixedExpandedHeights()
|
|
156
|
-
}, 20)
|
|
271
|
+
setTimeout(() => syncFixedExpandedHeights(), SYNC_DELAY_EXPAND)
|
|
157
272
|
})
|
|
158
273
|
}
|
|
159
274
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
275
|
+
onMounted(() => {
|
|
276
|
+
nextTick(() => {
|
|
277
|
+
setupHeightSync()
|
|
278
|
+
syncFixedExpandedHeights()
|
|
279
|
+
})
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
onBeforeUnmount(() => {
|
|
283
|
+
try {
|
|
284
|
+
observer?.disconnect?.()
|
|
285
|
+
resizeObserver?.disconnect?.()
|
|
286
|
+
if (rafId) cancelAnimationFrame(rafId)
|
|
287
|
+
if (syncAfterPageChangeTimer) clearTimeout(syncAfterPageChangeTimer)
|
|
288
|
+
} finally {
|
|
289
|
+
observer = null
|
|
290
|
+
resizeObserver = null
|
|
291
|
+
rafId = 0
|
|
292
|
+
syncAfterPageChangeTimer = 0
|
|
293
|
+
isSyncing = false
|
|
294
|
+
}
|
|
166
295
|
})
|
|
167
296
|
|
|
168
|
-
//
|
|
297
|
+
// 计算属性
|
|
169
298
|
const isCustomPagination = computed(() => {
|
|
170
|
-
const
|
|
171
|
-
const paginationAttr = (a && a.paginationStyle) || ''
|
|
299
|
+
const paginationAttr = attrs?.paginationStyle || ''
|
|
172
300
|
return props.tableStyle === 'custom-pagination' || paginationAttr === 'custom-pagination'
|
|
173
301
|
})
|
|
174
|
-
|
|
302
|
+
|
|
175
303
|
const isHiddenFunctionalArea = computed(() => {
|
|
176
|
-
return attrs
|
|
304
|
+
return attrs?.hiddenFunctionalArea === 'true' || attrs?.hiddenFunctionalArea === true
|
|
177
305
|
})
|
|
178
306
|
|
|
179
|
-
// 从 attrs 中获取 pageMaxSize,如果存在则作为 defaultPageSize
|
|
180
307
|
const computedDefaultPageSize = computed(() => {
|
|
181
|
-
const pageMaxSize = attrs
|
|
182
|
-
// 将字符串转换为数字,如果无效则使用默认值
|
|
308
|
+
const pageMaxSize = attrs?.pageMaxSize
|
|
183
309
|
const numericPageSize = pageMaxSize ? Number(pageMaxSize) : null
|
|
184
|
-
|
|
310
|
+
return (numericPageSize && numericPageSize > 0) ? numericPageSize : 10
|
|
311
|
+
})
|
|
185
312
|
|
|
186
|
-
|
|
313
|
+
defineExpose({
|
|
314
|
+
getXFormTableInstance: () => xFormTableRef.value,
|
|
315
|
+
waitConfigEnd: () => xFormTableRef.value?.waitConfigEnd?.() ?? Promise.resolve()
|
|
187
316
|
})
|
|
188
317
|
</script>
|
|
189
318
|
|
|
190
319
|
<template>
|
|
191
320
|
<div
|
|
321
|
+
ref="wrapperRef"
|
|
192
322
|
class="h-form-table-wrapper"
|
|
193
323
|
:class="[
|
|
194
324
|
`h-form-table-${tableStyle}`,
|
|
195
325
|
wrapperClassObject
|
|
196
326
|
]"
|
|
327
|
+
:style="wrapperStyleObject"
|
|
197
328
|
>
|
|
198
329
|
<x-form-table
|
|
199
330
|
ref="xFormTableRef"
|
|
@@ -213,25 +344,48 @@ const computedDefaultPageSize = computed(() => {
|
|
|
213
344
|
</template>
|
|
214
345
|
|
|
215
346
|
<style scoped lang="less">
|
|
347
|
+
// 表格行高度变量,默认37px
|
|
348
|
+
@row-height: var(--row-height, 37px);
|
|
349
|
+
|
|
216
350
|
.h-form-table-wrapper {
|
|
217
351
|
// 基础样式
|
|
218
352
|
:deep(.table-wrapper) {
|
|
219
353
|
.ant-table {
|
|
220
354
|
.ant-table-row {
|
|
221
|
-
margin:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
355
|
+
margin: 0 !important;
|
|
356
|
+
height: @row-height !important;
|
|
357
|
+
max-height: @row-height !important;
|
|
358
|
+
line-height: @row-height !important;
|
|
359
|
+
|
|
360
|
+
> td {
|
|
361
|
+
height: @row-height !important;
|
|
362
|
+
min-height: @row-height !important;
|
|
363
|
+
max-height: @row-height !important;
|
|
364
|
+
padding: 0 8px !important;
|
|
365
|
+
box-sizing: border-box !important;
|
|
366
|
+
vertical-align: middle !important;
|
|
367
|
+
|
|
368
|
+
// 去掉内部元素的 margin,防止带下拉框的行被撑高
|
|
369
|
+
.ant-form-item,
|
|
370
|
+
.ant-form-item-control {
|
|
371
|
+
margin-bottom: 0 !important;
|
|
372
|
+
margin-top: 0 !important;
|
|
373
|
+
}
|
|
374
|
+
.ant-select,
|
|
375
|
+
.ant-input,
|
|
376
|
+
.ant-picker {
|
|
377
|
+
margin-bottom: 0 !important;
|
|
378
|
+
margin-top: 0 !important;
|
|
379
|
+
height: @row-height !important;
|
|
380
|
+
max-height: @row-height !important;
|
|
381
|
+
line-height: @row-height !important;
|
|
382
|
+
}
|
|
383
|
+
.ant-select-selection--single {
|
|
384
|
+
height: calc(@row-height - 2px) !important;
|
|
385
|
+
min-height: calc(@row-height - 2px) !important;
|
|
386
|
+
}
|
|
387
|
+
.ant-select-selection__rendered {
|
|
388
|
+
line-height: calc(@row-height - 2px) !important;
|
|
235
389
|
}
|
|
236
390
|
}
|
|
237
391
|
}
|
|
@@ -275,6 +429,36 @@ const computedDefaultPageSize = computed(() => {
|
|
|
275
429
|
}
|
|
276
430
|
}
|
|
277
431
|
|
|
432
|
+
// 操作列(固定列)高度与主体一致,行内文字垂直居中
|
|
433
|
+
:deep(.ant-table-fixed-right .ant-table-body-inner) {
|
|
434
|
+
table tbody tr.ant-table-row {
|
|
435
|
+
height: @row-height !important;
|
|
436
|
+
max-height: @row-height !important;
|
|
437
|
+
|
|
438
|
+
> td {
|
|
439
|
+
height: @row-height !important;
|
|
440
|
+
min-height: @row-height !important;
|
|
441
|
+
max-height: @row-height !important;
|
|
442
|
+
padding: 0 8px !important;
|
|
443
|
+
box-sizing: border-box !important;
|
|
444
|
+
vertical-align: middle !important;
|
|
445
|
+
line-height: @row-height !important;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
// 主表行高与固定列一致
|
|
450
|
+
:deep(.table-wrapper .ant-table-body > table > tbody > tr.ant-table-row) {
|
|
451
|
+
height: @row-height !important;
|
|
452
|
+
max-height: @row-height !important;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
:deep(.ant-table-fixed-right .ant-btn),
|
|
456
|
+
:deep(.ant-table-fixed-right a) {
|
|
457
|
+
line-height: inherit !important;
|
|
458
|
+
vertical-align: middle !important;
|
|
459
|
+
padding: 0 4px;
|
|
460
|
+
}
|
|
461
|
+
|
|
278
462
|
// 表格高度样式
|
|
279
463
|
&.h-form-table-height {
|
|
280
464
|
:deep(.table-wrapper) {
|
|
@@ -461,7 +645,7 @@ const computedDefaultPageSize = computed(() => {
|
|
|
461
645
|
background-color: white;
|
|
462
646
|
}
|
|
463
647
|
}
|
|
464
|
-
// listView
|
|
648
|
+
// listView模式下隐藏"已选择"按钮(该按钮包含 monitor 图标)
|
|
465
649
|
&.h-form-table-listview-hide-selected {
|
|
466
650
|
:deep(.ant-badge:has(.ant-btn .anticon-monitor)) {
|
|
467
651
|
display: none !important;
|
|
@@ -845,7 +845,7 @@ export default {
|
|
|
845
845
|
if (this.attr.dataChangeFunc) {
|
|
846
846
|
this.debouncedDataChangeFunc = debounce(this.dataChangeFunc, 200)
|
|
847
847
|
// 执行一次
|
|
848
|
-
this.dataChangeFunc()
|
|
848
|
+
this.dataChangeFunc(true)
|
|
849
849
|
}
|
|
850
850
|
if (this.attr.showFormItemFunc) {
|
|
851
851
|
this.debouncedShowFormItemFunc = debounce(this.showFormItemFunc, 100)
|
|
@@ -1092,7 +1092,8 @@ export default {
|
|
|
1092
1092
|
},
|
|
1093
1093
|
|
|
1094
1094
|
// Select组件change处理
|
|
1095
|
-
handleSelectChange() {
|
|
1095
|
+
handleSelectChange(a,b,c) {
|
|
1096
|
+
console.warn(a,b,c)
|
|
1096
1097
|
this.handleFormItemChange()
|
|
1097
1098
|
},
|
|
1098
1099
|
|
|
@@ -1246,7 +1247,8 @@ export default {
|
|
|
1246
1247
|
this.getDataCallback(option)
|
|
1247
1248
|
}
|
|
1248
1249
|
},
|
|
1249
|
-
|
|
1250
|
+
// f 是否是初始化执行的
|
|
1251
|
+
async dataChangeFunc(f = false) {
|
|
1250
1252
|
if (this.attr.dataChangeFunc) {
|
|
1251
1253
|
await executeStrFunctionByContext(this, this.attr.dataChangeFunc, [
|
|
1252
1254
|
this.form,
|
|
@@ -1255,7 +1257,8 @@ export default {
|
|
|
1255
1257
|
util,
|
|
1256
1258
|
this.mode,
|
|
1257
1259
|
runLogic,
|
|
1258
|
-
getConfigByNameAsync
|
|
1260
|
+
getConfigByNameAsync,
|
|
1261
|
+
f
|
|
1259
1262
|
])
|
|
1260
1263
|
}
|
|
1261
1264
|
},
|