UNPKG

quick-admin-vue3-core

Version:

以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板

129 lines (128 loc) 3.6 kB
import { defineComponent as f, ref as b, resolveComponent as h, createBlock as B, openBlock as T, unref as x } from "vue"; import { u as C, C as g, w as y, E as D } from "./index-C0qRtkRj.js"; import { _ as r } from "./AddEdit.vue_vue_type_script_setup_true_lang-B5YzMEJ8.js"; import { aL as d } from "./platform-DsTwHxm6.js"; /* empty css */ const P = /* @__PURE__ */ f({ name: "CommonCenterUserAccount", __name: "index", setup(k) { const { openPopup: n } = C(), i = b([ { prop: "id", label: "用户ID" }, { prop: "name", label: "用户姓名" }, { prop: "age", // [ "min_age", "max_age" ] label: "年龄", type: "BaseNumberRange" }, { prop: "gender", label: "性别", type: "select", attrs: { options: "D_Gender" } }, { prop: "role", label: "角色类型", type: "select", attrs: { options: "D_RoleType" } }, { prop: "status", label: "账号状态", type: "select", attrs: { options: "D_EnableStatus" } }, { tpl: "T_CreateTime" } ]), c = [ { tpl: "T_Selection" }, { tpl: "T_Sort" }, { tpl: "T_Index" }, { tpl: "T_Id", label: "用户ID" }, { prop: "name", label: "用户姓名", width: 90 }, { prop: "gender_text", label: "性别", width: 90 }, { prop: "age", label: "年龄", width: 90, sortable: !0 }, { prop: "address_text", label: "地址", minWidth: 250 }, { prop: "phone", label: "电话", minWidth: 120 }, { prop: "role_text", label: "角色类型", minWidth: 100 }, { prop: "status", label: "状态", type: "BaseTag" }, { tpl: "T_Create" }, { tpl: "T_Update" } // { type: "operate", label: "操作", width: 500 }, // 245 可覆盖操作列的属性设置 ]; function u(e, t, a) { d( { edit: () => o(t, a), view: () => _(t), delete: () => s([t.id], a), forbid: () => p(t, a), enable: () => p(t, a) }, e ); } function m(e, t, a) { const { selectedKeys: l } = a; d( { add: () => o(null, t), delete: () => s(l, t) }, e ); } function o(e, t) { n(e ? "编辑" : "新增", [r, { id: e == null ? void 0 : e.id, refreshList: t }]); } function _(e) { n("查看", [r, { id: e.id, pureText: !0 }]); } function s(e, t) { y({ ids: e }).then((a) => { t(); }); } function p(e, t) { const { status: a, id: l } = e; D({ id: l, status: a === 1 ? 2 : 1 }).then((U) => { t(); }); } return (e, t) => { const a = h("BaseCrud"); return T(), B(a, { cols: c, fields: i.value, fetch: x(g), extraBtns: ["add", { name: "add", text: "新增(url)", to: "/common-center/user/detail" }, , "delete", "import", "export"], operateBtns: [ "edit", { name: "edit", text: "编辑(url)", to: (l) => `/common-center/user/detail?id=${l.id}` }, "delete", (l) => (l == null ? void 0 : l.status) === 1 ? "forbid" : "enable", "view" ], onExtraBtns: m, onOperateBtns: u }, null, 8, ["fields", "fetch", "operateBtns"]); }; } }); export { P as default };