vxe-table 4.23.11 → 4.23.12

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 (86) hide show
  1. package/dist/all.esm.js +15834 -15806
  2. package/dist/all.esm.min.js +3 -0
  3. package/es/grid/src/grid.js +1665 -1662
  4. package/es/table/src/column.js +39 -36
  5. package/es/table/src/group.js +49 -46
  6. package/es/table/src/table.js +13721 -13706
  7. package/es/toolbar/src/toolbar.js +595 -592
  8. package/es/ui/index.js +2 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/grid/src/grid.js +1665 -1662
  11. package/lib/index.umd.js +15834 -15806
  12. package/lib/index.umd.min.js +3 -3
  13. package/lib/locale/ar-EG.umd.min.js +1 -0
  14. package/lib/locale/de-DE.umd.min.js +1 -0
  15. package/lib/locale/en-US.umd.min.js +1 -0
  16. package/lib/locale/es-ES.umd.min.js +1 -0
  17. package/lib/locale/fr-FR.umd.min.js +1 -0
  18. package/lib/locale/hu-HU.umd.min.js +1 -0
  19. package/lib/locale/hy-AM.umd.min.js +1 -0
  20. package/lib/locale/id-ID.umd.min.js +1 -0
  21. package/lib/locale/it-IT.umd.min.js +1 -0
  22. package/lib/locale/ja-JP.umd.min.js +1 -0
  23. package/lib/locale/ko-KR.umd.min.js +1 -0
  24. package/lib/locale/lang/ar-EG.umd.min.js +1 -0
  25. package/lib/locale/lang/de-DE.umd.min.js +1 -0
  26. package/lib/locale/lang/en-US.umd.min.js +1 -0
  27. package/lib/locale/lang/es-ES.umd.min.js +1 -0
  28. package/lib/locale/lang/fr-FR.umd.min.js +1 -0
  29. package/lib/locale/lang/hu-HU.umd.min.js +1 -0
  30. package/lib/locale/lang/hy-AM.umd.min.js +1 -0
  31. package/lib/locale/lang/id-ID.umd.min.js +1 -0
  32. package/lib/locale/lang/it-IT.umd.min.js +1 -0
  33. package/lib/locale/lang/ja-JP.umd.min.js +1 -0
  34. package/lib/locale/lang/ko-KR.umd.min.js +1 -0
  35. package/lib/locale/lang/ms-MY.umd.min.js +1 -0
  36. package/lib/locale/lang/nb-NO.umd.min.js +1 -0
  37. package/lib/locale/lang/pt-BR.umd.min.js +1 -0
  38. package/lib/locale/lang/ru-RU.umd.min.js +1 -0
  39. package/lib/locale/lang/th-TH.umd.min.js +1 -0
  40. package/lib/locale/lang/ug-CN.umd.min.js +1 -0
  41. package/lib/locale/lang/uk-UA.umd.min.js +1 -0
  42. package/lib/locale/lang/uz-UZ.umd.min.js +1 -0
  43. package/lib/locale/lang/vi-VN.umd.min.js +1 -0
  44. package/lib/locale/lang/zh-CHT.umd.min.js +1 -0
  45. package/lib/locale/lang/zh-CN.umd.min.js +1 -0
  46. package/lib/locale/lang/zh-HK.umd.min.js +1 -0
  47. package/lib/locale/lang/zh-MO.umd.min.js +1 -0
  48. package/lib/locale/lang/zh-TC.umd.min.js +1 -0
  49. package/lib/locale/lang/zh-TW.umd.min.js +1 -0
  50. package/lib/locale/ms-MY.umd.min.js +1 -0
  51. package/lib/locale/nb-NO.umd.min.js +1 -0
  52. package/lib/locale/pt-BR.umd.min.js +1 -0
  53. package/lib/locale/ru-RU.umd.min.js +1 -0
  54. package/lib/locale/th-TH.umd.min.js +1 -0
  55. package/lib/locale/ug-CN.umd.min.js +1 -0
  56. package/lib/locale/uk-UA.umd.min.js +1 -0
  57. package/lib/locale/uz-UZ.umd.min.js +1 -0
  58. package/lib/locale/vi-VN.umd.min.js +1 -0
  59. package/lib/locale/zh-CHT.umd.min.js +1 -0
  60. package/lib/locale/zh-CN.umd.min.js +1 -0
  61. package/lib/locale/zh-HK.umd.min.js +1 -0
  62. package/lib/locale/zh-MO.umd.min.js +1 -0
  63. package/lib/locale/zh-TC.umd.min.js +1 -0
  64. package/lib/locale/zh-TW.umd.min.js +1 -0
  65. package/lib/table/src/column.js +39 -36
  66. package/lib/table/src/group.js +49 -46
  67. package/lib/table/src/table.js +13721 -13706
  68. package/lib/toolbar/src/toolbar.js +595 -592
  69. package/lib/ui/index.js +2 -1
  70. package/lib/ui/src/log.js +1 -1
  71. package/package.json +9 -2
  72. package/packages/grid/src/grid.ts +2 -2
  73. package/packages/table/src/column.ts +2 -2
  74. package/packages/table/src/group.ts +2 -2
  75. package/packages/table/src/table.ts +55 -26
  76. package/packages/toolbar/src/toolbar.ts +2 -2
  77. package/packages/ui/index.ts +1 -0
  78. /package/dist/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  79. /package/dist/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  80. /package/dist/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
  81. /package/es/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  82. /package/es/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  83. /package/es/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
  84. /package/lib/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  85. /package/lib/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  86. /package/lib/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
@@ -257,1807 +257,1810 @@ function createInternalData() {
257
257
  uFoot: false
258
258
  };
259
259
  }
260
- var grid_default = (0, import_comp.defineVxeComponent)({
261
- name: "VxeGrid",
262
- props: import_props.gridProps,
263
- emits: import_emits.gridEmits,
264
- setup(props, context) {
265
- const { slots, emit } = context;
266
- const xID = import_xe_utils.default.uniqueId();
267
- const VxeUIFormComponent = import_core.VxeUI.getComponent("VxeForm");
268
- const VxeUIPagerComponent = import_core.VxeUI.getComponent("VxePager");
269
- const defaultLayouts = [["Form"], ["Toolbar", "Top", "Table", "Bottom", "Pager"]];
270
- const { computeSize } = useFns.useSize(props);
271
- const { computeIsVScrollbar } = useFns.useVScrollbar(props);
272
- const reactData = (0, import_vue.reactive)(createReactData());
273
- const internalData = createInternalData();
274
- const refElem = (0, import_vue.ref)();
275
- const refTable = (0, import_vue.ref)();
276
- const refForm = (0, import_vue.ref)();
277
- const refToolbar = (0, import_vue.ref)();
278
- const refPager = (0, import_vue.ref)();
279
- const refPopupContainerElem = (0, import_vue.ref)();
280
- const refFormWrapper = (0, import_vue.ref)();
281
- const refToolbarWrapper = (0, import_vue.ref)();
282
- const refTopWrapper = (0, import_vue.ref)();
283
- const refBottomWrapper = (0, import_vue.ref)();
284
- const refPagerWrapper = (0, import_vue.ref)();
285
- const extendTableMethods = (methodKeys) => {
286
- const funcs = {};
287
- methodKeys.forEach((name) => {
288
- funcs[name] = (...args) => {
260
+ var grid_default = (
261
+ /* define-vxe-component start */
262
+ (0, import_comp.defineVxeComponent)({
263
+ name: "VxeGrid",
264
+ props: import_props.gridProps,
265
+ emits: import_emits.gridEmits,
266
+ setup(props, context) {
267
+ const { slots, emit } = context;
268
+ const xID = import_xe_utils.default.uniqueId();
269
+ const VxeUIFormComponent = import_core.VxeUI.getComponent("VxeForm");
270
+ const VxeUIPagerComponent = import_core.VxeUI.getComponent("VxePager");
271
+ const defaultLayouts = [["Form"], ["Toolbar", "Top", "Table", "Bottom", "Pager"]];
272
+ const { computeSize } = useFns.useSize(props);
273
+ const { computeIsVScrollbar } = useFns.useVScrollbar(props);
274
+ const reactData = (0, import_vue.reactive)(createReactData());
275
+ const internalData = createInternalData();
276
+ const refElem = (0, import_vue.ref)();
277
+ const refTable = (0, import_vue.ref)();
278
+ const refForm = (0, import_vue.ref)();
279
+ const refToolbar = (0, import_vue.ref)();
280
+ const refPager = (0, import_vue.ref)();
281
+ const refPopupContainerElem = (0, import_vue.ref)();
282
+ const refFormWrapper = (0, import_vue.ref)();
283
+ const refToolbarWrapper = (0, import_vue.ref)();
284
+ const refTopWrapper = (0, import_vue.ref)();
285
+ const refBottomWrapper = (0, import_vue.ref)();
286
+ const refPagerWrapper = (0, import_vue.ref)();
287
+ const extendTableMethods = (methodKeys) => {
288
+ const funcs = {};
289
+ methodKeys.forEach((name) => {
290
+ funcs[name] = (...args) => {
291
+ const $xeTable = refTable.value;
292
+ if ($xeTable && $xeTable[name]) {
293
+ return $xeTable[name](...args);
294
+ }
295
+ };
296
+ });
297
+ return funcs;
298
+ };
299
+ const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
300
+ tableComponentMethodKeys.forEach((name) => {
301
+ gridExtendTableMethods[name] = (...args) => {
289
302
  const $xeTable = refTable.value;
290
303
  if ($xeTable && $xeTable[name]) {
291
- return $xeTable[name](...args);
304
+ return $xeTable && $xeTable[name](...args);
292
305
  }
293
306
  };
294
307
  });
295
- return funcs;
296
- };
297
- const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
298
- tableComponentMethodKeys.forEach((name) => {
299
- gridExtendTableMethods[name] = (...args) => {
300
- const $xeTable = refTable.value;
301
- if ($xeTable && $xeTable[name]) {
302
- return $xeTable && $xeTable[name](...args);
308
+ const computeProxyOpts = (0, import_vue.computed)(() => {
309
+ return import_xe_utils.default.merge({}, import_xe_utils.default.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
310
+ });
311
+ const computeIsRespMsg = (0, import_vue.computed)(() => {
312
+ const proxyOpts = computeProxyOpts.value;
313
+ return !!(import_xe_utils.default.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg);
314
+ });
315
+ const computeIsActiveMsg = (0, import_vue.computed)(() => {
316
+ const proxyOpts = computeProxyOpts.value;
317
+ return import_xe_utils.default.isBoolean(proxyOpts.showActionMsg) ? proxyOpts.showActionMsg : !!proxyOpts.showActiveMsg;
318
+ });
319
+ const computePagerOpts = (0, import_vue.computed)(() => {
320
+ return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig);
321
+ });
322
+ const computePagerProps = (0, import_vue.computed)(() => {
323
+ const pagerOpts = computePagerOpts.value;
324
+ return Object.assign({}, pagerOpts, { enabled: void 0, slots: void 0 });
325
+ });
326
+ const computeFormOpts = (0, import_vue.computed)(() => {
327
+ return Object.assign({}, getConfig().grid.formConfig, props.formConfig);
328
+ });
329
+ const computeToolbarOpts = (0, import_vue.computed)(() => {
330
+ return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig);
331
+ });
332
+ const computeZoomOpts = (0, import_vue.computed)(() => {
333
+ return Object.assign({}, getConfig().grid.zoomConfig, props.zoomConfig);
334
+ });
335
+ const computeStyles = (0, import_vue.computed)(() => {
336
+ const { height, maxHeight } = props;
337
+ const { isZMax, tZindex } = reactData;
338
+ const stys = {};
339
+ if (isZMax) {
340
+ stys.zIndex = tZindex;
341
+ } else {
342
+ if (height) {
343
+ stys.height = height === "auto" || height === "100%" ? "100%" : (0, import_dom.toCssUnit)(height);
344
+ }
345
+ if (maxHeight) {
346
+ stys.maxHeight = maxHeight === "auto" || maxHeight === "100%" ? "100%" : (0, import_dom.toCssUnit)(maxHeight);
347
+ }
303
348
  }
304
- };
305
- });
306
- const computeProxyOpts = (0, import_vue.computed)(() => {
307
- return import_xe_utils.default.merge({}, import_xe_utils.default.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
308
- });
309
- const computeIsRespMsg = (0, import_vue.computed)(() => {
310
- const proxyOpts = computeProxyOpts.value;
311
- return !!(import_xe_utils.default.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg);
312
- });
313
- const computeIsActiveMsg = (0, import_vue.computed)(() => {
314
- const proxyOpts = computeProxyOpts.value;
315
- return import_xe_utils.default.isBoolean(proxyOpts.showActionMsg) ? proxyOpts.showActionMsg : !!proxyOpts.showActiveMsg;
316
- });
317
- const computePagerOpts = (0, import_vue.computed)(() => {
318
- return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig);
319
- });
320
- const computePagerProps = (0, import_vue.computed)(() => {
321
- const pagerOpts = computePagerOpts.value;
322
- return Object.assign({}, pagerOpts, { enabled: void 0, slots: void 0 });
323
- });
324
- const computeFormOpts = (0, import_vue.computed)(() => {
325
- return Object.assign({}, getConfig().grid.formConfig, props.formConfig);
326
- });
327
- const computeToolbarOpts = (0, import_vue.computed)(() => {
328
- return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig);
329
- });
330
- const computeZoomOpts = (0, import_vue.computed)(() => {
331
- return Object.assign({}, getConfig().grid.zoomConfig, props.zoomConfig);
332
- });
333
- const computeStyles = (0, import_vue.computed)(() => {
334
- const { height, maxHeight } = props;
335
- const { isZMax, tZindex } = reactData;
336
- const stys = {};
337
- if (isZMax) {
338
- stys.zIndex = tZindex;
339
- } else {
340
- if (height) {
341
- stys.height = height === "auto" || height === "100%" ? "100%" : (0, import_dom.toCssUnit)(height);
349
+ return stys;
350
+ });
351
+ const computeTableExtendProps = (0, import_vue.computed)(() => {
352
+ const rest = {};
353
+ tableComponentPropKeys.forEach((key) => {
354
+ if (props[key] !== void 0) {
355
+ rest[key] = props[key];
356
+ }
357
+ });
358
+ return rest;
359
+ });
360
+ const computeTableProps = (0, import_vue.computed)(() => {
361
+ const { showFooter, seqConfig, pagerConfig, editConfig, proxyConfig } = props;
362
+ const { isZMax, tablePage, footerData } = reactData;
363
+ const tableExtendProps = computeTableExtendProps.value;
364
+ const proxyOpts = computeProxyOpts.value;
365
+ const pagerOpts = computePagerOpts.value;
366
+ const isLoading = computeIsLoading.value;
367
+ const tProps = Object.assign({}, tableExtendProps);
368
+ if (showFooter && !tProps.footerData) {
369
+ tProps.footerData = footerData;
370
+ } else if (proxyOpts.footer && footerData.length) {
371
+ tProps.footerData = footerData;
372
+ }
373
+ if (isZMax) {
374
+ if (tProps.maxHeight) {
375
+ tProps.maxHeight = "100%";
376
+ } else {
377
+ tProps.height = "100%";
378
+ }
342
379
  }
343
- if (maxHeight) {
344
- stys.maxHeight = maxHeight === "auto" || maxHeight === "100%" ? "100%" : (0, import_dom.toCssUnit)(maxHeight);
380
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
381
+ tProps.loading = isLoading;
382
+ if (pagerConfig && proxyOpts.seq && (0, import_utils.isEnableConf)(pagerOpts)) {
383
+ tProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
384
+ }
345
385
  }
346
- }
347
- return stys;
348
- });
349
- const computeTableExtendProps = (0, import_vue.computed)(() => {
350
- const rest = {};
351
- tableComponentPropKeys.forEach((key) => {
352
- if (props[key] !== void 0) {
353
- rest[key] = props[key];
386
+ if (editConfig) {
387
+ tProps.editConfig = Object.assign({}, editConfig);
354
388
  }
389
+ return tProps;
355
390
  });
356
- return rest;
357
- });
358
- const computeTableProps = (0, import_vue.computed)(() => {
359
- const { showFooter, seqConfig, pagerConfig, editConfig, proxyConfig } = props;
360
- const { isZMax, tablePage, footerData } = reactData;
361
- const tableExtendProps = computeTableExtendProps.value;
362
- const proxyOpts = computeProxyOpts.value;
363
- const pagerOpts = computePagerOpts.value;
364
- const isLoading = computeIsLoading.value;
365
- const tProps = Object.assign({}, tableExtendProps);
366
- if (showFooter && !tProps.footerData) {
367
- tProps.footerData = footerData;
368
- } else if (proxyOpts.footer && footerData.length) {
369
- tProps.footerData = footerData;
370
- }
371
- if (isZMax) {
372
- if (tProps.maxHeight) {
373
- tProps.maxHeight = "100%";
391
+ const computeCurrLayoutConf = (0, import_vue.computed)(() => {
392
+ const { layouts } = props;
393
+ let confs = [];
394
+ if (layouts && layouts.length) {
395
+ confs = layouts;
374
396
  } else {
375
- tProps.height = "100%";
397
+ confs = getConfig().grid.layouts || defaultLayouts;
376
398
  }
377
- }
378
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
379
- tProps.loading = isLoading;
380
- if (pagerConfig && proxyOpts.seq && (0, import_utils.isEnableConf)(pagerOpts)) {
381
- tProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
399
+ let headKeys = [];
400
+ let bodyKeys = [];
401
+ let footKeys = [];
402
+ if (confs.length) {
403
+ if (import_xe_utils.default.isArray(confs[0])) {
404
+ headKeys = confs[0];
405
+ bodyKeys = confs[1] || [];
406
+ footKeys = confs[2] || [];
407
+ } else {
408
+ bodyKeys = confs;
409
+ }
382
410
  }
383
- }
384
- if (editConfig) {
385
- tProps.editConfig = Object.assign({}, editConfig);
386
- }
387
- return tProps;
388
- });
389
- const computeCurrLayoutConf = (0, import_vue.computed)(() => {
390
- const { layouts } = props;
391
- let confs = [];
392
- if (layouts && layouts.length) {
393
- confs = layouts;
394
- } else {
395
- confs = getConfig().grid.layouts || defaultLayouts;
396
- }
397
- let headKeys = [];
398
- let bodyKeys = [];
399
- let footKeys = [];
400
- if (confs.length) {
401
- if (import_xe_utils.default.isArray(confs[0])) {
402
- headKeys = confs[0];
403
- bodyKeys = confs[1] || [];
404
- footKeys = confs[2] || [];
405
- } else {
406
- bodyKeys = confs;
411
+ return {
412
+ headKeys,
413
+ bodyKeys,
414
+ footKeys
415
+ };
416
+ });
417
+ const computeCustomCurrentPageFlag = (0, import_vue.computed)(() => {
418
+ const pagerOpts = computePagerOpts.value;
419
+ return pagerOpts.currentPage;
420
+ });
421
+ const computeCustomPageSizeFlag = (0, import_vue.computed)(() => {
422
+ const pagerOpts = computePagerOpts.value;
423
+ return pagerOpts.pageSize;
424
+ });
425
+ const computeCustomTotalFlag = (0, import_vue.computed)(() => {
426
+ const pagerOpts = computePagerOpts.value;
427
+ return pagerOpts.total;
428
+ });
429
+ const computePageCount = (0, import_vue.computed)(() => {
430
+ const { tablePage } = reactData;
431
+ return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
432
+ });
433
+ const computeIsLoading = (0, import_vue.computed)(() => {
434
+ const { loading, proxyConfig } = props;
435
+ const { tableLoading } = reactData;
436
+ const proxyOpts = computeProxyOpts.value;
437
+ const { showLoading } = proxyOpts;
438
+ return loading || tableLoading && showLoading && proxyConfig && (0, import_utils.isEnableConf)(proxyOpts);
439
+ });
440
+ const refMaps = {
441
+ refElem,
442
+ refTable,
443
+ refForm,
444
+ refToolbar,
445
+ refPager,
446
+ refPopupContainerElem
447
+ };
448
+ const computeMaps = {
449
+ computeSize,
450
+ computeIsVScrollbar,
451
+ computeProxyOpts,
452
+ computePagerOpts,
453
+ computeFormOpts,
454
+ computeToolbarOpts,
455
+ computeZoomOpts
456
+ };
457
+ const $xeGrid = {
458
+ xID,
459
+ props,
460
+ context,
461
+ reactData,
462
+ internalData,
463
+ getRefMaps: () => refMaps,
464
+ getComputeMaps: () => computeMaps
465
+ };
466
+ const initToolbar = () => {
467
+ const toolbarOpts = computeToolbarOpts.value;
468
+ if (props.toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts)) {
469
+ (0, import_vue.nextTick)(() => {
470
+ const $xeTable = refTable.value;
471
+ const $xeToolbar = refToolbar.value;
472
+ if ($xeTable && $xeToolbar) {
473
+ $xeTable.connectToolbar($xeToolbar);
474
+ }
475
+ });
407
476
  }
408
- }
409
- return {
410
- headKeys,
411
- bodyKeys,
412
- footKeys
413
477
  };
414
- });
415
- const computeCustomCurrentPageFlag = (0, import_vue.computed)(() => {
416
- const pagerOpts = computePagerOpts.value;
417
- return pagerOpts.currentPage;
418
- });
419
- const computeCustomPageSizeFlag = (0, import_vue.computed)(() => {
420
- const pagerOpts = computePagerOpts.value;
421
- return pagerOpts.pageSize;
422
- });
423
- const computeCustomTotalFlag = (0, import_vue.computed)(() => {
424
- const pagerOpts = computePagerOpts.value;
425
- return pagerOpts.total;
426
- });
427
- const computePageCount = (0, import_vue.computed)(() => {
428
- const { tablePage } = reactData;
429
- return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
430
- });
431
- const computeIsLoading = (0, import_vue.computed)(() => {
432
- const { loading, proxyConfig } = props;
433
- const { tableLoading } = reactData;
434
- const proxyOpts = computeProxyOpts.value;
435
- const { showLoading } = proxyOpts;
436
- return loading || tableLoading && showLoading && proxyConfig && (0, import_utils.isEnableConf)(proxyOpts);
437
- });
438
- const refMaps = {
439
- refElem,
440
- refTable,
441
- refForm,
442
- refToolbar,
443
- refPager,
444
- refPopupContainerElem
445
- };
446
- const computeMaps = {
447
- computeSize,
448
- computeIsVScrollbar,
449
- computeProxyOpts,
450
- computePagerOpts,
451
- computeFormOpts,
452
- computeToolbarOpts,
453
- computeZoomOpts
454
- };
455
- const $xeGrid = {
456
- xID,
457
- props,
458
- context,
459
- reactData,
460
- internalData,
461
- getRefMaps: () => refMaps,
462
- getComputeMaps: () => computeMaps
463
- };
464
- const initToolbar = () => {
465
- const toolbarOpts = computeToolbarOpts.value;
466
- if (props.toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts)) {
467
- (0, import_vue.nextTick)(() => {
468
- const $xeTable = refTable.value;
469
- const $xeToolbar = refToolbar.value;
470
- if ($xeTable && $xeToolbar) {
471
- $xeTable.connectToolbar($xeToolbar);
478
+ const getFormData = () => {
479
+ const { proxyConfig } = props;
480
+ const { formData } = reactData;
481
+ const proxyOpts = computeProxyOpts.value;
482
+ const formOpts = computeFormOpts.value;
483
+ return proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data;
484
+ };
485
+ const initPages = (propKey) => {
486
+ const { tablePage } = reactData;
487
+ const { pagerConfig } = props;
488
+ const pagerOpts = computePagerOpts.value;
489
+ if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
490
+ if (propKey) {
491
+ if (pagerOpts[propKey]) {
492
+ tablePage[propKey] = import_xe_utils.default.toNumber(pagerOpts[propKey]);
493
+ }
494
+ } else {
495
+ const { currentPage, pageSize, total } = pagerOpts;
496
+ if (currentPage) {
497
+ tablePage.currentPage = currentPage;
498
+ }
499
+ if (pageSize) {
500
+ tablePage.pageSize = pageSize;
501
+ }
502
+ if (total) {
503
+ tablePage.total = total;
504
+ }
472
505
  }
473
- });
474
- }
475
- };
476
- const getFormData = () => {
477
- const { proxyConfig } = props;
478
- const { formData } = reactData;
479
- const proxyOpts = computeProxyOpts.value;
480
- const formOpts = computeFormOpts.value;
481
- return proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data;
482
- };
483
- const initPages = (propKey) => {
484
- const { tablePage } = reactData;
485
- const { pagerConfig } = props;
486
- const pagerOpts = computePagerOpts.value;
487
- if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
488
- if (propKey) {
489
- if (pagerOpts[propKey]) {
490
- tablePage[propKey] = import_xe_utils.default.toNumber(pagerOpts[propKey]);
506
+ }
507
+ };
508
+ const triggerPendingEvent = (code) => {
509
+ const isActiveMsg = computeIsActiveMsg.value;
510
+ const $xeTable = refTable.value;
511
+ const selectRecords = $xeTable ? $xeTable.getCheckboxRecords() : [];
512
+ if (selectRecords.length) {
513
+ if ($xeTable) {
514
+ $xeTable.togglePendingRow(selectRecords);
491
515
  }
516
+ $xeGrid.clearCheckboxRow();
492
517
  } else {
493
- const { currentPage, pageSize, total } = pagerOpts;
494
- if (currentPage) {
495
- tablePage.currentPage = currentPage;
496
- }
497
- if (pageSize) {
498
- tablePage.pageSize = pageSize;
499
- }
500
- if (total) {
501
- tablePage.total = total;
518
+ if (isActiveMsg) {
519
+ if (import_core.VxeUI.modal) {
520
+ import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
521
+ }
502
522
  }
503
523
  }
504
- }
505
- };
506
- const triggerPendingEvent = (code) => {
507
- const isActiveMsg = computeIsActiveMsg.value;
508
- const $xeTable = refTable.value;
509
- const selectRecords = $xeTable ? $xeTable.getCheckboxRecords() : [];
510
- if (selectRecords.length) {
511
- if ($xeTable) {
512
- $xeTable.togglePendingRow(selectRecords);
524
+ };
525
+ const getRespMsg = (rest, defaultMsg) => {
526
+ const proxyOpts = computeProxyOpts.value;
527
+ const resConfigs = proxyOpts.response || proxyOpts.props || {};
528
+ const messageProp = resConfigs.message;
529
+ const $xeTable = refTable.value;
530
+ let msg;
531
+ if (rest && messageProp) {
532
+ msg = import_xe_utils.default.isFunction(messageProp) ? messageProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : import_xe_utils.default.get(rest, messageProp);
513
533
  }
514
- $xeGrid.clearCheckboxRow();
515
- } else {
534
+ return msg || getI18n(defaultMsg);
535
+ };
536
+ const handleDeleteRow = (code, alertKey, callback) => {
537
+ const isActiveMsg = computeIsActiveMsg.value;
538
+ const selectRecords = $xeGrid.getCheckboxRecords();
516
539
  if (isActiveMsg) {
517
- if (import_core.VxeUI.modal) {
518
- import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
540
+ if (selectRecords.length) {
541
+ if (import_core.VxeUI.modal) {
542
+ return import_core.VxeUI.modal.confirm({ id: `cfm_${code}`, content: getI18n(alertKey), escClosable: true }).then((type) => {
543
+ if (type === "confirm") {
544
+ return callback();
545
+ }
546
+ });
547
+ }
548
+ } else {
549
+ if (import_core.VxeUI.modal) {
550
+ import_core.VxeUI.modal.message({ id: `msg_${code}`, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
551
+ }
552
+ }
553
+ } else {
554
+ if (selectRecords.length) {
555
+ callback();
519
556
  }
520
557
  }
521
- }
522
- };
523
- const getRespMsg = (rest, defaultMsg) => {
524
- const proxyOpts = computeProxyOpts.value;
525
- const resConfigs = proxyOpts.response || proxyOpts.props || {};
526
- const messageProp = resConfigs.message;
527
- const $xeTable = refTable.value;
528
- let msg;
529
- if (rest && messageProp) {
530
- msg = import_xe_utils.default.isFunction(messageProp) ? messageProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : import_xe_utils.default.get(rest, messageProp);
531
- }
532
- return msg || getI18n(defaultMsg);
533
- };
534
- const handleDeleteRow = (code, alertKey, callback) => {
535
- const isActiveMsg = computeIsActiveMsg.value;
536
- const selectRecords = $xeGrid.getCheckboxRecords();
537
- if (isActiveMsg) {
538
- if (selectRecords.length) {
539
- if (import_core.VxeUI.modal) {
540
- return import_core.VxeUI.modal.confirm({ id: `cfm_${code}`, content: getI18n(alertKey), escClosable: true }).then((type) => {
541
- if (type === "confirm") {
542
- return callback();
543
- }
558
+ return Promise.resolve();
559
+ };
560
+ const pageChangeEvent = (params) => {
561
+ const { proxyConfig } = props;
562
+ const { tablePage } = reactData;
563
+ const { $event, currentPage, pageSize } = params;
564
+ const proxyOpts = computeProxyOpts.value;
565
+ tablePage.currentPage = currentPage;
566
+ tablePage.pageSize = pageSize;
567
+ $xeGrid.dispatchEvent("page-change", params, $event);
568
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
569
+ $xeGrid.commitProxy("query").then((rest) => {
570
+ $xeGrid.dispatchEvent("proxy-query", rest, $event);
571
+ });
572
+ }
573
+ };
574
+ const handleSortEvent = (params) => {
575
+ const $xeTable = refTable.value;
576
+ const { proxyConfig } = props;
577
+ if (!$xeTable) {
578
+ return;
579
+ }
580
+ const { computeSortOpts } = $xeTable.getComputeMaps();
581
+ const proxyOpts = computeProxyOpts.value;
582
+ const sortOpts = computeSortOpts.value;
583
+ if (sortOpts.remote) {
584
+ reactData.sortData = params.sortList;
585
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
586
+ reactData.tablePage.currentPage = 1;
587
+ $xeGrid.commitProxy("query").then((rest) => {
588
+ $xeGrid.dispatchEvent("proxy-query", rest, params.$event);
544
589
  });
545
590
  }
546
- } else {
547
- if (import_core.VxeUI.modal) {
548
- import_core.VxeUI.modal.message({ id: `msg_${code}`, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
591
+ }
592
+ };
593
+ const sortChangeEvent = (params) => {
594
+ handleSortEvent(params);
595
+ $xeGrid.dispatchEvent("sort-change", params, params.$event);
596
+ };
597
+ const clearAllSortEvent = (params) => {
598
+ handleSortEvent(params);
599
+ $xeGrid.dispatchEvent("clear-all-sort", params, params.$event);
600
+ };
601
+ const handleFilterEvent = (params) => {
602
+ const $xeTable = refTable.value;
603
+ const { proxyConfig } = props;
604
+ if (!$xeTable) {
605
+ return;
606
+ }
607
+ const { computeFilterOpts } = $xeTable.getComputeMaps();
608
+ const proxyOpts = computeProxyOpts.value;
609
+ const filterOpts = computeFilterOpts.value;
610
+ if (filterOpts.remote) {
611
+ reactData.filterData = params.filterList;
612
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
613
+ reactData.tablePage.currentPage = 1;
614
+ internalData.uFoot = true;
615
+ $xeGrid.commitProxy("query").then((rest) => {
616
+ $xeGrid.dispatchEvent("proxy-query", rest, params.$event);
617
+ });
618
+ internalData.uFoot = false;
619
+ updateQueryFooter();
549
620
  }
550
621
  }
551
- } else {
552
- if (selectRecords.length) {
553
- callback();
622
+ };
623
+ const filterChangeEvent = (params) => {
624
+ handleFilterEvent(params);
625
+ $xeGrid.dispatchEvent("filter-change", params, params.$event);
626
+ };
627
+ const clearAllFilterEvent = (params) => {
628
+ handleFilterEvent(params);
629
+ $xeGrid.dispatchEvent("clear-all-filter", params, params.$event);
630
+ };
631
+ const submitFormEvent = (params) => {
632
+ const { proxyConfig } = props;
633
+ const proxyOpts = computeProxyOpts.value;
634
+ const formOptions = proxyOpts.formOptions || {};
635
+ if (reactData.tableLoading) {
636
+ return;
554
637
  }
555
- }
556
- return Promise.resolve();
557
- };
558
- const pageChangeEvent = (params) => {
559
- const { proxyConfig } = props;
560
- const { tablePage } = reactData;
561
- const { $event, currentPage, pageSize } = params;
562
- const proxyOpts = computeProxyOpts.value;
563
- tablePage.currentPage = currentPage;
564
- tablePage.pageSize = pageSize;
565
- $xeGrid.dispatchEvent("page-change", params, $event);
566
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
567
- $xeGrid.commitProxy("query").then((rest) => {
568
- $xeGrid.dispatchEvent("proxy-query", rest, $event);
569
- });
570
- }
571
- };
572
- const handleSortEvent = (params) => {
573
- const $xeTable = refTable.value;
574
- const { proxyConfig } = props;
575
- if (!$xeTable) {
576
- return;
577
- }
578
- const { computeSortOpts } = $xeTable.getComputeMaps();
579
- const proxyOpts = computeProxyOpts.value;
580
- const sortOpts = computeSortOpts.value;
581
- if (sortOpts.remote) {
582
- reactData.sortData = params.sortList;
583
638
  if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
584
- reactData.tablePage.currentPage = 1;
585
- $xeGrid.commitProxy("query").then((rest) => {
586
- $xeGrid.dispatchEvent("proxy-query", rest, params.$event);
639
+ $xeGrid.dispatchEvent("form-submit", params, params.$event);
640
+ internalData.uFoot = true;
641
+ $xeGrid.commitProxy(formOptions.submitMode || "reload").then((rest) => {
642
+ $xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, params.$event);
587
643
  });
644
+ internalData.uFoot = false;
645
+ updateQueryFooter();
646
+ } else {
647
+ $xeGrid.dispatchEvent("form-submit", params, params.$event);
588
648
  }
589
- }
590
- };
591
- const sortChangeEvent = (params) => {
592
- handleSortEvent(params);
593
- $xeGrid.dispatchEvent("sort-change", params, params.$event);
594
- };
595
- const clearAllSortEvent = (params) => {
596
- handleSortEvent(params);
597
- $xeGrid.dispatchEvent("clear-all-sort", params, params.$event);
598
- };
599
- const handleFilterEvent = (params) => {
600
- const $xeTable = refTable.value;
601
- const { proxyConfig } = props;
602
- if (!$xeTable) {
603
- return;
604
- }
605
- const { computeFilterOpts } = $xeTable.getComputeMaps();
606
- const proxyOpts = computeProxyOpts.value;
607
- const filterOpts = computeFilterOpts.value;
608
- if (filterOpts.remote) {
609
- reactData.filterData = params.filterList;
649
+ };
650
+ const resetFormEvent = (params) => {
651
+ const $xeTable = refTable.value;
652
+ const { proxyConfig } = props;
653
+ const { $event } = params;
654
+ const proxyOpts = computeProxyOpts.value;
610
655
  if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
611
- reactData.tablePage.currentPage = 1;
656
+ const formOptions = proxyOpts.formOptions || {};
657
+ $xeGrid.dispatchEvent("form-reset", params, $event);
658
+ if ($xeTable) {
659
+ $xeTable.clearScroll();
660
+ }
612
661
  internalData.uFoot = true;
613
- $xeGrid.commitProxy("query").then((rest) => {
614
- $xeGrid.dispatchEvent("proxy-query", rest, params.$event);
662
+ $xeGrid.commitProxy(formOptions.resetMode === "reset_form" ? "query" : "reload").then((rest) => {
663
+ $xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, $event);
615
664
  });
616
665
  internalData.uFoot = false;
617
666
  updateQueryFooter();
667
+ } else {
668
+ $xeGrid.dispatchEvent("form-reset", params, $event);
618
669
  }
619
- }
620
- };
621
- const filterChangeEvent = (params) => {
622
- handleFilterEvent(params);
623
- $xeGrid.dispatchEvent("filter-change", params, params.$event);
624
- };
625
- const clearAllFilterEvent = (params) => {
626
- handleFilterEvent(params);
627
- $xeGrid.dispatchEvent("clear-all-filter", params, params.$event);
628
- };
629
- const submitFormEvent = (params) => {
630
- const { proxyConfig } = props;
631
- const proxyOpts = computeProxyOpts.value;
632
- const formOptions = proxyOpts.formOptions || {};
633
- if (reactData.tableLoading) {
634
- return;
635
- }
636
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
637
- $xeGrid.dispatchEvent("form-submit", params, params.$event);
638
- internalData.uFoot = true;
639
- $xeGrid.commitProxy(formOptions.submitMode || "reload").then((rest) => {
640
- $xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, params.$event);
641
- });
642
- internalData.uFoot = false;
643
- updateQueryFooter();
644
- } else {
645
- $xeGrid.dispatchEvent("form-submit", params, params.$event);
646
- }
647
- };
648
- const resetFormEvent = (params) => {
649
- const $xeTable = refTable.value;
650
- const { proxyConfig } = props;
651
- const { $event } = params;
652
- const proxyOpts = computeProxyOpts.value;
653
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
654
- const formOptions = proxyOpts.formOptions || {};
655
- $xeGrid.dispatchEvent("form-reset", params, $event);
656
- if ($xeTable) {
657
- $xeTable.clearScroll();
658
- }
659
- internalData.uFoot = true;
660
- $xeGrid.commitProxy(formOptions.resetMode === "reset_form" ? "query" : "reload").then((rest) => {
661
- $xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, $event);
662
- });
663
- internalData.uFoot = false;
664
- updateQueryFooter();
665
- } else {
666
- $xeGrid.dispatchEvent("form-reset", params, $event);
667
- }
668
- };
669
- const submitInvalidEvent = (params) => {
670
- $xeGrid.dispatchEvent("form-submit-invalid", params, params.$event);
671
- };
672
- const collapseEvent = (params) => {
673
- const { $event } = params;
674
- $xeGrid.dispatchEvent("form-toggle-collapse", params, $event);
675
- $xeGrid.dispatchEvent("form-collapse", params, $event);
676
- };
677
- const handleZoom = (isMax) => {
678
- const { isZMax } = reactData;
679
- if (isMax ? !isZMax : isZMax) {
680
- reactData.isZMax = !isZMax;
681
- if (reactData.tZindex < (0, import_utils.getLastZIndex)()) {
682
- reactData.tZindex = (0, import_utils.nextZIndex)();
683
- }
684
- }
685
- return (0, import_vue.nextTick)().then(() => $xeGrid.recalculate(true)).then(() => {
686
- setTimeout(() => $xeGrid.recalculate(true), 15);
687
- return reactData.isZMax;
688
- });
689
- };
690
- const getFuncSlot = (optSlots, slotKey) => {
691
- const funcSlot = optSlots[slotKey];
692
- if (funcSlot) {
693
- if (import_xe_utils.default.isString(funcSlot)) {
694
- if (slots[funcSlot]) {
695
- return slots[funcSlot];
696
- } else {
697
- errLog("vxe.error.notSlot", [funcSlot]);
670
+ };
671
+ const submitInvalidEvent = (params) => {
672
+ $xeGrid.dispatchEvent("form-submit-invalid", params, params.$event);
673
+ };
674
+ const collapseEvent = (params) => {
675
+ const { $event } = params;
676
+ $xeGrid.dispatchEvent("form-toggle-collapse", params, $event);
677
+ $xeGrid.dispatchEvent("form-collapse", params, $event);
678
+ };
679
+ const handleZoom = (isMax) => {
680
+ const { isZMax } = reactData;
681
+ if (isMax ? !isZMax : isZMax) {
682
+ reactData.isZMax = !isZMax;
683
+ if (reactData.tZindex < (0, import_utils.getLastZIndex)()) {
684
+ reactData.tZindex = (0, import_utils.nextZIndex)();
698
685
  }
699
- } else {
700
- return funcSlot;
701
686
  }
702
- }
703
- return null;
704
- };
705
- const getConfigSlot = (slotConfigs) => {
706
- const slotConf = {};
707
- import_xe_utils.default.objectMap(slotConfigs, (slotFunc, slotKey) => {
708
- if (slotFunc) {
709
- if (import_xe_utils.default.isString(slotFunc)) {
710
- if (slots[slotFunc]) {
711
- slotConf[slotKey] = slots[slotFunc];
687
+ return (0, import_vue.nextTick)().then(() => $xeGrid.recalculate(true)).then(() => {
688
+ setTimeout(() => $xeGrid.recalculate(true), 15);
689
+ return reactData.isZMax;
690
+ });
691
+ };
692
+ const getFuncSlot = (optSlots, slotKey) => {
693
+ const funcSlot = optSlots[slotKey];
694
+ if (funcSlot) {
695
+ if (import_xe_utils.default.isString(funcSlot)) {
696
+ if (slots[funcSlot]) {
697
+ return slots[funcSlot];
712
698
  } else {
713
- errLog("vxe.error.notSlot", [slotFunc]);
699
+ errLog("vxe.error.notSlot", [funcSlot]);
714
700
  }
715
701
  } else {
716
- slotConf[slotKey] = slotFunc;
702
+ return funcSlot;
717
703
  }
718
704
  }
719
- });
720
- return slotConf;
721
- };
722
- const renderForm = () => {
723
- const { formConfig, proxyConfig } = props;
724
- const { formData } = reactData;
725
- const proxyOpts = computeProxyOpts.value;
726
- const formOpts = computeFormOpts.value;
727
- if (formConfig && (0, import_utils.isEnableConf)(formOpts) || slots.form) {
728
- let slotVNs = [];
729
- if (slots.form) {
730
- slotVNs = slots.form({ $grid: $xeGrid, $gantt: null });
731
- } else {
732
- if (formOpts.items) {
733
- const formSlots = {};
734
- if (!formOpts.inited) {
735
- ;
736
- formOpts.inited = true;
737
- const beforeItem = proxyOpts.beforeItem;
738
- if (proxyOpts && beforeItem) {
739
- formOpts.items.forEach((item) => {
740
- beforeItem({ $grid: $xeGrid, $gantt: null, item });
741
- });
705
+ return null;
706
+ };
707
+ const getConfigSlot = (slotConfigs) => {
708
+ const slotConf = {};
709
+ import_xe_utils.default.objectMap(slotConfigs, (slotFunc, slotKey) => {
710
+ if (slotFunc) {
711
+ if (import_xe_utils.default.isString(slotFunc)) {
712
+ if (slots[slotFunc]) {
713
+ slotConf[slotKey] = slots[slotFunc];
714
+ } else {
715
+ errLog("vxe.error.notSlot", [slotFunc]);
742
716
  }
717
+ } else {
718
+ slotConf[slotKey] = slotFunc;
743
719
  }
744
- formOpts.items.forEach((item) => {
745
- import_xe_utils.default.each(item.slots, (func) => {
746
- if (func && !import_xe_utils.default.isFunction(func)) {
747
- if (slots[func]) {
748
- formSlots[func] = slots[func];
749
- }
720
+ }
721
+ });
722
+ return slotConf;
723
+ };
724
+ const renderForm = () => {
725
+ const { formConfig, proxyConfig } = props;
726
+ const { formData } = reactData;
727
+ const proxyOpts = computeProxyOpts.value;
728
+ const formOpts = computeFormOpts.value;
729
+ if (formConfig && (0, import_utils.isEnableConf)(formOpts) || slots.form) {
730
+ let slotVNs = [];
731
+ if (slots.form) {
732
+ slotVNs = slots.form({ $grid: $xeGrid, $gantt: null });
733
+ } else {
734
+ if (formOpts.items) {
735
+ const formSlots = {};
736
+ if (!formOpts.inited) {
737
+ ;
738
+ formOpts.inited = true;
739
+ const beforeItem = proxyOpts.beforeItem;
740
+ if (proxyOpts && beforeItem) {
741
+ formOpts.items.forEach((item) => {
742
+ beforeItem({ $grid: $xeGrid, $gantt: null, item });
743
+ });
750
744
  }
745
+ }
746
+ formOpts.items.forEach((item) => {
747
+ import_xe_utils.default.each(item.slots, (func) => {
748
+ if (func && !import_xe_utils.default.isFunction(func)) {
749
+ if (slots[func]) {
750
+ formSlots[func] = slots[func];
751
+ }
752
+ }
753
+ });
751
754
  });
752
- });
753
- if (VxeUIFormComponent) {
754
- slotVNs.push(
755
- (0, import_vue.h)(
756
- VxeUIFormComponent,
757
- {
758
- ref: refForm,
759
- ...Object.assign({}, formOpts, {
760
- data: proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data
761
- }),
762
- onSubmit: submitFormEvent,
763
- onReset: resetFormEvent,
764
- onSubmitInvalid: submitInvalidEvent,
765
- onCollapse: collapseEvent
766
- },
767
- formSlots
768
- )
769
- );
755
+ if (VxeUIFormComponent) {
756
+ slotVNs.push(
757
+ (0, import_vue.h)(
758
+ VxeUIFormComponent,
759
+ {
760
+ ref: refForm,
761
+ ...Object.assign({}, formOpts, {
762
+ data: proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data
763
+ }),
764
+ onSubmit: submitFormEvent,
765
+ onReset: resetFormEvent,
766
+ onSubmitInvalid: submitInvalidEvent,
767
+ onCollapse: collapseEvent
768
+ },
769
+ formSlots
770
+ )
771
+ );
772
+ }
770
773
  }
771
774
  }
775
+ return (0, import_vue.h)(
776
+ "div",
777
+ {
778
+ ref: refFormWrapper,
779
+ key: "form",
780
+ class: "vxe-grid--form-wrapper"
781
+ },
782
+ slotVNs
783
+ );
772
784
  }
773
- return (0, import_vue.h)(
774
- "div",
775
- {
776
- ref: refFormWrapper,
777
- key: "form",
778
- class: "vxe-grid--form-wrapper"
779
- },
780
- slotVNs
781
- );
782
- }
783
- return renderEmptyElement($xeGrid);
784
- };
785
- const renderToolbar = () => {
786
- const { toolbarConfig } = props;
787
- const toolbarOpts = computeToolbarOpts.value;
788
- const toolbarSlot = slots.toolbar;
789
- if (toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) || toolbarSlot) {
790
- let slotVNs = [];
791
- if (toolbarSlot) {
792
- slotVNs = toolbarSlot({ $grid: $xeGrid, $gantt: null });
793
- } else {
794
- const toolbarOptSlots = toolbarOpts.slots;
795
- const toolbarSlots = {};
796
- if (toolbarOptSlots) {
797
- const buttonsSlot = getFuncSlot(toolbarOptSlots, "buttons");
798
- const buttonPrefixSlot = getFuncSlot(toolbarOptSlots, "buttonPrefix");
799
- const buttonSuffixSlot = getFuncSlot(toolbarOptSlots, "buttonSuffix");
800
- const toolsSlot = getFuncSlot(toolbarOptSlots, "tools");
801
- const toolPrefixSlot = getFuncSlot(toolbarOptSlots, "toolPrefix");
802
- const toolSuffixSlot = getFuncSlot(toolbarOptSlots, "toolSuffix");
803
- if (buttonsSlot) {
804
- toolbarSlots.buttons = buttonsSlot;
805
- }
806
- if (buttonPrefixSlot) {
807
- toolbarSlots.buttonPrefix = buttonPrefixSlot;
808
- }
809
- if (buttonSuffixSlot) {
810
- toolbarSlots.buttonSuffix = buttonSuffixSlot;
811
- }
812
- if (toolsSlot) {
813
- toolbarSlots.tools = toolsSlot;
814
- }
815
- if (toolPrefixSlot) {
816
- toolbarSlots.toolPrefix = toolPrefixSlot;
817
- }
818
- if (toolSuffixSlot) {
819
- toolbarSlots.toolSuffix = toolSuffixSlot;
785
+ return renderEmptyElement($xeGrid);
786
+ };
787
+ const renderToolbar = () => {
788
+ const { toolbarConfig } = props;
789
+ const toolbarOpts = computeToolbarOpts.value;
790
+ const toolbarSlot = slots.toolbar;
791
+ if (toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) || toolbarSlot) {
792
+ let slotVNs = [];
793
+ if (toolbarSlot) {
794
+ slotVNs = toolbarSlot({ $grid: $xeGrid, $gantt: null });
795
+ } else {
796
+ const toolbarOptSlots = toolbarOpts.slots;
797
+ const toolbarSlots = {};
798
+ if (toolbarOptSlots) {
799
+ const buttonsSlot = getFuncSlot(toolbarOptSlots, "buttons");
800
+ const buttonPrefixSlot = getFuncSlot(toolbarOptSlots, "buttonPrefix");
801
+ const buttonSuffixSlot = getFuncSlot(toolbarOptSlots, "buttonSuffix");
802
+ const toolsSlot = getFuncSlot(toolbarOptSlots, "tools");
803
+ const toolPrefixSlot = getFuncSlot(toolbarOptSlots, "toolPrefix");
804
+ const toolSuffixSlot = getFuncSlot(toolbarOptSlots, "toolSuffix");
805
+ if (buttonsSlot) {
806
+ toolbarSlots.buttons = buttonsSlot;
807
+ }
808
+ if (buttonPrefixSlot) {
809
+ toolbarSlots.buttonPrefix = buttonPrefixSlot;
810
+ }
811
+ if (buttonSuffixSlot) {
812
+ toolbarSlots.buttonSuffix = buttonSuffixSlot;
813
+ }
814
+ if (toolsSlot) {
815
+ toolbarSlots.tools = toolsSlot;
816
+ }
817
+ if (toolPrefixSlot) {
818
+ toolbarSlots.toolPrefix = toolPrefixSlot;
819
+ }
820
+ if (toolSuffixSlot) {
821
+ toolbarSlots.toolSuffix = toolSuffixSlot;
822
+ }
820
823
  }
824
+ slotVNs.push(
825
+ (0, import_vue.h)(
826
+ import_toolbar.default,
827
+ {
828
+ ref: refToolbar,
829
+ ...toolbarOpts,
830
+ slots: void 0
831
+ },
832
+ toolbarSlots
833
+ )
834
+ );
821
835
  }
822
- slotVNs.push(
823
- (0, import_vue.h)(
824
- import_toolbar.default,
825
- {
826
- ref: refToolbar,
827
- ...toolbarOpts,
828
- slots: void 0
829
- },
830
- toolbarSlots
831
- )
836
+ return (0, import_vue.h)(
837
+ "div",
838
+ {
839
+ ref: refToolbarWrapper,
840
+ key: "toolbar",
841
+ class: "vxe-grid--toolbar-wrapper"
842
+ },
843
+ slotVNs
832
844
  );
833
845
  }
834
- return (0, import_vue.h)(
835
- "div",
836
- {
837
- ref: refToolbarWrapper,
838
- key: "toolbar",
839
- class: "vxe-grid--toolbar-wrapper"
840
- },
841
- slotVNs
842
- );
843
- }
844
- return renderEmptyElement($xeGrid);
845
- };
846
- const renderTop = () => {
847
- const topSlot = slots.top;
848
- if (topSlot) {
849
- return (0, import_vue.h)(
850
- "div",
851
- {
852
- ref: refTopWrapper,
853
- key: "top",
854
- class: "vxe-grid--top-wrapper"
855
- },
856
- topSlot({ $grid: $xeGrid, $gantt: null })
857
- );
858
- }
859
- return renderEmptyElement($xeGrid);
860
- };
861
- const renderTableLeft = () => {
862
- const leftSlot = slots.left;
863
- if (leftSlot) {
864
- return (0, import_vue.h)(
865
- "div",
866
- {
867
- class: "vxe-grid--left-wrapper"
868
- },
869
- leftSlot({ $grid: $xeGrid, $gantt: null })
870
- );
871
- }
872
- return renderEmptyElement($xeGrid);
873
- };
874
- const renderTableRight = () => {
875
- const rightSlot = slots.right;
876
- if (rightSlot) {
877
- return (0, import_vue.h)(
878
- "div",
879
- {
880
- class: "vxe-grid--right-wrapper"
881
- },
882
- rightSlot({ $grid: $xeGrid, $gantt: null })
883
- );
884
- }
885
- return renderEmptyElement($xeGrid);
886
- };
887
- const renderTable = () => {
888
- const { proxyConfig } = props;
889
- const tableProps2 = computeTableProps.value;
890
- const proxyOpts = computeProxyOpts.value;
891
- const tableOns = Object.assign({}, tableCompEvents);
892
- const emptySlot = slots.empty;
893
- const loadingSlot = slots.loading;
894
- const rowDragIconSlot = slots.rowDragIcon || slots["row-drag-icon"];
895
- const columnDragIconSlot = slots.columnDragIcon || slots["column-drag-icon"];
896
- const headerTooltipSlot = slots.headerTooltip || slots["header-tooltip"];
897
- const tooltipSlot = slots.tooltip;
898
- const footerTooltipSlot = slots.footerTooltip || slots["footer-tooltip"];
899
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
900
- if (proxyOpts.sort) {
901
- tableOns.onSortChange = sortChangeEvent;
902
- tableOns.onClearAllSort = clearAllSortEvent;
846
+ return renderEmptyElement($xeGrid);
847
+ };
848
+ const renderTop = () => {
849
+ const topSlot = slots.top;
850
+ if (topSlot) {
851
+ return (0, import_vue.h)(
852
+ "div",
853
+ {
854
+ ref: refTopWrapper,
855
+ key: "top",
856
+ class: "vxe-grid--top-wrapper"
857
+ },
858
+ topSlot({ $grid: $xeGrid, $gantt: null })
859
+ );
903
860
  }
904
- if (proxyOpts.filter) {
905
- tableOns.onFilterChange = filterChangeEvent;
906
- tableOns.onClearAllFilter = clearAllFilterEvent;
861
+ return renderEmptyElement($xeGrid);
862
+ };
863
+ const renderTableLeft = () => {
864
+ const leftSlot = slots.left;
865
+ if (leftSlot) {
866
+ return (0, import_vue.h)(
867
+ "div",
868
+ {
869
+ class: "vxe-grid--left-wrapper"
870
+ },
871
+ leftSlot({ $grid: $xeGrid, $gantt: null })
872
+ );
907
873
  }
908
- }
909
- const slotObj = {};
910
- if (emptySlot) {
911
- slotObj.empty = emptySlot;
912
- }
913
- if (loadingSlot) {
914
- slotObj.loading = loadingSlot;
915
- }
916
- if (rowDragIconSlot) {
917
- slotObj.rowDragIcon = rowDragIconSlot;
918
- }
919
- if (columnDragIconSlot) {
920
- slotObj.columnDragIcon = columnDragIconSlot;
921
- }
922
- if (headerTooltipSlot) {
923
- slotObj.headerTooltip = headerTooltipSlot;
924
- }
925
- if (tooltipSlot) {
926
- slotObj.tooltip = tooltipSlot;
927
- }
928
- if (footerTooltipSlot) {
929
- slotObj.footerTooltip = footerTooltipSlot;
930
- }
931
- return (0, import_vue.h)(
932
- "div",
933
- {
934
- class: "vxe-grid--table-wrapper"
935
- },
936
- [
937
- (0, import_vue.h)(
938
- import_table.default,
874
+ return renderEmptyElement($xeGrid);
875
+ };
876
+ const renderTableRight = () => {
877
+ const rightSlot = slots.right;
878
+ if (rightSlot) {
879
+ return (0, import_vue.h)(
880
+ "div",
939
881
  {
940
- ref: refTable,
941
- ...tableProps2,
942
- ...tableOns
882
+ class: "vxe-grid--right-wrapper"
943
883
  },
944
- slotObj
945
- )
946
- ]
947
- );
948
- };
949
- const renderBottom = () => {
950
- if (slots.bottom) {
884
+ rightSlot({ $grid: $xeGrid, $gantt: null })
885
+ );
886
+ }
887
+ return renderEmptyElement($xeGrid);
888
+ };
889
+ const renderTable = () => {
890
+ const { proxyConfig } = props;
891
+ const tableProps2 = computeTableProps.value;
892
+ const proxyOpts = computeProxyOpts.value;
893
+ const tableOns = Object.assign({}, tableCompEvents);
894
+ const emptySlot = slots.empty;
895
+ const loadingSlot = slots.loading;
896
+ const rowDragIconSlot = slots.rowDragIcon || slots["row-drag-icon"];
897
+ const columnDragIconSlot = slots.columnDragIcon || slots["column-drag-icon"];
898
+ const headerTooltipSlot = slots.headerTooltip || slots["header-tooltip"];
899
+ const tooltipSlot = slots.tooltip;
900
+ const footerTooltipSlot = slots.footerTooltip || slots["footer-tooltip"];
901
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
902
+ if (proxyOpts.sort) {
903
+ tableOns.onSortChange = sortChangeEvent;
904
+ tableOns.onClearAllSort = clearAllSortEvent;
905
+ }
906
+ if (proxyOpts.filter) {
907
+ tableOns.onFilterChange = filterChangeEvent;
908
+ tableOns.onClearAllFilter = clearAllFilterEvent;
909
+ }
910
+ }
911
+ const slotObj = {};
912
+ if (emptySlot) {
913
+ slotObj.empty = emptySlot;
914
+ }
915
+ if (loadingSlot) {
916
+ slotObj.loading = loadingSlot;
917
+ }
918
+ if (rowDragIconSlot) {
919
+ slotObj.rowDragIcon = rowDragIconSlot;
920
+ }
921
+ if (columnDragIconSlot) {
922
+ slotObj.columnDragIcon = columnDragIconSlot;
923
+ }
924
+ if (headerTooltipSlot) {
925
+ slotObj.headerTooltip = headerTooltipSlot;
926
+ }
927
+ if (tooltipSlot) {
928
+ slotObj.tooltip = tooltipSlot;
929
+ }
930
+ if (footerTooltipSlot) {
931
+ slotObj.footerTooltip = footerTooltipSlot;
932
+ }
951
933
  return (0, import_vue.h)(
952
934
  "div",
953
935
  {
954
- ref: refBottomWrapper,
955
- key: "bottom",
956
- class: "vxe-grid--bottom-wrapper"
936
+ class: "vxe-grid--table-wrapper"
957
937
  },
958
- slots.bottom({ $grid: $xeGrid, $gantt: null })
959
- );
960
- }
961
- return renderEmptyElement($xeGrid);
962
- };
963
- const renderPager = () => {
964
- const { proxyConfig, pagerConfig } = props;
965
- const proxyOpts = computeProxyOpts.value;
966
- const pagerOpts = computePagerOpts.value;
967
- const pagerProps = computePagerProps.value;
968
- const pagerSlot = slots.pager;
969
- if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts) || slots.pager) {
970
- return (0, import_vue.h)(
971
- "div",
972
- {
973
- ref: refPagerWrapper,
974
- key: "pager",
975
- class: "vxe-grid--pager-wrapper"
976
- },
977
- pagerSlot ? pagerSlot({ $grid: $xeGrid, $gantt: null }) : [
978
- VxeUIPagerComponent ? (0, import_vue.h)(
979
- VxeUIPagerComponent,
938
+ [
939
+ (0, import_vue.h)(
940
+ import_table.default,
980
941
  {
981
- ref: refPager,
982
- ...pagerProps,
983
- ...proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) ? reactData.tablePage : {},
984
- onPageChange: pageChangeEvent
942
+ ref: refTable,
943
+ ...tableProps2,
944
+ ...tableOns
985
945
  },
986
- getConfigSlot(pagerOpts.slots)
987
- ) : renderEmptyElement($xeGrid)
946
+ slotObj
947
+ )
988
948
  ]
989
949
  );
990
- }
991
- return renderEmptyElement($xeGrid);
992
- };
993
- const renderChildLayout = (layoutKeys) => {
994
- const childVNs = [];
995
- layoutKeys.forEach((key) => {
996
- switch (key) {
997
- case "Form":
998
- childVNs.push(renderForm());
999
- break;
1000
- case "Toolbar":
1001
- childVNs.push(renderToolbar());
1002
- break;
1003
- case "Top":
1004
- childVNs.push(renderTop());
1005
- break;
1006
- case "Table":
1007
- childVNs.push(
950
+ };
951
+ const renderBottom = () => {
952
+ if (slots.bottom) {
953
+ return (0, import_vue.h)(
954
+ "div",
955
+ {
956
+ ref: refBottomWrapper,
957
+ key: "bottom",
958
+ class: "vxe-grid--bottom-wrapper"
959
+ },
960
+ slots.bottom({ $grid: $xeGrid, $gantt: null })
961
+ );
962
+ }
963
+ return renderEmptyElement($xeGrid);
964
+ };
965
+ const renderPager = () => {
966
+ const { proxyConfig, pagerConfig } = props;
967
+ const proxyOpts = computeProxyOpts.value;
968
+ const pagerOpts = computePagerOpts.value;
969
+ const pagerProps = computePagerProps.value;
970
+ const pagerSlot = slots.pager;
971
+ if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts) || slots.pager) {
972
+ return (0, import_vue.h)(
973
+ "div",
974
+ {
975
+ ref: refPagerWrapper,
976
+ key: "pager",
977
+ class: "vxe-grid--pager-wrapper"
978
+ },
979
+ pagerSlot ? pagerSlot({ $grid: $xeGrid, $gantt: null }) : [
980
+ VxeUIPagerComponent ? (0, import_vue.h)(
981
+ VxeUIPagerComponent,
982
+ {
983
+ ref: refPager,
984
+ ...pagerProps,
985
+ ...proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) ? reactData.tablePage : {},
986
+ onPageChange: pageChangeEvent
987
+ },
988
+ getConfigSlot(pagerOpts.slots)
989
+ ) : renderEmptyElement($xeGrid)
990
+ ]
991
+ );
992
+ }
993
+ return renderEmptyElement($xeGrid);
994
+ };
995
+ const renderChildLayout = (layoutKeys) => {
996
+ const childVNs = [];
997
+ layoutKeys.forEach((key) => {
998
+ switch (key) {
999
+ case "Form":
1000
+ childVNs.push(renderForm());
1001
+ break;
1002
+ case "Toolbar":
1003
+ childVNs.push(renderToolbar());
1004
+ break;
1005
+ case "Top":
1006
+ childVNs.push(renderTop());
1007
+ break;
1008
+ case "Table":
1009
+ childVNs.push(
1010
+ (0, import_vue.h)(
1011
+ "div",
1012
+ {
1013
+ key: "table",
1014
+ class: "vxe-grid--table-container"
1015
+ },
1016
+ [renderTableLeft(), renderTable(), renderTableRight()]
1017
+ )
1018
+ );
1019
+ break;
1020
+ case "Bottom":
1021
+ childVNs.push(renderBottom());
1022
+ break;
1023
+ case "Pager":
1024
+ childVNs.push(renderPager());
1025
+ break;
1026
+ default:
1027
+ errLog("vxe.error.notProp", [`layouts -> ${key}`]);
1028
+ break;
1029
+ }
1030
+ });
1031
+ return childVNs;
1032
+ };
1033
+ const renderLayout = () => {
1034
+ const currLayoutConf = computeCurrLayoutConf.value;
1035
+ const { headKeys, bodyKeys, footKeys } = currLayoutConf;
1036
+ const asideLeftSlot = slots.asideLeft || slots["aside-left"];
1037
+ const asideRightSlot = slots.asideRight || slots["aside-right"];
1038
+ return [
1039
+ (0, import_vue.h)(
1040
+ "div",
1041
+ {
1042
+ class: "vxe-grid--layout-header-wrapper"
1043
+ },
1044
+ renderChildLayout(headKeys)
1045
+ ),
1046
+ (0, import_vue.h)(
1047
+ "div",
1048
+ {
1049
+ class: "vxe-grid--layout-body-wrapper"
1050
+ },
1051
+ [
1052
+ asideLeftSlot ? (0, import_vue.h)(
1053
+ "div",
1054
+ {
1055
+ class: "vxe-grid--layout-aside-left-wrapper"
1056
+ },
1057
+ asideLeftSlot({})
1058
+ ) : renderEmptyElement($xeGrid),
1008
1059
  (0, import_vue.h)(
1009
1060
  "div",
1010
1061
  {
1011
- key: "table",
1012
- class: "vxe-grid--table-container"
1062
+ class: "vxe-grid--layout-body-content-wrapper"
1013
1063
  },
1014
- [renderTableLeft(), renderTable(), renderTableRight()]
1015
- )
1016
- );
1017
- break;
1018
- case "Bottom":
1019
- childVNs.push(renderBottom());
1020
- break;
1021
- case "Pager":
1022
- childVNs.push(renderPager());
1023
- break;
1024
- default:
1025
- errLog("vxe.error.notProp", [`layouts -> ${key}`]);
1026
- break;
1027
- }
1064
+ renderChildLayout(bodyKeys)
1065
+ ),
1066
+ asideRightSlot ? (0, import_vue.h)(
1067
+ "div",
1068
+ {
1069
+ class: "vxe-grid--layout-aside-right-wrapper"
1070
+ },
1071
+ asideRightSlot({})
1072
+ ) : renderEmptyElement($xeGrid)
1073
+ ]
1074
+ ),
1075
+ (0, import_vue.h)(
1076
+ "div",
1077
+ {
1078
+ class: "vxe-grid--layout-footer-wrapper"
1079
+ },
1080
+ renderChildLayout(footKeys)
1081
+ ),
1082
+ (0, import_vue.h)("div", {
1083
+ ref: refPopupContainerElem
1084
+ })
1085
+ ];
1086
+ };
1087
+ const tableCompEvents = {};
1088
+ import_emits2.tableEmits.forEach((name) => {
1089
+ const type = import_xe_utils.default.camelCase(`on-${name}`);
1090
+ tableCompEvents[type] = (...args) => emit(name, ...args);
1028
1091
  });
1029
- return childVNs;
1030
- };
1031
- const renderLayout = () => {
1032
- const currLayoutConf = computeCurrLayoutConf.value;
1033
- const { headKeys, bodyKeys, footKeys } = currLayoutConf;
1034
- const asideLeftSlot = slots.asideLeft || slots["aside-left"];
1035
- const asideRightSlot = slots.asideRight || slots["aside-right"];
1036
- return [
1037
- (0, import_vue.h)(
1038
- "div",
1039
- {
1040
- class: "vxe-grid--layout-header-wrapper"
1041
- },
1042
- renderChildLayout(headKeys)
1043
- ),
1044
- (0, import_vue.h)(
1045
- "div",
1046
- {
1047
- class: "vxe-grid--layout-body-wrapper"
1048
- },
1049
- [
1050
- asideLeftSlot ? (0, import_vue.h)(
1051
- "div",
1052
- {
1053
- class: "vxe-grid--layout-aside-left-wrapper"
1054
- },
1055
- asideLeftSlot({})
1056
- ) : renderEmptyElement($xeGrid),
1057
- (0, import_vue.h)(
1058
- "div",
1059
- {
1060
- class: "vxe-grid--layout-body-content-wrapper"
1061
- },
1062
- renderChildLayout(bodyKeys)
1063
- ),
1064
- asideRightSlot ? (0, import_vue.h)(
1065
- "div",
1066
- {
1067
- class: "vxe-grid--layout-aside-right-wrapper"
1068
- },
1069
- asideRightSlot({})
1070
- ) : renderEmptyElement($xeGrid)
1071
- ]
1072
- ),
1073
- (0, import_vue.h)(
1074
- "div",
1075
- {
1076
- class: "vxe-grid--layout-footer-wrapper"
1077
- },
1078
- renderChildLayout(footKeys)
1079
- ),
1080
- (0, import_vue.h)("div", {
1081
- ref: refPopupContainerElem
1082
- })
1083
- ];
1084
- };
1085
- const tableCompEvents = {};
1086
- import_emits2.tableEmits.forEach((name) => {
1087
- const type = import_xe_utils.default.camelCase(`on-${name}`);
1088
- tableCompEvents[type] = (...args) => emit(name, ...args);
1089
- });
1090
- const getDefaultFormData = () => {
1091
- const formOpts = computeFormOpts.value;
1092
- if (formOpts.items) {
1093
- const fData = {};
1094
- formOpts.items.forEach((item) => {
1095
- const { field, itemRender } = item;
1096
- if (field) {
1097
- let itemValue = null;
1098
- if (itemRender) {
1099
- const { startField, endField, defaultValue } = itemRender;
1100
- if (import_xe_utils.default.isFunction(defaultValue)) {
1101
- itemValue = defaultValue({ item });
1102
- } else if (!import_xe_utils.default.isUndefined(defaultValue)) {
1103
- itemValue = defaultValue;
1104
- }
1105
- if (startField && endField) {
1106
- import_xe_utils.default.set(fData, startField, null);
1107
- import_xe_utils.default.set(fData, endField, null);
1092
+ const getDefaultFormData = () => {
1093
+ const formOpts = computeFormOpts.value;
1094
+ if (formOpts.items) {
1095
+ const fData = {};
1096
+ formOpts.items.forEach((item) => {
1097
+ const { field, itemRender } = item;
1098
+ if (field) {
1099
+ let itemValue = null;
1100
+ if (itemRender) {
1101
+ const { startField, endField, defaultValue } = itemRender;
1102
+ if (import_xe_utils.default.isFunction(defaultValue)) {
1103
+ itemValue = defaultValue({ item });
1104
+ } else if (!import_xe_utils.default.isUndefined(defaultValue)) {
1105
+ itemValue = defaultValue;
1106
+ }
1107
+ if (startField && endField) {
1108
+ import_xe_utils.default.set(fData, startField, null);
1109
+ import_xe_utils.default.set(fData, endField, null);
1110
+ }
1108
1111
  }
1112
+ fData[field] = itemValue;
1109
1113
  }
1110
- fData[field] = itemValue;
1111
- }
1112
- });
1113
- return fData;
1114
- }
1115
- return {};
1116
- };
1117
- const initProxy = () => {
1118
- const { proxyConfig, formConfig } = props;
1119
- const { proxyInited } = reactData;
1120
- const proxyOpts = computeProxyOpts.value;
1121
- const formOpts = computeFormOpts.value;
1122
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
1123
- if (formConfig && (0, import_utils.isEnableConf)(formOpts) && proxyOpts.form && formOpts.items) {
1124
- reactData.formData = getDefaultFormData();
1114
+ });
1115
+ return fData;
1125
1116
  }
1126
- if (!proxyInited) {
1127
- reactData.proxyInited = true;
1128
- if (proxyOpts.autoLoad !== false) {
1129
- (0, import_vue.nextTick)().then(() => {
1130
- internalData.uFoot = true;
1131
- const rest = $xeGrid.commitProxy("initial");
1132
- internalData.uFoot = false;
1133
- updateQueryFooter();
1134
- return rest;
1135
- }).then((rest) => {
1136
- dispatchEvent("proxy-query", { ...rest, isInited: true }, new Event("initial"));
1137
- });
1117
+ return {};
1118
+ };
1119
+ const initProxy = () => {
1120
+ const { proxyConfig, formConfig } = props;
1121
+ const { proxyInited } = reactData;
1122
+ const proxyOpts = computeProxyOpts.value;
1123
+ const formOpts = computeFormOpts.value;
1124
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
1125
+ if (formConfig && (0, import_utils.isEnableConf)(formOpts) && proxyOpts.form && formOpts.items) {
1126
+ reactData.formData = getDefaultFormData();
1127
+ }
1128
+ if (!proxyInited) {
1129
+ reactData.proxyInited = true;
1130
+ if (proxyOpts.autoLoad !== false) {
1131
+ (0, import_vue.nextTick)().then(() => {
1132
+ internalData.uFoot = true;
1133
+ const rest = $xeGrid.commitProxy("initial");
1134
+ internalData.uFoot = false;
1135
+ updateQueryFooter();
1136
+ return rest;
1137
+ }).then((rest) => {
1138
+ dispatchEvent("proxy-query", { ...rest, isInited: true }, new Event("initial"));
1139
+ });
1140
+ }
1138
1141
  }
1139
1142
  }
1140
- }
1141
- };
1142
- const updateQueryFooter = () => {
1143
- const proxyOpts = computeProxyOpts.value;
1144
- const { ajax } = proxyOpts;
1145
- if (ajax && ajax.queryFooter) {
1146
- return $xeGrid.commitProxy("queryFooter");
1147
- }
1148
- };
1149
- const handleGlobalKeydownEvent = (evnt) => {
1150
- const zoomOpts = computeZoomOpts.value;
1151
- const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
1152
- if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
1153
- $xeGrid.triggerZoomEvent(evnt);
1154
- }
1155
- };
1156
- const dispatchEvent = (type, params, evnt) => {
1157
- emit(type, createEvent(evnt, { $grid: $xeGrid, $gantt: null }, params));
1158
- };
1159
- const gridMethods = {
1160
- dispatchEvent,
1161
- getEl() {
1162
- return refElem.value;
1163
- },
1164
- /**
1165
- * 提交指令,支持 code 或 button
1166
- * @param {String/Object} code 字符串或对象
1167
- */
1168
- commitProxy(proxyTarget, ...args) {
1169
- const { showFooter, proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props;
1170
- const { tablePage } = reactData;
1171
- const isActiveMsg = computeIsActiveMsg.value;
1172
- const isRespMsg = computeIsRespMsg.value;
1143
+ };
1144
+ const updateQueryFooter = () => {
1173
1145
  const proxyOpts = computeProxyOpts.value;
1174
- const pagerOpts = computePagerOpts.value;
1175
- const toolbarOpts = computeToolbarOpts.value;
1176
- const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
1177
- const resConfigs = proxyOpts.response || proxyOpts.props || {};
1178
- const $xeTable = refTable.value;
1179
- if (!$xeTable) {
1180
- return (0, import_vue.nextTick)();
1146
+ const { ajax } = proxyOpts;
1147
+ if (ajax && ajax.queryFooter) {
1148
+ return $xeGrid.commitProxy("queryFooter");
1181
1149
  }
1182
- let formData = getFormData();
1183
- let button = null;
1184
- let code = null;
1185
- if (import_xe_utils.default.isString(proxyTarget)) {
1186
- const { buttons } = toolbarOpts;
1187
- const matchObj = toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) && buttons ? import_xe_utils.default.findTree(buttons, (item) => item.code === proxyTarget, { children: "dropdowns" }) : null;
1188
- button = matchObj ? matchObj.item : null;
1189
- code = proxyTarget;
1190
- } else {
1191
- button = proxyTarget;
1192
- code = button.code;
1150
+ };
1151
+ const handleGlobalKeydownEvent = (evnt) => {
1152
+ const zoomOpts = computeZoomOpts.value;
1153
+ const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
1154
+ if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
1155
+ $xeGrid.triggerZoomEvent(evnt);
1193
1156
  }
1194
- const btnParams = button ? button.params : null;
1195
- switch (code) {
1196
- case "insert":
1197
- return $xeTable.insert({});
1198
- case "insert_edit":
1199
- return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
1200
- // 已废弃
1201
- case "insert_actived":
1202
- return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
1203
- // 已废弃
1204
- case "mark_cancel":
1205
- triggerPendingEvent(code);
1206
- break;
1207
- case "remove":
1208
- return handleDeleteRow(code, "vxe.grid.removeSelectRecord", () => $xeTable.removeCheckboxRow());
1209
- case "import":
1210
- $xeTable.importData(btnParams);
1211
- break;
1212
- case "open_import":
1213
- $xeTable.openImport(btnParams);
1214
- break;
1215
- case "export":
1216
- $xeTable.exportData(btnParams);
1217
- break;
1218
- case "open_export":
1219
- $xeTable.openExport(btnParams);
1220
- break;
1221
- case "reset_custom":
1222
- return $xeTable.resetCustom(true);
1223
- case "initial":
1224
- case "reload":
1225
- case "query": {
1226
- const bqMethod = ajax.beforeQuery;
1227
- const qMethod = ajax.query;
1228
- const aqMethod = ajax.afterQuery;
1229
- const qsMethod = ajax.querySuccess;
1230
- const qeMethod = ajax.queryError;
1231
- if (qMethod) {
1232
- const isInited = code === "initial";
1233
- const isReload = code === "reload";
1234
- if (!isInited && reactData.tableLoading) {
1235
- return (0, import_vue.nextTick)();
1236
- }
1237
- let operPromise = null;
1238
- let sortList = [];
1239
- let filterList = [];
1240
- let pageParams = {};
1241
- if (pagerConfig) {
1242
- if (isInited || isReload) {
1243
- tablePage.currentPage = 1;
1244
- }
1245
- if ((0, import_utils.isEnableConf)(pagerOpts)) {
1246
- pageParams = { ...tablePage };
1247
- }
1248
- }
1249
- if (isInited) {
1250
- if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form) {
1251
- formData = getDefaultFormData();
1252
- reactData.formData = formData;
1157
+ };
1158
+ const dispatchEvent = (type, params, evnt) => {
1159
+ emit(type, createEvent(evnt, { $grid: $xeGrid, $gantt: null }, params));
1160
+ };
1161
+ const gridMethods = {
1162
+ dispatchEvent,
1163
+ getEl() {
1164
+ return refElem.value;
1165
+ },
1166
+ /**
1167
+ * 提交指令,支持 code 或 button
1168
+ * @param {String/Object} code 字符串或对象
1169
+ */
1170
+ commitProxy(proxyTarget, ...args) {
1171
+ const { showFooter, proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props;
1172
+ const { tablePage } = reactData;
1173
+ const isActiveMsg = computeIsActiveMsg.value;
1174
+ const isRespMsg = computeIsRespMsg.value;
1175
+ const proxyOpts = computeProxyOpts.value;
1176
+ const pagerOpts = computePagerOpts.value;
1177
+ const toolbarOpts = computeToolbarOpts.value;
1178
+ const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
1179
+ const resConfigs = proxyOpts.response || proxyOpts.props || {};
1180
+ const $xeTable = refTable.value;
1181
+ if (!$xeTable) {
1182
+ return (0, import_vue.nextTick)();
1183
+ }
1184
+ let formData = getFormData();
1185
+ let button = null;
1186
+ let code = null;
1187
+ if (import_xe_utils.default.isString(proxyTarget)) {
1188
+ const { buttons } = toolbarOpts;
1189
+ const matchObj = toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) && buttons ? import_xe_utils.default.findTree(buttons, (item) => item.code === proxyTarget, { children: "dropdowns" }) : null;
1190
+ button = matchObj ? matchObj.item : null;
1191
+ code = proxyTarget;
1192
+ } else {
1193
+ button = proxyTarget;
1194
+ code = button.code;
1195
+ }
1196
+ const btnParams = button ? button.params : null;
1197
+ switch (code) {
1198
+ case "insert":
1199
+ return $xeTable.insert({});
1200
+ case "insert_edit":
1201
+ return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
1202
+ // 已废弃
1203
+ case "insert_actived":
1204
+ return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
1205
+ // 已废弃
1206
+ case "mark_cancel":
1207
+ triggerPendingEvent(code);
1208
+ break;
1209
+ case "remove":
1210
+ return handleDeleteRow(code, "vxe.grid.removeSelectRecord", () => $xeTable.removeCheckboxRow());
1211
+ case "import":
1212
+ $xeTable.importData(btnParams);
1213
+ break;
1214
+ case "open_import":
1215
+ $xeTable.openImport(btnParams);
1216
+ break;
1217
+ case "export":
1218
+ $xeTable.exportData(btnParams);
1219
+ break;
1220
+ case "open_export":
1221
+ $xeTable.openExport(btnParams);
1222
+ break;
1223
+ case "reset_custom":
1224
+ return $xeTable.resetCustom(true);
1225
+ case "initial":
1226
+ case "reload":
1227
+ case "query": {
1228
+ const bqMethod = ajax.beforeQuery;
1229
+ const qMethod = ajax.query;
1230
+ const aqMethod = ajax.afterQuery;
1231
+ const qsMethod = ajax.querySuccess;
1232
+ const qeMethod = ajax.queryError;
1233
+ if (qMethod) {
1234
+ const isInited = code === "initial";
1235
+ const isReload = code === "reload";
1236
+ if (!isInited && reactData.tableLoading) {
1237
+ return (0, import_vue.nextTick)();
1253
1238
  }
1254
- if ($xeTable) {
1255
- const tableInternalData = $xeTable.internalData;
1256
- const { tableFullColumn, fullColumnFieldData } = tableInternalData;
1257
- const { computeSortOpts } = $xeTable.getComputeMaps();
1258
- const sortOpts = computeSortOpts.value;
1259
- let defaultSort = sortOpts.defaultSort;
1260
- tableFullColumn.forEach((column) => {
1261
- column.order = null;
1262
- });
1263
- if (defaultSort) {
1264
- if (!import_xe_utils.default.isArray(defaultSort)) {
1265
- defaultSort = [defaultSort];
1266
- }
1267
- sortList = defaultSort.map((item) => {
1268
- const { field, order } = item;
1269
- const colRest = fullColumnFieldData[field];
1270
- if (colRest) {
1271
- const column = colRest.column;
1272
- if (column) {
1273
- column.order = order;
1274
- }
1275
- }
1276
- return {
1277
- field,
1278
- property: field,
1279
- order
1280
- };
1281
- });
1239
+ let operPromise = null;
1240
+ let sortList = [];
1241
+ let filterList = [];
1242
+ let pageParams = {};
1243
+ if (pagerConfig) {
1244
+ if (isInited || isReload) {
1245
+ tablePage.currentPage = 1;
1246
+ }
1247
+ if ((0, import_utils.isEnableConf)(pagerOpts)) {
1248
+ pageParams = { ...tablePage };
1282
1249
  }
1283
- filterList = $xeTable.getCheckedFilters();
1284
1250
  }
1285
- } else {
1286
- if ($xeTable) {
1287
- if (isReload) {
1288
- operPromise = $xeTable.clearAll();
1289
- } else {
1290
- sortList = $xeTable.getSortColumns();
1251
+ if (isInited) {
1252
+ if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form) {
1253
+ formData = getDefaultFormData();
1254
+ reactData.formData = formData;
1255
+ }
1256
+ if ($xeTable) {
1257
+ const tableInternalData = $xeTable.internalData;
1258
+ const { tableFullColumn, fullColumnFieldData } = tableInternalData;
1259
+ const { computeSortOpts } = $xeTable.getComputeMaps();
1260
+ const sortOpts = computeSortOpts.value;
1261
+ let defaultSort = sortOpts.defaultSort;
1262
+ tableFullColumn.forEach((column) => {
1263
+ column.order = null;
1264
+ });
1265
+ if (defaultSort) {
1266
+ if (!import_xe_utils.default.isArray(defaultSort)) {
1267
+ defaultSort = [defaultSort];
1268
+ }
1269
+ sortList = defaultSort.map((item) => {
1270
+ const { field, order } = item;
1271
+ const colRest = fullColumnFieldData[field];
1272
+ if (colRest) {
1273
+ const column = colRest.column;
1274
+ if (column) {
1275
+ column.order = order;
1276
+ }
1277
+ }
1278
+ return {
1279
+ field,
1280
+ property: field,
1281
+ order
1282
+ };
1283
+ });
1284
+ }
1291
1285
  filterList = $xeTable.getCheckedFilters();
1292
1286
  }
1287
+ } else {
1288
+ if ($xeTable) {
1289
+ if (isReload) {
1290
+ operPromise = $xeTable.clearAll();
1291
+ } else {
1292
+ sortList = $xeTable.getSortColumns();
1293
+ filterList = $xeTable.getCheckedFilters();
1294
+ }
1295
+ }
1293
1296
  }
1294
- }
1295
- const commitParams = {
1296
- $table: $xeTable,
1297
- $grid: $xeGrid,
1298
- $gantt: null,
1299
- code,
1300
- button,
1301
- isInited,
1302
- isReload,
1303
- page: pageParams,
1304
- sort: sortList.length ? sortList[0] : {},
1305
- sorts: sortList,
1306
- filters: filterList,
1307
- form: formData,
1308
- options: qMethod
1309
- };
1310
- const handleQuery = () => {
1311
- reactData.sortData = sortList;
1312
- reactData.filterData = filterList;
1313
- reactData.tableLoading = true;
1314
- return Promise.all([Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)), operPromise]).then(([rest]) => {
1315
- reactData.tableLoading = false;
1316
- if (aqMethod) {
1317
- aqMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1318
- } else {
1319
- let tableData = [];
1320
- if (rest) {
1321
- const listProp = resConfigs.list;
1322
- const resultProp = resConfigs.result;
1323
- const reParams = { data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null };
1324
- if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
1325
- const totalProp = resConfigs.total;
1326
- const total = (import_xe_utils.default.isFunction(totalProp) ? totalProp(reParams) : import_xe_utils.default.get(rest, totalProp || "page.total")) || 0;
1327
- tablePage.total = import_xe_utils.default.toNumber(total);
1328
- tableData = (import_xe_utils.default.isFunction(resultProp) ? resultProp(reParams) : import_xe_utils.default.get(rest, resultProp || "result")) || [];
1329
- const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
1330
- if (tablePage.currentPage > pageCount) {
1331
- tablePage.currentPage = pageCount;
1297
+ const commitParams = {
1298
+ $table: $xeTable,
1299
+ $grid: $xeGrid,
1300
+ $gantt: null,
1301
+ code,
1302
+ button,
1303
+ isInited,
1304
+ isReload,
1305
+ page: pageParams,
1306
+ sort: sortList.length ? sortList[0] : {},
1307
+ sorts: sortList,
1308
+ filters: filterList,
1309
+ form: formData,
1310
+ options: qMethod
1311
+ };
1312
+ const handleQuery = () => {
1313
+ reactData.sortData = sortList;
1314
+ reactData.filterData = filterList;
1315
+ reactData.tableLoading = true;
1316
+ return Promise.all([Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)), operPromise]).then(([rest]) => {
1317
+ reactData.tableLoading = false;
1318
+ if (aqMethod) {
1319
+ aqMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1320
+ } else {
1321
+ let tableData = [];
1322
+ if (rest) {
1323
+ const listProp = resConfigs.list;
1324
+ const resultProp = resConfigs.result;
1325
+ const reParams = { data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null };
1326
+ if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
1327
+ const totalProp = resConfigs.total;
1328
+ const total = (import_xe_utils.default.isFunction(totalProp) ? totalProp(reParams) : import_xe_utils.default.get(rest, totalProp || "page.total")) || 0;
1329
+ tablePage.total = import_xe_utils.default.toNumber(total);
1330
+ tableData = (import_xe_utils.default.isFunction(resultProp) ? resultProp(reParams) : import_xe_utils.default.get(rest, resultProp || "result")) || [];
1331
+ const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
1332
+ if (tablePage.currentPage > pageCount) {
1333
+ tablePage.currentPage = pageCount;
1334
+ }
1335
+ } else {
1336
+ if (import_xe_utils.default.isArray(rest)) {
1337
+ tableData = rest;
1338
+ } else if (listProp) {
1339
+ tableData = (import_xe_utils.default.isFunction(listProp) ? listProp(reParams) : import_xe_utils.default.get(rest, listProp)) || [];
1340
+ }
1332
1341
  }
1333
- } else {
1334
- if (import_xe_utils.default.isArray(rest)) {
1335
- tableData = rest;
1336
- } else if (listProp) {
1337
- tableData = (import_xe_utils.default.isFunction(listProp) ? listProp(reParams) : import_xe_utils.default.get(rest, listProp)) || [];
1342
+ if (showFooter) {
1343
+ const fdProp = resConfigs.footerData;
1344
+ const footerList = fdProp ? import_xe_utils.default.isFunction(fdProp) ? fdProp(reParams) : import_xe_utils.default.get(rest, fdProp) : [];
1345
+ if (import_xe_utils.default.isArray(footerList)) {
1346
+ reactData.footerData = footerList;
1347
+ }
1338
1348
  }
1339
1349
  }
1340
- if (showFooter) {
1341
- const fdProp = resConfigs.footerData;
1342
- const footerList = fdProp ? import_xe_utils.default.isFunction(fdProp) ? fdProp(reParams) : import_xe_utils.default.get(rest, fdProp) : [];
1343
- if (import_xe_utils.default.isArray(footerList)) {
1344
- reactData.footerData = footerList;
1345
- }
1350
+ if ($xeTable) {
1351
+ $xeTable.loadData(tableData);
1352
+ } else {
1353
+ (0, import_vue.nextTick)(() => {
1354
+ const $xeTable2 = refTable.value;
1355
+ if ($xeTable2) {
1356
+ $xeTable2.loadData(tableData);
1357
+ }
1358
+ });
1359
+ }
1360
+ if (oldAfterQuery) {
1361
+ oldAfterQuery({ ...commitParams, response: rest }, ...args);
1346
1362
  }
1347
1363
  }
1348
- if ($xeTable) {
1349
- $xeTable.loadData(tableData);
1350
- } else {
1351
- (0, import_vue.nextTick)(() => {
1352
- const $xeTable2 = refTable.value;
1353
- if ($xeTable2) {
1354
- $xeTable2.loadData(tableData);
1355
- }
1356
- });
1364
+ if (qsMethod) {
1365
+ qsMethod({ ...commitParams, response: rest });
1357
1366
  }
1358
- if (oldAfterQuery) {
1359
- oldAfterQuery({ ...commitParams, response: rest }, ...args);
1367
+ return { status: true };
1368
+ }).catch((rest) => {
1369
+ reactData.tableLoading = false;
1370
+ if (aqMethod) {
1371
+ aqMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1360
1372
  }
1361
- }
1362
- if (qsMethod) {
1363
- qsMethod({ ...commitParams, response: rest });
1364
- }
1365
- return { status: true };
1366
- }).catch((rest) => {
1367
- reactData.tableLoading = false;
1368
- if (aqMethod) {
1369
- aqMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1370
- }
1371
- if (qeMethod) {
1372
- qeMethod({ ...commitParams, response: rest });
1373
- }
1374
- return { status: false };
1375
- });
1376
- };
1377
- if (bqMethod) {
1378
- return Promise.resolve(bqMethod(commitParams, ...args)).then((status) => {
1379
- if (status !== false) {
1380
- return handleQuery();
1381
- }
1382
- });
1373
+ if (qeMethod) {
1374
+ qeMethod({ ...commitParams, response: rest });
1375
+ }
1376
+ return { status: false };
1377
+ });
1378
+ };
1379
+ if (bqMethod) {
1380
+ return Promise.resolve(bqMethod(commitParams, ...args)).then((status) => {
1381
+ if (status !== false) {
1382
+ return handleQuery();
1383
+ }
1384
+ });
1385
+ }
1386
+ return handleQuery();
1387
+ } else {
1388
+ errLog("vxe.error.notFunc", ["proxy-config.ajax.query"]);
1383
1389
  }
1384
- return handleQuery();
1385
- } else {
1386
- errLog("vxe.error.notFunc", ["proxy-config.ajax.query"]);
1390
+ break;
1387
1391
  }
1388
- break;
1389
- }
1390
- case "queryFooter":
1391
- case "query_footer": {
1392
- const bqfMethod = ajax.beforeQueryFooter;
1393
- const qfMethod = ajax.queryFooter;
1394
- const aqfMethod = ajax.afterQueryFooter;
1395
- const qfSuccessMethod = ajax.queryFooterSuccess;
1396
- const qfErrorMethod = ajax.queryFooterError;
1397
- if (qfMethod) {
1398
- let filterList = [];
1399
- if ($xeTable) {
1400
- filterList = $xeTable.getCheckedFilters();
1401
- }
1402
- let pageParams = {};
1403
- if (pagerConfig) {
1404
- if ((0, import_utils.isEnableConf)(pagerOpts)) {
1405
- pageParams = { ...tablePage };
1392
+ case "queryFooter":
1393
+ case "query_footer": {
1394
+ const bqfMethod = ajax.beforeQueryFooter;
1395
+ const qfMethod = ajax.queryFooter;
1396
+ const aqfMethod = ajax.afterQueryFooter;
1397
+ const qfSuccessMethod = ajax.queryFooterSuccess;
1398
+ const qfErrorMethod = ajax.queryFooterError;
1399
+ if (qfMethod) {
1400
+ let filterList = [];
1401
+ if ($xeTable) {
1402
+ filterList = $xeTable.getCheckedFilters();
1406
1403
  }
1407
- }
1408
- const commitParams = {
1409
- $table: $xeTable,
1410
- $grid: $xeGrid,
1411
- $gantt: null,
1412
- code,
1413
- button,
1414
- page: pageParams,
1415
- filters: filterList,
1416
- form: formData,
1417
- options: qfMethod
1418
- };
1419
- const handleQueryFooter = () => {
1420
- return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then((rest) => {
1421
- if (aqfMethod) {
1422
- aqfMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1423
- } else {
1424
- reactData.footerData = import_xe_utils.default.isArray(rest) ? rest : [];
1425
- if (oldAfterQueryFooter) {
1426
- oldAfterQueryFooter({ ...commitParams, response: rest }, ...args);
1427
- }
1428
- }
1429
- if (qfSuccessMethod) {
1430
- qfSuccessMethod({ ...commitParams, response: rest });
1431
- }
1432
- return { status: true };
1433
- }).catch((rest) => {
1434
- if (aqfMethod) {
1435
- aqfMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1436
- }
1437
- if (qfErrorMethod) {
1438
- qfErrorMethod({ ...commitParams, response: rest });
1439
- }
1440
- return { status: false };
1441
- });
1442
- };
1443
- if (bqfMethod) {
1444
- return Promise.resolve(bqfMethod(commitParams, ...args)).then((status) => {
1445
- if (status !== false) {
1446
- return handleQueryFooter();
1404
+ let pageParams = {};
1405
+ if (pagerConfig) {
1406
+ if ((0, import_utils.isEnableConf)(pagerOpts)) {
1407
+ pageParams = { ...tablePage };
1447
1408
  }
1448
- });
1409
+ }
1410
+ const commitParams = {
1411
+ $table: $xeTable,
1412
+ $grid: $xeGrid,
1413
+ $gantt: null,
1414
+ code,
1415
+ button,
1416
+ page: pageParams,
1417
+ filters: filterList,
1418
+ form: formData,
1419
+ options: qfMethod
1420
+ };
1421
+ const handleQueryFooter = () => {
1422
+ return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then((rest) => {
1423
+ if (aqfMethod) {
1424
+ aqfMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1425
+ } else {
1426
+ reactData.footerData = import_xe_utils.default.isArray(rest) ? rest : [];
1427
+ if (oldAfterQueryFooter) {
1428
+ oldAfterQueryFooter({ ...commitParams, response: rest }, ...args);
1429
+ }
1430
+ }
1431
+ if (qfSuccessMethod) {
1432
+ qfSuccessMethod({ ...commitParams, response: rest });
1433
+ }
1434
+ return { status: true };
1435
+ }).catch((rest) => {
1436
+ if (aqfMethod) {
1437
+ aqfMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1438
+ }
1439
+ if (qfErrorMethod) {
1440
+ qfErrorMethod({ ...commitParams, response: rest });
1441
+ }
1442
+ return { status: false };
1443
+ });
1444
+ };
1445
+ if (bqfMethod) {
1446
+ return Promise.resolve(bqfMethod(commitParams, ...args)).then((status) => {
1447
+ if (status !== false) {
1448
+ return handleQueryFooter();
1449
+ }
1450
+ });
1451
+ }
1452
+ return handleQueryFooter();
1453
+ } else {
1454
+ errLog("vxe.error.notFunc", ["proxy-config.ajax.queryFooter"]);
1449
1455
  }
1450
- return handleQueryFooter();
1451
- } else {
1452
- errLog("vxe.error.notFunc", ["proxy-config.ajax.queryFooter"]);
1456
+ break;
1453
1457
  }
1454
- break;
1455
- }
1456
- case "delete": {
1457
- const bdMethod = ajax.beforeDelete;
1458
- const dMethod = ajax.delete;
1459
- const adMethod = ajax.afterDelete;
1460
- const deleteSuccessMethods = ajax.deleteSuccess;
1461
- const deleteErrorMethods = ajax.deleteError;
1462
- if (dMethod) {
1463
- const selectRecords = $xeGrid.getCheckboxRecords();
1464
- const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
1465
- const body = { removeRecords };
1466
- const commitParams = {
1467
- $table: $xeTable,
1468
- $grid: $xeGrid,
1469
- $gantt: null,
1470
- code,
1471
- button,
1472
- body,
1473
- form: formData,
1474
- options: dMethod
1475
- };
1476
- if (selectRecords.length) {
1477
- return handleDeleteRow(code, "vxe.grid.deleteSelectRecord", () => {
1478
- if (!removeRecords.length) {
1479
- return $xeTable.remove(selectRecords);
1480
- }
1481
- const handleDelete = () => {
1482
- reactData.tableLoading = true;
1483
- return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args)).then((rest) => {
1484
- reactData.tableLoading = false;
1485
- if (adMethod) {
1486
- adMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1487
- } else {
1488
- $xeTable.setPendingRow(removeRecords, false);
1489
- if (isRespMsg) {
1490
- if (import_core.VxeUI.modal) {
1491
- import_core.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.delSuccess"), status: "success" });
1458
+ case "delete": {
1459
+ const bdMethod = ajax.beforeDelete;
1460
+ const dMethod = ajax.delete;
1461
+ const adMethod = ajax.afterDelete;
1462
+ const deleteSuccessMethods = ajax.deleteSuccess;
1463
+ const deleteErrorMethods = ajax.deleteError;
1464
+ if (dMethod) {
1465
+ const selectRecords = $xeGrid.getCheckboxRecords();
1466
+ const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
1467
+ const body = { removeRecords };
1468
+ const commitParams = {
1469
+ $table: $xeTable,
1470
+ $grid: $xeGrid,
1471
+ $gantt: null,
1472
+ code,
1473
+ button,
1474
+ body,
1475
+ form: formData,
1476
+ options: dMethod
1477
+ };
1478
+ if (selectRecords.length) {
1479
+ return handleDeleteRow(code, "vxe.grid.deleteSelectRecord", () => {
1480
+ if (!removeRecords.length) {
1481
+ return $xeTable.remove(selectRecords);
1482
+ }
1483
+ const handleDelete = () => {
1484
+ reactData.tableLoading = true;
1485
+ return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args)).then((rest) => {
1486
+ reactData.tableLoading = false;
1487
+ if (adMethod) {
1488
+ adMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1489
+ } else {
1490
+ $xeTable.setPendingRow(removeRecords, false);
1491
+ if (isRespMsg) {
1492
+ if (import_core.VxeUI.modal) {
1493
+ import_core.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.delSuccess"), status: "success" });
1494
+ }
1495
+ }
1496
+ if (oldAfterDelete) {
1497
+ oldAfterDelete({ ...commitParams, response: rest }, ...args);
1498
+ } else {
1499
+ internalData.uFoot = true;
1500
+ $xeGrid.commitProxy("query");
1501
+ internalData.uFoot = false;
1502
+ updateQueryFooter();
1492
1503
  }
1493
1504
  }
1494
- if (oldAfterDelete) {
1495
- oldAfterDelete({ ...commitParams, response: rest }, ...args);
1496
- } else {
1497
- internalData.uFoot = true;
1498
- $xeGrid.commitProxy("query");
1499
- internalData.uFoot = false;
1500
- updateQueryFooter();
1505
+ if (deleteSuccessMethods) {
1506
+ deleteSuccessMethods({ ...commitParams, response: rest });
1501
1507
  }
1502
- }
1503
- if (deleteSuccessMethods) {
1504
- deleteSuccessMethods({ ...commitParams, response: rest });
1505
- }
1506
- return { status: true };
1507
- }).catch((rest) => {
1508
- reactData.tableLoading = false;
1509
- if (adMethod) {
1510
- adMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1511
- } else {
1512
- if (isRespMsg) {
1513
- if (import_core.VxeUI.modal) {
1514
- import_core.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
1508
+ return { status: true };
1509
+ }).catch((rest) => {
1510
+ reactData.tableLoading = false;
1511
+ if (adMethod) {
1512
+ adMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1513
+ } else {
1514
+ if (isRespMsg) {
1515
+ if (import_core.VxeUI.modal) {
1516
+ import_core.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
1517
+ }
1515
1518
  }
1516
1519
  }
1517
- }
1518
- if (deleteErrorMethods) {
1519
- deleteErrorMethods({ ...commitParams, response: rest });
1520
- }
1521
- return { status: false };
1522
- });
1523
- };
1524
- if (bdMethod) {
1525
- return Promise.resolve(bdMethod(commitParams, ...args)).then((status) => {
1526
- if (status !== false) {
1527
- return handleDelete();
1528
- }
1529
- });
1530
- }
1531
- return handleDelete();
1532
- });
1533
- } else {
1534
- if (isActiveMsg) {
1535
- if (import_core.VxeUI.modal) {
1536
- import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
1520
+ if (deleteErrorMethods) {
1521
+ deleteErrorMethods({ ...commitParams, response: rest });
1522
+ }
1523
+ return { status: false };
1524
+ });
1525
+ };
1526
+ if (bdMethod) {
1527
+ return Promise.resolve(bdMethod(commitParams, ...args)).then((status) => {
1528
+ if (status !== false) {
1529
+ return handleDelete();
1530
+ }
1531
+ });
1532
+ }
1533
+ return handleDelete();
1534
+ });
1535
+ } else {
1536
+ if (isActiveMsg) {
1537
+ if (import_core.VxeUI.modal) {
1538
+ import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
1539
+ }
1537
1540
  }
1538
1541
  }
1542
+ } else {
1543
+ errLog("vxe.error.notFunc", ["proxy-config.ajax.delete"]);
1539
1544
  }
1540
- } else {
1541
- errLog("vxe.error.notFunc", ["proxy-config.ajax.delete"]);
1545
+ break;
1542
1546
  }
1543
- break;
1544
- }
1545
- case "save": {
1546
- const bSaveMethod = ajax.beforeSave;
1547
- const sMethod = ajax.save;
1548
- const aSaveMethod = ajax.afterSave;
1549
- const sSuccessMethod = ajax.saveSuccess;
1550
- const sErrorMethod = ajax.saveError;
1551
- if (sMethod) {
1552
- const body = $xeTable.getRecordset();
1553
- const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
1554
- const commitParams = {
1555
- $table: $xeTable,
1556
- $grid: $xeGrid,
1557
- $gantt: null,
1558
- code,
1559
- button,
1560
- body,
1561
- form: formData,
1562
- options: sMethod
1563
- };
1564
- if (insertRecords.length) {
1565
- body.pendingRecords = pendingRecords.filter((row) => $xeTable.findRowIndexOf(insertRecords, row) === -1);
1566
- }
1567
- if (pendingRecords.length) {
1568
- body.insertRecords = insertRecords.filter((row) => $xeTable.findRowIndexOf(pendingRecords, row) === -1);
1569
- }
1570
- let restPromise = Promise.resolve();
1571
- if (editRules) {
1572
- restPromise = $xeTable[validConfig && validConfig.msgMode === "full" ? "fullValidate" : "validate"](body.insertRecords.concat(updateRecords));
1573
- }
1574
- return restPromise.then((errMap) => {
1575
- if (errMap) {
1576
- return;
1547
+ case "save": {
1548
+ const bSaveMethod = ajax.beforeSave;
1549
+ const sMethod = ajax.save;
1550
+ const aSaveMethod = ajax.afterSave;
1551
+ const sSuccessMethod = ajax.saveSuccess;
1552
+ const sErrorMethod = ajax.saveError;
1553
+ if (sMethod) {
1554
+ const body = $xeTable.getRecordset();
1555
+ const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
1556
+ const commitParams = {
1557
+ $table: $xeTable,
1558
+ $grid: $xeGrid,
1559
+ $gantt: null,
1560
+ code,
1561
+ button,
1562
+ body,
1563
+ form: formData,
1564
+ options: sMethod
1565
+ };
1566
+ if (insertRecords.length) {
1567
+ body.pendingRecords = pendingRecords.filter((row) => $xeTable.findRowIndexOf(insertRecords, row) === -1);
1577
1568
  }
1578
- if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
1579
- const handleSave = () => {
1580
- reactData.tableLoading = true;
1581
- return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args)).then((rest) => {
1582
- reactData.tableLoading = false;
1583
- if (aSaveMethod) {
1584
- aSaveMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1585
- } else {
1586
- $xeTable.clearPendingRow();
1587
- if (isRespMsg) {
1588
- if (import_core.VxeUI.modal) {
1589
- import_core.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.saveSuccess"), status: "success" });
1569
+ if (pendingRecords.length) {
1570
+ body.insertRecords = insertRecords.filter((row) => $xeTable.findRowIndexOf(pendingRecords, row) === -1);
1571
+ }
1572
+ let restPromise = Promise.resolve();
1573
+ if (editRules) {
1574
+ restPromise = $xeTable[validConfig && validConfig.msgMode === "full" ? "fullValidate" : "validate"](body.insertRecords.concat(updateRecords));
1575
+ }
1576
+ return restPromise.then((errMap) => {
1577
+ if (errMap) {
1578
+ return;
1579
+ }
1580
+ if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
1581
+ const handleSave = () => {
1582
+ reactData.tableLoading = true;
1583
+ return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args)).then((rest) => {
1584
+ reactData.tableLoading = false;
1585
+ if (aSaveMethod) {
1586
+ aSaveMethod({ ...commitParams, response: rest, status: "success" }, ...args);
1587
+ } else {
1588
+ $xeTable.clearPendingRow();
1589
+ if (isRespMsg) {
1590
+ if (import_core.VxeUI.modal) {
1591
+ import_core.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.saveSuccess"), status: "success" });
1592
+ }
1593
+ }
1594
+ if (oldAfterSave) {
1595
+ oldAfterSave({ ...commitParams, response: rest }, ...args);
1596
+ } else {
1597
+ internalData.uFoot = true;
1598
+ $xeGrid.commitProxy("query");
1599
+ internalData.uFoot = false;
1600
+ updateQueryFooter();
1590
1601
  }
1591
1602
  }
1592
- if (oldAfterSave) {
1593
- oldAfterSave({ ...commitParams, response: rest }, ...args);
1594
- } else {
1595
- internalData.uFoot = true;
1596
- $xeGrid.commitProxy("query");
1597
- internalData.uFoot = false;
1598
- updateQueryFooter();
1603
+ if (sSuccessMethod) {
1604
+ sSuccessMethod({ ...commitParams, response: rest });
1599
1605
  }
1600
- }
1601
- if (sSuccessMethod) {
1602
- sSuccessMethod({ ...commitParams, response: rest });
1603
- }
1604
- return { status: true };
1605
- }).catch((rest) => {
1606
- reactData.tableLoading = false;
1607
- if (aSaveMethod) {
1608
- aSaveMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1609
- } else {
1610
- if (isRespMsg) {
1611
- if (import_core.VxeUI.modal) {
1612
- import_core.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
1606
+ return { status: true };
1607
+ }).catch((rest) => {
1608
+ reactData.tableLoading = false;
1609
+ if (aSaveMethod) {
1610
+ aSaveMethod({ ...commitParams, response: rest, status: "error" }, ...args);
1611
+ } else {
1612
+ if (isRespMsg) {
1613
+ if (import_core.VxeUI.modal) {
1614
+ import_core.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
1615
+ }
1613
1616
  }
1614
1617
  }
1618
+ if (sErrorMethod) {
1619
+ sErrorMethod({ ...commitParams, response: rest });
1620
+ }
1621
+ return { status: false };
1622
+ });
1623
+ };
1624
+ if (bSaveMethod) {
1625
+ return Promise.resolve(bSaveMethod(commitParams, ...args)).then((status) => {
1626
+ if (status !== false) {
1627
+ return handleSave();
1628
+ }
1629
+ });
1630
+ }
1631
+ return handleSave();
1632
+ } else {
1633
+ if (isActiveMsg) {
1634
+ if (import_core.VxeUI.modal) {
1635
+ import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.dataUnchanged"), status: "info" });
1615
1636
  }
1616
- if (sErrorMethod) {
1617
- sErrorMethod({ ...commitParams, response: rest });
1618
- }
1619
- return { status: false };
1620
- });
1621
- };
1622
- if (bSaveMethod) {
1623
- return Promise.resolve(bSaveMethod(commitParams, ...args)).then((status) => {
1624
- if (status !== false) {
1625
- return handleSave();
1626
- }
1627
- });
1628
- }
1629
- return handleSave();
1630
- } else {
1631
- if (isActiveMsg) {
1632
- if (import_core.VxeUI.modal) {
1633
- import_core.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.dataUnchanged"), status: "info" });
1634
1637
  }
1635
1638
  }
1636
- }
1637
- });
1638
- } else {
1639
- errLog("vxe.error.notFunc", ["proxy-config.ajax.save"]);
1640
- }
1641
- break;
1642
- }
1643
- default: {
1644
- const gCommandOpts = commands.get(code);
1645
- if (gCommandOpts) {
1646
- const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
1647
- if (tCommandMethod) {
1648
- tCommandMethod({ code, button, $grid: $xeGrid, $table: $xeTable, $gantt: null }, ...args);
1639
+ });
1649
1640
  } else {
1650
- errLog("vxe.error.notCommands", [code]);
1641
+ errLog("vxe.error.notFunc", ["proxy-config.ajax.save"]);
1642
+ }
1643
+ break;
1644
+ }
1645
+ default: {
1646
+ const gCommandOpts = commands.get(code);
1647
+ if (gCommandOpts) {
1648
+ const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
1649
+ if (tCommandMethod) {
1650
+ tCommandMethod({ code, button, $grid: $xeGrid, $table: $xeTable, $gantt: null }, ...args);
1651
+ } else {
1652
+ errLog("vxe.error.notCommands", [code]);
1653
+ }
1651
1654
  }
1652
1655
  }
1653
1656
  }
1654
- }
1655
- return (0, import_vue.nextTick)();
1656
- },
1657
- getParams() {
1658
- return props.params;
1659
- },
1660
- zoom() {
1661
- if (reactData.isZMax) {
1662
- return $xeGrid.revert();
1663
- }
1664
- return $xeGrid.maximize();
1665
- },
1666
- isMaximized() {
1667
- return reactData.isZMax;
1668
- },
1669
- maximize() {
1670
- return handleZoom(true);
1671
- },
1672
- revert() {
1673
- return handleZoom();
1674
- },
1675
- getFormData,
1676
- /**
1677
- * 已废弃,被 getFormFlatItems 替换
1678
- * @deprecated
1679
- */
1680
- getFormItems(itemIndex) {
1681
- const formOpts = computeFormOpts.value;
1682
- const { formConfig } = props;
1683
- const { items } = formOpts;
1684
- const itemList = [];
1685
- import_xe_utils.default.eachTree(
1686
- formConfig && (0, import_utils.isEnableConf)(formOpts) && items ? items : [],
1687
- (item) => {
1688
- itemList.push(item);
1689
- },
1690
- { children: "children" }
1691
- );
1692
- return import_xe_utils.default.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
1693
- },
1694
- getFormFlatItems() {
1695
- const $form = refForm.value;
1696
- if ($form) {
1697
- return $form.getFlatItems();
1698
- }
1699
- return [];
1700
- },
1701
- getFormNestedItems() {
1702
- const $form = refForm.value;
1703
- if ($form) {
1704
- return $form.getNestedItems();
1705
- }
1706
- return [];
1707
- },
1708
- getFormItemByField(field) {
1709
- const $form = refForm.value;
1710
- if ($form) {
1711
- return $form.getItemByField(field);
1712
- }
1713
- return null;
1714
- },
1715
- resetForm() {
1716
- const $form = refForm.value;
1717
- if ($form) {
1718
- return $form.reset();
1719
- }
1720
- return (0, import_vue.nextTick)();
1721
- },
1722
- validateForm() {
1723
- const $form = refForm.value;
1724
- if ($form) {
1725
- return $form.validate();
1726
- }
1727
- return Promise.resolve();
1728
- },
1729
- validateFormField(field) {
1730
- const $form = refForm.value;
1731
- if ($form) {
1732
- return $form.validateField(field);
1733
- }
1734
- return Promise.resolve();
1735
- },
1736
- clearFormValidate(field) {
1737
- const $form = refForm.value;
1738
- if ($form) {
1739
- return $form.clearValidate(field);
1740
- }
1741
- return (0, import_vue.nextTick)();
1742
- },
1743
- homePage() {
1744
- const { tablePage } = reactData;
1745
- tablePage.currentPage = 1;
1746
- return (0, import_vue.nextTick)();
1747
- },
1748
- homePageByEvent(evnt) {
1749
- const $pager = refPager.value;
1750
- if ($pager) {
1751
- $pager.homePageByEvent(evnt);
1752
- }
1753
- },
1754
- endPage() {
1755
- const { tablePage } = reactData;
1756
- const pageCount = computePageCount.value;
1757
- tablePage.currentPage = pageCount;
1758
- return (0, import_vue.nextTick)();
1759
- },
1760
- endPageByEvent(evnt) {
1761
- const $pager = refPager.value;
1762
- if ($pager) {
1763
- $pager.endPageByEvent(evnt);
1764
- }
1765
- },
1766
- getCurrentPage() {
1767
- const { tablePage } = reactData;
1768
- return tablePage.currentPage;
1769
- },
1770
- setCurrentPage(currentPage) {
1771
- const { tablePage } = reactData;
1772
- const pageCount = computePageCount.value;
1773
- tablePage.currentPage = Math.min(pageCount, Math.max(1, import_xe_utils.default.toNumber(currentPage)));
1774
- return (0, import_vue.nextTick)();
1775
- },
1776
- setCurrentPageByEvent(evnt, currentPage) {
1777
- const $pager = refPager.value;
1778
- if ($pager) {
1779
- $pager.setCurrentPageByEvent(evnt, currentPage);
1780
- }
1781
- },
1782
- getPageSize() {
1783
- const { tablePage } = reactData;
1784
- return tablePage.pageSize;
1785
- },
1786
- setPageSize(pageSize) {
1787
- const { tablePage } = reactData;
1788
- tablePage.pageSize = Math.max(1, import_xe_utils.default.toNumber(pageSize));
1789
- return (0, import_vue.nextTick)();
1790
- },
1791
- setPageSizeByEvent(evnt, pageSize) {
1792
- const $pager = refPager.value;
1793
- if ($pager) {
1794
- $pager.setPageSizeByEvent(evnt, pageSize);
1795
- }
1796
- },
1797
- getProxyInfo() {
1798
- const $xeTable = refTable.value;
1799
- if (props.proxyConfig) {
1800
- const { sortData } = reactData;
1801
- return {
1802
- data: $xeTable ? $xeTable.getFullData() : [],
1803
- filter: reactData.filterData,
1804
- form: getFormData(),
1805
- sort: sortData.length ? sortData[0] : {},
1806
- sorts: sortData,
1807
- pager: reactData.tablePage,
1808
- pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
1809
- };
1810
- }
1811
- return null;
1812
- },
1813
- getCustomPagerData() {
1814
- const { pagerConfig } = props;
1815
- const { tablePage } = reactData;
1816
- const pagerOpts = computePagerOpts.value;
1817
- if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
1818
- return {
1819
- pSize: tablePage.pageSize
1820
- };
1821
- }
1822
- return {};
1823
- }
1824
- // setProxyInfo (options) {
1825
- // if (props.proxyConfig && options) {
1826
- // const { pager, form } = options
1827
- // const proxyOpts = computeProxyOpts.value
1828
- // if (pager) {
1829
- // if (pager.currentPage) {
1830
- // reactData.tablePage.currentPage = Number(pager.currentPage)
1831
- // }
1832
- // if (pager.pageSize) {
1833
- // reactData.tablePage.pageSize = Number(pager.pageSize)
1834
- // }
1835
- // }
1836
- // if (proxyOpts.form && form) {
1837
- // Object.assign(reactData.formData, form)
1838
- // }
1839
- // }
1840
- // return nextTick()
1841
- // }
1842
- };
1843
- const gridPrivateMethods = {
1844
- extendTableMethods,
1845
- callSlot(slotFunc, params) {
1846
- if (slotFunc) {
1847
- if (import_xe_utils.default.isString(slotFunc)) {
1848
- slotFunc = slots[slotFunc] || null;
1657
+ return (0, import_vue.nextTick)();
1658
+ },
1659
+ getParams() {
1660
+ return props.params;
1661
+ },
1662
+ zoom() {
1663
+ if (reactData.isZMax) {
1664
+ return $xeGrid.revert();
1665
+ }
1666
+ return $xeGrid.maximize();
1667
+ },
1668
+ isMaximized() {
1669
+ return reactData.isZMax;
1670
+ },
1671
+ maximize() {
1672
+ return handleZoom(true);
1673
+ },
1674
+ revert() {
1675
+ return handleZoom();
1676
+ },
1677
+ getFormData,
1678
+ /**
1679
+ * 已废弃,被 getFormFlatItems 替换
1680
+ * @deprecated
1681
+ */
1682
+ getFormItems(itemIndex) {
1683
+ const formOpts = computeFormOpts.value;
1684
+ const { formConfig } = props;
1685
+ const { items } = formOpts;
1686
+ const itemList = [];
1687
+ import_xe_utils.default.eachTree(
1688
+ formConfig && (0, import_utils.isEnableConf)(formOpts) && items ? items : [],
1689
+ (item) => {
1690
+ itemList.push(item);
1691
+ },
1692
+ { children: "children" }
1693
+ );
1694
+ return import_xe_utils.default.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
1695
+ },
1696
+ getFormFlatItems() {
1697
+ const $form = refForm.value;
1698
+ if ($form) {
1699
+ return $form.getFlatItems();
1849
1700
  }
1850
- if (import_xe_utils.default.isFunction(slotFunc)) {
1851
- return (0, import_vn.getSlotVNs)(slotFunc(params));
1701
+ return [];
1702
+ },
1703
+ getFormNestedItems() {
1704
+ const $form = refForm.value;
1705
+ if ($form) {
1706
+ return $form.getNestedItems();
1852
1707
  }
1853
- }
1854
- return [];
1855
- },
1856
- /**
1857
- * 获取需要排除的高度
1858
- */
1859
- getExcludeHeight() {
1860
- const { height } = props;
1861
- const { isZMax } = reactData;
1862
- const el = refElem.value;
1863
- if (el) {
1864
- const formWrapper = refFormWrapper.value;
1865
- const toolbarWrapper = refToolbarWrapper.value;
1866
- const topWrapper = refTopWrapper.value;
1867
- const bottomWrapper = refBottomWrapper.value;
1868
- const pagerWrapper = refPagerWrapper.value;
1869
- const parentEl = el.parentElement;
1870
- let parentPaddingSize = 0;
1871
- if (parentEl && (height === "100%" || height === "auto")) {
1872
- parentPaddingSize = isZMax ? 0 : (0, import_dom.getPaddingTopBottomSize)(parentEl);
1708
+ return [];
1709
+ },
1710
+ getFormItemByField(field) {
1711
+ const $form = refForm.value;
1712
+ if ($form) {
1713
+ return $form.getItemByField(field);
1873
1714
  }
1874
- return parentPaddingSize + (0, import_dom.getPaddingTopBottomSize)(el) + (0, import_dom.getOffsetHeight)(formWrapper) + (0, import_dom.getOffsetHeight)(toolbarWrapper) + (0, import_dom.getOffsetHeight)(topWrapper) + (0, import_dom.getOffsetHeight)(bottomWrapper) + (0, import_dom.getOffsetHeight)(pagerWrapper);
1875
- }
1876
- return 0;
1877
- },
1878
- getParentElem() {
1879
- const el = refElem.value;
1880
- if (!el) {
1881
1715
  return null;
1716
+ },
1717
+ resetForm() {
1718
+ const $form = refForm.value;
1719
+ if ($form) {
1720
+ return $form.reset();
1721
+ }
1722
+ return (0, import_vue.nextTick)();
1723
+ },
1724
+ validateForm() {
1725
+ const $form = refForm.value;
1726
+ if ($form) {
1727
+ return $form.validate();
1728
+ }
1729
+ return Promise.resolve();
1730
+ },
1731
+ validateFormField(field) {
1732
+ const $form = refForm.value;
1733
+ if ($form) {
1734
+ return $form.validateField(field);
1735
+ }
1736
+ return Promise.resolve();
1737
+ },
1738
+ clearFormValidate(field) {
1739
+ const $form = refForm.value;
1740
+ if ($form) {
1741
+ return $form.clearValidate(field);
1742
+ }
1743
+ return (0, import_vue.nextTick)();
1744
+ },
1745
+ homePage() {
1746
+ const { tablePage } = reactData;
1747
+ tablePage.currentPage = 1;
1748
+ return (0, import_vue.nextTick)();
1749
+ },
1750
+ homePageByEvent(evnt) {
1751
+ const $pager = refPager.value;
1752
+ if ($pager) {
1753
+ $pager.homePageByEvent(evnt);
1754
+ }
1755
+ },
1756
+ endPage() {
1757
+ const { tablePage } = reactData;
1758
+ const pageCount = computePageCount.value;
1759
+ tablePage.currentPage = pageCount;
1760
+ return (0, import_vue.nextTick)();
1761
+ },
1762
+ endPageByEvent(evnt) {
1763
+ const $pager = refPager.value;
1764
+ if ($pager) {
1765
+ $pager.endPageByEvent(evnt);
1766
+ }
1767
+ },
1768
+ getCurrentPage() {
1769
+ const { tablePage } = reactData;
1770
+ return tablePage.currentPage;
1771
+ },
1772
+ setCurrentPage(currentPage) {
1773
+ const { tablePage } = reactData;
1774
+ const pageCount = computePageCount.value;
1775
+ tablePage.currentPage = Math.min(pageCount, Math.max(1, import_xe_utils.default.toNumber(currentPage)));
1776
+ return (0, import_vue.nextTick)();
1777
+ },
1778
+ setCurrentPageByEvent(evnt, currentPage) {
1779
+ const $pager = refPager.value;
1780
+ if ($pager) {
1781
+ $pager.setCurrentPageByEvent(evnt, currentPage);
1782
+ }
1783
+ },
1784
+ getPageSize() {
1785
+ const { tablePage } = reactData;
1786
+ return tablePage.pageSize;
1787
+ },
1788
+ setPageSize(pageSize) {
1789
+ const { tablePage } = reactData;
1790
+ tablePage.pageSize = Math.max(1, import_xe_utils.default.toNumber(pageSize));
1791
+ return (0, import_vue.nextTick)();
1792
+ },
1793
+ setPageSizeByEvent(evnt, pageSize) {
1794
+ const $pager = refPager.value;
1795
+ if ($pager) {
1796
+ $pager.setPageSizeByEvent(evnt, pageSize);
1797
+ }
1798
+ },
1799
+ getProxyInfo() {
1800
+ const $xeTable = refTable.value;
1801
+ if (props.proxyConfig) {
1802
+ const { sortData } = reactData;
1803
+ return {
1804
+ data: $xeTable ? $xeTable.getFullData() : [],
1805
+ filter: reactData.filterData,
1806
+ form: getFormData(),
1807
+ sort: sortData.length ? sortData[0] : {},
1808
+ sorts: sortData,
1809
+ pager: reactData.tablePage,
1810
+ pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
1811
+ };
1812
+ }
1813
+ return null;
1814
+ },
1815
+ getCustomPagerData() {
1816
+ const { pagerConfig } = props;
1817
+ const { tablePage } = reactData;
1818
+ const pagerOpts = computePagerOpts.value;
1819
+ if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
1820
+ return {
1821
+ pSize: tablePage.pageSize
1822
+ };
1823
+ }
1824
+ return {};
1882
1825
  }
1883
- let parentEl = el.parentElement;
1884
- if (parentEl && (0, import_dom.hasClass)(parentEl, "vxe-scrollbar--view-inner")) {
1885
- parentEl = parentEl.parentElement;
1886
- }
1887
- return parentEl;
1888
- },
1889
- getParentHeight() {
1890
- const el = refElem.value;
1891
- if (el) {
1892
- const parentEl = $xeGrid.getParentElem();
1893
- return (reactData.isZMax ? (0, import_dom.getDomNode)().visibleHeight : parentEl ? import_xe_utils.default.toNumber(getComputedStyle(parentEl).height) : 0) - gridPrivateMethods.getExcludeHeight();
1894
- }
1895
- return 0;
1896
- },
1897
- triggerToolbarCommitEvent(params, evnt) {
1898
- const { code } = params;
1899
- if (code) {
1900
- const isUf = ["reload", "delete", "save"].includes(code);
1901
- if (isUf) {
1902
- internalData.uFoot = true;
1826
+ // setProxyInfo (options) {
1827
+ // if (props.proxyConfig && options) {
1828
+ // const { pager, form } = options
1829
+ // const proxyOpts = computeProxyOpts.value
1830
+ // if (pager) {
1831
+ // if (pager.currentPage) {
1832
+ // reactData.tablePage.currentPage = Number(pager.currentPage)
1833
+ // }
1834
+ // if (pager.pageSize) {
1835
+ // reactData.tablePage.pageSize = Number(pager.pageSize)
1836
+ // }
1837
+ // }
1838
+ // if (proxyOpts.form && form) {
1839
+ // Object.assign(reactData.formData, form)
1840
+ // }
1841
+ // }
1842
+ // return nextTick()
1843
+ // }
1844
+ };
1845
+ const gridPrivateMethods = {
1846
+ extendTableMethods,
1847
+ callSlot(slotFunc, params) {
1848
+ if (slotFunc) {
1849
+ if (import_xe_utils.default.isString(slotFunc)) {
1850
+ slotFunc = slots[slotFunc] || null;
1851
+ }
1852
+ if (import_xe_utils.default.isFunction(slotFunc)) {
1853
+ return (0, import_vn.getSlotVNs)(slotFunc(params));
1854
+ }
1903
1855
  }
1904
- const rest = $xeGrid.commitProxy(params, evnt).then((rest2) => {
1905
- if (rest2 && rest2.status && ["query", "reload", "delete", "save"].includes(code)) {
1906
- $xeGrid.dispatchEvent(code === "delete" || code === "save" ? `proxy-${code}` : "proxy-query", { ...rest2, isReload: code === "reload" }, evnt);
1856
+ return [];
1857
+ },
1858
+ /**
1859
+ * 获取需要排除的高度
1860
+ */
1861
+ getExcludeHeight() {
1862
+ const { height } = props;
1863
+ const { isZMax } = reactData;
1864
+ const el = refElem.value;
1865
+ if (el) {
1866
+ const formWrapper = refFormWrapper.value;
1867
+ const toolbarWrapper = refToolbarWrapper.value;
1868
+ const topWrapper = refTopWrapper.value;
1869
+ const bottomWrapper = refBottomWrapper.value;
1870
+ const pagerWrapper = refPagerWrapper.value;
1871
+ const parentEl = el.parentElement;
1872
+ let parentPaddingSize = 0;
1873
+ if (parentEl && (height === "100%" || height === "auto")) {
1874
+ parentPaddingSize = isZMax ? 0 : (0, import_dom.getPaddingTopBottomSize)(parentEl);
1907
1875
  }
1908
- });
1909
- internalData.uFoot = false;
1910
- if (isUf) {
1911
- updateQueryFooter();
1876
+ return parentPaddingSize + (0, import_dom.getPaddingTopBottomSize)(el) + (0, import_dom.getOffsetHeight)(formWrapper) + (0, import_dom.getOffsetHeight)(toolbarWrapper) + (0, import_dom.getOffsetHeight)(topWrapper) + (0, import_dom.getOffsetHeight)(bottomWrapper) + (0, import_dom.getOffsetHeight)(pagerWrapper);
1912
1877
  }
1913
- return rest;
1914
- }
1915
- return (0, import_vue.nextTick)();
1916
- },
1917
- triggerToolbarBtnEvent(button, evnt) {
1918
- $xeGrid.triggerToolbarCommitEvent(button, evnt);
1919
- $xeGrid.dispatchEvent("toolbar-button-click", { code: button.code, button }, evnt);
1920
- },
1921
- triggerToolbarTolEvent(tool, evnt) {
1922
- $xeGrid.triggerToolbarCommitEvent(tool, evnt);
1923
- $xeGrid.dispatchEvent("toolbar-tool-click", { code: tool.code, tool }, evnt);
1924
- },
1925
- triggerZoomEvent(evnt) {
1926
- $xeGrid.zoom();
1927
- $xeGrid.dispatchEvent("zoom", { type: reactData.isZMax ? "max" : "revert" }, evnt);
1928
- }
1929
- };
1930
- Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods, {
1931
- // 检查插槽
1932
- loadColumn(columns) {
1933
- const $xeTable = refTable.value;
1934
- import_xe_utils.default.eachTree(columns, (column) => {
1935
- if (column.slots) {
1936
- import_xe_utils.default.each(column.slots, (func) => {
1937
- if (func && !import_xe_utils.default.isFunction(func)) {
1938
- if (!slots[func]) {
1939
- errLog("vxe.error.notSlot", [func]);
1940
- }
1878
+ return 0;
1879
+ },
1880
+ getParentElem() {
1881
+ const el = refElem.value;
1882
+ if (!el) {
1883
+ return null;
1884
+ }
1885
+ let parentEl = el.parentElement;
1886
+ if (parentEl && (0, import_dom.hasClass)(parentEl, "vxe-scrollbar--view-inner")) {
1887
+ parentEl = parentEl.parentElement;
1888
+ }
1889
+ return parentEl;
1890
+ },
1891
+ getParentHeight() {
1892
+ const el = refElem.value;
1893
+ if (el) {
1894
+ const parentEl = $xeGrid.getParentElem();
1895
+ return (reactData.isZMax ? (0, import_dom.getDomNode)().visibleHeight : parentEl ? import_xe_utils.default.toNumber(getComputedStyle(parentEl).height) : 0) - gridPrivateMethods.getExcludeHeight();
1896
+ }
1897
+ return 0;
1898
+ },
1899
+ triggerToolbarCommitEvent(params, evnt) {
1900
+ const { code } = params;
1901
+ if (code) {
1902
+ const isUf = ["reload", "delete", "save"].includes(code);
1903
+ if (isUf) {
1904
+ internalData.uFoot = true;
1905
+ }
1906
+ const rest = $xeGrid.commitProxy(params, evnt).then((rest2) => {
1907
+ if (rest2 && rest2.status && ["query", "reload", "delete", "save"].includes(code)) {
1908
+ $xeGrid.dispatchEvent(code === "delete" || code === "save" ? `proxy-${code}` : "proxy-query", { ...rest2, isReload: code === "reload" }, evnt);
1941
1909
  }
1942
1910
  });
1911
+ internalData.uFoot = false;
1912
+ if (isUf) {
1913
+ updateQueryFooter();
1914
+ }
1915
+ return rest;
1943
1916
  }
1944
- });
1945
- if ($xeTable) {
1946
- return $xeTable.loadColumn(columns);
1917
+ return (0, import_vue.nextTick)();
1918
+ },
1919
+ triggerToolbarBtnEvent(button, evnt) {
1920
+ $xeGrid.triggerToolbarCommitEvent(button, evnt);
1921
+ $xeGrid.dispatchEvent("toolbar-button-click", { code: button.code, button }, evnt);
1922
+ },
1923
+ triggerToolbarTolEvent(tool, evnt) {
1924
+ $xeGrid.triggerToolbarCommitEvent(tool, evnt);
1925
+ $xeGrid.dispatchEvent("toolbar-tool-click", { code: tool.code, tool }, evnt);
1926
+ },
1927
+ triggerZoomEvent(evnt) {
1928
+ $xeGrid.zoom();
1929
+ $xeGrid.dispatchEvent("zoom", { type: reactData.isZMax ? "max" : "revert" }, evnt);
1947
1930
  }
1948
- return (0, import_vue.nextTick)();
1949
- },
1950
- reloadColumn(columns) {
1951
- $xeGrid.clearAll();
1952
- return $xeGrid.loadColumn(columns);
1953
- }
1954
- });
1955
- const renderVN = () => {
1956
- const vSize = computeSize.value;
1957
- const styles = computeStyles.value;
1958
- const isLoading = computeIsLoading.value;
1959
- return (0, import_vue.h)(
1960
- "div",
1961
- {
1962
- ref: refElem,
1963
- class: [
1964
- "vxe-grid",
1965
- {
1966
- [`size--${vSize}`]: vSize,
1967
- "is--animat": !!props.animat,
1968
- "is--round": props.round,
1969
- "is--maximize": reactData.isZMax,
1970
- "is--loading": isLoading
1931
+ };
1932
+ Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods, {
1933
+ // 检查插槽
1934
+ loadColumn(columns) {
1935
+ const $xeTable = refTable.value;
1936
+ import_xe_utils.default.eachTree(columns, (column) => {
1937
+ if (column.slots) {
1938
+ import_xe_utils.default.each(column.slots, (func) => {
1939
+ if (func && !import_xe_utils.default.isFunction(func)) {
1940
+ if (!slots[func]) {
1941
+ errLog("vxe.error.notSlot", [func]);
1942
+ }
1943
+ }
1944
+ });
1971
1945
  }
1972
- ],
1973
- style: styles
1946
+ });
1947
+ if ($xeTable) {
1948
+ return $xeTable.loadColumn(columns);
1949
+ }
1950
+ return (0, import_vue.nextTick)();
1974
1951
  },
1975
- renderLayout()
1976
- );
1977
- };
1978
- const columnFlag = (0, import_vue.ref)(0);
1979
- (0, import_vue.watch)(
1980
- () => props.columns ? props.columns.length : -1,
1981
- () => {
1982
- columnFlag.value++;
1983
- }
1984
- );
1985
- (0, import_vue.watch)(
1986
- () => props.columns,
1987
- () => {
1988
- columnFlag.value++;
1989
- }
1990
- );
1991
- (0, import_vue.watch)(columnFlag, () => {
1992
- (0, import_vue.nextTick)(() => $xeGrid.loadColumn(props.columns || []));
1993
- });
1994
- (0, import_vue.watch)(
1995
- () => props.toolbarConfig,
1996
- () => {
1997
- initToolbar();
1998
- }
1999
- );
2000
- (0, import_vue.watch)(computeCustomCurrentPageFlag, () => {
2001
- initPages("currentPage");
2002
- });
2003
- (0, import_vue.watch)(computeCustomPageSizeFlag, () => {
2004
- initPages("pageSize");
2005
- });
2006
- (0, import_vue.watch)(computeCustomTotalFlag, () => {
2007
- initPages("total");
2008
- });
2009
- (0, import_vue.watch)(
2010
- () => props.proxyConfig,
2011
- () => {
2012
- initProxy();
2013
- }
2014
- );
2015
- hooks.forEach((options) => {
2016
- const { setupGrid } = options;
2017
- if (setupGrid) {
2018
- const hookRest = setupGrid($xeGrid);
2019
- if (hookRest && import_xe_utils.default.isObject(hookRest)) {
2020
- Object.assign($xeGrid, hookRest);
1952
+ reloadColumn(columns) {
1953
+ $xeGrid.clearAll();
1954
+ return $xeGrid.loadColumn(columns);
2021
1955
  }
2022
- }
2023
- });
2024
- initPages();
2025
- (0, import_vue.onMounted)(() => {
2026
- (0, import_vue.nextTick)(() => {
2027
- const { columns } = props;
2028
- const proxyOpts = computeProxyOpts.value;
2029
- if (props.formConfig) {
2030
- if (!VxeUIFormComponent) {
2031
- errLog("vxe.error.reqComp", ["vxe-form"]);
2032
- }
1956
+ });
1957
+ const renderVN = () => {
1958
+ const vSize = computeSize.value;
1959
+ const styles = computeStyles.value;
1960
+ const isLoading = computeIsLoading.value;
1961
+ return (0, import_vue.h)(
1962
+ "div",
1963
+ {
1964
+ ref: refElem,
1965
+ class: [
1966
+ "vxe-grid",
1967
+ {
1968
+ [`size--${vSize}`]: vSize,
1969
+ "is--animat": !!props.animat,
1970
+ "is--round": props.round,
1971
+ "is--maximize": reactData.isZMax,
1972
+ "is--loading": isLoading
1973
+ }
1974
+ ],
1975
+ style: styles
1976
+ },
1977
+ renderLayout()
1978
+ );
1979
+ };
1980
+ const columnFlag = (0, import_vue.ref)(0);
1981
+ (0, import_vue.watch)(
1982
+ () => props.columns ? props.columns.length : -1,
1983
+ () => {
1984
+ columnFlag.value++;
2033
1985
  }
2034
- if (props.pagerConfig) {
2035
- if (!VxeUIPagerComponent) {
2036
- errLog("vxe.error.reqComp", ["vxe-pager"]);
2037
- }
1986
+ );
1987
+ (0, import_vue.watch)(
1988
+ () => props.columns,
1989
+ () => {
1990
+ columnFlag.value++;
2038
1991
  }
2039
- if (proxyOpts.props) {
2040
- warnLog("vxe.error.delProp", ["proxy-config.props", "proxy-config.response"]);
1992
+ );
1993
+ (0, import_vue.watch)(columnFlag, () => {
1994
+ (0, import_vue.nextTick)(() => $xeGrid.loadColumn(props.columns || []));
1995
+ });
1996
+ (0, import_vue.watch)(
1997
+ () => props.toolbarConfig,
1998
+ () => {
1999
+ initToolbar();
2041
2000
  }
2042
- if (columns && columns.length) {
2043
- $xeGrid.loadColumn(columns);
2001
+ );
2002
+ (0, import_vue.watch)(computeCustomCurrentPageFlag, () => {
2003
+ initPages("currentPage");
2004
+ });
2005
+ (0, import_vue.watch)(computeCustomPageSizeFlag, () => {
2006
+ initPages("pageSize");
2007
+ });
2008
+ (0, import_vue.watch)(computeCustomTotalFlag, () => {
2009
+ initPages("total");
2010
+ });
2011
+ (0, import_vue.watch)(
2012
+ () => props.proxyConfig,
2013
+ () => {
2014
+ initProxy();
2015
+ }
2016
+ );
2017
+ hooks.forEach((options) => {
2018
+ const { setupGrid } = options;
2019
+ if (setupGrid) {
2020
+ const hookRest = setupGrid($xeGrid);
2021
+ if (hookRest && import_xe_utils.default.isObject(hookRest)) {
2022
+ Object.assign($xeGrid, hookRest);
2023
+ }
2044
2024
  }
2045
- initToolbar();
2046
- initProxy();
2047
2025
  });
2048
- globalEvents.on($xeGrid, "keydown", handleGlobalKeydownEvent);
2049
- });
2050
- (0, import_vue.onBeforeUnmount)(() => {
2051
- globalEvents.off($xeGrid, "keydown");
2052
- import_xe_utils.default.assign(reactData, createReactData());
2053
- import_xe_utils.default.assign(internalData, createInternalData());
2054
- });
2055
- $xeGrid.renderVN = renderVN;
2056
- (0, import_vue.provide)("$xeGrid", $xeGrid);
2057
- (0, import_vue.provide)("$xeGantt", null);
2058
- return $xeGrid;
2059
- },
2060
- render() {
2061
- return this.renderVN();
2062
- }
2063
- });
2026
+ initPages();
2027
+ (0, import_vue.onMounted)(() => {
2028
+ (0, import_vue.nextTick)(() => {
2029
+ const { columns } = props;
2030
+ const proxyOpts = computeProxyOpts.value;
2031
+ if (props.formConfig) {
2032
+ if (!VxeUIFormComponent) {
2033
+ errLog("vxe.error.reqComp", ["vxe-form"]);
2034
+ }
2035
+ }
2036
+ if (props.pagerConfig) {
2037
+ if (!VxeUIPagerComponent) {
2038
+ errLog("vxe.error.reqComp", ["vxe-pager"]);
2039
+ }
2040
+ }
2041
+ if (proxyOpts.props) {
2042
+ warnLog("vxe.error.delProp", ["proxy-config.props", "proxy-config.response"]);
2043
+ }
2044
+ if (columns && columns.length) {
2045
+ $xeGrid.loadColumn(columns);
2046
+ }
2047
+ initToolbar();
2048
+ initProxy();
2049
+ });
2050
+ globalEvents.on($xeGrid, "keydown", handleGlobalKeydownEvent);
2051
+ });
2052
+ (0, import_vue.onBeforeUnmount)(() => {
2053
+ globalEvents.off($xeGrid, "keydown");
2054
+ import_xe_utils.default.assign(reactData, createReactData());
2055
+ import_xe_utils.default.assign(internalData, createInternalData());
2056
+ });
2057
+ $xeGrid.renderVN = renderVN;
2058
+ (0, import_vue.provide)("$xeGrid", $xeGrid);
2059
+ (0, import_vue.provide)("$xeGantt", null);
2060
+ return $xeGrid;
2061
+ },
2062
+ render() {
2063
+ return this.renderVN();
2064
+ }
2065
+ })
2066
+ );