vue2-client 1.22.3 → 1.22.4
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/.env.his +19 -19
- package/.idea/.name +1 -0
- package/.idea/MarsCodeWorkspaceAppSettings.xml +8 -0
- package/.idea/deployment.xml +14 -0
- package/.idea/gradle.xml +7 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/libraries/contour_plot.xml +9 -0
- package/.idea/material_theme_project_new.xml +18 -0
- package/.idea/misc.xml +87 -5
- package/package.json +1 -1
- package/src/base-client/components/common/HIS/HForm/HForm.vue +1186 -1186
- package/src/base-client/components/common/XMarkdownViewer/demo.vue +102 -102
- package/src/base-client/components/his/HAi/HAi.vue +1177 -1177
- package/src/base-client/components/his/XTransfer/index.md +327 -327
- package/src/base-client/plugins/GetLoginInfoService.js +4 -4
- package/src/utils/login.js +11 -11
- package/.history/.eslintrc_20260521171150.js +0 -74
- package/.history/.eslintrc_20260521171213.js +0 -74
- package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154443.vue +0 -726
- package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154700.vue +0 -478
- package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175435.vue +0 -706
- package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175450.vue +0 -694
- package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260611152602.vue +0 -755
- package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513145941.vue +0 -524
- package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513153133.vue +0 -731
- package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513160316.vue +0 -525
- package/.history/src/base-client/components/common/HIS/HForm/HForm_20260601144150.vue +0 -1046
- package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310142713.vue +0 -512
- package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310145118.vue +0 -511
- package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260311094834.vue +0 -696
- package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260320143028.vue +0 -693
- package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue +0 -677
- package/.history/src/base-client/components/common/HIS/HTab/HTab_20260508164645.vue +0 -758
- package/.history/src/base-client/components/common/HIS/HTab/HTab_20260508164714.vue +0 -693
- package/.history/src/base-client/components/common/HIS/HTab/HTab_20260508171651.vue +0 -716
- package/.history/src/base-client/components/common/HIS/HTab/HTab_20260509133717.vue +0 -695
- package/.history/src/base-client/components/common/HIS/HTab/HTab_20260509171115.vue +0 -664
- package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140637.vue +0 -1455
- package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140935.vue +0 -1441
- package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513150818.vue +0 -1441
- package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153119.vue +0 -1442
- package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153126.vue +0 -1486
- package/.history/src/base-client/components/common/XForm/XFormItem_20260513140854.vue +0 -1607
- package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140403.vue +0 -643
- package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140829.vue +0 -628
- package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519142824.vue +0 -104
- package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519143155.vue +0 -102
- package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171231.vue +0 -1241
- package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171441.vue +0 -1223
- package/.history/src/base-client/components/his/HAi/HAi_20260612174826.vue +0 -472
- package/.history/src/base-client/components/his/HAi/HAi_20260612175839.vue +0 -538
- package/.history/src/base-client/components/his/HAi/HAi_20260615103331.vue +0 -650
- package/.history/src/base-client/components/his/XHDescriptions/XHDescriptions_20260424134504.vue +0 -1469
- package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171133.vue +0 -788
- package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171151.vue +0 -780
- package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511170841.vue +0 -585
- package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511171138.vue +0 -787
- package/.history/src/base-client/components/his/XTransfer/XTransfer_20260512141830.vue +0 -739
- package/.history/src/components/STable/index_20260409155138.js +0 -806
- package/.history/src/components/STable/index_20260409155218.js +0 -814
- package/.history/src/expression/core/Expression_20260305164427.js +0 -1371
- package/.history/src/expression/core/Expression_20260305170258.js +0 -1358
- package/.history/src/expression/core/Program_20260305111830.js +0 -944
- package/.history/src/expression/core/Program_20260305112041.js +0 -931
- package/.history/src/logic/LogicRunner_20260304154306.js +0 -170
- package/.history/src/logic/LogicRunner_20260304155553.js +0 -112
- package/.history/src/logic/LogicRunner_20260305105834.js +0 -112
- package/.history/src/logic/LogicRunner_20260305112718.js +0 -129
- package/.history/src/logic/LogicRunner_20260305182436.js +0 -133
- package/.history/src/logic/LogicRunner_20260306151301.js +0 -213
- package/.history/src/logic/LogicRunner_20260306152419.js +0 -213
- package/.history/src/logic/plugins/common/DateTools_20260305154159.js +0 -61
- package/.history/src/logic/plugins/common/DateTools_20260305154217.js +0 -44
- package/.history/src/logic/plugins/common/DateTools_20260305161014.js +0 -44
- package/.history/src/logic/plugins/common/HttpTools_20260305164352.js +0 -80
- package/.history/src/logic/plugins/common/HttpTools_20260305170258.js +0 -75
- package/.history/src/logic/plugins/common/HttpTools_20260305171634.js +0 -75
- package/.history/src/logic/plugins/common/HttpTools_20260306152419.js +0 -72
- package/.history/src/services/api/restTools_20260427142149.js +0 -245
- package/.history/src/services/api/restTools_20260427142853.js +0 -230
- package/.history/src/services/api/restTools_20260519135558.js +0 -230
- package/.history/src/services/api/restTools_20260519140825.js +0 -230
- package/.history/src/services/api/restTools_20260519151223.js +0 -230
- package/.history/src/utils/indexedDB_20260306150918.js +0 -593
- package/.history/src/utils/indexedDB_20260306151301.js +0 -586
- package/.idea/codeStyles/Project.xml +0 -62
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/preview-input-box.html +0 -180
package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue
DELETED
|
@@ -1,677 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.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
|
-
}
|
|
86
|
-
|
|
87
|
-
const props = defineProps({
|
|
88
|
-
tableStyle: {
|
|
89
|
-
type: String,
|
|
90
|
-
default: 'formtable-col1'
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
const attrs = useAttrs()
|
|
95
|
-
|
|
96
|
-
const wrapperClassObject = computed(() => {
|
|
97
|
-
const classes = {}
|
|
98
|
-
|
|
99
|
-
for (const key of BOOLEAN_STYLE_KEYS) {
|
|
100
|
-
const val = attrs[key]
|
|
101
|
-
const truthy = val === true || val === '' || val === 'true'
|
|
102
|
-
if (truthy) classes[`h-form-table-${key}`] = true
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const paginationAttr = attrs?.paginationStyle
|
|
106
|
-
if (paginationAttr && ALLOWED_PAGINATION_STYLES.includes(paginationAttr)) {
|
|
107
|
-
classes[`h-form-table-${paginationAttr}`] = true
|
|
108
|
-
}
|
|
109
|
-
return classes
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
const wrapperStyleObject = computed(() => {
|
|
113
|
-
const rowHeight = attrs['row-height'] || attrs.rowHeight || ROW_HEIGHT_DEFAULT
|
|
114
|
-
const tableMinHeight = attrs['table-min-height'] || attrs.tableMinHeight || null
|
|
115
|
-
// 表格高度偏移量(分页器+边距等固定部分),配置600显示550,偏移50
|
|
116
|
-
const tableMinHeightOffset = 50
|
|
117
|
-
return {
|
|
118
|
-
'--row-height': rowHeight,
|
|
119
|
-
'--table-min-height': tableMinHeight ? `calc(${tableMinHeight} - ${tableMinHeightOffset}px)` : undefined
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
const xFormTableRef = ref()
|
|
124
|
-
const wrapperRef = ref()
|
|
125
|
-
|
|
126
|
-
// 状态变量
|
|
127
|
-
let observer = null
|
|
128
|
-
let resizeObserver = null
|
|
129
|
-
let isSyncing = false
|
|
130
|
-
let rafId = 0
|
|
131
|
-
let syncAfterPageChangeTimer = 0
|
|
132
|
-
|
|
133
|
-
const getWrapperEl = () => wrapperRef.value
|
|
134
|
-
|
|
135
|
-
const scheduleSync = () => {
|
|
136
|
-
if (isSyncing) return
|
|
137
|
-
if (rafId) cancelAnimationFrame(rafId)
|
|
138
|
-
rafId = requestAnimationFrame(() => {
|
|
139
|
-
rafId = 0
|
|
140
|
-
syncFixedExpandedHeights()
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const clearAllFixedRowHeights = () => {
|
|
145
|
-
try {
|
|
146
|
-
const wrapper = getWrapperEl()
|
|
147
|
-
if (!wrapper) return
|
|
148
|
-
const fixedRows = wrapper.querySelectorAll(FIXED_TABLE_SELECTORS.join(', '))
|
|
149
|
-
fixedRows.forEach(f => {
|
|
150
|
-
if (!f) return
|
|
151
|
-
cleanRowStyles(f, true)
|
|
152
|
-
f.querySelectorAll('td').forEach(td => cleanCellStyles(td, true))
|
|
153
|
-
})
|
|
154
|
-
} catch (e) {
|
|
155
|
-
console.warn('[HFormTable] clearAllFixedRowHeights error:', e)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const scheduleSyncAfterPageChange = () => {
|
|
160
|
-
clearAllFixedRowHeights()
|
|
161
|
-
if (syncAfterPageChangeTimer) clearTimeout(syncAfterPageChangeTimer)
|
|
162
|
-
syncAfterPageChangeTimer = setTimeout(() => {
|
|
163
|
-
syncAfterPageChangeTimer = 0
|
|
164
|
-
scheduleSync()
|
|
165
|
-
setTimeout(scheduleSync, SYNC_DELAY_RETRY)
|
|
166
|
-
}, SYNC_DELAY_AFTER_PAGE)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const setupHeightSync = () => {
|
|
170
|
-
try {
|
|
171
|
-
const wrapper = getWrapperEl()
|
|
172
|
-
if (!wrapper || observer) return
|
|
173
|
-
|
|
174
|
-
const mainTable = queryFirst(wrapper, MAIN_TBODY_SELECTORS)
|
|
175
|
-
const fixedTbody = queryFirst(wrapper, FIXED_TBODY_SELECTORS)
|
|
176
|
-
const tableBody = queryFirst(wrapper, TABLE_BODY_SELECTORS)
|
|
177
|
-
|
|
178
|
-
const observerOptions = {
|
|
179
|
-
childList: true,
|
|
180
|
-
subtree: true,
|
|
181
|
-
attributes: true,
|
|
182
|
-
attributeFilter: ['style', 'class']
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
observer = new MutationObserver((mutations) => {
|
|
186
|
-
if (isSyncing) return
|
|
187
|
-
const hasChildList = mutations.some(m => m.type === 'childList')
|
|
188
|
-
const hasAttr = mutations.some(m =>
|
|
189
|
-
m.type === 'attributes' &&
|
|
190
|
-
(m.attributeName === 'style' || m.attributeName === 'class')
|
|
191
|
-
)
|
|
192
|
-
if (hasChildList) {
|
|
193
|
-
scheduleSyncAfterPageChange()
|
|
194
|
-
} else if (hasAttr) {
|
|
195
|
-
scheduleSync()
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
if (mainTable) observer.observe(mainTable, observerOptions)
|
|
200
|
-
if (fixedTbody) observer.observe(fixedTbody, observerOptions)
|
|
201
|
-
|
|
202
|
-
if (!resizeObserver && tableBody && typeof ResizeObserver !== 'undefined') {
|
|
203
|
-
resizeObserver = new ResizeObserver(() => scheduleSync())
|
|
204
|
-
resizeObserver.observe(tableBody)
|
|
205
|
-
}
|
|
206
|
-
} catch (e) {
|
|
207
|
-
console.warn('[HFormTable] setupHeightSync error:', e)
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const syncFixedExpandedHeights = () => {
|
|
212
|
-
try {
|
|
213
|
-
const wrapper = getWrapperEl()
|
|
214
|
-
if (!wrapper) return
|
|
215
|
-
if (isSyncing) return
|
|
216
|
-
isSyncing = true
|
|
217
|
-
|
|
218
|
-
const mainRows = Array.from(wrapper.querySelectorAll(MAIN_TABLE_SELECTORS.join(', ')))
|
|
219
|
-
const fixedRows = Array.from(wrapper.querySelectorAll(FIXED_TABLE_SELECTORS.join(', ')))
|
|
220
|
-
|
|
221
|
-
// 只取有 key 的行进行顺序匹配
|
|
222
|
-
const mainRowsList = mainRows.filter(m => getRowKey(m))
|
|
223
|
-
const fixedRowsList = fixedRows.filter(f => getRowKey(f))
|
|
224
|
-
const count = Math.min(mainRowsList.length, fixedRowsList.length)
|
|
225
|
-
|
|
226
|
-
for (let i = 0; i < count; i++) {
|
|
227
|
-
const m = mainRowsList[i]
|
|
228
|
-
const f = fixedRowsList[i]
|
|
229
|
-
const key = getRowKey(m)
|
|
230
|
-
if (!key) continue
|
|
231
|
-
|
|
232
|
-
const h = Math.round(m.getBoundingClientRect().height)
|
|
233
|
-
if (!h) continue
|
|
234
|
-
|
|
235
|
-
const hs = String(h)
|
|
236
|
-
if (f.dataset.syncedHeight === hs) continue
|
|
237
|
-
f.dataset.syncedHeight = hs
|
|
238
|
-
|
|
239
|
-
f.style.cssText = ''
|
|
240
|
-
f.style.setProperty('height', h + 'px', 'important')
|
|
241
|
-
f.style.setProperty('min-height', h + 'px', 'important')
|
|
242
|
-
f.style.setProperty('max-height', h + 'px', 'important')
|
|
243
|
-
f.style.setProperty('line-height', 'normal', 'important')
|
|
244
|
-
|
|
245
|
-
f.querySelectorAll('td').forEach(td => {
|
|
246
|
-
td.style.cssText = ''
|
|
247
|
-
td.style.setProperty('height', h + 'px', 'important')
|
|
248
|
-
td.style.setProperty('min-height', h + 'px', 'important')
|
|
249
|
-
td.style.setProperty('max-height', h + 'px', 'important')
|
|
250
|
-
td.style.setProperty('line-height', 'normal', 'important')
|
|
251
|
-
td.style.setProperty('vertical-align', 'middle', 'important')
|
|
252
|
-
})
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// 清理无对应主表 key 的固定列行
|
|
256
|
-
const mainKeys = new Set(mainRowsList.map(m => getRowKey(m)))
|
|
257
|
-
fixedRows.forEach(f => {
|
|
258
|
-
const key = getRowKey(f)
|
|
259
|
-
if (!mainKeys.has(key) && f.dataset.syncedHeight) {
|
|
260
|
-
cleanRowStyles(f, true)
|
|
261
|
-
f.querySelectorAll('td').forEach(td => cleanCellStyles(td, true))
|
|
262
|
-
}
|
|
263
|
-
})
|
|
264
|
-
} catch (e) {
|
|
265
|
-
console.warn('[HFormTable] syncFixedExpandedHeights error:', e)
|
|
266
|
-
} finally {
|
|
267
|
-
isSyncing = false
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
const onExpandLog = () => {
|
|
272
|
-
nextTick(() => {
|
|
273
|
-
if (!observer) {
|
|
274
|
-
setupHeightSync()
|
|
275
|
-
}
|
|
276
|
-
syncFixedExpandedHeights()
|
|
277
|
-
setTimeout(() => syncFixedExpandedHeights(), SYNC_DELAY_EXPAND)
|
|
278
|
-
})
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
onMounted(() => {
|
|
282
|
-
nextTick(() => {
|
|
283
|
-
setupHeightSync()
|
|
284
|
-
syncFixedExpandedHeights()
|
|
285
|
-
})
|
|
286
|
-
})
|
|
287
|
-
|
|
288
|
-
onBeforeUnmount(() => {
|
|
289
|
-
try {
|
|
290
|
-
observer?.disconnect?.()
|
|
291
|
-
resizeObserver?.disconnect?.()
|
|
292
|
-
if (rafId) cancelAnimationFrame(rafId)
|
|
293
|
-
if (syncAfterPageChangeTimer) clearTimeout(syncAfterPageChangeTimer)
|
|
294
|
-
} finally {
|
|
295
|
-
observer = null
|
|
296
|
-
resizeObserver = null
|
|
297
|
-
rafId = 0
|
|
298
|
-
syncAfterPageChangeTimer = 0
|
|
299
|
-
isSyncing = false
|
|
300
|
-
}
|
|
301
|
-
})
|
|
302
|
-
|
|
303
|
-
// 计算属性
|
|
304
|
-
const isCustomPagination = computed(() => {
|
|
305
|
-
const paginationAttr = attrs?.paginationStyle || ''
|
|
306
|
-
return props.tableStyle === 'custom-pagination' || paginationAttr === 'custom-pagination'
|
|
307
|
-
})
|
|
308
|
-
|
|
309
|
-
const isHiddenFunctionalArea = computed(() => {
|
|
310
|
-
return attrs?.hiddenFunctionalArea === 'true' || attrs?.hiddenFunctionalArea === true
|
|
311
|
-
})
|
|
312
|
-
|
|
313
|
-
const computedDefaultPageSize = computed(() => {
|
|
314
|
-
const pageMaxSize = attrs?.pageMaxSize
|
|
315
|
-
const numericPageSize = pageMaxSize ? Number(pageMaxSize) : null
|
|
316
|
-
return (numericPageSize && numericPageSize > 0) ? numericPageSize : 10
|
|
317
|
-
})
|
|
318
|
-
|
|
319
|
-
defineExpose({
|
|
320
|
-
getXFormTableInstance: () => xFormTableRef.value,
|
|
321
|
-
waitConfigEnd: () => xFormTableRef.value?.waitConfigEnd?.() ?? Promise.resolve()
|
|
322
|
-
})
|
|
323
|
-
</script>
|
|
324
|
-
|
|
325
|
-
<template>
|
|
326
|
-
<div
|
|
327
|
-
ref="wrapperRef"
|
|
328
|
-
class="h-form-table-wrapper"
|
|
329
|
-
:class="[
|
|
330
|
-
`h-form-table-${tableStyle}`,
|
|
331
|
-
wrapperClassObject
|
|
332
|
-
]"
|
|
333
|
-
:style="wrapperStyleObject"
|
|
334
|
-
>
|
|
335
|
-
<x-form-table
|
|
336
|
-
ref="xFormTableRef"
|
|
337
|
-
v-bind="$attrs"
|
|
338
|
-
:defaultPageSize="computedDefaultPageSize"
|
|
339
|
-
:customPagination="isCustomPagination"
|
|
340
|
-
:hiddenFunctionalArea="isHiddenFunctionalArea"
|
|
341
|
-
@expand="onExpandLog"
|
|
342
|
-
@configEnd="$emit('configEnd')"
|
|
343
|
-
v-on="$listeners"
|
|
344
|
-
>
|
|
345
|
-
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
346
|
-
<slot :name="name" v-bind="slotData" />
|
|
347
|
-
</template>
|
|
348
|
-
</x-form-table>
|
|
349
|
-
</div>
|
|
350
|
-
</template>
|
|
351
|
-
|
|
352
|
-
<style scoped lang="less">
|
|
353
|
-
// 表格行高度变量,默认37px
|
|
354
|
-
@row-height: var(--row-height, 37px);
|
|
355
|
-
|
|
356
|
-
.h-form-table-wrapper {
|
|
357
|
-
// 基础样式
|
|
358
|
-
:deep(.table-wrapper) {
|
|
359
|
-
.ant-table {
|
|
360
|
-
.ant-table-row {
|
|
361
|
-
margin: 0 !important;
|
|
362
|
-
height: @row-height !important;
|
|
363
|
-
max-height: @row-height !important;
|
|
364
|
-
line-height: @row-height !important;
|
|
365
|
-
|
|
366
|
-
> td {
|
|
367
|
-
height: @row-height !important;
|
|
368
|
-
min-height: @row-height !important;
|
|
369
|
-
max-height: @row-height !important;
|
|
370
|
-
padding: 0 8px !important;
|
|
371
|
-
box-sizing: border-box !important;
|
|
372
|
-
vertical-align: middle !important;
|
|
373
|
-
|
|
374
|
-
// 去掉内部元素的 margin,防止带下拉框的行被撑高
|
|
375
|
-
.ant-form-item,
|
|
376
|
-
.ant-form-item-control {
|
|
377
|
-
margin-bottom: 0 !important;
|
|
378
|
-
margin-top: 0 !important;
|
|
379
|
-
}
|
|
380
|
-
.ant-select,
|
|
381
|
-
.ant-input,
|
|
382
|
-
.ant-picker {
|
|
383
|
-
margin-bottom: 0 !important;
|
|
384
|
-
margin-top: 0 !important;
|
|
385
|
-
height: @row-height !important;
|
|
386
|
-
max-height: @row-height !important;
|
|
387
|
-
line-height: @row-height !important;
|
|
388
|
-
}
|
|
389
|
-
.ant-select-selection--single {
|
|
390
|
-
height: calc(@row-height - 2px) !important;
|
|
391
|
-
min-height: calc(@row-height - 2px) !important;
|
|
392
|
-
}
|
|
393
|
-
.ant-select-selection__rendered {
|
|
394
|
-
line-height: calc(@row-height - 2px) !important;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
font-size: 16px;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.ant-alert-info {
|
|
402
|
-
display: none;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
:deep(.ant-card) {
|
|
407
|
-
margin: -10px 0px 29px 0px;
|
|
408
|
-
}
|
|
409
|
-
:deep(.ant-space .ant-btn .anticon) {
|
|
410
|
-
display: none;
|
|
411
|
-
}
|
|
412
|
-
:deep(.ant-space .ant-btn) {
|
|
413
|
-
border: 0px;
|
|
414
|
-
box-shadow: none;
|
|
415
|
-
padding: 0px;
|
|
416
|
-
color: #5D5C5C;
|
|
417
|
-
font-weight: bold;
|
|
418
|
-
letter-spacing: 0em;
|
|
419
|
-
font-size: 18px;
|
|
420
|
-
line-height: normal;
|
|
421
|
-
background-color: transparent;
|
|
422
|
-
font-family: "Source Han Sans";
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
:deep(.ant-card-body) {
|
|
426
|
-
padding: 0 6px;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
:deep(.ant-table-small) {
|
|
430
|
-
border-width: 0;
|
|
431
|
-
|
|
432
|
-
.ant-table-fixed {
|
|
433
|
-
border-radius: 0;
|
|
434
|
-
border-bottom: 1px solid #f0f0f0;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// 操作列(固定列)高度与主体一致,行内文字垂直居中
|
|
439
|
-
:deep(.ant-table-fixed-right .ant-table-body-inner) {
|
|
440
|
-
table tbody tr.ant-table-row {
|
|
441
|
-
height: @row-height !important;
|
|
442
|
-
max-height: @row-height !important;
|
|
443
|
-
|
|
444
|
-
> td {
|
|
445
|
-
height: @row-height !important;
|
|
446
|
-
min-height: @row-height !important;
|
|
447
|
-
max-height: @row-height !important;
|
|
448
|
-
padding: 0 8px !important;
|
|
449
|
-
box-sizing: border-box !important;
|
|
450
|
-
vertical-align: middle !important;
|
|
451
|
-
line-height: @row-height !important;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
// 主表行高与固定列一致
|
|
456
|
-
:deep(.table-wrapper .ant-table-body > table > tbody > tr.ant-table-row) {
|
|
457
|
-
height: @row-height !important;
|
|
458
|
-
max-height: @row-height !important;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
:deep(.ant-table-fixed-right .ant-btn),
|
|
462
|
-
:deep(.ant-table-fixed-right a) {
|
|
463
|
-
line-height: inherit !important;
|
|
464
|
-
vertical-align: middle !important;
|
|
465
|
-
padding: 0 4px;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
// 表格高度样式
|
|
469
|
-
&.h-form-table-height {
|
|
470
|
-
:deep(.table-wrapper) {
|
|
471
|
-
.ant-select-open ~ .ant-table-content {
|
|
472
|
-
height: 500px !important;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
// 表格最小高度自动
|
|
477
|
-
&.h-form-table-min-height-auto {
|
|
478
|
-
:deep(.table-wrapper) {
|
|
479
|
-
.ant-table:not(.ant-table-empty) {
|
|
480
|
-
.ant-table-content {
|
|
481
|
-
min-height: auto !important;
|
|
482
|
-
.ant-table-body {
|
|
483
|
-
min-height: auto !important;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// 自定义表格固定高度(通过 table-min-height 属性设置)
|
|
491
|
-
// 只在表格有数据时应用
|
|
492
|
-
:deep(.table-wrapper) {
|
|
493
|
-
.ant-table:not(.ant-table-empty) {
|
|
494
|
-
.ant-table-content {
|
|
495
|
-
.ant-table-body {
|
|
496
|
-
height: calc(var(--table-min-height, 300px) - 50px);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// 表格样式
|
|
503
|
-
&.h-form-table-table {
|
|
504
|
-
:deep(.ant-table-small .ant-table-fixed-header) {
|
|
505
|
-
.ant-table-content {
|
|
506
|
-
.ant-table-content {
|
|
507
|
-
.ant-table-body {
|
|
508
|
-
border-radius: 0 0 4px 4px;
|
|
509
|
-
// 修复展开行后固定列与主体错位:保持表体滚动容器为自动滚动
|
|
510
|
-
overflow: auto !important;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
// 移除之前隐藏固定列占位行的样式,保持与主体行数一致
|
|
517
|
-
// 展开行单元格去除额外内边距,避免高度不一致
|
|
518
|
-
:deep(.ant-table-expanded-row > td) {
|
|
519
|
-
padding: 0 !important;
|
|
520
|
-
}
|
|
521
|
-
// 展开内容中的表单/控件去掉外边距,避免撑高
|
|
522
|
-
:deep(.ant-table-expanded-row .ant-form-item) {
|
|
523
|
-
margin-bottom: 0 !important;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// 移除之前的隐藏固定列样式,避免展开/合并后操作列消失
|
|
527
|
-
&.h-form-table-dialog-style {
|
|
528
|
-
/* 选择前面的兄弟元素 */
|
|
529
|
-
:global(.ant-col.ant-col-24[name="trGroup"]:has(+ .ant-card .ant-card-body .h-form-table-wrapper.h-form-table-dialog-style)) {
|
|
530
|
-
padding-top: 0px !important;
|
|
531
|
-
padding-left: 0px !important;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
:global(.ant-card-body:has(.h-form-table-wrapper.h-form-table-dialog-style)) {
|
|
535
|
-
padding-top: 0px !important;
|
|
536
|
-
padding-left: 0px !important;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
// 隐藏按钮区域
|
|
540
|
-
&.h-form-table-button-area-hide {
|
|
541
|
-
:deep(.ant-btn) {
|
|
542
|
-
display: none;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
:deep(.table-wrapper) {
|
|
546
|
-
margin-top: -39px;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// 顶部区域隐藏(与按钮隐藏一致的视觉需求)
|
|
551
|
-
&.h-form-table-top-hidden {
|
|
552
|
-
:deep(.ant-btn) {
|
|
553
|
-
display: none;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
:deep(.table-wrapper) {
|
|
557
|
-
margin-top: -39px;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// 列样式1
|
|
562
|
-
&.h-form-table-formtable-col1 {
|
|
563
|
-
:deep(.table-wrapper) {
|
|
564
|
-
.ant-row {
|
|
565
|
-
.ant-col span {
|
|
566
|
-
border: none;
|
|
567
|
-
width: auto;
|
|
568
|
-
margin-bottom: auto;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.ant-table {
|
|
573
|
-
.ant-table-body {
|
|
574
|
-
.ant-table-fixed colgroup col:nth-child(2) {
|
|
575
|
-
width: 50px;
|
|
576
|
-
min-width: 50px;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.ant-table-header {
|
|
581
|
-
.ant-table-fixed colgroup col:nth-child(2) {
|
|
582
|
-
width: 50px;
|
|
583
|
-
min-width: 50px;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// 底部分页居中 & 自定义分页样式(共用样式)
|
|
591
|
-
&.h-form-table-bottom-center,
|
|
592
|
-
&.h-form-table-custom-pagination {
|
|
593
|
-
:deep(.table-wrapper) {
|
|
594
|
-
.ant-row-flex-start {
|
|
595
|
-
position: relative;
|
|
596
|
-
display: flex;
|
|
597
|
-
align-items: center;
|
|
598
|
-
margin-top: 12px !important;
|
|
599
|
-
height: 32px;
|
|
600
|
-
|
|
601
|
-
// 防止第一个子元素无限拉伸,影响分页居中
|
|
602
|
-
> :first-child {
|
|
603
|
-
flex: 0 0 auto;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// 将第二个子元素(分页)绝对居中
|
|
607
|
-
> :nth-child(2) {
|
|
608
|
-
position: absolute;
|
|
609
|
-
left: 50%;
|
|
610
|
-
transform: translateX(-50%);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// 按钮行0margin
|
|
617
|
-
&.h-form-table-button-row-0margin {
|
|
618
|
-
:deep(.ant-row) {
|
|
619
|
-
margin: 0px;
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
// crud按钮样式
|
|
623
|
-
&.h-form-table-button-style {
|
|
624
|
-
:deep(.ant-btn){
|
|
625
|
-
border-radius: 6px;
|
|
626
|
-
background-color: #FFFFFF;
|
|
627
|
-
border: 1px solid #9499A0;
|
|
628
|
-
color: #313131;
|
|
629
|
-
font-weight: normal;
|
|
630
|
-
letter-spacing: 0em;
|
|
631
|
-
font-size: 16px;
|
|
632
|
-
font-family: "Source Han Sans";
|
|
633
|
-
line-height: normal;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
// 表格内容全部居中样式
|
|
637
|
-
&.h-form-table-header-center {
|
|
638
|
-
:deep(.ant-table-thead > tr > th),
|
|
639
|
-
:deep(.ant-table-tbody > tr > td) {
|
|
640
|
-
text-align: center !important;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
// 行展开白色背景
|
|
644
|
-
&.h-form-table-expanded-grid-white {
|
|
645
|
-
:deep(.ant-table-expanded-row){
|
|
646
|
-
background-color: white;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
// listView模式下隐藏"已选择"按钮(该按钮包含 monitor 图标)
|
|
650
|
-
&.h-form-table-listview-hide-selected {
|
|
651
|
-
:deep(.ant-badge:has(.ant-btn .anticon-monitor)) {
|
|
652
|
-
display: none !important;
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
// 报表样式
|
|
656
|
-
@skip-cells: 2;
|
|
657
|
-
&.h-form-table-report-mode {
|
|
658
|
-
--skip-cells: 4;
|
|
659
|
-
:deep(.ant-table-header){
|
|
660
|
-
padding-bottom: 0px !important;
|
|
661
|
-
}
|
|
662
|
-
:deep(.ant-table-content){
|
|
663
|
-
border: 1px solid #E5E9F0;
|
|
664
|
-
}
|
|
665
|
-
:deep(.resize-table-th){
|
|
666
|
-
background-color: white !important;
|
|
667
|
-
}
|
|
668
|
-
:deep(.ant-table-row) {
|
|
669
|
-
.ant-table-row-cell-ellipsis {
|
|
670
|
-
&:nth-child(n + @{skip-cells}) {
|
|
671
|
-
color: #3362DA !important;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
</style>
|