quick-admin-vue3-core
Version:
以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板
111 lines (110 loc) • 2.79 kB
JavaScript
import { defineComponent as d, reactive as u, computed as f, resolveComponent as c, createBlock as b, openBlock as x, unref as r, isRef as h } from "vue";
import { s as g, v as y } from "./index-C0qRtkRj.js";
const A = /* @__PURE__ */ d({
name: "DemoCenterCrudComplexBaseCrudSimpleListAddEdit",
__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, l) => {
var o;
const i = c("BaseForm");
return x(), b(i, {
style: { width: "600px" },
modelValue: r(e),
"onUpdate:modelValue": l[0] || (l[0] = (t) => h(e) ? e.value = t : e = t),
fields: n.value,
fetch: a.data ? r(g) : r(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: l[1] || (l[1] = (t, m) => r(e)[t] = m)
}, null, 8, ["modelValue", "fields", "fetch", "afterSuccess", "extraParams"]);
};
}
});
export {
A as default
};