@maxax/ui 1.1.29 → 1.1.31

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 (61) hide show
  1. package/dist/components/basic-button-export-max/BasicButtonExportMax.vue.d.ts +21 -0
  2. package/dist/components/basic-button-export-max/BasicButtonExportMax.vue.d.ts.map +1 -0
  3. package/dist/components/basic-button-export-max/context.d.ts +6 -0
  4. package/dist/components/basic-button-export-max/context.d.ts.map +1 -0
  5. package/dist/components/basic-button-export-max/index.d.ts +7 -0
  6. package/dist/components/basic-button-export-max/index.d.ts.map +1 -0
  7. package/dist/components/basic-button-export-max/interface.d.ts +22 -0
  8. package/dist/components/basic-button-export-max/interface.d.ts.map +1 -0
  9. package/dist/components/{basic-button-import-preview/BasicButtonImportPreview.vue.d.ts → basic-button-import-max/BasicButtonImportMax.vue.d.ts} +6 -6
  10. package/dist/components/basic-button-import-max/BasicButtonImportMax.vue.d.ts.map +1 -0
  11. package/dist/components/{basic-button-import-preview/BasicButtonImportPreviewModal.vue.d.ts → basic-button-import-max/BasicButtonImportMaxModal.vue.d.ts} +4 -4
  12. package/dist/components/basic-button-import-max/BasicButtonImportMaxModal.vue.d.ts.map +1 -0
  13. package/dist/components/basic-button-import-max/BasicButtonImportUploadModal.vue.d.ts.map +1 -0
  14. package/dist/components/basic-button-import-max/context.d.ts +6 -0
  15. package/dist/components/basic-button-import-max/context.d.ts.map +1 -0
  16. package/dist/components/basic-button-import-max/index.d.ts +7 -0
  17. package/dist/components/basic-button-import-max/index.d.ts.map +1 -0
  18. package/dist/components/{basic-button-import-preview → basic-button-import-max}/interface.d.ts +5 -5
  19. package/dist/components/basic-button-import-max/interface.d.ts.map +1 -0
  20. package/dist/components/basic-drawer/BasicDrawer.vue.d.ts +2 -2
  21. package/dist/components/basic-form/BasicForm.vue.d.ts +1 -1
  22. package/dist/components/basic-json-viewer/BasicJsonViewer.d.ts +1 -1
  23. package/dist/components/basic-json-viewer/components/TreeNode.d.ts +1 -1
  24. package/dist/components/index.d.ts +2 -2
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/index.cjs +159 -253
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.mjs +159 -253
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/locale/lang/en.d.ts.map +1 -1
  31. package/dist/locale/lang/zh-cn.d.ts.map +1 -1
  32. package/dist/locales.cjs +6 -2
  33. package/dist/locales.cjs.map +1 -1
  34. package/dist/locales.mjs +6 -2
  35. package/dist/locales.mjs.map +1 -1
  36. package/dist/theme-chalk/index.css +1 -1
  37. package/dist/theme-chalk/light.css +1 -1
  38. package/dist/{utils-BEqfRRBG.js → utils-BqJsjHj1.js} +6 -2
  39. package/dist/utils-BqJsjHj1.js.map +1 -0
  40. package/dist/{utils-COQsBuSS.cjs → utils-o29LtjNO.cjs} +6 -2
  41. package/dist/utils-o29LtjNO.cjs.map +1 -0
  42. package/package.json +4 -4
  43. package/dist/components/basic-button-import-preview/BasicButtonImportPreview.vue.d.ts.map +0 -1
  44. package/dist/components/basic-button-import-preview/BasicButtonImportPreviewModal.vue.d.ts.map +0 -1
  45. package/dist/components/basic-button-import-preview/BasicButtonImportUploadModal.vue.d.ts.map +0 -1
  46. package/dist/components/basic-button-import-preview/context.d.ts +0 -6
  47. package/dist/components/basic-button-import-preview/context.d.ts.map +0 -1
  48. package/dist/components/basic-button-import-preview/index.d.ts +0 -7
  49. package/dist/components/basic-button-import-preview/index.d.ts.map +0 -1
  50. package/dist/components/basic-button-import-preview/interface.d.ts.map +0 -1
  51. package/dist/components/basic-button-import-with-tpl/BasicButtonImportWithTpl.vue.d.ts +0 -23
  52. package/dist/components/basic-button-import-with-tpl/BasicButtonImportWithTpl.vue.d.ts.map +0 -1
  53. package/dist/components/basic-button-import-with-tpl/context.d.ts +0 -6
  54. package/dist/components/basic-button-import-with-tpl/context.d.ts.map +0 -1
  55. package/dist/components/basic-button-import-with-tpl/index.d.ts +0 -7
  56. package/dist/components/basic-button-import-with-tpl/index.d.ts.map +0 -1
  57. package/dist/components/basic-button-import-with-tpl/interface.d.ts +0 -20
  58. package/dist/components/basic-button-import-with-tpl/interface.d.ts.map +0 -1
  59. package/dist/utils-BEqfRRBG.js.map +0 -1
  60. package/dist/utils-COQsBuSS.cjs.map +0 -1
  61. /package/dist/components/{basic-button-import-preview → basic-button-import-max}/BasicButtonImportUploadModal.vue.d.ts +0 -0
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@ const utils = require("@maxax/utils");
4
4
  const vue = require("vue");
5
5
  const BScroll = require("@better-scroll/core");
6
6
  const naiveUi = require("naive-ui");
7
- const utils$1 = require("./utils-COQsBuSS.cjs");
7
+ const utils$1 = require("./utils-o29LtjNO.cjs");
8
8
  const lodashEs = require("lodash-es");
9
9
  const vxePcUi = require("vxe-pc-ui");
10
10
  const vxeTable = require("vxe-table");
@@ -2853,7 +2853,7 @@ const Icon = vue.defineComponent((props, { emit }) => {
2853
2853
  ],
2854
2854
  emits: ["load"]
2855
2855
  });
2856
- const _hoisted_1$e = ["xlink:href"];
2856
+ const _hoisted_1$d = ["xlink:href"];
2857
2857
  const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
2858
2858
  __name: "BasicSvgIcon",
2859
2859
  props: {
@@ -2888,7 +2888,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
2888
2888
  vue.createElementVNode("use", {
2889
2889
  "xlink:href": symbolId.value,
2890
2890
  fill: "currentColor"
2891
- }, null, 8, _hoisted_1$e)
2891
+ }, null, 8, _hoisted_1$d)
2892
2892
  ], 16)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2893
2893
  __props.icon ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), vue.mergeProps({
2894
2894
  key: 0,
@@ -3625,7 +3625,7 @@ const _export_sfc = (sfc, props) => {
3625
3625
  }
3626
3626
  return target;
3627
3627
  };
3628
- const _hoisted_1$d = ["aria-label", "aria-describedby"];
3628
+ const _hoisted_1$c = ["aria-label", "aria-describedby"];
3629
3629
  const _hoisted_2$4 = ["id"];
3630
3630
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
3631
3631
  const _component_BasicSvgIcon = vue.resolveComponent("BasicSvgIcon");
@@ -3783,7 +3783,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
3783
3783
  ])
3784
3784
  ], 2)
3785
3785
  ], 6)
3786
- ], 42, _hoisted_1$d)
3786
+ ], 42, _hoisted_1$c)
3787
3787
  ]),
3788
3788
  _: 3
3789
3789
  }, 8, ["z-index", "overlay-class", "mask"]), [
@@ -4263,7 +4263,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
4263
4263
  };
4264
4264
  }
4265
4265
  });
4266
- const _hoisted_1$c = ["multiple", "name", "accept"];
4266
+ const _hoisted_1$b = ["multiple", "name", "accept"];
4267
4267
  const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
4268
4268
  __name: "BasicButtonImport",
4269
4269
  props: {
@@ -4351,7 +4351,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
4351
4351
  accept: __props.accept,
4352
4352
  style: vue.normalizeStyle(buttonStyle.value),
4353
4353
  onChange: onFileChange
4354
- }, null, 44, _hoisted_1$c)),
4354
+ }, null, 44, _hoisted_1$b)),
4355
4355
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
4356
4356
  vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.basic.import")), 1)
4357
4357
  ])
@@ -4394,10 +4394,133 @@ const XBasicButtonImport = utils.withInstall(_sfc_main$K);
4394
4394
  const XBasicButtonPrint = utils.withInstall(_sfc_main$J);
4395
4395
  const XBasicButtonDrop = utils.withInstall(_sfc_main$O);
4396
4396
  const XBasicButtonExportDrop = utils.withInstall(_sfc_main$L);
4397
+ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
4398
+ __name: "BasicButtonExportMax",
4399
+ props: {
4400
+ drop: { type: Boolean, default: true },
4401
+ disabled: { type: Boolean },
4402
+ icon: { default: "ri:export-line" },
4403
+ options: { default: () => [
4404
+ { label: "全部导出", key: "all" },
4405
+ { label: "按选择条目导出", key: "select" }
4406
+ ] },
4407
+ exportApi: {},
4408
+ beforeFetch: {},
4409
+ afterFetch: {},
4410
+ showProgress: { type: Boolean, default: true }
4411
+ },
4412
+ emits: ["click"],
4413
+ setup(__props, { emit: __emit }) {
4414
+ const props = __props;
4415
+ const emit = __emit;
4416
+ const { b } = useNamespace("basic-button-export-max");
4417
+ const { b: bm, e: em } = useNamespace("basic-button-export-max-modal");
4418
+ const progressVisible = vue.ref(false);
4419
+ const progressPercent = vue.ref(0);
4420
+ const attrs = vue.useAttrs();
4421
+ const { t } = useLocale();
4422
+ const cOptions = vue.computed(() => {
4423
+ var _a;
4424
+ return ((_a = props.options) != null ? _a : []).map((option) => {
4425
+ return option;
4426
+ });
4427
+ });
4428
+ function getFetchParams(key2) {
4429
+ return props.beforeFetch ? props.beforeFetch(key2) : {};
4430
+ }
4431
+ function getFetchApi(key2) {
4432
+ var _a;
4433
+ if (!props.drop) return props.exportApi;
4434
+ const option = (_a = props.options) == null ? void 0 : _a.find((option2) => option2.key === key2);
4435
+ return (option == null ? void 0 : option.api) || props.exportApi;
4436
+ }
4437
+ function onDownloadProgress(progressEvent) {
4438
+ if (progressEvent.total) {
4439
+ const percent = Math.round(progressEvent.loaded * 100 / progressEvent.total);
4440
+ progressPercent.value = percent;
4441
+ }
4442
+ }
4443
+ async function trigger(key2) {
4444
+ const api = getFetchApi(key2);
4445
+ const params = getFetchParams(key2);
4446
+ if (!api) return;
4447
+ if (props.showProgress) {
4448
+ progressPercent.value = 0;
4449
+ progressVisible.value = true;
4450
+ }
4451
+ const { response, error } = await api(params, { onDownloadProgress });
4452
+ if (props.showProgress) {
4453
+ progressPercent.value = 100;
4454
+ progressVisible.value = false;
4455
+ }
4456
+ if (error) return;
4457
+ utils.downloadFileByResponseData(response);
4458
+ emit("click", key2);
4459
+ }
4460
+ function onMultiExportClick(key2) {
4461
+ if (!key2) return;
4462
+ trigger(key2);
4463
+ }
4464
+ function onSingleExportClick() {
4465
+ trigger("max");
4466
+ }
4467
+ return (_ctx, _cache) => {
4468
+ const _component_XBasicButton = vue.resolveComponent("XBasicButton");
4469
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
4470
+ __props.drop ? (vue.openBlock(), vue.createBlock(_sfc_main$O, vue.mergeProps({
4471
+ key: 0,
4472
+ icon: __props.icon,
4473
+ options: cOptions.value,
4474
+ class: vue.unref(b)()
4475
+ }, vue.unref(attrs), { onClick: onMultiExportClick }), {
4476
+ default: vue.withCtx(() => [
4477
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
4478
+ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.basic.export")), 1)
4479
+ ])
4480
+ ]),
4481
+ _: 3
4482
+ }, 16, ["icon", "options", "class"])) : (vue.openBlock(), vue.createBlock(_component_XBasicButton, vue.mergeProps({
4483
+ key: 1,
4484
+ icon: __props.icon,
4485
+ type: "primary"
4486
+ }, vue.unref(attrs), { onClick: onSingleExportClick }), {
4487
+ default: vue.withCtx(() => [
4488
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
4489
+ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.basic.export")), 1)
4490
+ ])
4491
+ ]),
4492
+ _: 3
4493
+ }, 16, ["icon"])),
4494
+ vue.createVNode(vue.unref(naiveUi.NModal), {
4495
+ show: progressVisible.value,
4496
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => progressVisible.value = $event),
4497
+ closable: false,
4498
+ preset: "card",
4499
+ class: vue.normalizeClass(vue.unref(bm)())
4500
+ }, {
4501
+ default: vue.withCtx(() => [
4502
+ vue.createElementVNode("div", {
4503
+ class: vue.normalizeClass(vue.unref(em)("progress-content"))
4504
+ }, [
4505
+ vue.createVNode(vue.unref(naiveUi.NProgress), {
4506
+ type: "line",
4507
+ percentage: progressPercent.value,
4508
+ "indicator-placement": "inside"
4509
+ }, null, 8, ["percentage"]),
4510
+ vue.createElementVNode("p", null, vue.toDisplayString(vue.unref(t)("max.basic.exportingTip")), 1)
4511
+ ], 2)
4512
+ ]),
4513
+ _: 1
4514
+ }, 8, ["show", "class"])
4515
+ ], 64);
4516
+ };
4517
+ }
4518
+ });
4519
+ const XBasicButtonExportMax = utils.withInstall(_sfc_main$I);
4397
4520
  function _isSlot$3(s) {
4398
4521
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
4399
4522
  }
4400
- const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
4523
+ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
4401
4524
  name: "ButtonGroupItem",
4402
4525
  props: {
4403
4526
  schema: {
@@ -4750,7 +4873,7 @@ function useButtonGroupSchema({ getProps, schemaRef }) {
4750
4873
  });
4751
4874
  return { getSchema };
4752
4875
  }
4753
- const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
4876
+ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
4754
4877
  __name: "BasicButtonGroup",
4755
4878
  props: {
4756
4879
  showReturnButton: { type: Boolean },
@@ -4831,7 +4954,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
4831
4954
  return (_ctx, _cache) => {
4832
4955
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: vue.unref(getWrapperClass) }, getBindValue.value), [
4833
4956
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(getSchema), (schema) => {
4834
- return vue.openBlock(), vue.createBlock(_sfc_main$I, {
4957
+ return vue.openBlock(), vue.createBlock(_sfc_main$H, {
4835
4958
  key: schema.field,
4836
4959
  schema,
4837
4960
  "button-group-action-type": buttonGroupActionType,
@@ -4852,12 +4975,12 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
4852
4975
  };
4853
4976
  }
4854
4977
  });
4855
- const XBasicButtonGroup = utils.withInstall(_sfc_main$H);
4856
- const _hoisted_1$b = ["id"];
4978
+ const XBasicButtonGroup = utils.withInstall(_sfc_main$G);
4979
+ const _hoisted_1$a = ["id"];
4857
4980
  const _hoisted_2$3 = ["textContent"];
4858
4981
  const _hoisted_3 = { key: 0 };
4859
4982
  const _hoisted_4 = ["innerHTML"];
4860
- const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
4983
+ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
4861
4984
  __name: "BasicNotification",
4862
4985
  props: {
4863
4986
  customClass: { default: "" },
@@ -4993,7 +5116,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
4993
5116
  }, null, 8, ["class"])) : vue.createCommentVNode("", true)
4994
5117
  ])
4995
5118
  ], 2)
4996
- ], 46, _hoisted_1$b), [
5119
+ ], 46, _hoisted_1$a), [
4997
5120
  [vue.vShow, visible.value]
4998
5121
  ])
4999
5122
  ]),
@@ -5044,7 +5167,7 @@ const notify = (options, context) => {
5044
5167
  appendTo = document.body;
5045
5168
  }
5046
5169
  const container = document.createElement("div");
5047
- const vm = vue.createVNode(_sfc_main$G, props, utils.isFunction(props.message) ? props.message : vue.isVNode(props.message) ? () => props.message : null);
5170
+ const vm = vue.createVNode(_sfc_main$F, props, utils.isFunction(props.message) ? props.message : vue.isVNode(props.message) ? () => props.message : null);
5048
5171
  vm.appContext = utils.isUndefined(context) ? notify._context : context;
5049
5172
  vm.props.onDestroy = () => {
5050
5173
  vue.render(null, container);
@@ -5938,8 +6061,8 @@ function useTableForm(propsRef, { fetch: fetch2, getLoading, setPagination, setS
5938
6061
  handleSearchInfoReload
5939
6062
  };
5940
6063
  }
5941
- const _hoisted_1$a = { class: "max-table-selection-count" };
5942
- const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6064
+ const _hoisted_1$9 = { class: "max-table-selection-count" };
6065
+ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
5943
6066
  __name: "BasicTable",
5944
6067
  props: {
5945
6068
  layouts: {},
@@ -6388,7 +6511,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6388
6511
  class: vue.normalizeClass(vue.unref(e)("selection-count"))
6389
6512
  }, [
6390
6513
  vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("max.basic.selected")), 1),
6391
- vue.createElementVNode("span", _hoisted_1$a, vue.toDisplayString(vue.unref(getSelectRows)().length), 1),
6514
+ vue.createElementVNode("span", _hoisted_1$9, vue.toDisplayString(vue.unref(getSelectRows)().length), 1),
6392
6515
  vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("max.basic.item")), 1)
6393
6516
  ], 2)
6394
6517
  ], 2)) : vue.createCommentVNode("", true),
@@ -6456,9 +6579,9 @@ vxeTable.VxeUI.formats.mixin(vxeTableFormatter);
6456
6579
  vxeTable.VxeUI.setConfig({
6457
6580
  zIndex: 2e3
6458
6581
  });
6459
- const XBasicTable = utils.withInstall(_sfc_main$F);
6460
- const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
6461
- __name: "BasicButtonImportPreviewModal",
6582
+ const XBasicTable = utils.withInstall(_sfc_main$E);
6583
+ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
6584
+ __name: "BasicButtonImportMaxModal",
6462
6585
  props: {
6463
6586
  previewWidth: {},
6464
6587
  previewColumns: {},
@@ -6470,7 +6593,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
6470
6593
  const props = __props;
6471
6594
  const emit = __emit;
6472
6595
  const basicTableRef = vue.useTemplateRef("basicTableRef");
6473
- const { b: bm, e: em } = useNamespace("basic-button-import-preview-modal");
6596
+ const { b: bm, e: em } = useNamespace("basic-button-import-max-modal");
6474
6597
  const { t } = useLocale();
6475
6598
  const tableDataCount = vue.ref(0);
6476
6599
  const { visible, show, hide } = useBasicDrawerModal({
@@ -8225,8 +8348,8 @@ const BasicUpload = /* @__PURE__ */ vue.defineComponent({
8225
8348
  }
8226
8349
  });
8227
8350
  const XBasicUpload = utils.withInstall(BasicUpload);
8228
- const _hoisted_1$9 = { key: 0 };
8229
- const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8351
+ const _hoisted_1$8 = { key: 0 };
8352
+ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8230
8353
  __name: "BasicButtonImportUploadModal",
8231
8354
  props: {
8232
8355
  width: {},
@@ -8237,7 +8360,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8237
8360
  setup(__props, { expose: __expose, emit: __emit }) {
8238
8361
  const props = __props;
8239
8362
  const emit = __emit;
8240
- const { b: bm, e: em } = useNamespace("basic-button-import-preview-modal");
8363
+ const { b: bm, e: em } = useNamespace("basic-button-import-max-modal");
8241
8364
  const { t } = useLocale();
8242
8365
  const fileList = vue.ref([]);
8243
8366
  const checked = vue.ref(false);
@@ -8292,7 +8415,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8292
8415
  vue.createElementVNode("div", {
8293
8416
  class: vue.normalizeClass(vue.unref(em)("footer-left"))
8294
8417
  }, [
8295
- props.showCoverSwitch ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$9, [
8418
+ props.showCoverSwitch ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$8, [
8296
8419
  vue.createElementVNode("span", {
8297
8420
  class: vue.normalizeClass([vue.unref(em)("footer-text"), { [vue.unref(em)("footer-text--checked")]: checked.value }])
8298
8421
  }, vue.toDisplayString(vue.unref(t)("max.import.updateExisting")), 3),
@@ -8379,8 +8502,8 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8379
8502
  };
8380
8503
  }
8381
8504
  });
8382
- const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8383
- __name: "BasicButtonImportPreview",
8505
+ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8506
+ __name: "BasicButtonImportMax",
8384
8507
  props: {
8385
8508
  showTplButton: { type: Boolean, default: true },
8386
8509
  showCoverSwitch: { type: Boolean },
@@ -8406,7 +8529,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8406
8529
  const emit = __emit;
8407
8530
  const previewModalRef = vue.useTemplateRef("previewModalRef");
8408
8531
  const uploadModalRef = vue.useTemplateRef("uploadModalRef");
8409
- const { b } = useNamespace("basic-button-import-preview");
8532
+ const { b } = useNamespace("basic-button-import-max");
8410
8533
  const { t } = useLocale();
8411
8534
  const attrs = vue.useAttrs();
8412
8535
  const currentFile = vue.ref(null);
@@ -8531,7 +8654,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8531
8654
  _: 3
8532
8655
  }, 16)
8533
8656
  ], 2),
8534
- vue.createVNode(_sfc_main$D, {
8657
+ vue.createVNode(_sfc_main$C, {
8535
8658
  ref_key: "uploadModalRef",
8536
8659
  ref: uploadModalRef,
8537
8660
  width: props.width,
@@ -8540,7 +8663,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8540
8663
  onConfirm: onUploadConfirm,
8541
8664
  onDownloadTemplate: onExport
8542
8665
  }, null, 8, ["width", "show-tpl-button", "show-cover-switch"]),
8543
- vue.createVNode(_sfc_main$E, {
8666
+ vue.createVNode(_sfc_main$D, {
8544
8667
  ref_key: "previewModalRef",
8545
8668
  ref: previewModalRef,
8546
8669
  "preview-width": props.previewWidth,
@@ -8553,224 +8676,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8553
8676
  };
8554
8677
  }
8555
8678
  });
8556
- const XBasicButtonImportPreview = utils.withInstall(_sfc_main$C);
8557
- const _hoisted_1$8 = { key: 0 };
8558
- const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8559
- __name: "BasicButtonImportWithTpl",
8560
- props: {
8561
- showTplButton: { type: Boolean, default: true },
8562
- showCoverSwitch: { type: Boolean },
8563
- width: {},
8564
- href: {},
8565
- importApi: {},
8566
- templateApi: {},
8567
- handleSearchInfoFn: {}
8568
- },
8569
- emits: ["confirm"],
8570
- setup(__props, { emit: __emit }) {
8571
- const props = __props;
8572
- const emit = __emit;
8573
- const { b } = useNamespace("basic-button-import-with-tpl");
8574
- const { b: bm, e: em } = useNamespace("basic-button-import-with-tpl-modal");
8575
- const { t } = useLocale();
8576
- const attrs = vue.useAttrs();
8577
- const visible = vue.ref(false);
8578
- const fileList = vue.ref([]);
8579
- const checked = vue.ref(false);
8580
- const loading = vue.ref(false);
8581
- const modalStyle = vue.computed(() => {
8582
- return { width: props.width || "630px" };
8583
- });
8584
- async function onImport() {
8585
- const { importApi, handleSearchInfoFn } = props;
8586
- if (!importApi || loading.value) return;
8587
- try {
8588
- loading.value = true;
8589
- const po = new FormData();
8590
- po.append("file", fileList.value[0].originFileObj);
8591
- const params = handleSearchInfoFn ? handleSearchInfoFn(po) : po;
8592
- const { error, data } = await importApi(params);
8593
- if (error) return;
8594
- emit("confirm", { data, checked: checked.value });
8595
- visible.value = false;
8596
- } catch (error) {
8597
- console.error(error);
8598
- } finally {
8599
- loading.value = false;
8600
- }
8601
- }
8602
- async function onExport() {
8603
- if (props.href) {
8604
- const url = typeof props.href === "function" ? props.href() : props.href;
8605
- window.open(url, "_blank");
8606
- return;
8607
- }
8608
- const { templateApi } = props;
8609
- if (!templateApi) {
8610
- XBasicNotification.error(t("max.import.noTemplateApi"));
8611
- return;
8612
- }
8613
- try {
8614
- loading.value = true;
8615
- const { error, response } = await templateApi();
8616
- if (error) return;
8617
- XBasicNotification.success(t("max.import.exportSuccess"));
8618
- utils.downloadFileByResponseData(response);
8619
- } catch (error) {
8620
- console.error(error);
8621
- } finally {
8622
- loading.value = false;
8623
- }
8624
- }
8625
- const beforeUpload = (file) => {
8626
- const isLt2M = (file.size || 0) / 1024 / 1024 < 50;
8627
- if (!isLt2M) {
8628
- XBasicNotification.error(t("max.import.fileSizeLimit"));
8629
- return false;
8630
- }
8631
- return false;
8632
- };
8633
- function onPositiveClickHandler() {
8634
- if (fileList.value.length === 0) {
8635
- XBasicNotification.error(t("max.import.uploadFile"));
8636
- return;
8637
- }
8638
- XBasicMessageBox.confirm(t("max.import.confirmImport"), {
8639
- confirmButtonText: t("max.import.confirm"),
8640
- cancelButtonText: t("max.import.cancel")
8641
- }).then(() => {
8642
- onImport();
8643
- }).catch(() => {
8644
- });
8645
- }
8646
- function onClickHandler() {
8647
- fileList.value = [];
8648
- visible.value = true;
8649
- }
8650
- function downloadTemplate() {
8651
- onExport();
8652
- }
8653
- return (_ctx, _cache) => {
8654
- return vue.openBlock(), vue.createElementBlock("span", null, [
8655
- vue.createElementVNode("div", {
8656
- class: vue.normalizeClass(vue.unref(b)())
8657
- }, [
8658
- vue.createVNode(vue.unref(XBasicButton), vue.mergeProps({
8659
- icon: "ri:import-line",
8660
- type: "primary"
8661
- }, vue.unref(attrs), { onClick: onClickHandler }), {
8662
- default: vue.withCtx(() => [
8663
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
8664
- vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.import.import")), 1)
8665
- ])
8666
- ]),
8667
- _: 3
8668
- }, 16)
8669
- ], 2),
8670
- vue.createVNode(vue.unref(naiveUi.NModal), {
8671
- show: visible.value,
8672
- "onUpdate:show": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
8673
- segmented: { footer: "soft" },
8674
- closable: false,
8675
- preset: "card",
8676
- class: vue.normalizeClass(vue.unref(bm)()),
8677
- style: vue.normalizeStyle(modalStyle.value)
8678
- }, {
8679
- footer: vue.withCtx(() => [
8680
- vue.createElementVNode("span", {
8681
- class: vue.normalizeClass(vue.unref(em)("footer"))
8682
- }, [
8683
- vue.createElementVNode("div", {
8684
- class: vue.normalizeClass(vue.unref(em)("footer-left"))
8685
- }, [
8686
- __props.showCoverSwitch ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$8, [
8687
- vue.createElementVNode("span", {
8688
- class: vue.normalizeClass([vue.unref(em)("footer-text"), { [vue.unref(em)("footer-text--checked")]: checked.value }])
8689
- }, vue.toDisplayString(vue.unref(t)("max.import.updateExisting")), 3),
8690
- vue.createVNode(vue.unref(naiveUi.NSwitch), {
8691
- checked: checked.value,
8692
- "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => checked.value = $event),
8693
- class: vue.normalizeClass(vue.unref(em)("footer-switch"))
8694
- }, null, 8, ["checked", "class"])
8695
- ])) : vue.createCommentVNode("", true)
8696
- ], 2),
8697
- vue.createElementVNode("span", {
8698
- class: vue.normalizeClass(vue.unref(em)("footer-right"))
8699
- }, [
8700
- vue.createVNode(vue.unref(XBasicButton), {
8701
- class: vue.normalizeClass(vue.unref(em)("footer-btn")),
8702
- onClick: _cache[2] || (_cache[2] = ($event) => visible.value = false)
8703
- }, {
8704
- default: vue.withCtx(() => [
8705
- vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.import.cancel")), 1)
8706
- ]),
8707
- _: 1
8708
- }, 8, ["class"]),
8709
- vue.createVNode(vue.unref(XBasicButton), {
8710
- type: "primary",
8711
- onClick: onPositiveClickHandler
8712
- }, {
8713
- default: vue.withCtx(() => [
8714
- vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.import.confirm")), 1)
8715
- ]),
8716
- _: 1
8717
- })
8718
- ], 2)
8719
- ], 2)
8720
- ]),
8721
- default: vue.withCtx(() => [
8722
- vue.createElementVNode("div", null, [
8723
- vue.createVNode(vue.unref(XBasicUpload), {
8724
- "file-list": fileList.value,
8725
- "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => fileList.value = $event),
8726
- "before-upload": beforeUpload,
8727
- "show-upload-list": "",
8728
- type: "drag",
8729
- "max-count": 1,
8730
- accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
8731
- }, {
8732
- default: vue.withCtx(() => [
8733
- vue.createElementVNode("p", {
8734
- class: vue.normalizeClass(vue.unref(em)("upload-icon"))
8735
- }, [
8736
- vue.createVNode(vue.unref(XBasicSvgIcon), {
8737
- icon: "ri:upload-2-line",
8738
- class: vue.normalizeClass(vue.unref(em)("upload-icon-svg"))
8739
- }, null, 8, ["class"])
8740
- ], 2),
8741
- vue.createElementVNode("p", {
8742
- class: vue.normalizeClass(vue.unref(em)("upload-text"))
8743
- }, vue.toDisplayString(vue.unref(t)("max.import.uploadTip")), 3)
8744
- ]),
8745
- _: 1
8746
- }, 8, ["file-list"]),
8747
- __props.showTplButton ? (vue.openBlock(), vue.createElementBlock("div", {
8748
- key: 0,
8749
- class: vue.normalizeClass(vue.unref(em)("tips"))
8750
- }, [
8751
- vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("max.import.allowedFormats")), 1),
8752
- vue.createVNode(vue.unref(XBasicButton), {
8753
- type: "primary",
8754
- size: "tiny",
8755
- secondary: "",
8756
- icon: "ri-file-excel-2-line",
8757
- onClick: downloadTemplate
8758
- }, {
8759
- default: vue.withCtx(() => [
8760
- vue.createTextVNode(vue.toDisplayString(vue.unref(t)("max.import.downloadTemplate")), 1)
8761
- ]),
8762
- _: 1
8763
- })
8764
- ], 2)) : vue.createCommentVNode("", true)
8765
- ])
8766
- ]),
8767
- _: 1
8768
- }, 8, ["show", "class", "style"])
8769
- ]);
8770
- };
8771
- }
8772
- });
8773
- const XBasicButtonImportWithTpl = utils.withInstall(_sfc_main$B);
8679
+ const XBasicButtonImportMax = utils.withInstall(_sfc_main$B);
8774
8680
  const _hoisted_1$7 = ["title"];
8775
8681
  const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
8776
8682
  __name: "BasicText",
@@ -27807,8 +27713,8 @@ const components = [
27807
27713
  XBasicCard,
27808
27714
  XBasicRegion,
27809
27715
  XBasicRegionSelect,
27810
- XBasicButtonImportWithTpl,
27811
- XBasicButtonImportPreview
27716
+ XBasicButtonImportMax,
27717
+ XBasicButtonExportMax
27812
27718
  ];
27813
27719
  const makeInstaller = (components2 = []) => {
27814
27720
  const install2 = (app, options) => {
@@ -28153,10 +28059,10 @@ exports.XBasicButtonDrop = XBasicButtonDrop;
28153
28059
  exports.XBasicButtonEdit = XBasicButtonEdit;
28154
28060
  exports.XBasicButtonExport = XBasicButtonExport;
28155
28061
  exports.XBasicButtonExportDrop = XBasicButtonExportDrop;
28062
+ exports.XBasicButtonExportMax = XBasicButtonExportMax;
28156
28063
  exports.XBasicButtonGroup = XBasicButtonGroup;
28157
28064
  exports.XBasicButtonImport = XBasicButtonImport;
28158
- exports.XBasicButtonImportPreview = XBasicButtonImportPreview;
28159
- exports.XBasicButtonImportWithTpl = XBasicButtonImportWithTpl;
28065
+ exports.XBasicButtonImportMax = XBasicButtonImportMax;
28160
28066
  exports.XBasicButtonPrint = XBasicButtonPrint;
28161
28067
  exports.XBasicCard = XBasicCard;
28162
28068
  exports.XBasicCascader = XBasicCascader;