form-design-v3 1.0.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -1
- package/dist-lib/{CodeEditor-LYxKHZlN.js → CodeEditor-C8Hh8Y2_.js} +1 -1
- package/dist-lib/form-design-v3.css +1 -1
- package/dist-lib/form-design-v3.es.js +15 -9
- package/dist-lib/form-design-v3.umd.cjs +2 -2
- package/dist-lib/{index-CQD0PeFm.js → index-AVoRu-VQ.js} +919 -828
- package/dist-lib/index.d.ts +96 -3
- package/package.json +2 -2
- package/dist-lib/package.json +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { ElSelect as
|
|
1
|
+
import { defineComponent as N, openBlock as d, createElementBlock as c, normalizeClass as j, unref as h, createElementVNode as t, toDisplayString as k, normalizeStyle as q, Fragment as L, createTextVNode as U, computed as M, ref as O, onMounted as ve, onUnmounted as Oe, createVNode as F, withCtx as A, renderList as E, createBlock as R, resolveDynamicComponent as ke, createCommentVNode as T, withModifiers as G, withDirectives as de, renderSlot as Z, vShow as ye, reactive as Ue, Teleport as we, nextTick as Be, resolveComponent as Re, mergeProps as he, createSlots as ce, normalizeProps as qe, guardReactiveProps as Ye, provide as Ke, watch as ue, createStaticVNode as $e, onBeforeUnmount as Qe, vModelText as Xe, h as ge, defineAsyncComponent as Ze, createApp as et } from "vue";
|
|
2
|
+
import { defineStore as tt } from "pinia";
|
|
3
|
+
import { ElSelect as fe, ElOption as te, ElTree as nt, ElLoading as ot, ElConfigProvider as st, ElDialog as lt, ElInput as it, ElEmpty as at, ElPagination as dt, ElButton as Fe, ElInputNumber as rt, ElMessage as J, ElMessageBox as ut } from "element-plus";
|
|
4
4
|
import "element-plus/es/components/select/style/css";
|
|
5
|
-
import { icons as
|
|
5
|
+
import { icons as ct } from "lucide-vue-next";
|
|
6
6
|
import "element-plus/es/components/input-number/style/css";
|
|
7
7
|
import "element-plus/es/components/message/style/css";
|
|
8
8
|
import "element-plus/es/components/message-box/style/css";
|
|
@@ -14,39 +14,39 @@ import "element-plus/es/components/button/style/css";
|
|
|
14
14
|
import "element-plus/es/components/empty/style/css";
|
|
15
15
|
import "element-plus/es/components/loading/style/css";
|
|
16
16
|
import "element-plus/es/components/config-provider/style/css";
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
17
|
+
const xe = /* @__PURE__ */ new Map();
|
|
18
|
+
function ie(e) {
|
|
19
|
+
xe.set(e.type, e);
|
|
20
20
|
}
|
|
21
21
|
function X(e) {
|
|
22
|
-
return
|
|
22
|
+
return xe.get(e);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return Array.from(
|
|
24
|
+
function ft() {
|
|
25
|
+
return Array.from(xe.values());
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function mt(e) {
|
|
28
28
|
const n = X(e);
|
|
29
29
|
if (!n) throw new Error(`未注册的控件类型: ${e}`);
|
|
30
30
|
return { ...n.createDefaultProps(), id: `${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 7)}` };
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const pt = { class: "fd-label-name" }, vt = /* @__PURE__ */ N({
|
|
33
33
|
__name: "LabelDesign",
|
|
34
34
|
props: {
|
|
35
35
|
node: {}
|
|
36
36
|
},
|
|
37
37
|
setup(e) {
|
|
38
|
-
const n =
|
|
38
|
+
const n = Y();
|
|
39
39
|
return (o, s) => (d(), c("div", {
|
|
40
|
-
class:
|
|
40
|
+
class: j(["fd-label-design", { "is-mobile": h(n).device === "mobile" }])
|
|
41
41
|
}, [
|
|
42
|
-
t("span",
|
|
42
|
+
t("span", pt, k(e.node.label || "标题"), 1),
|
|
43
43
|
t("span", {
|
|
44
|
-
class:
|
|
45
|
-
style:
|
|
44
|
+
class: j(["fd-label-value", { "fd-label-value--link": !!e.node.bindLink }]),
|
|
45
|
+
style: q(!e.node.bindLink && e.node.color ? { color: e.node.color } : void 0)
|
|
46
46
|
}, [
|
|
47
|
-
e.node.bindLink ? (d(), c(
|
|
47
|
+
e.node.bindLink ? (d(), c(L, { key: 0 }, [
|
|
48
48
|
U(k(e.node.bindField || e.node.bindLink), 1)
|
|
49
|
-
], 64)) : (d(), c(
|
|
49
|
+
], 64)) : (d(), c(L, { key: 1 }, [
|
|
50
50
|
U(k(e.node.bindField || "未绑定字段"), 1)
|
|
51
51
|
], 64))
|
|
52
52
|
], 6)
|
|
@@ -54,10 +54,10 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
54
54
|
}
|
|
55
55
|
}), P = (e, n) => {
|
|
56
56
|
const o = e.__vccOpts || e;
|
|
57
|
-
for (const [s,
|
|
58
|
-
o[s] =
|
|
57
|
+
for (const [s, i] of n)
|
|
58
|
+
o[s] = i;
|
|
59
59
|
return o;
|
|
60
|
-
},
|
|
60
|
+
}, bt = /* @__PURE__ */ P(vt, [["__scopeId", "data-v-3b9308ef"]]), gt = { class: "fd-label-name" }, ht = ["data-key"], yt = ["href"], kt = /* @__PURE__ */ N({
|
|
61
61
|
__name: "LabelRender",
|
|
62
62
|
props: {
|
|
63
63
|
node: {},
|
|
@@ -69,25 +69,25 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
69
69
|
var p;
|
|
70
70
|
const m = n.node.bindLink ? (p = n.formData) == null ? void 0 : p[n.node.bindLink] : void 0;
|
|
71
71
|
return m == null ? "" : String(m);
|
|
72
|
-
}),
|
|
72
|
+
}), i = M(() => n.value !== void 0 && n.value !== null && n.value !== "" ? String(n.value) : s.value ? s.value : ""), a = Y(), u = O(!1);
|
|
73
73
|
let r = null;
|
|
74
|
-
|
|
74
|
+
ve(() => {
|
|
75
75
|
r = window.matchMedia("(max-width: 768px)"), u.value = r.matches, r.addEventListener("change", (m) => {
|
|
76
76
|
u.value = m.matches;
|
|
77
77
|
});
|
|
78
|
-
}),
|
|
78
|
+
}), Oe(() => {
|
|
79
79
|
r && r.removeEventListener("change", () => {
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
|
-
const l = M(() =>
|
|
82
|
+
const l = M(() => a.device === "mobile" || u.value);
|
|
83
83
|
return (m, p) => (d(), c("div", {
|
|
84
|
-
class:
|
|
84
|
+
class: j(["fd-label-render", { "is-mobile": l.value }])
|
|
85
85
|
}, [
|
|
86
|
-
t("span",
|
|
86
|
+
t("span", gt, k(e.node.label || "标题"), 1),
|
|
87
87
|
t("span", {
|
|
88
|
-
class:
|
|
88
|
+
class: j(["fd-label-value", { "fd-label-value--link": o.value }]),
|
|
89
89
|
"data-key": e.node.bindField,
|
|
90
|
-
style:
|
|
90
|
+
style: q(!o.value && e.node.color ? { color: e.node.color } : void 0)
|
|
91
91
|
}, [
|
|
92
92
|
s.value ? (d(), c("a", {
|
|
93
93
|
key: 0,
|
|
@@ -95,13 +95,13 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
95
95
|
href: s.value,
|
|
96
96
|
target: "_blank",
|
|
97
97
|
rel: "noopener noreferrer"
|
|
98
|
-
}, k(
|
|
99
|
-
U(k(
|
|
98
|
+
}, k(i.value), 9, yt)) : (d(), c(L, { key: 1 }, [
|
|
99
|
+
U(k(i.value), 1)
|
|
100
100
|
], 64))
|
|
101
|
-
], 14,
|
|
101
|
+
], 14, ht)
|
|
102
102
|
], 2));
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
104
|
+
}), wt = /* @__PURE__ */ P(kt, [["__scopeId", "data-v-d9af68cc"]]), $t = { class: "fd-panel" }, xt = { class: "fd-panel-item" }, Ct = ["value"], _t = { class: "fd-panel-item" }, It = { class: "fd-panel-item" }, St = { class: "fd-panel-item" }, Dt = { class: "fd-color-row" }, Tt = ["value"], Lt = ["value"], Ft = "#344054", Nt = /* @__PURE__ */ N({
|
|
105
105
|
__name: "LabelPanel",
|
|
106
106
|
props: {
|
|
107
107
|
node: {},
|
|
@@ -110,10 +110,10 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
110
110
|
emits: ["update"],
|
|
111
111
|
setup(e, { emit: n }) {
|
|
112
112
|
const o = e, s = n;
|
|
113
|
-
function a(l) {
|
|
114
|
-
return l && /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(l) ? l : Tt;
|
|
115
|
-
}
|
|
116
113
|
function i(l) {
|
|
114
|
+
return l && /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(l) ? l : Ft;
|
|
115
|
+
}
|
|
116
|
+
function a(l) {
|
|
117
117
|
s("update", { color: l.target.value });
|
|
118
118
|
}
|
|
119
119
|
const u = (l) => {
|
|
@@ -125,17 +125,17 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
125
125
|
}, r = (l) => {
|
|
126
126
|
s("update", { bindLink: l ?? "" });
|
|
127
127
|
};
|
|
128
|
-
return (l, m) => (d(), c("div",
|
|
129
|
-
t("div",
|
|
128
|
+
return (l, m) => (d(), c("div", $t, [
|
|
129
|
+
t("div", xt, [
|
|
130
130
|
m[2] || (m[2] = t("label", null, "标题", -1)),
|
|
131
131
|
t("input", {
|
|
132
132
|
value: e.node.label,
|
|
133
133
|
onInput: m[0] || (m[0] = (p) => s("update", { label: p.target.value }))
|
|
134
|
-
}, null, 40,
|
|
134
|
+
}, null, 40, Ct)
|
|
135
135
|
]),
|
|
136
|
-
t("div",
|
|
136
|
+
t("div", _t, [
|
|
137
137
|
m[3] || (m[3] = t("label", null, "绑定字段", -1)),
|
|
138
|
-
|
|
138
|
+
F(h(fe), {
|
|
139
139
|
"model-value": e.node.bindField,
|
|
140
140
|
filterable: "",
|
|
141
141
|
clearable: "",
|
|
@@ -143,12 +143,12 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
143
143
|
style: { width: "100%" },
|
|
144
144
|
"onUpdate:modelValue": u
|
|
145
145
|
}, {
|
|
146
|
-
default:
|
|
147
|
-
|
|
146
|
+
default: A(() => [
|
|
147
|
+
F(h(te), {
|
|
148
148
|
label: "不绑定",
|
|
149
149
|
value: ""
|
|
150
150
|
}),
|
|
151
|
-
(d(!0), c(
|
|
151
|
+
(d(!0), c(L, null, E(e.fields, (p) => (d(), R(h(te), {
|
|
152
152
|
key: p.name,
|
|
153
153
|
label: `${p.label}(${p.name})`,
|
|
154
154
|
value: p.name
|
|
@@ -157,9 +157,9 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
157
157
|
_: 1
|
|
158
158
|
}, 8, ["model-value"])
|
|
159
159
|
]),
|
|
160
|
-
t("div",
|
|
160
|
+
t("div", It, [
|
|
161
161
|
m[4] || (m[4] = t("label", null, "链接", -1)),
|
|
162
|
-
|
|
162
|
+
F(h(fe), {
|
|
163
163
|
"model-value": e.node.bindLink,
|
|
164
164
|
filterable: "",
|
|
165
165
|
clearable: "",
|
|
@@ -167,12 +167,12 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
167
167
|
style: { width: "100%" },
|
|
168
168
|
"onUpdate:modelValue": r
|
|
169
169
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
|
|
170
|
+
default: A(() => [
|
|
171
|
+
F(h(te), {
|
|
172
172
|
label: "不绑定",
|
|
173
173
|
value: ""
|
|
174
174
|
}),
|
|
175
|
-
(d(!0), c(
|
|
175
|
+
(d(!0), c(L, null, E(e.fields, (p) => (d(), R(h(te), {
|
|
176
176
|
key: p.name,
|
|
177
177
|
label: `${p.label}(${p.name})`,
|
|
178
178
|
value: p.name
|
|
@@ -181,30 +181,30 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
181
181
|
_: 1
|
|
182
182
|
}, 8, ["model-value"])
|
|
183
183
|
]),
|
|
184
|
-
t("div",
|
|
184
|
+
t("div", St, [
|
|
185
185
|
m[5] || (m[5] = t("label", null, "字体颜色", -1)),
|
|
186
|
-
t("div",
|
|
186
|
+
t("div", Dt, [
|
|
187
187
|
t("input", {
|
|
188
188
|
type: "color",
|
|
189
|
-
value:
|
|
190
|
-
onInput:
|
|
191
|
-
}, null, 40,
|
|
189
|
+
value: i(e.node.color),
|
|
190
|
+
onInput: a
|
|
191
|
+
}, null, 40, Tt),
|
|
192
192
|
t("input", {
|
|
193
193
|
type: "text",
|
|
194
194
|
value: e.node.color,
|
|
195
195
|
onInput: m[1] || (m[1] = (p) => s("update", { color: p.target.value })),
|
|
196
196
|
placeholder: "默认 #344054"
|
|
197
|
-
}, null, 40,
|
|
197
|
+
}, null, 40, Lt)
|
|
198
198
|
])
|
|
199
199
|
])
|
|
200
200
|
]));
|
|
201
201
|
}
|
|
202
|
-
}),
|
|
202
|
+
}), Mt = /* @__PURE__ */ P(Nt, [["__scopeId", "data-v-9219c401"]]), Et = {
|
|
203
203
|
type: "label",
|
|
204
204
|
title: "Label 文本",
|
|
205
|
-
design:
|
|
206
|
-
render:
|
|
207
|
-
panel:
|
|
205
|
+
design: bt,
|
|
206
|
+
render: wt,
|
|
207
|
+
panel: Mt,
|
|
208
208
|
isContainer: !1,
|
|
209
209
|
createDefaultProps: () => ({
|
|
210
210
|
id: "",
|
|
@@ -215,7 +215,7 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
215
215
|
color: "#344054"
|
|
216
216
|
}),
|
|
217
217
|
serialize: (e) => e
|
|
218
|
-
},
|
|
218
|
+
}, me = /* @__PURE__ */ N({
|
|
219
219
|
__name: "LucideIcon",
|
|
220
220
|
props: {
|
|
221
221
|
name: {},
|
|
@@ -223,41 +223,41 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
223
223
|
strokeWidth: { default: 2 }
|
|
224
224
|
},
|
|
225
225
|
setup(e) {
|
|
226
|
-
const n = e, o = M(() => n.name &&
|
|
227
|
-
return (s,
|
|
226
|
+
const n = e, o = M(() => n.name && ct[n.name] || null);
|
|
227
|
+
return (s, i) => o.value ? (d(), R(ke(o.value), {
|
|
228
228
|
key: 0,
|
|
229
229
|
size: e.size,
|
|
230
230
|
"stroke-width": e.strokeWidth
|
|
231
231
|
}, null, 8, ["size", "stroke-width"])) : T("", !0);
|
|
232
232
|
}
|
|
233
|
-
}),
|
|
233
|
+
}), Pt = { class: "fd-card-design" }, Ot = { class: "fd-card-head" }, Ut = { class: "fd-card-title" }, Bt = ["title"], Rt = { class: "fd-card-body" }, Vt = /* @__PURE__ */ N({
|
|
234
234
|
__name: "CardDesign",
|
|
235
235
|
props: {
|
|
236
236
|
node: {}
|
|
237
237
|
},
|
|
238
238
|
setup(e) {
|
|
239
|
-
const n = e, o =
|
|
239
|
+
const n = e, o = Y();
|
|
240
240
|
function s() {
|
|
241
241
|
o.setExpanded(n.node.id, !n.node.expanded);
|
|
242
242
|
}
|
|
243
|
-
return (
|
|
244
|
-
t("div",
|
|
243
|
+
return (i, a) => (d(), c("div", Pt, [
|
|
244
|
+
t("div", Ot, [
|
|
245
245
|
e.node.icon ? (d(), c("span", {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "fd-card-icon",
|
|
248
|
-
style:
|
|
248
|
+
style: q({ background: e.node.iconBgColor || void 0 })
|
|
249
249
|
}, [
|
|
250
|
-
|
|
250
|
+
F(me, {
|
|
251
251
|
name: e.node.icon,
|
|
252
252
|
size: 18
|
|
253
253
|
}, null, 8, ["name"])
|
|
254
254
|
], 4)) : T("", !0),
|
|
255
|
-
t("span",
|
|
255
|
+
t("span", Ut, k(e.node.label || "卡片标题"), 1),
|
|
256
256
|
t("span", {
|
|
257
|
-
class:
|
|
257
|
+
class: j(["fd-card-arrow", { "is-open": e.node.expanded }]),
|
|
258
258
|
title: e.node.expanded ? "收起" : "展开",
|
|
259
|
-
onClick:
|
|
260
|
-
}, [...
|
|
259
|
+
onClick: G(s, ["stop"])
|
|
260
|
+
}, [...a[0] || (a[0] = [
|
|
261
261
|
t("svg", {
|
|
262
262
|
viewBox: "0 0 24 24",
|
|
263
263
|
fill: "none",
|
|
@@ -268,27 +268,27 @@ const ft = { class: "fd-label-name" }, mt = /* @__PURE__ */ E({
|
|
|
268
268
|
}, [
|
|
269
269
|
t("polyline", { points: "6 9 12 15 18 9" })
|
|
270
270
|
], -1)
|
|
271
|
-
])], 10,
|
|
271
|
+
])], 10, Bt)
|
|
272
272
|
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
de(t("div", Rt, [
|
|
274
|
+
Z(i.$slots, "children", {}, () => [
|
|
275
|
+
a[1] || (a[1] = t("div", { class: "fd-card-empty" }, "拖拽子控件到此处", -1))
|
|
276
276
|
], !0)
|
|
277
277
|
], 512), [
|
|
278
278
|
[ye, e.node.expanded]
|
|
279
279
|
])
|
|
280
280
|
]));
|
|
281
281
|
}
|
|
282
|
-
}),
|
|
283
|
-
function
|
|
282
|
+
}), At = /* @__PURE__ */ P(Vt, [["__scopeId", "data-v-6a46ee95"]]);
|
|
283
|
+
function Ve(e, n) {
|
|
284
284
|
if (!e || e === "none") return !1;
|
|
285
285
|
const o = Number(n);
|
|
286
286
|
return e === "start" ? o === 10 : e === "not-start" ? o !== 10 : e === "not-approval" ? o !== 20 : !1;
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const jt = {
|
|
289
289
|
key: 0,
|
|
290
290
|
class: "fd-card-render"
|
|
291
|
-
},
|
|
291
|
+
}, zt = { class: "fd-card-title" }, Jt = { class: "fd-card-body" }, Wt = /* @__PURE__ */ N({
|
|
292
292
|
__name: "CardRender",
|
|
293
293
|
props: {
|
|
294
294
|
node: {},
|
|
@@ -296,27 +296,27 @@ const At = {
|
|
|
296
296
|
},
|
|
297
297
|
setup(e) {
|
|
298
298
|
const o = O(e.node.expanded);
|
|
299
|
-
return (s,
|
|
300
|
-
var
|
|
301
|
-
return h(
|
|
299
|
+
return (s, i) => {
|
|
300
|
+
var a;
|
|
301
|
+
return h(Ve)(e.node.hiddenMode, (a = e.formData) == null ? void 0 : a.status) ? T("", !0) : (d(), c("div", jt, [
|
|
302
302
|
t("div", {
|
|
303
303
|
class: "fd-card-head",
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: i[0] || (i[0] = (u) => o.value = !o.value)
|
|
305
305
|
}, [
|
|
306
306
|
e.node.icon ? (d(), c("span", {
|
|
307
307
|
key: 0,
|
|
308
308
|
class: "fd-card-icon",
|
|
309
|
-
style:
|
|
309
|
+
style: q({ background: e.node.iconBgColor || void 0 })
|
|
310
310
|
}, [
|
|
311
|
-
|
|
311
|
+
F(me, {
|
|
312
312
|
name: e.node.icon,
|
|
313
313
|
size: 18
|
|
314
314
|
}, null, 8, ["name"])
|
|
315
315
|
], 4)) : T("", !0),
|
|
316
|
-
t("span",
|
|
316
|
+
t("span", zt, k(e.node.label || "卡片标题"), 1),
|
|
317
317
|
t("span", {
|
|
318
|
-
class:
|
|
319
|
-
}, [...
|
|
318
|
+
class: j(["fd-card-arrow", { "is-open": o.value }])
|
|
319
|
+
}, [...i[1] || (i[1] = [
|
|
320
320
|
t("svg", {
|
|
321
321
|
viewBox: "0 0 24 24",
|
|
322
322
|
fill: "none",
|
|
@@ -329,15 +329,15 @@ const At = {
|
|
|
329
329
|
], -1)
|
|
330
330
|
])], 2)
|
|
331
331
|
]),
|
|
332
|
-
|
|
333
|
-
|
|
332
|
+
de(t("div", Jt, [
|
|
333
|
+
Z(s.$slots, "children", {}, void 0, !0)
|
|
334
334
|
], 512), [
|
|
335
335
|
[ye, o.value]
|
|
336
336
|
])
|
|
337
337
|
]));
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
}),
|
|
340
|
+
}), Ht = /* @__PURE__ */ P(Wt, [["__scopeId", "data-v-bc2f6273"]]), Gt = ["disabled", "aria-checked"], qt = /* @__PURE__ */ N({
|
|
341
341
|
__name: "FdSwitch",
|
|
342
342
|
props: {
|
|
343
343
|
modelValue: { type: Boolean },
|
|
@@ -346,18 +346,18 @@ const At = {
|
|
|
346
346
|
emits: ["update:modelValue"],
|
|
347
347
|
setup(e, { emit: n }) {
|
|
348
348
|
const o = n;
|
|
349
|
-
return (s,
|
|
349
|
+
return (s, i) => (d(), c("button", {
|
|
350
350
|
type: "button",
|
|
351
|
-
class:
|
|
351
|
+
class: j(["fd-switch", { "is-on": e.modelValue }]),
|
|
352
352
|
disabled: e.disabled,
|
|
353
353
|
role: "switch",
|
|
354
354
|
"aria-checked": e.modelValue,
|
|
355
|
-
onClick:
|
|
356
|
-
}, [...
|
|
355
|
+
onClick: i[0] || (i[0] = (a) => o("update:modelValue", !e.modelValue))
|
|
356
|
+
}, [...i[1] || (i[1] = [
|
|
357
357
|
t("span", { class: "fd-switch-dot" }, null, -1)
|
|
358
|
-
])], 10,
|
|
358
|
+
])], 10, Gt));
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
360
|
+
}), re = /* @__PURE__ */ P(qt, [["__scopeId", "data-v-eac909bd"]]), Yt = [
|
|
361
361
|
// 卡片 / 布局通用
|
|
362
362
|
"LayoutGrid",
|
|
363
363
|
"PanelTop",
|
|
@@ -408,10 +408,10 @@ const At = {
|
|
|
408
408
|
"BookOpen",
|
|
409
409
|
"Coins",
|
|
410
410
|
"Wallet"
|
|
411
|
-
],
|
|
411
|
+
], Kt = { class: "fd-panel" }, Qt = { class: "fd-panel-item" }, Xt = ["value"], Zt = { class: "fd-panel-item" }, en = { class: "fd-icon-picker" }, tn = {
|
|
412
412
|
key: 1,
|
|
413
413
|
class: "fd-icon-placeholder"
|
|
414
|
-
},
|
|
414
|
+
}, nn = { class: "fd-icon-grid" }, on = ["title", "onClick"], sn = { class: "fd-panel-item" }, ln = ["value"], an = { class: "fd-panel-item fd-panel-item--row" }, dn = { class: "fd-panel-item" }, rn = ["value"], un = /* @__PURE__ */ N({
|
|
415
415
|
__name: "CardPanel",
|
|
416
416
|
props: {
|
|
417
417
|
node: {},
|
|
@@ -420,30 +420,30 @@ const At = {
|
|
|
420
420
|
emits: ["update"],
|
|
421
421
|
setup(e, { emit: n }) {
|
|
422
422
|
const o = n, s = O(!1);
|
|
423
|
-
function a
|
|
424
|
-
o("update", { icon:
|
|
423
|
+
function i(a) {
|
|
424
|
+
o("update", { icon: a }), s.value = !1;
|
|
425
425
|
}
|
|
426
|
-
return (
|
|
427
|
-
t("div",
|
|
426
|
+
return (a, u) => (d(), c("div", Kt, [
|
|
427
|
+
t("div", Qt, [
|
|
428
428
|
u[7] || (u[7] = t("label", null, "标题", -1)),
|
|
429
429
|
t("input", {
|
|
430
430
|
value: e.node.label,
|
|
431
431
|
onInput: u[0] || (u[0] = (r) => o("update", { label: r.target.value }))
|
|
432
|
-
}, null, 40,
|
|
432
|
+
}, null, 40, Xt)
|
|
433
433
|
]),
|
|
434
|
-
t("div",
|
|
434
|
+
t("div", Zt, [
|
|
435
435
|
u[10] || (u[10] = t("label", null, "图标", -1)),
|
|
436
|
-
t("div",
|
|
436
|
+
t("div", en, [
|
|
437
437
|
t("button", {
|
|
438
438
|
type: "button",
|
|
439
439
|
class: "fd-icon-trigger",
|
|
440
440
|
onClick: u[1] || (u[1] = (r) => s.value = !s.value)
|
|
441
441
|
}, [
|
|
442
|
-
e.node.icon ? (d(),
|
|
442
|
+
e.node.icon ? (d(), R(me, {
|
|
443
443
|
key: 0,
|
|
444
444
|
name: e.node.icon,
|
|
445
445
|
size: 16
|
|
446
|
-
}, null, 8, ["name"])) : (d(), c("span",
|
|
446
|
+
}, null, 8, ["name"])) : (d(), c("span", tn, "无图标")),
|
|
447
447
|
u[8] || (u[8] = t("svg", {
|
|
448
448
|
class: "fd-icon-caret",
|
|
449
449
|
viewBox: "0 0 24 24",
|
|
@@ -459,63 +459,63 @@ const At = {
|
|
|
459
459
|
s.value ? (d(), c("div", {
|
|
460
460
|
key: 0,
|
|
461
461
|
class: "fd-icon-popover",
|
|
462
|
-
onClick: u[3] || (u[3] =
|
|
462
|
+
onClick: u[3] || (u[3] = G(() => {
|
|
463
463
|
}, ["stop"]))
|
|
464
464
|
}, [
|
|
465
|
-
t("div",
|
|
465
|
+
t("div", nn, [
|
|
466
466
|
t("button", {
|
|
467
467
|
type: "button",
|
|
468
|
-
class:
|
|
468
|
+
class: j(["fd-icon-option", { active: !e.node.icon }]),
|
|
469
469
|
title: "无图标",
|
|
470
|
-
onClick: u[2] || (u[2] = (r) =>
|
|
470
|
+
onClick: u[2] || (u[2] = (r) => i(""))
|
|
471
471
|
}, [...u[9] || (u[9] = [
|
|
472
472
|
t("span", { class: "fd-icon-none" }, "无", -1)
|
|
473
473
|
])], 2),
|
|
474
|
-
(d(!0), c(
|
|
474
|
+
(d(!0), c(L, null, E(h(Yt), (r) => (d(), c("button", {
|
|
475
475
|
key: r,
|
|
476
476
|
type: "button",
|
|
477
|
-
class:
|
|
477
|
+
class: j(["fd-icon-option", { active: e.node.icon === r }]),
|
|
478
478
|
title: r,
|
|
479
|
-
onClick: (l) =>
|
|
479
|
+
onClick: (l) => i(r)
|
|
480
480
|
}, [
|
|
481
|
-
|
|
481
|
+
F(me, {
|
|
482
482
|
name: r,
|
|
483
483
|
size: 18
|
|
484
484
|
}, null, 8, ["name"])
|
|
485
|
-
], 10,
|
|
485
|
+
], 10, on))), 128))
|
|
486
486
|
])
|
|
487
487
|
])) : T("", !0)
|
|
488
488
|
])
|
|
489
489
|
]),
|
|
490
|
-
t("div",
|
|
490
|
+
t("div", sn, [
|
|
491
491
|
u[11] || (u[11] = t("label", null, "图标底色", -1)),
|
|
492
492
|
t("input", {
|
|
493
493
|
value: e.node.iconBgColor,
|
|
494
494
|
onInput: u[4] || (u[4] = (r) => o("update", { iconBgColor: r.target.value }))
|
|
495
|
-
}, null, 40,
|
|
495
|
+
}, null, 40, ln)
|
|
496
496
|
]),
|
|
497
|
-
t("div",
|
|
497
|
+
t("div", an, [
|
|
498
498
|
u[12] || (u[12] = t("label", null, "初始展开", -1)),
|
|
499
|
-
|
|
499
|
+
F(re, {
|
|
500
500
|
"model-value": e.node.expanded,
|
|
501
501
|
"onUpdate:modelValue": u[5] || (u[5] = (r) => o("update", { expanded: r }))
|
|
502
502
|
}, null, 8, ["model-value"])
|
|
503
503
|
]),
|
|
504
|
-
t("div",
|
|
504
|
+
t("div", dn, [
|
|
505
505
|
u[13] || (u[13] = t("label", null, "宽度", -1)),
|
|
506
506
|
t("input", {
|
|
507
507
|
value: e.node.width,
|
|
508
508
|
onInput: u[6] || (u[6] = (r) => o("update", { width: r.target.value }))
|
|
509
|
-
}, null, 40,
|
|
509
|
+
}, null, 40, rn)
|
|
510
510
|
])
|
|
511
511
|
]));
|
|
512
512
|
}
|
|
513
|
-
}),
|
|
513
|
+
}), cn = /* @__PURE__ */ P(un, [["__scopeId", "data-v-d3ccdc07"]]), fn = {
|
|
514
514
|
type: "card",
|
|
515
515
|
title: "卡片容器",
|
|
516
|
-
design:
|
|
517
|
-
render:
|
|
518
|
-
panel:
|
|
516
|
+
design: At,
|
|
517
|
+
render: Ht,
|
|
518
|
+
panel: cn,
|
|
519
519
|
isContainer: !0,
|
|
520
520
|
createDefaultProps: () => ({
|
|
521
521
|
id: "",
|
|
@@ -530,24 +530,24 @@ const At = {
|
|
|
530
530
|
children: []
|
|
531
531
|
}),
|
|
532
532
|
serialize: (e) => e
|
|
533
|
-
},
|
|
533
|
+
}, mn = { class: "fd-slot-design" }, pn = { class: "fd-slot-hint" }, vn = /* @__PURE__ */ N({
|
|
534
534
|
__name: "SlotDesign",
|
|
535
535
|
props: {
|
|
536
536
|
node: {}
|
|
537
537
|
},
|
|
538
538
|
setup(e) {
|
|
539
|
-
return (n, o) => (d(), c("div",
|
|
539
|
+
return (n, o) => (d(), c("div", mn, [
|
|
540
540
|
o[0] || (o[0] = t("span", { class: "fd-slot-tag" }, "插槽", -1)),
|
|
541
|
-
|
|
541
|
+
de(t("span", { class: "fd-slot-name" }, k(e.node.label || "未命名插槽"), 513), [
|
|
542
542
|
[ye, !["", "插", "插槽"].includes(e.node.label)]
|
|
543
543
|
]),
|
|
544
|
-
t("span",
|
|
544
|
+
t("span", pn, "宿主注入:" + k(e.node.slotName), 1)
|
|
545
545
|
]));
|
|
546
546
|
}
|
|
547
|
-
}),
|
|
547
|
+
}), bn = /* @__PURE__ */ P(vn, [["__scopeId", "data-v-b1a912fb"]]), gn = {
|
|
548
548
|
key: 0,
|
|
549
549
|
class: "fd-slot-render"
|
|
550
|
-
},
|
|
550
|
+
}, hn = /* @__PURE__ */ N({
|
|
551
551
|
__name: "SlotRender",
|
|
552
552
|
props: {
|
|
553
553
|
node: {},
|
|
@@ -558,19 +558,17 @@ const At = {
|
|
|
558
558
|
setup(e) {
|
|
559
559
|
return (n, o) => {
|
|
560
560
|
var s;
|
|
561
|
-
return h(
|
|
562
|
-
|
|
561
|
+
return h(Ve)(e.node.hiddenMode, (s = e.formData) == null ? void 0 : s.status) ? T("", !0) : (d(), c("div", gn, [
|
|
562
|
+
Z(n.$slots, e.node.slotName, {
|
|
563
563
|
node: e.node,
|
|
564
564
|
formData: e.formData,
|
|
565
565
|
mode: e.mode,
|
|
566
566
|
formId: e.formId
|
|
567
|
-
},
|
|
568
|
-
t("div", bn, "未注入插槽:" + k(e.node.slotName), 1)
|
|
569
|
-
], !0)
|
|
567
|
+
}, void 0, !0)
|
|
570
568
|
]));
|
|
571
569
|
};
|
|
572
570
|
}
|
|
573
|
-
}),
|
|
571
|
+
}), yn = /* @__PURE__ */ P(hn, [["__scopeId", "data-v-19b90209"]]), kn = [
|
|
574
572
|
"header",
|
|
575
573
|
"base-info",
|
|
576
574
|
"shop-tuning",
|
|
@@ -586,7 +584,7 @@ const At = {
|
|
|
586
584
|
"approval-opinion",
|
|
587
585
|
"related-flows",
|
|
588
586
|
"footer"
|
|
589
|
-
],
|
|
587
|
+
], be = {
|
|
590
588
|
header: "页面头部",
|
|
591
589
|
"base-info": "基础信息",
|
|
592
590
|
"shop-tuning": "招调信息",
|
|
@@ -602,7 +600,7 @@ const At = {
|
|
|
602
600
|
"approval-opinion": "审批意见",
|
|
603
601
|
"related-flows": "相关流程",
|
|
604
602
|
footer: "页面底部"
|
|
605
|
-
},
|
|
603
|
+
}, wn = { class: "fd-panel" }, $n = { class: "fd-panel-item" }, xn = ["value"], Cn = { class: "fd-panel-item" }, Ne = "插槽", _n = /* @__PURE__ */ N({
|
|
606
604
|
__name: "SlotPanel",
|
|
607
605
|
props: {
|
|
608
606
|
node: {},
|
|
@@ -610,7 +608,7 @@ const At = {
|
|
|
610
608
|
},
|
|
611
609
|
emits: ["update"],
|
|
612
610
|
setup(e, { emit: n }) {
|
|
613
|
-
const o = e, s = n,
|
|
611
|
+
const o = e, s = n, i = Y(), a = O([]);
|
|
614
612
|
function u(p, y) {
|
|
615
613
|
p.forEach((C) => {
|
|
616
614
|
var B;
|
|
@@ -618,29 +616,29 @@ const At = {
|
|
|
618
616
|
});
|
|
619
617
|
}
|
|
620
618
|
const r = M(() => {
|
|
621
|
-
const p = new Set(
|
|
622
|
-
return u(
|
|
619
|
+
const p = new Set(kn);
|
|
620
|
+
return u(i.widgets, p), a.value.forEach((y) => y && p.add(y)), [...p];
|
|
623
621
|
}), l = M(
|
|
624
|
-
() => o.node.label ||
|
|
622
|
+
() => o.node.label || be[o.node.slotName || ""] || Ne
|
|
625
623
|
);
|
|
626
624
|
function m(p) {
|
|
627
625
|
const y = p ?? "";
|
|
628
|
-
y && !r.value.includes(y) &&
|
|
626
|
+
y && !r.value.includes(y) && a.value.push(y), s("update", {
|
|
629
627
|
slotName: y,
|
|
630
|
-
label:
|
|
628
|
+
label: be[y] || Ne
|
|
631
629
|
});
|
|
632
630
|
}
|
|
633
|
-
return (p, y) => (d(), c("div",
|
|
634
|
-
t("div",
|
|
631
|
+
return (p, y) => (d(), c("div", wn, [
|
|
632
|
+
t("div", $n, [
|
|
635
633
|
y[1] || (y[1] = t("label", null, "标题", -1)),
|
|
636
634
|
t("input", {
|
|
637
635
|
value: l.value,
|
|
638
636
|
onInput: y[0] || (y[0] = (C) => s("update", { label: C.target.value }))
|
|
639
|
-
}, null, 40,
|
|
637
|
+
}, null, 40, xn)
|
|
640
638
|
]),
|
|
641
|
-
t("div",
|
|
639
|
+
t("div", Cn, [
|
|
642
640
|
y[2] || (y[2] = t("label", null, "插槽名", -1)),
|
|
643
|
-
|
|
641
|
+
F(h(fe), {
|
|
644
642
|
"model-value": e.node.slotName,
|
|
645
643
|
filterable: "",
|
|
646
644
|
"allow-create": "",
|
|
@@ -650,14 +648,14 @@ const At = {
|
|
|
650
648
|
style: { width: "100%" },
|
|
651
649
|
"onUpdate:modelValue": m
|
|
652
650
|
}, {
|
|
653
|
-
default:
|
|
654
|
-
(d(!0), c(
|
|
651
|
+
default: A(() => [
|
|
652
|
+
(d(!0), c(L, null, E(r.value, (C) => (d(), R(h(te), {
|
|
655
653
|
key: C,
|
|
656
654
|
label: C,
|
|
657
655
|
value: C
|
|
658
656
|
}, {
|
|
659
|
-
default:
|
|
660
|
-
U(k(h(
|
|
657
|
+
default: A(() => [
|
|
658
|
+
U(k(h(be)[C] ? `${h(be)[C]}(${C})` : C), 1)
|
|
661
659
|
]),
|
|
662
660
|
_: 2
|
|
663
661
|
}, 1032, ["label", "value"]))), 128))
|
|
@@ -667,12 +665,12 @@ const At = {
|
|
|
667
665
|
])
|
|
668
666
|
]));
|
|
669
667
|
}
|
|
670
|
-
}),
|
|
668
|
+
}), In = /* @__PURE__ */ P(_n, [["__scopeId", "data-v-56e42d3f"]]), Sn = {
|
|
671
669
|
type: "slot",
|
|
672
670
|
title: "插槽",
|
|
673
|
-
design:
|
|
674
|
-
render:
|
|
675
|
-
panel:
|
|
671
|
+
design: bn,
|
|
672
|
+
render: yn,
|
|
673
|
+
panel: In,
|
|
676
674
|
isContainer: !1,
|
|
677
675
|
createDefaultProps: () => ({
|
|
678
676
|
id: "",
|
|
@@ -684,139 +682,139 @@ const At = {
|
|
|
684
682
|
hiddenMode: "none"
|
|
685
683
|
}),
|
|
686
684
|
serialize: (e) => e
|
|
687
|
-
}, Dn = { class: "fd-st-design" },
|
|
685
|
+
}, Dn = { class: "fd-st-design" }, Tn = {
|
|
688
686
|
key: 0,
|
|
689
687
|
class: "fd-st-table-wrap"
|
|
690
|
-
},
|
|
688
|
+
}, Ln = { class: "fd-st-table" }, Fn = {
|
|
691
689
|
key: 0,
|
|
692
690
|
class: "fd-st-seq"
|
|
693
|
-
},
|
|
691
|
+
}, Nn = {
|
|
694
692
|
key: 0,
|
|
695
693
|
class: "fd-st-seq"
|
|
696
694
|
}, Mn = {
|
|
697
695
|
key: 1,
|
|
698
696
|
class: "fd-st-cards"
|
|
699
|
-
},
|
|
697
|
+
}, En = { class: "fd-st-card" }, Pn = { class: "fd-st-card-label" }, On = {
|
|
700
698
|
key: 0,
|
|
701
699
|
class: "fd-st-cards-empty"
|
|
702
|
-
},
|
|
700
|
+
}, Un = /* @__PURE__ */ N({
|
|
703
701
|
__name: "SubtableDesign",
|
|
704
702
|
props: {
|
|
705
703
|
node: {}
|
|
706
704
|
},
|
|
707
705
|
setup(e) {
|
|
708
706
|
const n = e, o = M(() => n.node.tablestyle !== "cards");
|
|
709
|
-
return (s,
|
|
710
|
-
o.value ? (d(), c("div",
|
|
711
|
-
t("table",
|
|
707
|
+
return (s, i) => (d(), c("div", Dn, [
|
|
708
|
+
o.value ? (d(), c("div", Tn, [
|
|
709
|
+
t("table", Ln, [
|
|
712
710
|
t("thead", null, [
|
|
713
711
|
t("tr", null, [
|
|
714
712
|
e.node.secondtableindex === "1" ? (d(), c("th", Fn, "序号")) : T("", !0),
|
|
715
|
-
(d(!0), c(
|
|
716
|
-
key:
|
|
717
|
-
style:
|
|
718
|
-
}, k(
|
|
713
|
+
(d(!0), c(L, null, E(e.node.colnums.filter((a) => a.isshow === 1), (a) => (d(), c("th", {
|
|
714
|
+
key: a.name,
|
|
715
|
+
style: q({ width: a.showwidth || void 0 })
|
|
716
|
+
}, k(a.showname || a.major || a.name), 5))), 128))
|
|
719
717
|
])
|
|
720
718
|
]),
|
|
721
719
|
t("tbody", null, [
|
|
722
720
|
t("tr", null, [
|
|
723
|
-
e.node.secondtableindex === "1" ? (d(), c("td",
|
|
724
|
-
(d(!0), c(
|
|
725
|
-
key:
|
|
726
|
-
class:
|
|
727
|
-
}, k(
|
|
721
|
+
e.node.secondtableindex === "1" ? (d(), c("td", Nn, "1")) : T("", !0),
|
|
722
|
+
(d(!0), c(L, null, E(e.node.colnums.filter((a) => a.isshow === 1), (a) => (d(), c("td", {
|
|
723
|
+
key: a.name,
|
|
724
|
+
class: j(["fd-st-cell", { "fd-st-cell--link": !!a.bindLink }])
|
|
725
|
+
}, k(a.name), 3))), 128))
|
|
728
726
|
])
|
|
729
727
|
])
|
|
730
728
|
])
|
|
731
729
|
])) : (d(), c("div", Mn, [
|
|
732
|
-
t("div",
|
|
733
|
-
(d(!0), c(
|
|
734
|
-
key:
|
|
730
|
+
t("div", En, [
|
|
731
|
+
(d(!0), c(L, null, E(e.node.colnums.filter((a) => a.isshow === 1), (a) => (d(), c("div", {
|
|
732
|
+
key: a.name,
|
|
735
733
|
class: "fd-st-card-row"
|
|
736
734
|
}, [
|
|
737
|
-
t("span",
|
|
735
|
+
t("span", Pn, k(a.showname || a.major), 1),
|
|
738
736
|
t("span", {
|
|
739
|
-
class:
|
|
740
|
-
}, k(
|
|
737
|
+
class: j(["fd-st-card-value", { "fd-st-card-value--link": !!a.bindLink }])
|
|
738
|
+
}, k(a.name), 3)
|
|
741
739
|
]))), 128))
|
|
742
740
|
]),
|
|
743
|
-
e.node.colnums.filter((
|
|
741
|
+
e.node.colnums.filter((a) => a.isshow === 1).length === 0 ? (d(), c("div", On, " 暂无列配置 ")) : T("", !0)
|
|
744
742
|
]))
|
|
745
743
|
]));
|
|
746
744
|
}
|
|
747
|
-
}),
|
|
745
|
+
}), Bn = /* @__PURE__ */ P(Un, [["__scopeId", "data-v-aba8caec"]]), Rn = ["subtable-key"], Vn = {
|
|
748
746
|
key: 0,
|
|
749
747
|
class: "fd-st-table-wrap"
|
|
750
748
|
}, An = { class: "fd-st-table" }, jn = {
|
|
751
749
|
key: 0,
|
|
752
750
|
class: "fd-st-seq"
|
|
753
|
-
},
|
|
751
|
+
}, zn = ["subtable-val"], Jn = {
|
|
754
752
|
key: 1,
|
|
755
753
|
class: "fd-st-op"
|
|
756
|
-
},
|
|
754
|
+
}, Wn = {
|
|
757
755
|
key: 0,
|
|
758
756
|
class: "fd-st-seq"
|
|
759
|
-
},
|
|
757
|
+
}, Hn = ["rowspan", "subtable-val"], Gn = ["href"], qn = {
|
|
760
758
|
key: 1,
|
|
761
759
|
class: "fd-st-op"
|
|
762
|
-
},
|
|
760
|
+
}, Yn = ["onClick"], Kn = { key: 0 }, Qn = ["colspan"], Xn = {
|
|
763
761
|
key: 1,
|
|
764
762
|
class: "fd-st-cards"
|
|
765
|
-
},
|
|
763
|
+
}, Zn = { class: "fd-st-card-label" }, eo = ["subtable-val"], to = ["href"], no = {
|
|
766
764
|
key: 0,
|
|
767
765
|
class: "fd-st-card-actions"
|
|
768
|
-
},
|
|
766
|
+
}, oo = ["onClick"], so = {
|
|
769
767
|
key: 0,
|
|
770
768
|
class: "fd-st-cards-empty"
|
|
771
|
-
},
|
|
769
|
+
}, lo = /* @__PURE__ */ N({
|
|
772
770
|
__name: "SubtableRender",
|
|
773
771
|
props: {
|
|
774
772
|
node: {},
|
|
775
773
|
formData: {}
|
|
776
774
|
},
|
|
777
775
|
setup(e) {
|
|
778
|
-
const n = e, o = M(() => n.node.colnums.filter((_) => _.isshow === 1)), s = M(() => n.node.isreadonly === "1"),
|
|
779
|
-
var
|
|
780
|
-
const _ = (
|
|
776
|
+
const n = e, o = M(() => n.node.colnums.filter((_) => _.isshow === 1)), s = M(() => n.node.isreadonly === "1"), i = M(() => {
|
|
777
|
+
var D;
|
|
778
|
+
const _ = (D = n.formData) == null ? void 0 : D[n.node.secondtable];
|
|
781
779
|
return Array.isArray(_) ? _ : [];
|
|
782
|
-
}),
|
|
780
|
+
}), a = M(() => !(n.node.nodatahidetable === "1" && i.value.length === 0)), u = M(() => n.node.tablestyle !== "cards");
|
|
783
781
|
function r() {
|
|
784
782
|
if (s.value) return;
|
|
785
783
|
const _ = {};
|
|
786
|
-
o.value.forEach((
|
|
784
|
+
o.value.forEach((D) => _[D.name] = ""), n.formData && Array.isArray(n.formData[n.node.secondtable]) && n.formData[n.node.secondtable].push(_);
|
|
787
785
|
}
|
|
788
786
|
function l(_) {
|
|
789
787
|
s.value || n.formData && Array.isArray(n.formData[n.node.secondtable]) && n.formData[n.node.secondtable].splice(_, 1);
|
|
790
788
|
}
|
|
791
|
-
function m(_,
|
|
792
|
-
const v = _[
|
|
789
|
+
function m(_, D) {
|
|
790
|
+
const v = _[D];
|
|
793
791
|
return v == null ? "" : String(v);
|
|
794
792
|
}
|
|
795
|
-
function p(_,
|
|
796
|
-
return _.bindLink ? m(
|
|
793
|
+
function p(_, D) {
|
|
794
|
+
return _.bindLink ? m(D, _.bindLink) : "";
|
|
797
795
|
}
|
|
798
796
|
const y = M(() => {
|
|
799
|
-
const _ =
|
|
797
|
+
const _ = i.value, D = [], v = [];
|
|
800
798
|
return o.value.forEach((g, $) => {
|
|
801
|
-
|
|
802
|
-
const
|
|
803
|
-
let
|
|
799
|
+
D[$] = [], v[$] = [];
|
|
800
|
+
const V = g.issamecolmerge === 1;
|
|
801
|
+
let K = 0;
|
|
804
802
|
for (let x = 0; x < _.length; x++) {
|
|
805
803
|
const b = m(_[x], g.name);
|
|
806
|
-
|
|
804
|
+
V && x > 0 && b === m(_[x - 1], g.name) ? (v[$][x] = !0, D[$][K] += 1) : (v[$][x] = !1, D[$][x] = 1, K = x);
|
|
807
805
|
}
|
|
808
|
-
}), { spans:
|
|
806
|
+
}), { spans: D, skipped: v };
|
|
809
807
|
});
|
|
810
|
-
function C(_,
|
|
808
|
+
function C(_, D) {
|
|
811
809
|
var v;
|
|
812
|
-
return ((v = y.value.skipped[_]) == null ? void 0 : v[
|
|
810
|
+
return ((v = y.value.skipped[_]) == null ? void 0 : v[D]) === !0;
|
|
813
811
|
}
|
|
814
|
-
function B(_,
|
|
812
|
+
function B(_, D) {
|
|
815
813
|
var g;
|
|
816
|
-
const v = (g = y.value.spans[_]) == null ? void 0 : g[
|
|
814
|
+
const v = (g = y.value.spans[_]) == null ? void 0 : g[D];
|
|
817
815
|
return v && v > 1 ? v : void 0;
|
|
818
816
|
}
|
|
819
|
-
return (_,
|
|
817
|
+
return (_, D) => a.value ? (d(), c("div", {
|
|
820
818
|
key: 0,
|
|
821
819
|
class: "fd-st-render",
|
|
822
820
|
"subtable-key": e.node.secondtable
|
|
@@ -826,25 +824,25 @@ const At = {
|
|
|
826
824
|
t("thead", null, [
|
|
827
825
|
t("tr", null, [
|
|
828
826
|
e.node.secondtableindex === "1" ? (d(), c("th", jn, "序号")) : T("", !0),
|
|
829
|
-
(d(!0), c(
|
|
827
|
+
(d(!0), c(L, null, E(o.value, (v) => (d(), c("th", {
|
|
830
828
|
key: v.name,
|
|
831
829
|
"subtable-val": v.name,
|
|
832
|
-
style:
|
|
833
|
-
}, k(v.showname || v.major || v.name), 13,
|
|
830
|
+
style: q({ width: v.showwidth || void 0, textAlign: v.align || "left" })
|
|
831
|
+
}, k(v.showname || v.major || v.name), 13, zn))), 128)),
|
|
834
832
|
s.value ? T("", !0) : (d(), c("th", Jn, "操作"))
|
|
835
833
|
])
|
|
836
834
|
]),
|
|
837
835
|
t("tbody", null, [
|
|
838
|
-
(d(!0), c(
|
|
839
|
-
e.node.secondtableindex === "1" ? (d(), c("td",
|
|
840
|
-
(d(!0), c(
|
|
836
|
+
(d(!0), c(L, null, E(i.value, (v, g) => (d(), c("tr", { key: g }, [
|
|
837
|
+
e.node.secondtableindex === "1" ? (d(), c("td", Wn, k(g + 1), 1)) : T("", !0),
|
|
838
|
+
(d(!0), c(L, null, E(o.value, ($, V) => (d(), c(L, {
|
|
841
839
|
key: $.name
|
|
842
840
|
}, [
|
|
843
|
-
C(
|
|
841
|
+
C(V, g) ? T("", !0) : (d(), c("td", {
|
|
844
842
|
key: 0,
|
|
845
|
-
rowspan: B(
|
|
843
|
+
rowspan: B(V, g),
|
|
846
844
|
"subtable-val": $.name,
|
|
847
|
-
style:
|
|
845
|
+
style: q({ textAlign: $.align || "left", color: $.prospect || void 0, background: $.background || void 0 })
|
|
848
846
|
}, [
|
|
849
847
|
p($, v) ? (d(), c("a", {
|
|
850
848
|
key: 0,
|
|
@@ -852,36 +850,36 @@ const At = {
|
|
|
852
850
|
href: p($, v),
|
|
853
851
|
target: "_blank",
|
|
854
852
|
rel: "noopener noreferrer"
|
|
855
|
-
}, k(m(v, $.name)), 9,
|
|
853
|
+
}, k(m(v, $.name)), 9, Gn)) : (d(), c(L, { key: 1 }, [
|
|
856
854
|
U(k(m(v, $.name)), 1)
|
|
857
855
|
], 64))
|
|
858
|
-
], 12,
|
|
856
|
+
], 12, Hn))
|
|
859
857
|
], 64))), 128)),
|
|
860
858
|
s.value ? T("", !0) : (d(), c("td", qn, [
|
|
861
859
|
t("button", {
|
|
862
860
|
class: "fd-btn fd-btn--danger",
|
|
863
861
|
onClick: ($) => l(g)
|
|
864
|
-
}, "删除", 8,
|
|
862
|
+
}, "删除", 8, Yn)
|
|
865
863
|
]))
|
|
866
864
|
]))), 128)),
|
|
867
|
-
|
|
865
|
+
i.value.length === 0 ? (d(), c("tr", Kn, [
|
|
868
866
|
t("td", {
|
|
869
867
|
colspan: o.value.length + (e.node.secondtableindex === "1" ? 1 : 0) + (s.value ? 0 : 1),
|
|
870
868
|
class: "fd-st-empty"
|
|
871
|
-
}, k(e.node.nodatatitle === "1" ? "暂无数据" : ""), 9,
|
|
869
|
+
}, k(e.node.nodatatitle === "1" ? "暂无数据" : ""), 9, Qn)
|
|
872
870
|
])) : T("", !0)
|
|
873
871
|
])
|
|
874
872
|
])
|
|
875
|
-
])) : (d(), c("div",
|
|
876
|
-
(d(!0), c(
|
|
873
|
+
])) : (d(), c("div", Xn, [
|
|
874
|
+
(d(!0), c(L, null, E(i.value, (v, g) => (d(), c("div", {
|
|
877
875
|
key: g,
|
|
878
876
|
class: "fd-st-card"
|
|
879
877
|
}, [
|
|
880
|
-
(d(!0), c(
|
|
878
|
+
(d(!0), c(L, null, E(o.value, ($) => (d(), c("div", {
|
|
881
879
|
key: $.name,
|
|
882
880
|
class: "fd-st-card-row"
|
|
883
881
|
}, [
|
|
884
|
-
t("span",
|
|
882
|
+
t("span", Zn, k($.showname || $.major || $.name), 1),
|
|
885
883
|
t("span", {
|
|
886
884
|
class: "fd-st-card-value",
|
|
887
885
|
"subtable-val": $.name
|
|
@@ -892,31 +890,31 @@ const At = {
|
|
|
892
890
|
href: p($, v),
|
|
893
891
|
target: "_blank",
|
|
894
892
|
rel: "noopener noreferrer"
|
|
895
|
-
}, k(m(v, $.name)), 9,
|
|
893
|
+
}, k(m(v, $.name)), 9, to)) : (d(), c(L, { key: 1 }, [
|
|
896
894
|
U(k(m(v, $.name)), 1)
|
|
897
895
|
], 64))
|
|
898
|
-
], 8,
|
|
896
|
+
], 8, eo)
|
|
899
897
|
]))), 128)),
|
|
900
|
-
s.value ? T("", !0) : (d(), c("div",
|
|
898
|
+
s.value ? T("", !0) : (d(), c("div", no, [
|
|
901
899
|
t("button", {
|
|
902
900
|
class: "fd-btn fd-btn--danger fd-btn--sm",
|
|
903
901
|
onClick: ($) => l(g)
|
|
904
|
-
}, "删除", 8,
|
|
902
|
+
}, "删除", 8, oo)
|
|
905
903
|
]))
|
|
906
904
|
]))), 128)),
|
|
907
|
-
|
|
905
|
+
i.value.length === 0 ? (d(), c("div", so, k(e.node.nodatatitle === "1" ? "暂无数据" : ""), 1)) : T("", !0)
|
|
908
906
|
])),
|
|
909
907
|
s.value ? T("", !0) : (d(), c("button", {
|
|
910
908
|
key: 2,
|
|
911
909
|
class: "fd-btn fd-btn--primary fd-st-add",
|
|
912
910
|
onClick: r
|
|
913
911
|
}, "新增一行"))
|
|
914
|
-
], 8,
|
|
912
|
+
], 8, Rn)) : T("", !0);
|
|
915
913
|
}
|
|
916
|
-
}),
|
|
914
|
+
}), io = /* @__PURE__ */ P(lo, [["__scopeId", "data-v-eda3f0fb"]]);
|
|
917
915
|
function ao(e) {
|
|
918
916
|
return e.fields.map((n, o) => {
|
|
919
|
-
const s = n.dataType === "file",
|
|
917
|
+
const s = n.dataType === "file", i = n.dataType === "link";
|
|
920
918
|
return {
|
|
921
919
|
name: n.name,
|
|
922
920
|
isshow: 1,
|
|
@@ -932,19 +930,19 @@ function ao(e) {
|
|
|
932
930
|
iscompletehidecode: "",
|
|
933
931
|
issamecolmerge: 0,
|
|
934
932
|
// 链接字段:直接使用所绑定字段的链接
|
|
935
|
-
bindLink:
|
|
933
|
+
bindLink: i ? n.name : "",
|
|
936
934
|
editmode: { editmode: s ? "files" : "text", title: s ? "文件" : "文本" },
|
|
937
935
|
events: []
|
|
938
936
|
};
|
|
939
937
|
});
|
|
940
938
|
}
|
|
941
|
-
const
|
|
939
|
+
const ro = { class: "fd-panel" }, uo = { class: "fd-panel-item" }, co = { class: "fd-panel-item fd-panel-item--row" }, fo = { class: "fd-panel-item fd-panel-item--row" }, mo = { class: "fd-panel-item" }, po = { class: "fd-panel-item" }, vo = { class: "fd-cols-head" }, bo = {
|
|
942
940
|
key: 0,
|
|
943
941
|
class: "fd-cols-empty"
|
|
944
|
-
},
|
|
942
|
+
}, go = { class: "fd-col-card-top" }, ho = { class: "fd-col-order" }, yo = { class: "fd-col-meta" }, ko = { class: "fd-col-title" }, wo = { class: "fd-col-name-sub" }, $o = { class: "fd-col-tag" }, xo = { class: "fd-col-card-bottom" }, Co = { class: "fd-col-switch" }, _o = { class: "fd-col-actions" }, Io = ["onClick"], So = ["onClick"], Do = {
|
|
945
943
|
class: "fd-dialog",
|
|
946
944
|
style: { "max-width": "560px" }
|
|
947
|
-
},
|
|
945
|
+
}, To = { class: "fd-dialog-head" }, Lo = { class: "fd-dialog-body" }, Fo = { class: "fd-form-section" }, No = { class: "fd-form-grid" }, Mo = { class: "fd-form-item" }, Eo = ["value"], Po = ["value"], Oo = { class: "fd-form-item" }, Uo = ["value"], Bo = { class: "fd-form-item" }, Ro = ["value"], Vo = { class: "fd-form-item" }, Ao = ["value"], jo = { class: "fd-form-section" }, zo = { class: "fd-form-grid" }, Jo = { class: "fd-form-item" }, Wo = ["value"], Ho = { class: "fd-form-item" }, Go = ["value"], qo = { class: "fd-form-item" }, Yo = { class: "fd-color-row" }, Ko = ["value"], Qo = ["value"], Xo = { class: "fd-form-item" }, Zo = { class: "fd-color-row" }, es = ["value"], ts = ["value"], ns = { class: "fd-form-section" }, os = { class: "fd-form-grid" }, ss = { class: "fd-form-item" }, ls = { class: "fd-form-item" }, is = ["value"], as = /* @__PURE__ */ N({
|
|
948
946
|
__name: "SubtablePanel",
|
|
949
947
|
props: {
|
|
950
948
|
node: {},
|
|
@@ -952,15 +950,15 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
952
950
|
},
|
|
953
951
|
emits: ["update"],
|
|
954
952
|
setup(e, { emit: n }) {
|
|
955
|
-
const o = e, s = n,
|
|
953
|
+
const o = e, s = n, i = Y(), a = M(() => i.subTables);
|
|
956
954
|
function u(x, b) {
|
|
957
955
|
s("update", { [x]: b });
|
|
958
956
|
}
|
|
959
957
|
function r(x) {
|
|
960
|
-
const b = x ?? "", w =
|
|
958
|
+
const b = x ?? "", w = i.subTables.find((se) => se.name === b), W = { secondtable: b };
|
|
961
959
|
w && (W.displaytitle = w.label, W.colnums = ao(w)), s("update", W);
|
|
962
960
|
}
|
|
963
|
-
const l =
|
|
961
|
+
const l = Ue({
|
|
964
962
|
open: !1,
|
|
965
963
|
index: -1,
|
|
966
964
|
draft: null
|
|
@@ -1003,9 +1001,9 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1003
1001
|
editmode: { editmode: "text", title: "文本" },
|
|
1004
1002
|
events: []
|
|
1005
1003
|
};
|
|
1006
|
-
s("update", { colnums: [...o.node.colnums, x] }), await
|
|
1004
|
+
s("update", { colnums: [...o.node.colnums, x] }), await Be(), p(o.node.colnums.length - 1);
|
|
1007
1005
|
}
|
|
1008
|
-
function
|
|
1006
|
+
function D(x) {
|
|
1009
1007
|
const b = o.node.colnums.slice();
|
|
1010
1008
|
b.splice(x, 1), s("update", { colnums: b });
|
|
1011
1009
|
}
|
|
@@ -1017,9 +1015,9 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1017
1015
|
}
|
|
1018
1016
|
const $ = M(() => {
|
|
1019
1017
|
var x;
|
|
1020
|
-
return ((x =
|
|
1018
|
+
return ((x = i.subTables.find((b) => b.name === o.node.secondtable)) == null ? void 0 : x.fields) ?? [];
|
|
1021
1019
|
});
|
|
1022
|
-
function
|
|
1020
|
+
function V(x) {
|
|
1023
1021
|
if (!l.draft) return;
|
|
1024
1022
|
const b = x.target.value;
|
|
1025
1023
|
l.draft.name = b;
|
|
@@ -1030,14 +1028,14 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1030
1028
|
l.draft.editmode.editmode = W ? "files" : "text", l.draft.editmode.title = W ? "文件" : "文本", l.draft.bindLink = w.dataType === "link" ? b : "";
|
|
1031
1029
|
}
|
|
1032
1030
|
}
|
|
1033
|
-
function
|
|
1031
|
+
function K(x) {
|
|
1034
1032
|
u("tablestyle", x || "table");
|
|
1035
1033
|
}
|
|
1036
|
-
return (x, b) => (d(), c(
|
|
1037
|
-
t("div",
|
|
1038
|
-
t("div",
|
|
1034
|
+
return (x, b) => (d(), c(L, null, [
|
|
1035
|
+
t("div", ro, [
|
|
1036
|
+
t("div", uo, [
|
|
1039
1037
|
b[13] || (b[13] = t("label", null, "选择子表", -1)),
|
|
1040
|
-
|
|
1038
|
+
F(h(fe), {
|
|
1041
1039
|
"model-value": e.node.secondtable,
|
|
1042
1040
|
filterable: "",
|
|
1043
1041
|
clearable: "",
|
|
@@ -1045,8 +1043,8 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1045
1043
|
style: { width: "100%" },
|
|
1046
1044
|
"onUpdate:modelValue": r
|
|
1047
1045
|
}, {
|
|
1048
|
-
default:
|
|
1049
|
-
(d(!0), c(
|
|
1046
|
+
default: A(() => [
|
|
1047
|
+
(d(!0), c(L, null, E(a.value, (w) => (d(), R(h(te), {
|
|
1050
1048
|
key: w.name,
|
|
1051
1049
|
label: `${w.label}(${w.name})`,
|
|
1052
1050
|
value: w.name
|
|
@@ -1055,33 +1053,33 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1055
1053
|
_: 1
|
|
1056
1054
|
}, 8, ["model-value"])
|
|
1057
1055
|
]),
|
|
1058
|
-
t("div",
|
|
1056
|
+
t("div", co, [
|
|
1059
1057
|
b[14] || (b[14] = t("label", null, "只读", -1)),
|
|
1060
|
-
|
|
1058
|
+
F(re, {
|
|
1061
1059
|
"model-value": e.node.isreadonly === "1",
|
|
1062
1060
|
"onUpdate:modelValue": b[0] || (b[0] = (w) => u("isreadonly", w ? "1" : "0"))
|
|
1063
1061
|
}, null, 8, ["model-value"])
|
|
1064
1062
|
]),
|
|
1065
|
-
t("div",
|
|
1063
|
+
t("div", fo, [
|
|
1066
1064
|
b[15] || (b[15] = t("label", null, "序号列", -1)),
|
|
1067
|
-
|
|
1065
|
+
F(re, {
|
|
1068
1066
|
"model-value": e.node.secondtableindex === "1",
|
|
1069
1067
|
"onUpdate:modelValue": b[1] || (b[1] = (w) => u("secondtableindex", w ? "1" : "0"))
|
|
1070
1068
|
}, null, 8, ["model-value"])
|
|
1071
1069
|
]),
|
|
1072
|
-
t("div",
|
|
1070
|
+
t("div", mo, [
|
|
1073
1071
|
b[16] || (b[16] = t("label", null, "表格样式", -1)),
|
|
1074
|
-
|
|
1072
|
+
F(h(fe), {
|
|
1075
1073
|
"model-value": e.node.tablestyle || "table",
|
|
1076
1074
|
style: { width: "100%" },
|
|
1077
|
-
"onUpdate:modelValue":
|
|
1075
|
+
"onUpdate:modelValue": K
|
|
1078
1076
|
}, {
|
|
1079
|
-
default:
|
|
1080
|
-
|
|
1077
|
+
default: A(() => [
|
|
1078
|
+
F(h(te), {
|
|
1081
1079
|
label: "表格",
|
|
1082
1080
|
value: "table"
|
|
1083
1081
|
}),
|
|
1084
|
-
|
|
1082
|
+
F(h(te), {
|
|
1085
1083
|
label: "卡片列表",
|
|
1086
1084
|
value: "cards"
|
|
1087
1085
|
})
|
|
@@ -1089,57 +1087,57 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1089
1087
|
_: 1
|
|
1090
1088
|
}, 8, ["model-value"])
|
|
1091
1089
|
]),
|
|
1092
|
-
t("div",
|
|
1093
|
-
t("div",
|
|
1090
|
+
t("div", po, [
|
|
1091
|
+
t("div", vo, [
|
|
1094
1092
|
t("span", null, "列配置(" + k(e.node.colnums.length) + ")", 1),
|
|
1095
1093
|
t("button", {
|
|
1096
1094
|
class: "fd-btn fd-btn--primary fd-btn--sm",
|
|
1097
1095
|
onClick: _
|
|
1098
1096
|
}, "+ 新增列")
|
|
1099
1097
|
]),
|
|
1100
|
-
e.node.colnums.length === 0 ? (d(), c("div",
|
|
1101
|
-
(d(!0), c(
|
|
1098
|
+
e.node.colnums.length === 0 ? (d(), c("div", bo, " 暂无列,点击「新增列」添加 ")) : T("", !0),
|
|
1099
|
+
(d(!0), c(L, null, E(e.node.colnums, (w, W) => (d(), c("div", {
|
|
1102
1100
|
key: w.name,
|
|
1103
1101
|
class: "fd-col-card"
|
|
1104
1102
|
}, [
|
|
1105
|
-
t("div",
|
|
1106
|
-
t("span",
|
|
1107
|
-
t("div",
|
|
1108
|
-
t("span",
|
|
1109
|
-
t("span",
|
|
1103
|
+
t("div", go, [
|
|
1104
|
+
t("span", ho, k(W + 1), 1),
|
|
1105
|
+
t("div", yo, [
|
|
1106
|
+
t("span", ko, k(w.showname || "未命名列"), 1),
|
|
1107
|
+
t("span", wo, k(w.name), 1)
|
|
1110
1108
|
]),
|
|
1111
|
-
t("span",
|
|
1109
|
+
t("span", $o, k(w.bindLink ? "链接" : "文本"), 1)
|
|
1112
1110
|
]),
|
|
1113
|
-
t("div",
|
|
1114
|
-
t("label",
|
|
1111
|
+
t("div", xo, [
|
|
1112
|
+
t("label", Co, [
|
|
1115
1113
|
b[17] || (b[17] = t("span", null, "显示", -1)),
|
|
1116
|
-
|
|
1114
|
+
F(re, {
|
|
1117
1115
|
"model-value": w.isshow === 1,
|
|
1118
1116
|
"onUpdate:modelValue": (se) => B(w, se)
|
|
1119
1117
|
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
1120
1118
|
]),
|
|
1121
|
-
t("div",
|
|
1119
|
+
t("div", _o, [
|
|
1122
1120
|
t("button", {
|
|
1123
1121
|
class: "fd-btn fd-btn--ghost fd-btn--sm",
|
|
1124
1122
|
onClick: (se) => p(W)
|
|
1125
|
-
}, "设置", 8,
|
|
1123
|
+
}, "设置", 8, Io),
|
|
1126
1124
|
t("button", {
|
|
1127
1125
|
class: "fd-btn fd-btn--danger fd-btn--sm",
|
|
1128
|
-
onClick: (se) =>
|
|
1129
|
-
}, "删除", 8,
|
|
1126
|
+
onClick: (se) => D(W)
|
|
1127
|
+
}, "删除", 8, So)
|
|
1130
1128
|
])
|
|
1131
1129
|
])
|
|
1132
1130
|
]))), 128))
|
|
1133
1131
|
])
|
|
1134
1132
|
]),
|
|
1135
|
-
(d(),
|
|
1133
|
+
(d(), R(we, { to: "body" }, [
|
|
1136
1134
|
l.open && l.draft ? (d(), c("div", {
|
|
1137
1135
|
key: 0,
|
|
1138
1136
|
class: "fd-dialog-mask",
|
|
1139
|
-
onClick:
|
|
1137
|
+
onClick: G(y, ["self"])
|
|
1140
1138
|
}, [
|
|
1141
1139
|
t("div", Do, [
|
|
1142
|
-
t("div",
|
|
1140
|
+
t("div", To, [
|
|
1143
1141
|
t("span", null, "列设置 · " + k(l.draft.showname || l.draft.name || "新列"), 1),
|
|
1144
1142
|
t("button", {
|
|
1145
1143
|
class: "fd-dialog-close",
|
|
@@ -1147,38 +1145,38 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1147
1145
|
title: "关闭"
|
|
1148
1146
|
}, "×")
|
|
1149
1147
|
]),
|
|
1150
|
-
t("div",
|
|
1148
|
+
t("div", Lo, [
|
|
1151
1149
|
t("section", Fo, [
|
|
1152
1150
|
b[23] || (b[23] = t("h5", { class: "fd-form-section-h" }, "基本信息", -1)),
|
|
1153
|
-
t("div",
|
|
1151
|
+
t("div", No, [
|
|
1154
1152
|
t("div", Mo, [
|
|
1155
1153
|
b[19] || (b[19] = t("label", null, "列字段", -1)),
|
|
1156
1154
|
t("select", {
|
|
1157
1155
|
value: l.draft.name,
|
|
1158
|
-
onChange: b[2] || (b[2] = (w) =>
|
|
1156
|
+
onChange: b[2] || (b[2] = (w) => V(w))
|
|
1159
1157
|
}, [
|
|
1160
1158
|
b[18] || (b[18] = t("option", { value: "" }, "请选择字段", -1)),
|
|
1161
|
-
(d(!0), c(
|
|
1159
|
+
(d(!0), c(L, null, E($.value, (w) => (d(), c("option", {
|
|
1162
1160
|
key: w.name,
|
|
1163
1161
|
value: w.name
|
|
1164
|
-
}, k(w.label) + "(" + k(w.name) + ")", 9,
|
|
1165
|
-
], 40,
|
|
1162
|
+
}, k(w.label) + "(" + k(w.name) + ")", 9, Po))), 128))
|
|
1163
|
+
], 40, Eo)
|
|
1166
1164
|
]),
|
|
1167
|
-
t("div",
|
|
1165
|
+
t("div", Oo, [
|
|
1168
1166
|
b[20] || (b[20] = t("label", null, "显示标题", -1)),
|
|
1169
1167
|
t("input", {
|
|
1170
1168
|
value: l.draft.showname,
|
|
1171
1169
|
onInput: b[3] || (b[3] = (w) => l.draft.showname = w.target.value),
|
|
1172
1170
|
placeholder: "如 姓名"
|
|
1173
|
-
}, null, 40,
|
|
1171
|
+
}, null, 40, Uo)
|
|
1174
1172
|
]),
|
|
1175
|
-
t("div",
|
|
1173
|
+
t("div", Bo, [
|
|
1176
1174
|
b[21] || (b[21] = t("label", null, "主表头分组", -1)),
|
|
1177
1175
|
t("input", {
|
|
1178
1176
|
value: l.draft.major,
|
|
1179
1177
|
onInput: b[4] || (b[4] = (w) => l.draft.major = w.target.value),
|
|
1180
1178
|
placeholder: "可合并表头分组名"
|
|
1181
|
-
}, null, 40,
|
|
1179
|
+
}, null, 40, Ro)
|
|
1182
1180
|
]),
|
|
1183
1181
|
t("div", Vo, [
|
|
1184
1182
|
b[22] || (b[22] = t("label", null, "列序号", -1)),
|
|
@@ -1193,16 +1191,16 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1193
1191
|
]),
|
|
1194
1192
|
t("section", jo, [
|
|
1195
1193
|
b[29] || (b[29] = t("h5", { class: "fd-form-section-h" }, "显示与样式", -1)),
|
|
1196
|
-
t("div",
|
|
1194
|
+
t("div", zo, [
|
|
1197
1195
|
t("div", Jo, [
|
|
1198
1196
|
b[24] || (b[24] = t("label", null, "列宽", -1)),
|
|
1199
1197
|
t("input", {
|
|
1200
1198
|
value: l.draft.showwidth,
|
|
1201
1199
|
onInput: b[6] || (b[6] = (w) => l.draft.showwidth = w.target.value),
|
|
1202
1200
|
placeholder: "如 120px 或 20%"
|
|
1203
|
-
}, null, 40,
|
|
1201
|
+
}, null, 40, Wo)
|
|
1204
1202
|
]),
|
|
1205
|
-
t("div",
|
|
1203
|
+
t("div", Ho, [
|
|
1206
1204
|
b[26] || (b[26] = t("label", null, "对齐方式", -1)),
|
|
1207
1205
|
t("select", {
|
|
1208
1206
|
value: l.draft.align,
|
|
@@ -1212,56 +1210,56 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1212
1210
|
t("option", { value: "left" }, "左对齐", -1),
|
|
1213
1211
|
t("option", { value: "center" }, "居中", -1),
|
|
1214
1212
|
t("option", { value: "right" }, "右对齐", -1)
|
|
1215
|
-
])], 40,
|
|
1213
|
+
])], 40, Go)
|
|
1216
1214
|
]),
|
|
1217
1215
|
t("div", qo, [
|
|
1218
1216
|
b[27] || (b[27] = t("label", null, "背景色", -1)),
|
|
1219
|
-
t("div",
|
|
1217
|
+
t("div", Yo, [
|
|
1220
1218
|
t("input", {
|
|
1221
1219
|
type: "color",
|
|
1222
1220
|
value: v(l.draft.background),
|
|
1223
1221
|
onInput: b[8] || (b[8] = (w) => g("background", w))
|
|
1224
|
-
}, null, 40,
|
|
1222
|
+
}, null, 40, Ko),
|
|
1225
1223
|
t("input", {
|
|
1226
1224
|
value: l.draft.background,
|
|
1227
1225
|
onInput: b[9] || (b[9] = (w) => l.draft.background = w.target.value),
|
|
1228
1226
|
placeholder: "如 #f5f7fa 或空"
|
|
1229
|
-
}, null, 40,
|
|
1227
|
+
}, null, 40, Qo)
|
|
1230
1228
|
])
|
|
1231
1229
|
]),
|
|
1232
|
-
t("div",
|
|
1230
|
+
t("div", Xo, [
|
|
1233
1231
|
b[28] || (b[28] = t("label", null, "字体色", -1)),
|
|
1234
|
-
t("div",
|
|
1232
|
+
t("div", Zo, [
|
|
1235
1233
|
t("input", {
|
|
1236
1234
|
type: "color",
|
|
1237
1235
|
value: v(l.draft.prospect),
|
|
1238
1236
|
onInput: b[10] || (b[10] = (w) => g("prospect", w))
|
|
1239
|
-
}, null, 40,
|
|
1237
|
+
}, null, 40, es),
|
|
1240
1238
|
t("input", {
|
|
1241
1239
|
value: l.draft.prospect,
|
|
1242
1240
|
onInput: b[11] || (b[11] = (w) => l.draft.prospect = w.target.value),
|
|
1243
1241
|
placeholder: "如 #f5523a 或空"
|
|
1244
|
-
}, null, 40,
|
|
1242
|
+
}, null, 40, ts)
|
|
1245
1243
|
])
|
|
1246
1244
|
])
|
|
1247
1245
|
])
|
|
1248
1246
|
]),
|
|
1249
|
-
t("section",
|
|
1247
|
+
t("section", ns, [
|
|
1250
1248
|
b[32] || (b[32] = t("h5", { class: "fd-form-section-h" }, "编辑模式", -1)),
|
|
1251
|
-
t("div",
|
|
1252
|
-
t("div",
|
|
1249
|
+
t("div", os, [
|
|
1250
|
+
t("div", ss, [
|
|
1253
1251
|
b[30] || (b[30] = t("label", null, "同内容合并", -1)),
|
|
1254
|
-
|
|
1252
|
+
F(re, {
|
|
1255
1253
|
"model-value": l.draft.issamecolmerge === 1,
|
|
1256
1254
|
"onUpdate:modelValue": b[12] || (b[12] = (w) => l.draft.issamecolmerge = w ? 1 : 0)
|
|
1257
1255
|
}, null, 8, ["model-value"])
|
|
1258
1256
|
]),
|
|
1259
|
-
t("div",
|
|
1257
|
+
t("div", ls, [
|
|
1260
1258
|
b[31] || (b[31] = t("label", null, "链接", -1)),
|
|
1261
1259
|
t("input", {
|
|
1262
1260
|
value: l.draft.bindLink ? `${l.draft.bindLink}(链接字段自动绑定)` : "非链接字段",
|
|
1263
1261
|
readonly: ""
|
|
1264
|
-
}, null, 8,
|
|
1262
|
+
}, null, 8, is)
|
|
1265
1263
|
])
|
|
1266
1264
|
])
|
|
1267
1265
|
])
|
|
@@ -1281,8 +1279,8 @@ const io = { class: "fd-panel" }, ro = { class: "fd-panel-item" }, uo = { class:
|
|
|
1281
1279
|
]))
|
|
1282
1280
|
], 64));
|
|
1283
1281
|
}
|
|
1284
|
-
}),
|
|
1285
|
-
function
|
|
1282
|
+
}), ds = /* @__PURE__ */ P(as, [["__scopeId", "data-v-e1fd519d"]]);
|
|
1283
|
+
function rs() {
|
|
1286
1284
|
return [
|
|
1287
1285
|
{
|
|
1288
1286
|
name: "field1",
|
|
@@ -1322,12 +1320,12 @@ function ds() {
|
|
|
1322
1320
|
}
|
|
1323
1321
|
];
|
|
1324
1322
|
}
|
|
1325
|
-
const
|
|
1323
|
+
const us = {
|
|
1326
1324
|
type: "subtable",
|
|
1327
1325
|
title: "子表",
|
|
1328
|
-
design:
|
|
1329
|
-
render:
|
|
1330
|
-
panel:
|
|
1326
|
+
design: Bn,
|
|
1327
|
+
render: io,
|
|
1328
|
+
panel: ds,
|
|
1331
1329
|
isContainer: !1,
|
|
1332
1330
|
createDefaultProps: () => ({
|
|
1333
1331
|
id: "",
|
|
@@ -1353,24 +1351,24 @@ const rs = {
|
|
|
1353
1351
|
tableheight: 0,
|
|
1354
1352
|
iscompletehide: "0",
|
|
1355
1353
|
iscompletehidecode: "",
|
|
1356
|
-
colnums:
|
|
1354
|
+
colnums: rs(),
|
|
1357
1355
|
events: []
|
|
1358
1356
|
}),
|
|
1359
1357
|
serialize: (e) => e
|
|
1360
|
-
},
|
|
1358
|
+
}, cs = /* @__PURE__ */ N({
|
|
1361
1359
|
__name: "GridDesign",
|
|
1362
1360
|
props: {
|
|
1363
1361
|
node: {}
|
|
1364
1362
|
},
|
|
1365
1363
|
setup(e) {
|
|
1366
|
-
const n =
|
|
1364
|
+
const n = Y();
|
|
1367
1365
|
return (o, s) => (d(), c("div", {
|
|
1368
|
-
class:
|
|
1366
|
+
class: j(["fd-grid-design", { "is-mobile": h(n).device === "mobile" }])
|
|
1369
1367
|
}, [
|
|
1370
|
-
|
|
1368
|
+
Z(o.$slots, "children", {}, void 0, !0)
|
|
1371
1369
|
], 2));
|
|
1372
1370
|
}
|
|
1373
|
-
}),
|
|
1371
|
+
}), fs = /* @__PURE__ */ P(cs, [["__scopeId", "data-v-b4d1e09d"]]), Ce = /* @__PURE__ */ N({
|
|
1374
1372
|
__name: "WidgetHost",
|
|
1375
1373
|
props: {
|
|
1376
1374
|
node: {},
|
|
@@ -1380,37 +1378,37 @@ const rs = {
|
|
|
1380
1378
|
formId: {}
|
|
1381
1379
|
},
|
|
1382
1380
|
setup(e) {
|
|
1383
|
-
const n = e, o = M(() => X(n.node.type)), s = M(() => o.value ? n.mode === "design" ? o.value.design : o.value.render : null),
|
|
1384
|
-
return (
|
|
1381
|
+
const n = e, o = M(() => X(n.node.type)), s = M(() => o.value ? n.mode === "design" ? o.value.design : o.value.render : null), i = (a) => a && n.formData ? n.formData[a] : void 0;
|
|
1382
|
+
return (a, u) => {
|
|
1385
1383
|
var l;
|
|
1386
|
-
const r =
|
|
1387
|
-
return s.value ? (d(),
|
|
1384
|
+
const r = Re("WidgetHost", !0);
|
|
1385
|
+
return s.value ? (d(), R(ke(s.value), he({
|
|
1388
1386
|
key: 0,
|
|
1389
1387
|
node: e.node,
|
|
1390
|
-
value:
|
|
1388
|
+
value: i(e.node.bindField),
|
|
1391
1389
|
"form-data": e.formData
|
|
1392
|
-
}, e.mode === "render" ? { formMode: e.formMode, formId: e.formId } : null),
|
|
1393
|
-
|
|
1390
|
+
}, e.mode === "render" ? { formMode: e.formMode, formId: e.formId } : null), ce({ _: 2 }, [
|
|
1391
|
+
E(a.$slots, (m, p) => ({
|
|
1394
1392
|
name: p,
|
|
1395
|
-
fn:
|
|
1396
|
-
|
|
1393
|
+
fn: A((y) => [
|
|
1394
|
+
Z(a.$slots, p, qe(Ye(y || {})))
|
|
1397
1395
|
])
|
|
1398
1396
|
})),
|
|
1399
|
-
(l = o.value) != null && l.isContainer && !
|
|
1397
|
+
(l = o.value) != null && l.isContainer && !a.$slots.children ? {
|
|
1400
1398
|
name: "children",
|
|
1401
|
-
fn:
|
|
1402
|
-
(d(!0), c(
|
|
1399
|
+
fn: A(() => [
|
|
1400
|
+
(d(!0), c(L, null, E(e.node.children, (m) => (d(), R(r, {
|
|
1403
1401
|
key: m.id,
|
|
1404
1402
|
node: m,
|
|
1405
1403
|
mode: e.mode,
|
|
1406
1404
|
"form-mode": e.formMode,
|
|
1407
1405
|
"form-data": e.formData,
|
|
1408
1406
|
"form-id": e.formId
|
|
1409
|
-
},
|
|
1410
|
-
|
|
1407
|
+
}, ce({ _: 2 }, [
|
|
1408
|
+
E(a.$slots, (p, y) => ({
|
|
1411
1409
|
name: y,
|
|
1412
|
-
fn:
|
|
1413
|
-
|
|
1410
|
+
fn: A((C) => [
|
|
1411
|
+
Z(a.$slots, y, he({ ref_for: !0 }, C || {}))
|
|
1414
1412
|
])
|
|
1415
1413
|
}))
|
|
1416
1414
|
]), 1032, ["node", "mode", "form-mode", "form-data", "form-id"]))), 128))
|
|
@@ -1420,25 +1418,25 @@ const rs = {
|
|
|
1420
1418
|
]), 1040, ["node", "value", "form-data"])) : T("", !0);
|
|
1421
1419
|
};
|
|
1422
1420
|
}
|
|
1423
|
-
}),
|
|
1424
|
-
function
|
|
1421
|
+
}), ms = 24;
|
|
1422
|
+
function Ae(e, n, o, s, i = !1) {
|
|
1425
1423
|
if (e.type !== "label" || !o.length) return "";
|
|
1426
|
-
const
|
|
1424
|
+
const a = i ? 1 : ms, u = (D) => Math.min(Math.max(D.gridSpan || s || a, 1), a), r = [];
|
|
1427
1425
|
let l = 0, m = 0;
|
|
1428
|
-
for (const
|
|
1429
|
-
const v = u(
|
|
1430
|
-
l + v >
|
|
1426
|
+
for (const D of o) {
|
|
1427
|
+
const v = u(D);
|
|
1428
|
+
l + v > a && (l = 0, m++);
|
|
1431
1429
|
const g = l === 0;
|
|
1432
1430
|
l += v;
|
|
1433
|
-
const $ = l >=
|
|
1434
|
-
r.push({ row: m, rowFirst: g, rowLast: $ }), l >=
|
|
1431
|
+
const $ = l >= a;
|
|
1432
|
+
r.push({ row: m, rowFirst: g, rowLast: $ }), l >= a && (l = 0, m++);
|
|
1435
1433
|
}
|
|
1436
1434
|
const p = r[n];
|
|
1437
1435
|
if (!p) return "";
|
|
1438
1436
|
const y = r[r.length - 1].row, C = p.row === 0, B = p.row === y, _ = [];
|
|
1439
1437
|
return p.rowFirst && C && _.push("is-g-corner-tl"), p.rowLast && C && _.push("is-g-corner-tr"), p.rowFirst && B && _.push("is-g-corner-bl"), p.rowLast && B && _.push("is-g-corner-br"), _.join(" ");
|
|
1440
1438
|
}
|
|
1441
|
-
const
|
|
1439
|
+
const ps = /* @__PURE__ */ N({
|
|
1442
1440
|
__name: "GridRender",
|
|
1443
1441
|
props: {
|
|
1444
1442
|
node: {},
|
|
@@ -1447,43 +1445,43 @@ const ms = /* @__PURE__ */ E({
|
|
|
1447
1445
|
formId: {}
|
|
1448
1446
|
},
|
|
1449
1447
|
setup(e) {
|
|
1450
|
-
const n =
|
|
1448
|
+
const n = Y(), o = O(!1);
|
|
1451
1449
|
let s = null;
|
|
1452
|
-
|
|
1453
|
-
s = window.matchMedia("(max-width: 768px)"), o.value = s.matches, s.addEventListener("change", (
|
|
1454
|
-
o.value =
|
|
1450
|
+
ve(() => {
|
|
1451
|
+
s = window.matchMedia("(max-width: 768px)"), o.value = s.matches, s.addEventListener("change", (a) => {
|
|
1452
|
+
o.value = a.matches;
|
|
1455
1453
|
});
|
|
1456
|
-
}),
|
|
1454
|
+
}), Oe(() => {
|
|
1457
1455
|
s && s.removeEventListener("change", () => {
|
|
1458
1456
|
});
|
|
1459
1457
|
});
|
|
1460
|
-
const
|
|
1461
|
-
return (
|
|
1462
|
-
class:
|
|
1458
|
+
const i = M(() => n.device === "mobile" || o.value);
|
|
1459
|
+
return (a, u) => (d(), c("div", {
|
|
1460
|
+
class: j(["fd-grid-render", { "is-mobile": i.value }])
|
|
1463
1461
|
}, [
|
|
1464
|
-
(d(!0), c(
|
|
1462
|
+
(d(!0), c(L, null, E(e.node.children, (r, l) => (d(), c("div", {
|
|
1465
1463
|
key: r.id,
|
|
1466
|
-
class:
|
|
1467
|
-
style:
|
|
1464
|
+
class: j(["fd-grid-cell", h(Ae)(r, l, e.node.children || [], e.node.layout || 24, i.value)]),
|
|
1465
|
+
style: q({ gridColumn: `span ${r.gridSpan || e.node.layout}` })
|
|
1468
1466
|
}, [
|
|
1469
|
-
|
|
1467
|
+
F(Ce, {
|
|
1470
1468
|
node: r,
|
|
1471
1469
|
mode: "render",
|
|
1472
1470
|
"form-mode": e.formMode,
|
|
1473
1471
|
"form-data": e.formData,
|
|
1474
1472
|
"form-id": e.formId
|
|
1475
|
-
},
|
|
1476
|
-
|
|
1473
|
+
}, ce({ _: 2 }, [
|
|
1474
|
+
E(a.$slots, (m, p) => ({
|
|
1477
1475
|
name: p,
|
|
1478
|
-
fn:
|
|
1479
|
-
|
|
1476
|
+
fn: A((y) => [
|
|
1477
|
+
Z(a.$slots, p, he({ ref_for: !0 }, y || {}), void 0, !0)
|
|
1480
1478
|
])
|
|
1481
1479
|
}))
|
|
1482
1480
|
]), 1032, ["node", "form-mode", "form-data", "form-id"])
|
|
1483
1481
|
], 6))), 128))
|
|
1484
1482
|
], 2));
|
|
1485
1483
|
}
|
|
1486
|
-
}),
|
|
1484
|
+
}), vs = /* @__PURE__ */ P(ps, [["__scopeId", "data-v-a4c55357"]]), bs = { class: "fd-panel" }, gs = { class: "fd-panel-item" }, hs = ["value"], ys = ["value"], ks = { class: "fd-panel-item" }, ws = /* @__PURE__ */ N({
|
|
1487
1485
|
__name: "GridPanel",
|
|
1488
1486
|
props: {
|
|
1489
1487
|
node: {},
|
|
@@ -1491,44 +1489,44 @@ const ms = /* @__PURE__ */ E({
|
|
|
1491
1489
|
},
|
|
1492
1490
|
emits: ["update"],
|
|
1493
1491
|
setup(e, { emit: n }) {
|
|
1494
|
-
const o = e, s = n,
|
|
1492
|
+
const o = e, s = n, i = [
|
|
1495
1493
|
{ label: "2列布局", value: 24 },
|
|
1496
1494
|
{ label: "4列布局", value: 12 },
|
|
1497
1495
|
{ label: "6列布局", value: 8 },
|
|
1498
1496
|
{ label: "8列布局", value: 6 }
|
|
1499
1497
|
];
|
|
1500
|
-
function
|
|
1498
|
+
function a() {
|
|
1501
1499
|
const u = o.node.layout || 24, r = (o.node.children ?? []).map((l) => ({ ...l, gridSpan: u }));
|
|
1502
1500
|
s("update", { children: r });
|
|
1503
1501
|
}
|
|
1504
|
-
return (u, r) => (d(), c("div",
|
|
1505
|
-
t("div",
|
|
1502
|
+
return (u, r) => (d(), c("div", bs, [
|
|
1503
|
+
t("div", gs, [
|
|
1506
1504
|
r[1] || (r[1] = t("label", null, "布局", -1)),
|
|
1507
1505
|
t("select", {
|
|
1508
1506
|
value: e.node.layout,
|
|
1509
1507
|
onChange: r[0] || (r[0] = (l) => s("update", { layout: Number(l.target.value) }))
|
|
1510
1508
|
}, [
|
|
1511
|
-
(d(), c(
|
|
1509
|
+
(d(), c(L, null, E(i, (l) => t("option", {
|
|
1512
1510
|
key: l.value,
|
|
1513
1511
|
value: l.value
|
|
1514
|
-
}, k(l.label), 9,
|
|
1515
|
-
], 40,
|
|
1512
|
+
}, k(l.label), 9, ys)), 64))
|
|
1513
|
+
], 40, hs)
|
|
1516
1514
|
]),
|
|
1517
|
-
t("div",
|
|
1515
|
+
t("div", ks, [
|
|
1518
1516
|
r[2] || (r[2] = t("label", null, "一键布局", -1)),
|
|
1519
1517
|
t("button", {
|
|
1520
1518
|
class: "fd-btn fd-btn--primary fd-btn--sm fd-grid-apply",
|
|
1521
|
-
onClick:
|
|
1519
|
+
onClick: a
|
|
1522
1520
|
}, " 应用到全部子组件(每项占比 " + k(e.node.layout || 24) + "/24) ", 1)
|
|
1523
1521
|
])
|
|
1524
1522
|
]));
|
|
1525
1523
|
}
|
|
1526
|
-
}),
|
|
1524
|
+
}), $s = /* @__PURE__ */ P(ws, [["__scopeId", "data-v-a333d2ea"]]), xs = {
|
|
1527
1525
|
type: "grid",
|
|
1528
1526
|
title: "栅栏格",
|
|
1529
|
-
design:
|
|
1530
|
-
render:
|
|
1531
|
-
panel:
|
|
1527
|
+
design: fs,
|
|
1528
|
+
render: vs,
|
|
1529
|
+
panel: $s,
|
|
1532
1530
|
isContainer: !0,
|
|
1533
1531
|
createDefaultProps: () => ({
|
|
1534
1532
|
id: "",
|
|
@@ -1540,7 +1538,7 @@ const ms = /* @__PURE__ */ E({
|
|
|
1540
1538
|
children: []
|
|
1541
1539
|
}),
|
|
1542
1540
|
serialize: (e) => e
|
|
1543
|
-
},
|
|
1541
|
+
}, Cs = /* @__PURE__ */ N({
|
|
1544
1542
|
__name: "TextDesign",
|
|
1545
1543
|
props: {
|
|
1546
1544
|
node: {}
|
|
@@ -1548,10 +1546,10 @@ const ms = /* @__PURE__ */ E({
|
|
|
1548
1546
|
setup(e) {
|
|
1549
1547
|
return (n, o) => (d(), c("div", {
|
|
1550
1548
|
class: "fd-text-design",
|
|
1551
|
-
style:
|
|
1549
|
+
style: q({ display: e.node.display })
|
|
1552
1550
|
}, k(e.node.text || "文本内容"), 5));
|
|
1553
1551
|
}
|
|
1554
|
-
}),
|
|
1552
|
+
}), _s = /* @__PURE__ */ P(Cs, [["__scopeId", "data-v-ba382e6c"]]), Is = /* @__PURE__ */ N({
|
|
1555
1553
|
__name: "TextRender",
|
|
1556
1554
|
props: {
|
|
1557
1555
|
node: {},
|
|
@@ -1563,12 +1561,12 @@ const ms = /* @__PURE__ */ E({
|
|
|
1563
1561
|
const s = n.value;
|
|
1564
1562
|
return s == null ? "" : String(s);
|
|
1565
1563
|
});
|
|
1566
|
-
return (s,
|
|
1564
|
+
return (s, i) => (d(), c("div", {
|
|
1567
1565
|
class: "fd-text-render",
|
|
1568
|
-
style:
|
|
1566
|
+
style: q({ display: e.node.display })
|
|
1569
1567
|
}, k(o.value), 5));
|
|
1570
1568
|
}
|
|
1571
|
-
}),
|
|
1569
|
+
}), Ss = /* @__PURE__ */ P(Is, [["__scopeId", "data-v-3ed7b0f0"]]), Ds = { class: "fd-panel" }, Ts = { class: "fd-panel-item" }, Ls = ["value"], Fs = { class: "fd-panel-item" }, Ns = ["value"], Ms = ["value"], Es = { class: "fd-panel-item" }, Ps = ["value"], Os = /* @__PURE__ */ N({
|
|
1572
1570
|
__name: "TextPanel",
|
|
1573
1571
|
props: {
|
|
1574
1572
|
node: {},
|
|
@@ -1577,46 +1575,46 @@ const ms = /* @__PURE__ */ E({
|
|
|
1577
1575
|
emits: ["update"],
|
|
1578
1576
|
setup(e, { emit: n }) {
|
|
1579
1577
|
const o = n;
|
|
1580
|
-
return (s,
|
|
1581
|
-
t("div",
|
|
1582
|
-
|
|
1578
|
+
return (s, i) => (d(), c("div", Ds, [
|
|
1579
|
+
t("div", Ts, [
|
|
1580
|
+
i[3] || (i[3] = t("label", null, "文本", -1)),
|
|
1583
1581
|
t("textarea", {
|
|
1584
1582
|
rows: "4",
|
|
1585
1583
|
value: e.node.text,
|
|
1586
|
-
onInput:
|
|
1587
|
-
}, null, 40,
|
|
1584
|
+
onInput: i[0] || (i[0] = (a) => o("update", { text: a.target.value }))
|
|
1585
|
+
}, null, 40, Ls)
|
|
1588
1586
|
]),
|
|
1589
1587
|
t("div", Fs, [
|
|
1590
|
-
|
|
1588
|
+
i[5] || (i[5] = t("label", null, "绑定字段", -1)),
|
|
1591
1589
|
t("select", {
|
|
1592
1590
|
value: e.node.bindField,
|
|
1593
|
-
onChange:
|
|
1591
|
+
onChange: i[1] || (i[1] = (a) => o("update", { bindField: a.target.value }))
|
|
1594
1592
|
}, [
|
|
1595
|
-
|
|
1596
|
-
(d(!0), c(
|
|
1597
|
-
key:
|
|
1598
|
-
value:
|
|
1599
|
-
}, k(
|
|
1600
|
-
], 40,
|
|
1593
|
+
i[4] || (i[4] = t("option", { value: "" }, "不绑定", -1)),
|
|
1594
|
+
(d(!0), c(L, null, E(e.fields, (a) => (d(), c("option", {
|
|
1595
|
+
key: a.name,
|
|
1596
|
+
value: a.name
|
|
1597
|
+
}, k(a.label) + "(" + k(a.name) + ")", 9, Ms))), 128))
|
|
1598
|
+
], 40, Ns)
|
|
1601
1599
|
]),
|
|
1602
|
-
t("div",
|
|
1603
|
-
|
|
1600
|
+
t("div", Es, [
|
|
1601
|
+
i[7] || (i[7] = t("label", null, "对齐方式", -1)),
|
|
1604
1602
|
t("select", {
|
|
1605
1603
|
value: e.node.display,
|
|
1606
|
-
onChange:
|
|
1607
|
-
}, [...
|
|
1604
|
+
onChange: i[2] || (i[2] = (a) => o("update", { display: a.target.value }))
|
|
1605
|
+
}, [...i[6] || (i[6] = [
|
|
1608
1606
|
t("option", { value: "inline-block" }, "对齐", -1),
|
|
1609
1607
|
t("option", { value: "block" }, "换行", -1)
|
|
1610
|
-
])], 40,
|
|
1608
|
+
])], 40, Ps)
|
|
1611
1609
|
])
|
|
1612
1610
|
]));
|
|
1613
1611
|
}
|
|
1614
|
-
}),
|
|
1612
|
+
}), Us = /* @__PURE__ */ P(Os, [["__scopeId", "data-v-3201879c"]]), Bs = {
|
|
1615
1613
|
type: "text",
|
|
1616
1614
|
title: "文本",
|
|
1617
|
-
design:
|
|
1618
|
-
render:
|
|
1619
|
-
panel:
|
|
1615
|
+
design: _s,
|
|
1616
|
+
render: Ss,
|
|
1617
|
+
panel: Us,
|
|
1620
1618
|
isContainer: !1,
|
|
1621
1619
|
createDefaultProps: () => ({
|
|
1622
1620
|
id: "",
|
|
@@ -1629,43 +1627,76 @@ const ms = /* @__PURE__ */ E({
|
|
|
1629
1627
|
serialize: (e) => e
|
|
1630
1628
|
};
|
|
1631
1629
|
let Me = !1;
|
|
1632
|
-
function
|
|
1633
|
-
Me || (Me = !0,
|
|
1630
|
+
function _e() {
|
|
1631
|
+
Me || (Me = !0, ie(Et), ie(fn), ie(Sn), ie(us), ie(xs), ie(Bs));
|
|
1632
|
+
}
|
|
1633
|
+
_e();
|
|
1634
|
+
const Rs = { baseUrl: "/bpm" };
|
|
1635
|
+
let le = {}, pe = {}, Ie = {};
|
|
1636
|
+
const Vs = "__BPM_LOGIN_SITE__", As = "RetutnUrl";
|
|
1637
|
+
let Ee = !1;
|
|
1638
|
+
const js = "api/formdesigner/v1";
|
|
1639
|
+
function je(e) {
|
|
1640
|
+
pe = { ...pe, ...e };
|
|
1641
|
+
}
|
|
1642
|
+
function zs(e) {
|
|
1643
|
+
le.baseUrl = e;
|
|
1644
|
+
}
|
|
1645
|
+
function ua(e) {
|
|
1646
|
+
le.baseUrl = e ? e.startsWith("/") ? e : `/${e}` : "";
|
|
1634
1647
|
}
|
|
1635
|
-
|
|
1636
|
-
const Bs = { baseUrl: "/bpmapi-uat" };
|
|
1637
|
-
let _e = {}, ge = {}, Vs = {};
|
|
1638
|
-
const As = "api/formdesigner/v1";
|
|
1639
|
-
function Ae(e) {
|
|
1640
|
-
ge = { ...ge, ...e };
|
|
1648
|
+
function ca(e) {
|
|
1641
1649
|
}
|
|
1642
|
-
function
|
|
1643
|
-
|
|
1650
|
+
function fa(e) {
|
|
1651
|
+
le.onUnauthorized = e;
|
|
1644
1652
|
}
|
|
1645
|
-
function
|
|
1646
|
-
|
|
1653
|
+
function ma(e) {
|
|
1654
|
+
le.loginSite = e;
|
|
1647
1655
|
}
|
|
1648
|
-
function
|
|
1656
|
+
function Js() {
|
|
1657
|
+
const e = Ie.loginSite ?? le.loginSite ?? pe.loginSite;
|
|
1658
|
+
if (e) return e;
|
|
1659
|
+
if (typeof window < "u") {
|
|
1660
|
+
const n = window[Vs];
|
|
1661
|
+
if (typeof n == "string" && n) return n;
|
|
1662
|
+
}
|
|
1663
|
+
return "";
|
|
1664
|
+
}
|
|
1665
|
+
function Ws() {
|
|
1666
|
+
if (Ee) return !1;
|
|
1667
|
+
const e = Js();
|
|
1668
|
+
return !e || typeof window > "u" ? !1 : (Ee = !0, window.location.href = `${e}?${As}=${encodeURIComponent(window.location.href)}`, !0);
|
|
1669
|
+
}
|
|
1670
|
+
function Hs() {
|
|
1671
|
+
const e = Ie.onUnauthorized ?? le.onUnauthorized ?? pe.onUnauthorized;
|
|
1672
|
+
if (e) {
|
|
1673
|
+
try {
|
|
1674
|
+
e();
|
|
1675
|
+
} catch {
|
|
1676
|
+
}
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
Ws();
|
|
1649
1680
|
}
|
|
1650
|
-
function
|
|
1681
|
+
function Gs() {
|
|
1651
1682
|
return {
|
|
1652
|
-
baseUrl:
|
|
1683
|
+
baseUrl: Ie.baseUrl ?? le.baseUrl ?? pe.baseUrl ?? Rs.baseUrl
|
|
1653
1684
|
};
|
|
1654
1685
|
}
|
|
1655
1686
|
function ne(e, n) {
|
|
1656
|
-
const { baseUrl: o } =
|
|
1657
|
-
Object.entries(n ?? {}).forEach(([
|
|
1658
|
-
u != null && u !== "" && s.append(
|
|
1687
|
+
const { baseUrl: o } = Gs(), s = new URLSearchParams();
|
|
1688
|
+
Object.entries(n ?? {}).forEach(([a, u]) => {
|
|
1689
|
+
u != null && u !== "" && s.append(a, u);
|
|
1659
1690
|
});
|
|
1660
|
-
const
|
|
1661
|
-
return `${o}/${
|
|
1691
|
+
const i = s.toString();
|
|
1692
|
+
return `${o}/${js}/${e}${i ? `?${i}` : ""}`;
|
|
1662
1693
|
}
|
|
1663
|
-
class
|
|
1694
|
+
class ze extends Error {
|
|
1664
1695
|
constructor(n, o) {
|
|
1665
1696
|
super(o), this.status = n, this.name = "ApiError";
|
|
1666
1697
|
}
|
|
1667
1698
|
}
|
|
1668
|
-
function
|
|
1699
|
+
function qs(e) {
|
|
1669
1700
|
if (!e) return "";
|
|
1670
1701
|
try {
|
|
1671
1702
|
const n = JSON.parse(e), o = n.error ?? n.message ?? n.title ?? n.detail;
|
|
@@ -1680,7 +1711,7 @@ async function oe(e, n) {
|
|
|
1680
1711
|
headers: { "Content-Type": "application/json", ...(n == null ? void 0 : n.headers) ?? {} }
|
|
1681
1712
|
}), s = await o.text();
|
|
1682
1713
|
if (!o.ok)
|
|
1683
|
-
throw new
|
|
1714
|
+
throw o.status === 401 && Hs(), new ze(o.status, qs(s) || `请求失败(${o.status})`);
|
|
1684
1715
|
if ((o.headers.get("content-type") ?? "").includes("text/plain")) return s;
|
|
1685
1716
|
if (!s) return null;
|
|
1686
1717
|
try {
|
|
@@ -1689,7 +1720,7 @@ async function oe(e, n) {
|
|
|
1689
1720
|
return s;
|
|
1690
1721
|
}
|
|
1691
1722
|
}
|
|
1692
|
-
function
|
|
1723
|
+
function Ys(e) {
|
|
1693
1724
|
if (e == null) return null;
|
|
1694
1725
|
if (typeof e != "string") return e;
|
|
1695
1726
|
try {
|
|
@@ -1698,34 +1729,34 @@ function zs(e) {
|
|
|
1698
1729
|
return null;
|
|
1699
1730
|
}
|
|
1700
1731
|
}
|
|
1701
|
-
function
|
|
1732
|
+
function Je(e) {
|
|
1702
1733
|
return e == null ? { success: !1, message: "无响应" } : typeof e == "string" ? { success: e.includes("成功"), message: e } : e;
|
|
1703
1734
|
}
|
|
1704
|
-
async function
|
|
1735
|
+
async function Ks(e, n) {
|
|
1705
1736
|
return oe(ne("opendesigner"), {
|
|
1706
1737
|
method: "POST",
|
|
1707
1738
|
body: JSON.stringify(e)
|
|
1708
1739
|
});
|
|
1709
1740
|
}
|
|
1710
|
-
async function
|
|
1741
|
+
async function Qs(e, n) {
|
|
1711
1742
|
return oe(ne("formconfig", { id: e }));
|
|
1712
1743
|
}
|
|
1713
|
-
async function
|
|
1744
|
+
async function Xs(e, n, o) {
|
|
1714
1745
|
return oe(ne("fieldbinding/allfields", { dbtable: e, formid: n }));
|
|
1715
1746
|
}
|
|
1716
|
-
async function
|
|
1717
|
-
return
|
|
1747
|
+
async function Zs(e, n) {
|
|
1748
|
+
return Je(await oe(ne("save"), { method: "POST", body: JSON.stringify(e) }));
|
|
1718
1749
|
}
|
|
1719
|
-
async function
|
|
1720
|
-
return
|
|
1750
|
+
async function el(e, n) {
|
|
1751
|
+
return Je(await oe(ne("publish"), { method: "POST", body: JSON.stringify(e) }));
|
|
1721
1752
|
}
|
|
1722
|
-
async function
|
|
1753
|
+
async function tl(e, n) {
|
|
1723
1754
|
return oe(ne("saveas"), { method: "POST", body: JSON.stringify(e) });
|
|
1724
1755
|
}
|
|
1725
|
-
async function
|
|
1756
|
+
async function nl(e, n) {
|
|
1726
1757
|
return oe(ne("effectcount", { formId: e }));
|
|
1727
1758
|
}
|
|
1728
|
-
async function
|
|
1759
|
+
async function ol(e, n) {
|
|
1729
1760
|
return oe(
|
|
1730
1761
|
ne("effectprocesses", {
|
|
1731
1762
|
id: e.id,
|
|
@@ -1735,22 +1766,22 @@ async function Xs(e, n) {
|
|
|
1735
1766
|
})
|
|
1736
1767
|
);
|
|
1737
1768
|
}
|
|
1738
|
-
function
|
|
1769
|
+
function sl(e) {
|
|
1739
1770
|
return { name: e.name, label: e.label, dataType: e.dataType };
|
|
1740
1771
|
}
|
|
1741
|
-
function
|
|
1772
|
+
function ll(e) {
|
|
1742
1773
|
return { name: e.name, label: e.label, dataType: e.dataType || "string" };
|
|
1743
1774
|
}
|
|
1744
|
-
function
|
|
1745
|
-
return (e ?? []).filter((o) => o.name && o.name !== n).map((o) => ({ name: o.name, label: o.name, fields: (o.fields ?? []).map(
|
|
1775
|
+
function il(e, n) {
|
|
1776
|
+
return (e ?? []).filter((o) => o.name && o.name !== n).map((o) => ({ name: o.name, label: o.name, fields: (o.fields ?? []).map(ll) }));
|
|
1746
1777
|
}
|
|
1747
|
-
function
|
|
1748
|
-
return
|
|
1778
|
+
function al(e) {
|
|
1779
|
+
return Ys(e);
|
|
1749
1780
|
}
|
|
1750
1781
|
function ae(e) {
|
|
1751
|
-
return e instanceof
|
|
1782
|
+
return e instanceof ze || e instanceof Error ? e.message : String(e);
|
|
1752
1783
|
}
|
|
1753
|
-
const
|
|
1784
|
+
const ee = (e) => JSON.parse(JSON.stringify(e));
|
|
1754
1785
|
function Q(e, n) {
|
|
1755
1786
|
for (const o of e) {
|
|
1756
1787
|
if (o.id === n) return o;
|
|
@@ -1761,15 +1792,15 @@ function Q(e, n) {
|
|
|
1761
1792
|
}
|
|
1762
1793
|
return null;
|
|
1763
1794
|
}
|
|
1764
|
-
function
|
|
1795
|
+
function We(e, n) {
|
|
1765
1796
|
const o = e.findIndex((s) => s.id === n);
|
|
1766
1797
|
if (o >= 0)
|
|
1767
1798
|
return e.splice(o, 1), !0;
|
|
1768
1799
|
for (const s of e)
|
|
1769
|
-
if (s.children &&
|
|
1800
|
+
if (s.children && We(s.children, n)) return !0;
|
|
1770
1801
|
return !1;
|
|
1771
1802
|
}
|
|
1772
|
-
const
|
|
1803
|
+
const Y = tt("designer", {
|
|
1773
1804
|
state: () => ({
|
|
1774
1805
|
workFormId: "",
|
|
1775
1806
|
originFormId: "",
|
|
@@ -1807,15 +1838,15 @@ const G = Ze("designer", {
|
|
|
1807
1838
|
actions: {
|
|
1808
1839
|
/** 提交一次变更快照(用于撤销重做) */
|
|
1809
1840
|
commit() {
|
|
1810
|
-
this.past.push(
|
|
1841
|
+
this.past.push(ee(this.widgets)), this.past.length > 50 && this.past.shift(), this.future = [];
|
|
1811
1842
|
},
|
|
1812
1843
|
undo() {
|
|
1813
1844
|
const e = this.past.pop();
|
|
1814
|
-
e && (this.future.push(
|
|
1845
|
+
e && (this.future.push(ee(this.widgets)), this.widgets = e, this.selectedId && !Q(this.widgets, this.selectedId) && (this.selectedId = null));
|
|
1815
1846
|
},
|
|
1816
1847
|
redo() {
|
|
1817
1848
|
const e = this.future.pop();
|
|
1818
|
-
e && (this.past.push(
|
|
1849
|
+
e && (this.past.push(ee(this.widgets)), this.widgets = e);
|
|
1819
1850
|
},
|
|
1820
1851
|
select(e) {
|
|
1821
1852
|
this.selectedId = e, this.selectedForm = !1;
|
|
@@ -1844,11 +1875,11 @@ const G = Ze("designer", {
|
|
|
1844
1875
|
},
|
|
1845
1876
|
/** 新增控件:parentId 指定容器,index 指定插入位置(不传则末尾) */
|
|
1846
1877
|
addWidget(e, n, o) {
|
|
1847
|
-
var
|
|
1848
|
-
const s =
|
|
1878
|
+
var a;
|
|
1879
|
+
const s = mt(e);
|
|
1849
1880
|
this.commit();
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1881
|
+
const i = n ? Q(this.widgets, n) : null;
|
|
1882
|
+
i && ((a = X(i.type)) != null && a.isContainer) ? (i.children = i.children || [], i.type === "grid" && s.gridSpan == null && (s.gridSpan = i.layout || 24), o == null || o > i.children.length ? i.children.push(s) : i.children.splice(Math.max(0, o), 0, s)) : o == null || o > this.widgets.length ? this.widgets.push(s) : this.widgets.splice(Math.max(0, o), 0, s), this.selectedId = s.id;
|
|
1852
1883
|
},
|
|
1853
1884
|
/** 判断 maybeChild 是否为 node 的后代(防止把容器拖进自己) */
|
|
1854
1885
|
isDescendant(e, n) {
|
|
@@ -1863,31 +1894,31 @@ const G = Ze("designer", {
|
|
|
1863
1894
|
if (e === n) return;
|
|
1864
1895
|
const s = Q(this.widgets, e);
|
|
1865
1896
|
if (!s || n && this.isDescendant(s, n)) return;
|
|
1866
|
-
const
|
|
1897
|
+
const i = n ? Q(this.widgets, n) : null, a = (y) => {
|
|
1867
1898
|
const C = y.findIndex((B) => B.id === e);
|
|
1868
1899
|
if (C >= 0) return { list: y, index: C };
|
|
1869
1900
|
for (const B of y)
|
|
1870
1901
|
if (B.children) {
|
|
1871
|
-
const _ =
|
|
1902
|
+
const _ = a(B.children);
|
|
1872
1903
|
if (_) return _;
|
|
1873
1904
|
}
|
|
1874
1905
|
return null;
|
|
1875
|
-
}, u =
|
|
1906
|
+
}, u = a(this.widgets);
|
|
1876
1907
|
if (!u) return;
|
|
1877
1908
|
let r;
|
|
1878
|
-
|
|
1909
|
+
i && ((p = X(i.type)) != null && p.isContainer) ? (i.children = i.children || [], r = i.children) : r = this.widgets, this.commit();
|
|
1879
1910
|
let l = o;
|
|
1880
1911
|
r === u.list && u.index < o && (l = o - 1);
|
|
1881
1912
|
const [m] = u.list.splice(u.index, 1);
|
|
1882
|
-
if (l = Math.max(0, Math.min(l, r.length)), r.splice(l, 0, m),
|
|
1883
|
-
const y =
|
|
1913
|
+
if (l = Math.max(0, Math.min(l, r.length)), r.splice(l, 0, m), i && i.type === "grid") {
|
|
1914
|
+
const y = i.layout || 24;
|
|
1884
1915
|
(u.list !== r || m.gridSpan == null) && (m.gridSpan = y);
|
|
1885
1916
|
} else
|
|
1886
1917
|
delete m.gridSpan;
|
|
1887
1918
|
this.selectedId = m.id;
|
|
1888
1919
|
},
|
|
1889
1920
|
removeWidget(e) {
|
|
1890
|
-
this.commit(),
|
|
1921
|
+
this.commit(), We(this.widgets, e), this.selectedId === e && (this.selectedId = null);
|
|
1891
1922
|
},
|
|
1892
1923
|
moveSibling(e, n) {
|
|
1893
1924
|
const o = (r) => {
|
|
@@ -1900,11 +1931,11 @@ const G = Ze("designer", {
|
|
|
1900
1931
|
return null;
|
|
1901
1932
|
}, s = o(this.widgets);
|
|
1902
1933
|
if (!s) return;
|
|
1903
|
-
const
|
|
1904
|
-
if (
|
|
1934
|
+
const i = s.findIndex((r) => r.id === e), a = i + n;
|
|
1935
|
+
if (a < 0 || a >= s.length) return;
|
|
1905
1936
|
this.commit();
|
|
1906
|
-
const [u] = s.splice(
|
|
1907
|
-
s.splice(
|
|
1937
|
+
const [u] = s.splice(i, 1);
|
|
1938
|
+
s.splice(a, 0, u);
|
|
1908
1939
|
},
|
|
1909
1940
|
updateNode(e, n) {
|
|
1910
1941
|
const o = Q(this.widgets, e);
|
|
@@ -1920,17 +1951,17 @@ const G = Ze("designer", {
|
|
|
1920
1951
|
},
|
|
1921
1952
|
/** 将 draggingId 控件移动到 targetId(容器)或根 */
|
|
1922
1953
|
dropTo(e) {
|
|
1923
|
-
var
|
|
1954
|
+
var i;
|
|
1924
1955
|
const n = this.draggingId;
|
|
1925
1956
|
if (!n || n === e) return;
|
|
1926
1957
|
this.commit();
|
|
1927
|
-
const o = (
|
|
1928
|
-
const u =
|
|
1958
|
+
const o = (a) => {
|
|
1959
|
+
const u = a.findIndex((r) => r.id === n);
|
|
1929
1960
|
if (u >= 0) {
|
|
1930
|
-
const [r] =
|
|
1961
|
+
const [r] = a.splice(u, 1);
|
|
1931
1962
|
return r;
|
|
1932
1963
|
}
|
|
1933
|
-
for (const r of
|
|
1964
|
+
for (const r of a)
|
|
1934
1965
|
if (r.children) {
|
|
1935
1966
|
const l = o(r.children);
|
|
1936
1967
|
if (l) return l;
|
|
@@ -1942,14 +1973,14 @@ const G = Ze("designer", {
|
|
|
1942
1973
|
return;
|
|
1943
1974
|
}
|
|
1944
1975
|
if (e) {
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1976
|
+
const a = Q(this.widgets, e);
|
|
1977
|
+
a && ((i = X(a.type)) != null && i.isContainer) ? (a.children = a.children || [], a.children.push(s)) : this.widgets.push(s);
|
|
1947
1978
|
} else
|
|
1948
1979
|
this.widgets.push(s);
|
|
1949
1980
|
this.draggingId = null, this.selectedId = s.id;
|
|
1950
1981
|
},
|
|
1951
1982
|
loadSchema(e) {
|
|
1952
|
-
this.formId = e.formId, this.dbtable = e.dbtable, this.fields = e.fields, this.widgets =
|
|
1983
|
+
this.formId = e.formId, this.dbtable = e.dbtable, this.fields = e.fields, this.widgets = ee(e.widgets), this.events = e.events ? ee(e.events) : { lifecycle: {}, custom: [] }, this.selectedId = null, this.selectedForm = !1, this.past = [], this.future = [];
|
|
1953
1984
|
},
|
|
1954
1985
|
/**
|
|
1955
1986
|
* 导入(「导入」按钮):仅用导入 JSON 的表单结构(控件树 + 事件)覆盖当前设计,
|
|
@@ -1959,7 +1990,7 @@ const G = Ze("designer", {
|
|
|
1959
1990
|
* importSchema 只换表单 JSON,不动业务对象与字段。
|
|
1960
1991
|
*/
|
|
1961
1992
|
importSchema(e) {
|
|
1962
|
-
this.widgets =
|
|
1993
|
+
this.widgets = ee(e.widgets ?? []), this.events = e.events ? ee(e.events) : this.events, this.selectedId = null, this.selectedForm = !1, this.past = [], this.future = [];
|
|
1963
1994
|
},
|
|
1964
1995
|
toSchema() {
|
|
1965
1996
|
return {
|
|
@@ -1967,7 +1998,7 @@ const G = Ze("designer", {
|
|
|
1967
1998
|
dbtable: this.dbtable,
|
|
1968
1999
|
fields: this.fields,
|
|
1969
2000
|
widgets: this.widgets,
|
|
1970
|
-
events:
|
|
2001
|
+
events: ee(this.events)
|
|
1971
2002
|
};
|
|
1972
2003
|
},
|
|
1973
2004
|
/**
|
|
@@ -2005,26 +2036,26 @@ const G = Ze("designer", {
|
|
|
2005
2036
|
return;
|
|
2006
2037
|
}
|
|
2007
2038
|
this.originFormId = e;
|
|
2008
|
-
const s = await
|
|
2039
|
+
const s = await Ks({ openType: o, id: e, formVersion: n });
|
|
2009
2040
|
this.workFormId = s.newFormID, this.formId = s.newFormID;
|
|
2010
|
-
const
|
|
2011
|
-
this.attribute =
|
|
2012
|
-
const
|
|
2013
|
-
this.dbtable =
|
|
2014
|
-
const r = this.enrichFields((u.fields ?? []).map(
|
|
2015
|
-
this.setFields(r), this.setSubTables(
|
|
2016
|
-
const l =
|
|
2041
|
+
const i = await Qs(s.newFormID);
|
|
2042
|
+
this.attribute = i.attribute ?? {}, this.formName = this.attribute.name ?? "", this.device = i.templateType === "App" ? "mobile" : "pc";
|
|
2043
|
+
const a = this.attribute.dbtable || "", u = await Xs(a, s.newFormID);
|
|
2044
|
+
this.dbtable = a || u.dbtable;
|
|
2045
|
+
const r = this.enrichFields((u.fields ?? []).map(sl));
|
|
2046
|
+
this.setFields(r), this.setSubTables(il(u.subtables, this.dbtable));
|
|
2047
|
+
const l = al(i.json);
|
|
2017
2048
|
l && Array.isArray(l.widgets) ? this.loadSchema({
|
|
2018
2049
|
...l,
|
|
2019
2050
|
formId: s.newFormID,
|
|
2020
|
-
templateType:
|
|
2051
|
+
templateType: i.templateType,
|
|
2021
2052
|
dbtable: this.dbtable,
|
|
2022
2053
|
fields: r,
|
|
2023
2054
|
widgets: l.widgets,
|
|
2024
2055
|
events: l.events ?? { lifecycle: {}, custom: [] }
|
|
2025
2056
|
}) : (this.noticeMsg = "未能解析表单模板(老设计器 HTML 模板或空模板),已加载为空表单:字段与子表可正常绑定,请手动设计后保存", this.loadSchema({
|
|
2026
2057
|
formId: s.newFormID,
|
|
2027
|
-
templateType:
|
|
2058
|
+
templateType: i.templateType,
|
|
2028
2059
|
dbtable: this.dbtable,
|
|
2029
2060
|
fields: r,
|
|
2030
2061
|
widgets: [],
|
|
@@ -2044,15 +2075,15 @@ const G = Ze("designer", {
|
|
|
2044
2075
|
enrichFields(e) {
|
|
2045
2076
|
const n = this.attribute.settings ?? {}, o = (s) => s === !0 || s === "true" || s === "1";
|
|
2046
2077
|
return e.map((s) => {
|
|
2047
|
-
const
|
|
2048
|
-
return
|
|
2078
|
+
const i = n[s.name];
|
|
2079
|
+
return i ? o(i.isdatetime) ? { ...s, dataType: "date" } : o(i.ismoney) ? { ...s, dataType: "money" } : s : s;
|
|
2049
2080
|
});
|
|
2050
2081
|
},
|
|
2051
2082
|
/** 保存:保存到工作表单(opendesigner 返回的临时记录,Status=4 → 后端同步回写版本行) */
|
|
2052
2083
|
async save() {
|
|
2053
2084
|
this.errorMsg = "";
|
|
2054
2085
|
try {
|
|
2055
|
-
return await
|
|
2086
|
+
return await Zs({
|
|
2056
2087
|
id: this.workFormId,
|
|
2057
2088
|
name: this.formName,
|
|
2058
2089
|
att: this.attJson,
|
|
@@ -2073,7 +2104,7 @@ const G = Ze("designer", {
|
|
|
2073
2104
|
async saveAs(e, n, o = "start") {
|
|
2074
2105
|
this.errorMsg = "";
|
|
2075
2106
|
try {
|
|
2076
|
-
return await
|
|
2107
|
+
return await tl({ id: this.workFormId, name: e, code: n, saveSelect: o });
|
|
2077
2108
|
} catch (s) {
|
|
2078
2109
|
throw this.errorMsg = `另存为失败:${ae(s)}`, s;
|
|
2079
2110
|
}
|
|
@@ -2082,7 +2113,7 @@ const G = Ze("designer", {
|
|
|
2082
2113
|
async publish(e = "") {
|
|
2083
2114
|
this.errorMsg = "";
|
|
2084
2115
|
try {
|
|
2085
|
-
return await
|
|
2116
|
+
return await el({
|
|
2086
2117
|
id: this.workFormId,
|
|
2087
2118
|
name: this.formName,
|
|
2088
2119
|
att: this.attJson,
|
|
@@ -2101,19 +2132,19 @@ const G = Ze("designer", {
|
|
|
2101
2132
|
async checkPublish() {
|
|
2102
2133
|
this.errorMsg = "";
|
|
2103
2134
|
try {
|
|
2104
|
-
const e = await
|
|
2135
|
+
const e = await nl(this.originFormId);
|
|
2105
2136
|
return { needConfirm: e.result || e.count > 0, count: e.count };
|
|
2106
2137
|
} catch (e) {
|
|
2107
2138
|
throw this.errorMsg = `发布检查失败:${ae(e)}`, e;
|
|
2108
2139
|
}
|
|
2109
2140
|
}
|
|
2110
2141
|
}
|
|
2111
|
-
}),
|
|
2112
|
-
function
|
|
2113
|
-
localStorage.setItem(
|
|
2142
|
+
}), He = "fd:form:";
|
|
2143
|
+
function dl(e, n) {
|
|
2144
|
+
localStorage.setItem(He + e, JSON.stringify(n));
|
|
2114
2145
|
}
|
|
2115
|
-
function
|
|
2116
|
-
const n = localStorage.getItem(
|
|
2146
|
+
function pa(e) {
|
|
2147
|
+
const n = localStorage.getItem(He + e);
|
|
2117
2148
|
if (!n) return null;
|
|
2118
2149
|
try {
|
|
2119
2150
|
return JSON.parse(n);
|
|
@@ -2121,8 +2152,8 @@ function oi(e) {
|
|
|
2121
2152
|
return null;
|
|
2122
2153
|
}
|
|
2123
2154
|
}
|
|
2124
|
-
const
|
|
2125
|
-
function
|
|
2155
|
+
const rl = "fdFireEvent";
|
|
2156
|
+
function Pe(e, n = {}) {
|
|
2126
2157
|
if (!(!e || !e.trim()))
|
|
2127
2158
|
try {
|
|
2128
2159
|
return new Function("ctx", `"use strict";
|
|
@@ -2132,7 +2163,7 @@ ${e}`)(n);
|
|
|
2132
2163
|
return;
|
|
2133
2164
|
}
|
|
2134
2165
|
}
|
|
2135
|
-
function
|
|
2166
|
+
function ul(e) {
|
|
2136
2167
|
if (!(!e || !e.trim() || typeof document > "u"))
|
|
2137
2168
|
try {
|
|
2138
2169
|
const n = document.createElement("script");
|
|
@@ -2141,7 +2172,7 @@ function ll(e) {
|
|
|
2141
2172
|
console.error("[form-designer] 自定义方法挂载失败:", n);
|
|
2142
2173
|
}
|
|
2143
2174
|
}
|
|
2144
|
-
const
|
|
2175
|
+
const cl = { class: "fd-renderer" }, fl = /* @__PURE__ */ N({
|
|
2145
2176
|
__name: "Renderer",
|
|
2146
2177
|
props: {
|
|
2147
2178
|
widgets: {},
|
|
@@ -2158,51 +2189,51 @@ const al = { class: "fd-renderer" }, il = /* @__PURE__ */ E({
|
|
|
2158
2189
|
return !r || r.length === 0 ? !0 : o.formMode ? r.includes(o.formMode) : !0;
|
|
2159
2190
|
})
|
|
2160
2191
|
);
|
|
2161
|
-
function
|
|
2192
|
+
function i(u) {
|
|
2162
2193
|
var l;
|
|
2163
2194
|
const r = (l = o.events) == null ? void 0 : l.lifecycle[u];
|
|
2164
|
-
|
|
2195
|
+
Pe(r, { formData: o.formData, event: u });
|
|
2165
2196
|
}
|
|
2166
|
-
function
|
|
2197
|
+
function a(u, r) {
|
|
2167
2198
|
var m;
|
|
2168
2199
|
const l = (m = o.events) == null ? void 0 : m.custom.find((p) => p.name === u);
|
|
2169
|
-
l &&
|
|
2200
|
+
l && Pe(l.handler, { formData: o.formData, event: u, payload: r });
|
|
2170
2201
|
}
|
|
2171
|
-
return
|
|
2202
|
+
return Ke(rl, a), ve(() => {
|
|
2172
2203
|
var u;
|
|
2173
|
-
|
|
2174
|
-
}),
|
|
2204
|
+
i("onLoad"), i("onMounted"), ul((u = o.events) == null ? void 0 : u.lifecycle.custom);
|
|
2205
|
+
}), ue(
|
|
2175
2206
|
() => o.formData,
|
|
2176
|
-
() =>
|
|
2207
|
+
() => i("onValueChange"),
|
|
2177
2208
|
{ deep: !0 }
|
|
2178
|
-
), n({ fireEvent:
|
|
2179
|
-
(d(!0), c(
|
|
2209
|
+
), n({ fireEvent: a, runLifecycle: i }), (u, r) => (d(), c("div", cl, [
|
|
2210
|
+
(d(!0), c(L, null, E(s.value, (l) => (d(), R(Ce, {
|
|
2180
2211
|
key: l.id,
|
|
2181
2212
|
node: l,
|
|
2182
2213
|
mode: "render",
|
|
2183
2214
|
"form-mode": e.formMode,
|
|
2184
2215
|
"form-data": e.formData,
|
|
2185
2216
|
"form-id": e.formId
|
|
2186
|
-
},
|
|
2187
|
-
|
|
2217
|
+
}, ce({ _: 2 }, [
|
|
2218
|
+
E(u.$slots, (m, p) => ({
|
|
2188
2219
|
name: p,
|
|
2189
|
-
fn:
|
|
2190
|
-
|
|
2220
|
+
fn: A((y) => [
|
|
2221
|
+
Z(u.$slots, p, he({ ref_for: !0 }, y || {}), void 0, !0)
|
|
2191
2222
|
])
|
|
2192
2223
|
}))
|
|
2193
2224
|
]), 1032, ["node", "form-mode", "form-data", "form-id"]))), 128))
|
|
2194
2225
|
]));
|
|
2195
2226
|
}
|
|
2196
|
-
}),
|
|
2227
|
+
}), Ge = /* @__PURE__ */ P(fl, [["__scopeId", "data-v-82088c12"]]), ml = { class: "fd-tree" }, pl = { class: "fd-tree-head" }, vl = {
|
|
2197
2228
|
key: 0,
|
|
2198
2229
|
class: "fd-tree-count"
|
|
2199
|
-
},
|
|
2230
|
+
}, bl = {
|
|
2200
2231
|
key: 0,
|
|
2201
2232
|
class: "fd-tree-empty"
|
|
2202
|
-
},
|
|
2233
|
+
}, gl = { class: "fd-tree-name" }, hl = ["title"], yl = /* @__PURE__ */ N({
|
|
2203
2234
|
__name: "ComponentTree",
|
|
2204
2235
|
setup(e) {
|
|
2205
|
-
const n =
|
|
2236
|
+
const n = Y();
|
|
2206
2237
|
function o(u) {
|
|
2207
2238
|
var p;
|
|
2208
2239
|
const r = X(u.type), l = u.label, m = (r == null ? void 0 : r.title) ?? u.type;
|
|
@@ -2214,22 +2245,22 @@ const al = { class: "fd-renderer" }, il = /* @__PURE__ */ E({
|
|
|
2214
2245
|
children: (p = u.children) == null ? void 0 : p.map(o)
|
|
2215
2246
|
};
|
|
2216
2247
|
}
|
|
2217
|
-
const s = M(() => n.widgets.map(o)),
|
|
2248
|
+
const s = M(() => n.widgets.map(o)), i = M(() => {
|
|
2218
2249
|
const u = (r) => r.reduce((l, m) => l + 1 + u(m.children ?? []), 0);
|
|
2219
2250
|
return u(n.widgets);
|
|
2220
2251
|
});
|
|
2221
|
-
function
|
|
2222
|
-
n.select(u.id),
|
|
2252
|
+
function a(u) {
|
|
2253
|
+
n.select(u.id), Be(() => {
|
|
2223
2254
|
var r;
|
|
2224
2255
|
(r = document.querySelector(".fd-canvas-node.is-selected")) == null || r.scrollIntoView({ block: "nearest" });
|
|
2225
2256
|
});
|
|
2226
2257
|
}
|
|
2227
|
-
return (u, r) => (d(), c("div",
|
|
2228
|
-
t("div",
|
|
2229
|
-
r[0] || (r[0] =
|
|
2230
|
-
|
|
2258
|
+
return (u, r) => (d(), c("div", ml, [
|
|
2259
|
+
t("div", pl, [
|
|
2260
|
+
r[0] || (r[0] = $e('<svg class="fd-tree-head-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-e38c14ec><rect x="3" y="3" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="3" y="14" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="14" y="14" width="7" height="7" rx="1" data-v-e38c14ec></rect></svg><span class="fd-tree-title" data-v-e38c14ec>组件树</span>', 2)),
|
|
2261
|
+
i.value ? (d(), c("span", vl, k(i.value), 1)) : T("", !0)
|
|
2231
2262
|
]),
|
|
2232
|
-
|
|
2263
|
+
i.value ? (d(), R(h(nt), {
|
|
2233
2264
|
key: 1,
|
|
2234
2265
|
class: "fd-tree-el",
|
|
2235
2266
|
data: s.value,
|
|
@@ -2239,18 +2270,18 @@ const al = { class: "fd-renderer" }, il = /* @__PURE__ */ E({
|
|
|
2239
2270
|
"default-expand-all": "",
|
|
2240
2271
|
"show-line": "",
|
|
2241
2272
|
"expand-on-click-node": !1,
|
|
2242
|
-
onNodeClick:
|
|
2273
|
+
onNodeClick: a
|
|
2243
2274
|
}, {
|
|
2244
|
-
default:
|
|
2245
|
-
t("span",
|
|
2275
|
+
default: A(({ data: l }) => [
|
|
2276
|
+
t("span", gl, k(l.name), 1),
|
|
2246
2277
|
l.sub ? (d(), c("span", {
|
|
2247
2278
|
key: 0,
|
|
2248
2279
|
class: "fd-tree-sub",
|
|
2249
2280
|
title: l.sub
|
|
2250
|
-
}, k(l.sub), 9,
|
|
2281
|
+
}, k(l.sub), 9, hl)) : T("", !0)
|
|
2251
2282
|
]),
|
|
2252
2283
|
_: 1
|
|
2253
|
-
}, 8, ["data", "current-node-key"])) : (d(), c("div",
|
|
2284
|
+
}, 8, ["data", "current-node-key"])) : (d(), c("div", bl, [...r[1] || (r[1] = [
|
|
2254
2285
|
t("svg", {
|
|
2255
2286
|
viewBox: "0 0 24 24",
|
|
2256
2287
|
fill: "none",
|
|
@@ -2272,8 +2303,8 @@ const al = { class: "fd-renderer" }, il = /* @__PURE__ */ E({
|
|
|
2272
2303
|
])]))
|
|
2273
2304
|
]));
|
|
2274
2305
|
}
|
|
2275
|
-
}),
|
|
2276
|
-
var
|
|
2306
|
+
}), kl = /* @__PURE__ */ P(yl, [["__scopeId", "data-v-e38c14ec"]]);
|
|
2307
|
+
var wl = {
|
|
2277
2308
|
name: "zh-cn",
|
|
2278
2309
|
el: {
|
|
2279
2310
|
breadcrumb: { label: "面包屑" },
|
|
@@ -2455,10 +2486,10 @@ var bl = {
|
|
|
2455
2486
|
}
|
|
2456
2487
|
}
|
|
2457
2488
|
};
|
|
2458
|
-
const
|
|
2489
|
+
const $l = { class: "fd-publish-tip" }, xl = { class: "fd-publish-tip-text" }, Cl = { class: "fd-publish-toolbar" }, _l = { class: "fd-publish-table-wrap" }, Il = { class: "fd-publish-table" }, Sl = ["title"], Dl = ["href", "title"], Tl = ["title"], Ll = ["title"], Fl = {
|
|
2459
2490
|
key: 1,
|
|
2460
2491
|
class: "fd-publish-error"
|
|
2461
|
-
},
|
|
2492
|
+
}, Nl = { class: "fd-publish-pager" }, Ml = /* @__PURE__ */ N({
|
|
2462
2493
|
__name: "PublishConfirmDialog",
|
|
2463
2494
|
props: {
|
|
2464
2495
|
modelValue: { type: Boolean },
|
|
@@ -2467,77 +2498,77 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2467
2498
|
},
|
|
2468
2499
|
emits: ["update:modelValue", "confirm"],
|
|
2469
2500
|
setup(e, { emit: n }) {
|
|
2470
|
-
const o =
|
|
2501
|
+
const o = ot.directive, s = e, i = n, a = O(!1), u = O(""), r = O(""), l = O(1), m = O(10), p = O(0), y = O([]);
|
|
2471
2502
|
async function C() {
|
|
2472
2503
|
if (s.formId) {
|
|
2473
|
-
|
|
2504
|
+
a.value = !0, u.value = "";
|
|
2474
2505
|
try {
|
|
2475
|
-
const
|
|
2506
|
+
const D = await ol({
|
|
2476
2507
|
id: s.formId,
|
|
2477
2508
|
processName: r.value,
|
|
2478
2509
|
page: l.value,
|
|
2479
2510
|
pageSize: m.value
|
|
2480
2511
|
});
|
|
2481
|
-
y.value =
|
|
2482
|
-
} catch (
|
|
2483
|
-
y.value = [], p.value = 0, u.value = ae(
|
|
2512
|
+
y.value = D.items ?? [], p.value = D.total ?? 0;
|
|
2513
|
+
} catch (D) {
|
|
2514
|
+
y.value = [], p.value = 0, u.value = ae(D);
|
|
2484
2515
|
} finally {
|
|
2485
|
-
|
|
2516
|
+
a.value = !1;
|
|
2486
2517
|
}
|
|
2487
2518
|
}
|
|
2488
2519
|
}
|
|
2489
|
-
|
|
2520
|
+
ue(
|
|
2490
2521
|
() => s.modelValue,
|
|
2491
|
-
(
|
|
2492
|
-
|
|
2522
|
+
(D) => {
|
|
2523
|
+
D && (r.value = "", l.value = 1, C());
|
|
2493
2524
|
}
|
|
2494
|
-
),
|
|
2525
|
+
), ue(r, () => {
|
|
2495
2526
|
l.value = 1, C();
|
|
2496
|
-
}),
|
|
2527
|
+
}), ue(l, () => C());
|
|
2497
2528
|
function B() {
|
|
2498
|
-
|
|
2529
|
+
i("update:modelValue", !1);
|
|
2499
2530
|
}
|
|
2500
2531
|
function _() {
|
|
2501
|
-
|
|
2532
|
+
i("confirm");
|
|
2502
2533
|
}
|
|
2503
|
-
return (
|
|
2504
|
-
default:
|
|
2505
|
-
|
|
2534
|
+
return (D, v) => (d(), R(h(st), { locale: h(wl) }, {
|
|
2535
|
+
default: A(() => [
|
|
2536
|
+
F(h(lt), {
|
|
2506
2537
|
"model-value": e.modelValue,
|
|
2507
2538
|
title: "发布确认",
|
|
2508
2539
|
width: "70rem",
|
|
2509
2540
|
"close-on-click-modal": !1,
|
|
2510
|
-
"onUpdate:modelValue": v[3] || (v[3] = (g) =>
|
|
2541
|
+
"onUpdate:modelValue": v[3] || (v[3] = (g) => i("update:modelValue", g))
|
|
2511
2542
|
}, {
|
|
2512
|
-
footer:
|
|
2513
|
-
|
|
2514
|
-
default:
|
|
2543
|
+
footer: A(() => [
|
|
2544
|
+
F(h(Fe), { onClick: B }, {
|
|
2545
|
+
default: A(() => [...v[9] || (v[9] = [
|
|
2515
2546
|
U("取消", -1)
|
|
2516
2547
|
])]),
|
|
2517
2548
|
_: 1
|
|
2518
2549
|
}),
|
|
2519
|
-
|
|
2550
|
+
F(h(Fe), {
|
|
2520
2551
|
type: "primary",
|
|
2521
|
-
disabled:
|
|
2552
|
+
disabled: a.value,
|
|
2522
2553
|
onClick: _
|
|
2523
2554
|
}, {
|
|
2524
|
-
default:
|
|
2555
|
+
default: A(() => [...v[10] || (v[10] = [
|
|
2525
2556
|
U("确认发布", -1)
|
|
2526
2557
|
])]),
|
|
2527
2558
|
_: 1
|
|
2528
2559
|
}, 8, ["disabled"])
|
|
2529
2560
|
]),
|
|
2530
|
-
default:
|
|
2531
|
-
t("div",
|
|
2561
|
+
default: A(() => [
|
|
2562
|
+
t("div", $l, [
|
|
2532
2563
|
v[6] || (v[6] = t("span", { class: "fd-publish-tip-icon" }, "!", -1)),
|
|
2533
|
-
t("span",
|
|
2564
|
+
t("span", xl, [
|
|
2534
2565
|
v[4] || (v[4] = U(" 该表单正在被 ", -1)),
|
|
2535
2566
|
t("b", null, k(e.count), 1),
|
|
2536
2567
|
v[5] || (v[5] = U(" 个流程使用,发布后将影响以下流程,确定发布? ", -1))
|
|
2537
2568
|
])
|
|
2538
2569
|
]),
|
|
2539
|
-
t("div",
|
|
2540
|
-
|
|
2570
|
+
t("div", Cl, [
|
|
2571
|
+
F(h(it), {
|
|
2541
2572
|
modelValue: r.value,
|
|
2542
2573
|
"onUpdate:modelValue": v[0] || (v[0] = (g) => r.value = g),
|
|
2543
2574
|
placeholder: "输入流程名搜索",
|
|
@@ -2545,8 +2576,8 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2545
2576
|
class: "fd-publish-search"
|
|
2546
2577
|
}, null, 8, ["modelValue"])
|
|
2547
2578
|
]),
|
|
2548
|
-
|
|
2549
|
-
t("table",
|
|
2579
|
+
de((d(), c("div", _l, [
|
|
2580
|
+
t("table", Il, [
|
|
2550
2581
|
v[7] || (v[7] = t("colgroup", null, [
|
|
2551
2582
|
t("col", { style: { width: "24%" } }),
|
|
2552
2583
|
t("col", { style: { width: "40%" } }),
|
|
@@ -2560,12 +2591,12 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2560
2591
|
])
|
|
2561
2592
|
], -1)),
|
|
2562
2593
|
t("tbody", null, [
|
|
2563
|
-
(d(!0), c(
|
|
2594
|
+
(d(!0), c(L, null, E(y.value, (g) => (d(), c("tr", {
|
|
2564
2595
|
key: g.templateId || g.formId
|
|
2565
2596
|
}, [
|
|
2566
2597
|
t("td", {
|
|
2567
2598
|
title: g.formNameCN || g.formCode
|
|
2568
|
-
}, k(g.formNameCN || g.formCode), 9,
|
|
2599
|
+
}, k(g.formNameCN || g.formCode), 9, Sl),
|
|
2569
2600
|
t("td", null, [
|
|
2570
2601
|
g.templateUrl ? (d(), c("a", {
|
|
2571
2602
|
key: 0,
|
|
@@ -2574,29 +2605,29 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2574
2605
|
target: "_blank",
|
|
2575
2606
|
rel: "noopener noreferrer",
|
|
2576
2607
|
title: g.templateName
|
|
2577
|
-
}, k(g.templateName), 9,
|
|
2608
|
+
}, k(g.templateName), 9, Dl)) : (d(), c("span", {
|
|
2578
2609
|
key: 1,
|
|
2579
2610
|
title: g.templateName
|
|
2580
|
-
}, k(g.templateName), 9,
|
|
2611
|
+
}, k(g.templateName), 9, Tl))
|
|
2581
2612
|
]),
|
|
2582
2613
|
t("td", {
|
|
2583
2614
|
class: "fd-publish-id",
|
|
2584
2615
|
title: g.templateId
|
|
2585
|
-
}, k(g.templateId), 9,
|
|
2616
|
+
}, k(g.templateId), 9, Ll)
|
|
2586
2617
|
]))), 128))
|
|
2587
2618
|
])
|
|
2588
2619
|
]),
|
|
2589
|
-
!y.value.length && !u.value && !
|
|
2620
|
+
!y.value.length && !u.value && !a.value ? (d(), R(h(at), {
|
|
2590
2621
|
key: 0,
|
|
2591
2622
|
description: "暂无可用流程模板",
|
|
2592
2623
|
"image-size": 60
|
|
2593
2624
|
})) : T("", !0),
|
|
2594
|
-
!y.value.length && u.value ? (d(), c("div",
|
|
2625
|
+
!y.value.length && u.value ? (d(), c("div", Fl, k(u.value), 1)) : T("", !0)
|
|
2595
2626
|
])), [
|
|
2596
|
-
[h(o),
|
|
2627
|
+
[h(o), a.value]
|
|
2597
2628
|
]),
|
|
2598
|
-
t("div",
|
|
2599
|
-
|
|
2629
|
+
t("div", Nl, [
|
|
2630
|
+
F(h(dt), {
|
|
2600
2631
|
"current-page": l.value,
|
|
2601
2632
|
"onUpdate:currentPage": v[1] || (v[1] = (g) => l.value = g),
|
|
2602
2633
|
"page-size": m.value,
|
|
@@ -2614,57 +2645,57 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2614
2645
|
_: 1
|
|
2615
2646
|
}, 8, ["locale"]));
|
|
2616
2647
|
}
|
|
2617
|
-
}),
|
|
2648
|
+
}), El = /* @__PURE__ */ P(Ml, [["__scopeId", "data-v-6fdc08dc"]]), Pl = { class: "fd-toolbar" }, Ol = { class: "fd-toolbar-left flex-align-center" }, Ul = ["value"], Bl = { class: "fd-device" }, Rl = {
|
|
2618
2649
|
key: 0,
|
|
2619
2650
|
class: "is-active",
|
|
2620
2651
|
title: "移动端比例(由 URL 参数 templateType 决定)"
|
|
2621
|
-
},
|
|
2652
|
+
}, Vl = {
|
|
2622
2653
|
key: 1,
|
|
2623
2654
|
class: "is-active",
|
|
2624
2655
|
title: "电脑端比例(由 URL 参数 templateType 决定)"
|
|
2625
|
-
},
|
|
2656
|
+
}, Al = { class: "fd-toolbar-right flex-align-center" }, jl = ["disabled"], zl = ["disabled"], Jl = { class: "fd-dialog fd-dialog--preview" }, Wl = { class: "fd-dialog-head" }, Hl = { class: "fd-preview-width" }, Gl = { class: "fd-dialog-body bg" }, ql = { class: "fd-dialog" }, Yl = { class: "fd-dialog-head" }, Kl = ["value"], Ql = { class: "fd-dialog" }, Xl = { class: "fd-dialog-head" }, Zl = { class: "fd-dialog-body" }, ei = /* @__PURE__ */ N({
|
|
2626
2657
|
__name: "Toolbar",
|
|
2627
2658
|
setup(e) {
|
|
2628
|
-
const n =
|
|
2629
|
-
function u(
|
|
2630
|
-
const
|
|
2631
|
-
return I &&
|
|
2659
|
+
const n = Y(), o = O(!1), s = O(!1), i = O(!1), a = O(!1);
|
|
2660
|
+
function u(S, f, I) {
|
|
2661
|
+
const z = [ge("p", { style: "margin:0" }, f)];
|
|
2662
|
+
return I && z.push(ge("p", { style: "margin:8px 0 0" }, I)), ut.alert(ge("div", z), S, { confirmButtonText: "知道了" });
|
|
2632
2663
|
}
|
|
2633
2664
|
const r = O(!1), l = O(0);
|
|
2634
2665
|
function m() {
|
|
2635
|
-
const
|
|
2636
|
-
return
|
|
2666
|
+
const S = new URLSearchParams(window.location.search).get("templateType") || "";
|
|
2667
|
+
return S === "mobile" || S === "2";
|
|
2637
2668
|
}
|
|
2638
2669
|
const p = O(m() ? 375 : 1200);
|
|
2639
2670
|
function y() {
|
|
2640
|
-
const
|
|
2641
|
-
p.value = Math.min(1200, Math.max(270, Number.isFinite(
|
|
2671
|
+
const S = Number(p.value);
|
|
2672
|
+
p.value = Math.min(1200, Math.max(270, Number.isFinite(S) ? S : 1200));
|
|
2642
2673
|
}
|
|
2643
|
-
|
|
2674
|
+
ue(
|
|
2644
2675
|
() => n.device,
|
|
2645
|
-
(
|
|
2646
|
-
p.value =
|
|
2676
|
+
(S) => {
|
|
2677
|
+
p.value = S === "mobile" ? 375 : 1200;
|
|
2647
2678
|
}
|
|
2648
2679
|
);
|
|
2649
2680
|
const C = O("");
|
|
2650
2681
|
function B() {
|
|
2651
|
-
const
|
|
2652
|
-
if (!
|
|
2653
|
-
|
|
2682
|
+
const S = C.value.trim();
|
|
2683
|
+
if (!S) {
|
|
2684
|
+
J.warning("请先粘贴表单 JSON");
|
|
2654
2685
|
return;
|
|
2655
2686
|
}
|
|
2656
2687
|
let f;
|
|
2657
2688
|
try {
|
|
2658
|
-
f = JSON.parse(
|
|
2689
|
+
f = JSON.parse(S);
|
|
2659
2690
|
} catch {
|
|
2660
|
-
|
|
2691
|
+
J.error("JSON 解析失败");
|
|
2661
2692
|
return;
|
|
2662
2693
|
}
|
|
2663
2694
|
if (!f || !Array.isArray(f.widgets)) {
|
|
2664
|
-
|
|
2695
|
+
J.error("JSON 格式不正确:缺少 widgets 数组");
|
|
2665
2696
|
return;
|
|
2666
2697
|
}
|
|
2667
|
-
n.importSchema(f), C.value = "",
|
|
2698
|
+
n.importSchema(f), C.value = "", a.value = !1;
|
|
2668
2699
|
}
|
|
2669
2700
|
const _ = M(
|
|
2670
2701
|
() => JSON.stringify(
|
|
@@ -2672,11 +2703,11 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2672
2703
|
null,
|
|
2673
2704
|
2
|
|
2674
2705
|
)
|
|
2675
|
-
),
|
|
2706
|
+
), D = O("");
|
|
2676
2707
|
let v;
|
|
2677
|
-
function g(
|
|
2708
|
+
function g(S) {
|
|
2678
2709
|
const f = document.createElement("textarea");
|
|
2679
|
-
f.value =
|
|
2710
|
+
f.value = S, f.style.position = "fixed", f.style.top = "-9999px", f.style.opacity = "0", document.body.appendChild(f), f.select();
|
|
2680
2711
|
let I = !1;
|
|
2681
2712
|
try {
|
|
2682
2713
|
I = document.execCommand("copy");
|
|
@@ -2689,64 +2720,64 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2689
2720
|
}
|
|
2690
2721
|
async function $() {
|
|
2691
2722
|
var f;
|
|
2692
|
-
let
|
|
2723
|
+
let S = !1;
|
|
2693
2724
|
try {
|
|
2694
|
-
(f = navigator.clipboard) != null && f.writeText ? (await navigator.clipboard.writeText(_.value),
|
|
2725
|
+
(f = navigator.clipboard) != null && f.writeText ? (await navigator.clipboard.writeText(_.value), S = !0) : S = g(_.value);
|
|
2695
2726
|
} catch {
|
|
2696
|
-
|
|
2727
|
+
S = g(_.value);
|
|
2697
2728
|
}
|
|
2698
|
-
|
|
2699
|
-
|
|
2729
|
+
D.value = S ? "已复制" : "复制失败", window.clearTimeout(v), v = window.setTimeout(() => {
|
|
2730
|
+
D.value = "";
|
|
2700
2731
|
}, 1500);
|
|
2701
2732
|
}
|
|
2702
|
-
const
|
|
2703
|
-
const
|
|
2733
|
+
const V = M(() => {
|
|
2734
|
+
const S = {};
|
|
2704
2735
|
n.fields.forEach((I) => {
|
|
2705
|
-
|
|
2736
|
+
S[I.name] = I.name;
|
|
2706
2737
|
});
|
|
2707
|
-
const f = (I,
|
|
2708
|
-
var
|
|
2709
|
-
H.type === "subtable" &&
|
|
2710
|
-
}),
|
|
2738
|
+
const f = (I, z) => (I.forEach((H) => {
|
|
2739
|
+
var Le;
|
|
2740
|
+
H.type === "subtable" && z.push(H), (Le = H.children) != null && Le.length && f(H.children, z);
|
|
2741
|
+
}), z);
|
|
2711
2742
|
return f(n.widgets, []).forEach((I) => {
|
|
2712
2743
|
if (I.type !== "subtable" || !I.secondtable) return;
|
|
2713
|
-
const
|
|
2744
|
+
const z = {};
|
|
2714
2745
|
(I.colnums ?? []).forEach((H) => {
|
|
2715
|
-
|
|
2716
|
-
}),
|
|
2717
|
-
}),
|
|
2746
|
+
z[H.name] = H.name, H.bindLink && (z[H.bindLink] = H.bindLink);
|
|
2747
|
+
}), S[I.secondtable] = [z];
|
|
2748
|
+
}), S;
|
|
2718
2749
|
});
|
|
2719
|
-
async function
|
|
2750
|
+
async function K() {
|
|
2720
2751
|
if (!n.workFormId) {
|
|
2721
|
-
|
|
2752
|
+
J.warning("尚未打开表单,无法保存");
|
|
2722
2753
|
return;
|
|
2723
2754
|
}
|
|
2724
2755
|
if (!n.formName.trim()) {
|
|
2725
|
-
|
|
2756
|
+
J.warning("请先填写表单名称(保存必填)");
|
|
2726
2757
|
return;
|
|
2727
2758
|
}
|
|
2728
2759
|
try {
|
|
2729
|
-
const
|
|
2730
|
-
|
|
2760
|
+
const S = await n.save();
|
|
2761
|
+
S.success ? (dl(n.formId, n.toSchema()), u("保存成功", S.message, `工作表单 ID:${n.workFormId}`)) : J.error(`保存失败:${S.message}`);
|
|
2731
2762
|
} catch {
|
|
2732
|
-
|
|
2763
|
+
J.error(n.errorMsg || "保存失败");
|
|
2733
2764
|
}
|
|
2734
2765
|
}
|
|
2735
2766
|
async function x() {
|
|
2736
|
-
var I,
|
|
2767
|
+
var I, z;
|
|
2737
2768
|
if (!n.workFormId) {
|
|
2738
|
-
|
|
2769
|
+
J.warning("尚未打开表单,无法另存为");
|
|
2739
2770
|
return;
|
|
2740
2771
|
}
|
|
2741
|
-
const
|
|
2742
|
-
if (!
|
|
2743
|
-
const f = (
|
|
2772
|
+
const S = (I = window.prompt("新表单名称", `${n.formName || "表单"} 副本`)) == null ? void 0 : I.trim();
|
|
2773
|
+
if (!S) return;
|
|
2774
|
+
const f = (z = window.prompt("新表单编码(如 SG_ZL_YYQHTSP,_M 结尾为移动端模板)", "")) == null ? void 0 : z.trim();
|
|
2744
2775
|
if (f)
|
|
2745
2776
|
try {
|
|
2746
|
-
const H = await n.saveAs(
|
|
2747
|
-
H.success ? u("另存为成功", H.message, `新表单 ID:${H.newFormID}`) :
|
|
2777
|
+
const H = await n.saveAs(S, f);
|
|
2778
|
+
H.success ? u("另存为成功", H.message, `新表单 ID:${H.newFormID}`) : J.error(`另存为失败:${H.message}`);
|
|
2748
2779
|
} catch {
|
|
2749
|
-
|
|
2780
|
+
J.error(n.errorMsg || "另存为失败");
|
|
2750
2781
|
}
|
|
2751
2782
|
}
|
|
2752
2783
|
function b() {
|
|
@@ -2754,55 +2785,55 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2754
2785
|
}
|
|
2755
2786
|
async function w() {
|
|
2756
2787
|
if (!n.workFormId) {
|
|
2757
|
-
|
|
2788
|
+
J.warning("尚未打开表单,无法发布");
|
|
2758
2789
|
return;
|
|
2759
2790
|
}
|
|
2760
2791
|
if (!n.formName.trim()) {
|
|
2761
|
-
|
|
2792
|
+
J.warning("请先填写表单名称(发布必填)");
|
|
2762
2793
|
return;
|
|
2763
2794
|
}
|
|
2764
2795
|
try {
|
|
2765
|
-
const { needConfirm:
|
|
2766
|
-
if (
|
|
2796
|
+
const { needConfirm: S, count: f } = await n.checkPublish();
|
|
2797
|
+
if (S) {
|
|
2767
2798
|
l.value = f, r.value = !0;
|
|
2768
2799
|
return;
|
|
2769
2800
|
}
|
|
2770
2801
|
await W();
|
|
2771
2802
|
} catch {
|
|
2772
|
-
|
|
2803
|
+
J.error(n.errorMsg || "发布检查失败");
|
|
2773
2804
|
}
|
|
2774
2805
|
}
|
|
2775
2806
|
async function W() {
|
|
2776
2807
|
try {
|
|
2777
|
-
const
|
|
2778
|
-
|
|
2808
|
+
const S = await n.publish();
|
|
2809
|
+
S.success ? J.success(S.message) : J.error(`发布失败:${S.message}`);
|
|
2779
2810
|
} catch {
|
|
2780
|
-
|
|
2811
|
+
J.error(n.errorMsg || "发布失败");
|
|
2781
2812
|
}
|
|
2782
2813
|
}
|
|
2783
2814
|
async function se() {
|
|
2784
2815
|
r.value = !1, await W();
|
|
2785
2816
|
}
|
|
2786
|
-
const
|
|
2787
|
-
function
|
|
2788
|
-
var I,
|
|
2789
|
-
if (!
|
|
2790
|
-
const f =
|
|
2791
|
-
(I =
|
|
2792
|
-
}
|
|
2793
|
-
return
|
|
2794
|
-
document.removeEventListener("click",
|
|
2795
|
-
}), (
|
|
2796
|
-
t("div",
|
|
2817
|
+
const Se = O(null), De = O(null);
|
|
2818
|
+
function Te(S) {
|
|
2819
|
+
var I, z;
|
|
2820
|
+
if (!i.value) return;
|
|
2821
|
+
const f = S.target;
|
|
2822
|
+
(I = Se.value) != null && I.contains(f) || (z = De.value) != null && z.contains(f) || (i.value = !1);
|
|
2823
|
+
}
|
|
2824
|
+
return ve(() => document.addEventListener("click", Te)), Qe(() => {
|
|
2825
|
+
document.removeEventListener("click", Te), window.clearTimeout(v);
|
|
2826
|
+
}), (S, f) => (d(), c("div", Pl, [
|
|
2827
|
+
t("div", Ol, [
|
|
2797
2828
|
f[18] || (f[18] = t("span", { class: "fd-toolbar-title" }, "表单设计器", -1)),
|
|
2798
2829
|
t("input", {
|
|
2799
2830
|
class: "fd-toolbar-name",
|
|
2800
2831
|
value: h(n).formName,
|
|
2801
2832
|
placeholder: "表单名称(保存必填)",
|
|
2802
2833
|
onInput: f[0] || (f[0] = (I) => h(n).formName = I.target.value)
|
|
2803
|
-
}, null, 40,
|
|
2804
|
-
t("div",
|
|
2805
|
-
h(n).device === "mobile" ? (d(), c("button",
|
|
2834
|
+
}, null, 40, Ul),
|
|
2835
|
+
t("div", Bl, [
|
|
2836
|
+
h(n).device === "mobile" ? (d(), c("button", Rl, [...f[16] || (f[16] = [
|
|
2806
2837
|
t("svg", {
|
|
2807
2838
|
class: "fd-tool-btn-icon",
|
|
2808
2839
|
viewBox: "0 0 24 24",
|
|
@@ -2827,7 +2858,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2827
2858
|
})
|
|
2828
2859
|
], -1),
|
|
2829
2860
|
U(" 移动端 ", -1)
|
|
2830
|
-
])])) : (d(), c("button",
|
|
2861
|
+
])])) : (d(), c("button", Vl, [...f[17] || (f[17] = [
|
|
2831
2862
|
t("svg", {
|
|
2832
2863
|
class: "fd-tool-btn-icon",
|
|
2833
2864
|
viewBox: "0 0 24 24",
|
|
@@ -2861,7 +2892,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2861
2892
|
])]))
|
|
2862
2893
|
])
|
|
2863
2894
|
]),
|
|
2864
|
-
t("div",
|
|
2895
|
+
t("div", Al, [
|
|
2865
2896
|
t("button", {
|
|
2866
2897
|
class: "fd-tool-btn",
|
|
2867
2898
|
onClick: f[1] || (f[1] = (I) => o.value = !0)
|
|
@@ -2904,7 +2935,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2904
2935
|
])]),
|
|
2905
2936
|
t("button", {
|
|
2906
2937
|
class: "fd-tool-btn",
|
|
2907
|
-
onClick: f[3] || (f[3] = (I) =>
|
|
2938
|
+
onClick: f[3] || (f[3] = (I) => a.value = !0)
|
|
2908
2939
|
}, [...f[21] || (f[21] = [
|
|
2909
2940
|
t("svg", {
|
|
2910
2941
|
class: "fd-tool-btn-icon",
|
|
@@ -2946,7 +2977,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
2946
2977
|
])]),
|
|
2947
2978
|
t("button", {
|
|
2948
2979
|
class: "fd-tool-btn",
|
|
2949
|
-
onClick:
|
|
2980
|
+
onClick: K
|
|
2950
2981
|
}, [...f[23] || (f[23] = [
|
|
2951
2982
|
t("svg", {
|
|
2952
2983
|
class: "fd-tool-btn-icon",
|
|
@@ -3029,7 +3060,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3029
3060
|
t("polyline", { points: "9 14 4 9 9 4" }),
|
|
3030
3061
|
t("path", { d: "M20 20v-7a4 4 0 0 0-4-4H4" })
|
|
3031
3062
|
], -1)
|
|
3032
|
-
])], 8,
|
|
3063
|
+
])], 8, jl),
|
|
3033
3064
|
t("button", {
|
|
3034
3065
|
class: "fd-tool-btn fd-tool-icon-btn",
|
|
3035
3066
|
disabled: !h(n).canRedo,
|
|
@@ -3048,28 +3079,28 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3048
3079
|
t("polyline", { points: "15 14 20 9 15 4" }),
|
|
3049
3080
|
t("path", { d: "M4 20v-7a4 4 0 0 1 4-4h12" })
|
|
3050
3081
|
], -1)
|
|
3051
|
-
])], 8,
|
|
3082
|
+
])], 8, zl),
|
|
3052
3083
|
t("button", {
|
|
3053
3084
|
ref_key: "treeBtnRef",
|
|
3054
3085
|
ref: De,
|
|
3055
3086
|
class: "fd-tool-btn",
|
|
3056
|
-
onClick: f[6] || (f[6] = (I) =>
|
|
3087
|
+
onClick: f[6] || (f[6] = (I) => i.value = !i.value)
|
|
3057
3088
|
}, [...f[28] || (f[28] = [
|
|
3058
|
-
|
|
3089
|
+
$e('<svg class="fd-tool-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-da21485c><line x1="8" y1="6" x2="21" y2="6" data-v-da21485c></line><line x1="8" y1="12" x2="21" y2="12" data-v-da21485c></line><line x1="8" y1="18" x2="21" y2="18" data-v-da21485c></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-da21485c></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-da21485c></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-da21485c></line></svg> 组件树 ', 2)
|
|
3059
3090
|
])], 512)
|
|
3060
3091
|
]),
|
|
3061
|
-
(d(),
|
|
3092
|
+
(d(), R(we, { to: "body" }, [
|
|
3062
3093
|
o.value ? (d(), c("div", {
|
|
3063
3094
|
key: 0,
|
|
3064
3095
|
class: "fd-dialog-mask",
|
|
3065
|
-
onClick: f[9] || (f[9] =
|
|
3096
|
+
onClick: f[9] || (f[9] = G((I) => o.value = !1, ["self"]))
|
|
3066
3097
|
}, [
|
|
3067
|
-
t("div",
|
|
3068
|
-
t("div",
|
|
3098
|
+
t("div", Jl, [
|
|
3099
|
+
t("div", Wl, [
|
|
3069
3100
|
f[32] || (f[32] = t("span", null, "预览", -1)),
|
|
3070
|
-
t("div",
|
|
3101
|
+
t("div", Hl, [
|
|
3071
3102
|
f[30] || (f[30] = t("label", { for: "fd-preview-width-input" }, "宽度", -1)),
|
|
3072
|
-
|
|
3103
|
+
F(h(rt), {
|
|
3073
3104
|
id: "fd-preview-width-input",
|
|
3074
3105
|
modelValue: p.value,
|
|
3075
3106
|
"onUpdate:modelValue": f[7] || (f[7] = (I) => p.value = I),
|
|
@@ -3087,14 +3118,14 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3087
3118
|
onClick: f[8] || (f[8] = (I) => o.value = !1)
|
|
3088
3119
|
}, "关闭")
|
|
3089
3120
|
]),
|
|
3090
|
-
t("div",
|
|
3121
|
+
t("div", Gl, [
|
|
3091
3122
|
t("div", {
|
|
3092
3123
|
class: "fd-preview-stage",
|
|
3093
|
-
style:
|
|
3124
|
+
style: q({ width: p.value + "px" })
|
|
3094
3125
|
}, [
|
|
3095
|
-
|
|
3126
|
+
F(Ge, {
|
|
3096
3127
|
widgets: h(n).widgets,
|
|
3097
|
-
"form-data":
|
|
3128
|
+
"form-data": V.value
|
|
3098
3129
|
}, null, 8, ["widgets", "form-data"])
|
|
3099
3130
|
], 4)
|
|
3100
3131
|
])
|
|
@@ -3103,10 +3134,10 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3103
3134
|
s.value ? (d(), c("div", {
|
|
3104
3135
|
key: 1,
|
|
3105
3136
|
class: "fd-dialog-mask",
|
|
3106
|
-
onClick: f[11] || (f[11] =
|
|
3137
|
+
onClick: f[11] || (f[11] = G((I) => s.value = !1, ["self"]))
|
|
3107
3138
|
}, [
|
|
3108
|
-
t("div",
|
|
3109
|
-
t("div",
|
|
3139
|
+
t("div", ql, [
|
|
3140
|
+
t("div", Yl, [
|
|
3110
3141
|
f[34] || (f[34] = t("span", null, "JSON Schema", -1)),
|
|
3111
3142
|
t("button", {
|
|
3112
3143
|
class: "fd-tool-btn",
|
|
@@ -3131,7 +3162,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3131
3162
|
}),
|
|
3132
3163
|
t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
3133
3164
|
], -1)),
|
|
3134
|
-
U(" " + k(
|
|
3165
|
+
U(" " + k(D.value || "复制JSON"), 1)
|
|
3135
3166
|
]),
|
|
3136
3167
|
t("button", {
|
|
3137
3168
|
class: "fd-tool-btn",
|
|
@@ -3142,46 +3173,46 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3142
3173
|
class: "fd-dialog-code",
|
|
3143
3174
|
value: _.value,
|
|
3144
3175
|
readonly: ""
|
|
3145
|
-
}, null, 8,
|
|
3176
|
+
}, null, 8, Kl)
|
|
3146
3177
|
])
|
|
3147
3178
|
])) : T("", !0),
|
|
3148
|
-
|
|
3179
|
+
a.value ? (d(), c("div", {
|
|
3149
3180
|
key: 2,
|
|
3150
3181
|
class: "fd-dialog-mask",
|
|
3151
|
-
onClick: f[14] || (f[14] =
|
|
3182
|
+
onClick: f[14] || (f[14] = G((I) => a.value = !1, ["self"]))
|
|
3152
3183
|
}, [
|
|
3153
|
-
t("div",
|
|
3154
|
-
t("div",
|
|
3184
|
+
t("div", Ql, [
|
|
3185
|
+
t("div", Xl, [
|
|
3155
3186
|
f[35] || (f[35] = t("span", null, "导入(粘贴 JSON)", -1)),
|
|
3156
3187
|
t("button", {
|
|
3157
3188
|
class: "fd-tool-btn",
|
|
3158
|
-
onClick: f[12] || (f[12] = (I) =>
|
|
3189
|
+
onClick: f[12] || (f[12] = (I) => a.value = !1)
|
|
3159
3190
|
}, "取消"),
|
|
3160
3191
|
t("button", {
|
|
3161
3192
|
class: "fd-tool-btn fd-tool-btn--primary",
|
|
3162
3193
|
onClick: B
|
|
3163
3194
|
}, "确认")
|
|
3164
3195
|
]),
|
|
3165
|
-
t("div",
|
|
3166
|
-
|
|
3196
|
+
t("div", Zl, [
|
|
3197
|
+
de(t("textarea", {
|
|
3167
3198
|
"onUpdate:modelValue": f[13] || (f[13] = (I) => C.value = I),
|
|
3168
3199
|
class: "fd-dialog-import-text",
|
|
3169
3200
|
placeholder: "请粘贴表单 JSON(可从「查看代码」复制),确认后仅覆盖表单结构,保留业务对象"
|
|
3170
3201
|
}, null, 512), [
|
|
3171
|
-
[
|
|
3202
|
+
[Xe, C.value]
|
|
3172
3203
|
])
|
|
3173
3204
|
])
|
|
3174
3205
|
])
|
|
3175
3206
|
])) : T("", !0),
|
|
3176
|
-
|
|
3207
|
+
i.value ? (d(), c("div", {
|
|
3177
3208
|
key: 3,
|
|
3178
3209
|
ref_key: "treeDrawerRef",
|
|
3179
|
-
ref:
|
|
3210
|
+
ref: Se,
|
|
3180
3211
|
class: "fd-tree-drawer"
|
|
3181
3212
|
}, [
|
|
3182
|
-
|
|
3213
|
+
F(kl)
|
|
3183
3214
|
], 512)) : T("", !0),
|
|
3184
|
-
|
|
3215
|
+
F(El, {
|
|
3185
3216
|
modelValue: r.value,
|
|
3186
3217
|
"onUpdate:modelValue": f[15] || (f[15] = (I) => r.value = I),
|
|
3187
3218
|
"form-id": h(n).originFormId,
|
|
@@ -3191,10 +3222,10 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3191
3222
|
]))
|
|
3192
3223
|
]));
|
|
3193
3224
|
}
|
|
3194
|
-
}),
|
|
3225
|
+
}), ti = /* @__PURE__ */ P(ei, [["__scopeId", "data-v-da21485c"]]), ni = { class: "fd-palette" }, oi = { class: "fd-palette-group-title" }, si = ["onDragstart", "onClick"], li = { class: "fd-palette-icon" }, ii = /* @__PURE__ */ N({
|
|
3195
3226
|
__name: "WidgetPalette",
|
|
3196
3227
|
setup(e) {
|
|
3197
|
-
const n =
|
|
3228
|
+
const n = Y(), o = ft(), s = [
|
|
3198
3229
|
{
|
|
3199
3230
|
title: "基础控件",
|
|
3200
3231
|
types: ["label", "text"]
|
|
@@ -3207,7 +3238,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3207
3238
|
title: "布局控件",
|
|
3208
3239
|
types: ["grid", "card", "slot"]
|
|
3209
3240
|
}
|
|
3210
|
-
],
|
|
3241
|
+
], i = {
|
|
3211
3242
|
grid: "▦",
|
|
3212
3243
|
card: "▤",
|
|
3213
3244
|
slot: "⧉",
|
|
@@ -3215,7 +3246,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3215
3246
|
text: "¶",
|
|
3216
3247
|
subtable: "☰"
|
|
3217
3248
|
};
|
|
3218
|
-
function
|
|
3249
|
+
function a(l) {
|
|
3219
3250
|
return o.find((m) => m.type === l);
|
|
3220
3251
|
}
|
|
3221
3252
|
function u(l, m) {
|
|
@@ -3225,46 +3256,46 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3225
3256
|
function r(l) {
|
|
3226
3257
|
n.addWidget(l);
|
|
3227
3258
|
}
|
|
3228
|
-
return (l, m) => (d(), c("div",
|
|
3259
|
+
return (l, m) => (d(), c("div", ni, [
|
|
3229
3260
|
m[0] || (m[0] = t("div", { class: "fd-palette-title" }, "控件库", -1)),
|
|
3230
|
-
(d(), c(
|
|
3261
|
+
(d(), c(L, null, E(s, (p) => t("div", {
|
|
3231
3262
|
key: p.title,
|
|
3232
3263
|
class: "fd-palette-group"
|
|
3233
3264
|
}, [
|
|
3234
|
-
t("div",
|
|
3235
|
-
(d(!0), c(
|
|
3236
|
-
|
|
3265
|
+
t("div", oi, k(p.title), 1),
|
|
3266
|
+
(d(!0), c(L, null, E(p.types, (y) => (d(), c(L, { key: y }, [
|
|
3267
|
+
a(y) ? (d(), c("div", {
|
|
3237
3268
|
key: 0,
|
|
3238
3269
|
class: "fd-palette-item",
|
|
3239
3270
|
draggable: "true",
|
|
3240
3271
|
onDragstart: (C) => u(C, y),
|
|
3241
3272
|
onClick: (C) => r(y)
|
|
3242
3273
|
}, [
|
|
3243
|
-
t("span",
|
|
3244
|
-
t("span", null, k(
|
|
3245
|
-
], 40,
|
|
3274
|
+
t("span", li, k(i[y]), 1),
|
|
3275
|
+
t("span", null, k(a(y).title), 1)
|
|
3276
|
+
], 40, si)) : T("", !0)
|
|
3246
3277
|
], 64))), 128))
|
|
3247
3278
|
])), 64))
|
|
3248
3279
|
]));
|
|
3249
3280
|
}
|
|
3250
|
-
}),
|
|
3281
|
+
}), ai = /* @__PURE__ */ P(ii, [["__scopeId", "data-v-6a2bab90"]]), di = [
|
|
3251
3282
|
{ key: "onLoad", label: "加载完成", desc: "表单数据就绪后触发" },
|
|
3252
3283
|
{ key: "onMounted", label: "渲染挂载", desc: "渲染完成并挂载到 DOM 后触发" },
|
|
3253
3284
|
{ key: "onValueChange", label: "值变化", desc: "任意字段值变化时触发" },
|
|
3254
3285
|
{ key: "custom", label: "自定义方法", desc: "写入的方法将挂载至全局 window,可在其他事件处理中调用" }
|
|
3255
|
-
],
|
|
3286
|
+
], ri = { class: "fd-form-events" }, ui = { class: "fd-form-meta" }, ci = { class: "fd-events-section" }, fi = { class: "fd-event-head" }, mi = ["title"], pi = { class: "fd-event-key" }, vi = ["onClick", "title"], bi = {
|
|
3256
3287
|
key: 0,
|
|
3257
3288
|
class: "fd-event-trigger-text"
|
|
3258
|
-
},
|
|
3289
|
+
}, gi = {
|
|
3259
3290
|
key: 1,
|
|
3260
3291
|
class: "fd-event-trigger-placeholder"
|
|
3261
|
-
},
|
|
3292
|
+
}, hi = {
|
|
3262
3293
|
class: "fd-dialog",
|
|
3263
3294
|
style: { "max-width": "600px" }
|
|
3264
|
-
},
|
|
3295
|
+
}, yi = { class: "fd-dialog-head" }, ki = { class: "fd-dialog-body" }, wi = /* @__PURE__ */ N({
|
|
3265
3296
|
__name: "FormEventsPanel",
|
|
3266
3297
|
setup(e) {
|
|
3267
|
-
const n =
|
|
3298
|
+
const n = Ze(() => import("./CodeEditor-C8Hh8Y2_.js")), o = Y(), s = Ue({
|
|
3268
3299
|
open: !1,
|
|
3269
3300
|
type: "",
|
|
3270
3301
|
hookKey: "",
|
|
@@ -3272,52 +3303,52 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3272
3303
|
title: "",
|
|
3273
3304
|
draft: ""
|
|
3274
3305
|
});
|
|
3275
|
-
function
|
|
3306
|
+
function i(r) {
|
|
3276
3307
|
s.open = !0, s.type = "lifecycle", s.hookKey = r.key, s.title = `${r.label}(${r.key})`, s.draft = o.events.lifecycle[r.key] ?? "";
|
|
3277
3308
|
}
|
|
3278
|
-
function
|
|
3309
|
+
function a() {
|
|
3279
3310
|
s.type === "lifecycle" && s.hookKey ? o.setLifecycleHook(s.hookKey, s.draft) : s.type === "custom" && s.index >= 0 && o.updateCustomEvent(s.index, { handler: s.draft }), s.open = !1;
|
|
3280
3311
|
}
|
|
3281
3312
|
function u() {
|
|
3282
3313
|
s.open = !1;
|
|
3283
3314
|
}
|
|
3284
|
-
return (r, l) => (d(), c("div",
|
|
3315
|
+
return (r, l) => (d(), c("div", ri, [
|
|
3285
3316
|
l[4] || (l[4] = t("div", { class: "fd-property-title" }, "表单属性", -1)),
|
|
3286
|
-
t("div",
|
|
3317
|
+
t("div", ui, [
|
|
3287
3318
|
t("span", null, "表单:" + k(h(o).formId), 1),
|
|
3288
3319
|
t("span", null, "主表:" + k(h(o).dbtable), 1)
|
|
3289
3320
|
]),
|
|
3290
|
-
t("section",
|
|
3321
|
+
t("section", ci, [
|
|
3291
3322
|
l[2] || (l[2] = t("h4", { class: "fd-events-h" }, "全局事件 · 生命周期", -1)),
|
|
3292
3323
|
l[3] || (l[3] = t("p", { class: "fd-events-tip" }, "渲染时绑定至对应钩子函数中执行", -1)),
|
|
3293
|
-
(d(!0), c(
|
|
3324
|
+
(d(!0), c(L, null, E(h(di), (m) => (d(), c("div", {
|
|
3294
3325
|
key: m.key,
|
|
3295
3326
|
class: "fd-event-row"
|
|
3296
3327
|
}, [
|
|
3297
|
-
t("div",
|
|
3328
|
+
t("div", fi, [
|
|
3298
3329
|
t("label", {
|
|
3299
3330
|
title: m.desc
|
|
3300
|
-
}, k(m.label), 9,
|
|
3301
|
-
t("code",
|
|
3331
|
+
}, k(m.label), 9, mi),
|
|
3332
|
+
t("code", pi, k(m.key), 1)
|
|
3302
3333
|
]),
|
|
3303
3334
|
t("div", {
|
|
3304
3335
|
class: "fd-event-trigger",
|
|
3305
|
-
onClick: (p) =>
|
|
3336
|
+
onClick: (p) => i(m),
|
|
3306
3337
|
title: h(o).events.lifecycle[m.key] || "点击编写处理函数"
|
|
3307
3338
|
}, [
|
|
3308
|
-
h(o).events.lifecycle[m.key] ? (d(), c("span",
|
|
3339
|
+
h(o).events.lifecycle[m.key] ? (d(), c("span", bi, k(h(o).events.lifecycle[m.key]), 1)) : (d(), c("span", gi, "点击编写")),
|
|
3309
3340
|
l[1] || (l[1] = t("span", { class: "fd-event-trigger-arrow" }, "›", -1))
|
|
3310
|
-
], 8,
|
|
3341
|
+
], 8, vi)
|
|
3311
3342
|
]))), 128))
|
|
3312
3343
|
]),
|
|
3313
|
-
(d(),
|
|
3344
|
+
(d(), R(we, { to: "body" }, [
|
|
3314
3345
|
s.open ? (d(), c("div", {
|
|
3315
3346
|
key: 0,
|
|
3316
3347
|
class: "fd-dialog-mask",
|
|
3317
|
-
onClick:
|
|
3348
|
+
onClick: G(u, ["self"])
|
|
3318
3349
|
}, [
|
|
3319
|
-
t("div",
|
|
3320
|
-
t("div",
|
|
3350
|
+
t("div", hi, [
|
|
3351
|
+
t("div", yi, [
|
|
3321
3352
|
t("span", null, "编写处理函数 - " + k(s.title), 1),
|
|
3322
3353
|
t("button", {
|
|
3323
3354
|
class: "fd-dialog-close",
|
|
@@ -3325,8 +3356,8 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3325
3356
|
title: "关闭"
|
|
3326
3357
|
}, "×")
|
|
3327
3358
|
]),
|
|
3328
|
-
t("div",
|
|
3329
|
-
|
|
3359
|
+
t("div", ki, [
|
|
3360
|
+
F(h(n), {
|
|
3330
3361
|
modelValue: s.draft,
|
|
3331
3362
|
"onUpdate:modelValue": l[0] || (l[0] = (m) => s.draft = m),
|
|
3332
3363
|
language: "javascript"
|
|
@@ -3335,7 +3366,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3335
3366
|
t("div", { class: "fd-dialog-foot" }, [
|
|
3336
3367
|
t("button", {
|
|
3337
3368
|
class: "fd-btn fd-btn--primary",
|
|
3338
|
-
onClick:
|
|
3369
|
+
onClick: a
|
|
3339
3370
|
}, "确定")
|
|
3340
3371
|
])
|
|
3341
3372
|
])
|
|
@@ -3343,20 +3374,20 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3343
3374
|
]))
|
|
3344
3375
|
]));
|
|
3345
3376
|
}
|
|
3346
|
-
}),
|
|
3377
|
+
}), $i = /* @__PURE__ */ P(wi, [["__scopeId", "data-v-7e5a3f15"]]), xi = { class: "fd-property" }, Ci = {
|
|
3347
3378
|
key: 1,
|
|
3348
3379
|
class: "fd-property-empty"
|
|
3349
|
-
},
|
|
3380
|
+
}, _i = {
|
|
3350
3381
|
key: 1,
|
|
3351
3382
|
class: "fd-property-item"
|
|
3352
|
-
},
|
|
3383
|
+
}, Ii = ["value"], Si = { class: "fd-property-foot" }, Di = { class: "fd-property-type" }, Ti = /* @__PURE__ */ N({
|
|
3353
3384
|
__name: "PropertyPanel",
|
|
3354
3385
|
setup(e) {
|
|
3355
|
-
const n =
|
|
3386
|
+
const n = Y(), o = M(() => n.selectedNode), s = M(() => o.value ? X(o.value.type) : void 0), i = M(() => {
|
|
3356
3387
|
var l;
|
|
3357
3388
|
return (l = s.value) == null ? void 0 : l.panel;
|
|
3358
3389
|
});
|
|
3359
|
-
function
|
|
3390
|
+
function a(l) {
|
|
3360
3391
|
o.value && n.updateNode(o.value.id, l);
|
|
3361
3392
|
}
|
|
3362
3393
|
const u = M(() => o.value != null && o.value.gridSpan != null);
|
|
@@ -3367,16 +3398,16 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3367
3398
|
}
|
|
3368
3399
|
return (l, m) => {
|
|
3369
3400
|
var p;
|
|
3370
|
-
return d(), c("div",
|
|
3401
|
+
return d(), c("div", xi, [
|
|
3371
3402
|
m[2] || (m[2] = t("div", { class: "fd-property-title" }, "属性", -1)),
|
|
3372
|
-
h(n).selectedForm ? (d(),
|
|
3373
|
-
|
|
3403
|
+
h(n).selectedForm ? (d(), R($i, { key: 0 })) : o.value ? (d(), c(L, { key: 2 }, [
|
|
3404
|
+
i.value ? (d(), R(ke(i.value), {
|
|
3374
3405
|
key: 0,
|
|
3375
3406
|
node: o.value,
|
|
3376
3407
|
fields: h(n).fields,
|
|
3377
|
-
onUpdate:
|
|
3408
|
+
onUpdate: a
|
|
3378
3409
|
}, null, 40, ["node", "fields"])) : T("", !0),
|
|
3379
|
-
u.value ? (d(), c("div",
|
|
3410
|
+
u.value ? (d(), c("div", _i, [
|
|
3380
3411
|
m[1] || (m[1] = t("label", null, "占比", -1)),
|
|
3381
3412
|
t("input", {
|
|
3382
3413
|
type: "number",
|
|
@@ -3384,12 +3415,12 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3384
3415
|
max: "24",
|
|
3385
3416
|
value: o.value.gridSpan,
|
|
3386
3417
|
onChange: r
|
|
3387
|
-
}, null, 40,
|
|
3418
|
+
}, null, 40, Ii)
|
|
3388
3419
|
])) : T("", !0),
|
|
3389
|
-
t("div",
|
|
3390
|
-
t("span",
|
|
3420
|
+
t("div", Si, [
|
|
3421
|
+
t("span", Di, "类型:" + k((p = s.value) == null ? void 0 : p.title), 1)
|
|
3391
3422
|
])
|
|
3392
|
-
], 64)) : (d(), c("div",
|
|
3423
|
+
], 64)) : (d(), c("div", Ci, [...m[0] || (m[0] = [
|
|
3393
3424
|
t("span", { class: "fd-property-empty-icon" }, "⚙", -1),
|
|
3394
3425
|
t("span", null, [
|
|
3395
3426
|
U("请选择左侧控件"),
|
|
@@ -3400,10 +3431,10 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3400
3431
|
]);
|
|
3401
3432
|
};
|
|
3402
3433
|
}
|
|
3403
|
-
}),
|
|
3434
|
+
}), Li = /* @__PURE__ */ P(Ti, [["__scopeId", "data-v-e89617c7"]]), Fi = {
|
|
3404
3435
|
key: 0,
|
|
3405
3436
|
class: "fd-canvas-dropzone"
|
|
3406
|
-
},
|
|
3437
|
+
}, Ni = /* @__PURE__ */ N({
|
|
3407
3438
|
__name: "CanvasNode",
|
|
3408
3439
|
props: {
|
|
3409
3440
|
node: {},
|
|
@@ -3411,17 +3442,17 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3411
3442
|
index: {}
|
|
3412
3443
|
},
|
|
3413
3444
|
setup(e) {
|
|
3414
|
-
const n = e, o =
|
|
3445
|
+
const n = e, o = Y(), s = O(null), i = M(() => {
|
|
3415
3446
|
const v = {};
|
|
3416
3447
|
return n.node.gridSpan != null && (v.gridColumn = `span ${n.node.gridSpan}`), n.node.type === "text" && (v.display = n.node.display || "inline-block"), Object.keys(v).length ? v : void 0;
|
|
3417
|
-
}),
|
|
3448
|
+
}), a = () => {
|
|
3418
3449
|
var v;
|
|
3419
3450
|
return (v = X(n.node.type)) == null ? void 0 : v.isContainer;
|
|
3420
3451
|
};
|
|
3421
3452
|
function u(v, g) {
|
|
3422
3453
|
if (n.node.type !== "grid") return "";
|
|
3423
3454
|
const $ = n.node.layout || 24;
|
|
3424
|
-
return
|
|
3455
|
+
return Ae(v, g, n.node.children || [], $, o.device === "mobile");
|
|
3425
3456
|
}
|
|
3426
3457
|
function r(v) {
|
|
3427
3458
|
const g = v.dataTransfer;
|
|
@@ -3445,7 +3476,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3445
3476
|
}
|
|
3446
3477
|
function B(v) {
|
|
3447
3478
|
if (r(v))
|
|
3448
|
-
if (v.preventDefault(), v.stopPropagation(),
|
|
3479
|
+
if (v.preventDefault(), v.stopPropagation(), a())
|
|
3449
3480
|
o.dragOverId = null, o.dragBefore = !1, o.dropContainerId = n.node.id;
|
|
3450
3481
|
else {
|
|
3451
3482
|
o.dropContainerId = null, o.dragOverId = n.node.id;
|
|
@@ -3459,12 +3490,12 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3459
3490
|
function _() {
|
|
3460
3491
|
C();
|
|
3461
3492
|
}
|
|
3462
|
-
function
|
|
3463
|
-
var
|
|
3493
|
+
function D(v) {
|
|
3494
|
+
var V, K, x;
|
|
3464
3495
|
if (!r(v)) return;
|
|
3465
3496
|
v.preventDefault(), v.stopPropagation();
|
|
3466
|
-
const g = (
|
|
3467
|
-
if (
|
|
3497
|
+
const g = (V = v.dataTransfer) == null ? void 0 : V.getData("application/x-fd-new"), $ = (K = v.dataTransfer) == null ? void 0 : K.getData("application/x-fd-move");
|
|
3498
|
+
if (a())
|
|
3468
3499
|
g ? o.addWidget(g, n.node.id) : $ && o.moveNode($, n.node.id, ((x = n.node.children) == null ? void 0 : x.length) ?? 0);
|
|
3469
3500
|
else {
|
|
3470
3501
|
const b = o.dragBefore ? n.index : n.index + 1;
|
|
@@ -3473,11 +3504,11 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3473
3504
|
o.dragOverId = null, o.dragBefore = !1, o.dropContainerId = null;
|
|
3474
3505
|
}
|
|
3475
3506
|
return (v, g) => {
|
|
3476
|
-
const $ =
|
|
3507
|
+
const $ = Re("CanvasNode", !0);
|
|
3477
3508
|
return d(), c("div", {
|
|
3478
3509
|
ref_key: "rootEl",
|
|
3479
3510
|
ref: s,
|
|
3480
|
-
class:
|
|
3511
|
+
class: j(["fd-canvas-node", [
|
|
3481
3512
|
`fd-canvas-node--${e.node.type}`,
|
|
3482
3513
|
{
|
|
3483
3514
|
"is-selected": h(o).selectedId === e.node.id,
|
|
@@ -3486,26 +3517,26 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3486
3517
|
"dragging-source": h(o).draggingId === e.node.id
|
|
3487
3518
|
}
|
|
3488
3519
|
]]),
|
|
3489
|
-
style:
|
|
3520
|
+
style: q(i.value),
|
|
3490
3521
|
draggable: "true",
|
|
3491
|
-
onMousedown:
|
|
3492
|
-
onClick: g[4] || (g[4] =
|
|
3522
|
+
onMousedown: G(l, ["stop"]),
|
|
3523
|
+
onClick: g[4] || (g[4] = G(() => {
|
|
3493
3524
|
}, ["stop"])),
|
|
3494
3525
|
onDragstart: m,
|
|
3495
3526
|
onDragend: y,
|
|
3496
3527
|
onDragover: B,
|
|
3497
3528
|
onDragleave: _,
|
|
3498
|
-
onDrop:
|
|
3529
|
+
onDrop: D
|
|
3499
3530
|
}, [
|
|
3500
3531
|
t("div", {
|
|
3501
3532
|
class: "fd-canvas-node-actions",
|
|
3502
|
-
onMousedown: g[3] || (g[3] =
|
|
3533
|
+
onMousedown: g[3] || (g[3] = G(() => {
|
|
3503
3534
|
}, ["stop"]))
|
|
3504
3535
|
}, [
|
|
3505
3536
|
t("span", {
|
|
3506
3537
|
class: "fd-node-action",
|
|
3507
3538
|
title: "上移",
|
|
3508
|
-
onClick: g[0] || (g[0] =
|
|
3539
|
+
onClick: g[0] || (g[0] = G((V) => h(o).moveSibling(e.node.id, -1), ["stop"]))
|
|
3509
3540
|
}, [...g[5] || (g[5] = [
|
|
3510
3541
|
t("svg", {
|
|
3511
3542
|
class: "fd-node-icon",
|
|
@@ -3528,7 +3559,7 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3528
3559
|
t("span", {
|
|
3529
3560
|
class: "fd-node-action",
|
|
3530
3561
|
title: "下移",
|
|
3531
|
-
onClick: g[1] || (g[1] =
|
|
3562
|
+
onClick: g[1] || (g[1] = G((V) => h(o).moveSibling(e.node.id, 1), ["stop"]))
|
|
3532
3563
|
}, [...g[6] || (g[6] = [
|
|
3533
3564
|
t("svg", {
|
|
3534
3565
|
class: "fd-node-icon",
|
|
@@ -3551,26 +3582,26 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3551
3582
|
t("span", {
|
|
3552
3583
|
class: "fd-node-action delete",
|
|
3553
3584
|
title: "删除",
|
|
3554
|
-
onClick: g[2] || (g[2] =
|
|
3585
|
+
onClick: g[2] || (g[2] = G((V) => h(o).removeWidget(e.node.id), ["stop"]))
|
|
3555
3586
|
}, [...g[7] || (g[7] = [
|
|
3556
|
-
|
|
3587
|
+
$e('<svg class="fd-node-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-3f3a43d3><path d="M4 7h16" data-v-3f3a43d3></path><path d="M9 7V5.5a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 15 5.5V7" data-v-3f3a43d3></path><path d="M6.5 7l1 12.5h9l1-12.5" data-v-3f3a43d3></path><line x1="10" y1="11" x2="10" y2="16.5" data-v-3f3a43d3></line><line x1="14" y1="11" x2="14" y2="16.5" data-v-3f3a43d3></line></svg>', 1)
|
|
3557
3588
|
])])
|
|
3558
3589
|
], 32),
|
|
3559
|
-
|
|
3590
|
+
F(Ce, {
|
|
3560
3591
|
node: e.node,
|
|
3561
3592
|
mode: "design"
|
|
3562
|
-
},
|
|
3563
|
-
|
|
3593
|
+
}, ce({ _: 2 }, [
|
|
3594
|
+
a() && e.node.children ? {
|
|
3564
3595
|
name: "children",
|
|
3565
|
-
fn:
|
|
3566
|
-
(d(!0), c(
|
|
3567
|
-
key:
|
|
3568
|
-
node:
|
|
3596
|
+
fn: A(() => [
|
|
3597
|
+
(d(!0), c(L, null, E(e.node.children, (V, K) => (d(), R($, {
|
|
3598
|
+
key: V.id,
|
|
3599
|
+
node: V,
|
|
3569
3600
|
"parent-id": e.node.id,
|
|
3570
|
-
index:
|
|
3571
|
-
class:
|
|
3601
|
+
index: K,
|
|
3602
|
+
class: j(u(V, K))
|
|
3572
3603
|
}, null, 8, ["node", "parent-id", "index", "class"]))), 128)),
|
|
3573
|
-
!e.node.children || e.node.children.length === 0 ? (d(), c("div",
|
|
3604
|
+
!e.node.children || e.node.children.length === 0 ? (d(), c("div", Fi, "拖拽控件到此容器")) : T("", !0)
|
|
3574
3605
|
]),
|
|
3575
3606
|
key: "0"
|
|
3576
3607
|
} : void 0
|
|
@@ -3578,60 +3609,60 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3578
3609
|
], 38);
|
|
3579
3610
|
};
|
|
3580
3611
|
}
|
|
3581
|
-
}),
|
|
3612
|
+
}), Mi = /* @__PURE__ */ P(Ni, [["__scopeId", "data-v-3f3a43d3"]]), Ei = { class: "fd-designer" }, Pi = { class: "fd-designer-body" }, Oi = { class: "fd-designer-left" }, Ui = {
|
|
3582
3613
|
key: 0,
|
|
3583
3614
|
class: "fd-canvas-notice"
|
|
3584
|
-
},
|
|
3615
|
+
}, Bi = {
|
|
3585
3616
|
key: 1,
|
|
3586
3617
|
class: "fd-canvas-state"
|
|
3587
|
-
},
|
|
3618
|
+
}, Ri = {
|
|
3588
3619
|
key: 2,
|
|
3589
3620
|
class: "fd-canvas-state fd-canvas-state--error"
|
|
3590
|
-
},
|
|
3621
|
+
}, Vi = {
|
|
3591
3622
|
key: 0,
|
|
3592
3623
|
class: "fd-canvas-empty"
|
|
3593
|
-
},
|
|
3624
|
+
}, Ai = { class: "fd-designer-right" }, ji = /* @__PURE__ */ N({
|
|
3594
3625
|
__name: "Designer",
|
|
3595
3626
|
props: {
|
|
3596
3627
|
formId: {}
|
|
3597
3628
|
},
|
|
3598
3629
|
setup(e) {
|
|
3599
|
-
const n = e, o =
|
|
3600
|
-
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3603
|
-
const u = n.formId ||
|
|
3630
|
+
const n = e, o = Y();
|
|
3631
|
+
ve(async () => {
|
|
3632
|
+
const i = new URLSearchParams(window.location.search), a = i.get("baseUrl");
|
|
3633
|
+
a && zs(a);
|
|
3634
|
+
const u = n.formId || i.get("id") || "", r = i.get("formVersion") || i.get("FormVersion") || "", l = i.get("openType") || i.get("OpenType") || "";
|
|
3604
3635
|
await o.openForm(u, r, l);
|
|
3605
3636
|
});
|
|
3606
|
-
function s(
|
|
3637
|
+
function s(i) {
|
|
3607
3638
|
var r, l;
|
|
3608
|
-
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3611
|
-
}
|
|
3612
|
-
return (
|
|
3613
|
-
|
|
3614
|
-
t("div",
|
|
3615
|
-
t("aside",
|
|
3616
|
-
|
|
3639
|
+
i.preventDefault();
|
|
3640
|
+
const a = (r = i.dataTransfer) == null ? void 0 : r.getData("application/x-fd-new"), u = (l = i.dataTransfer) == null ? void 0 : l.getData("application/x-fd-move");
|
|
3641
|
+
a ? o.addWidget(a, null, o.widgets.length) : u && o.moveNode(u, null, o.widgets.length);
|
|
3642
|
+
}
|
|
3643
|
+
return (i, a) => (d(), c("div", Ei, [
|
|
3644
|
+
F(ti),
|
|
3645
|
+
t("div", Pi, [
|
|
3646
|
+
t("aside", Oi, [
|
|
3647
|
+
F(ai)
|
|
3617
3648
|
]),
|
|
3618
3649
|
t("main", {
|
|
3619
3650
|
class: "fd-designer-center",
|
|
3620
|
-
onDragover:
|
|
3651
|
+
onDragover: a[1] || (a[1] = G(() => {
|
|
3621
3652
|
}, ["prevent"])),
|
|
3622
3653
|
onDrop: s
|
|
3623
3654
|
}, [
|
|
3624
|
-
h(o).noticeMsg ? (d(), c("div",
|
|
3625
|
-
h(o).loading ? (d(), c("div",
|
|
3655
|
+
h(o).noticeMsg ? (d(), c("div", Ui, k(h(o).noticeMsg), 1)) : T("", !0),
|
|
3656
|
+
h(o).loading ? (d(), c("div", Bi, "正在加载表单…")) : h(o).errorMsg ? (d(), c("div", Ri, k(h(o).errorMsg), 1)) : (d(), c("div", {
|
|
3626
3657
|
key: 3,
|
|
3627
|
-
class:
|
|
3628
|
-
onClick:
|
|
3658
|
+
class: j(["fd-canvas", { "is-mobile": h(o).device === "mobile", "is-selected": h(o).selectedForm }]),
|
|
3659
|
+
onClick: a[0] || (a[0] = (u) => h(o).selectForm())
|
|
3629
3660
|
}, [
|
|
3630
|
-
h(o).widgets.length === 0 ? (d(), c("div",
|
|
3661
|
+
h(o).widgets.length === 0 ? (d(), c("div", Vi, [...a[2] || (a[2] = [
|
|
3631
3662
|
t("span", { class: "fd-canvas-empty-icon" }, "▦", -1),
|
|
3632
3663
|
t("span", null, "从左侧拖拽控件到此处", -1)
|
|
3633
3664
|
])])) : T("", !0),
|
|
3634
|
-
(d(!0), c(
|
|
3665
|
+
(d(!0), c(L, null, E(h(o).widgets, (u, r) => (d(), R(Mi, {
|
|
3635
3666
|
key: u.id,
|
|
3636
3667
|
node: u,
|
|
3637
3668
|
"parent-id": null,
|
|
@@ -3639,51 +3670,111 @@ const gl = { class: "fd-publish-tip" }, hl = { class: "fd-publish-tip-text" }, y
|
|
|
3639
3670
|
}, null, 8, ["node", "index"]))), 128))
|
|
3640
3671
|
], 2))
|
|
3641
3672
|
], 32),
|
|
3642
|
-
t("aside",
|
|
3643
|
-
|
|
3673
|
+
t("aside", Ai, [
|
|
3674
|
+
F(Li)
|
|
3644
3675
|
])
|
|
3645
3676
|
])
|
|
3646
3677
|
]));
|
|
3647
3678
|
}
|
|
3648
|
-
}),
|
|
3649
|
-
|
|
3650
|
-
|
|
3679
|
+
}), zi = /* @__PURE__ */ P(ji, [["__scopeId", "data-v-d6db258b"]]), Ji = { class: "fd-card-title" }, Wi = { class: "fd-card-body" }, Hi = /* @__PURE__ */ N({
|
|
3680
|
+
__name: "FormCard",
|
|
3681
|
+
props: {
|
|
3682
|
+
label: { default: "卡片标题" },
|
|
3683
|
+
icon: { default: "" },
|
|
3684
|
+
iconBgColor: { default: "" },
|
|
3685
|
+
expanded: { type: Boolean, default: !0 },
|
|
3686
|
+
width: { default: "" }
|
|
3687
|
+
},
|
|
3688
|
+
setup(e) {
|
|
3689
|
+
const o = O(e.expanded);
|
|
3690
|
+
return (s, i) => (d(), c("div", {
|
|
3691
|
+
class: "fd-card-render",
|
|
3692
|
+
style: q(e.width ? { width: e.width } : void 0)
|
|
3693
|
+
}, [
|
|
3694
|
+
t("div", {
|
|
3695
|
+
class: "fd-card-head",
|
|
3696
|
+
onClick: i[0] || (i[0] = (a) => o.value = !o.value)
|
|
3697
|
+
}, [
|
|
3698
|
+
e.icon ? (d(), c("span", {
|
|
3699
|
+
key: 0,
|
|
3700
|
+
class: "fd-card-icon",
|
|
3701
|
+
style: q({ background: e.iconBgColor || void 0 })
|
|
3702
|
+
}, [
|
|
3703
|
+
F(me, {
|
|
3704
|
+
name: e.icon,
|
|
3705
|
+
size: 18
|
|
3706
|
+
}, null, 8, ["name"])
|
|
3707
|
+
], 4)) : T("", !0),
|
|
3708
|
+
t("span", Ji, k(e.label || "卡片标题"), 1),
|
|
3709
|
+
t("span", {
|
|
3710
|
+
class: j(["fd-card-arrow", { "is-open": o.value }])
|
|
3711
|
+
}, [...i[1] || (i[1] = [
|
|
3712
|
+
t("svg", {
|
|
3713
|
+
viewBox: "0 0 24 24",
|
|
3714
|
+
fill: "none",
|
|
3715
|
+
stroke: "currentColor",
|
|
3716
|
+
"stroke-width": "2",
|
|
3717
|
+
"stroke-linecap": "round",
|
|
3718
|
+
"stroke-linejoin": "round"
|
|
3719
|
+
}, [
|
|
3720
|
+
t("polyline", { points: "6 9 12 15 18 9" })
|
|
3721
|
+
], -1)
|
|
3722
|
+
])], 2)
|
|
3723
|
+
]),
|
|
3724
|
+
de(t("div", Wi, [
|
|
3725
|
+
Z(s.$slots, "default", {}, void 0, !0)
|
|
3726
|
+
], 512), [
|
|
3727
|
+
[ye, o.value]
|
|
3728
|
+
])
|
|
3729
|
+
], 4));
|
|
3730
|
+
}
|
|
3731
|
+
}), Gi = /* @__PURE__ */ P(Hi, [["__scopeId", "data-v-3c92df6b"]]);
|
|
3732
|
+
function va(e) {
|
|
3733
|
+
_e(), e.baseUrl && je({ baseUrl: e.baseUrl });
|
|
3651
3734
|
let n = null;
|
|
3652
|
-
const s =
|
|
3653
|
-
render: () =>
|
|
3735
|
+
const s = et({
|
|
3736
|
+
render: () => ge(Ge, {
|
|
3654
3737
|
widgets: e.widgets,
|
|
3655
3738
|
formMode: e.formMode,
|
|
3656
3739
|
formData: e.formData,
|
|
3657
3740
|
events: e.events,
|
|
3658
3741
|
formId: e.formId,
|
|
3659
|
-
ref: (
|
|
3660
|
-
n =
|
|
3742
|
+
ref: (i) => {
|
|
3743
|
+
n = i;
|
|
3661
3744
|
}
|
|
3662
3745
|
})
|
|
3663
3746
|
});
|
|
3664
3747
|
return s.mount(e.container), {
|
|
3665
|
-
fireEvent: (
|
|
3748
|
+
fireEvent: (i, a) => {
|
|
3666
3749
|
var u;
|
|
3667
|
-
return (u = n == null ? void 0 : n.fireEvent) == null ? void 0 : u.call(n,
|
|
3750
|
+
return (u = n == null ? void 0 : n.fireEvent) == null ? void 0 : u.call(n, i, a);
|
|
3668
3751
|
},
|
|
3669
3752
|
unmount: () => s.unmount()
|
|
3670
3753
|
};
|
|
3671
3754
|
}
|
|
3672
|
-
const
|
|
3755
|
+
const ba = {
|
|
3673
3756
|
install(e, n = {}) {
|
|
3674
|
-
|
|
3757
|
+
_e();
|
|
3758
|
+
const o = {};
|
|
3759
|
+
n.baseUrl && (o.baseUrl = n.baseUrl), n.loginSite && (o.loginSite = n.loginSite), n.onUnauthorized && (o.onUnauthorized = n.onUnauthorized), Object.keys(o).length && je(o), e.component("FdDesigner", zi), e.component("FdFormCard", Gi);
|
|
3675
3760
|
}
|
|
3676
3761
|
};
|
|
3677
3762
|
export {
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3763
|
+
zi as D,
|
|
3764
|
+
Gi as F,
|
|
3765
|
+
di as L,
|
|
3766
|
+
Ge as R,
|
|
3681
3767
|
P as _,
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3768
|
+
me as a,
|
|
3769
|
+
ba as b,
|
|
3770
|
+
je as c,
|
|
3771
|
+
ie as d,
|
|
3772
|
+
va as e,
|
|
3773
|
+
Js as f,
|
|
3774
|
+
ua as g,
|
|
3775
|
+
ma as h,
|
|
3776
|
+
fa as i,
|
|
3777
|
+
pa as l,
|
|
3778
|
+
Ws as r,
|
|
3779
|
+
ca as s
|
|
3689
3780
|
};
|