qmw-form-design
Version:
表单设计器
75 lines (74 loc) • 2.71 kB
JavaScript
import { mergeModels as f, useModel as u, onMounted as w, createElementBlock as r, openBlock as i, normalizeStyle as s, createElementVNode as g, toDisplayString as v, createVNode as a, unref as l, withCtx as h, Fragment as k, renderList as x, normalizeClass as L, withModifiers as C, createBlock as m, resolveDynamicComponent as c } from "vue";
import { l as _, _ as b, a as M } from "./formDesign-B53UPgeF.mjs";
const S = { style: { "min-height": "60px", border: "1px solid #e8eaec", "border-style": "dashed", "border-radius": "4px" } }, W = ["onClick"], B = {
__name: "groupWidget",
props: /* @__PURE__ */ f({
style: {
type: Object,
default: () => ({})
}
}, {
widgetList: {},
widgetListModifiers: {},
widget: {},
widgetModifiers: {}
}),
emits: ["update:widgetList", "update:widget"],
setup(n) {
u(n, "widgetList");
const t = u(n, "widget"), d = window.$formDesignerStore;
return w(() => {
}), (V, o) => (i(), r("div", {
style: s(n.style),
class: "group-widget"
}, [
g("div", {
style: s(t.value.labelStyle)
}, v(t.value.config.label), 5),
g("div", S, [
a(l(_), {
modelValue: t.value.children,
"onUpdate:modelValue": o[0] || (o[0] = (e) => t.value.children = e),
animation: "150",
group: "formContainer",
onAdd: o[1] || (o[1] = (e) => {
l(d).addWidget(e, t.value.children, t.value);
}),
onEnd: l(d).saveHistoryStep,
style: { "min-height": "30px" }
}, {
default: h(() => [
(i(!0), r(k, null, x(t.value.children, (e, y) => (i(), r("div", {
key: e.type,
onClick: C((p) => {
l(d).onClickFormWidget(p, e, e.children);
}, ["stop"]),
class: L(["widget-div", l(d).setAreaClass(e)])
}, [
a(b, { widget: e }, null, 8, ["widget"]),
a(M, {
widget: e,
widgetList: e.children,
widgetIndex: y,
pWidget: e
}, null, 8, ["widget", "widgetList", "widgetIndex", "pWidget"]),
e.pType == "formWidget" ? (i(), m(c(e.widgetType), {
key: 0,
widget: e,
style: s(e.style)
}, null, 8, ["widget", "style"])) : (i(), m(c(e.widgetType), {
key: 1,
widgetList: e.children,
style: s(e.style)
}, null, 8, ["widgetList", "style"]))
], 10, W))), 128))
]),
_: 1
}, 8, ["modelValue", "onEnd"])
])
], 4));
}
};
export {
B as default
};