el-plus-crud
Version:
采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件
1,275 lines • 284 kB
JavaScript
import { nextTick as Ve, defineComponent as le, inject as ge, ref as g, watch as fe, onBeforeMount as Ce, useAttrs as ye, onMounted as ht, resolveComponent as I, openBlock as d, createBlock as L, mergeProps as ae, toHandlers as Ae, unref as W, isRef as Le, createCommentVNode as N, useSlots as Xe, createSlots as at, withCtx as P, renderSlot as ke, renderList as ve, createElementBlock as A, createElementVNode as te, computed as ee, Fragment as ie, createVNode as J, createTextVNode as he, toDisplayString as de, normalizeStyle as je, reactive as $e, withKeys as tl, withModifiers as pt, normalizeClass as ut, onUnmounted as Dn, withDirectives as ml, vShow as Il, triggerRef as bl, resolveDynamicComponent as nl, provide as vo, resolveDirective as go } from "vue";
import { useVModel as De } from "@vueuse/core";
import { ElMessageBox as jl, ElMessage as Ge } from "element-plus";
const Te = async (e, l) => {
var n, r, u, o, a, v;
const t = Object.assign({}, l, (n = e.desc) == null ? void 0 : n._attrs, e.desc, (r = e.desc) == null ? void 0 : r.attrs, yo(e.desc));
return e.desc.multiple && (t.multiple = !0, t.showCheckbox = !0, ["select"].indexOf(e.desc.type) >= 0 && (t.collapseTags = ((u = e.desc.attrs) == null ? void 0 : u.collapseTags) ?? ((o = e.desc) == null ? void 0 : o.collapseTags) ?? !1, t.collapseTagsTooltip = ((a = e.desc.attrs) == null ? void 0 : a.collapseTagsTooltip) ?? ((v = e.desc) == null ? void 0 : v.collapseTagsTooltip) ?? !1)), e.desc.elType && (typeof e.desc.elType == "function" ? t.type = e.desc.elType(e.formData) : t.type = e.desc.elType), delete t.label, t;
}, Pe = (e) => {
var t;
const l = {};
return (t = e.desc) != null && t.on && Object.keys(e.desc.on).map((n) => {
l[n] = (r) => {
Ve(() => {
e.desc.on[n](e.formData, e.rowIndex, r);
});
};
}), l;
};
function yo(e) {
if (e != null && e.placeholder)
return { placeholder: e == null ? void 0 : e.placeholder };
if (!e || !e.type)
return "";
switch (e.type) {
case "input":
case "nbinput":
case "password":
case "number":
case "validCode":
case "tag":
case "textarea":
case "percentinput":
return { placeholder: (e == null ? void 0 : e.placeholder) || "请输入" + ((e == null ? void 0 : e._label) || "") };
case "switch":
return {};
case "area":
case "select":
case "category":
case "cascader":
return { placeholder: (e == null ? void 0 : e.placeholder) || "请选择" + (e.remote ? "(可输入进行搜索)" : (e == null ? void 0 : e._label) || "") };
case "data":
case "datetime":
case "datas":
case "date":
return { placeholder: "请选择日期" };
case "daterange":
case "datetimerange":
case "timerange":
case "monthrange":
return {
startPlaceholder: "开始日期",
endPlaceholder: "结束日期"
};
case "dates":
return { placeholder: "请选择一个或多个日期" };
case "month":
return { placeholder: "请选择月" };
case "time":
case "timsPicker":
return { placeholder: "请选择时间" };
case "week":
return { placeholder: "请选择周" };
case "year":
return { placeholder: "请选择年" };
case "upimg":
return { placeholder: "请上传" };
case "upfile":
return { placeholder: "点击上传" };
}
}
const ho = {
name: "ElPlusFormArea",
inheritAttrs: !1,
typeName: "area",
customOptions: {}
}, bo = /* @__PURE__ */ le({
...ho,
props: {
modelValue: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = ge("globalData"), n = e, r = l, u = g([]), o = g({}), a = g(!1), v = g(Pe(n)), i = De(n, "modelValue", r);
return fe(
() => n.modelValue,
(s) => {
i.value = Array.isArray(s) ? s : s == null ? [] : [s];
},
{ immediate: !0 }
), Ce(async () => {
o.value = await Te(n, { props: { value: "id", label: "name", children: "childs", checkStrictly: !!n.desc.checkStrictly }, clearable: !0, filterable: !0, ...ye() }), a.value = !0;
}), ht(async () => {
u.value = t.areaList || [];
}), (s, p) => {
const f = I("el-cascader");
return a.value ? (d(), L(f, ae({
key: 0,
class: "ElPlusFormArea-panel"
}, o.value, { disabled: e.disabled }, Ae(v.value), {
modelValue: W(i),
"onUpdate:modelValue": p[0] || (p[0] = (m) => Le(i) ? i.value = m : null),
options: u.value
}), null, 16, ["disabled", "modelValue", "options"])) : N("", !0);
};
}
});
const Fe = (e, l) => {
const t = e.__vccOpts || e;
for (const [n, r] of l)
t[n] = r;
return t;
}, Pn = /* @__PURE__ */ Fe(bo, [["__scopeId", "data-v-877642f2"]]), _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Pn }, Symbol.toStringTag, { value: "Module" })), wo = {
name: "ElPlusFormAutocomplete",
inheritAttrs: !1,
typeName: "autocomplete",
customOptions: {}
}, xo = /* @__PURE__ */ le({
...wo,
props: {
modelValue: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l), u = g(Object.assign({}, Xe(), t.desc.slots)), o = g({}), a = g(Pe(t));
return Ce(async () => {
o.value = await Te(t, { autocomplete: "new-password", ...ye() });
}), (v, i) => {
const s = I("el-autocomplete");
return d(), L(s, ae({ class: "ElPlusFormAutocomplete-panel" }, o.value, { disabled: e.disabled }, Ae(a.value), {
modelValue: W(r),
"onUpdate:modelValue": i[0] || (i[0] = (p) => Le(r) ? r.value = p : null)
}), at({
default: P((p) => [
ke(v.$slots, "default", { data: p }, void 0, !0)
]),
_: 2
}, [
ve(u.value, (p, f, m) => ({
name: f,
fn: P((x) => [
ke(v.$slots, f, { data: x }, void 0, !0)
])
}))
]), 1040, ["disabled", "modelValue"]);
};
}
});
const Fn = /* @__PURE__ */ Fe(xo, [["__scopeId", "data-v-23f5ab4b"]]), Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Fn }, Symbol.toStringTag, { value: "Module" }));
/*! Element Plus Icons Vue v2.3.2 */
var Co = /* @__PURE__ */ le({
name: "ArrowDown",
__name: "arrow-down",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
})
]));
}
}), On = Co, To = /* @__PURE__ */ le({
name: "ArrowRight",
__name: "arrow-right",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
})
]));
}
}), ko = To, Vo = /* @__PURE__ */ le({
name: "ArrowUp",
__name: "arrow-up",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
})
]));
}
}), So = Vo, Eo = /* @__PURE__ */ le({
name: "Download",
__name: "download",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
})
]));
}
}), Do = Eo, Po = /* @__PURE__ */ le({
name: "Expand",
__name: "expand",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M128 192h768v128H128zm0 256h512v128H128zm0 256h768v128H128zm576-352 192 160-192 128z"
})
]));
}
}), Fo = Po, Oo = /* @__PURE__ */ le({
name: "Loading",
__name: "loading",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
})
]));
}
}), Tl = Oo, Io = /* @__PURE__ */ le({
name: "Menu",
__name: "menu",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"
})
]));
}
}), jo = Io, Bo = /* @__PURE__ */ le({
name: "Plus",
__name: "plus",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
})
]));
}
}), $o = Bo, Lo = /* @__PURE__ */ le({
name: "Search",
__name: "search",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
})
]));
}
}), zo = Lo, Mo = /* @__PURE__ */ le({
name: "Setting",
__name: "setting",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
})
]));
}
}), Uo = Mo, Ro = /* @__PURE__ */ le({
name: "Share",
__name: "share",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"
})
]));
}
}), Yl = Ro, No = /* @__PURE__ */ le({
name: "Upload",
__name: "upload",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"
})
]));
}
}), Ko = No, Qo = /* @__PURE__ */ le({
name: "UserFilled",
__name: "user-filled",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M288 320a224 224 0 1 0 448 0 224 224 0 1 0-448 0m544 608H160a32 32 0 0 1-32-32v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 0 1-32 32z"
})
]));
}
}), Wl = Qo, Ho = /* @__PURE__ */ le({
name: "WarningFilled",
__name: "warning-filled",
setup(e) {
return (l, t) => (d(), A("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
te("path", {
fill: "currentColor",
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
})
]));
}
}), qo = Ho;
const Go = {
name: "ElPlusFormBtn",
inheritAttrs: !1,
typeName: "btn",
customOptions: {}
}, bt = /* @__PURE__ */ le({
...Go,
props: {
field: {},
rowIndex: {},
loading: { type: Boolean },
desc: {},
formData: {}
},
setup(e) {
const l = ge("lodash"), t = ge("defaultConf"), n = e, r = g(n.loading ?? !1), u = ee(() => {
var m;
if ((m = n.desc) != null && m.auth)
if (!t.auth)
console.warn("使用auth属性,请在crud注册时传入auth校验方法~");
else
return t.auth(n.desc.auth);
return !0;
}), o = ee(() => {
var m;
return !!((m = n.desc) != null && m.text);
}), a = /* @__PURE__ */ new Set(["text", "plain", "bg", "loading", "round", "circle", "dashed", "native-type", "autofocus", "auto-insert-space", "tag", "size", "btnType", "btnLabel", "mask", "confirm", "auth", "isTag", "label", "on", "_attrs", "type"]), v = ee(() => {
const m = {};
for (const x in s.value)
a.has(x) || (m[x] = s.value[x]);
return m;
}), i = ee(() => {
const m = s.value;
return m.btnType ? typeof m.btnType == "function" ? m.btnType(n.formData || {}) || "primary" : m.btnType || "primary" : m.type || "primary";
}), s = ee(() => {
var x;
const m = Object.assign({}, ye(), n.desc, (x = n.desc) == null ? void 0 : x._attrs);
return m.btnType && (typeof m.btnType == "function" ? m.type = m.btnType(n.formData || {}) : m.type = m.btnType, m.type || (m.type = "primary")), m;
}), p = ee(() => {
const m = {};
if (n.desc && n.desc.on)
for (const x in n.desc.on)
x === "click" && n.desc.mask ? m[x] = function() {
var F;
r.value = !0, (F = n.desc) == null || F.on[x]({
row: n.formData || {},
callBack: ($) => {
setTimeout(() => r.value = !1, $ || 50);
},
field: n.field,
rowIndex: n.rowIndex
});
} : m[x] = function() {
var F;
(F = n.desc) == null || F.on[x]({ row: l.cloneDeep(n.formData || {}), field: n.field, rowIndex: n.rowIndex });
};
return m;
}), f = ee(() => {
var m, x;
return (m = n.desc) != null && m.btnLabel ? typeof n.desc.btnLabel == "function" ? n.desc.btnLabel(n.formData || {}) : n.desc.btnLabel : (x = n.desc) != null && x.label ? typeof n.desc.label == "function" ? n.desc.label(n.formData || {}) : n.desc.label : "";
});
return fe(
() => n.loading,
(m) => {
r.value = m;
}
), (m, x) => {
var U, K, V, j, S, z, _, E, w, T;
const F = I("el-icon"), $ = I("el-link"), C = I("el-popconfirm"), M = I("el-button");
return u.value ? (d(), A(ie, { key: 0 }, [
o.value ? (d(), A(ie, { key: 0 }, [
(U = n.desc) != null && U.confirm ? (d(), L(C, {
key: 0,
onConfirm: p.value.click,
title: (K = n.desc) == null ? void 0 : K.confirm
}, {
reference: P(() => {
var R, X;
return [
J($, ae({
underline: "never",
type: i.value
}, v.value, {
disabled: r.value || v.value.disabled,
style: { pointerEvents: (R = e.desc) != null && R.isTag ? "none" : "all" },
class: { "no-label": !((X = n.desc) != null && X.label) }
}), {
default: P(() => [
r.value ? (d(), L(F, {
key: 0,
class: "is-loading"
}, {
default: P(() => [
J(W(Tl))
]),
_: 1
})) : N("", !0),
ke(m.$slots, "default", {}, () => {
var Z;
return [
(Z = n.desc) != null && Z.label ? (d(), A(ie, { key: 0 }, [
he(de(f.value), 1)
], 64)) : N("", !0)
];
})
]),
_: 3
}, 16, ["type", "disabled", "style", "class"])
];
}),
_: 3
}, 8, ["onConfirm", "title"])) : (d(), L($, ae({
key: 1,
underline: "never",
type: i.value
}, v.value, Ae(p.value), {
disabled: r.value || v.value.disabled,
style: { pointerEvents: (V = e.desc) != null && V.isTag ? "none" : "all" },
class: { "no-label": !((j = n.desc) != null && j.label) }
}), {
default: P(() => [
r.value ? (d(), L(F, {
key: 0,
class: "is-loading"
}, {
default: P(() => [
J(W(Tl))
]),
_: 1
})) : N("", !0),
ke(m.$slots, "default", {}, () => {
var R;
return [
(R = n.desc) != null && R.label ? (d(), A(ie, { key: 0 }, [
he(de(f.value), 1)
], 64)) : N("", !0)
];
})
]),
_: 3
}, 16, ["type", "disabled", "style", "class"]))
], 64)) : (d(), A(ie, { key: 1 }, [
(S = n.desc) != null && S.confirm ? (d(), L(C, {
key: 0,
onConfirm: p.value.click,
title: (z = n.desc) == null ? void 0 : z.confirm
}, {
reference: P(() => {
var R, X;
return [
J(M, ae({
loading: r.value,
size: ((R = n.desc) == null ? void 0 : R.size) || W(t).size
}, s.value, {
class: { btnHideLabel: !((X = n.desc) != null && X.label) && !m.$slots.default }
}), {
default: P(() => [
ke(m.$slots, "default", {}, () => {
var Z;
return [
(Z = n.desc) != null && Z.label ? (d(), A(ie, { key: 0 }, [
he(de(f.value), 1)
], 64)) : N("", !0)
];
})
]),
_: 3
}, 16, ["loading", "size", "class"])
];
}),
_: 3
}, 8, ["onConfirm", "title"])) : (d(), L(M, ae({
key: 1,
loading: r.value,
size: ((_ = n.desc) == null ? void 0 : _.size) || W(t).size
}, s.value, Ae(p.value), {
style: { pointerEvents: (E = e.desc) != null && E.isTag ? "none" : "all" },
class: { "no-label": !((w = n.desc) != null && w.label), btnHideLabel: !((T = n.desc) != null && T.label) && !m.$slots.default }
}), {
default: P(() => [
ke(m.$slots, "default", {}, () => {
var R;
return [
(R = n.desc) != null && R.label ? (d(), A(ie, { key: 0 }, [
he(de(f.value), 1)
], 64)) : N("", !0)
];
})
]),
_: 3
}, 16, ["loading", "size", "style", "class"]))
], 64))
], 64)) : N("", !0);
};
}
});
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bt }, Symbol.toStringTag, { value: "Module" })), Wo = { class: "el-button el-plus-form-up-btn" }, Jo = {
name: "ElPlusFormUpbtn",
inheritAttrs: !1,
typeName: "upbtn",
customOptions: {}
}, Xo = /* @__PURE__ */ le({
...Jo,
props: {
field: {},
rowIndex: {},
loading: { type: Boolean },
desc: {},
formData: {},
disabled: { type: Boolean }
},
setup(e) {
const l = e, t = g(!!l.loading), n = g([]), r = g({}), u = g(!1), o = {
name: "file",
showFileList: !1,
listType: "text",
accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",
beforeUpload: async (i) => {
var p, f;
t.value = !0;
let s = ((p = l.desc) == null ? void 0 : p.confirm) || "";
return s && typeof ((f = l.desc) == null ? void 0 : f.confirm) == "function" && (s = l.desc.confirm()), s ? new Promise((m) => {
jl.confirm(s, "提示", {
type: "warning",
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(() => m(!0)).catch(() => {
m(!1), t.value = !1;
});
}) : await v(i);
},
onError: () => {
Ge.error("文件上传出错,请检查文件格式及内容是否正确!"), t.value = !1;
}
}, a = ee(() => l.desc.btnLabel ? typeof l.desc.btnLabel == "function" ? l.desc.btnLabel(l.formData || {}) : l.desc.btnLabel : l.desc.label ? typeof l.desc.label == "function" ? l.desc.label(l.formData || {}) : l.desc.label : "");
function v(i) {
return new Promise((s, p) => {
t.value = !0;
const f = i.name.substring(i.name.lastIndexOf(".")), m = l.desc.accept || l.desc.attrs.accept || [".xlsx", ".xls"];
if (m.indexOf(f) < 0)
return Ge.warning(`请上传后缀为${m.join(",")}格式的文件!`), t.value = !1, p(!1), !1;
if (i.size > 20 * 1024 * 1024)
return Ge.warning("超出文件大小限制(最大为20M)!"), t.value = !1, p(!1), !1;
s(!0);
});
}
return fe(
() => l.loading,
(i) => {
t.value = i;
},
{ immediate: !0 }
), Ce(async () => {
r.value = await Te(l, { ...o, ...ye() }), r.value.action || console.warn("上传组件未填写action..."), r.value.onSuccess = (i) => {
var s, p;
(p = (s = l.desc) == null ? void 0 : s.on) != null && p.success && l.desc.on.success({
row: i,
callBack: () => {
setTimeout(() => t.value = !1, 500);
},
field: l.field,
rowIndex: l.rowIndex
});
}, u.value = !0;
}), (i, s) => {
const p = I("el-button"), f = I("el-upload");
return d(), A("div", Wo, [
J(f, ae({
class: "upload-demo",
style: { display: "flex" }
}, r.value, {
disabled: t.value || r.value.disabled,
modelValue: n.value,
"onUpdate:modelValue": s[0] || (s[0] = (m) => n.value = m)
}), {
file: P(() => [...s[1] || (s[1] = [
te("div", null, null, -1)
])]),
default: P(() => [
J(p, {
type: "primary",
icon: W(Ko),
loading: t.value
}, {
default: P(() => [
he(de(a.value), 1)
]),
_: 1
}, 8, ["icon", "loading"])
]),
_: 1
}, 16, ["disabled", "modelValue"])
]);
};
}
});
const al = /* @__PURE__ */ Fe(Xo, [["__scopeId", "data-v-189da0c6"]]), Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: al }, Symbol.toStringTag, { value: "Module" })), es = {
name: "ElPlusFormBtns",
inheritAttrs: !1,
typeName: "btns",
customOptions: {}
}, In = /* @__PURE__ */ le({
...es,
props: {
field: {},
rowIndex: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
setup(e) {
const l = ge("defaultConf"), t = e, n = g([]), r = g([]), u = ee(() => {
switch (t.desc.align) {
case "right":
return "flex-end";
case "center":
return "center";
case void 0:
case "left":
return "flex-start";
default:
return "flex-start";
}
}), o = ee(() => (s) => {
const p = {};
if (s && s.on)
for (const f in s.on)
f === "click" && s.confirm ? p[f] = function() {
jl.confirm(s.confirm, "提示", {
type: "warning",
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(() => {
s.on[f]({ row: t.formData || {}, field: t.field, rowIndex: t.rowIndex });
});
} : p[f] = function() {
s.on[f]({ row: t.formData || {}, field: t.field, rowIndex: t.rowIndex });
};
return p;
}), a = () => {
const s = [];
r.value = [], t.desc.btns.length > 0 && t.desc.btns.map((f) => {
v(f) && s.push(f);
}), n.value = s;
const p = t.desc.limit || 3;
n.value.length > p && (r.value = n.value.splice(p - 1));
}, v = (s) => {
let p = !0;
return typeof s.vif == "function" ? p = !!i(s.vif) : typeof s.vif == "boolean" && (p = s.vif), p && s != null && s.auth && (l.auth ? p = l.auth(s.auth) : console.warn("使用auth属性,请在crud注册时传入auth校验方法~")), p;
}, i = (s) => s(t.formData || {});
return fe(
() => t.desc,
() => a()
), fe(
() => t.formData,
() => a()
), ht(() => {
a();
}), (s, p) => {
const f = I("el-icon"), m = I("el-button"), x = I("el-dropdown-item"), F = I("el-dropdown-menu"), $ = I("el-dropdown");
return d(), A("div", {
class: "el-plus-form-btn-group",
style: je({ "justify-content": u.value })
}, [
(d(!0), A(ie, null, ve(n.value, (C, M) => (d(), A(ie, {
key: M + (C.label || C.title || "")
}, [
C.elType === "upload" ? (d(), L(al, {
key: 0,
type: "primary",
field: e.field,
desc: C || {},
formData: e.formData,
plain: (C && C.plain) ?? e.desc.plain ?? !0,
disabled: e.disabled || e.desc.disabled,
text: e.desc.text,
rowIndex: e.rowIndex
}, null, 8, ["field", "desc", "formData", "plain", "disabled", "text", "rowIndex"])) : (d(), L(bt, {
key: 1,
type: "primary",
field: e.field,
desc: C || {},
formData: e.formData,
plain: (C && C.plain) ?? e.desc.plain ?? !0,
disabled: e.disabled || e.desc.disabled,
text: e.desc.text,
rowIndex: e.rowIndex
}, null, 8, ["field", "desc", "formData", "plain", "disabled", "text", "rowIndex"]))
], 64))), 128)),
r.value && r.value.length > 0 ? (d(), L($, {
key: 0,
class: "group-menu-btn",
size: e.desc.size || "default",
disabled: e.disabled || e.desc.disabled
}, {
dropdown: P(() => [
J(F, null, {
default: P(() => [
(d(!0), A(ie, null, ve(r.value, (C, M) => (d(), L(x, ae({
key: M + (C.label || C.title)
}, Ae(o.value(C))), {
default: P(() => [
he(de(C.label || C.title), 1)
]),
_: 2
}, 1040))), 128))
]),
_: 1
})
]),
default: P(() => [
J(m, {
type: "primary",
size: e.desc.size || "default",
plain: e.desc.plain ?? !0
}, {
default: P(() => [
p[0] || (p[0] = he(" 更多", -1)),
J(f, { class: "el-icon--right" }, {
default: P(() => [
J(W(On))
]),
_: 1
})
]),
_: 1
}, 8, ["size", "plain"])
]),
_: 1
}, 8, ["size", "disabled"])) : N("", !0)
], 4);
};
}
});
const ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: In }, Symbol.toStringTag, { value: "Module" }));
function ls(e) {
return Array.isArray(e) ? e : e == null || e === "" ? [] : e.split(",");
}
function ns(e, l) {
const t = {
"M+": e.getMonth() + 1,
// 月份
"d+|D+": e.getDate(),
// 日
"h+": e.getHours() % 12 === 0 ? 12 : e.getHours() % 12,
// 小时
"H+": e.getHours(),
// 小时
"m+|M+": e.getMinutes(),
// 分
"s+|S+": e.getSeconds(),
// 秒
"q+": Math.floor((e.getMonth() + 3) / 3),
// 季度
S: e.getMilliseconds(),
// 毫秒
a: e.getHours() < 12 ? "上午" : "下午",
// 上午/下午
A: e.getHours() < 12 ? "AM" : "PM"
// AM/PM
};
/(y+|Y+)/.test(l) && (l = l.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let n in t)
new RegExp("(" + n + ")").test(l) && (l = l.replace(RegExp.$1, RegExp.$1.length === 1 ? t[n] : ("00" + t[n]).substr(("" + t[n]).length)));
return l;
}
function yt(e, l) {
if (!l || !e || e.length <= 0)
return null;
if (Array.isArray(e)) {
let t = JSON.parse(JSON.stringify(l));
for (let n = 0; n < e.length; n++) {
if (t = t[Array.isArray(t) ? parseInt(e[n]) : e[n]], t == null)
return null;
if (t === "")
return "";
}
return t;
} else
return l[e] || null;
}
function as(e) {
switch (e.type) {
case void 0:
e.type = "primary";
break;
case "add":
e.type = "primary", e.title = e.title || "新增", e.icon = "ele-Plus";
break;
case "edit":
e.type = "primary", e.title = e.title || "编辑", e.icon = "ele-EditPen";
break;
case "delete":
case "del":
e.type = "danger", e.title = e.title || "删除", e.icon = "ele-Delete";
break;
}
return e;
}
function jn(e, l, t, n, r) {
const u = [], o = (/* @__PURE__ */ new Date()).getTime();
return e && e.length > 0 && e.map((a, v) => {
switch (a.children ? (a.headerAlign = a.headerAlign || "center", a.children = jn(a.children, l, t, n || "center", r)) : (a.headerAlign = a.headerAlign || n || "center", a.align = a.align || n || "center"), a.type || (a.type = "text"), a.type) {
case "image":
a.width = a.width || "110px", a.align = a.align || n || "center", a.headerAlign = a.headerAlign || n || "center";
break;
case "btns":
if (!a.minWidth && a.btns && a.btns.length >= 2) {
let i = 0;
for (let s = 0; s < a.btns.length && s < (a.limit || 3); s++)
a.btns[s] && typeof a.btns[s].label == "string" ? i += a.btns[s].label.length : i += 4;
a.width = a.width || i * 24 + "px";
}
a.align = a.align || n || "center", a.headerAlign = a.headerAlign || n || "center", a.text = !0;
break;
}
a.minWidth = a.minWidth || (a.label !== "操作" ? r : "auto"), a.showOverflowTooltip = a.label !== "操作", os(a, l, t), a.__id = `${o + v}`, u.push(a);
}), u;
}
function os(e, l, t) {
e.vif !== void 0 && e.vif !== null ? typeof e.vif == "function" ? e._vif = e.vif(e) : e._vif = !!e.vif : e._vif = !0, e.auth && (l.auth ? e._vif = l.auth(e.auth) : console.warn("使用auth属性,请在crud注册时传入auth校验方法~")), e.__vif = t ? e.scShow !== !1 && e._vif : e._vif, e.children && e.children.every((n) => !n.__vif) && (e.__vif = !1);
}
const ss = 768, kl = g(!1), _l = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(`(max-width: ${ss}px)`) : null;
_l && (kl.value = _l.matches, _l.addEventListener("change", (e) => kl.value = e.matches));
function zt() {
return kl.value;
}
function dt(e, l) {
return JSON.stringify(e) === JSON.stringify(l);
}
function ct(e) {
return e instanceof Promise || typeof (e == null ? void 0 : e.then) == "function";
}
const rs = (e, l) => {
let t = "";
for (const n in e)
l && Array.isArray(l) && l.length > 0 && l.indexOf(n) >= 0 || e[n] !== void 0 && e[n] !== null && e[n] !== "" && (t !== "" && (t += "&"), t += n + "=" + e[n]);
return t;
}, $t = (e, l) => {
if (e === "" || e === null || e === void 0)
return "";
let t = "YYYY-MM-DD HH:mm:ss";
return l && (typeof l == "string" ? t = l : t = l(e)), ns(new Date(e), t);
}, is = {
name: "ElPlusFormCascader",
inheritAttrs: !1,
typeName: "cascader",
customOptions: {}
}, us = /* @__PURE__ */ le({
...is,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = ge("globalData"), n = e, u = De(n, "modelValue", l), o = g(!1), a = g({}), v = g(Pe(n)), i = $e([]);
return Ce(async () => {
a.value = await Te(n, { clearable: !0, props: { value: "value", label: "label", children: "children", checkStrictly: !!n.desc.checkStrictly }, ...ye() }), o.value = !0;
}), fe(
() => n.desc.options,
async (s) => {
typeof s == "string" ? i.splice(0, i.length, ...t[s] || []) : typeof s == "function" ? i.splice(0, i.length, ...await s(n.formData || {})) : Array.isArray(s) ? s && i && !dt(s, i) && i.splice(0, i.length, ...s) : i.splice(0, i.length);
},
{ immediate: !0 }
), (s, p) => {
const f = I("el-cascader");
return o.value ? (d(), L(f, ae({
key: 0,
class: "ElPlusFormCascader-panel"
}, a.value, { disabled: e.disabled }, Ae(v.value), {
options: i,
modelValue: W(u),
"onUpdate:modelValue": p[0] || (p[0] = (m) => Le(u) ? u.value = m : null)
}), null, 16, ["disabled", "options", "modelValue"])) : N("", !0);
};
}
});
const Bn = /* @__PURE__ */ Fe(us, [["__scopeId", "data-v-c9c2c533"]]), cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Bn }, Symbol.toStringTag, { value: "Module" })), ds = {
name: "ElPlusFormCascaderPanel",
inheritAttrs: !1,
typeName: "cascaderPanel",
customOptions: {}
}, fs = /* @__PURE__ */ le({
...ds,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = ge("globalData"), n = e, u = De(n, "modelValue", l);
fe(
() => n.modelValue,
(s) => {
u.value = s ? Array.isArray(s) ? s : [s] : [];
},
{ immediate: !0 }
);
const o = g({}), a = g(!1), v = g(Pe(n)), i = $e([]);
return Ce(async () => {
o.value = await Te(n, {
props: { value: "value", label: "label", children: "children" },
fetchSuggestions(s, p) {
p([]);
},
...ye()
}), a.value = !0;
}), fe(
() => n.desc.options,
async (s) => {
typeof s == "string" ? i.splice(0, i.length, ...t[s] || []) : typeof s == "function" ? i.splice(0, i.length, ...await s(n.formData || {})) : Array.isArray(s) ? s && i && !dt(s, i) && i.splice(0, i.length, ...s) : i.splice(0, i.length);
},
{ immediate: !0 }
), (s, p) => {
const f = I("el-cascader-panel");
return a.value ? (d(), L(f, ae({
key: 0,
class: "ElPlusFormCascaderPanel-panel"
}, o.value, { disabled: e.disabled }, Ae(v.value), {
options: i,
modelValue: W(u),
"onUpdate:modelValue": p[0] || (p[0] = (m) => Le(u) ? u.value = m : null)
}), null, 16, ["disabled", "options", "modelValue"])) : N("", !0);
};
}
});
const $n = /* @__PURE__ */ Fe(fs, [["__scopeId", "data-v-9f5b584f"]]), ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: $n }, Symbol.toStringTag, { value: "Module" })), ms = {
key: 1,
class: "null-tip"
}, vs = {
name: "ElPlusFormCheckbox",
inheritAttrs: !1,
typeName: "checkbox",
customOptions: {}
}, gs = /* @__PURE__ */ le({
...vs,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = ge("globalData"), n = e, u = De(n, "modelValue", l), o = $e([]), a = g(!1), v = g({}), i = g(Pe(n));
return Ce(async () => {
v.value = await Te(n, { ...ye() }), a.value = !0;
}), fe(
() => n.desc.options,
async (s) => {
typeof s == "string" ? o.splice(0, o.length, ...t[s] || []) : typeof s == "function" ? o.splice(0, o.length, ...await s(n.formData || {})) : Array.isArray(s) ? s && o && !dt(s, o) && o.splice(0, o.length, ...s) : o.splice(0, o.length);
},
{ immediate: !0 }
), fe(
() => n.modelValue,
(s) => {
s ? u.value = Array.isArray(s) ? s : [s] : u.value = [];
},
{ immediate: !0 }
), (s, p) => {
const f = I("el-checkbox"), m = I("el-checkbox-group");
return a.value ? (d(), A(ie, { key: 0 }, [
o != null && o.length ? (d(), L(m, ae({
key: 0,
class: "ElPlusFormCheckbox-panel"
}, v.value, { disabled: e.disabled }, Ae(i.value), {
modelValue: W(u),
"onUpdate:modelValue": p[0] || (p[0] = (x) => Le(u) ? u.value = x : null)
}), {
default: P(() => [
(d(!0), A(ie, null, ve(o, (x) => (d(), L(f, {
key: x.value,
label: x.value,
value: x.value
}, {
default: P(() => [
he(de(x.text || x.label), 1)
]),
_: 2
}, 1032, ["label", "value"]))), 128))
]),
_: 1
}, 16, ["disabled", "modelValue"])) : (d(), A("div", ms, "暂无选项"))
], 64)) : N("", !0);
};
}
});
const Ln = /* @__PURE__ */ Fe(gs, [["__scopeId", "data-v-2a297ce7"]]), ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Ln }, Symbol.toStringTag, { value: "Module" })), hs = {
name: "ElPlusFormCheckboxButton",
inheritAttrs: !1,
typeName: "checkboxButton",
customOptions: {}
}, bs = /* @__PURE__ */ le({
...hs,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l);
fe(
() => t.modelValue,
(v) => {
r.value = v ? Array.isArray(v) ? v : [v] : [];
},
{ immediate: !0 }
);
const u = g({}), o = g(!1), a = g(Pe(t));
return Ce(async () => {
u.value = await Te(t, { ...ye() }), o.value = !0;
}), (v, i) => {
const s = I("el-checkbox-button"), p = I("el-checkbox-group");
return o.value ? (d(), L(p, ae({
key: 0,
class: "ElPlusFormCheckboxButton-panel"
}, u.value, { disabled: e.disabled }, Ae(a.value), {
modelValue: W(r),
"onUpdate:modelValue": i[0] || (i[0] = (f) => Le(r) ? r.value = f : null)
}), {
default: P(() => [
(d(!0), A(ie, null, ve(e.desc.options, (f) => (d(), L(s, ae({
key: f.value,
value: f.value
}, { ref_for: !0 }, f.attrs), {
default: P(() => [
he(de(f.text), 1)
]),
_: 2
}, 1040, ["value"]))), 128))
]),
_: 1
}, 16, ["disabled", "modelValue"])) : N("", !0);
};
}
});
const zn = /* @__PURE__ */ Fe(bs, [["__scopeId", "data-v-4dc6128e"]]), _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: zn }, Symbol.toStringTag, { value: "Module" })), ws = {
name: "ElPlusFormColor",
inheritAttrs: !1,
typeName: "color",
customOptions: {}
}, xs = /* @__PURE__ */ le({
...ws,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l), u = g({}), o = g(Pe(t));
return Ce(async () => {
u.value = await Te(t, { ...ye() });
}), (a, v) => {
const i = I("el-color-picker");
return d(), L(i, ae({ class: "ElPlusFormColor-panel" }, u.value, { disabled: e.disabled }, Ae(o.value), {
modelValue: W(r),
"onUpdate:modelValue": v[0] || (v[0] = (s) => Le(r) ? r.value = s : null)
}), null, 16, ["disabled", "modelValue"]);
};
}
});
const Mn = /* @__PURE__ */ Fe(xs, [["__scopeId", "data-v-b89e85de"]]), As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Mn }, Symbol.toStringTag, { value: "Module" })), Cs = {
name: "ElPlusFormDate",
inheritAttrs: !1,
typeName: "date",
customOptions: {}
}, Ts = /* @__PURE__ */ le({
...Cs,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, n = l, r = g(!1), u = g({}), o = g(Pe(t)), a = De(t, "modelValue", n);
return Ce(async () => {
u.value = await Te(t, { valueFormat: "YYYY-MM-DD HH:mm:ss", editable: !1, ...ye() }), r.value = !0;
}), (v, i) => {
const s = I("el-date-picker");
return r.value ? (d(), L(s, ae({
key: 0,
class: "ElPlusFormDate-panel"
}, u.value, { disabled: e.disabled }, Ae(o.value), {
modelValue: W(a),
"onUpdate:modelValue": i[0] || (i[0] = (p) => Le(a) ? a.value = p : null)
}), null, 16, ["disabled", "modelValue"])) : N("", !0);
};
}
});
const Un = /* @__PURE__ */ Fe(Ts, [["__scopeId", "data-v-9e53a749"]]), ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Un }, Symbol.toStringTag, { value: "Module" })), Vs = {
name: "ElPlusFormDaterange",
inheritAttrs: !1,
typeName: "daterange",
customOptions: {}
}, Ss = /* @__PURE__ */ le({
...Vs,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l), u = g(Object.assign({}, Xe(), t.desc.slots)), o = g(!1), a = g({}), v = g(Pe(t));
return Ce(async () => {
const i = typeof t.desc.elType == "function" ? t.desc.elType(t.formData) : t.desc.elType, s = i === "monthrange" ? "YYYY-MM" : i === "yearrange" ? "YYYY" : "YYYY-MM-DD";
a.value = await Te(t, { type: "daterange", format: s, valueFormat: "x", editable: !1, ...ye() }), o.value = !0;
}), (i, s) => {
const p = I("el-date-picker");
return o.value ? (d(), L(p, ae({
key: 0,
class: "el-plusF-form-daterange-panel"
}, a.value, { disabled: e.disabled }, Ae(v.value), {
modelValue: W(r),
"onUpdate:modelValue": s[0] || (s[0] = (f) => Le(r) ? r.value = f : null)
}), at({ _: 2 }, [
ve(u.value, (f, m, x) => ({
name: m,
fn: P((F) => [
ke(i.$slots, m, { data: F }, void 0, !0)
])
}))
]), 1040, ["disabled", "modelValue"])) : N("", !0);
};
}
});
const Rn = /* @__PURE__ */ Fe(Ss, [["__scopeId", "data-v-6bed53d6"]]), Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Rn }, Symbol.toStringTag, { value: "Module" })), Ds = {
name: "ElPlusFormDatetime",
inheritAttrs: !1,
typeName: "datetime",
customOptions: {}
}, Ps = /* @__PURE__ */ le({
...Ds,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l), u = g({}), o = g(!1), a = g(Pe(t));
return Ce(async () => {
u.value = await Te(t, { valueFormat: "YYYY-MM-DD HH:mm:ss", ...ye() }), o.value = !0;
}), (v, i) => {
const s = I("el-date-picker");
return o.value ? (d(), L(s, ae({
key: 0,
class: "ElPlusFormDatetime-panel"
}, u.value, { disabled: e.disabled }, Ae(a.value), {
type: "datetime",
modelValue: W(r),
"onUpdate:modelValue": i[0] || (i[0] = (p) => Le(r) ? r.value = p : null)
}), null, 16, ["disabled", "modelValue"])) : N("", !0);
};
}
});
const Nn = /* @__PURE__ */ Fe(Ps, [["__scopeId", "data-v-6e06c923"]]), Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Nn }, Symbol.toStringTag, { value: "Module" })), Os = {
name: "ElPlusFormDatetimerange",
inheritAttrs: !1,
typeName: "datetimerange",
customOptions: {}
}, Is = /* @__PURE__ */ le({
...Os,
props: {
modelValue: {},
field: {},
desc: {},
formData: {},
disabled: { type: Boolean }
},
emits: ["update:modelValue"],
setup(e, { emit: l }) {
const t = e, r = De(t, "modelValue", l), u = g(Object.assign({}, Xe(), t.desc.slots)), o = g({}), a = g(!1), v = g(Pe(t));
return Ce(async () => {
o.value = await Te(t, { type: "datetimerange", format: "YYYY-MM-DD HH:mm:ss", valueFormat: "x", editable: !1, ...ye() }), a.value = !0;
}), (i, s) => {
const p = I("el-date-picker");
return a.value ? (d(), L(p, ae({
key: 0,
class: "el-plusF-form-datetimerange-panel"
}, o.value, { disabled: e.disabled }, Ae(v.value), {
modelValue: W(r),
"onUpdate:modelValue": s[0] || (s[0] = (f) => Le(r) ? r.value = f : null)
}), at({ _: 2 }, [
ve(u.value, (f, m, x) => ({
name: m,
fn: P((F) => [
ke(i.$slots, m, { data: F }, void 0, !0)
])
}))
]), 1040, ["disabled", "modelValue"])) : N("", !0);
};
}
});
const Kn = /* @__PURE__ */ Fe(Is, [["__scopeId", "data-v-42ba2168"]]), js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Kn }, Symbol.toStringTag, { value: "Module" })), Qn = ["image/jpg", "image/png", "image/gif", "image/jpeg"], Ut = [".jpe", ".jpeg", ".jpg", ".gif", ".png"], Hn = ["video/3gpp", "video/mpeg", "application/mp4", "video/mp4", "video/ogg", "video/x-flv", "video/x-msvideo"], qn = [".3gpp", ".mpeg", ".mpg", ".mp4", ".ogv", ".flv", ".avi"], Gn = ["audio/x-wav", "audio/x-ms-wma", "audio/mp4", "audio/mp3"], Yn = [".wav", ".wma", ".mp4a", ".mp3"], Wn = ["application/x-msaccess", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.presentation", " application/vnd.ms-powerpoint", "application/vnd.ms-excel", " application/msword", "application/pdf", "application/vnd.ms-works"], Jn = [".mdb", ".docx", ".xlsx", ".pptx", ".ppt", ".xls", ".doc", ".pdf"], Xn = ["application/xml", "application/x-sh", "application/json", "application/javascript", "application/java-vm", "application/java-archive", "text/html", "text/plain"], Zn = [".xml", ".sh", ".json", ".js", ".class", ".jar", ".html", ".txt", ".wdb", ".wps"], ea = ["application/x-rar-compressed", "application/x-msdownload", "application/x-font-woff", " application/x-font-ttf", "application/x-7z-compressed", " application/vnd.android.package-archive", "application/zip"], ta = [".rar", ".exe", ".woff", ".ttf", ".7z", ".apk", ".zip"], Bs = [...Qn, ...Hn, ...Gn, ...Wn, ...Xn, ...ea], $s = [...Ut, ...qn, ...Yn, ...Jn, ...Zn, ...ta], Pt = [
{ type: "pdf", suffixes: [".pdf"] },
{ type: "txt", suffixes: [".txt"] },
{ type: "excel", suffixes: [".xls", ".xlsx"] },
{ type: "word", suffixes: [".doc", ".docx"] },
{ type: "ppt", suffixes: [".ppt", ".pptx"] },
{ type: "zip", suffixes: [".zip", ".rar", ".7z"] }
], Jl = /* @