quick-admin-vue3-core
Version:
以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板
100 lines (99 loc) • 3.67 kB
JavaScript
import { defineComponent as O, useAttrs as T, computed as V, resolveComponent as _, createElementBlock as v, unref as o, openBlock as d, Fragment as I, createBlock as w, mergeProps as c, withCtx as u, createVNode as R, renderSlot as A, createTextVNode as D, toDisplayString as S } from "vue";
import { c as q, d as z } from "./platform-DsTwHxm6.js";
import { u as G, g as H } from "./index-C0qRtkRj.js";
/* empty css */
import { u as J } from "./next-callback-Bd-U9so0.js";
import { u as K } from "./vue-router-CAs1aAcA.js";
const L = {
key: 1,
class: "base-btn"
};
var $;
const Z = /* @__PURE__ */ O({
inheritAttrs: !1,
__name: "Index",
props: {
tpl: {},
to: {},
order: {},
auth: {},
popconfirm: { type: [Boolean, Object], default: void 0 },
isDebounce: { type: Boolean, default: !0 },
isStand: { type: Boolean },
handleAuth: { type: Function, default: ($ = q.BaseBtn) == null ? void 0 : $.handleAuth },
handleClickType: { default: void 0 },
validateForm: { type: Boolean, default: void 0 },
loading: { type: Boolean }
},
emits: ["click", "change"],
setup(x, { emit: F }) {
var m;
const { closePopup: N } = G(), P = T(), j = K(), a = x, E = F, e = V(() => {
var l;
const t = !a.handleAuth || !((l = a.auth) != null && l.length) || a.handleAuth(a.auth);
if (!t) return;
const { isStand: r, tpl: n } = a;
if (!n) throw new Error("请传入按钮属性:tpl");
const s = r ? n : H(n, void 0, { attrs: P });
return t === "disabled" && (s.attrs.disabled = !0), s;
});
function p(t) {
const { name: r, to: n, text: s } = e.value;
if (n === void 0) return E("click", r, e.value, J(s, N), t);
j.push(n);
}
const f = (m = e.value) != null && m.isDebounce || a.isDebounce ? z(p, !0, 500) : p;
return (t, r) => {
var l, b, h, g, k;
const n = _("el-button"), s = _("el-popconfirm");
return o(e) ? (d(), v(I, { key: 0 }, [
(l = o(e)) != null && l.popconfirm ? (d(), w(s, c({
key: 0,
onConfirm: o(f),
width: "fit-content"
}, (b = o(e)) == null ? void 0 : b.popconfirm), {
reference: u(() => {
var i, B, y;
return [
R(n, c({ class: "base-btn" }, (i = o(e)) == null ? void 0 : i.attrs, {
disabled: t.loading || ((y = (B = o(e)) == null ? void 0 : B.attrs) == null ? void 0 : y.disabled),
loading: t.loading
}), {
default: u(() => [
A(t.$slots, "default", {}, () => {
var C;
return [
D(S(((C = o(e)) == null ? void 0 : C.text) ?? ""), 1)
];
})
]),
_: 3
}, 16, ["disabled", "loading"])
];
}),
_: 3
}, 16, ["onConfirm"])) : (d(), w(n, c({
key: 1,
class: "base-btn"
}, (h = o(e)) == null ? void 0 : h.attrs, {
disabled: t.loading || ((k = (g = o(e)) == null ? void 0 : g.attrs) == null ? void 0 : k.disabled),
loading: t.loading,
onClick: o(f)
}), {
default: u(() => [
A(t.$slots, "default", {}, () => {
var i;
return [
D(S(((i = o(e)) == null ? void 0 : i.text) ?? ""), 1)
];
})
]),
_: 3
}, 16, ["disabled", "loading", "onClick"]))
], 64)) : (d(), v("span", L));
};
}
});
export {
Z as default
};