UNPKG

epic-designer-dev

Version:

基于vue3的设计器,可视化开发页面表单。在epic-designer的基础上新增了字典选择器

129 lines (128 loc) 3 kB
const n = { bindModel: "checked", component: async () => (await import("ant-design-vue")).Switch, config: { attribute: [ { field: "field", label: "字段名", type: "input" }, { field: "label", label: "标题", type: "input" }, { field: "componentProps.defaultValue", label: "默认值", type: "switch" }, { componentProps: { placeholder: "请输入" }, field: "componentProps.checkedValue", label: "ON状态值", onChange(e) { setTimeout(() => t(e)); }, type: "input" }, { componentProps: { placeholder: "请输入" }, field: "componentProps.unCheckedValue", label: "OFF状态值", onChange(e) { setTimeout(() => t(e)); }, type: "input" }, { componentProps: { placeholder: "请输入" }, field: "componentProps.checkedChildren", label: "ON状态描述", type: "input" }, { componentProps: { placeholder: "请输入" }, field: "componentProps.unCheckedChildren", label: "OFF状态描述", type: "input" }, { componentProps: { allowClear: !0, options: [ { label: "default", value: "default" }, { label: "small", value: "small" } ], placeholder: "请选择" }, field: "componentProps.size", label: "尺寸", type: "select" }, { field: "componentProps.disabled", label: "禁用", type: "switch" }, { field: "componentProps.hidden", label: "隐藏", type: "switch" }, { componentProps: { ruleType: "boolean" }, description: "校验规则需要配合表单使用", field: "rules", label: "表单校验", layout: "vertical", type: "ERuleEditor" } ], event: [ { description: "值变化时", type: "change" } ] }, defaultSchema: { componentProps: { defaultValue: !1 }, field: "switch", input: !0, label: "开关", type: "switch" }, groupName: "表单", icon: "icon--epic--toggle-off-outline", sort: 930 }; function t(e) { var o; const l = ((o = e.values.componentProps) == null ? void 0 : o.unCheckedValue) || !1; e.values.componentProps.unCheckedValue === "" && delete e.values.componentProps.unCheckedValue, e.values.componentProps.checkedValue === "" && delete e.values.componentProps.checkedValue, e.values.componentProps ? e.values.componentProps.defaultValue = l : e.values.componentProps = { defaultValue: l }; } export { n as default };