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