@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.
- package/dist/components/basic-button-export-max/BasicButtonExportMax.vue.d.ts +21 -0
- package/dist/components/basic-button-export-max/BasicButtonExportMax.vue.d.ts.map +1 -0
- package/dist/components/basic-button-export-max/context.d.ts +6 -0
- package/dist/components/basic-button-export-max/context.d.ts.map +1 -0
- package/dist/components/basic-button-export-max/index.d.ts +7 -0
- package/dist/components/basic-button-export-max/index.d.ts.map +1 -0
- package/dist/components/basic-button-export-max/interface.d.ts +22 -0
- package/dist/components/basic-button-export-max/interface.d.ts.map +1 -0
- package/dist/components/{basic-button-import-preview/BasicButtonImportPreview.vue.d.ts → basic-button-import-max/BasicButtonImportMax.vue.d.ts} +6 -6
- package/dist/components/basic-button-import-max/BasicButtonImportMax.vue.d.ts.map +1 -0
- package/dist/components/{basic-button-import-preview/BasicButtonImportPreviewModal.vue.d.ts → basic-button-import-max/BasicButtonImportMaxModal.vue.d.ts} +4 -4
- package/dist/components/basic-button-import-max/BasicButtonImportMaxModal.vue.d.ts.map +1 -0
- package/dist/components/basic-button-import-max/BasicButtonImportUploadModal.vue.d.ts.map +1 -0
- package/dist/components/basic-button-import-max/context.d.ts +6 -0
- package/dist/components/basic-button-import-max/context.d.ts.map +1 -0
- package/dist/components/basic-button-import-max/index.d.ts +7 -0
- package/dist/components/basic-button-import-max/index.d.ts.map +1 -0
- package/dist/components/{basic-button-import-preview → basic-button-import-max}/interface.d.ts +5 -5
- package/dist/components/basic-button-import-max/interface.d.ts.map +1 -0
- package/dist/components/basic-drawer/BasicDrawer.vue.d.ts +2 -2
- package/dist/components/basic-form/BasicForm.vue.d.ts +1 -1
- package/dist/components/basic-json-viewer/BasicJsonViewer.d.ts +1 -1
- package/dist/components/basic-json-viewer/components/TreeNode.d.ts +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +159 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +159 -253
- package/dist/index.mjs.map +1 -1
- package/dist/locale/lang/en.d.ts.map +1 -1
- package/dist/locale/lang/zh-cn.d.ts.map +1 -1
- package/dist/locales.cjs +6 -2
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.mjs +6 -2
- package/dist/locales.mjs.map +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/light.css +1 -1
- package/dist/{utils-BEqfRRBG.js → utils-BqJsjHj1.js} +6 -2
- package/dist/utils-BqJsjHj1.js.map +1 -0
- package/dist/{utils-COQsBuSS.cjs → utils-o29LtjNO.cjs} +6 -2
- package/dist/utils-o29LtjNO.cjs.map +1 -0
- package/package.json +4 -4
- package/dist/components/basic-button-import-preview/BasicButtonImportPreview.vue.d.ts.map +0 -1
- package/dist/components/basic-button-import-preview/BasicButtonImportPreviewModal.vue.d.ts.map +0 -1
- package/dist/components/basic-button-import-preview/BasicButtonImportUploadModal.vue.d.ts.map +0 -1
- package/dist/components/basic-button-import-preview/context.d.ts +0 -6
- package/dist/components/basic-button-import-preview/context.d.ts.map +0 -1
- package/dist/components/basic-button-import-preview/index.d.ts +0 -7
- package/dist/components/basic-button-import-preview/index.d.ts.map +0 -1
- package/dist/components/basic-button-import-preview/interface.d.ts.map +0 -1
- package/dist/components/basic-button-import-with-tpl/BasicButtonImportWithTpl.vue.d.ts +0 -23
- package/dist/components/basic-button-import-with-tpl/BasicButtonImportWithTpl.vue.d.ts.map +0 -1
- package/dist/components/basic-button-import-with-tpl/context.d.ts +0 -6
- package/dist/components/basic-button-import-with-tpl/context.d.ts.map +0 -1
- package/dist/components/basic-button-import-with-tpl/index.d.ts +0 -7
- package/dist/components/basic-button-import-with-tpl/index.d.ts.map +0 -1
- package/dist/components/basic-button-import-with-tpl/interface.d.ts +0 -20
- package/dist/components/basic-button-import-with-tpl/interface.d.ts.map +0 -1
- package/dist/utils-BEqfRRBG.js.map +0 -1
- package/dist/utils-COQsBuSS.cjs.map +0 -1
- /package/dist/components/{basic-button-import-preview → basic-button-import-max}/BasicButtonImportUploadModal.vue.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { camelize, isNumber, isString, removeClass, addClass, pascalCase, isClie
|
|
|
2
2
|
import { shallowRef, shallowReadonly, onUnmounted, onMounted, nextTick, getCurrentScope, onScopeDispose, toValue, getCurrentInstance, watch, computed, unref, Fragment, isVNode, Comment, Text, watchEffect, onBeforeUnmount, inject, ref, isRef, toRaw, defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, h, useAttrs, mergeProps, createBlock, createCommentVNode, withCtx, createTextVNode, toDisplayString, createVNode, useSlots, createSlots, provide, reactive, toRefs, resolveComponent, Transition, withDirectives, withModifiers, normalizeStyle, withKeys, resolveDynamicComponent, vShow, render as render$1, useTemplateRef, renderList, normalizeProps, guardReactiveProps, triggerRef, TransitionGroup, toRef, vModelText, createApp, toHandlers, mergeDefaults } from "vue";
|
|
3
3
|
import BScroll from "@better-scroll/core";
|
|
4
4
|
import { NTooltip, NButton, NInput, NButtonGroup, NDropdown, NModal, NProgress, NSwitch, NCard, NCascader, NDatePicker, NDrawer, NDrawerContent, NSelect, NInputNumber, NUpload, NAutoComplete, NDynamicTags, NTreeSelect, NTimePicker, NCheckbox, NCheckboxGroup, NRadio, NRadioButton, NRadioGroup, NSlider, NTransfer, NDivider, NColorPicker, NRate, NCol, NFormItem, NForm, NRow, NPopover, NTabs, NTabPane, NScrollbar, NEmpty, NPagination, NSpin } from "naive-ui";
|
|
5
|
-
import { b as buildLocaleContext, z as zhCN } from "./utils-
|
|
5
|
+
import { b as buildLocaleContext, z as zhCN } from "./utils-BqJsjHj1.js";
|
|
6
6
|
import { merge, cloneDeep as cloneDeep$1, uniqBy, isBoolean as isBoolean$1, isFunction as isFunction$1, isArray as isArray$1, isString as isString$1, isEqual, get, concat, partition, omit, has, set, unset, isNumber as isNumber$1, isPlainObject } from "lodash-es";
|
|
7
7
|
import { VxePager } from "vxe-pc-ui";
|
|
8
8
|
import { VxeUI, VxePager as VxePager2 } from "vxe-pc-ui";
|
|
@@ -2853,7 +2853,7 @@ const Icon = defineComponent((props, { emit }) => {
|
|
|
2853
2853
|
],
|
|
2854
2854
|
emits: ["load"]
|
|
2855
2855
|
});
|
|
2856
|
-
const _hoisted_1$
|
|
2856
|
+
const _hoisted_1$d = ["xlink:href"];
|
|
2857
2857
|
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
2858
2858
|
__name: "BasicSvgIcon",
|
|
2859
2859
|
props: {
|
|
@@ -2888,7 +2888,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
2888
2888
|
createElementVNode("use", {
|
|
2889
2889
|
"xlink:href": symbolId.value,
|
|
2890
2890
|
fill: "currentColor"
|
|
2891
|
-
}, null, 8, _hoisted_1$
|
|
2891
|
+
}, null, 8, _hoisted_1$d)
|
|
2892
2892
|
], 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2893
2893
|
__props.icon ? (openBlock(), createBlock(unref(Icon), 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$
|
|
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 = 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$
|
|
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__ */ defineComponent({
|
|
|
4263
4263
|
};
|
|
4264
4264
|
}
|
|
4265
4265
|
});
|
|
4266
|
-
const _hoisted_1$
|
|
4266
|
+
const _hoisted_1$b = ["multiple", "name", "accept"];
|
|
4267
4267
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
4268
4268
|
__name: "BasicButtonImport",
|
|
4269
4269
|
props: {
|
|
@@ -4351,7 +4351,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
4351
4351
|
accept: __props.accept,
|
|
4352
4352
|
style: normalizeStyle(buttonStyle.value),
|
|
4353
4353
|
onChange: onFileChange
|
|
4354
|
-
}, null, 44, _hoisted_1$
|
|
4354
|
+
}, null, 44, _hoisted_1$b)),
|
|
4355
4355
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4356
4356
|
createTextVNode(toDisplayString(unref(t)("max.basic.import")), 1)
|
|
4357
4357
|
])
|
|
@@ -4394,10 +4394,133 @@ const XBasicButtonImport = withInstall(_sfc_main$K);
|
|
|
4394
4394
|
const XBasicButtonPrint = withInstall(_sfc_main$J);
|
|
4395
4395
|
const XBasicButtonDrop = withInstall(_sfc_main$O);
|
|
4396
4396
|
const XBasicButtonExportDrop = withInstall(_sfc_main$L);
|
|
4397
|
+
const _sfc_main$I = /* @__PURE__ */ 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 = ref(false);
|
|
4419
|
+
const progressPercent = ref(0);
|
|
4420
|
+
const attrs = useAttrs();
|
|
4421
|
+
const { t } = useLocale();
|
|
4422
|
+
const cOptions = 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
|
+
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 = resolveComponent("XBasicButton");
|
|
4469
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
4470
|
+
__props.drop ? (openBlock(), createBlock(_sfc_main$O, mergeProps({
|
|
4471
|
+
key: 0,
|
|
4472
|
+
icon: __props.icon,
|
|
4473
|
+
options: cOptions.value,
|
|
4474
|
+
class: unref(b)()
|
|
4475
|
+
}, unref(attrs), { onClick: onMultiExportClick }), {
|
|
4476
|
+
default: withCtx(() => [
|
|
4477
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4478
|
+
createTextVNode(toDisplayString(unref(t)("max.basic.export")), 1)
|
|
4479
|
+
])
|
|
4480
|
+
]),
|
|
4481
|
+
_: 3
|
|
4482
|
+
}, 16, ["icon", "options", "class"])) : (openBlock(), createBlock(_component_XBasicButton, mergeProps({
|
|
4483
|
+
key: 1,
|
|
4484
|
+
icon: __props.icon,
|
|
4485
|
+
type: "primary"
|
|
4486
|
+
}, unref(attrs), { onClick: onSingleExportClick }), {
|
|
4487
|
+
default: withCtx(() => [
|
|
4488
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4489
|
+
createTextVNode(toDisplayString(unref(t)("max.basic.export")), 1)
|
|
4490
|
+
])
|
|
4491
|
+
]),
|
|
4492
|
+
_: 3
|
|
4493
|
+
}, 16, ["icon"])),
|
|
4494
|
+
createVNode(unref(NModal), {
|
|
4495
|
+
show: progressVisible.value,
|
|
4496
|
+
"onUpdate:show": _cache[0] || (_cache[0] = ($event) => progressVisible.value = $event),
|
|
4497
|
+
closable: false,
|
|
4498
|
+
preset: "card",
|
|
4499
|
+
class: normalizeClass(unref(bm)())
|
|
4500
|
+
}, {
|
|
4501
|
+
default: withCtx(() => [
|
|
4502
|
+
createElementVNode("div", {
|
|
4503
|
+
class: normalizeClass(unref(em)("progress-content"))
|
|
4504
|
+
}, [
|
|
4505
|
+
createVNode(unref(NProgress), {
|
|
4506
|
+
type: "line",
|
|
4507
|
+
percentage: progressPercent.value,
|
|
4508
|
+
"indicator-placement": "inside"
|
|
4509
|
+
}, null, 8, ["percentage"]),
|
|
4510
|
+
createElementVNode("p", null, toDisplayString(unref(t)("max.basic.exportingTip")), 1)
|
|
4511
|
+
], 2)
|
|
4512
|
+
]),
|
|
4513
|
+
_: 1
|
|
4514
|
+
}, 8, ["show", "class"])
|
|
4515
|
+
], 64);
|
|
4516
|
+
};
|
|
4517
|
+
}
|
|
4518
|
+
});
|
|
4519
|
+
const XBasicButtonExportMax = withInstall(_sfc_main$I);
|
|
4397
4520
|
function _isSlot$3(s) {
|
|
4398
4521
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
4399
4522
|
}
|
|
4400
|
-
const _sfc_main$
|
|
4523
|
+
const _sfc_main$H = /* @__PURE__ */ 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$
|
|
4876
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
4754
4877
|
__name: "BasicButtonGroup",
|
|
4755
4878
|
props: {
|
|
4756
4879
|
showReturnButton: { type: Boolean },
|
|
@@ -4831,7 +4954,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
4831
4954
|
return (_ctx, _cache) => {
|
|
4832
4955
|
return openBlock(), createElementBlock("div", mergeProps({ class: unref(getWrapperClass) }, getBindValue.value), [
|
|
4833
4956
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
|
|
4834
|
-
return openBlock(), createBlock(_sfc_main$
|
|
4957
|
+
return openBlock(), 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__ */ defineComponent({
|
|
|
4852
4975
|
};
|
|
4853
4976
|
}
|
|
4854
4977
|
});
|
|
4855
|
-
const XBasicButtonGroup = withInstall(_sfc_main$
|
|
4856
|
-
const _hoisted_1$
|
|
4978
|
+
const XBasicButtonGroup = 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$
|
|
4983
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
4861
4984
|
__name: "BasicNotification",
|
|
4862
4985
|
props: {
|
|
4863
4986
|
customClass: { default: "" },
|
|
@@ -4993,7 +5116,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4993
5116
|
}, null, 8, ["class"])) : createCommentVNode("", true)
|
|
4994
5117
|
])
|
|
4995
5118
|
], 2)
|
|
4996
|
-
], 46, _hoisted_1$
|
|
5119
|
+
], 46, _hoisted_1$a), [
|
|
4997
5120
|
[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 = createVNode(_sfc_main$
|
|
5170
|
+
const vm = createVNode(_sfc_main$F, props, isFunction(props.message) ? props.message : isVNode(props.message) ? () => props.message : null);
|
|
5048
5171
|
vm.appContext = isUndefined(context) ? notify._context : context;
|
|
5049
5172
|
vm.props.onDestroy = () => {
|
|
5050
5173
|
render$1(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$
|
|
5942
|
-
const _sfc_main$
|
|
6064
|
+
const _hoisted_1$9 = { class: "max-table-selection-count" };
|
|
6065
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
5943
6066
|
__name: "BasicTable",
|
|
5944
6067
|
props: {
|
|
5945
6068
|
layouts: {},
|
|
@@ -6388,7 +6511,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6388
6511
|
class: normalizeClass(unref(e)("selection-count"))
|
|
6389
6512
|
}, [
|
|
6390
6513
|
createElementVNode("span", null, toDisplayString(unref(t)("max.basic.selected")), 1),
|
|
6391
|
-
createElementVNode("span", _hoisted_1$
|
|
6514
|
+
createElementVNode("span", _hoisted_1$9, toDisplayString(unref(getSelectRows)().length), 1),
|
|
6392
6515
|
createElementVNode("span", null, toDisplayString(unref(t)("max.basic.item")), 1)
|
|
6393
6516
|
], 2)
|
|
6394
6517
|
], 2)) : createCommentVNode("", true),
|
|
@@ -6456,9 +6579,9 @@ VxeUI2.formats.mixin(vxeTableFormatter);
|
|
|
6456
6579
|
VxeUI2.setConfig({
|
|
6457
6580
|
zIndex: 2e3
|
|
6458
6581
|
});
|
|
6459
|
-
const XBasicTable = withInstall(_sfc_main$
|
|
6460
|
-
const _sfc_main$
|
|
6461
|
-
__name: "
|
|
6582
|
+
const XBasicTable = withInstall(_sfc_main$E);
|
|
6583
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
6584
|
+
__name: "BasicButtonImportMaxModal",
|
|
6462
6585
|
props: {
|
|
6463
6586
|
previewWidth: {},
|
|
6464
6587
|
previewColumns: {},
|
|
@@ -6470,7 +6593,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
6470
6593
|
const props = __props;
|
|
6471
6594
|
const emit = __emit;
|
|
6472
6595
|
const basicTableRef = useTemplateRef("basicTableRef");
|
|
6473
|
-
const { b: bm, e: em } = useNamespace("basic-button-import-
|
|
6596
|
+
const { b: bm, e: em } = useNamespace("basic-button-import-max-modal");
|
|
6474
6597
|
const { t } = useLocale();
|
|
6475
6598
|
const tableDataCount = ref(0);
|
|
6476
6599
|
const { visible, show, hide } = useBasicDrawerModal({
|
|
@@ -8225,8 +8348,8 @@ const BasicUpload = /* @__PURE__ */ defineComponent({
|
|
|
8225
8348
|
}
|
|
8226
8349
|
});
|
|
8227
8350
|
const XBasicUpload = withInstall(BasicUpload);
|
|
8228
|
-
const _hoisted_1$
|
|
8229
|
-
const _sfc_main$
|
|
8351
|
+
const _hoisted_1$8 = { key: 0 };
|
|
8352
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
8230
8353
|
__name: "BasicButtonImportUploadModal",
|
|
8231
8354
|
props: {
|
|
8232
8355
|
width: {},
|
|
@@ -8237,7 +8360,7 @@ const _sfc_main$D = /* @__PURE__ */ 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-
|
|
8363
|
+
const { b: bm, e: em } = useNamespace("basic-button-import-max-modal");
|
|
8241
8364
|
const { t } = useLocale();
|
|
8242
8365
|
const fileList = ref([]);
|
|
8243
8366
|
const checked = ref(false);
|
|
@@ -8292,7 +8415,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
8292
8415
|
createElementVNode("div", {
|
|
8293
8416
|
class: normalizeClass(unref(em)("footer-left"))
|
|
8294
8417
|
}, [
|
|
8295
|
-
props.showCoverSwitch ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
8418
|
+
props.showCoverSwitch ? (openBlock(), createElementBlock("span", _hoisted_1$8, [
|
|
8296
8419
|
createElementVNode("span", {
|
|
8297
8420
|
class: normalizeClass([unref(em)("footer-text"), { [unref(em)("footer-text--checked")]: checked.value }])
|
|
8298
8421
|
}, toDisplayString(unref(t)("max.import.updateExisting")), 3),
|
|
@@ -8379,8 +8502,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
8379
8502
|
};
|
|
8380
8503
|
}
|
|
8381
8504
|
});
|
|
8382
|
-
const _sfc_main$
|
|
8383
|
-
__name: "
|
|
8505
|
+
const _sfc_main$B = /* @__PURE__ */ 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__ */ defineComponent({
|
|
|
8406
8529
|
const emit = __emit;
|
|
8407
8530
|
const previewModalRef = useTemplateRef("previewModalRef");
|
|
8408
8531
|
const uploadModalRef = useTemplateRef("uploadModalRef");
|
|
8409
|
-
const { b } = useNamespace("basic-button-import-
|
|
8532
|
+
const { b } = useNamespace("basic-button-import-max");
|
|
8410
8533
|
const { t } = useLocale();
|
|
8411
8534
|
const attrs = useAttrs();
|
|
8412
8535
|
const currentFile = ref(null);
|
|
@@ -8531,7 +8654,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
8531
8654
|
_: 3
|
|
8532
8655
|
}, 16)
|
|
8533
8656
|
], 2),
|
|
8534
|
-
createVNode(_sfc_main$
|
|
8657
|
+
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__ */ defineComponent({
|
|
|
8540
8663
|
onConfirm: onUploadConfirm,
|
|
8541
8664
|
onDownloadTemplate: onExport
|
|
8542
8665
|
}, null, 8, ["width", "show-tpl-button", "show-cover-switch"]),
|
|
8543
|
-
createVNode(_sfc_main$
|
|
8666
|
+
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__ */ defineComponent({
|
|
|
8553
8676
|
};
|
|
8554
8677
|
}
|
|
8555
8678
|
});
|
|
8556
|
-
const
|
|
8557
|
-
const _hoisted_1$8 = { key: 0 };
|
|
8558
|
-
const _sfc_main$B = /* @__PURE__ */ 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 = useAttrs();
|
|
8577
|
-
const visible = ref(false);
|
|
8578
|
-
const fileList = ref([]);
|
|
8579
|
-
const checked = ref(false);
|
|
8580
|
-
const loading = ref(false);
|
|
8581
|
-
const modalStyle = 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
|
-
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 openBlock(), createElementBlock("span", null, [
|
|
8655
|
-
createElementVNode("div", {
|
|
8656
|
-
class: normalizeClass(unref(b)())
|
|
8657
|
-
}, [
|
|
8658
|
-
createVNode(unref(XBasicButton), mergeProps({
|
|
8659
|
-
icon: "ri:import-line",
|
|
8660
|
-
type: "primary"
|
|
8661
|
-
}, unref(attrs), { onClick: onClickHandler }), {
|
|
8662
|
-
default: withCtx(() => [
|
|
8663
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
8664
|
-
createTextVNode(toDisplayString(unref(t)("max.import.import")), 1)
|
|
8665
|
-
])
|
|
8666
|
-
]),
|
|
8667
|
-
_: 3
|
|
8668
|
-
}, 16)
|
|
8669
|
-
], 2),
|
|
8670
|
-
createVNode(unref(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: normalizeClass(unref(bm)()),
|
|
8677
|
-
style: normalizeStyle(modalStyle.value)
|
|
8678
|
-
}, {
|
|
8679
|
-
footer: withCtx(() => [
|
|
8680
|
-
createElementVNode("span", {
|
|
8681
|
-
class: normalizeClass(unref(em)("footer"))
|
|
8682
|
-
}, [
|
|
8683
|
-
createElementVNode("div", {
|
|
8684
|
-
class: normalizeClass(unref(em)("footer-left"))
|
|
8685
|
-
}, [
|
|
8686
|
-
__props.showCoverSwitch ? (openBlock(), createElementBlock("span", _hoisted_1$8, [
|
|
8687
|
-
createElementVNode("span", {
|
|
8688
|
-
class: normalizeClass([unref(em)("footer-text"), { [unref(em)("footer-text--checked")]: checked.value }])
|
|
8689
|
-
}, toDisplayString(unref(t)("max.import.updateExisting")), 3),
|
|
8690
|
-
createVNode(unref(NSwitch), {
|
|
8691
|
-
checked: checked.value,
|
|
8692
|
-
"onUpdate:checked": _cache[1] || (_cache[1] = ($event) => checked.value = $event),
|
|
8693
|
-
class: normalizeClass(unref(em)("footer-switch"))
|
|
8694
|
-
}, null, 8, ["checked", "class"])
|
|
8695
|
-
])) : createCommentVNode("", true)
|
|
8696
|
-
], 2),
|
|
8697
|
-
createElementVNode("span", {
|
|
8698
|
-
class: normalizeClass(unref(em)("footer-right"))
|
|
8699
|
-
}, [
|
|
8700
|
-
createVNode(unref(XBasicButton), {
|
|
8701
|
-
class: normalizeClass(unref(em)("footer-btn")),
|
|
8702
|
-
onClick: _cache[2] || (_cache[2] = ($event) => visible.value = false)
|
|
8703
|
-
}, {
|
|
8704
|
-
default: withCtx(() => [
|
|
8705
|
-
createTextVNode(toDisplayString(unref(t)("max.import.cancel")), 1)
|
|
8706
|
-
]),
|
|
8707
|
-
_: 1
|
|
8708
|
-
}, 8, ["class"]),
|
|
8709
|
-
createVNode(unref(XBasicButton), {
|
|
8710
|
-
type: "primary",
|
|
8711
|
-
onClick: onPositiveClickHandler
|
|
8712
|
-
}, {
|
|
8713
|
-
default: withCtx(() => [
|
|
8714
|
-
createTextVNode(toDisplayString(unref(t)("max.import.confirm")), 1)
|
|
8715
|
-
]),
|
|
8716
|
-
_: 1
|
|
8717
|
-
})
|
|
8718
|
-
], 2)
|
|
8719
|
-
], 2)
|
|
8720
|
-
]),
|
|
8721
|
-
default: withCtx(() => [
|
|
8722
|
-
createElementVNode("div", null, [
|
|
8723
|
-
createVNode(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: withCtx(() => [
|
|
8733
|
-
createElementVNode("p", {
|
|
8734
|
-
class: normalizeClass(unref(em)("upload-icon"))
|
|
8735
|
-
}, [
|
|
8736
|
-
createVNode(unref(XBasicSvgIcon), {
|
|
8737
|
-
icon: "ri:upload-2-line",
|
|
8738
|
-
class: normalizeClass(unref(em)("upload-icon-svg"))
|
|
8739
|
-
}, null, 8, ["class"])
|
|
8740
|
-
], 2),
|
|
8741
|
-
createElementVNode("p", {
|
|
8742
|
-
class: normalizeClass(unref(em)("upload-text"))
|
|
8743
|
-
}, toDisplayString(unref(t)("max.import.uploadTip")), 3)
|
|
8744
|
-
]),
|
|
8745
|
-
_: 1
|
|
8746
|
-
}, 8, ["file-list"]),
|
|
8747
|
-
__props.showTplButton ? (openBlock(), createElementBlock("div", {
|
|
8748
|
-
key: 0,
|
|
8749
|
-
class: normalizeClass(unref(em)("tips"))
|
|
8750
|
-
}, [
|
|
8751
|
-
createElementVNode("span", null, toDisplayString(unref(t)("max.import.allowedFormats")), 1),
|
|
8752
|
-
createVNode(unref(XBasicButton), {
|
|
8753
|
-
type: "primary",
|
|
8754
|
-
size: "tiny",
|
|
8755
|
-
secondary: "",
|
|
8756
|
-
icon: "ri-file-excel-2-line",
|
|
8757
|
-
onClick: downloadTemplate
|
|
8758
|
-
}, {
|
|
8759
|
-
default: withCtx(() => [
|
|
8760
|
-
createTextVNode(toDisplayString(unref(t)("max.import.downloadTemplate")), 1)
|
|
8761
|
-
]),
|
|
8762
|
-
_: 1
|
|
8763
|
-
})
|
|
8764
|
-
], 2)) : createCommentVNode("", true)
|
|
8765
|
-
])
|
|
8766
|
-
]),
|
|
8767
|
-
_: 1
|
|
8768
|
-
}, 8, ["show", "class", "style"])
|
|
8769
|
-
]);
|
|
8770
|
-
};
|
|
8771
|
-
}
|
|
8772
|
-
});
|
|
8773
|
-
const XBasicButtonImportWithTpl = withInstall(_sfc_main$B);
|
|
8679
|
+
const XBasicButtonImportMax = withInstall(_sfc_main$B);
|
|
8774
8680
|
const _hoisted_1$7 = ["title"];
|
|
8775
8681
|
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
8776
8682
|
__name: "BasicText",
|
|
@@ -27807,8 +27713,8 @@ const components = [
|
|
|
27807
27713
|
XBasicCard,
|
|
27808
27714
|
XBasicRegion,
|
|
27809
27715
|
XBasicRegionSelect,
|
|
27810
|
-
|
|
27811
|
-
|
|
27716
|
+
XBasicButtonImportMax,
|
|
27717
|
+
XBasicButtonExportMax
|
|
27812
27718
|
];
|
|
27813
27719
|
const makeInstaller = (components2 = []) => {
|
|
27814
27720
|
const install2 = (app, options) => {
|
|
@@ -28130,10 +28036,10 @@ export {
|
|
|
28130
28036
|
XBasicButtonEdit,
|
|
28131
28037
|
XBasicButtonExport,
|
|
28132
28038
|
XBasicButtonExportDrop,
|
|
28039
|
+
XBasicButtonExportMax,
|
|
28133
28040
|
XBasicButtonGroup,
|
|
28134
28041
|
XBasicButtonImport,
|
|
28135
|
-
|
|
28136
|
-
XBasicButtonImportWithTpl,
|
|
28042
|
+
XBasicButtonImportMax,
|
|
28137
28043
|
XBasicButtonPrint,
|
|
28138
28044
|
XBasicCard,
|
|
28139
28045
|
XBasicCascader,
|