qmw-form-design
Version:
表单设计器
86 lines (85 loc) • 3 kB
JavaScript
import { mergeModels as _, useModel as g, onMounted as v, createElementBlock as s, openBlock as i, normalizeStyle as o, Fragment as u, renderList as p, withModifiers as m, normalizeClass as c, unref as d, createVNode as l, withCtx as x, createBlock as y, resolveDynamicComponent as w } from "vue";
import { _ as f, a as W, l as M } from "./formDesign-B53UPgeF.mjs";
const V = ["onClick"], A = ["onClick"], E = {
__name: "rowColWidget",
props: /* @__PURE__ */ _({
style: {
type: Object,
default: () => ({})
}
}, {
widgetList: {},
widgetListModifiers: {},
pWidget: {},
pWidgetModifiers: {}
}),
emits: ["update:widgetList", "update:pWidget"],
setup(r) {
const a = g(r, "widgetList"), h = g(r, "pWidget"), n = window.$formDesignerStore;
return v(() => {
}), (I, S) => (i(), s("div", {
style: o(r.style),
class: "row-widget"
}, [
(i(!0), s(u, null, p(a.value, (t, k) => (i(), s("div", {
key: t.id,
style: o(t.style),
class: c(["col-widget", d(n).setAreaClass(t)]),
onClick: m((e) => {
d(n).onClickFormWidget(e, t, a.value);
}, ["stop"])
}, [
l(f, { widget: t }, null, 8, ["widget"]),
l(W, {
widget: t,
widgetList: a.value,
widgetIndex: k,
pWidget: h.value
}, null, 8, ["widget", "widgetList", "widgetIndex", "pWidget"]),
l(d(M), {
modelValue: t.children,
"onUpdate:modelValue": (e) => t.children = e,
animation: "150",
group: "formContainer",
onAdd: (e) => {
d(n).addWidget(e, t.children, t);
},
onEnd: d(n).saveHistoryStep,
style: { "min-height": "30px" }
}, {
default: x(() => [
(i(!0), s(u, null, p(t.children, (e, C) => (i(), s("div", {
key: e.type,
onClick: m((L) => {
d(n).onClickFormWidget(L, e, t.children);
}, ["stop"]),
class: c(["widget-div", d(n).setAreaClass(e)])
}, [
l(f, { widget: e }, null, 8, ["widget"]),
l(W, {
widget: e,
widgetList: t.children,
widgetIndex: C,
pWidget: e
}, null, 8, ["widget", "widgetList", "widgetIndex", "pWidget"]),
e.pType == "formWidget" ? (i(), y(w(e.widgetType), {
key: 0,
widget: e,
style: o(e.style)
}, null, 8, ["widget", "style"])) : (i(), y(w(e.widgetType), {
key: 1,
widgetList: e.children,
style: o(e.style),
pWidget: e
}, null, 8, ["widgetList", "style", "pWidget"]))
], 10, A))), 128))
]),
_: 2
}, 1032, ["modelValue", "onUpdate:modelValue", "onAdd", "onEnd"])
], 14, V))), 128))
], 4));
}
};
export {
E as default
};