quick-admin-vue3-core
Version:
以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板
61 lines (60 loc) • 1.97 kB
JavaScript
import { defineComponent as f, reactive as c, ref as _, resolveComponent as r, createBlock as h, openBlock as b, unref as s, isRef as k, withCtx as V, createVNode as R } from "vue";
import { h as v, P as C, i as M } from "./index-C0qRtkRj.js";
import { a as B } from "./index-KDj-4JiF.js";
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const S = /* @__PURE__ */ f({
name: "CommonCenterRoleAddEdit",
__name: "AddEdit",
props: {
id: {},
refreshList: {}
},
setup(d) {
const { allMenus: n } = B(), l = d;
let e = c(l.id ? {} : { status: 1 });
const u = _([
{ prop: "role_text", label: "角色名称", required: !0 },
{ prop: "role", label: "角色标识符", attrs: { disabled: !0 } },
{
prop: "menu_auth",
label: "菜单权限",
type: "slot"
},
{ tpl: "T_EnableStatus" },
{ tpl: "T_Remark" }
]);
l.id && m(l.id);
function m(o) {
v({ id: o }).then((a) => Object.assign(e, a));
}
return (o, a) => {
const p = r("el-tree"), i = r("BaseForm");
return b(), h(i, {
modelValue: s(e),
"onUpdate:modelValue": a[1] || (a[1] = (t) => k(e) ? e.value = t : e = t),
style: { width: "600px" },
fields: u.value,
fetch: o.id ? s(C) : s(M),
afterSuccess: () => {
var t;
return (t = o.refreshList) == null ? void 0 : t.call(o);
}
}, {
menu_auth: V(() => [
R(p, {
class: "tree",
data: s(n),
props: { value: "id" },
"show-checkbox": "",
modelValue: s(e).menu_auth,
"onUpdate:modelValue": a[0] || (a[0] = (t) => s(e).menu_auth = t)
}, null, 8, ["data", "modelValue"])
]),
_: 1
}, 8, ["modelValue", "fields", "fetch", "afterSuccess"]);
};
}
}), y = /* @__PURE__ */ E(S, [["__scopeId", "data-v-3486def8"]]);
export {
y as default
};