vxe-table 4.17.20 → 4.17.21

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.
Files changed (34) hide show
  1. package/es/grid/src/grid.js +136 -30
  2. package/es/style.css +1 -1
  3. package/es/table/render/index.js +113 -4
  4. package/es/table/src/cell.js +3 -3
  5. package/es/table/src/table.js +27 -14
  6. package/es/ui/index.js +3 -2
  7. package/es/ui/src/log.js +1 -1
  8. package/lib/grid/src/grid.js +152 -43
  9. package/lib/grid/src/grid.min.js +1 -1
  10. package/lib/index.umd.js +310 -64
  11. package/lib/index.umd.min.js +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/table/render/index.js +140 -10
  14. package/lib/table/render/index.min.js +1 -1
  15. package/lib/table/src/cell.js +6 -3
  16. package/lib/table/src/cell.min.js +1 -1
  17. package/lib/table/src/table.js +5 -4
  18. package/lib/table/src/table.min.js +1 -1
  19. package/lib/ui/index.js +3 -2
  20. package/lib/ui/index.min.js +1 -1
  21. package/lib/ui/src/log.js +1 -1
  22. package/lib/ui/src/log.min.js +1 -1
  23. package/package.json +2 -2
  24. package/packages/grid/src/grid.ts +132 -29
  25. package/packages/table/render/index.ts +115 -4
  26. package/packages/table/src/cell.ts +3 -3
  27. package/packages/table/src/table.ts +26 -12
  28. package/packages/ui/index.ts +2 -1
  29. /package/es/{iconfont.1764045862093.ttf → iconfont.1764298161293.ttf} +0 -0
  30. /package/es/{iconfont.1764045862093.woff → iconfont.1764298161293.woff} +0 -0
  31. /package/es/{iconfont.1764045862093.woff2 → iconfont.1764298161293.woff2} +0 -0
  32. /package/lib/{iconfont.1764045862093.ttf → iconfont.1764298161293.ttf} +0 -0
  33. /package/lib/{iconfont.1764045862093.woff → iconfont.1764298161293.woff} +0 -0
  34. /package/lib/{iconfont.1764045862093.woff2 → iconfont.1764298161293.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3141,7 +3141,7 @@ function eqEmptyValue(cellValue) {
3141
3141
  ;// ./packages/ui/index.ts
3142
3142
 
3143
3143
 
3144
- const version = "4.17.20";
3144
+ const version = "4.17.21";
3145
3145
  core_.VxeUI.version = version;
3146
3146
  core_.VxeUI.tableVersion = version;
3147
3147
  core_.VxeUI.setConfig({
@@ -3420,9 +3420,10 @@ core_.VxeUI.setConfig({
3420
3420
  showResponseMsg: true,
3421
3421
  showActionMsg: true,
3422
3422
  response: {
3423
- list: null,
3423
+ list: 'list',
3424
3424
  result: 'result',
3425
3425
  total: 'page.total',
3426
+ footerData: 'footerData',
3426
3427
  message: 'message'
3427
3428
  }
3428
3429
  // beforeItem: null,
@@ -3655,7 +3656,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3655
3656
  const {
3656
3657
  log: log_log
3657
3658
  } = core_.VxeUI;
3658
- const log_version = `table v${"4.17.20"}`;
3659
+ const log_version = `table v${"4.17.21"}`;
3659
3660
  const warnLog = log_log.create('warn', log_version);
3660
3661
  const errLog = log_log.create('error', log_version);
3661
3662
  ;// ./packages/table/src/columnInfo.ts
@@ -5538,7 +5539,10 @@ const Cell = {
5538
5539
  const {
5539
5540
  mode,
5540
5541
  padding,
5541
- indent
5542
+ indent,
5543
+ showIcon,
5544
+ iconOpen,
5545
+ iconClose
5542
5546
  } = aggregateOpts;
5543
5547
  const rowid = getRowid($table, row);
5544
5548
  const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
@@ -5549,13 +5553,13 @@ const Cell = {
5549
5553
  style: mode !== 'column' && padding && indent ? {
5550
5554
  paddingLeft: `${level * indent}px`
5551
5555
  } : undefined
5552
- }, [row.isAggregate ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
5556
+ }, [showIcon && row.isAggregate ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
5553
5557
  class: 'vxe-row-group--node-btn',
5554
5558
  onClick(evnt) {
5555
5559
  $table.triggerRowGroupExpandEvent(evnt, params);
5556
5560
  }
5557
5561
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
5558
- class: isExpand ? cell_getIcon().TABLE_ROW_GROUP_OPEN : cell_getIcon().TABLE_ROW_GROUP_CLOSE
5562
+ class: isExpand ? iconOpen || cell_getIcon().TABLE_ROW_GROUP_OPEN : iconClose || cell_getIcon().TABLE_ROW_GROUP_CLOSE
5559
5563
  })]) : renderEmptyElement($table), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
5560
5564
  class: 'vxe-row-group-cell'
5561
5565
  }, cellVNodes)]);
@@ -18050,10 +18054,7 @@ function oldSelectEditRender(renderOpts, params) {
18050
18054
  ...getEditOns(renderOpts, params)
18051
18055
  })];
18052
18056
  }
18053
- function getSelectCellValue(renderOpts, {
18054
- row,
18055
- column
18056
- }) {
18057
+ function handleSelectCellValue(cellValue, renderOpts) {
18057
18058
  const {
18058
18059
  options,
18059
18060
  optionGroups,
@@ -18061,7 +18062,6 @@ function getSelectCellValue(renderOpts, {
18061
18062
  optionGroupProps = {},
18062
18063
  props = {}
18063
18064
  } = renderOpts;
18064
- const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
18065
18065
  let selectItem;
18066
18066
  const labelProp = optionProps.label || 'label';
18067
18067
  const valueProp = optionProps.value || 'value';
@@ -18094,6 +18094,13 @@ function getSelectCellValue(renderOpts, {
18094
18094
  }
18095
18095
  return '';
18096
18096
  }
18097
+ function getSelectCellValue(renderOpts, {
18098
+ row,
18099
+ column
18100
+ }) {
18101
+ const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
18102
+ return handleSelectCellValue(cellValue, renderOpts);
18103
+ }
18097
18104
  function handleExportSelectMethod(params) {
18098
18105
  const {
18099
18106
  row,
@@ -18102,15 +18109,11 @@ function handleExportSelectMethod(params) {
18102
18109
  } = params;
18103
18110
  return options.original ? getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
18104
18111
  }
18105
- function getTreeSelectCellValue(renderOpts, {
18106
- row,
18107
- column
18108
- }) {
18112
+ function handleTreeSelectCellValue(cellValue, renderOpts) {
18109
18113
  const {
18110
18114
  options,
18111
18115
  optionProps = {}
18112
18116
  } = renderOpts;
18113
- const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
18114
18117
  const labelProp = optionProps.label || 'label';
18115
18118
  const valueProp = optionProps.value || 'value';
18116
18119
  const childrenProp = optionProps.children || 'children';
@@ -18128,6 +18131,13 @@ function getTreeSelectCellValue(renderOpts, {
18128
18131
  }
18129
18132
  return '';
18130
18133
  }
18134
+ function getTreeSelectCellValue(renderOpts, {
18135
+ row,
18136
+ column
18137
+ }) {
18138
+ const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
18139
+ return handleTreeSelectCellValue(cellValue, renderOpts);
18140
+ }
18131
18141
  function handleExportTreeSelectMethod(params) {
18132
18142
  const {
18133
18143
  row,
@@ -18199,6 +18209,112 @@ function handleNumberCell(renderOpts, params) {
18199
18209
  class: 'is--negative'
18200
18210
  } : {});
18201
18211
  }
18212
+ function handleFormatSelect(renderOpts, params) {
18213
+ const {
18214
+ cellValue
18215
+ } = params;
18216
+ return handleSelectCellValue(cellValue, renderOpts);
18217
+ }
18218
+ function handleSetSelectValue(renderOpts, params) {
18219
+ const {
18220
+ row,
18221
+ column,
18222
+ cellValue
18223
+ } = params;
18224
+ const {
18225
+ field
18226
+ } = column;
18227
+ if (field) {
18228
+ const {
18229
+ options,
18230
+ optionGroups,
18231
+ optionProps = {},
18232
+ optionGroupProps = {},
18233
+ props
18234
+ } = renderOpts;
18235
+ if (isEmptyValue(cellValue)) {
18236
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, props && props.multiple ? [] : null);
18237
+ return;
18238
+ }
18239
+ const isMultiVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().indexOf(`${cellValue}`, ',') > -1;
18240
+ const labelProp = optionProps.label || 'label';
18241
+ const valueProp = optionProps.value || 'value';
18242
+ const labelMpas = {};
18243
+ if (optionGroups && optionGroups.length) {
18244
+ const groupOptions = optionGroupProps.options || 'options';
18245
+ for (let i = 0; i < optionGroups.length; i++) {
18246
+ const opts = optionGroups[i][groupOptions] || {};
18247
+ for (let j = 0; j < opts.length; j++) {
18248
+ const item = opts[j];
18249
+ if (isMultiVal) {
18250
+ labelMpas[item[labelProp]] = item;
18251
+ /* eslint-disable eqeqeq */
18252
+ } else if (item[labelProp] == cellValue) {
18253
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, item[valueProp]);
18254
+ return;
18255
+ }
18256
+ }
18257
+ }
18258
+ } else {
18259
+ if (options) {
18260
+ for (let i = 0; i < options.length; i++) {
18261
+ const item = options[i];
18262
+ if (isMultiVal) {
18263
+ labelMpas[item[labelProp]] = item;
18264
+ /* eslint-disable eqeqeq */
18265
+ } else if (item[labelProp] == cellValue) {
18266
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, item[valueProp]);
18267
+ return;
18268
+ }
18269
+ }
18270
+ }
18271
+ }
18272
+ if (isMultiVal) {
18273
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, (isMultiVal ? cellValue.split(',') : [cellValue]).map(label => {
18274
+ const item = labelMpas[label];
18275
+ return item ? item[valueProp] : label;
18276
+ }));
18277
+ } else {
18278
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, cellValue);
18279
+ }
18280
+ }
18281
+ }
18282
+ function handleFormatTreeSelect(renderOpts, params) {
18283
+ const {
18284
+ cellValue
18285
+ } = params;
18286
+ return handleTreeSelectCellValue(cellValue, renderOpts);
18287
+ }
18288
+ function handleSetTreeSelectValue(renderOpts, params) {
18289
+ const {
18290
+ row,
18291
+ column,
18292
+ cellValue
18293
+ } = params;
18294
+ const {
18295
+ field
18296
+ } = column;
18297
+ if (field) {
18298
+ const {
18299
+ options,
18300
+ optionProps = {}
18301
+ } = renderOpts;
18302
+ const labelProp = optionProps.label || 'label';
18303
+ const valueProp = optionProps.value || 'value';
18304
+ const childrenProp = optionProps.children || 'children';
18305
+ const matchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(options || [], item => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, labelProp) === cellValue, {
18306
+ children: childrenProp
18307
+ });
18308
+ if (matchRest) {
18309
+ const selectItem = matchRest.item;
18310
+ if (selectItem) {
18311
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, selectItem[valueProp]);
18312
+ return;
18313
+ }
18314
+ }
18315
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, cellValue);
18316
+ }
18317
+ }
18202
18318
  /**
18203
18319
  * 表格 - 渲染器
18204
18320
  */
@@ -18233,6 +18349,9 @@ render_renderer.mixin({
18233
18349
  }, renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params));
18234
18350
  });
18235
18351
  },
18352
+ tableCellFormatter: handleFormatSelect,
18353
+ tableCellCopyMethod: handleFormatSelect,
18354
+ tableCellPasteMethod: handleSetSelectValue,
18236
18355
  tableFilterDefaultMethod: handleFilterMethod,
18237
18356
  tableExportMethod: handleExportSelectMethod
18238
18357
  },
@@ -18536,6 +18655,9 @@ render_renderer.mixin({
18536
18655
  ...getFloatingFilterOns(renderOpts, params, option)
18537
18656
  });
18538
18657
  },
18658
+ tableCellFormatter: handleFormatSelect,
18659
+ tableCellCopyMethod: handleFormatSelect,
18660
+ tableCellPasteMethod: handleSetSelectValue,
18539
18661
  tableFilterDefaultMethod: handleFilterMethod,
18540
18662
  tableExportMethod: handleExportSelectMethod
18541
18663
  },
@@ -18592,6 +18714,9 @@ render_renderer.mixin({
18592
18714
  renderTableDefault(renderOpts, params) {
18593
18715
  return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
18594
18716
  },
18717
+ tableCellFormatter: handleFormatSelect,
18718
+ tableCellCopyMethod: handleFormatSelect,
18719
+ tableCellPasteMethod: handleSetSelectValue,
18595
18720
  tableFilterDefaultMethod: handleFilterMethod,
18596
18721
  tableExportMethod: handleExportSelectMethod
18597
18722
  },
@@ -18601,6 +18726,9 @@ render_renderer.mixin({
18601
18726
  renderTableCell(renderOpts, params) {
18602
18727
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
18603
18728
  },
18729
+ tableCellFormatter: handleFormatTreeSelect,
18730
+ tableCellCopyMethod: handleFormatTreeSelect,
18731
+ tableCellPasteMethod: handleSetTreeSelectValue,
18604
18732
  tableExportMethod: handleExportTreeSelectMethod
18605
18733
  },
18606
18734
  /**
@@ -18616,6 +18744,9 @@ render_renderer.mixin({
18616
18744
  renderTableDefault(renderOpts, params) {
18617
18745
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
18618
18746
  },
18747
+ tableCellFormatter: handleFormatTreeSelect,
18748
+ tableCellCopyMethod: handleFormatTreeSelect,
18749
+ tableCellPasteMethod: handleSetTreeSelectValue,
18619
18750
  tableExportMethod: handleExportTreeSelectMethod
18620
18751
  },
18621
18752
  VxeTableSelect: {
@@ -18624,6 +18755,9 @@ render_renderer.mixin({
18624
18755
  renderTableCell(renderOpts, params) {
18625
18756
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
18626
18757
  },
18758
+ tableCellFormatter: handleFormatTreeSelect,
18759
+ tableCellCopyMethod: handleFormatTreeSelect,
18760
+ tableCellPasteMethod: handleSetTreeSelectValue,
18627
18761
  tableExportMethod: handleExportTreeSelectMethod
18628
18762
  },
18629
18763
  VxeColorPicker: {
@@ -18855,7 +18989,7 @@ render_renderer.mixin({
18855
18989
  // 以上已废弃
18856
18990
  });
18857
18991
  ;// ./packages/table/src/table.ts
18858
- const{getConfig: table_getConfig,getIcon: table_getIcon,getI18n: table_getI18n,renderer: table_renderer,formats: table_formats,createEvent,globalResize: table_globalResize,interceptor: table_interceptor,hooks: table_hooks,globalEvents: table_globalEvents,GLOBAL_EVENT_KEYS: table_GLOBAL_EVENT_KEYS,useFns,renderEmptyElement: table_renderEmptyElement}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;let crossTableDragRowObj=null;/* harmony default export */ var table = (defineVxeComponent({name:'VxeTable',props:tableProps,emits:tableEmits,setup(props,context){const{slots,emit}=context;const xID=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();const browseObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();// 使用已安装的组件,如果未安装则不渲染
18992
+ const{getConfig: table_getConfig,getIcon: table_getIcon,getI18n: table_getI18n,renderer: table_renderer,formats: table_formats,createEvent,globalResize: table_globalResize,interceptor: table_interceptor,hooks: table_hooks,globalEvents: table_globalEvents,GLOBAL_EVENT_KEYS: table_GLOBAL_EVENT_KEYS,useFns,renderEmptyElement: table_renderEmptyElement}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const table_sourceType='table';let crossTableDragRowObj=null;/* harmony default export */ var table = (defineVxeComponent({name:'VxeTable',props:tableProps,emits:tableEmits,setup(props,context){const{slots,emit}=context;const xID=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();const browseObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();// 使用已安装的组件,如果未安装则不渲染
18859
18993
  const VxeUILoadingComponent=core_.VxeUI.getComponent('VxeLoading');const VxeUITooltipComponent=core_.VxeUI.getComponent('VxeTooltip');const $xeTabs=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTabs',null);const $xeParentTable=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable',null);const $xeGrid=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid',null);const $xeGantt=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGantt',null);const $xeGGWrapper=$xeGrid||$xeGantt;const{computeSize}=useFns.useSize(props);const crossTableDragRowInfo=getCrossTableDragRowInfo();const reactData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({// 低性能的静态列
18860
18994
  staticColumns:[],// 渲染的列分组
18861
18995
  tableGroupColumn:[],// 可视区渲染的列
@@ -19221,8 +19355,9 @@ if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scroll
19221
19355
  * 如果还额外传了 field 则清空指定单元格内容
19222
19356
  * @param {Array/Row} rows 行数据
19223
19357
  * @param {String} field 字段名
19224
- */clearData(rows,field){const{tableFullData,visibleColumn}=internalData;if(!arguments.length){rows=tableFullData;}else if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}if(field){rows.forEach(row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,field,null));}else{rows.forEach(row=>{visibleColumn.forEach(column=>{if(column.field){setCellValue(row,column,null);}});});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCellElement(row,fieldOrColumn){const{elemStore}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const rowid=getRowid($xeTable,row);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);let bodyElem;if(column){if(column.fixed){if(column.fixed==='left'){if(leftScrollElem){bodyElem=leftScrollElem;}}else{if(rightScrollElem){bodyElem=rightScrollElem;}}}if(!bodyElem){bodyElem=bodyScrollElem;}if(bodyElem){return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);}}return null;},getCellLabel(row,fieldOrColumn){const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{formatter}=column;const cellValue=getCellValue(row,column);let cellLabel=cellValue;if(formatter){let formatData;const{fullAllDataRowIdData}=internalData;const rowid=getRowid($xeTable,row);const colid=column.id;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){formatData=rowRest.formatData;if(!formatData){formatData=fullAllDataRowIdData[rowid].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===cellValue){return formatData[colid].label;}}}const formatParams={cellValue,row,rowIndex:$xeTable.getRowIndex(row),column,columnIndex:$xeTable.getColumnIndex(column)};if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(formatter)){const gFormatOpts=table_formats.get(formatter);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(formatter)){const gFormatOpts=table_formats.get(formatter[0]);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams,...formatter.slice(1)):'';}else{cellLabel=formatter(formatParams);}if(formatData){formatData[colid]={value:cellValue,label:cellLabel};}}return cellLabel;},getFooterCellLabel(row,fieldOrColumn){const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{footerFormatter}=column;const _columnIndex=$xeTable.getVTColumnIndex(column);let itemValue='';// 兼容老模式
19225
- if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row)){itemValue=row[_columnIndex];}else{itemValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,column.field);}let cellLabel=itemValue;if(footerFormatter){let formatData;const{footerTableData}=reactData;const{footerFullDataRowData}=internalData;const colid=column.id;const $rowIndex=footerTableData.indexOf(row);let rowRest=null;if($rowIndex>-1){rowRest=footerFullDataRowData[$rowIndex];if(!rowRest){rowRest=footerFullDataRowData[$rowIndex]={};}formatData=rowRest.formatData;if(!formatData){formatData=footerFullDataRowData[$rowIndex].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===itemValue){return formatData[colid].label;}}}const footerFormatParams={cellValue:itemValue,itemValue,row,items:row,$rowIndex,column,_columnIndex,columnIndex:$xeTable.getColumnIndex(column)};if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(footerFormatter)){const gFormatOpts=table_formats.get(footerFormatter);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter)){const gFormatOpts=table_formats.get(footerFormatter[0]);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams,...footerFormatter.slice(1)):'';}else{cellLabel=footerFormatter(footerFormatParams);}if(formatData){formatData[colid]={value:itemValue,label:cellLabel};}}return cellLabel;},/**
19358
+ */clearData(rows,field){const{tableFullData,visibleColumn}=internalData;if(!arguments.length){rows=tableFullData;}else if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}if(field){rows.forEach(row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,field,null));}else{rows.forEach(row=>{visibleColumn.forEach(column=>{if(column.field){setCellValue(row,column,null);}});});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCellElement(row,fieldOrColumn){const{elemStore}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const rowid=getRowid($xeTable,row);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);let bodyElem;if(column){if(column.fixed){if(column.fixed==='left'){if(leftScrollElem){bodyElem=leftScrollElem;}}else{if(rightScrollElem){bodyElem=rightScrollElem;}}}if(!bodyElem){bodyElem=bodyScrollElem;}if(bodyElem){return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);}}return null;},getCellLabel(row,fieldOrColumn){const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{editConfig}=props;const{formatter,editRender,cellRender}=column;// formatter > tableCellFormatter
19359
+ const renderOpts=formatter?null:editConfig&&isEnableConf(editRender)?editRender:isEnableConf(cellRender)?cellRender:null;const compConf=renderOpts?table_renderer.get(renderOpts.name):null;const tcFormatter=compConf?compConf.tableCellFormatter:null;const cellValue=getCellValue(row,column);let cellLabel=cellValue;if(formatter||tcFormatter){let formatData;const{fullAllDataRowIdData}=internalData;const rowid=getRowid($xeTable,row);const colid=column.id;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){formatData=rowRest.formatData;if(!formatData){formatData=fullAllDataRowIdData[rowid].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===cellValue){return formatData[colid].label;}}}const formatParams={$table:$xeTable,cellValue,row,rowIndex:$xeTable.getRowIndex(row),column,columnIndex:$xeTable.getColumnIndex(column)};if(formatter){if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(formatter)){const gFormatOpts=table_formats.get(formatter);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(formatter)){const gFormatOpts=table_formats.get(formatter[0]);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams,...formatter.slice(1)):'';}else{cellLabel=`${formatter(formatParams)}`;}}else if(renderOpts&&tcFormatter){cellLabel=`${tcFormatter(renderOpts,formatParams)}`;}if(formatData){formatData[colid]={value:cellValue,label:cellLabel};}}return cellLabel;},getFooterCellLabel(row,fieldOrColumn){const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{footerFormatter}=column;const _columnIndex=$xeTable.getVTColumnIndex(column);let itemValue='';// 兼容老模式
19360
+ if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row)){itemValue=row[_columnIndex];}else{itemValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,column.field);}let cellLabel=itemValue;if(footerFormatter){let formatData;const{footerTableData}=reactData;const{footerFullDataRowData}=internalData;const colid=column.id;const $rowIndex=footerTableData.indexOf(row);let rowRest=null;if($rowIndex>-1){rowRest=footerFullDataRowData[$rowIndex];if(!rowRest){rowRest=footerFullDataRowData[$rowIndex]={};}formatData=rowRest.formatData;if(!formatData){formatData=footerFullDataRowData[$rowIndex].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===itemValue){return formatData[colid].label;}}}const footerFormatParams={$table:$xeTable,cellValue:itemValue,itemValue,row,items:row,$rowIndex,column,_columnIndex,columnIndex:$xeTable.getColumnIndex(column)};if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(footerFormatter)){const gFormatOpts=table_formats.get(footerFormatter);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter)){const gFormatOpts=table_formats.get(footerFormatter[0]);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams,...footerFormatter.slice(1)):'';}else{cellLabel=footerFormatter(footerFormatParams);}if(formatData){formatData[colid]={value:itemValue,label:cellLabel};}}return cellLabel;},/**
19226
19361
  * 检查是否为临时行数据
19227
19362
  */isInsertByRow(row){const rowid=getRowid($xeTable,row);return!!reactData.insertRowFlag&&!!internalData.insertRowMaps[rowid];},isRemoveByRow(row){const rowid=getRowid($xeTable,row);return!!reactData.removeRowFlag&&!!internalData.removeRowMaps[rowid];},/**
19228
19363
  * 删除所有新增的临时数据
@@ -19683,7 +19818,7 @@ csIndex=0;ceIndex=_newColIndex-_firstColIndex;}else if(_dragColIndex>_lastColInd
19683
19818
  const $newRowIndex=dragColRest.$index;csIndex=$newRowIndex+1;ceIndex=tableColumn.length;offsetRate=-1;}else{if(_newColIndex>_dragColIndex){// 从左往右拖拽
19684
19819
  csIndex=_dragColIndex-_firstColIndex;ceIndex=csIndex+_newColIndex-_dragColIndex;}else{// 从右往左拖拽
19685
19820
  csIndex=_newColIndex-_firstColIndex+1;ceIndex=csIndex+_dragColIndex-_newColIndex;offsetRate=-1;}}const dragRangeList=[];const dragRangeMaps={};for(let i=csIndex;i<ceIndex;i++){const column=tableColumn[i];if(!dragRangeMaps[column.id]&&!dragNewColMaps[column.id]){dragRangeMaps[column.id]=column;dragRangeList.push(column);}}external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([newColumn],column=>{if(!dragRangeMaps[column.id]){dragRangeMaps[column.id]=column;dragRangeList.push(column);}});if(dragRangeList.length){const dtTrList=el.querySelectorAll(dragRangeList.map(column=>`.vxe-table--column[colid="${column.id}"]`).join(','));moveColAnimateToLr(dtTrList,offsetRate*dragColWidth);}}const newTrList=el.querySelectorAll(dragAllTargetCols.map(column=>`.vxe-table--column[colid="${column.id}"]`).join(','));const newTdEl=newTrList[0];if(dragOffsetLeft>-1&&newTdEl){moveColAnimateToLr(newTrList,dragOffsetLeft-newTdEl.offsetLeft);}}}updateColumnOffsetLeft();loadScrollXData();$xeTable.updateCellAreas();return{status:true};});}).catch(()=>{return errRest;});}clearColDragData();clearCrossTableDragStatus();return Promise.resolve(errRest);},handleHeaderCellDragDragendEvent(evnt){const{dragCol}=reactData;const{prevDragCol,prevDragPos,prevDragToChild}=internalData;$xeTable.handleColDragSwapEvent(evnt,true,dragCol,prevDragCol,prevDragPos,prevDragToChild);},handleHeaderCellDragDragoverEvent(evnt){const{dragCol}=reactData;const columnDragOpts=computeColumnDragOpts.value;const{isToChildDrag,isPeerDrag,isCrossDrag}=columnDragOpts;if(!dragCol){evnt.preventDefault();return;}const isControlKey=hasControlKey(evnt);const thEl=evnt.currentTarget;const colid=thEl.getAttribute('colid');const column=$xeTable.getColumnById(colid);if(column){evnt.preventDefault();const{clientX}=evnt;const offsetX=clientX-thEl.getBoundingClientRect().x;const dragPos=offsetX<thEl.clientWidth/2?'left':'right';internalData.prevDragToChild=!!(isCrossDrag&&isToChildDrag&&isControlKey);internalData.prevDragCol=column;internalData.prevDragPos=dragPos;if(column.fixed||dragCol&&dragCol.id===column.id||!isCrossDrag&&(isPeerDrag?dragCol.parentId!==column.parentId:column.parentId)){showDropTip(evnt,null,thEl,false,dragPos);return;}showDropTip(evnt,null,thEl,true,dragPos);dispatchEvent('column-dragover',{oldColumn:dragCol,targetColumn:column,dragPos},evnt);// 边缘滚动
19686
- const el=refElem.value;if(!el){return;}const xHandleEl=refScrollXHandleElem.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const scrollTargetEl=xHandleEl||tableBodyElem;if(scrollTargetEl){const wrapperRect=el.getBoundingClientRect();const tableWrapperWidth=el.clientWidth;const leftContainerElem=refLeftContainer.value;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=refRightContainer.value;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const srartX=wrapperRect.x+leftContainerWidth;const endX=wrapperRect.x+tableWrapperWidth-rightContainerWidth;const distSize=28;const startDistSize=clientX-srartX;const endDistSize=endX-clientX;if(startDistSize>0&&startDistSize<=distSize){const scrollRatio=Math.floor(tableWrapperWidth/(startDistSize>distSize/2?240:120));scrollTargetEl.scrollLeft-=scrollRatio*(distSize-startDistSize);}else if(endDistSize>0&&endDistSize<=distSize){const scrollRatio=Math.floor(tableWrapperWidth/(endDistSize>distSize/2?240:120));scrollTargetEl.scrollLeft+=scrollRatio*(distSize-endDistSize);}}}},handleHeaderCellDragMousedownEvent(evnt,params){evnt.stopPropagation();const columnDragOpts=computeColumnDragOpts.value;const{trigger,dragStartMethod}=columnDragOpts;const{column}=params;const dragEl=evnt.currentTarget;const thEl=trigger==='cell'?dragEl:dragEl.parentElement?.parentElement;clearColDropOrigin();if(dragStartMethod&&!dragStartMethod(params)){thEl.draggable=false;reactData.dragRow=null;reactData.dragCol=null;clearCrossTableDragStatus();hideDropTip();return;}reactData.dragCol=column;reactData.dragRow=null;thEl.draggable=true;clearCrossTableDragStatus();updateColDropOrigin(column);updateColDropTipContent(thEl);dispatchEvent('column-dragstart',params,evnt);},handleHeaderCellDragMouseupEvent(){clearColDropOrigin();hideDropTip();clearCrossTableDragStatus();reactData.dragRow=null;reactData.dragCol=null;},handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,params){const{highlightHoverRow}=props;const{lastScrollLeft,lastScrollTop}=internalData;const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;if(!xHandleEl||!yHandleEl){return;}const rowOpts=computeRowOpts.value;const validTip=refValidTooltip.value;const tooltip=refTooltip.value;const bodyHeight=yHandleEl.clientHeight;const bodyWidth=xHandleEl.clientWidth;const scrollHeight=yHandleEl.scrollHeight;const scrollWidth=xHandleEl.scrollWidth;let isTop=false;let isBottom=false;let isLeft=false;let isRight=false;let direction='';let isTopBoundary=false;let isBottomBoundary=false;let isLeftBoundary=false;let isRightBoundary=false;if(isRollX){const xThreshold=computeScrollXThreshold.value;isLeft=scrollLeft<=0;if(!isLeft){isRight=scrollLeft+bodyWidth>=scrollWidth;}if(scrollLeft>lastScrollLeft){direction='right';if(scrollLeft+bodyWidth>=scrollWidth-xThreshold){isRightBoundary=true;}}else{direction='left';if(scrollLeft<=xThreshold){isLeftBoundary=true;}}$xeTable.checkScrolling();internalData.lastScrollLeft=scrollLeft;}if(isRollY){const yThreshold=computeScrollYThreshold.value;isTop=scrollTop<=1;if(!isTop){isBottom=scrollTop+bodyHeight>=scrollHeight-1;}if(scrollTop>lastScrollTop){direction='bottom';if(scrollTop+bodyHeight>=scrollHeight-yThreshold){isBottomBoundary=true;}}else{direction='top';if(scrollTop<=yThreshold){isTopBoundary=true;}}internalData.lastScrollTop=scrollTop;}reactData.lastScrollTime=Date.now();const evntParams={scrollTop,scrollLeft,bodyHeight,bodyWidth,scrollHeight,scrollWidth,isX:isRollX,isY:isRollY,isTop,isBottom,isLeft,isRight,direction,...params};updateRowExpandStyle();checkLastSyncScroll(isRollX,isRollY);if(isRollX){$xeTable.closeFilter();}if(rowOpts.isHover||highlightHoverRow){$xeTable.clearHoverRow();}if(validTip&&validTip.reactData.visible){validTip.close();}if(tooltip&&tooltip.reactData.visible){tooltip.close();}if(isBottomBoundary||isTopBoundary||isRightBoundary||isLeftBoundary){dispatchEvent('scroll-boundary',evntParams,evnt);}dispatchEvent('scroll',evntParams,evnt);},/**
19821
+ const el=refElem.value;if(!el){return;}const xHandleEl=refScrollXHandleElem.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const scrollTargetEl=xHandleEl||tableBodyElem;if(scrollTargetEl){const wrapperRect=el.getBoundingClientRect();const tableWrapperWidth=el.clientWidth;const leftContainerElem=refLeftContainer.value;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=refRightContainer.value;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const srartX=wrapperRect.x+leftContainerWidth;const endX=wrapperRect.x+tableWrapperWidth-rightContainerWidth;const distSize=28;const startDistSize=clientX-srartX;const endDistSize=endX-clientX;if(startDistSize>0&&startDistSize<=distSize){const scrollRatio=Math.floor(tableWrapperWidth/(startDistSize>distSize/2?240:120));scrollTargetEl.scrollLeft-=scrollRatio*(distSize-startDistSize);}else if(endDistSize>0&&endDistSize<=distSize){const scrollRatio=Math.floor(tableWrapperWidth/(endDistSize>distSize/2?240:120));scrollTargetEl.scrollLeft+=scrollRatio*(distSize-endDistSize);}}}},handleHeaderCellDragMousedownEvent(evnt,params){evnt.stopPropagation();const columnDragOpts=computeColumnDragOpts.value;const{trigger,dragStartMethod}=columnDragOpts;const{column}=params;const dragEl=evnt.currentTarget;const thEl=trigger==='cell'?dragEl:dragEl.parentElement?.parentElement;clearColDropOrigin();if(dragStartMethod&&!dragStartMethod(params)){thEl.draggable=false;reactData.dragRow=null;reactData.dragCol=null;clearCrossTableDragStatus();hideDropTip();return;}reactData.dragCol=column;reactData.dragRow=null;thEl.draggable=true;clearCrossTableDragStatus();updateColDropOrigin(column);updateColDropTipContent(thEl);dispatchEvent('column-dragstart',params,evnt);},handleHeaderCellDragMouseupEvent(){clearColDropOrigin();hideDropTip();clearCrossTableDragStatus();reactData.dragRow=null;reactData.dragCol=null;},handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,params){const{highlightHoverRow}=props;const{lastScrollLeft,lastScrollTop}=internalData;const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;if(!xHandleEl||!yHandleEl){return;}const rowOpts=computeRowOpts.value;const validTip=refValidTooltip.value;const tooltip=refTooltip.value;const bodyHeight=yHandleEl.clientHeight;const bodyWidth=xHandleEl.clientWidth;const scrollHeight=yHandleEl.scrollHeight;const scrollWidth=xHandleEl.scrollWidth;let isTop=false;let isBottom=false;let isLeft=false;let isRight=false;let direction='';let isTopBoundary=false;let isBottomBoundary=false;let isLeftBoundary=false;let isRightBoundary=false;if(isRollX){const xThreshold=computeScrollXThreshold.value;isLeft=scrollLeft<=0;if(!isLeft){isRight=scrollLeft+bodyWidth>=scrollWidth;}if(scrollLeft>lastScrollLeft){direction='right';if(scrollLeft+bodyWidth>=scrollWidth-xThreshold){isRightBoundary=true;}}else{direction='left';if(scrollLeft<=xThreshold){isLeftBoundary=true;}}$xeTable.checkScrolling();internalData.lastScrollLeft=scrollLeft;}if(isRollY){const yThreshold=computeScrollYThreshold.value;isTop=scrollTop<=1;if(!isTop){isBottom=scrollTop+bodyHeight>=scrollHeight-1;}if(scrollTop>lastScrollTop){direction='bottom';if(scrollTop+bodyHeight>=scrollHeight-yThreshold){isBottomBoundary=true;}}else{direction='top';if(scrollTop<=yThreshold){isTopBoundary=true;}}internalData.lastScrollTop=scrollTop;}reactData.lastScrollTime=Date.now();const evntParams={source:table_sourceType,scrollTop,scrollLeft,bodyHeight,bodyWidth,scrollHeight,scrollWidth,isX:isRollX,isY:isRollY,isTop,isBottom,isLeft,isRight,direction,...params};updateRowExpandStyle();checkLastSyncScroll(isRollX,isRollY);if(isRollX){$xeTable.closeFilter();}if(rowOpts.isHover||highlightHoverRow){$xeTable.clearHoverRow();}if(validTip&&validTip.reactData.visible){validTip.close();}if(tooltip&&tooltip.reactData.visible){tooltip.close();}if(isBottomBoundary||isTopBoundary||isRightBoundary||isLeftBoundary){dispatchEvent('scroll-boundary',evntParams,evnt);}dispatchEvent('scroll',evntParams,evnt);},/**
19687
19822
  * 横向 X 可视渲染事件处理
19688
19823
  */triggerScrollXEvent(){const virtualXOpts=computeVirtualXOpts.value;if(virtualXOpts.immediate){loadScrollXData();}else{lazyScrollXData();}},/**
19689
19824
  * 纵向 Y 可视渲染事件处理
@@ -20601,7 +20736,9 @@ const {
20601
20736
  const tableComponentPropKeys = Object.keys(tableProps);
20602
20737
  const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
20603
20738
  function grid_createInternalData() {
20604
- return {};
20739
+ return {
20740
+ uFoot: false
20741
+ };
20605
20742
  }
20606
20743
  /* harmony default export */ var grid = (defineVxeComponent({
20607
20744
  name: 'VxeGrid',
@@ -20628,6 +20765,7 @@ function grid_createInternalData() {
20628
20765
  filterData: [],
20629
20766
  formData: {},
20630
20767
  sortData: [],
20768
+ footerData: [],
20631
20769
  tZindex: 0,
20632
20770
  tablePage: {
20633
20771
  total: 0,
@@ -20716,12 +20854,15 @@ function grid_createInternalData() {
20716
20854
  const computeTableExtendProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
20717
20855
  const rest = {};
20718
20856
  tableComponentPropKeys.forEach(key => {
20719
- rest[key] = props[key];
20857
+ if (props[key] !== undefined) {
20858
+ rest[key] = props[key];
20859
+ }
20720
20860
  });
20721
20861
  return rest;
20722
20862
  });
20723
20863
  const computeTableProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
20724
20864
  const {
20865
+ showFooter,
20725
20866
  seqConfig,
20726
20867
  pagerConfig,
20727
20868
  editConfig,
@@ -20729,15 +20870,23 @@ function grid_createInternalData() {
20729
20870
  } = props;
20730
20871
  const {
20731
20872
  isZMax,
20732
- tablePage
20873
+ tablePage,
20874
+ footerData
20733
20875
  } = reactData;
20734
20876
  const tableExtendProps = computeTableExtendProps.value;
20735
20877
  const proxyOpts = computeProxyOpts.value;
20736
20878
  const pagerOpts = computePagerOpts.value;
20737
20879
  const isLoading = computeIsLoading.value;
20738
20880
  const tProps = Object.assign({}, tableExtendProps);
20881
+ if (showFooter && !tProps.footerData) {
20882
+ // 如果未设置自己的标位数据,则使用代理的
20883
+ tProps.footerData = footerData;
20884
+ } else if (proxyOpts.footer && footerData.length) {
20885
+ // 如果代理标为数据,且未请求到数据,则用自己的
20886
+ tProps.footerData = footerData;
20887
+ }
20739
20888
  if (isZMax) {
20740
- if (tableExtendProps.maxHeight) {
20889
+ if (tProps.maxHeight) {
20741
20890
  tProps.maxHeight = '100%';
20742
20891
  } else {
20743
20892
  tProps.height = '100%';
@@ -21035,9 +21184,12 @@ function grid_createInternalData() {
21035
21184
  reactData.filterData = params.filterList;
21036
21185
  if (proxyConfig && isEnableConf(proxyOpts)) {
21037
21186
  reactData.tablePage.currentPage = 1;
21187
+ internalData.uFoot = true;
21038
21188
  $xeGrid.commitProxy('query').then(rest => {
21039
21189
  $xeGrid.dispatchEvent('proxy-query', rest, params.$event);
21040
21190
  });
21191
+ internalData.uFoot = false;
21192
+ updateQueryFooter();
21041
21193
  }
21042
21194
  }
21043
21195
  };
@@ -21058,12 +21210,15 @@ function grid_createInternalData() {
21058
21210
  return;
21059
21211
  }
21060
21212
  if (proxyConfig && isEnableConf(proxyOpts)) {
21213
+ internalData.uFoot = true;
21061
21214
  $xeGrid.commitProxy('reload').then(rest => {
21062
21215
  $xeGrid.dispatchEvent('proxy-query', {
21063
21216
  ...rest,
21064
21217
  isReload: true
21065
21218
  }, params.$event);
21066
21219
  });
21220
+ internalData.uFoot = false;
21221
+ updateQueryFooter();
21067
21222
  }
21068
21223
  $xeGrid.dispatchEvent('form-submit', params, params.$event);
21069
21224
  };
@@ -21080,12 +21235,15 @@ function grid_createInternalData() {
21080
21235
  if ($xeTable) {
21081
21236
  $xeTable.clearScroll();
21082
21237
  }
21238
+ internalData.uFoot = true;
21083
21239
  $xeGrid.commitProxy('reload').then(rest => {
21084
21240
  $xeGrid.dispatchEvent('proxy-query', {
21085
21241
  ...rest,
21086
21242
  isReload: true
21087
21243
  }, $event);
21088
21244
  });
21245
+ internalData.uFoot = false;
21246
+ updateQueryFooter();
21089
21247
  }
21090
21248
  $xeGrid.dispatchEvent('form-reset', params, $event);
21091
21249
  };
@@ -21530,7 +21688,13 @@ function grid_createInternalData() {
21530
21688
  if (!proxyInited) {
21531
21689
  reactData.proxyInited = true;
21532
21690
  if (proxyOpts.autoLoad !== false) {
21533
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => $xeGrid.commitProxy('initial')).then(rest => {
21691
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
21692
+ internalData.uFoot = true;
21693
+ const rest = $xeGrid.commitProxy('initial');
21694
+ internalData.uFoot = false;
21695
+ updateQueryFooter();
21696
+ return rest;
21697
+ }).then(rest => {
21534
21698
  dispatchEvent('proxy-query', {
21535
21699
  ...rest,
21536
21700
  isInited: true
@@ -21540,6 +21704,15 @@ function grid_createInternalData() {
21540
21704
  }
21541
21705
  }
21542
21706
  };
21707
+ const updateQueryFooter = () => {
21708
+ const proxyOpts = computeProxyOpts.value;
21709
+ const {
21710
+ ajax
21711
+ } = proxyOpts;
21712
+ if (ajax && ajax.queryFooter) {
21713
+ return $xeGrid.commitProxy('queryFooter');
21714
+ }
21715
+ };
21543
21716
  const handleGlobalKeydownEvent = evnt => {
21544
21717
  const zoomOpts = computeZoomOpts.value;
21545
21718
  const isEsc = grid_globalEvents.hasKey(evnt, grid_GLOBAL_EVENT_KEYS.ESCAPE);
@@ -21564,6 +21737,7 @@ function grid_createInternalData() {
21564
21737
  */
21565
21738
  commitProxy(proxyTarget, ...args) {
21566
21739
  const {
21740
+ showFooter,
21567
21741
  proxyConfig,
21568
21742
  toolbarConfig,
21569
21743
  pagerConfig,
@@ -21581,6 +21755,8 @@ function grid_createInternalData() {
21581
21755
  const {
21582
21756
  beforeQuery,
21583
21757
  afterQuery,
21758
+ beforeQueryFooter,
21759
+ afterQueryFooter,
21584
21760
  beforeDelete,
21585
21761
  afterDelete,
21586
21762
  beforeSave,
@@ -21645,10 +21821,10 @@ function grid_createInternalData() {
21645
21821
  case 'reload':
21646
21822
  case 'query':
21647
21823
  {
21648
- const ajaxMethods = ajax.query;
21649
- const querySuccessMethods = ajax.querySuccess;
21650
- const queryErrorMethods = ajax.queryError;
21651
- if (ajaxMethods) {
21824
+ const qMethods = ajax.query;
21825
+ const qsMethods = ajax.querySuccess;
21826
+ const qeMethods = ajax.queryError;
21827
+ if (qMethods) {
21652
21828
  const isInited = code === 'initial';
21653
21829
  const isReload = code === 'reload';
21654
21830
  if (!isInited && reactData.tableLoading) {
@@ -21738,31 +21914,27 @@ function grid_createInternalData() {
21738
21914
  sorts: sortList,
21739
21915
  filters: filterList,
21740
21916
  form: formData,
21741
- options: ajaxMethods
21917
+ options: qMethods
21742
21918
  };
21743
21919
  reactData.sortData = sortList;
21744
21920
  reactData.filterData = filterList;
21745
21921
  reactData.tableLoading = true;
21746
- return Promise.all([Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args)), operPromise]).then(([rest]) => {
21922
+ return Promise.all([Promise.resolve((beforeQuery || qMethods)(commitParams, ...args)), operPromise]).then(([rest]) => {
21747
21923
  let tableData = [];
21748
21924
  reactData.tableLoading = false;
21749
21925
  if (rest) {
21926
+ const reParams = {
21927
+ data: rest,
21928
+ $table: $xeTable,
21929
+ $grid: $xeGrid,
21930
+ $gantt: null
21931
+ };
21750
21932
  if (pagerConfig && isEnableConf(pagerOpts)) {
21751
21933
  const totalProp = resConfigs.total;
21752
- const total = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(totalProp) ? totalProp({
21753
- data: rest,
21754
- $table: $xeTable,
21755
- $grid: $xeGrid,
21756
- $gantt: null
21757
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, totalProp || 'page.total')) || 0;
21934
+ const total = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(totalProp) ? totalProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, totalProp || 'page.total')) || 0;
21758
21935
  tablePage.total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(total);
21759
21936
  const resultProp = resConfigs.result;
21760
- tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(resultProp) ? resultProp({
21761
- data: rest,
21762
- $table: $xeTable,
21763
- $grid: $xeGrid,
21764
- $gantt: null
21765
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, resultProp || 'result')) || [];
21937
+ tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(resultProp) ? resultProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, resultProp || 'result')) || [];
21766
21938
  // 检验当前页码,不能超出当前最大页数
21767
21939
  const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
21768
21940
  if (tablePage.currentPage > pageCount) {
@@ -21770,12 +21942,18 @@ function grid_createInternalData() {
21770
21942
  }
21771
21943
  } else {
21772
21944
  const listProp = resConfigs.list;
21773
- tableData = (listProp ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(listProp) ? listProp({
21774
- data: rest,
21775
- $table: $xeTable,
21776
- $grid: $xeGrid,
21777
- $gantt: null
21778
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, listProp) : rest) || [];
21945
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rest)) {
21946
+ tableData = rest;
21947
+ } else if (listProp) {
21948
+ tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(listProp) ? listProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, listProp)) || [];
21949
+ }
21950
+ }
21951
+ if (showFooter) {
21952
+ const fdProp = resConfigs.footerData;
21953
+ const footerList = fdProp ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(fdProp) ? fdProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, fdProp) : [];
21954
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerList)) {
21955
+ reactData.footerData = footerList;
21956
+ }
21779
21957
  }
21780
21958
  }
21781
21959
  if ($xeTable) {
@@ -21791,8 +21969,8 @@ function grid_createInternalData() {
21791
21969
  if (afterQuery) {
21792
21970
  afterQuery(commitParams, ...args);
21793
21971
  }
21794
- if (querySuccessMethods) {
21795
- querySuccessMethods({
21972
+ if (qsMethods) {
21973
+ qsMethods({
21796
21974
  ...commitParams,
21797
21975
  response: rest
21798
21976
  });
@@ -21802,8 +21980,8 @@ function grid_createInternalData() {
21802
21980
  };
21803
21981
  }).catch(rest => {
21804
21982
  reactData.tableLoading = false;
21805
- if (queryErrorMethods) {
21806
- queryErrorMethods({
21983
+ if (qeMethods) {
21984
+ qeMethods({
21807
21985
  ...commitParams,
21808
21986
  response: rest
21809
21987
  });
@@ -21817,12 +21995,62 @@ function grid_createInternalData() {
21817
21995
  }
21818
21996
  break;
21819
21997
  }
21998
+ case 'queryFooter':
21999
+ {
22000
+ const qfMethods = ajax.queryFooter;
22001
+ const qfSuccessMethods = ajax.queryFooterSuccess;
22002
+ const qfErrorMethods = ajax.queryFooterError;
22003
+ if (qfMethods) {
22004
+ let filterList = [];
22005
+ if ($xeTable) {
22006
+ filterList = $xeTable.getCheckedFilters();
22007
+ }
22008
+ const commitParams = {
22009
+ $table: $xeTable,
22010
+ $grid: $xeGrid,
22011
+ $gantt: null,
22012
+ code,
22013
+ button,
22014
+ filters: filterList,
22015
+ form: formData,
22016
+ options: qfMethods
22017
+ };
22018
+ return Promise.resolve((beforeQueryFooter || qfMethods)(commitParams, ...args)).then(rest => {
22019
+ reactData.footerData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rest) ? rest : [];
22020
+ if (afterQueryFooter) {
22021
+ afterQueryFooter(commitParams, ...args);
22022
+ }
22023
+ if (qfSuccessMethods) {
22024
+ qfSuccessMethods({
22025
+ ...commitParams,
22026
+ response: rest
22027
+ });
22028
+ }
22029
+ return {
22030
+ status: true
22031
+ };
22032
+ }).catch(rest => {
22033
+ if (qfErrorMethods) {
22034
+ qfErrorMethods({
22035
+ ...commitParams,
22036
+ response: rest
22037
+ });
22038
+ }
22039
+ return {
22040
+ status: false
22041
+ };
22042
+ });
22043
+ } else {
22044
+ errLog('vxe.error.notFunc', ['[grid] proxy-config.ajax.queryFooter']);
22045
+ }
22046
+ break;
22047
+ }
21820
22048
  case 'delete':
21821
22049
  {
21822
- const ajaxMethods = ajax.delete;
22050
+ const dMethods = ajax.delete;
21823
22051
  const deleteSuccessMethods = ajax.deleteSuccess;
21824
22052
  const deleteErrorMethods = ajax.deleteError;
21825
- if (ajaxMethods) {
22053
+ if (dMethods) {
21826
22054
  const selectRecords = $xeGrid.getCheckboxRecords();
21827
22055
  const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
21828
22056
  const body = {
@@ -21836,7 +22064,7 @@ function grid_createInternalData() {
21836
22064
  button,
21837
22065
  body,
21838
22066
  form: formData,
21839
- options: ajaxMethods
22067
+ options: dMethods
21840
22068
  };
21841
22069
  if (selectRecords.length) {
21842
22070
  return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
@@ -21844,7 +22072,7 @@ function grid_createInternalData() {
21844
22072
  return $xeTable.remove(selectRecords);
21845
22073
  }
21846
22074
  reactData.tableLoading = true;
21847
- return Promise.resolve((beforeDelete || ajaxMethods)(commitParams, ...args)).then(rest => {
22075
+ return Promise.resolve((beforeDelete || dMethods)(commitParams, ...args)).then(rest => {
21848
22076
  reactData.tableLoading = false;
21849
22077
  $xeTable.setPendingRow(removeRecords, false);
21850
22078
  if (isRespMsg) {
@@ -21858,7 +22086,10 @@ function grid_createInternalData() {
21858
22086
  if (afterDelete) {
21859
22087
  afterDelete(commitParams, ...args);
21860
22088
  } else {
22089
+ internalData.uFoot = true;
21861
22090
  $xeGrid.commitProxy('query');
22091
+ internalData.uFoot = false;
22092
+ updateQueryFooter();
21862
22093
  }
21863
22094
  if (deleteSuccessMethods) {
21864
22095
  deleteSuccessMethods({
@@ -21964,7 +22195,10 @@ function grid_createInternalData() {
21964
22195
  if (afterSave) {
21965
22196
  afterSave(commitParams, ...args);
21966
22197
  } else {
22198
+ internalData.uFoot = true;
21967
22199
  $xeGrid.commitProxy('query');
22200
+ internalData.uFoot = false;
22201
+ updateQueryFooter();
21968
22202
  }
21969
22203
  if (saveSuccessMethods) {
21970
22204
  saveSuccessMethods({
@@ -22251,14 +22485,26 @@ function grid_createInternalData() {
22251
22485
  const {
22252
22486
  code
22253
22487
  } = params;
22254
- return $xeGrid.commitProxy(params, evnt).then(rest => {
22255
- if (code && rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
22256
- $xeGrid.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code}` : 'proxy-query', {
22257
- ...rest,
22258
- isReload: code === 'reload'
22259
- }, evnt);
22488
+ if (code) {
22489
+ const isUf = ['reload', 'delete', 'save'].includes(code);
22490
+ if (isUf) {
22491
+ internalData.uFoot = true;
22260
22492
  }
22261
- });
22493
+ const rest = $xeGrid.commitProxy(params, evnt).then(rest => {
22494
+ if (rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
22495
+ $xeGrid.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code}` : 'proxy-query', {
22496
+ ...rest,
22497
+ isReload: code === 'reload'
22498
+ }, evnt);
22499
+ }
22500
+ });
22501
+ internalData.uFoot = false;
22502
+ if (isUf) {
22503
+ updateQueryFooter();
22504
+ }
22505
+ return rest;
22506
+ }
22507
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
22262
22508
  },
22263
22509
  triggerToolbarBtnEvent(button, evnt) {
22264
22510
  $xeGrid.triggerToolbarCommitEvent(button, evnt);