UNPKG

quick-admin-vue3-core

Version:

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

111 lines (110 loc) 2.79 kB
import { defineComponent as d, reactive as u, computed as f, resolveComponent as c, createBlock as b, openBlock as x, unref as l, isRef as h } from "vue"; import { s as g, v as y } from "./index-C0qRtkRj.js"; const A = /* @__PURE__ */ d({ name: "DemoCenterCrudComplexBaseCrudSimpleFormAddEdit", __name: "AddEdit", props: { data: {}, refreshList: {} }, setup(p) { const s = [ { label: "警告", value: 1 }, { label: "禁言", value: 2 }, { label: "封禁", value: 3 } ]; let e = u(Object.assign({ cflx: 1, sfqy: 0 }, p.data)); const n = f(() => [ { prop: "xm", label: "姓名", required: !0, attrs: { maxlength: 6 } }, { prop: "xb", label: "性别", required: !0, type: "select", attrs: { options: "D_Gender" } }, { prop: "nl", label: "年龄", tpl: "T_Age" }, { prop: "dhhm", label: "电话号码", tpl: "T_Phone" }, { prop: "sfqy", label: "是否启用", type: "switch", quickAttrs: { explain: "这是explain示例" } }, { prop: "cflx", label: "处罚类型", type: "radio-group", attrs: { options: s } }, e.cflx === 1 && { prop: "jgnr", label: "警告内容", tips: "这是tips示例", attrs: { type: "textarea", maxlength: 100 } }, ...e.cflx === 2 ? [ { prop: "ts", label: "天数", type: "input-number", attrs: { min: 0 }, quickAttrs: { after: "天" } }, { prop: "jygz", label: "禁言告知", attrs: { type: "textarea", maxlength: 100 } } ] : [], e.cflx === 3 && { prop: "fjgz", label: "封禁告知", tips: "这是tips示例", attrs: { type: "textarea", maxlength: 100 } } ]); return (a, r) => { var o; const m = c("BaseForm"); return x(), b(m, { style: { width: "600px" }, modelValue: l(e), "onUpdate:modelValue": r[0] || (r[0] = (t) => h(e) ? e.value = t : e = t), fields: n.value, fetch: a.data ? l(g) : l(y), afterSuccess: () => { var t; return (t = a.refreshList) == null ? void 0 : t.call(a); }, extraParams: { id: (o = a.data) == null ? void 0 : o.id }, onChange: r[1] || (r[1] = (t, i) => l(e)[t] = i) }, null, 8, ["modelValue", "fields", "fetch", "afterSuccess", "extraParams"]); }; } }); export { A as default };