UNPKG

epic-designer-gold

Version:

基于vue3的设计器,可视化开发页面表单

86 lines (85 loc) 2.65 kB
import { defineComponent as V, useAttrs as C, computed as N, openBlock as m, createBlock as B, unref as t, normalizeProps as w, guardReactiveProps as $, withCtx as o, createElementVNode as u, renderSlot as i, createElementBlock as A, Fragment as E, renderList as O, createVNode as c, createTextVNode as h, toDisplayString as P } from "vue"; import { version as T, Modal as U, Space as j, Button as f } from "ant-design-vue"; const z = { class: "epic-modal-main" }, D = { class: "epic-modal-footer" }, I = /* @__PURE__ */ V({ __name: "modal", props: { componentSchema: { type: Object, default: () => ({}) } }, emits: ["ok", "close", "update:modelValue"], setup(k, { emit: v }) { const y = T.split("."), S = parseInt(y[0]), n = C(), l = k, a = v, g = { position: "absolute", right: "150px", left: "150px", minWidth: "700px", width: "auto", top: "56px", bottom: "30px", minHeight: "500px" }, x = { height: "calc(100vh - 108px)", padding: 0 }, d = N(() => { var e; return { ...l.componentSchema, ...n, title: ((e = l.componentSchema) == null ? void 0 : e.label) ?? "", wrapClassName: "epic-modal-ant", open: n.modelValue, visible: S > 3 ? void 0 : n.modelValue, "onUpdate:open": s, "onUpdate:visible": s, style: "top:20px", bodyStyle: x, dialogStyle: g, footer: null, children: null }; }), p = l.componentSchema.children ?? []; function _() { a("ok"); } function s() { a("update:modelValue", !1), a("close"); } return (e, r) => (m(), B(t(U), w($(d.value)), { default: o(() => [ u("div", z, [ i(e.$slots, "edit-node", {}, () => [ t(p).length ? (m(!0), A(E, { key: 0 }, O(t(p), (b) => i(e.$slots, "node", { componentSchema: b })), 256)) : i(e.$slots, "default", { key: 1 }) ]) ]), u("div", D, [ c(t(j), { align: "end" }, { default: o(() => [ c(t(f), { onClick: s }, { default: o(() => [...r[0] || (r[0] = [ h("关闭", -1) ])]), _: 1 }), c(t(f), { type: "primary", onClick: _ }, { default: o(() => [ h(P(d.value.okText ?? "确定"), 1) ]), _: 1 }) ]), _: 1 }) ]) ]), _: 3 }, 16)); } }); export { I as default };