UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

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