@juzhenfe/page-model 3.15.1 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4728,10 +4728,16 @@ class TableManager extends IManager {
4728
4728
  updateLoading(loading2) {
4729
4729
  this.loadingData = loading2;
4730
4730
  }
4731
+ get pageIndexKey() {
4732
+ return this.table.pageIndexKey || "pageIndex";
4733
+ }
4734
+ get pageSizeKey() {
4735
+ return this.table.pageSizeKey || "pageSize";
4736
+ }
4731
4737
  getReqParams() {
4732
4738
  return {
4733
- pageIndex: this.currentPage,
4734
- pageSize: this.pageSizeUserSet || this.pageSize,
4739
+ [this.pageIndexKey]: this.currentPage,
4740
+ [this.pageSizeKey]: this.pageSizeUserSet || this.pageSize,
4735
4741
  ...this.sortParams,
4736
4742
  ...this.getColumnParams(),
4737
4743
  ...this.getColumnSortParams()
@@ -4950,7 +4956,9 @@ class TableManager extends IManager {
4950
4956
  this.tableEvents["rowContextmenu"] = function(row, column, event) {
4951
4957
  _rowContextmenu == null ? void 0 : _rowContextmenu.call(this, row, column, event);
4952
4958
  event.preventDefault();
4953
- const rowIndex = this.tableData.findIndex((a) => a[this.rowKey] === row[this.rowKey]);
4959
+ const rowIndex = this.tableData.findIndex(
4960
+ (a) => a[this.rowKey] === row[this.rowKey]
4961
+ );
4954
4962
  this.exposeActions.showContextMenu(row, rowIndex, event);
4955
4963
  try {
4956
4964
  this.tableRef.setCurrentRow(row);
@@ -5264,25 +5272,8 @@ class TableManager extends IManager {
5264
5272
  return (_a = rowData[el.prop]) != null ? _a : "";
5265
5273
  }
5266
5274
  }
5267
- async exportDataToExcel(opts) {
5268
- var _a, _b, _c;
5269
- const depLoadResult = await this.loadExcelDependence();
5270
- if (!depLoadResult) {
5271
- return false;
5272
- }
5273
- const childrenKey = ((_b = (_a = this.table.props) == null ? void 0 : _a.treeProps) == null ? void 0 : _b.children) || "children";
5274
- function patchChildrenData(data) {
5275
- return data.reduce((memo, item) => {
5276
- memo.push(item);
5277
- if (item[childrenKey] && Array.isArray(item[childrenKey])) {
5278
- memo = memo.concat(patchChildrenData(item[childrenKey]));
5279
- }
5280
- return memo;
5281
- }, []);
5282
- }
5283
- const exportData = patchChildrenData(opts.data);
5284
- this.manager.context.$emit("_exported", exportData);
5285
- const exportEls = opts.columns.filter((a) => !a.children);
5275
+ getExcelDataHeader(columns) {
5276
+ const exportEls = columns.filter((a) => !a.children);
5286
5277
  const excelData = [[]];
5287
5278
  const cols = [];
5288
5279
  exportEls.forEach((el) => {
@@ -5291,16 +5282,55 @@ class TableManager extends IManager {
5291
5282
  wpx: el.width || el.minWidth || 120
5292
5283
  });
5293
5284
  });
5294
- for (let i = 0, len = exportData.length; i < len; i++) {
5285
+ return {
5286
+ exportEls,
5287
+ excelData,
5288
+ cols
5289
+ };
5290
+ }
5291
+ insertExcelData(excelData, exportEls, insertData) {
5292
+ for (let i = 0, len = insertData.length; i < len; i++) {
5295
5293
  const rowData = [];
5296
5294
  for (let j = 0; j < exportEls.length; j++) {
5297
- const item = exportData[i];
5295
+ const item = insertData[i];
5298
5296
  const el = exportEls[j];
5299
5297
  let val = this.getTableCellText(el, item);
5300
5298
  rowData.push(val);
5301
5299
  }
5302
5300
  excelData.push(rowData);
5303
5301
  }
5302
+ }
5303
+ patchChildrenData(data, childrenKey) {
5304
+ return data.reduce((memo, item) => {
5305
+ memo.push(item);
5306
+ if (item[childrenKey] && Array.isArray(item[childrenKey])) {
5307
+ memo = memo.concat(this.patchChildrenData(item[childrenKey], childrenKey));
5308
+ }
5309
+ return memo;
5310
+ }, []);
5311
+ }
5312
+ async exportDataToExcel(opts) {
5313
+ var _a, _b;
5314
+ const depLoadResult = await this.loadExcelDependence();
5315
+ if (!depLoadResult) {
5316
+ return false;
5317
+ }
5318
+ const childrenKey = ((_b = (_a = this.table.props) == null ? void 0 : _a.treeProps) == null ? void 0 : _b.children) || "children";
5319
+ const exportData = this.patchChildrenData(opts.data, childrenKey);
5320
+ this.manager.context.$emit("_exported", exportData);
5321
+ const {
5322
+ exportEls,
5323
+ excelData,
5324
+ cols
5325
+ } = this.getExcelDataHeader(opts.columns);
5326
+ this.insertExcelData(excelData, exportEls, exportData);
5327
+ this.exportDataToExcelByExcelData(opts.filename, excelData, cols, {
5328
+ exportData,
5329
+ exportEls
5330
+ });
5331
+ }
5332
+ exportDataToExcelByExcelData(filename, excelData, cols, mergeOpt) {
5333
+ var _a;
5304
5334
  try {
5305
5335
  let s2ab = function(s) {
5306
5336
  var buf = new ArrayBuffer(s.length);
@@ -5310,11 +5340,11 @@ class TableManager extends IManager {
5310
5340
  return buf;
5311
5341
  };
5312
5342
  var sheet = window.oXlsx.utils.aoa_to_sheet(excelData);
5313
- if (typeof ((_c = this.table.xlsx) == null ? void 0 : _c.mergeFn) === "function") {
5343
+ if (typeof ((_a = this.table.xlsx) == null ? void 0 : _a.mergeFn) === "function") {
5314
5344
  sheet["!merges"] = this.table.xlsx.mergeFn.call(
5315
5345
  this,
5316
- exportData,
5317
- exportEls
5346
+ mergeOpt.exportData || [],
5347
+ mergeOpt.exportEls || []
5318
5348
  );
5319
5349
  }
5320
5350
  Object.keys(sheet).forEach((colKey) => {
@@ -5369,7 +5399,7 @@ class TableManager extends IManager {
5369
5399
  const url = URL.createObjectURL(blob);
5370
5400
  const aLink = document.createElement("a");
5371
5401
  aLink.href = url;
5372
- aLink.download = opts.filename;
5402
+ aLink.download = filename;
5373
5403
  aLink.click();
5374
5404
  return true;
5375
5405
  } catch (e) {
@@ -6158,7 +6188,7 @@ const _hoisted_5$4 = {
6158
6188
  class: "el-table-cell_editable"
6159
6189
  };
6160
6190
  const _hoisted_6$3 = { class: "el-table-cell_editable-inputer" };
6161
- const _hoisted_7$3 = {
6191
+ const _hoisted_7$2 = {
6162
6192
  key: 0,
6163
6193
  class: "el-table-cell_loading"
6164
6194
  };
@@ -6385,7 +6415,7 @@ const _sfc_main$x = defineComponent({
6385
6415
  columnEl.columnKey,
6386
6416
  row[tableManager.value.rowKey]
6387
6417
  ) + "-loading"
6388
- ) ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
6418
+ ) ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
6389
6419
  createVNode(_component_el_icon, { class: "is-loading" }, {
6390
6420
  default: withCtx(() => [
6391
6421
  createVNode(unref(loading))
@@ -7543,12 +7573,6 @@ const _sfc_main$v = defineComponent({
7543
7573
  {
7544
7574
  label: "\u6C47\u603B"
7545
7575
  },
7546
- {
7547
- label: "\u5BBD\u5EA6"
7548
- },
7549
- {
7550
- label: "\u6700\u5C0F\u5BBD\u5EA6"
7551
- },
7552
7576
  {
7553
7577
  label: "\u56FA\u5B9A\u5217"
7554
7578
  }
@@ -7574,7 +7598,6 @@ const _sfc_main$v = defineComponent({
7574
7598
  const _component_el_switch = resolveComponent("el-switch");
7575
7599
  const _component_el_radio_button = resolveComponent("el-radio-button");
7576
7600
  const _component_el_radio_group = resolveComponent("el-radio-group");
7577
- const _component_el_input_number = resolveComponent("el-input-number");
7578
7601
  const _component_el_button = resolveComponent("el-button");
7579
7602
  return openBlock(), createBlock(_sfc_main$D, {
7580
7603
  modelValue: visible.value,
@@ -7693,30 +7716,6 @@ const _sfc_main$v = defineComponent({
7693
7716
  !_ctx.onlyShow ? (openBlock(), createElementBlock("div", {
7694
7717
  key: 2,
7695
7718
  class: normalizeClass(unref(createBEMName)("cell"))
7696
- }, [
7697
- createVNode(_component_el_input_number, {
7698
- modelValue: element.width,
7699
- "onUpdate:modelValue": ($event) => element.width = $event,
7700
- size: "small",
7701
- controls: false,
7702
- placeholder: "\u8F93\u5165\u6570\u5B57"
7703
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
7704
- ], 2)) : createCommentVNode("", true),
7705
- !_ctx.onlyShow ? (openBlock(), createElementBlock("div", {
7706
- key: 3,
7707
- class: normalizeClass(unref(createBEMName)("cell"))
7708
- }, [
7709
- createVNode(_component_el_input_number, {
7710
- modelValue: element.minWidth,
7711
- "onUpdate:modelValue": ($event) => element.minWidth = $event,
7712
- size: "small",
7713
- controls: false,
7714
- placeholder: "\u8F93\u5165\u6570\u5B57"
7715
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
7716
- ], 2)) : createCommentVNode("", true),
7717
- !_ctx.onlyShow ? (openBlock(), createElementBlock("div", {
7718
- key: 4,
7719
- class: normalizeClass(unref(createBEMName)("cell"))
7720
7719
  }, [
7721
7720
  createVNode(_component_el_radio_group, {
7722
7721
  modelValue: element.fixed,
@@ -7950,7 +7949,7 @@ const useUserConfig = () => {
7950
7949
  const tableChangeEmiter = new EventEmitter();
7951
7950
  var index_vue_vue_type_style_index_0_lang$6 = "";
7952
7951
  var index_vue_vue_type_style_index_1_scoped_true_lang$1 = "";
7953
- const _withScopeId$3 = (n) => (pushScopeId("data-v-1098de7a"), n = n(), popScopeId(), n);
7952
+ const _withScopeId$3 = (n) => (pushScopeId("data-v-5b551558"), n = n(), popScopeId(), n);
7954
7953
  const _hoisted_1$e = { title: "\u5168\u9009/\u53D6\u6D88" };
7955
7954
  const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("i", {
7956
7955
  class: "pm-icon icon-drag-dot",
@@ -7964,20 +7963,25 @@ const _sfc_main$t = defineComponent({
7964
7963
  props: {
7965
7964
  els: {}
7966
7965
  },
7967
- emits: ["save-columns", "export"],
7966
+ emits: ["save-columns"],
7968
7967
  setup(__props, { emit: __emit }) {
7969
7968
  const innerEls = ref([]);
7970
7969
  const { BEMSpace, createBEMName } = createBEMSpace("column-tools");
7971
7970
  const props = __props;
7972
7971
  const { els } = toRefs(props);
7973
7972
  const emit = __emit;
7973
+ const isExternalChange = ref(false);
7974
7974
  watch(
7975
7975
  els,
7976
7976
  () => {
7977
+ isExternalChange.value = true;
7977
7978
  innerEls.value = cloneDeep(props.els).map((a) => {
7978
7979
  a.userConfigShow = a.userConfigShow === false ? false : true;
7979
7980
  return a;
7980
7981
  });
7982
+ setTimeout(() => {
7983
+ isExternalChange.value = false;
7984
+ }, 10);
7981
7985
  },
7982
7986
  {
7983
7987
  immediate: true,
@@ -7987,6 +7991,19 @@ const _sfc_main$t = defineComponent({
7987
7991
  const onSaveColumns = () => {
7988
7992
  emit("save-columns", innerEls.value);
7989
7993
  };
7994
+ watch(
7995
+ () => {
7996
+ return innerEls.value;
7997
+ },
7998
+ () => {
7999
+ if (!isExternalChange.value) {
8000
+ onSaveColumns();
8001
+ }
8002
+ },
8003
+ {
8004
+ deep: true
8005
+ }
8006
+ );
7990
8007
  const {
7991
8008
  columnToolsSettingRef,
7992
8009
  showColumnToolsSetting,
@@ -7997,7 +8014,7 @@ const _sfc_main$t = defineComponent({
7997
8014
  emit("save-columns", columns);
7998
8015
  };
7999
8016
  const showSetting = () => {
8000
- showColumnToolsSetting(innerEls.value);
8017
+ showColumnToolsSetting(jsonClone(innerEls.value));
8001
8018
  };
8002
8019
  const { userConfig, updateUserConfig } = useUserShowRowConfig(props.els);
8003
8020
  const onSubmitConfig = (config) => {
@@ -8013,9 +8030,6 @@ const _sfc_main$t = defineComponent({
8013
8030
  const onShowUserConfig = () => {
8014
8031
  showUserConfig(userConfig.value);
8015
8032
  };
8016
- const onExportData = () => {
8017
- emit("export");
8018
- };
8019
8033
  const isAllShow = computed({
8020
8034
  get() {
8021
8035
  return innerEls.value.every((item) => !!item.userConfigShow);
@@ -8049,7 +8063,6 @@ const _sfc_main$t = defineComponent({
8049
8063
  return (_ctx, _cache) => {
8050
8064
  const _component_el_checkbox = resolveComponent("el-checkbox");
8051
8065
  const _component_el_icon = resolveComponent("el-icon");
8052
- const _component_el_button = resolveComponent("el-button");
8053
8066
  return openBlock(), createElementBlock(Fragment, null, [
8054
8067
  createElementVNode("div", {
8055
8068
  class: normalizeClass(unref(createBEMName)("header"))
@@ -8133,31 +8146,6 @@ const _sfc_main$t = defineComponent({
8133
8146
  _: 1
8134
8147
  }, 8, ["modelValue", "class"])
8135
8148
  ], 2),
8136
- createElementVNode("div", {
8137
- class: normalizeClass(unref(createBEMName)("actions"))
8138
- }, [
8139
- createVNode(_component_el_button, {
8140
- size: "small",
8141
- link: "",
8142
- onClick: onExportData
8143
- }, {
8144
- default: withCtx(() => [
8145
- createTextVNode("\u5BFC\u51FA\u8868\u683C")
8146
- ]),
8147
- _: 1
8148
- }),
8149
- createVNode(_component_el_button, {
8150
- size: "small",
8151
- link: "",
8152
- type: "primary",
8153
- onClick: onSaveColumns
8154
- }, {
8155
- default: withCtx(() => [
8156
- createTextVNode("\u4FDD\u5B58\u4FEE\u6539")
8157
- ]),
8158
- _: 1
8159
- })
8160
- ], 2),
8161
8149
  unref(isRenderColumnToolsSetting) ? (openBlock(), createBlock(_sfc_main$v, {
8162
8150
  key: 0,
8163
8151
  ref_key: "columnToolsSettingRef",
@@ -8176,16 +8164,15 @@ const _sfc_main$t = defineComponent({
8176
8164
  };
8177
8165
  }
8178
8166
  });
8179
- var ColumnTools$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-1098de7a"]]);
8167
+ var ColumnTools$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-5b551558"]]);
8180
8168
  var index_vue_vue_type_style_index_0_scoped_true_lang$9 = "";
8181
- const _withScopeId$2 = (n) => (pushScopeId("data-v-15dbe923"), n = n(), popScopeId(), n);
8169
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-d12a7d22"), n = n(), popScopeId(), n);
8182
8170
  const _hoisted_1$d = { key: 0 };
8183
- const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "export-wrod" }, "\u4ECE\u7B2C", -1));
8184
- const _hoisted_3$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "export-wrod" }, "\u9875\u5F00\u59CB\u5BFC\u51FA\uFF0C\u6BCF\u9875", -1));
8185
- const _hoisted_4$3 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "export-wrod" }, "\u6761\u6570\u636E", -1));
8186
- const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
8187
- const _hoisted_6$2 = { class: "export-columns" };
8188
- const _hoisted_7$2 = { class: "bottom-box" };
8171
+ const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "export-wrod" }, "\u5BFC\u51FA", -1));
8172
+ const _hoisted_3$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "export-wrod" }, "\u6761\u6570\u636E", -1));
8173
+ const _hoisted_4$3 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
8174
+ const _hoisted_5$2 = { class: "export-columns" };
8175
+ const _hoisted_6$2 = { class: "bottom-box" };
8189
8176
  const _sfc_main$s = defineComponent({
8190
8177
  __name: "index",
8191
8178
  emits: ["closed"],
@@ -8204,15 +8191,13 @@ const _sfc_main$s = defineComponent({
8204
8191
  };
8205
8192
  const formData = reactive({
8206
8193
  filename: getDefaultFileName(),
8207
- pageIndex: 1,
8208
- pageSize: 99999,
8194
+ pageSize: 100,
8209
8195
  fromApi: true,
8210
8196
  exportSelected: false
8211
8197
  });
8212
8198
  const resetFormData = () => {
8213
8199
  formData.filename = getDefaultFileName();
8214
- formData.pageIndex = 1;
8215
- formData.pageSize = 99999;
8200
+ formData.pageSize = 100;
8216
8201
  formData.fromApi = true;
8217
8202
  formData.exportSelected = false;
8218
8203
  };
@@ -8220,6 +8205,8 @@ const _sfc_main$s = defineComponent({
8220
8205
  const libLoading = ref(false);
8221
8206
  const dataLoading = ref(false);
8222
8207
  const libLoadFail = ref(false);
8208
+ const showProgress = ref(false);
8209
+ const apiLoadingProgress = ref(0);
8223
8210
  const loadXlsx = async () => {
8224
8211
  libLoading.value = true;
8225
8212
  loadingText.value = "\u4F9D\u8D56\u52A0\u8F7D\u4E2D";
@@ -8245,43 +8232,85 @@ const _sfc_main$s = defineComponent({
8245
8232
  });
8246
8233
  };
8247
8234
  const doExport = async () => {
8248
- var _a, _b;
8235
+ var _a, _b, _c, _d;
8249
8236
  const manager = tableManager.manager;
8250
8237
  const config = manager.config;
8251
8238
  const method = (_a = config.getMethod) == null ? void 0 : _a.toLowerCase();
8252
- let list = [];
8239
+ const checkedNodes = treeRef.value.getCheckedNodes();
8240
+ const tableEls = checkedNodes.filter((a) => !a.children);
8253
8241
  if (formData.fromApi) {
8254
8242
  try {
8255
8243
  loadingText.value = "\u6570\u636E\u52A0\u8F7D\u4E2D";
8256
8244
  dataLoading.value = true;
8257
8245
  let searchFormManager = manager.searchFormManager;
8246
+ const tableManager2 = manager.tableManager;
8258
8247
  let reqData = manager.getListReqData();
8259
8248
  if ((_b = config.searchForm) == null ? void 0 : _b.beforeSubmit) {
8260
- let result2 = config.searchForm.beforeSubmit.call(searchFormManager, reqData);
8261
- if (result2 instanceof Promise) {
8262
- result2 = await result2;
8249
+ let result = config.searchForm.beforeSubmit.call(searchFormManager, reqData);
8250
+ if (result instanceof Promise) {
8251
+ result = await result;
8263
8252
  }
8264
- if (!result2) {
8253
+ if (!result) {
8265
8254
  return false;
8266
8255
  }
8267
- reqData = result2;
8256
+ reqData = result;
8268
8257
  }
8269
- let reqResult = await PageModelManager.request[method](
8270
- config.getUrl,
8271
- {
8272
- ...reqData,
8273
- pageIndex: formData.pageIndex,
8274
- pageSize: formData.pageSize
8258
+ const exportPageSize = config.table.exportPageSize || 100;
8259
+ const reqPageSize = formData.pageSize;
8260
+ const perTimePageSize = Math.min(reqPageSize, exportPageSize);
8261
+ const requestTimes = Math.ceil(reqPageSize / perTimePageSize);
8262
+ const lastRequestPageSize = reqPageSize - (requestTimes - 1) * perTimePageSize;
8263
+ const depLoadResult = await tableManager2.loadExcelDependence();
8264
+ if (!depLoadResult) {
8265
+ return false;
8266
+ }
8267
+ showProgress.value = true;
8268
+ const { exportEls, excelData, cols } = tableManager2.getExcelDataHeader(tableEls);
8269
+ for (let index2 = 0; index2 < requestTimes; index2++) {
8270
+ apiLoadingProgress.value = Number((index2 / requestTimes * 100).toFixed(2));
8271
+ let reqResult = await PageModelManager.request[method](
8272
+ config.getUrl,
8273
+ {
8274
+ ...reqData,
8275
+ [tableManager2.pageIndexKey]: index2 + 1,
8276
+ [tableManager2.pageSizeKey]: perTimePageSize
8277
+ }
8278
+ );
8279
+ let result = manager.proceessResult(reqResult);
8280
+ let list = result.list;
8281
+ let resultCount = list.length;
8282
+ if (index2 === requestTimes - 1) {
8283
+ list = list.slice(0, lastRequestPageSize);
8275
8284
  }
8276
- );
8277
- var result = manager.proceessResult(reqResult);
8278
- list = result.list;
8285
+ const childrenKey = ((_d = (_c = tableManager2.table.props) == null ? void 0 : _c.treeProps) == null ? void 0 : _d.children) || "children";
8286
+ let exportData = [];
8287
+ if (childrenKey) {
8288
+ exportData = tableManager2.patchChildrenData(list, childrenKey);
8289
+ } else {
8290
+ exportData = list;
8291
+ }
8292
+ tableManager2.insertExcelData(excelData, exportEls, exportData);
8293
+ reqResult = null;
8294
+ result = null;
8295
+ list = null;
8296
+ exportData = null;
8297
+ if (resultCount < perTimePageSize) {
8298
+ apiLoadingProgress.value = 100;
8299
+ break;
8300
+ }
8301
+ }
8302
+ tableManager2.exportDataToExcelByExcelData(formData.filename, excelData, cols, {
8303
+ exportData: [],
8304
+ exportEls
8305
+ });
8306
+ showProgress.value = false;
8279
8307
  } catch (error) {
8280
8308
  ElMessage.warning("\u6570\u636E\u83B7\u53D6\u5931\u8D25!");
8281
8309
  } finally {
8282
8310
  dataLoading.value = false;
8283
8311
  }
8284
8312
  } else {
8313
+ let list = [];
8285
8314
  if (typeof config.table.getExportSelectableData === "function") {
8286
8315
  list = config.table.getExportSelectableData.call(tableManager);
8287
8316
  } else {
@@ -8295,16 +8324,14 @@ const _sfc_main$s = defineComponent({
8295
8324
  ElMessage.info("\u65E0\u5BFC\u51FA\u6570\u636E");
8296
8325
  return false;
8297
8326
  }
8298
- }
8299
- const checkedNodes = treeRef.value.getCheckedNodes();
8300
- const exportEls = checkedNodes.filter((a) => !a.children);
8301
- const exportResult = await tableManager.exportDataToExcel({
8302
- columns: exportEls,
8303
- data: list,
8304
- filename: formData.filename
8305
- });
8306
- if (!exportResult) {
8307
- return false;
8327
+ const exportResult = await tableManager.exportDataToExcel({
8328
+ columns: tableEls,
8329
+ data: list,
8330
+ filename: formData.filename
8331
+ });
8332
+ if (!exportResult) {
8333
+ return false;
8334
+ }
8308
8335
  }
8309
8336
  };
8310
8337
  const show = (data) => {
@@ -8337,24 +8364,27 @@ const _sfc_main$s = defineComponent({
8337
8364
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
8338
8365
  const _component_el_form = resolveComponent("el-form");
8339
8366
  const _component_el_empty = resolveComponent("el-empty");
8367
+ const _component_el_progress = resolveComponent("el-progress");
8340
8368
  const _component_el_button = resolveComponent("el-button");
8341
8369
  const _directive_loading = resolveDirective("loading");
8342
8370
  return openBlock(), createBlock(_sfc_main$D, {
8343
8371
  modelValue: visible.value,
8344
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => visible.value = $event),
8372
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => visible.value = $event),
8345
8373
  title: "\u5BFC\u51FA\u8868\u683C\u6570\u636E",
8346
8374
  width: "700px",
8347
8375
  "dialog-props": { appendToBody: true, destroyOnClose: true },
8348
8376
  "dialog-events": {
8349
- closed: onClosed
8377
+ closed: onClosed,
8378
+ closeOnClickModal: false,
8379
+ closeOnPressEscape: false
8350
8380
  }
8351
8381
  }, {
8352
8382
  bottom: withCtx(() => [
8353
- createElementVNode("div", _hoisted_7$2, [
8383
+ createElementVNode("div", _hoisted_6$2, [
8354
8384
  createVNode(_component_el_button, {
8355
- disabled: libLoading.value || libLoadFail.value,
8385
+ disabled: libLoading.value || dataLoading.value,
8356
8386
  type: "info",
8357
- onClick: _cache[5] || (_cache[5] = ($event) => visible.value = false)
8387
+ onClick: _cache[4] || (_cache[4] = ($event) => visible.value = false)
8358
8388
  }, {
8359
8389
  default: withCtx(() => [
8360
8390
  createTextVNode("\u53D6\u6D88")
@@ -8362,7 +8392,7 @@ const _sfc_main$s = defineComponent({
8362
8392
  _: 1
8363
8393
  }, 8, ["disabled"]),
8364
8394
  createVNode(_component_el_button, {
8365
- disabled: libLoading.value || libLoadFail.value,
8395
+ disabled: libLoading.value || libLoadFail.value || dataLoading.value,
8366
8396
  type: "success",
8367
8397
  onClick: doExport
8368
8398
  }, {
@@ -8412,35 +8442,25 @@ const _sfc_main$s = defineComponent({
8412
8442
  ]),
8413
8443
  _: 1
8414
8444
  }, 8, ["disabled"]),
8415
- createVNode(_component_el_radio, {
8416
- label: false,
8417
- disabled: !unref(tableManager).table.selectable
8418
- }, {
8445
+ createVNode(_component_el_radio, { label: false }, {
8419
8446
  default: withCtx(() => [
8420
8447
  createTextVNode("\u8868\u683C\u5F53\u524D\u9875\u6570\u636E")
8421
8448
  ]),
8422
8449
  _: 1
8423
- }, 8, ["disabled"])
8450
+ })
8424
8451
  ]),
8425
8452
  _: 1
8426
8453
  }, 8, ["modelValue"]),
8427
8454
  formData.fromApi ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
8428
8455
  _hoisted_2$5,
8429
- createVNode(_component_el_input_number, {
8430
- modelValue: formData.pageIndex,
8431
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.pageIndex = $event),
8432
- min: 1,
8433
- size: "small"
8434
- }, null, 8, ["modelValue"]),
8435
- _hoisted_3$4,
8436
8456
  createVNode(_component_el_input_number, {
8437
8457
  modelValue: formData.pageSize,
8438
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => formData.pageSize = $event),
8458
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.pageSize = $event),
8439
8459
  min: 1,
8440
8460
  size: "small"
8441
8461
  }, null, 8, ["modelValue"]),
8442
- _hoisted_4$3,
8443
- _hoisted_5$2
8462
+ _hoisted_3$4,
8463
+ _hoisted_4$3
8444
8464
  ])) : createCommentVNode("", true)
8445
8465
  ]),
8446
8466
  _: 1
@@ -8453,7 +8473,7 @@ const _sfc_main$s = defineComponent({
8453
8473
  default: withCtx(() => [
8454
8474
  createVNode(_component_el_radio_group, {
8455
8475
  modelValue: formData.exportSelected,
8456
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => formData.exportSelected = $event)
8476
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => formData.exportSelected = $event)
8457
8477
  }, {
8458
8478
  default: withCtx(() => [
8459
8479
  createVNode(_component_el_radio, { label: false }, {
@@ -8479,7 +8499,7 @@ const _sfc_main$s = defineComponent({
8479
8499
  })) : createCommentVNode("", true),
8480
8500
  createVNode(_component_el_form_item, { label: "\u5BFC\u51FA\u5B57\u6BB5" }, {
8481
8501
  default: withCtx(() => [
8482
- createElementVNode("div", _hoisted_6$2, [
8502
+ createElementVNode("div", _hoisted_5$2, [
8483
8503
  createVNode(_component_el_scrollbar, { height: "100%" }, {
8484
8504
  default: withCtx(() => [
8485
8505
  createVNode(_component_el_tree, {
@@ -8506,14 +8526,22 @@ const _sfc_main$s = defineComponent({
8506
8526
  ]),
8507
8527
  withDirectives(createVNode(_component_el_empty, { description: "\u4F9D\u8D56\u52A0\u8F7D\u5931\u8D25" }, null, 512), [
8508
8528
  [vShow, libLoadFail.value]
8509
- ])
8529
+ ]),
8530
+ showProgress.value ? (openBlock(), createBlock(_component_el_progress, {
8531
+ key: 0,
8532
+ class: "progress-box",
8533
+ "stroke-width": 20,
8534
+ "text-inside": true,
8535
+ striped: "",
8536
+ percentage: apiLoadingProgress.value
8537
+ }, null, 8, ["percentage"])) : createCommentVNode("", true)
8510
8538
  ]),
8511
8539
  _: 1
8512
8540
  }, 8, ["modelValue", "dialog-events"]);
8513
8541
  };
8514
8542
  }
8515
8543
  });
8516
- var ExportForm = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-15dbe923"]]);
8544
+ var ExportForm = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-d12a7d22"]]);
8517
8545
  const SAVE_NAME$2 = "table-columns";
8518
8546
  const columnsSaver$1 = new ConfigSaver(SAVE_NAME$2);
8519
8547
  const saveTableColumns = columnsSaver$1.setContents.bind(columnsSaver$1);
@@ -14367,7 +14395,7 @@ const defineEditableTable = function(config) {
14367
14395
  };
14368
14396
  var iconfont = "";
14369
14397
  const name = "@juzhenfe/page-model";
14370
- const version = "3.15.1";
14398
+ const version = "3.16.0";
14371
14399
  const types = "dist/main.d.ts";
14372
14400
  const main = "dist/index.umd.js";
14373
14401
  const keywords = [