@aplus-frontend/ui
Version:
72 lines (71 loc) • 2.62 kB
JavaScript
import { defineComponent as v, computed as k, createBlock as r, openBlock as o, unref as u, normalizeProps as T, guardReactiveProps as P, withCtx as c, createElementBlock as i, Fragment as s, renderList as R, createCommentVNode as S, mergeProps as n, resolveDynamicComponent as m, h as _ } from "vue";
import { Space as B } from "@aplus-frontend/antdv";
import "../../ap-button/ap-button.vue2.mjs";
import "../../ap-button/ap-action-button.vue2.mjs";
import "../ap-batch-action-group/ApBatchActionGroup.vue.mjs";
import "../ap-export-group/ApExportGroup.vue.mjs";
import { omit as a } from "lodash-unified";
import { usePermission as x } from "@aplus-frontend/hooks";
import C from "../../ap-button/ap-button.vue.mjs";
import L from "../../ap-button/ap-action-button.vue.mjs";
import $ from "../ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
import b from "../ap-export-group/ApExportGroup.vue2.mjs";
const H = /* @__PURE__ */ v({
__name: "ApButtonGroup",
props: {
spaceProps: {},
selectedRows: {},
selectedRowKeys: {},
groupList: {}
},
setup(y) {
const { hasPermission: d } = x(), p = y, h = k(() => p.groupList);
function f(t) {
let l = t?.ifShow;
return !t?.ifShow && t?.auth && (l = () => d(t.auth)), l?.() ?? !0;
}
return (t, l) => (o(), r(u(B), T(P(p.spaceProps ?? {})), {
default: c(() => [
(o(!0), i(s, null, R(h.value, (e, w) => (o(), i(s, { key: w }, [
e.valueType === "button" && f(e) ? (o(), r(C, n({
key: 0,
ref_for: !0
}, {
...u(a)(e, ["valueType", "ifShow", "auth"])
}), {
default: c(() => [
(o(), r(m(_(s, [e?.content]))))
]),
_: 2
}, 1040)) : e.valueType === "actionButton" && f(e) ? (o(), r(L, n({
key: 1,
ref_for: !0
}, {
...u(a)(e, ["valueType", "ifShow", "auth"])
}), {
default: c(() => [
(o(), r(m(_(s, [e?.content]))))
]),
_: 2
}, 1040)) : e.valueType === "batchActionGroup" ? (o(), r($, n({
key: 2,
ref_for: !0
}, {
...u(a)(e, ["valueType"]),
selectedRows: p?.selectedRows
}), null, 16)) : e.valueType === "exportGroup" ? (o(), r(b, n({
key: 3,
ref_for: !0
}, {
...u(a)(e, ["valueType"]),
selectedRowKeys: p?.selectedRowKeys
}), null, 16)) : S("", !0)
], 64))), 128))
]),
_: 1
}, 16));
}
});
export {
H as default
};