UNPKG

lazy-components

Version:

一个基于Vue3和Vite的配置型快速开发组件库

1,839 lines 53.5 kB
import { g as U, p as b, d as A, i as C, o as x, m as j, a as F, b as I } from "./index-DlLdbrwu.js"; import { resolveComponent as u, openBlock as o, createBlock as c, createCommentVNode as y, resolveDirective as N, createElementBlock as f, normalizeClass as z, createElementVNode as S, createTextVNode as P, toDisplayString as V, withDirectives as $, withCtx as p, renderSlot as O, createVNode as v, normalizeStyle as B, Fragment as k, renderList as D, mergeProps as K, resolveDynamicComponent as Z } from "vue"; import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const M = { name: "ZInput", props: { modelValue: { default: "" }, prop: { default: "", type: String }, label: { default: "", type: String }, type: { default: void 0 }, rows: { default: void 0 }, showWordLimit: { type: Boolean, default: !1 }, clearable: { type: Boolean, default: !0 }, disabled: { type: Boolean, default: !1 }, maxlength: { type: Number, default: void 0 }, scope: { type: Object, default: () => { } }, hasPermi: { type: Array, default: [] }, children: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { rPlaceholder: "", permi_visible: !0 }; }, async mounted() { const l = U(this.$refs.ipt.$el); this.rPlaceholder = this.placeholder ? this.placeholder : `请输入${l}`, this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, computed: { rightValue() { return this.scope && Object.keys(this.scope).length ? this.scope.row[this.prop] : this.modelValue; } }, methods: {} }; function R(l, t, e, d, a, i) { const r = u("el-input"); return a.permi_visible ? (o(), c(r, { key: 0, ref: "ipt", modelValue: i.rightValue, placeholder: a.rPlaceholder, type: e.type, rows: e.rows, "show-word-limit": e.showWordLimit, maxlength: e.maxlength, clearable: e.clearable, disabled: e.disabled, "onUpdate:modelValue": t[0] || (t[0] = (n) => { Object.keys(e.scope).length ? e.scope.row[e.prop] = n : l.$emit("update:modelValue", n); }), onClick: t[1] || (t[1] = (n) => { l.$emit("click", n); }) }, null, 8, ["modelValue", "placeholder", "type", "rows", "show-word-limit", "maxlength", "clearable", "disabled"])) : y("", !0); } const E = /* @__PURE__ */ _(M, [["render", R], ["__scopeId", "data-v-2abeeb6d"]]), H = { name: "ZTable", components: {}, props: { modelValue: { type: Array, default: () => [] }, isDrag: { type: Boolean, default: !1 }, selectable: { type: Function, default: void 0 }, selectKey: { type: String, default: "" }, sortable: { type: Boolean, default: !1 }, loading: { type: Boolean, default: !0 }, autoFlex: { type: Boolean, default: !1 }, height: { default: void 0 }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { default_arr: [], default_data: {}, visible: !0, times: 0, ids: /* @__PURE__ */ new Set(), idsDict: {}, idsSize: 0, permi_visible: !0 }; }, computed: { rightHeight() { return this.height ? this.height : this.autoFlex ? "calc(100% - 20px)" : void 0; } }, watch: { modelValue: { handler: function(l) { this.selectKey && (this.visible = !1, this.toggle(l)); }, immediate: !0 } }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, methods: { toggle(l) { console.log("toggle", l), console.log("toggle2", this.ids), l.forEach((t) => { this.ids.has(t[this.selectKey]) && (console.log("检测到相同ID,勾选", t), this.$nextTick(() => { this.$refs.body_table.toggleRowSelection(t, !0); })); }); }, select(l, t) { console.log("SSSEEELECt", l), this.ids.has(t[this.selectKey]) ? (this.ids.delete(t[this.selectKey]), delete this.idsDict[this.selectKey]) : this.limit === "all" ? (this.ids.add(t[this.selectKey]), this.idsDict[t[this.selectKey]] = t) : this.idsSize >= this.limit ? (this.$message.error(`限制只能选择${this.limit}个资源`), this.$refs.body_table.toggleRowSelection(t)) : (this.ids.add(t[this.selectKey]), this.idsDict[t[this.selectKey]] = t), this.idsSize = this.ids.size, console.log("zt", this.ids, this.idsDict), this.$emit("modelPress", "select", { ids: Array.from(this.ids), idsDict: this.idsDict }); }, selectAll(l) { console.log("selection", l), l.length === 0 ? (this.modelValue.forEach((t) => { this.ids.delete(t[this.selectKey]), this.idsDict.hasOwnProperty(t[this.selectKey]) && delete this.idsDict[t[this.selectKey]]; }), this.$refs.body_table.clearSelection()) : this.modelValue.forEach((t, e) => { typeof this.selectable == "function" ? this.selectable(t, e) && (this.ids.add(t[this.selectKey]), this.idsDict[t[this.selectKey]] = t) : (this.ids.add(t[this.selectKey]), this.idsDict[t[this.selectKey]] = t); }), this.idsSize = this.ids.size, this.$emit("modelPress", "select", { ids: Array.from(this.ids), idsDict: this.idsDict }); }, idsClear() { console.log("idsClear"), this.idsSize = 0, this.$emit("modelPress", "select", { ids: [], idsDict: {} }), this.ids.clear(), this.idsDict = {}, this.$refs.body_table.clearSelection(); }, setDefaultValue(l) { const t = Object.keys(l); this.default_arr = A(t), this.default_data = A(l), this.ids = new Set(t), this.idsDict = l, this.idsSize = this.ids.size, this.$emit("modelPress", "select", { ids: this.ids, idsDict: this.idsDict }), this.$nextTick(() => { this.value && this.toggle(this.value); }); } } }, W = { key: 0, style: { "margin-bottom": "5px" } }, q = { style: { color: "#1890ff" } }; function L(l, t, e, d, a, i) { const r = u("el-table-column"), n = u("el-table"), h = N("loading"); return o(), f("div", { class: z(["z_table", e.autoFlex && "auto-flex"]) }, [ e.selectKey !== "" ? (o(), f("div", W, [ S("span", null, [ P("已经选了"), S("i", q, V(a.idsSize), 1), P("项目 "), S("span", { style: { color: "#1890ff", cursor: "pointer" }, onClick: t[0] || (t[0] = (...m) => i.idsClear && i.idsClear(...m)) }, "清空") ]) ])) : y("", !0), S("div", { class: z({ draggable: e.isDrag }), style: { height: "100%", overflow: "auto" } }, [ $((o(), c(n, { ref: "body_table", data: e.modelValue, onSelect: i.select, onSelectAll: i.selectAll, height: i.rightHeight }, { default: p(() => [ e.sortable ? (o(), c(r, { key: 0, label: "序号", type: "index", width: "50" })) : y("", !0), e.selectKey !== "" ? (o(), c(r, { key: 1, type: "selection", selectable: e.selectable }, null, 8, ["selectable"])) : y("", !0), O(l.$slots, "default", {}, void 0, !0) ]), _: 3 }, 8, ["data", "onSelect", "onSelectAll", "height"])), [ [h, e.loading] ]) ], 2) ], 2); } const J = /* @__PURE__ */ _(H, [["render", L], ["__scopeId", "data-v-1a5bdf21"]]), Y = { name: "ZForm", components: {}, props: { modelValue: { default: () => ({}) }, allValue: { default: () => ({}) }, children: { type: Array, default: () => [] }, inline: { type: Boolean, default: !1 }, labelWidth: { type: String, default: void 0 }, verify: { default: void 0 }, hasPermi: { type: Array, default: [] } }, data() { return { permi_visible: !0 }; }, emits: ["modelPress", "update:modelValue", "change"], computed: { form_rules() { let l = this.children.map((t) => t.options.hasOwnProperty("verify") ? C(t.options.verify, "Boolean") ? !1 : C(t.options.verify, "func") ? [t.prop, [{ required: !0, validator: t.options.verify, trigger: "blur" }]] : [t.prop, [{ required: !0, message: `请输入${t.label}`, trigger: "blur" }]] : this.verify === "req" ? [t.prop, [{ required: !0, message: `请输入${t.label}`, trigger: "blur" }]] : !1); return l = l.filter((t) => t), Object.fromEntries(l); } }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await exfunc.permiCheck(this.hasPermi)); }, methods: { validate(l) { this.$refs.z_form.validate(l); }, resetFields() { this.$refs.z_form.resetFields(); }, clearValidate() { console.log("清除校验"), this.$nextTick(() => { this.$refs.z_form.clearValidate(); }); }, channelChange() { } } }, G = { key: 0, class: "z_form" }; function Q(l, t, e, d, a, i) { const r = u("el-form"); return a.permi_visible ? (o(), f("div", G, [ v(r, { ref: "z_form", inline: e.inline, "label-width": e.labelWidth, model: e.allValue, rules: i.form_rules }, { default: p(() => [ O(l.$slots, "default", {}, void 0, !0) ]), _: 3 }, 8, ["inline", "label-width", "model", "rules"]) ])) : y("", !0); } const X = /* @__PURE__ */ _(Y, [["render", Q], ["__scopeId", "data-v-601ab053"]]), ee = { name: "ZButton", props: { type: { type: String, default: "" }, size: { type: String, default: void 0 }, prop: { type: String, default: "" }, label: { default: "点击" }, disabled: { type: Boolean, default: !1 }, hasPermi: { type: Array, default: [] }, children: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function te(l, t, e, d, a, i) { const r = u("el-button"); return a.permi_visible ? (o(), c(r, { key: 0, type: e.type, size: e.size, disabled: e.disabled, onClick: t[0] || (t[0] = (n) => l.$emit("modelPress", e.prop)) }, { default: p(() => [ P(V(e.label ? e.label : "点击"), 1) ]), _: 1 }, 8, ["type", "size", "disabled"])) : y("", !0); } const le = /* @__PURE__ */ _(ee, [["render", te]]), ie = { name: "ZPage", components: {}, props: { label: { type: String, default: "" }, value: { default: () => ({}) } }, emits: ["modelPress", "update:modelValue", "change"], data() { return {}; }, methods: {} }, ae = { class: /* @__PURE__ */ z(["z-page"]) }, se = { key: 0, class: "z-page-title" }; function oe(l, t, e, d, a, i) { return o(), f("div", ae, [ e.label ? (o(), f("div", se, V(e.label), 1)) : y("", !0), O(l.$slots, "default", {}, void 0, !0) ]); } const ne = /* @__PURE__ */ _(ie, [["render", oe], ["__scopeId", "data-v-dda9369f"]]), re = { name: "ZPagination", props: { options: { default: () => ({}), type: Object }, modelValue: { default: () => [], type: Array }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, methods: { pageChange(l) { const t = A(this.modelValue); t[0] = l, this.$emit("update:modelValue", t), this.$nextTick(() => { this.$emit("modelPress", "re"); }); }, limitChange(l) { const t = A(this.modelValue); t[1] = l, this.$emit("update:modelValue", t), this.$nextTick(() => { this.$emit("modelPress", "re"); }); }, pagination() { } } }; function de(l, t, e, d, a, i) { const r = u("pagination"); return a.permi_visible ? (o(), c(r, { key: 0, background: "", page: e.modelValue.length ? e.modelValue[0] : 0, limit: e.modelValue.length ? e.modelValue[1] : 0, total: e.modelValue.length ? e.modelValue[2] : 0, "page-sizes": [5, 10, 15, 30, 50, 100, 200], layout: "total,sizes,prev, pager, next,jumper", "onUpdate:page": i.pageChange, "onUpdate:limit": i.limitChange, onPagination: i.pagination }, null, 8, ["page", "limit", "total", "onUpdate:page", "onUpdate:limit", "onPagination"])) : y("", !0); } const ue = /* @__PURE__ */ _(re, [["render", de]]), he = { name: "z_layout", data() { return {}; } }; function ce(l, t, e, d, a, i) { return o(), f("div", null, [ O(l.$slots, "default", {}, void 0, !0) ]); } const pe = /* @__PURE__ */ _(he, [["render", ce], ["__scopeId", "data-v-b10b4640"]]), me = { name: "ZDatePicker", props: { modelValue: { default: "" }, placeholder: { type: String, default: "请选择时间" }, limit: { default: "", type: String }, clearable: { type: Boolean, default: !0 }, valueFormat: { default: "YYYY-MM-DD HH:mm:ss", type: String }, type: { default: "datetimerange", type: String }, width: { default: "350px", type: String }, disabled: { default: !1, type: Boolean }, isSameDay: { default: !0, type: Boolean }, pickerOptions: { type: Object, default: () => ({}) }, shortcuts: { default: () => [] }, hasPermi: { type: Array, default: [] }, children: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue"], data() { return { dateArr: ["", ""], tempDateArr: ["", ""], permi_visible: !0, setDisabled: { // 返回禁用时间 disabledDate(l) { return l.getTime() > Date.now(); } } }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, methods: { setDefaultValue(l) { this.dateArr = l; }, ckSyncValue() { this.tempDateArr[0] && this.tempDateArr[1] && (this.dateArr = JSON.parse(JSON.stringify(this.tempDateArr))); } } }; function fe(l, t, e, d, a, i) { const r = u("el-date-picker"); return o(), f("div", null, [ a.permi_visible ? (o(), c(r, { key: 0, modelValue: e.modelValue, type: e.type, "value-format": e.valueFormat, style: B({ width: e.width }), clearable: e.clearable, disabled: e.disabled, shortcuts: e.shortcuts, "picker-options": { ...e.pickerOptions, disabledDate(n) { return e.limit === "before" ? n.getTime() > Date.now() : e.limit === "after" ? n.getTime() < Date.now() - 864e5 : !1; }, selectableRange: e.isSameDay ? e.limit === "after" ? `${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()} - 23:59:59` : e.limit === "before" ? `00:00:00 - ${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()}` : "00:00:00 - 23:59:59" : "00:00:00 - 23:59:59" }, "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", placeholder: e.placeholder, align: "right", "onUpdate:modelValue": t[0] || (t[0] = (n) => { l.$emit("update:modelValue", n), l.$emit("change", n); }) }, null, 8, ["modelValue", "type", "value-format", "style", "clearable", "disabled", "shortcuts", "picker-options", "placeholder"])) : y("", !0) ]); } const ye = /* @__PURE__ */ _(me, [["render", fe]]), _e = { name: "ZSelect", props: { modelValue: { default: "" }, data: { type: Array, default: () => [] }, options: { type: Object, default: () => ({}) }, selected: { type: Array, default: () => [] }, selectedKey: { type: String, default: "key" }, disabled: { type: Boolean, default: !1 }, filterable: { type: Boolean, default: !0 }, clearable: { type: Boolean, default: !0 }, multiple: { type: Boolean, default: !1 }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { console, rPlaceholder: "", permi_visible: !0 }; }, async mounted() { const l = U(this.$refs.ipt.$el); this.rPlaceholder = this.placeholder ? this.placeholder : `请选择${l}`, this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, methods: { test() { } } }; function ge(l, t, e, d, a, i) { const r = u("el-option"), n = u("el-select"); return a.permi_visible ? (o(), c(n, { key: 0, ref: "ipt", class: "z_select", modelValue: e.modelValue, disabled: e.disabled, clearable: e.clearable, filterable: e.filterable, multiple: e.multiple, "collapse-tags": e.options.hasOwnProperty("multiple"), "onUpdate:modelValue": t[0] || (t[0] = (h) => { e.selected.find((s) => s[e.selectedKey] === h) || l.$emit("update:modelValue", h); }), onChange: t[1] || (t[1] = (h) => { console.log("select触发CHange", h), l.$emit("modelChange", h); }), onClear: t[2] || (t[2] = (h) => { l.$emit("clear", h); }) }, { default: p(() => [ (o(!0), f(k, null, D(e.data, (h) => (o(), c(r, { key: h.key, label: h.value, value: h.key, disabled: e.selected.find((m) => m[e.selectedKey] === h.key) }, null, 8, ["label", "value", "disabled"]))), 128)) ]), _: 1 }, 8, ["modelValue", "disabled", "clearable", "filterable", "multiple", "collapse-tags"])) : y("", !0); } const be = /* @__PURE__ */ _(_e, [["render", ge], ["__scopeId", "data-v-e89ea3a2"]]), Ve = { name: "ZDialog", components: {}, props: { visible: { default: !1, type: Boolean }, fatherThis: { default: void 0 }, verifyKey: { default: "form", type: String }, title: { default: "新增/编辑", type: String }, appendToBody: { default: !1, type: Boolean }, width: { default: "50%", type: String }, loading: { default: !1, type: Boolean }, onlyClose: { default: !1, type: Boolean }, closeText: { default: "取 消", type: String }, confirmText: { default: "确 定", type: String }, onlyConfirm: { default: !1, type: Boolean }, noVerify: { default: !1, type: Boolean } }, emits: ["modelPress", "update:modelValue", "change"], data() { return {}; }, methods: { handleClose() { this.$emit("update:modelValue", !1); }, dialogConfirm() { this.sendFinish(); }, sendFinish() { this.fatherThis !== void 0 ? this.fatherThis.$refs[this.verifyKey].validate((l) => { l ? this.$emit("finish", !0) : this.$message.error("校验不通过"); }) : this.$emit("finish", !0); }, setDefaultValue(l) { }, clearDefaultValue() { } } }, ve = { ref: "dialogContent" }, Pe = { class: "dialog-footer" }; function we(l, t, e, d, a, i) { const r = u("el-button"), n = u("el-dialog"); return o(), c(n, { ref: "dialog", visible: e.visible, title: e.title, class: "z_dialog", "before-close": i.handleClose, "append-to-body": e.appendToBody, width: e.width }, { footer: p(() => [ S("span", Pe, [ e.onlyConfirm ? y("", !0) : (o(), c(r, { key: 0, disabled: e.loading, onClick: i.handleClose }, { default: p(() => [ P(V(e.closeText), 1) ]), _: 1 }, 8, ["disabled", "onClick"])), e.onlyClose ? y("", !0) : (o(), c(r, { key: 1, disabled: e.loading, type: "primary", onClick: i.dialogConfirm }, { default: p(() => [ P(V(e.confirmText), 1) ]), _: 1 }, 8, ["disabled", "onClick"])) ]) ]), default: p(() => [ S("div", ve, [ O(l.$slots, "default", {}, void 0, !0) ], 512) ]), _: 3 }, 8, ["visible", "title", "before-close", "append-to-body", "width"]); } const ke = /* @__PURE__ */ _(Ve, [["render", we], ["__scopeId", "data-v-63f8504e"]]), Se = { name: "ZRadio", props: { data: { default: [], type: Array }, type: { default: "number", type: String }, groupType: { default: "radio", type: String }, modelValue: { default: 0 }, disabled: { default: !1, type: Boolean }, hasPermi: { type: Array, default: [] }, children: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { radio: 0, defaultData: { number: [{ value: "是", key: 1 }, { value: "否", key: 0 }], boolean: [{ value: "是", key: !0 }, { value: "否", key: !1 }] }, permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }, De = { key: 0, class: "z_radio" }; function Ce(l, t, e, d, a, i) { const r = u("el-radio"), n = u("el-radio-button"), h = u("el-radio-group"); return a.permi_visible ? (o(), f("div", De, [ v(h, { modelValue: e.modelValue, disabled: e.disabled, "onUpdate:modelValue": t[0] || (t[0] = (m) => { l.$emit("update:modelValue", m); }), onChange: t[1] || (t[1] = (m) => { l.$emit( "change", m ); }) }, { default: p(() => [ e.groupType === "radio" ? (o(!0), f(k, { key: 0 }, D(e.data.length !== 0 ? e.data : a.defaultData[e.type], (m) => (o(), c(r, { value: m.key }, { default: p(() => [ P(V(m.value), 1) ]), _: 2 }, 1032, ["value"]))), 256)) : e.groupType === "button" ? (o(!0), f(k, { key: 1 }, D(e.data.length !== 0 ? e.data : a.defaultData[e.type], (m) => (o(), c(n, { value: m.key }, { default: p(() => [ P(V(m.value), 1) ]), _: 2 }, 1032, ["value"]))), 256)) : y("", !0) ]), _: 1 }, 8, ["modelValue", "disabled"]) ])) : y("", !0); } const ze = /* @__PURE__ */ _(Se, [["render", Ce], ["__scopeId", "data-v-4e076294"]]), xe = { name: "ZSteps", props: { modelValue: { default: "" }, data: { default: [], type: Array }, jump: { type: Boolean, default: !1 }, size: { type: String, default: void 0 }, prop: { type: String, default: "" }, label: { default: "点击" }, disabled: { type: Boolean, default: !1 }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function Ae(l, t, e, d, a, i) { const r = u("el-step"), n = u("el-steps"); return a.permi_visible ? (o(), c(n, { key: 0, active: e.modelValue, "finish-status": "success" }, { default: p(() => [ (o(!0), f(k, null, D(e.data, (h, m) => (o(), c(r, { title: h.key, description: h.value, icon: h.icon, key: m, onClick: () => { e.jump && l.$emit("update:modelValue", m); } }, null, 8, ["title", "description", "icon", "onClick"]))), 128)) ]), _: 1 }, 8, ["active"])) : y("", !0); } const Be = /* @__PURE__ */ _(xe, [["render", Ae]]), Oe = { name: "ZSpan", props: { modelValue: { default: "" }, isTag: { default: !1, type: Boolean }, closable: { default: !1, type: Boolean }, hit: { default: !1, type: Boolean }, type: { default: "", type: String }, color: { default: "", type: String }, size: { default: "", type: String }, effect: { default: "", type: String }, data: { type: Array, default: () => [] }, prop: { type: String, default: "" }, limit: { type: Number, default: 0 }, scope: { default: () => { }, type: Object }, dict: { type: Object, default: () => { } }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { isType: C, permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, computed: { after_deal_value() { let l = this.modelValue; return this.scope && this.scope.row && (l = this.scope.row[this.prop]), this.dict && Object.keys(this.dict).length > 0 && (l = this.dict[l]), l || (this.data.length ? this.data[0].value : ""); } } }, Te = { key: 0 }, je = { key: 1 }; function Ue(l, t, e, d, a, i) { const r = u("el-tag"); return a.permi_visible ? (o(), f("div", Te, [ e.type || e.isTag || a.isType(i.after_deal_value, "object") ? (o(), c(r, { key: 0, type: a.isType(i.after_deal_value, "object") ? i.after_deal_value.type : e.type, color: a.isType(i.after_deal_value, "object") && i.after_deal_value.color ? i.after_deal_value.color : e.color, closable: e.closable, hit: e.hit, size: e.size, effect: e.effect, onClose: t[0] || (t[0] = (n) => l.$emit("modelPress", e.prop, { opType: "close" })) }, { default: p(() => [ P(V(a.isType(i.after_deal_value, "object") ? i.after_deal_value.value : i.after_deal_value), 1) ]), _: 1 }, 8, ["type", "color", "closable", "hit", "size", "effect"])) : (o(), f("span", je, V(i.after_deal_value), 1)) ])) : y("", !0); } const Ke = /* @__PURE__ */ _(Oe, [["render", Ue]]), Fe = { name: "ZSwitch", props: { modelValue: { default: "" }, rightValue: { default: "" }, errorValue: { default: "" }, width: { type: Number, default: 40 }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, methods: {} }; function Ie(l, t, e, d, a, i) { const r = u("el-switch"); return a.permi_visible ? (o(), c(r, { key: 0, modelValue: e.modelValue, "active-color": "#13ce66", "inactive-color": "#ff4949", "active-value": 1, "inactive-value": 0, "active-text": e.rightValue, "inactive-text": e.errorValue, width: e.width, "onUpdate:modelValue": t[0] || (t[0] = (n) => { l.$emit("update:modelValue", n); }), onChange: t[1] || (t[1] = (n) => { l.$emit("change", n); }) }, null, 8, ["modelValue", "active-text", "inactive-text", "width"])) : y("", !0); } const Ne = /* @__PURE__ */ _(Fe, [["render", Ie]]), $e = { name: "ZOperate", props: { tableOperationList: { type: Array, default: () => [] }, modelValue: { default: "默认" }, disabled: { default: !1 }, prop: { type: String, default: "opType" }, options: { type: Object, default: () => ({}) }, scope: { type: Object, default: () => ({}) }, type: { default: "dropdown", type: String }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { object_get: x, isType: C, permi_visible: !0, operationList: [] }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, watch: { tableOperationList: { deep: !0, async handler(l) { let t = x(this.tableOperationList, this.prop === "op" ? "默认" : this.scope.row[this.prop]); t ? t = (await Promise.all(t.map(async (d) => { const a = d.isRender ? d.isRender(scope.row) : !0, i = await (d.hasPermi && d.hasPermi.length > 0 ? b(d.hasPermi) : async () => !0); return a && i ? d : null; }))).filter((d) => d) : t = [], this.operationList = t; } } } }, Ze = { key: 0, class: "z_operate" }, Me = { class: "el-dropdown-link" }, Re = ["onClick"]; function Ee(l, t, e, d, a, i) { const r = u("el-button"), n = u("el-dropdown-item"), h = u("el-dropdown-menu"), m = u("el-dropdown"); return a.permi_visible ? (o(), f("div", Ze, [ e.options.type === "text" ? (o(!0), f(k, { key: 0 }, D(a.operationList, (s, g) => (o(), c(r, { type: "text", style: B(s.hasOwnProperty("style") ? s.style : {}), icon: s && s.icon, onClick: (w) => s && s.func(e.scope.row, e.scope.$index) }, { default: p(() => [ P(V(s && s.text), 1) ]), _: 2 }, 1032, ["style", "icon", "onClick"]))), 256)) : (o(), c(m, { key: 1, placement: "right-start" }, { dropdown: p(() => [ v(h, null, { default: p(() => [ (o(!0), f(k, null, D(a.operationList, (s, g) => (o(), f("div", null, [ (o(), f("div", { key: g, style: B(s.hasOwnProperty("style") ? s.style : {}), onClick: (w) => s && s.func(e.scope.row, e.scope.$index) }, [ v(n, null, { default: p(() => [ v(r, { type: "text", icon: s && s.icon }, { default: p(() => [ P(V(s && s.text), 1) ]), _: 2 }, 1032, ["icon"]) ]), _: 2 }, 1024) ], 12, Re)) ]))), 256)) ]), _: 1 }) ]), default: p(() => [ S("span", Me, [ v(r, { disabled: e.disabled, type: "text" }, { default: p(() => [ P("操作") ]), _: 1 }, 8, ["disabled"]) ]) ]), _: 1 })) ])) : y("", !0); } const He = /* @__PURE__ */ _($e, [["render", Ee]]), We = { name: "ZCheckbox", components: {}, props: { data: { default: () => [], type: Array }, modelValue: { default: () => [], type: Array }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function qe(l, t, e, d, a, i) { const r = u("el-checkbox"), n = u("el-checkbox-group"); return a.permi_visible ? (o(), c(n, { key: 0, class: "z_checkbox", modelValue: e.modelValue, "onUpdate:modelValue": t[0] || (t[0] = (h) => { l.$emit("update:modelValue", h); }) }, { default: p(() => [ (o(!0), f(k, null, D(e.data, (h) => (o(), c(r, { label: h.key, disabled: h.hasOwnProperty("disabled") ? h.disabled : !1 }, { default: p(() => [ P(V(h.value), 1) ]), _: 2 }, 1032, ["label", "disabled"]))), 256)) ]), _: 1 }, 8, ["modelValue"])) : y("", !0); } const Le = /* @__PURE__ */ _(We, [["render", qe], ["__scopeId", "data-v-df1c06c4"]]), Je = { name: "ZImgS", props: { modelValue: { type: String, default: "" }, width: { type: String, default: "50px" }, height: { type: String, default: "50px" }, fit: { type: String, default: "cover" }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function Ye(l, t, e, d, a, i) { const r = u("el-image"); return a.permi_visible ? (o(), c(r, { key: 0, style: B({ width: e.width, height: e.height }), src: typeof e.modelValue == "string" ? e.modelValue : e.modelValue[0], fit: e.fit, "preview-src-list": typeof e.modelValue == "string" ? [e.modelValue] : e.modelValue }, null, 8, ["style", "src", "fit", "preview-src-list"])) : y("", !0); } const Ge = /* @__PURE__ */ _(Je, [["render", Ye]]), Qe = { name: "ZNum", props: { disabled: { type: Boolean, default: !1 }, placeholder: { type: String, default: "" }, modelValue: { default: "" }, max: { type: Number, default: 99999999 }, min: { default: 0 }, width: { default: "100%", type: String }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function Xe(l, t, e, d, a, i) { const r = u("el-input-number"); return a.permi_visible ? (o(), c(r, { key: 0, min: e.min, max: e.max, controls: !1, step: 1, disabled: e.disabled, style: B({ width: e.width }), placeholder: e.placeholder, modelValue: e.modelValue, clearable: "", "step-strictly": "", "onUpdate:modelValue": t[0] || (t[0] = (n) => { l.$emit("update:modelValue", n); }), onChange: t[1] || (t[1] = (n) => { l.$emit("change", n); }), onBlur: t[2] || (t[2] = (n) => { l.$emit("blur", n); }) }, null, 8, ["min", "max", "disabled", "style", "placeholder", "modelValue"])) : y("", !0); } const et = /* @__PURE__ */ _(Qe, [["render", Xe], ["__scopeId", "data-v-80e46ab3"]]), tt = { name: "ZPrice", props: { disabled: { default: !1 }, modelValue: { default: "" }, prop: { default: "", type: String }, options: { default: () => { }, type: Object }, rowMax: { default: "", type: String }, rowMin: { default: "", type: String }, scope: { default: () => { }, type: Object }, min: { default: null }, max: { default: 99999999 }, width: { default: "100%", type: String }, hasPermi: { type: Array, default: [] } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); } }; function lt(l, t, e, d, a, i) { const r = u("el-input-number"); return o(), c(r, { modelValue: e.modelValue, style: B({ width: e.width ? e.width : "100%" }), disabled: typeof e.disabled == "boolean" ? e.disabled : e.disabled(e.prop, l.value, e.scope), max: e.rowMax ? e.scope.row[e.rowMax] : e.max, min: e.rowMin ? e.scope.row[e.rowMin] : e.min, step: 0.01, controls: !1, "step-strictly": "", "onUpdate:modelValue": t[0] || (t[0] = (n) => { l.$emit("update:modelValue", n); }), onChange: t[1] || (t[1] = (n) => { l.$emit("change", n); }), onBlur: t[2] || (t[2] = (n) => { l.$emit("blur", n); }) }, null, 8, ["modelValue", "style", "disabled", "max", "min"]); } const it = /* @__PURE__ */ _(tt, [["render", lt], ["__scopeId", "data-v-de44c5ee"]]), at = { name: "z_media_picker", inheritAttrs: !1, props: { options: { default: () => ({ listType: "picture-card" }), type: Object }, uploadFunc: { type: Function, default: void 0 }, max: { default: void 0, type: Number }, limitSize: { default: void 0, type: Number }, limitWidth: { default: void 0, type: Number }, limitHeight: { default: void 0, type: Number }, modelValue: { default: () => [] }, hasPermi: { type: Array, default: [] }, children: { type: Array, default: [] }, disabled: { type: Boolean, default: !1 } }, emits: ["modelPress", "update:modelValue", "change"], data() { return { dialogImageUrl: "", dialogVisible: !1, uploadButton: !1, permi_visible: !0 }; }, async mounted() { this.hasPermi.length > 0 && (this.permi_visible = await b(this.hasPermi)); }, computed: { fileList() { if (Array.isArray(this.modelValue) && this.modelValue.length) return this.modelValue.filter((l) => l && l.url).map((l, t) => { if (C(l, "object")) return l; { let e = l.split("/"); return e = e[e.length - 1], { name: e, url: l }; } }); if (C(this.modelValue, "str") && this.modelValue.indexOf("http") !== -1) { let l = this.modelValue.split("/"); return l = l[l.length - 1], [{ name: l, url: this.modelValue }]; } else return []; } }, methods: { handlePictureCardPreview(l) { this.dialogImageUrl = l.url, this.dialogVisible = !0; }, clear() { this.fileList = []; }, beforeAvatarUpload(l) { console.log("beforeAvatarUpload", l); const t = l.type === "image/png", e = l.type === "image/jpeg", d = l.size / 1048576; if (this.limitSize && d > this.limitSize) return this.$message.error(`上传图片过大,限制${this.limitSize}M`), !1; if (e || t) { let a = this, i = "", r = ""; return new Promise(function(n, h) { a.limitWidth, a.limitHeight; let m = window.URL || window.webkitURL, s = new Image(); s.onload = function() { i = s.width, r = s.height, n(); }, s.src = m.createObjectURL(l); }).then( () => l, () => { const n = `上传文件的图片大小不合符标准,${a.limitWidth ? `宽需要为${a.limitWidth}px` : ""} ${a.limitHeight ? `高需要为${a.limitHeight}px` : ""}当前上传图片的宽高分别为: ${i}px和${r}px`; return a.$message.error({ message: n, btn: !1 }), Promise.reject(); } ); } else return this.$message.error("上传图片只能是 png/jpg 格式!"), !1; }, handleDownload(l) { console.log(l); }, dataReset() { this.fileList = [], this.uploadButton = !1; }, handleRemove(l, t) { console.log("fileList", t), t = t.map((e) => e.response), t.length === 1 ? t = t[0] : t.length === 0 && (t = ""), this.uploadButton = !1, console.log("input", t), this.$emit("update:modelValue", t); }, uploadSuccess(l, t, e) { console.log("fileList", e), e = e.map((d) => d.response || d.url), e.length === 1 ? e = e[0] : e.length === 0 && (e = ""), console.log("input", e), this.$emit("update:modelValue", e), this.uploadButton = !0; }, async uploadImage({ file: l }) { const t = new FormData(); if (t.append("file", l), this.uploadFunc) { const { url: e } = await this.uploadFunc(t); return e; } else if (j.uploadFunc) { const { url: e } = await j.uploadFunc(t); return console.log("上传返回值", e), e; } else return this.$message.error("请配置上传接口"), !1; } } }; function st(l, t, e, d, a, i) { const r = u("Plus"), n = u("el-icon"), h = u("el-upload"), m = u("el-image"), s = u("el-dialog"); return a.permi_visible ? (o(), f("div", { key: 0, class: z({ upgrade: !0, disabled: e.max ? e.modelValue.length > e.max : e.modelValue.length !== 0 }) }, [ v(h, K({ ref: "upload", action: "#", "file-list": i.fileList }, e.options, { "http-request": i.uploadImage, "on-preview": i.handlePictureCardPreview, "before-upload": i.beforeAvatarUpload, "on-success": i.uploadSuccess, "on-remove": i.handleRemove, "auto-upload": !0, disabled: e.disabled }), { default: p(() => [ v(n, null, { default: p(() => [ v(r) ]), _: 1 }) ]), _: 1 }, 16, ["file-list", "http-request", "on-preview", "before-upload", "on-success", "on-remove", "disabled"]), v(s, { modelValue: a.dialogVisible, "onUpdate:modelValue": t[0] || (t[0] = (g) => a.dialogVisible = g), "append-to-body": "" }, { default: p(() => [ v(m, { src: a.dialogImageUrl, fit: "'fill'" }, null, 8, ["src"]) ]), _: 1 }, 8, ["modelValue"]) ], 2)) : y("", !0); } const ot = /* @__PURE__ */ _(at, [["render", st], ["__scopeId", "data-v-4952cad1"]]), nt = { name: "ZContent", inheritAttrs: !1, components: {}, emits: ["update:modelValue", "press", "modelPress", "change"], props: { options: { default: () => ({}) }, statusOptions: { default: () => ({}) }, scope: { default: () => ({}) }, isRender: { default: () => !0 }, modelValue: { default: void 0 }, children: { type: Array, default: () => [] }, path: { default: "", type: String }, index: { default: 0, type: Number }, inline: { default: !1, type: Boolean }, fatherDisabled: { default: !1, type: Boolean }, hasForm: { default: !1, type: Boolean }, hasTable: { default: !1, type: Boolean }, isDrag: { default: !1, type: Boolean } }, computed: { rightValue() { let l = this.options.options.hasOwnProperty("path") ? this.options.options.path : this.path, t = ""; return this.options.options.formatting && this.options.options.formatting.length && (l = l.replace(this.options.prop, this.options.options.formatting[0])), x(this.modelValue, l) !== void 0 ? this.options.options.formatting && this.options.options.formatting.length ? t = this.options.options.formatting.map((e) => x(this.modelValue, l.replace(this.options.prop, e))) : t = x(this.modelValue, l) : t = void 0, t; }, rightPath() { return this.options.options.hasOwnProperty("path") ? this.options.options.path : this.options.options.hasOwnProperty("hideKey") ? this.path.replace(`.${this.options.prop}`, "") : this.path; }, rightChildren() { const l = {}; return Array.isArray(this.options.children) ? (this.options.children.forEach((t) => { l[t.prop] ? l[t.prop]++ : l[t.prop] = 1; }), this.options.children.map((t, e) => l[t.prop] > 1 ? { ...t, prop: `${t.prop}.${e}` } : t).filter((t) => t.isRender ? t.isRender() : !0)) : []; }, rightOptions() { return Object.fromEntries( Object.keys(this.options.options).filter((l) => !["hideKey", "noFormItem", "noTableItem"].includes(l)).map((l) => [l, this.options.options[l]]) ); }, rightDisabled() { return this.options.options.hasOwnProperty("disabled") ? C(this.options.options.disabled, "func") ? this.options.options.disabled() : this.options.options.disabled : this.fatherDisabled; } }, data() { return { // console, deepCopy: A, isType: C, keyDict: {} // businessChannelOptionsDataList: [], }; }, async mounted() { this.keyDict = Object.fromEntries(Object.keys(F).map((l) => [l.replace("z_", ""), l])), this.path; }, methods: { childrenUpdate(l, t, e, d = -1) { if (console.log("childrenUpdate", l, t, e, "本层op", this.options.type), this.path) this.$emit("update:modelValue", l, t, e, d); else { console.log("modelValue", JSON.stringify(this.modelValue), "要设置的value", t, "path", l, "本层op", this.options.type, "触发op", e.prop); const a = l ? I(this.modelValue, l, t) : { ...A(this.modelValue), ...t }; console.log("最高层temp_value", a), this.$emit("update:modelValue", a); } }, componentUpdate(l) { if (console.log("第二级冲突", this.options.prop), this.options.options.formatting && this.options.options.formatting.length) { let t = x(this.modelValue, this.rightPath.replace(`.${this.options.prop}`, "")); t || (t = {}), this.options.options.formatting.forEach((d, a) => { console.log("temp_obj[key]", d), console.log("val[index]", l[a]), t[d] = l[a]; }); const e = this.rightPath.indexOf(".") !== -1 ? this.rightPath.replace(`.${this.options.prop}`, "") : this.rightPath.replace(`${this.options.prop}`, ""); console.log("处理temp_obj", e), this.$emit("update:modelValue", e, t, this.options, this.index); } else console.log("componentUpdate2", this.rightPath, l, this.options, this.index), this.$emit("update:modelValue", this.rightPath, l, this.options, this.index); }, statusOptionsUpdate() { }, pressTrust(l, t = {}, e) { this.options.hasOwnProperty("press") ? (console.log("pressTrust触发", this.options.type, e), this.options.press(l, t)) : (console.log("pressTrust传递", l), this.$emit("press", l, t)); }, idsClear(l = "default") { l === "default" && (this.options.type === "table" ? (console.log("step1"), this.$refs[this.options.prop].idsClear()) : (console.log("step2", this.options), this.options.children.forEach((t, e) => { t.type === "table" && (console.log("ritem", this.$refs), console.log(`${e}_${t.prop}`), this.$refs[`${e}_${t.prop}`][0].idsClear()); }))); }, validate(l) { console.log("validate-------begin"), this.options.type === "form" ? this.$refs[this.options.prop].validate(l) : (console.log("step2", this.options), this.options.children.forEach((t, e) => { t.type === "table" && this.$refs[`${e}_${t.prop}`][0].idsClear(l); })); }, getChildNodeBykey(l) { if (this.options.options.key === l) return this; for (let t = 0; t < this.rightChildren.length; t++) { const e = this.rightChildren[t]; return this.$refs[`${t}_${e.prop}`].getChildNodeBykey(l); } return null; }, setDefaultValueByKey(l, t) { const e = this.getChildNodeBykey(l); e.$refs[e.options.prop].setDefaultValue(t); }, validateByKey(l, t) { const e = this.getChildNodeBykey(l); e.$refs[e.options.prop].validate(t); }, clearValidateByKey() { const l = this.getChildNodeBykey(key); l.$refs[l.options.prop].clearValidate(); } } }, rt = { class: "mr5" }, dt = { class: "ml5" }; function ut(l, t, e, d, a, i) { const r = u("z_content", !0), n = u("el-button"), h = u("el-form-item"), m = u("el-table-column"); return o(), c(Z(e.options.type.indexOf("z_") === -1 ? a.keyDict[e.options.type] : e.options.type), K({ ref: e.options.prop, class: "z_content", children: i.rightChildren, prop: e.options.prop, label: e.options.label, modelValue: i.rightValue, data: e.options.data ? e.options.data : [], allValue: e.modelValue, scope: e.scope }, i.rightOptions, { disabled: i.rightDisabled, onModelPress: t[3] || (t[3] = (s, g) => { i.pressTrust(s, g, 1); }), onModelChange: t[4] || (t[4] = (s) => i.pressTrust("change", e.options.prop, "c1")), "onUpdate:modelValue": i.componentUpdate }), { default: p(() => [ e.options.children && e.options.children.length ? (o(!0), f(k, { key: 0 }, D(i.rightChildren, (s, g) => (o(), f(k, null, [ s.type !== "layout" && (e.hasForm || e.options.type === "form") && !s.options.noFormItem ? (o(), c(h, { class: z([s.options.noDrag ? !1 : "cursor-move"]), prop: s.prop, label: s.label ? s.label : "", key: `${g}_${s.type}` }, { default: p(() => [ S("div", rt, V(s.options.before ? s.options.before : ""), 1), v(r, { ref_for: !0, ref: `${g}_${s.prop}`, options: s, modelValue: e.modelValue, scope: e.scope, index: g, path: `${i.rightPath ? i.rightPath + "." : ""}${s.prop}`, "has-form": !1, fatherDisabled: i.rightDisabled, onModelPress: t[0] || (t[0] = (w) => { i.pressTrust(w, e.options, 2); }), "onUpdate:modelValue": i.childrenUpdate }, null, 8, ["options", "modelValue", "scope", "index", "path", "fatherDisabled", "onUpdate:modelValue"]), S("div", dt, V(s.options.after ? s.options.after : ""), 1), s.options.opList ? (o(!0), f(k, { key: 0 }, D(s.options.opList, (w) => (o(), c(n, { class: "ml10", link: "", type: w.type, onClick: (T) => i.pressTrust("click", {