UNPKG

quick-admin-vue3-core

Version:

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

114 lines (113 loc) 3.25 kB
import { defineComponent as f, reactive as _, ref as b, resolveComponent as h, createBlock as B, openBlock as g, unref as r, isRef as x } from "vue"; import { u as y, n as C } from "./index-C0qRtkRj.js"; import { _ as D } from "./AddEdit.vue_vue_type_script_setup_true_lang-BAOgqs5i.js"; import { _ as M } from "./FormPopup.vue_vue_type_script_setup_true_lang-Bj2dGM0n.js"; import { aL as i } from "./platform-DsTwHxm6.js"; /* empty css */ const S = /* @__PURE__ */ f({ name: "DemoCenterCrudSimpleBaseCrud", __name: "index", setup(v) { const { openPopup: n } = y(); let s = _({ age: [10, 30] }); const d = b([ { prop: "id", label: "用户ID" }, { prop: "name", label: "用户姓名" }, { prop: "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" } } ]), u = [ { prop: "name", label: "用户姓名", width: 90 }, { prop: "gender_text", label: "性别", width: 90, sortable: !0 }, { prop: "age", label: "年龄", width: 90, sortable: !0 }, { prop: "address_text", label: "地址", minWidth: 250 }, { prop: "phone", label: "电话", minWidth: 120 }, { prop: "role_text", label: "角色类型", minWidth: 90 }, { prop: "status", label: "状态", type: "BaseTag" } ]; function m(t, e) { i( { add: () => o(null, e) }, t ); } function c(t, e, a) { i( { edit: () => o(e, a), plus: () => p(t, e, a), minus: () => p(t, e, a) }, t ); } function o(t, e) { n(t ? "编辑" : "新增", [D, { id: t == null ? void 0 : t.id, refreshList: e }]); } function p(t, e, a) { n({ plus: "增加当日次数", minus: "减少当日次数" }[t], [M, { id: e == null ? void 0 : e.id, refreshList: a }], "dialog"); } return (t, e) => { const a = h("BaseCrud"); return g(), B(a, { modelValue: r(s), "onUpdate:modelValue": e[0] || (e[0] = (l) => x(s) ? s.value = l : s = l), cols: u, fields: d.value, fetch: r(C), extraBtns: ["add"], operateBtns: [ "edit", { name: "plus", text: "增加当日次数", attrs: { icon: "Plus", type: "success" } }, { name: "minus", text: "减少当日次数", attrs: { icon: "Minus", type: "danger" } } ], onExtraBtns: m, onOperateBtns: c, tableAttrs: { showSummary: !0 }, operateBtnsAttrs: { vertical: !0 } }, null, 8, ["modelValue", "fields", "fetch"]); }; } }); export { S as default };