UNPKG

qmw-form-design

Version:

表单设计器

101 lines (100 loc) 3.91 kB
import { mergeModels as M, useModel as m, onMounted as v, createElementBlock as l, openBlock as i, normalizeStyle as d, createElementVNode as V, Fragment as a, renderList as g, normalizeClass as u, unref as n, createCommentVNode as I, withModifiers as y, createVNode as r, withCtx as A, createBlock as w, resolveDynamicComponent as h } from "vue"; import { _ as f, a as W, l as b } from "./formDesign-B53UPgeF.mjs"; const E = ["id"], S = ["onClick", "colspan", "rowspan"], B = ["onClick"], T = { __name: "tableWidget", props: /* @__PURE__ */ M({ style: { type: Object, default: () => ({}) } }, { widgetList: {}, widgetListModifiers: {}, pWidget: {}, pWidgetModifiers: {} }), emits: ["update:widgetList", "update:pWidget"], setup(c) { const p = m(c, "widgetList"), k = m(c, "pWidget"), s = window.$formDesignerStore; return v(() => { }), (D, F) => (i(), l("table", { style: d(c.style) }, [ V("tbody", null, [ (i(!0), l(a, null, g(p.value, (o, C) => (i(), l("tr", { key: o.id, style: d(o.style), class: u(n(s).setAreaClass(o)), id: o.id }, [ (i(!0), l(a, null, g(o.children, (e, _) => (i(), l(a, { key: e.id }, [ !e.cMerge && !e.rMerge ? (i(), l("td", { key: 0, style: d(e.style), onClick: y((t) => { n(s).onClickFormWidget(t, e, o.children); }, ["stop"]), class: u(n(s).setAreaClass(e)), colspan: e.colspan, rowspan: e.rowspan }, [ r(f, { widget: e }, null, 8, ["widget"]), r(W, { widget: e, widgetList: p.value, widgetIndex: _, trIndex: C, pWidget: k.value }, null, 8, ["widget", "widgetList", "widgetIndex", "trIndex", "pWidget"]), r(n(b), { modelValue: e.children, "onUpdate:modelValue": (t) => e.children = t, animation: "150", group: "formContainer", style: d(e.style && e.style.minHeight ? "min-height:" + e.style.minHeight : ""), onAdd: (t) => { n(s).addWidget(t, e.children, e); }, onEnd: n(s).saveHistoryStep }, { default: A(() => [ (i(!0), l(a, null, g(e.children, (t, L) => (i(), l("div", { key: t.type, onClick: y((x) => { n(s).onClickFormWidget(x, t, e.children); }, ["stop"]), class: u(["widget-div", n(s).setAreaClass(t)]) }, [ r(f, { widget: t }, null, 8, ["widget"]), r(W, { widget: t, widgetList: e.children, widgetIndex: L, pWidget: t }, null, 8, ["widget", "widgetList", "widgetIndex", "pWidget"]), t.pType == "formWidget" ? (i(), w(h(t.widgetType), { key: 0, widget: t, style: d(t.style) }, null, 8, ["widget", "style"])) : (i(), w(h(t.widgetType), { key: 1, widgetList: t.children, style: d(t.style), pWidget: t }, null, 8, ["widgetList", "style", "pWidget"])) ], 10, B))), 128)) ]), _: 2 }, 1032, ["modelValue", "onUpdate:modelValue", "style", "onAdd", "onEnd"]) ], 14, S)) : I("", !0) ], 64))), 128)) ], 14, E))), 128)) ]) ], 4)); } }; export { T as default };