vxe-table 3.20.0-beta.12 → 3.20.0-beta.13

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.
@@ -557,6 +557,7 @@ export default {
557
557
  reScrollFlag: 0,
558
558
  reLayoutFlag: 0,
559
559
  footFlag: 0,
560
+ kfFlag: 0,
560
561
  mergeFooteCellFlag: 0,
561
562
  crossTableDragRowInfo: crossTableDragRowGlobal
562
563
  }
@@ -905,7 +906,16 @@ export default {
905
906
  return this.computeEditOpts
906
907
  },
907
908
  computeEditOpts () {
908
- return Object.assign({}, getConfig().table.editConfig, this.editConfig)
909
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
910
+ const props = $xeTable
911
+
912
+ return Object.assign({}, getConfig().table.editConfig, props.editConfig)
913
+ },
914
+ computeEditDirtyOpts () {
915
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
916
+ const props = $xeTable
917
+
918
+ return Object.assign({}, getConfig().table.editDirtyConfig, props.editDirtyConfig)
909
919
  },
910
920
  sortOpts () {
911
921
  return this.computeSortOpts
@@ -1267,6 +1277,36 @@ export default {
1267
1277
  }
1268
1278
  return false
1269
1279
  },
1280
+ computeKeepFields () {
1281
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1282
+ const reactData = $xeTable as unknown as TableReactData
1283
+ const internalData = $xeTable as unknown as TableInternalData
1284
+
1285
+ const { tableFullColumn } = internalData
1286
+ const { updateColFlag } = reactData
1287
+ const editDirtyOpts = $xeTable.computeEditDirtyOpts
1288
+ const { includeFields, excludeFields } = editDirtyOpts
1289
+ const kpFields: string[] = []
1290
+ if (updateColFlag) {
1291
+ if (includeFields && includeFields.length) {
1292
+ return includeFields
1293
+ }
1294
+ const exfMaps: Record<string, number> = {}
1295
+ if (excludeFields && excludeFields.length) {
1296
+ excludeFields.forEach(field => {
1297
+ exfMaps[field] = 1
1298
+ })
1299
+ }
1300
+ for (let i = 0; i < tableFullColumn.length; i++) {
1301
+ const column = tableFullColumn[i]
1302
+ const { field, type, editRender, cellRender } = column
1303
+ if (field && !type && (editRender || cellRender) && !exfMaps[field]) {
1304
+ kpFields.push(field)
1305
+ }
1306
+ }
1307
+ }
1308
+ return kpFields
1309
+ },
1270
1310
  computeTableBorder () {
1271
1311
  const $xeTable = this
1272
1312
  const props = $xeTable
@@ -1467,6 +1507,24 @@ export default {
1467
1507
  $xeTable.updateFooter()
1468
1508
  },
1469
1509
 
1510
+ updateColFlag () {
1511
+ this.kfFlag++
1512
+ },
1513
+ computeKeepFields () {
1514
+ this.kfFlag++
1515
+ },
1516
+ kfFlag () {
1517
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1518
+ const internalData = $xeTable as unknown as TableInternalData
1519
+
1520
+ const keepFields = $xeTable.computeKeepFields
1521
+ const kpfMaps: Record<string, number> = {}
1522
+ keepFields.forEach(field => {
1523
+ kpfMaps[field] = 1
1524
+ })
1525
+ internalData.keepUpdateFieldMaps = kpfMaps
1526
+ },
1527
+
1470
1528
  syncResize (value: any) {
1471
1529
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1472
1530
 
@@ -81,6 +81,8 @@ export function createInternalData (): TableInternalData {
81
81
  // 数据集(仅可视)
82
82
  visibleDataRowIdData: {},
83
83
 
84
+ keepUpdateFieldMaps: {},
85
+
84
86
  footerFullDataRowData: {},
85
87
 
86
88
  // 渲染中缓存数据
@@ -144,6 +146,7 @@ export function createInternalData (): TableInternalData {
144
146
 
145
147
  export function createReactData (): TableReactData {
146
148
  return {
149
+ updateColFlag: 0,
147
150
  // 低性能的静态列
148
151
  staticColumns: [],
149
152
  // 渲染的列分组