vxe-table 4.7.47 → 4.7.49
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/es/components.js +7 -3
- package/es/grid/src/grid.js +3 -3
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/zh-CN.js +9 -3
- package/es/locale/lang/zh-TC.js +9 -3
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/render/index.js +40 -2
- package/es/table/src/cell.js +12 -7
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/table.js +63 -13
- package/es/table/style.css +10 -7
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +10 -7
- package/es/vxe-table/style.min.css +1 -1
- package/lib/components.js +7 -3
- package/lib/components.min.js +1 -1
- package/lib/grid/src/grid.js +3 -3
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +168 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +9 -3
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +9 -3
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +9 -3
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +9 -3
- package/lib/locale/lang/zh-TC.js +9 -3
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +9 -3
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +9 -3
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/render/index.js +58 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/cell.js +15 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +69 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +10 -7
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +10 -7
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/components.ts +7 -3
- package/packages/grid/src/grid.ts +3 -3
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +9 -3
- package/packages/locale/lang/zh-TC.ts +9 -3
- package/packages/table/render/index.ts +47 -2
- package/packages/table/src/cell.ts +12 -7
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/table.ts +72 -19
- package/styles/components/table-module/export.scss +1 -1
- package/styles/components/table.scss +15 -6
- /package/es/{iconfont.1720578571395.ttf → iconfont.1720780228287.ttf} +0 -0
- /package/es/{iconfont.1720578571395.woff → iconfont.1720780228287.woff} +0 -0
- /package/es/{iconfont.1720578571395.woff2 → iconfont.1720780228287.woff2} +0 -0
- /package/lib/{iconfont.1720578571395.ttf → iconfont.1720780228287.ttf} +0 -0
- /package/lib/{iconfont.1720578571395.woff → iconfont.1720780228287.woff} +0 -0
- /package/lib/{iconfont.1720578571395.woff2 → iconfont.1720780228287.woff2} +0 -0
|
@@ -464,6 +464,18 @@ function defaultSelectEditRender (renderOpts: any, params: any) {
|
|
|
464
464
|
]
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
+
function defaultTreeSelectEditRender (renderOpts: any, params: any) {
|
|
468
|
+
const { row, column } = params
|
|
469
|
+
const { options, optionProps } = renderOpts
|
|
470
|
+
const cellValue = getCellValue(row, column)
|
|
471
|
+
return [
|
|
472
|
+
h(getDefaultComponent(renderOpts), {
|
|
473
|
+
...getCellEditProps(renderOpts, params, cellValue, { options, optionProps }),
|
|
474
|
+
...getEditOns(renderOpts, params)
|
|
475
|
+
})
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
|
|
467
479
|
/**
|
|
468
480
|
* 已废弃
|
|
469
481
|
* @deprecated
|
|
@@ -481,13 +493,13 @@ function oldSelectEditRender (renderOpts: any, params: any) {
|
|
|
481
493
|
}
|
|
482
494
|
|
|
483
495
|
function getSelectCellValue (renderOpts: any, { row, column }: any) {
|
|
484
|
-
const {
|
|
496
|
+
const { options, optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
|
|
485
497
|
const cellValue = XEUtils.get(row, column.property)
|
|
486
498
|
let selectItem: any
|
|
487
499
|
const labelProp = optionProps.label || 'label'
|
|
488
500
|
const valueProp = optionProps.value || 'value'
|
|
489
501
|
if (!isEmptyValue(cellValue)) {
|
|
490
|
-
return XEUtils.map(
|
|
502
|
+
return XEUtils.map(XEUtils.isArray(cellValue) ? cellValue : [cellValue],
|
|
491
503
|
optionGroups
|
|
492
504
|
? (value) => {
|
|
493
505
|
const groupOptions = optionGroupProps.options || 'options'
|
|
@@ -515,6 +527,31 @@ function handleExportSelectMethod (params: any) {
|
|
|
515
527
|
return options.original ? getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params)
|
|
516
528
|
}
|
|
517
529
|
|
|
530
|
+
function getTreeSelectCellValue (renderOpts: any, { row, column }: any) {
|
|
531
|
+
const { options, optionProps = {} } = renderOpts
|
|
532
|
+
const cellValue = XEUtils.get(row, column.property)
|
|
533
|
+
const labelProp = optionProps.label || 'label'
|
|
534
|
+
const valueProp = optionProps.value || 'value'
|
|
535
|
+
const childrenProp = optionProps.children || 'children'
|
|
536
|
+
if (!isEmptyValue(cellValue)) {
|
|
537
|
+
const keyMaps: Record<string, any> = {}
|
|
538
|
+
XEUtils.eachTree(options, item => {
|
|
539
|
+
keyMaps[XEUtils.get(item, valueProp)] = item
|
|
540
|
+
}, { children: childrenProp })
|
|
541
|
+
return XEUtils.map(XEUtils.isArray(cellValue) ? cellValue : [cellValue], (value) => {
|
|
542
|
+
const item = keyMaps[value]
|
|
543
|
+
return item ? XEUtils.get(item, labelProp) : item
|
|
544
|
+
}
|
|
545
|
+
).join(', ')
|
|
546
|
+
}
|
|
547
|
+
return ''
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function handleExportTreeSelectMethod (params: any) {
|
|
551
|
+
const { row, column, options } = params
|
|
552
|
+
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params)
|
|
553
|
+
}
|
|
554
|
+
|
|
518
555
|
/**
|
|
519
556
|
* 表格 - 渲染器
|
|
520
557
|
*/
|
|
@@ -664,6 +701,14 @@ renderer.mixin({
|
|
|
664
701
|
defaultFilterMethod: handleFilterMethod,
|
|
665
702
|
exportMethod: handleExportSelectMethod
|
|
666
703
|
},
|
|
704
|
+
VxeTreeSelect: {
|
|
705
|
+
autofocus: '.vxe-input--inner',
|
|
706
|
+
renderEdit: defaultTreeSelectEditRender,
|
|
707
|
+
renderCell (renderOpts, params) {
|
|
708
|
+
return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params))
|
|
709
|
+
},
|
|
710
|
+
exportMethod: handleExportTreeSelectMethod
|
|
711
|
+
},
|
|
667
712
|
VxeRadioGroup: {
|
|
668
713
|
renderDefault: radioAndCheckboxEditRender
|
|
669
714
|
},
|
|
@@ -252,9 +252,10 @@ export const Cell = {
|
|
|
252
252
|
*/
|
|
253
253
|
renderTreeIcon (params: VxeTableDefines.CellRenderBodyParams, cellVNodes: VxeComponentSlotType[]) {
|
|
254
254
|
const { $table, isHidden } = params
|
|
255
|
-
const { reactData } = $table
|
|
255
|
+
const { reactData, internalData } = $table
|
|
256
256
|
const { computeTreeOpts } = $table.getComputeMaps()
|
|
257
257
|
const { treeExpandedMaps, treeExpandLazyLoadedMaps } = reactData
|
|
258
|
+
const { fullAllDataRowIdData } = internalData
|
|
258
259
|
const treeOpts = computeTreeOpts.value
|
|
259
260
|
const { row, column, level } = params
|
|
260
261
|
const { slots } = column
|
|
@@ -262,9 +263,11 @@ export const Cell = {
|
|
|
262
263
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
263
264
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
264
265
|
const rowChilds = row[childrenField]
|
|
266
|
+
const hasChild = rowChilds && rowChilds.length
|
|
265
267
|
const iconSlot = slots ? slots.icon : null
|
|
266
268
|
let hasLazyChilds = false
|
|
267
269
|
let isAceived = false
|
|
270
|
+
let isLazyLoading = false
|
|
268
271
|
let isLazyLoaded = false
|
|
269
272
|
const ons: any = {}
|
|
270
273
|
if (iconSlot) {
|
|
@@ -274,8 +277,10 @@ export const Cell = {
|
|
|
274
277
|
const rowid = getRowid($table, row)
|
|
275
278
|
isAceived = !!treeExpandedMaps[rowid]
|
|
276
279
|
if (lazy) {
|
|
277
|
-
|
|
280
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
281
|
+
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid]
|
|
278
282
|
hasLazyChilds = row[hasChildField]
|
|
283
|
+
isLazyLoaded = !!rest.treeLoaded
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
286
|
if (!trigger || trigger === 'default') {
|
|
@@ -292,14 +297,14 @@ export const Cell = {
|
|
|
292
297
|
paddingLeft: `${level * indent}px`
|
|
293
298
|
}
|
|
294
299
|
}, [
|
|
295
|
-
showIcon && ((
|
|
300
|
+
showIcon && (lazy ? (isLazyLoaded ? hasChild : hasLazyChilds) : hasChild)
|
|
296
301
|
? [
|
|
297
302
|
h('div', {
|
|
298
303
|
class: 'vxe-tree--btn-wrapper',
|
|
299
304
|
...ons
|
|
300
305
|
}, [
|
|
301
306
|
h('i', {
|
|
302
|
-
class: ['vxe-tree--node-btn',
|
|
307
|
+
class: ['vxe-tree--node-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))]
|
|
303
308
|
})
|
|
304
309
|
])
|
|
305
310
|
]
|
|
@@ -622,7 +627,7 @@ export const Cell = {
|
|
|
622
627
|
const defaultSlot = slots ? slots.default : null
|
|
623
628
|
const iconSlot = slots ? slots.icon : null
|
|
624
629
|
let isAceived = false
|
|
625
|
-
let
|
|
630
|
+
let isLazyLoading = false
|
|
626
631
|
if (iconSlot) {
|
|
627
632
|
return $table.callSlot(iconSlot, params)
|
|
628
633
|
}
|
|
@@ -630,7 +635,7 @@ export const Cell = {
|
|
|
630
635
|
const rowid = getRowid($table, row)
|
|
631
636
|
isAceived = !!rowExpandedMaps[rowid]
|
|
632
637
|
if (lazy) {
|
|
633
|
-
|
|
638
|
+
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
|
|
634
639
|
}
|
|
635
640
|
}
|
|
636
641
|
return [
|
|
@@ -644,7 +649,7 @@ export const Cell = {
|
|
|
644
649
|
}
|
|
645
650
|
}, [
|
|
646
651
|
h('i', {
|
|
647
|
-
class: ['vxe-table--expand-btn',
|
|
652
|
+
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
648
653
|
})
|
|
649
654
|
])
|
|
650
655
|
: null,
|
|
@@ -43,6 +43,7 @@ export default defineComponent({
|
|
|
43
43
|
const { computeSize } = useFns.useSize(props)
|
|
44
44
|
|
|
45
45
|
const reactData = reactive<TableReactData>({
|
|
46
|
+
isCalcColumn: false,
|
|
46
47
|
// 低性能的静态列
|
|
47
48
|
staticColumns: [],
|
|
48
49
|
// 渲染的列分组
|
|
@@ -155,7 +156,8 @@ export default defineComponent({
|
|
|
155
156
|
pxMinList: [],
|
|
156
157
|
scaleList: [],
|
|
157
158
|
scaleMinList: [],
|
|
158
|
-
autoList: []
|
|
159
|
+
autoList: [],
|
|
160
|
+
remainList: []
|
|
159
161
|
},
|
|
160
162
|
// 存放快捷菜单的信息
|
|
161
163
|
ctxMenuStore: {
|
|
@@ -537,6 +539,11 @@ export default defineComponent({
|
|
|
537
539
|
return Object.assign({}, getConfig().table.customConfig, props.customConfig)
|
|
538
540
|
})
|
|
539
541
|
|
|
542
|
+
const computeAutoWidthColumnList = computed(() => {
|
|
543
|
+
const { visibleColumn } = internalData
|
|
544
|
+
return visibleColumn.filter(column => column.width === 'auto')
|
|
545
|
+
})
|
|
546
|
+
|
|
540
547
|
const computeFixedColumnSize = computed(() => {
|
|
541
548
|
const { collectColumn } = internalData
|
|
542
549
|
let fixedSize = 0
|
|
@@ -883,7 +890,7 @@ export default defineComponent({
|
|
|
883
890
|
const val = props[key]
|
|
884
891
|
let num = 0
|
|
885
892
|
if (val) {
|
|
886
|
-
if (val === 'auto') {
|
|
893
|
+
if (val === 'fill' || val === 'auto') {
|
|
887
894
|
num = parentHeight
|
|
888
895
|
} else {
|
|
889
896
|
const excludeHeight = $xeTable.getExcludeHeight()
|
|
@@ -1084,6 +1091,40 @@ export default defineComponent({
|
|
|
1084
1091
|
internalData.customMaxHeight = calcHeight('maxHeight')
|
|
1085
1092
|
}
|
|
1086
1093
|
|
|
1094
|
+
const calcCellWidth = () => {
|
|
1095
|
+
const { tableData } = reactData
|
|
1096
|
+
const autoWidthColumnList = computeAutoWidthColumnList.value
|
|
1097
|
+
if (!tableData.length || !autoWidthColumnList.length) {
|
|
1098
|
+
reactData.isCalcColumn = false
|
|
1099
|
+
return nextTick()
|
|
1100
|
+
}
|
|
1101
|
+
reactData.isCalcColumn = true
|
|
1102
|
+
return nextTick().then(() => {
|
|
1103
|
+
const el = refElem.value
|
|
1104
|
+
if (el) {
|
|
1105
|
+
autoWidthColumnList.forEach(column => {
|
|
1106
|
+
const cellElList = el.querySelectorAll(`.vxe-body--column.${column.id}>.vxe-cell`)
|
|
1107
|
+
const firstCellEl = cellElList[0]
|
|
1108
|
+
let paddingSize = 0
|
|
1109
|
+
if (firstCellEl) {
|
|
1110
|
+
const cellStyle = getComputedStyle(firstCellEl)
|
|
1111
|
+
paddingSize = Math.floor(XEUtils.toNumber(cellStyle.paddingLeft) + XEUtils.toNumber(cellStyle.paddingRight)) + 2
|
|
1112
|
+
}
|
|
1113
|
+
let colWidth = column.renderAutoWidth - paddingSize + 2
|
|
1114
|
+
XEUtils.arrayEach(cellElList, (cellEl) => {
|
|
1115
|
+
const labelEl = cellEl.firstChild as HTMLElement
|
|
1116
|
+
if (labelEl) {
|
|
1117
|
+
colWidth = Math.max(colWidth, labelEl.offsetWidth)
|
|
1118
|
+
}
|
|
1119
|
+
})
|
|
1120
|
+
column.renderAutoWidth = colWidth + paddingSize
|
|
1121
|
+
})
|
|
1122
|
+
tablePrivateMethods.analyColumnWidth()
|
|
1123
|
+
}
|
|
1124
|
+
reactData.isCalcColumn = false
|
|
1125
|
+
})
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1087
1128
|
/**
|
|
1088
1129
|
* 列宽算法
|
|
1089
1130
|
* 支持 px、%、固定 混合分配
|
|
@@ -1107,7 +1148,7 @@ export default defineComponent({
|
|
|
1107
1148
|
let meanWidth = remainWidth / 100
|
|
1108
1149
|
const { fit } = props
|
|
1109
1150
|
const { columnStore } = reactData
|
|
1110
|
-
const { resizeList, pxMinList, pxList, scaleList, scaleMinList, autoList } = columnStore
|
|
1151
|
+
const { resizeList, pxMinList, pxList, scaleList, scaleMinList, autoList, remainList } = columnStore
|
|
1111
1152
|
// 最小宽
|
|
1112
1153
|
pxMinList.forEach((column) => {
|
|
1113
1154
|
const minWidth = XEUtils.toInteger(column.minWidth)
|
|
@@ -1132,6 +1173,12 @@ export default defineComponent({
|
|
|
1132
1173
|
tableWidth += width
|
|
1133
1174
|
column.renderWidth = width
|
|
1134
1175
|
})
|
|
1176
|
+
// 自适应宽
|
|
1177
|
+
autoList.forEach((column) => {
|
|
1178
|
+
const width = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
|
|
1179
|
+
tableWidth += width
|
|
1180
|
+
column.renderWidth = width
|
|
1181
|
+
})
|
|
1135
1182
|
// 调整了列宽
|
|
1136
1183
|
resizeList.forEach((column) => {
|
|
1137
1184
|
const width = XEUtils.toInteger(column.resizeWidth)
|
|
@@ -1139,7 +1186,7 @@ export default defineComponent({
|
|
|
1139
1186
|
column.renderWidth = width
|
|
1140
1187
|
})
|
|
1141
1188
|
remainWidth -= tableWidth
|
|
1142
|
-
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length +
|
|
1189
|
+
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + remainList.length)) : 0
|
|
1143
1190
|
if (fit) {
|
|
1144
1191
|
if (remainWidth > 0) {
|
|
1145
1192
|
scaleMinList.concat(pxMinList).forEach((column) => {
|
|
@@ -1150,8 +1197,8 @@ export default defineComponent({
|
|
|
1150
1197
|
} else {
|
|
1151
1198
|
meanWidth = minCellWidth
|
|
1152
1199
|
}
|
|
1153
|
-
//
|
|
1154
|
-
|
|
1200
|
+
// 剩余均分
|
|
1201
|
+
remainList.forEach((column) => {
|
|
1155
1202
|
const width = Math.max(meanWidth, minCellWidth)
|
|
1156
1203
|
column.renderWidth = width
|
|
1157
1204
|
tableWidth += width
|
|
@@ -1161,7 +1208,7 @@ export default defineComponent({
|
|
|
1161
1208
|
* 偏移量算法
|
|
1162
1209
|
* 如果所有列足够放的情况下,从最后动态列开始分配
|
|
1163
1210
|
*/
|
|
1164
|
-
const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(
|
|
1211
|
+
const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(remainList)
|
|
1165
1212
|
let dynamicSize = dynamicList.length - 1
|
|
1166
1213
|
if (dynamicSize > 0) {
|
|
1167
1214
|
let odiffer = bodyWidth - tableWidth
|
|
@@ -2053,7 +2100,9 @@ export default defineComponent({
|
|
|
2053
2100
|
const rowid = getRowid($xeTable, row)
|
|
2054
2101
|
const rest = fullAllDataRowIdData[rowid]
|
|
2055
2102
|
treeExpandLazyLoadedMaps[rowid] = row
|
|
2056
|
-
|
|
2103
|
+
Promise.resolve(
|
|
2104
|
+
loadMethod({ $table: $xeTable, row })
|
|
2105
|
+
).then((childRecords: any) => {
|
|
2057
2106
|
rest.treeLoaded = true
|
|
2058
2107
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
2059
2108
|
delete treeExpandLazyLoadedMaps[rowid]
|
|
@@ -3486,6 +3535,7 @@ export default defineComponent({
|
|
|
3486
3535
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
3487
3536
|
*/
|
|
3488
3537
|
recalculate (refull?: boolean) {
|
|
3538
|
+
calcCellWidth()
|
|
3489
3539
|
autoCellWidth()
|
|
3490
3540
|
if (refull === true) {
|
|
3491
3541
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
@@ -5203,7 +5253,6 @@ export default defineComponent({
|
|
|
5203
5253
|
/**
|
|
5204
5254
|
* 处理显示 tooltip
|
|
5205
5255
|
* @param {Event} evnt 事件
|
|
5206
|
-
* @param {ColumnInfo} column 列配置
|
|
5207
5256
|
* @param {Row} row 行对象
|
|
5208
5257
|
*/
|
|
5209
5258
|
const handleTooltip = (evnt: MouseEvent, cell: HTMLTableCellElement, overflowElem: HTMLElement, tipElem: HTMLElement | null, params: any) => {
|
|
@@ -5271,7 +5320,7 @@ export default defineComponent({
|
|
|
5271
5320
|
const el = refElem.value
|
|
5272
5321
|
if (el) {
|
|
5273
5322
|
const parentElem = el.parentNode as HTMLElement
|
|
5274
|
-
const parentPaddingSize = height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
5323
|
+
const parentPaddingSize = height === 'fill' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
5275
5324
|
return Math.floor($xeGrid ? $xeGrid.getParentHeight() : XEUtils.toNumber(getComputedStyle(parentElem).height) - parentPaddingSize)
|
|
5276
5325
|
}
|
|
5277
5326
|
return 0
|
|
@@ -5423,12 +5472,13 @@ export default defineComponent({
|
|
|
5423
5472
|
const { tableFullColumn } = internalData
|
|
5424
5473
|
const columnOpts = computeColumnOpts.value
|
|
5425
5474
|
const { width: defaultWidth, minWidth: defaultMinWidth } = columnOpts
|
|
5426
|
-
const resizeList:
|
|
5427
|
-
const pxList:
|
|
5428
|
-
const pxMinList:
|
|
5429
|
-
const scaleList:
|
|
5430
|
-
const scaleMinList:
|
|
5431
|
-
const autoList:
|
|
5475
|
+
const resizeList: VxeTableDefines.ColumnInfo[] = []
|
|
5476
|
+
const pxList: VxeTableDefines.ColumnInfo[] = []
|
|
5477
|
+
const pxMinList: VxeTableDefines.ColumnInfo[] = []
|
|
5478
|
+
const scaleList: VxeTableDefines.ColumnInfo[] = []
|
|
5479
|
+
const scaleMinList: VxeTableDefines.ColumnInfo[] = []
|
|
5480
|
+
const autoList: VxeTableDefines.ColumnInfo[] = []
|
|
5481
|
+
const remainList: VxeTableDefines.ColumnInfo[] = []
|
|
5432
5482
|
tableFullColumn.forEach((column) => {
|
|
5433
5483
|
if (defaultWidth && !column.width) {
|
|
5434
5484
|
column.width = defaultWidth
|
|
@@ -5439,6 +5489,8 @@ export default defineComponent({
|
|
|
5439
5489
|
if (column.visible) {
|
|
5440
5490
|
if (column.resizeWidth) {
|
|
5441
5491
|
resizeList.push(column)
|
|
5492
|
+
} else if (column.width === 'auto') {
|
|
5493
|
+
autoList.push(column)
|
|
5442
5494
|
} else if (isPx(column.width)) {
|
|
5443
5495
|
pxList.push(column)
|
|
5444
5496
|
} else if (isScale(column.width)) {
|
|
@@ -5448,11 +5500,11 @@ export default defineComponent({
|
|
|
5448
5500
|
} else if (isScale(column.minWidth)) {
|
|
5449
5501
|
scaleMinList.push(column)
|
|
5450
5502
|
} else {
|
|
5451
|
-
|
|
5503
|
+
remainList.push(column)
|
|
5452
5504
|
}
|
|
5453
5505
|
}
|
|
5454
5506
|
})
|
|
5455
|
-
Object.assign(reactData.columnStore, { resizeList, pxList, pxMinList, scaleList, scaleMinList, autoList })
|
|
5507
|
+
Object.assign(reactData.columnStore, { resizeList, pxList, pxMinList, scaleList, scaleMinList, autoList, remainList })
|
|
5456
5508
|
},
|
|
5457
5509
|
saveCustomStore (type) {
|
|
5458
5510
|
const { id } = props
|
|
@@ -6853,7 +6905,7 @@ export default defineComponent({
|
|
|
6853
6905
|
|
|
6854
6906
|
const renderVN = () => {
|
|
6855
6907
|
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
|
|
6856
|
-
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData
|
|
6908
|
+
const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData
|
|
6857
6909
|
const { leftList, rightList } = columnStore
|
|
6858
6910
|
const loadingSlot = slots.loading
|
|
6859
6911
|
const tipConfig = computeTipConfig.value
|
|
@@ -6882,6 +6934,7 @@ export default defineComponent({
|
|
|
6882
6934
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
6883
6935
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
6884
6936
|
'checkbox--range': checkboxOpts.range,
|
|
6937
|
+
'column--calc': isCalcColumn,
|
|
6885
6938
|
'is--header': showHeader,
|
|
6886
6939
|
'is--footer': showFooter,
|
|
6887
6940
|
'is--group': isGroup,
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
& > .vxe-input,
|
|
93
93
|
& > .vxe-textarea,
|
|
94
94
|
& > .vxe-select,
|
|
95
|
+
& > .vxe-tree-select,
|
|
95
96
|
& > .vxe-date-picker,
|
|
96
97
|
& > .vxe-number-input {
|
|
97
98
|
width: 100%;
|
|
@@ -314,6 +315,19 @@
|
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
|
|
318
|
+
/*列宽*/
|
|
319
|
+
.vxe-table {
|
|
320
|
+
&.column--calc {
|
|
321
|
+
.vxe-header--column,
|
|
322
|
+
.vxe-body--column {
|
|
323
|
+
.vxe-cell {
|
|
324
|
+
word-break: break-all;
|
|
325
|
+
white-space: nowrap;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
317
331
|
/*header*/
|
|
318
332
|
.vxe-table {
|
|
319
333
|
.vxe-table--header-wrapper {
|
|
@@ -619,11 +633,6 @@
|
|
|
619
633
|
}
|
|
620
634
|
}
|
|
621
635
|
}
|
|
622
|
-
&.checkbox--range {
|
|
623
|
-
.vxe-body--column {
|
|
624
|
-
user-select: none;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
636
|
&.cell--area {
|
|
628
637
|
.vxe-table--body-wrapper,
|
|
629
638
|
.vxe-body--column {
|
|
@@ -631,7 +640,7 @@
|
|
|
631
640
|
}
|
|
632
641
|
}
|
|
633
642
|
&.drag--range {
|
|
634
|
-
.vxe-
|
|
643
|
+
.vxe-body--column {
|
|
635
644
|
user-select: none;
|
|
636
645
|
}
|
|
637
646
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|