@guodun/antdv 1.7.8 → 1.7.10
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/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +295 -296
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.mjs +132 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +267 -277
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.mjs +258 -252
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1020 -1011
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +193 -163
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +70 -68
- package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +63 -25
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +7 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +158 -93
- package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +45 -18
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +22 -22
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -2
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +7 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +5 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +5 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +18 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-variable-render.d.ts +15 -2
- package/package.json +3 -3
package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { isContractTemplateFieldType as e } from "./types.mjs";
|
|
2
2
|
import { isAllowedContractTemplateRemoteUrl as t, normalizeContractTemplateControlOptions as n, normalizeContractTemplateJsonObject as r, normalizeContractTemplateRequestTimeout as i } from "./utils/advanced-controls.mjs";
|
|
3
|
-
import { buildInitialRenderValues as a, buildTemplateRenderPages as o, isEmptyRenderValue as s, normalizeRenderValues as c, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne } from "./utils/template-renderer.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { useElementSize as
|
|
11
|
-
import { LeftOutlined as
|
|
3
|
+
import { buildInitialRenderValues as a, buildTemplateRenderPages as o, isEmptyRenderValue as s, normalizeRenderValues as c, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne, validateTemplateTextOverflow as re } from "./utils/template-renderer.mjs";
|
|
4
|
+
import ie from "./ContractTemplateRendererField.mjs";
|
|
5
|
+
import ae from "./ContractTemplateRendererHeader.mjs";
|
|
6
|
+
import oe from "./ContractTemplateRendererPage.mjs";
|
|
7
|
+
import se from "./ContractTemplateRendererValidation.mjs";
|
|
8
|
+
import { Fragment as ce, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as le, createTextVNode as ue, createVNode as m, defineComponent as h, mergeProps as de, nextTick as g, normalizeClass as fe, onBeforeUnmount as pe, openBlock as _, ref as v, renderList as me, renderSlot as he, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
|
|
9
|
+
import { Button as ge, Empty as _e, Input as ve, Modal as ye, Progress as be, Segmented as xe, Tooltip as Se } from "ant-design-vue";
|
|
10
|
+
import { useElementSize as Ce } from "@vueuse/core";
|
|
11
|
+
import { LeftOutlined as we, RightOutlined as Te, SearchOutlined as Ee } from "@ant-design/icons-vue";
|
|
12
12
|
//#region src/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var De = {
|
|
14
14
|
key: 2,
|
|
15
15
|
class: "gd-contract-template-renderer__empty"
|
|
16
|
-
},
|
|
16
|
+
}, Oe = ["data-highlighted-variable-key"], ke = { class: "gd-contract-template-renderer__pages" }, Ae = ["aria-label", "aria-expanded"], je = { class: "gd-contract-template-renderer__panel-clip" }, Me = { class: "gd-contract-template-renderer__panel" }, Ne = { class: "gd-contract-template-renderer__panel-head" }, Pe = { class: "gd-contract-template-renderer__panel-head-row" }, Fe = { class: "gd-contract-template-renderer__panel-head-actions" }, Ie = { class: "gd-contract-template-renderer__field-group-head" }, Le = { class: "gd-contract-template-renderer__field-group-items" }, Re = ["data-field-key"], ze = .5, Be = 1.5, C = .1, Ve = 3e3, He = /* @__PURE__ */ h({
|
|
17
17
|
name: "ContractTemplateSingleRenderer",
|
|
18
18
|
__name: "ContractTemplateSingleRenderer",
|
|
19
19
|
props: {
|
|
@@ -87,8 +87,8 @@ var Te = {
|
|
|
87
87
|
"update:zoom",
|
|
88
88
|
"control-warning"
|
|
89
89
|
],
|
|
90
|
-
setup(h, { expose:
|
|
91
|
-
let
|
|
90
|
+
setup(h, { expose: He, emit: Ue }) {
|
|
91
|
+
let w = h, T = Ue, We = [
|
|
92
92
|
{
|
|
93
93
|
label: "全部",
|
|
94
94
|
value: "all"
|
|
@@ -101,10 +101,10 @@ var Te = {
|
|
|
101
101
|
label: "有错误",
|
|
102
102
|
value: "error"
|
|
103
103
|
}
|
|
104
|
-
],
|
|
105
|
-
let e = { ...
|
|
104
|
+
], Ge = v(), E = v(), Ke = v(), D = v(c(w.template, w.values)), qe = v({ ...D.value }), O = v(!1), k = v([]), A = v([]), j = v(!1), M = v(!1), N = v(""), P = v(""), F = v(""), Je = v(0), I = v($t(w.zoom)), L = v(""), R = v("all"), z = v(!1), Ye = v(/* @__PURE__ */ new Map()), B = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new Set(), { width: Qe } = Ce(E), $e = l(() => w.readonly || w.disabled), et = l(() => te(w.template)), H = l(() => O.value ? k.value : [...et.value, ...A.value]), U = l(() => (Array.isArray(w.template?.variables) ? w.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), tt = l(() => {
|
|
105
|
+
let e = { ...D.value };
|
|
106
106
|
return U.value.forEach((t) => {
|
|
107
|
-
let n =
|
|
107
|
+
let n = Nt(t);
|
|
108
108
|
if (n?.toDisplayText) try {
|
|
109
109
|
e[t.key] = n.toDisplayText(e[t.key], {
|
|
110
110
|
variable: t,
|
|
@@ -112,26 +112,26 @@ var Te = {
|
|
|
112
112
|
});
|
|
113
113
|
} catch {}
|
|
114
114
|
}), e;
|
|
115
|
-
}),
|
|
115
|
+
}), nt = l(() => U.value.filter((e) => s(D.value[e.key])).length), rt = l(() => {
|
|
116
116
|
let e = /* @__PURE__ */ new Map();
|
|
117
|
-
return
|
|
117
|
+
return H.value.forEach((t) => {
|
|
118
118
|
t.variableKey && e.set(t.variableKey, [...e.get(t.variableKey) ?? [], t]);
|
|
119
119
|
}), e;
|
|
120
120
|
}), W = l(() => {
|
|
121
|
-
let e =
|
|
122
|
-
return o(
|
|
123
|
-
readonly:
|
|
124
|
-
disabled:
|
|
121
|
+
let e = w.interactionMode === "panel";
|
|
122
|
+
return o(w.template, e ? tt.value : qe.value, {
|
|
123
|
+
readonly: w.readonly,
|
|
124
|
+
disabled: w.disabled,
|
|
125
125
|
mode: e ? "display" : "control"
|
|
126
126
|
});
|
|
127
|
-
}),
|
|
127
|
+
}), it = l(() => {
|
|
128
128
|
let e = /* @__PURE__ */ new Map(), t = new Set(U.value.map((e) => e.key));
|
|
129
129
|
return W.value.forEach((n) => {
|
|
130
|
-
|
|
130
|
+
qt(n.contentHtml).forEach((r) => {
|
|
131
131
|
t.has(r) && !e.has(r) && e.set(r, n.id);
|
|
132
132
|
});
|
|
133
133
|
}), e;
|
|
134
|
-
}),
|
|
134
|
+
}), at = l(() => U.value.filter(Ht)), ot = l(() => {
|
|
135
135
|
let e = W.value.map((e, t) => ({
|
|
136
136
|
id: `page:${e.id}`,
|
|
137
137
|
pageId: e.id,
|
|
@@ -145,58 +145,64 @@ var Te = {
|
|
|
145
145
|
variables: []
|
|
146
146
|
};
|
|
147
147
|
return U.value.forEach((e) => {
|
|
148
|
-
let r = t.get(
|
|
149
|
-
r.allVariables.push(e),
|
|
148
|
+
let r = t.get(it.value.get(e.key) ?? "") ?? n;
|
|
149
|
+
r.allVariables.push(e), Ht(e) && r.variables.push(e);
|
|
150
150
|
}), [...e, n].filter((e) => e.variables.length > 0).map((e) => ({
|
|
151
151
|
id: e.id,
|
|
152
152
|
title: e.title,
|
|
153
153
|
totalCount: e.allVariables.length,
|
|
154
154
|
variables: e.variables
|
|
155
155
|
}));
|
|
156
|
-
}),
|
|
157
|
-
x(() =>
|
|
158
|
-
G(c(e,
|
|
156
|
+
}), st = l(() => W.value.length > 0), ct = l(() => U.value.filter((e) => !s(D.value[e.key])).length), lt = l(() => U.value.filter((e) => e.required && s(D.value[e.key])).length), ut = l(() => U.value.length ? Math.round(ct.value / U.value.length * 100) : 0), dt = l(() => O.value && k.value.length === 0), ft = l(() => O.value ? dt.value ? "校验通过,模板与填写值均符合规则" : `发现 ${k.value.length} 个模板或填写问题` : A.value.length ? `发现 ${H.value.length} 个模板或填写问题` : et.value.length ? `模板存在 ${et.value.length} 个问题,已安全降级展示` : ""), pt = l(() => O.value ? H.value.length > 0 || M.value : H.value.length > 0);
|
|
157
|
+
x(() => w.template, (e) => {
|
|
158
|
+
G(c(e, w.values), !1), wt();
|
|
159
159
|
let t = Array.isArray(e?.pages) ? e.pages.map((e) => e?.id) : [];
|
|
160
|
-
t.includes(F.value) || (F.value = t.find(Boolean) ?? ""), P.value && !U.value.some((e) => e.key === P.value) &&
|
|
160
|
+
t.includes(F.value) || (F.value = t.find(Boolean) ?? ""), P.value && !U.value.some((e) => e.key === P.value) && Ot();
|
|
161
161
|
}, { deep: !0 }), x(() => [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
w.template?.variables,
|
|
163
|
+
w.optionResolver,
|
|
164
|
+
w.requester,
|
|
165
|
+
w.allowedRemoteOrigins,
|
|
166
|
+
w.remoteRequestTimeoutMs,
|
|
167
|
+
w.remoteOptionsCacheTtlMs
|
|
168
168
|
], () => {
|
|
169
|
-
|
|
169
|
+
Ft();
|
|
170
170
|
}, {
|
|
171
171
|
deep: !0,
|
|
172
172
|
immediate: !0
|
|
173
|
-
}), x(() =>
|
|
174
|
-
let t = c(
|
|
175
|
-
|
|
176
|
-
}, { deep: !0 }), x(() =>
|
|
177
|
-
e === "inline" && (
|
|
178
|
-
}), x(() =>
|
|
173
|
+
}), x(() => w.values, (e) => {
|
|
174
|
+
let t = c(w.template, e);
|
|
175
|
+
en(t, D.value) || (G(t, !1, { refreshInlineHtml: w.interactionMode !== "inline" }), wt());
|
|
176
|
+
}, { deep: !0 }), x(() => w.interactionMode, (e) => {
|
|
177
|
+
e === "inline" && (qe.value = { ...D.value });
|
|
178
|
+
}), x(() => w.collapsiblePanel, (e) => {
|
|
179
179
|
e || (z.value = !1);
|
|
180
|
-
}), x(() =>
|
|
180
|
+
}), x(() => w.zoom, (e) => I.value = $t(e)), x(W, (e) => {
|
|
181
181
|
!F.value && e.length && (F.value = e[0].id);
|
|
182
182
|
}, { immediate: !0 });
|
|
183
183
|
function G(e, t = !0, n = {}) {
|
|
184
|
-
|
|
184
|
+
D.value = { ...e }, n.refreshInlineHtml !== !1 && (qe.value = { ...e }), t && (T("update:values", { ...D.value }), T("change", { ...D.value }));
|
|
185
185
|
}
|
|
186
186
|
function K(e, t) {
|
|
187
|
-
!e ||
|
|
188
|
-
|
|
187
|
+
if (!e || $e.value) return;
|
|
188
|
+
if (G({
|
|
189
|
+
...D.value,
|
|
189
190
|
[e]: t
|
|
190
|
-
}, !0, { refreshInlineHtml:
|
|
191
|
+
}, !0, { refreshInlineHtml: w.interactionMode !== "inline" }), O.value) {
|
|
192
|
+
bt();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
let n = U.value.find((t) => t.key === e);
|
|
196
|
+
n && (n.type ?? "text") === "text" && (A.value = [...A.value.filter((t) => t.variableKey !== e), ...re(n, t)], T("validate", H.value));
|
|
191
197
|
}
|
|
192
|
-
function
|
|
193
|
-
if (
|
|
198
|
+
function mt(e) {
|
|
199
|
+
if (w.interactionMode !== "inline") return;
|
|
194
200
|
let t = e.target;
|
|
195
201
|
if (!(t instanceof HTMLInputElement) && !(t instanceof HTMLTextAreaElement)) return;
|
|
196
202
|
let n = t.dataset.key || "";
|
|
197
203
|
n && (t instanceof HTMLInputElement && t.type === "checkbox" ? K(n, t.checked) : t instanceof HTMLInputElement && t.type === "number" ? K(n, t.value === "" ? void 0 : t.valueAsNumber) : K(n, t.value));
|
|
198
204
|
}
|
|
199
|
-
function
|
|
205
|
+
function ht(e) {
|
|
200
206
|
let t = e.target;
|
|
201
207
|
if (!(t instanceof Element)) return;
|
|
202
208
|
let n = t.closest("[data-render-page-id]");
|
|
@@ -204,9 +210,9 @@ var Te = {
|
|
|
204
210
|
let r = t.closest("[data-contract-render-wrapper], [data-contract-render-control]")?.dataset.key || "";
|
|
205
211
|
r && X(r);
|
|
206
212
|
}
|
|
207
|
-
function
|
|
213
|
+
function gt(e) {
|
|
208
214
|
let t = W.value.find((t) => t.id === e.pageId), n = U.value.some((t) => t.key === e.key);
|
|
209
|
-
if (!(!t || !n || !
|
|
215
|
+
if (!(!t || !n || !qt(t.contentHtml).has(e.key)) && !(e.kind === "input" && w.interactionMode !== "inline")) {
|
|
210
216
|
if (F.value = e.pageId, e.kind === "input") {
|
|
211
217
|
K(e.key, e.value);
|
|
212
218
|
return;
|
|
@@ -214,122 +220,122 @@ var Te = {
|
|
|
214
220
|
X(e.key);
|
|
215
221
|
}
|
|
216
222
|
}
|
|
217
|
-
function
|
|
223
|
+
function _t(e) {
|
|
218
224
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
219
225
|
let t = e.target;
|
|
220
226
|
!(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), X(t.dataset.key));
|
|
221
227
|
}
|
|
222
|
-
function gt() {
|
|
223
|
-
return { ...O.value };
|
|
224
|
-
}
|
|
225
|
-
function _t(e) {
|
|
226
|
-
G(c(T.template, e));
|
|
227
|
-
}
|
|
228
228
|
function vt() {
|
|
229
|
-
|
|
230
|
-
return Ct(e), E("validate", e), e;
|
|
229
|
+
return { ...D.value };
|
|
231
230
|
}
|
|
232
|
-
function yt() {
|
|
233
|
-
|
|
234
|
-
if ((T.validateOnSubmit || e.length) && (Ct(e), E("validate", e)), e.length) return Ot(e[0]), !1;
|
|
235
|
-
let t = gt();
|
|
236
|
-
return E("submit", t), t;
|
|
231
|
+
function yt(e) {
|
|
232
|
+
G(c(w.template, e));
|
|
237
233
|
}
|
|
238
234
|
function bt() {
|
|
239
|
-
|
|
235
|
+
let e = ne(w.template, D.value);
|
|
236
|
+
return Tt(e), T("validate", e), e;
|
|
240
237
|
}
|
|
241
238
|
function xt() {
|
|
242
|
-
|
|
239
|
+
let e = ee(w.template, D.value, w.validateOnSubmit);
|
|
240
|
+
if ((w.validateOnSubmit || e.length) && (Tt(e), T("validate", e)), e.length) return At(e[0]), !1;
|
|
241
|
+
let t = vt();
|
|
242
|
+
return T("submit", t), t;
|
|
243
|
+
}
|
|
244
|
+
function St() {
|
|
245
|
+
return G(a(w.template)), wt(), vt();
|
|
246
|
+
}
|
|
247
|
+
function Ct() {
|
|
248
|
+
$e.value || ye.confirm({
|
|
243
249
|
title: "重置填写内容?",
|
|
244
250
|
content: "将恢复模板中的默认值,当前未提交的填写内容会被覆盖。",
|
|
245
251
|
okText: "确认重置",
|
|
246
252
|
cancelText: "取消",
|
|
247
|
-
onOk: () =>
|
|
253
|
+
onOk: () => St()
|
|
248
254
|
});
|
|
249
255
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
256
|
+
function wt() {
|
|
257
|
+
A.value = [], O.value = !1, k.value = [], j.value = !1, M.value = !1, J();
|
|
252
258
|
}
|
|
253
|
-
function
|
|
254
|
-
if (A.value =
|
|
259
|
+
function Tt(e) {
|
|
260
|
+
if (A.value = [], k.value = e, O.value = !0, j.value = !1, e.length) {
|
|
255
261
|
M.value = !1, J();
|
|
256
262
|
return;
|
|
257
263
|
}
|
|
258
|
-
|
|
264
|
+
Et();
|
|
259
265
|
}
|
|
260
266
|
let q;
|
|
261
267
|
function J() {
|
|
262
268
|
q &&= (clearTimeout(q), void 0);
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function Et() {
|
|
265
271
|
J(), M.value = !0, q = setTimeout(() => {
|
|
266
272
|
M.value = !1, q = void 0;
|
|
267
|
-
},
|
|
273
|
+
}, Ve);
|
|
268
274
|
}
|
|
269
275
|
function Y(e) {
|
|
270
276
|
X(e, !0);
|
|
271
277
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
278
|
+
function Dt(e) {
|
|
279
|
+
w.interactionMode === "panel" && (z.value &&= !1, U.value.some((t) => t.key === e) && !at.value.some((t) => t.key === e) && Ut());
|
|
274
280
|
}
|
|
275
281
|
function X(e, t = !1) {
|
|
276
282
|
if (!e) return;
|
|
277
|
-
|
|
278
|
-
let n =
|
|
279
|
-
n && (F.value = n), t && (
|
|
280
|
-
|
|
281
|
-
let r = n ?
|
|
283
|
+
Dt(e), P.value = e, N.value = e;
|
|
284
|
+
let n = it.value.get(e);
|
|
285
|
+
n && (F.value = n), t && (Je.value += 1), g(() => {
|
|
286
|
+
kt(e);
|
|
287
|
+
let r = n ? E.value?.querySelector(`[data-render-page-id="${$(n)}"]`) : void 0;
|
|
282
288
|
t && r?.scrollIntoView({
|
|
283
289
|
behavior: "smooth",
|
|
284
290
|
block: "center",
|
|
285
291
|
inline: "center"
|
|
286
|
-
}),
|
|
292
|
+
}), w.interactionMode === "panel" && Ke.value?.querySelector(`[data-field-key="${$(e)}"]`)?.scrollIntoView({
|
|
287
293
|
behavior: "smooth",
|
|
288
294
|
block: "nearest"
|
|
289
295
|
});
|
|
290
296
|
});
|
|
291
297
|
}
|
|
292
|
-
function
|
|
293
|
-
P.value = "", N.value = "",
|
|
294
|
-
}
|
|
295
|
-
function Dt(e) {
|
|
296
|
-
D.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
|
|
297
|
-
}
|
|
298
|
-
function Ot(e) {
|
|
299
|
-
e.variableKey ? (Y(e.variableKey), T.interactionMode === "panel" && g(() => Ut(e.variableKey))) : e.pageId && Xt(e.pageId);
|
|
298
|
+
function Ot() {
|
|
299
|
+
P.value = "", N.value = "", kt("");
|
|
300
300
|
}
|
|
301
301
|
function kt(e) {
|
|
302
|
-
|
|
302
|
+
E.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
|
|
303
303
|
}
|
|
304
304
|
function At(e) {
|
|
305
|
-
|
|
305
|
+
e.variableKey ? (Y(e.variableKey), w.interactionMode === "panel" && g(() => Gt(e.variableKey))) : e.pageId && Qt(e.pageId);
|
|
306
|
+
}
|
|
307
|
+
function jt(e) {
|
|
308
|
+
return rt.value.get(e) ?? [];
|
|
309
|
+
}
|
|
310
|
+
function Mt(e) {
|
|
311
|
+
return Ye.value.get(e.key) ?? {
|
|
306
312
|
options: e.options ?? [],
|
|
307
313
|
loading: !1
|
|
308
314
|
};
|
|
309
315
|
}
|
|
310
|
-
function
|
|
316
|
+
function Nt(e) {
|
|
311
317
|
let t = e.componentKey || e.type || "";
|
|
312
|
-
return t ?
|
|
318
|
+
return t ? w.controlRegistry?.[t] : void 0;
|
|
313
319
|
}
|
|
314
320
|
function Z(e, t) {
|
|
315
|
-
let n = new Map(
|
|
316
|
-
n.set(e, t),
|
|
321
|
+
let n = new Map(Ye.value);
|
|
322
|
+
n.set(e, t), Ye.value = n;
|
|
317
323
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
324
|
+
function Pt(e) {
|
|
325
|
+
T("control-warning", e);
|
|
320
326
|
}
|
|
321
|
-
async function
|
|
322
|
-
B.forEach((e) => e.abort()), B.clear(),
|
|
323
|
-
let e = Array.isArray(
|
|
327
|
+
async function Ft() {
|
|
328
|
+
B.forEach((e) => e.abort()), B.clear(), Xe.clear(), Ze.clear();
|
|
329
|
+
let e = Array.isArray(w.template?.variables) ? w.template.variables : [];
|
|
324
330
|
await Promise.all(e.map(async (e) => {
|
|
325
331
|
if (!e?.key) return;
|
|
326
332
|
let t = Array.isArray(e.options) ? e.options.map((e) => ({ ...e })) : [];
|
|
327
|
-
if (e.dataSource ? await
|
|
333
|
+
if (e.dataSource ? await It(e, t) : Z(e.key, {
|
|
328
334
|
options: t,
|
|
329
335
|
loading: !1
|
|
330
|
-
}), e.type === "custom" && !
|
|
336
|
+
}), e.type === "custom" && !Nt(e)) {
|
|
331
337
|
let t = e.componentKey || "", n = `${e.key}:${t}`;
|
|
332
|
-
|
|
338
|
+
Ze.has(n) || (Ze.add(n), Pt({
|
|
333
339
|
code: "CONTROL_COMPONENT_MISSING",
|
|
334
340
|
variableKey: e.key,
|
|
335
341
|
componentKey: t,
|
|
@@ -338,7 +344,7 @@ var Te = {
|
|
|
338
344
|
}
|
|
339
345
|
}));
|
|
340
346
|
}
|
|
341
|
-
async function
|
|
347
|
+
async function It(e, n) {
|
|
342
348
|
let r = e.dataSource;
|
|
343
349
|
if (!r) return;
|
|
344
350
|
let i = new AbortController();
|
|
@@ -346,7 +352,7 @@ var Te = {
|
|
|
346
352
|
options: n,
|
|
347
353
|
loading: !0
|
|
348
354
|
});
|
|
349
|
-
let a =
|
|
355
|
+
let a = Lt(e), o = Date.now(), s = Xe.get(a);
|
|
350
356
|
if (s && s.expiresAt > o) {
|
|
351
357
|
Z(e.key, {
|
|
352
358
|
options: s.options,
|
|
@@ -356,15 +362,15 @@ var Te = {
|
|
|
356
362
|
}
|
|
357
363
|
let c = "CONTROL_OPTIONS_LOAD_FAILED";
|
|
358
364
|
try {
|
|
359
|
-
r.kind === "url" && !t(r.url,
|
|
365
|
+
r.kind === "url" && !t(r.url, w.allowedRemoteOrigins) && (c = "CONTROL_REMOTE_URL_BLOCKED");
|
|
360
366
|
let o = V.get(a);
|
|
361
|
-
o || (o =
|
|
367
|
+
o || (o = Rt(e, r, c, i), V.set(a, o), o.finally(() => {
|
|
362
368
|
V.get(a) === o && V.delete(a);
|
|
363
369
|
}).catch(() => void 0));
|
|
364
370
|
let s = await o;
|
|
365
371
|
if (i.signal.aborted) return;
|
|
366
|
-
let ee = Math.max(0, Number(
|
|
367
|
-
ee > 0 &&
|
|
372
|
+
let ee = Math.max(0, Number(w.remoteOptionsCacheTtlMs) || 0);
|
|
373
|
+
ee > 0 && Xe.set(a, {
|
|
368
374
|
options: s,
|
|
369
375
|
expiresAt: Date.now() + ee
|
|
370
376
|
}), Z(e.key, {
|
|
@@ -379,7 +385,7 @@ var Te = {
|
|
|
379
385
|
options: n,
|
|
380
386
|
loading: !1,
|
|
381
387
|
error: a
|
|
382
|
-
}),
|
|
388
|
+
}), Pt({
|
|
383
389
|
code: c,
|
|
384
390
|
variableKey: e.key,
|
|
385
391
|
message: `${e.label || e.key}:${a}`,
|
|
@@ -389,28 +395,28 @@ var Te = {
|
|
|
389
395
|
B.get(e.key) === i && B.delete(e.key);
|
|
390
396
|
}
|
|
391
397
|
}
|
|
392
|
-
function
|
|
398
|
+
function Lt(e) {
|
|
393
399
|
try {
|
|
394
400
|
return JSON.stringify([e.type, e.dataSource]);
|
|
395
401
|
} catch {
|
|
396
402
|
return `${e.key}:${e.type}`;
|
|
397
403
|
}
|
|
398
404
|
}
|
|
399
|
-
async function
|
|
405
|
+
async function Rt(e, r, a, o) {
|
|
400
406
|
let s;
|
|
401
407
|
if (r.kind === "resolver") {
|
|
402
|
-
if (!
|
|
403
|
-
s = await
|
|
408
|
+
if (!w.optionResolver) throw Error(`缺少 resolver ${r.resolverKey} 的宿主实现`);
|
|
409
|
+
s = await w.optionResolver({
|
|
404
410
|
resolverKey: r.resolverKey,
|
|
405
411
|
params: r.params,
|
|
406
412
|
variable: e,
|
|
407
413
|
signal: o.signal
|
|
408
414
|
});
|
|
409
415
|
} else {
|
|
410
|
-
if (!t(r.url,
|
|
411
|
-
if (!
|
|
412
|
-
let n = i(r.timeoutMs,
|
|
413
|
-
s = await
|
|
416
|
+
if (!t(r.url, w.allowedRemoteOrigins)) throw Error(`远程地址未在 allowlist 中:${r.url}`);
|
|
417
|
+
if (!w.requester) throw Error("缺少宿主 requester,组件库不会直接发起网络请求");
|
|
418
|
+
let n = i(r.timeoutMs, w.remoteRequestTimeoutMs);
|
|
419
|
+
s = await zt(w.requester({
|
|
414
420
|
url: r.url,
|
|
415
421
|
method: r.method || "GET",
|
|
416
422
|
params: r.params,
|
|
@@ -422,7 +428,7 @@ var Te = {
|
|
|
422
428
|
}
|
|
423
429
|
return n(s, r.kind === "url" ? r : void 0, e.type || "select");
|
|
424
430
|
}
|
|
425
|
-
function
|
|
431
|
+
function zt(e, t, n) {
|
|
426
432
|
return new Promise((r, i) => {
|
|
427
433
|
let a = () => {
|
|
428
434
|
clearTimeout(c), t.signal.removeEventListener("abort", s);
|
|
@@ -434,15 +440,15 @@ var Te = {
|
|
|
434
440
|
t.signal.addEventListener("abort", s, { once: !0 }), e.then((e) => o(() => r(e)), (e) => o(() => i(e)));
|
|
435
441
|
});
|
|
436
442
|
}
|
|
437
|
-
function
|
|
438
|
-
let t =
|
|
443
|
+
function Bt(e) {
|
|
444
|
+
let t = Mt(e);
|
|
439
445
|
return {
|
|
440
446
|
variable: e,
|
|
441
|
-
value:
|
|
442
|
-
errors:
|
|
447
|
+
value: D.value[e.key],
|
|
448
|
+
errors: jt(e.key),
|
|
443
449
|
active: P.value === e.key,
|
|
444
|
-
readonly:
|
|
445
|
-
disabled:
|
|
450
|
+
readonly: w.readonly,
|
|
451
|
+
disabled: w.disabled,
|
|
446
452
|
options: t.options,
|
|
447
453
|
loading: t.loading,
|
|
448
454
|
loadError: t.error,
|
|
@@ -450,42 +456,42 @@ var Te = {
|
|
|
450
456
|
focusVariable: () => Y(e.key)
|
|
451
457
|
};
|
|
452
458
|
}
|
|
453
|
-
function
|
|
459
|
+
function Vt() {
|
|
454
460
|
let e = U.value;
|
|
455
461
|
if (!e.length) return;
|
|
456
462
|
let t = e.findIndex((e) => e.key === P.value), n = t < 0 ? 0 : t + 1;
|
|
457
463
|
for (let t = 0; t < e.length; t += 1) {
|
|
458
464
|
let r = e[(n + t) % e.length];
|
|
459
|
-
if (s(
|
|
465
|
+
if (s(D.value[r.key])) {
|
|
460
466
|
Y(r.key);
|
|
461
467
|
return;
|
|
462
468
|
}
|
|
463
469
|
}
|
|
464
470
|
}
|
|
465
|
-
function
|
|
471
|
+
function Ht(e) {
|
|
466
472
|
let t = L.value.trim().toLocaleLowerCase();
|
|
467
|
-
return !t || e.key.toLocaleLowerCase().includes(t) || (e.label ?? "").toLocaleLowerCase().includes(t) ? R.value === "unfilled" ? s(
|
|
473
|
+
return !t || e.key.toLocaleLowerCase().includes(t) || (e.label ?? "").toLocaleLowerCase().includes(t) ? R.value === "unfilled" ? s(D.value[e.key]) : R.value === "error" ? jt(e.key).length > 0 : !0 : !1;
|
|
468
474
|
}
|
|
469
|
-
function
|
|
475
|
+
function Ut() {
|
|
470
476
|
L.value = "", R.value = "all";
|
|
471
477
|
}
|
|
472
|
-
function
|
|
473
|
-
let n =
|
|
478
|
+
function Wt(e, t) {
|
|
479
|
+
let n = at.value;
|
|
474
480
|
if (!n.length) return;
|
|
475
481
|
let r = n.findIndex((t) => t.key === e), i = n[r < 0 ? 0 : (r + t + n.length) % n.length]?.key;
|
|
476
|
-
i && (Y(i), g(() =>
|
|
482
|
+
i && (Y(i), g(() => Gt(i)));
|
|
477
483
|
}
|
|
478
|
-
function
|
|
479
|
-
(
|
|
484
|
+
function Gt(e) {
|
|
485
|
+
(Ke.value?.querySelector(`[data-field-key="${$(e)}"]`))?.querySelector("input:not([disabled]), textarea:not([disabled]), button:not([disabled])")?.focus();
|
|
480
486
|
}
|
|
481
|
-
function
|
|
487
|
+
function Kt(e) {
|
|
482
488
|
if (e.key !== "Enter" || e.target instanceof HTMLTextAreaElement) return;
|
|
483
489
|
let t = e.target;
|
|
484
490
|
if (!(t instanceof Element)) return;
|
|
485
491
|
let n = t.closest("[data-field-key]")?.dataset.fieldKey;
|
|
486
|
-
n && (e.preventDefault(),
|
|
492
|
+
n && (e.preventDefault(), Wt(n, e.shiftKey ? -1 : 1));
|
|
487
493
|
}
|
|
488
|
-
function
|
|
494
|
+
function qt(e) {
|
|
489
495
|
let t = /* @__PURE__ */ new Set();
|
|
490
496
|
if (typeof DOMParser < "u") return new DOMParser().parseFromString(e, "text/html").querySelectorAll("[data-key]").forEach((e) => {
|
|
491
497
|
let n = e.getAttribute("data-key")?.trim();
|
|
@@ -498,100 +504,100 @@ var Te = {
|
|
|
498
504
|
}
|
|
499
505
|
return t;
|
|
500
506
|
}
|
|
501
|
-
function
|
|
502
|
-
!
|
|
507
|
+
function Jt() {
|
|
508
|
+
!w.collapsiblePanel || w.interactionMode !== "panel" || (z.value = !z.value);
|
|
503
509
|
}
|
|
504
510
|
function Q(e) {
|
|
505
|
-
let t =
|
|
506
|
-
return I.value = t,
|
|
511
|
+
let t = $t(e);
|
|
512
|
+
return I.value = t, T("update:zoom", t), t;
|
|
507
513
|
}
|
|
508
|
-
function
|
|
514
|
+
function Yt() {
|
|
509
515
|
return Q(1);
|
|
510
516
|
}
|
|
511
|
-
function
|
|
517
|
+
function Xt() {
|
|
512
518
|
return I.value;
|
|
513
519
|
}
|
|
514
|
-
function
|
|
520
|
+
function Zt() {
|
|
515
521
|
let e = Math.max(...W.value.map((e) => e.width), 1);
|
|
516
|
-
return Q(Math.max(0,
|
|
522
|
+
return Q(Math.max(0, Qe.value - 48) / e);
|
|
517
523
|
}
|
|
518
|
-
function
|
|
524
|
+
function Qt(e) {
|
|
519
525
|
e && (F.value = e, g(() => {
|
|
520
|
-
|
|
526
|
+
E.value?.querySelector(`[data-render-page-id="${$(e)}"]`)?.scrollIntoView({
|
|
521
527
|
behavior: "smooth",
|
|
522
528
|
block: "start",
|
|
523
529
|
inline: "center"
|
|
524
530
|
});
|
|
525
531
|
}));
|
|
526
532
|
}
|
|
527
|
-
function
|
|
533
|
+
function $t(e) {
|
|
528
534
|
let t = Number(e);
|
|
529
|
-
return Number.isFinite(t) ? Math.min(
|
|
535
|
+
return Number.isFinite(t) ? Math.min(Be, Math.max(ze, Math.round(t * 100) / 100)) : 1;
|
|
530
536
|
}
|
|
531
537
|
function $(e) {
|
|
532
538
|
return e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
533
539
|
}
|
|
534
|
-
function
|
|
540
|
+
function en(e, t) {
|
|
535
541
|
let n = new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
536
542
|
return Array.from(n).every((n) => e[n] === t[n]);
|
|
537
543
|
}
|
|
538
|
-
function
|
|
539
|
-
!(e.ctrlKey || e.metaKey) || !
|
|
544
|
+
function tn(e) {
|
|
545
|
+
!(e.ctrlKey || e.metaKey) || !st.value || (e.preventDefault(), Q(e.deltaY > 0 ? I.value - C : I.value + C));
|
|
540
546
|
}
|
|
541
|
-
let
|
|
542
|
-
function
|
|
543
|
-
|
|
547
|
+
let nn;
|
|
548
|
+
function rn() {
|
|
549
|
+
nn?.removeEventListener("wheel", tn), nn = void 0;
|
|
544
550
|
}
|
|
545
|
-
function
|
|
546
|
-
|
|
551
|
+
function an(e) {
|
|
552
|
+
rn(), e && (e.addEventListener("wheel", tn, { passive: !1 }), nn = e);
|
|
547
553
|
}
|
|
548
|
-
return x(
|
|
549
|
-
|
|
550
|
-
}, { immediate: !0 }),
|
|
551
|
-
|
|
552
|
-
}),
|
|
553
|
-
showValidation:
|
|
554
|
+
return x(E, (e) => {
|
|
555
|
+
an(e);
|
|
556
|
+
}, { immediate: !0 }), pe(() => {
|
|
557
|
+
rn(), J(), B.forEach((e) => e.abort()), B.clear();
|
|
558
|
+
}), He({
|
|
559
|
+
showValidation: Tt,
|
|
554
560
|
focusError: (e) => {
|
|
555
|
-
|
|
561
|
+
At(e), e.variableKey && g(() => Gt(e.variableKey));
|
|
556
562
|
},
|
|
557
|
-
getValues:
|
|
558
|
-
setValues:
|
|
559
|
-
validate:
|
|
560
|
-
submit:
|
|
561
|
-
resetValues:
|
|
563
|
+
getValues: vt,
|
|
564
|
+
setValues: yt,
|
|
565
|
+
validate: bt,
|
|
566
|
+
submit: xt,
|
|
567
|
+
resetValues: St,
|
|
562
568
|
scrollToVariable: Y,
|
|
563
569
|
setZoom: Q,
|
|
564
|
-
resetZoom:
|
|
565
|
-
getZoom:
|
|
566
|
-
fitWidth:
|
|
567
|
-
scrollToPage:
|
|
570
|
+
resetZoom: Yt,
|
|
571
|
+
getZoom: Xt,
|
|
572
|
+
fitWidth: Zt,
|
|
573
|
+
scrollToPage: Qt
|
|
568
574
|
}), (e, t) => (_(), f("section", {
|
|
569
575
|
ref_key: "rendererElement",
|
|
570
|
-
ref:
|
|
571
|
-
class:
|
|
576
|
+
ref: Ge,
|
|
577
|
+
class: fe(["gd-contract-template-renderer", {
|
|
572
578
|
"is-disabled": h.disabled,
|
|
573
579
|
"is-readonly": h.readonly,
|
|
574
580
|
"is-panel": h.interactionMode === "panel",
|
|
575
581
|
"is-inline": h.interactionMode === "inline"
|
|
576
582
|
}]),
|
|
577
|
-
onClick:
|
|
578
|
-
onKeydown:
|
|
579
|
-
onInput:
|
|
580
|
-
onChange:
|
|
583
|
+
onClick: ht,
|
|
584
|
+
onKeydown: _t,
|
|
585
|
+
onInput: mt,
|
|
586
|
+
onChange: mt
|
|
581
587
|
}, [
|
|
582
|
-
|
|
583
|
-
|
|
588
|
+
he(e.$slots, "fileBar"),
|
|
589
|
+
st.value ? (_(), u(ae, {
|
|
584
590
|
key: 0,
|
|
585
591
|
title: h.title,
|
|
586
|
-
"filled-count":
|
|
592
|
+
"filled-count": ct.value,
|
|
587
593
|
"total-count": U.value.length,
|
|
588
|
-
"progress-percent":
|
|
589
|
-
"required-missing-count":
|
|
594
|
+
"progress-percent": ut.value,
|
|
595
|
+
"required-missing-count": lt.value,
|
|
590
596
|
zoom: I.value,
|
|
591
597
|
pages: W.value,
|
|
592
598
|
"active-page-id": F.value,
|
|
593
|
-
"min-zoom":
|
|
594
|
-
"max-zoom":
|
|
599
|
+
"min-zoom": ze,
|
|
600
|
+
"max-zoom": Be,
|
|
595
601
|
"show-toolbar": h.showToolbar,
|
|
596
602
|
"show-validate-button": h.showValidateButton,
|
|
597
603
|
"show-reset-button": h.showResetButton,
|
|
@@ -600,17 +606,17 @@ var Te = {
|
|
|
600
606
|
"panel-collapsed": z.value,
|
|
601
607
|
readonly: h.readonly,
|
|
602
608
|
disabled: h.disabled,
|
|
603
|
-
onZoomIn: t[0] ||= (e) => Q(I.value +
|
|
604
|
-
onZoomOut: t[1] ||= (e) => Q(I.value -
|
|
605
|
-
onResetZoom:
|
|
606
|
-
onFitWidth:
|
|
607
|
-
onSelectPage:
|
|
608
|
-
onValidate:
|
|
609
|
-
onReset:
|
|
610
|
-
onSubmit:
|
|
611
|
-
onTogglePanel:
|
|
609
|
+
onZoomIn: t[0] ||= (e) => Q(I.value + C),
|
|
610
|
+
onZoomOut: t[1] ||= (e) => Q(I.value - C),
|
|
611
|
+
onResetZoom: Yt,
|
|
612
|
+
onFitWidth: Zt,
|
|
613
|
+
onSelectPage: Qt,
|
|
614
|
+
onValidate: bt,
|
|
615
|
+
onReset: Ct,
|
|
616
|
+
onSubmit: xt,
|
|
617
|
+
onTogglePanel: Jt
|
|
612
618
|
}, {
|
|
613
|
-
extra: S(() => [
|
|
619
|
+
extra: S(() => [he(e.$slots, "headerExtra")]),
|
|
614
620
|
_: 3
|
|
615
621
|
}, 8, [
|
|
616
622
|
"title",
|
|
@@ -630,29 +636,29 @@ var Te = {
|
|
|
630
636
|
"readonly",
|
|
631
637
|
"disabled"
|
|
632
638
|
])) : d("", !0),
|
|
633
|
-
|
|
639
|
+
pt.value ? (_(), u(se, {
|
|
634
640
|
key: 1,
|
|
635
|
-
passed:
|
|
636
|
-
summary:
|
|
637
|
-
errors:
|
|
641
|
+
passed: dt.value,
|
|
642
|
+
summary: ft.value,
|
|
643
|
+
errors: H.value,
|
|
638
644
|
expanded: j.value,
|
|
639
645
|
onToggle: t[2] ||= (e) => j.value = !j.value,
|
|
640
|
-
onFocusError:
|
|
646
|
+
onFocusError: At
|
|
641
647
|
}, null, 8, [
|
|
642
648
|
"passed",
|
|
643
649
|
"summary",
|
|
644
650
|
"errors",
|
|
645
651
|
"expanded"
|
|
646
652
|
])) : d("", !0),
|
|
647
|
-
|
|
653
|
+
st.value ? (_(), f("div", {
|
|
648
654
|
key: 3,
|
|
649
|
-
class:
|
|
655
|
+
class: fe(["gd-contract-template-renderer__workspace", { "is-inline": h.interactionMode === "inline" }])
|
|
650
656
|
}, [p("div", {
|
|
651
657
|
ref_key: "pagesViewportElement",
|
|
652
|
-
ref:
|
|
658
|
+
ref: E,
|
|
653
659
|
class: "gd-contract-template-renderer__pages-viewport",
|
|
654
660
|
"data-highlighted-variable-key": N.value
|
|
655
|
-
}, [p("div",
|
|
661
|
+
}, [p("div", ke, [(_(!0), f(ce, null, me(W.value, (e, t) => (_(), u(oe, {
|
|
656
662
|
key: e.id,
|
|
657
663
|
page: e,
|
|
658
664
|
index: t,
|
|
@@ -661,8 +667,8 @@ var Te = {
|
|
|
661
667
|
"show-meta": h.showPageMeta,
|
|
662
668
|
"font-base-url": h.contractFontBaseUrl,
|
|
663
669
|
"active-key": N.value,
|
|
664
|
-
"scroll-request":
|
|
665
|
-
onInteraction:
|
|
670
|
+
"scroll-request": Je.value,
|
|
671
|
+
onInteraction: gt
|
|
666
672
|
}, null, 8, [
|
|
667
673
|
"page",
|
|
668
674
|
"index",
|
|
@@ -672,10 +678,10 @@ var Te = {
|
|
|
672
678
|
"font-base-url",
|
|
673
679
|
"active-key",
|
|
674
680
|
"scroll-request"
|
|
675
|
-
]))), 128))])], 8,
|
|
681
|
+
]))), 128))])], 8, Oe), h.interactionMode === "panel" ? (_(), f("div", {
|
|
676
682
|
key: 0,
|
|
677
|
-
class:
|
|
678
|
-
}, [h.collapsiblePanel ? (_(), u(b(
|
|
683
|
+
class: fe(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": z.value && h.collapsiblePanel }])
|
|
684
|
+
}, [h.collapsiblePanel ? (_(), u(b(Se), {
|
|
679
685
|
key: 0,
|
|
680
686
|
title: z.value ? "展开填写面板" : "收起填写面板"
|
|
681
687
|
}, {
|
|
@@ -685,17 +691,17 @@ var Te = {
|
|
|
685
691
|
"aria-label": z.value ? "展开填写面板" : "收起填写面板",
|
|
686
692
|
"aria-expanded": !z.value,
|
|
687
693
|
onClick: t[3] ||= (e) => z.value = !z.value
|
|
688
|
-
}, [z.value ? (_(), u(b(
|
|
694
|
+
}, [z.value ? (_(), u(b(we), {
|
|
689
695
|
key: 0,
|
|
690
696
|
"aria-hidden": "true"
|
|
691
|
-
})) : (_(), u(b(
|
|
697
|
+
})) : (_(), u(b(Te), {
|
|
692
698
|
key: 1,
|
|
693
699
|
"aria-hidden": "true"
|
|
694
|
-
}))], 8,
|
|
700
|
+
}))], 8, Ae)]),
|
|
695
701
|
_: 1
|
|
696
|
-
}, 8, ["title"])) : d("", !0), p("div",
|
|
697
|
-
p("div",
|
|
698
|
-
m(b(
|
|
702
|
+
}, 8, ["title"])) : d("", !0), p("div", je, [p("aside", Me, [p("div", Ne, [
|
|
703
|
+
p("div", Pe, [p("div", null, [t[6] ||= p("strong", null, "填写项", -1), p("span", null, y(ct.value) + " / " + y(U.value.length) + " 已填写", 1)]), p("span", null, y(lt.value ? `${lt.value} 项必填未完成` : "必填项已完成"), 1)]),
|
|
704
|
+
m(b(ve), {
|
|
699
705
|
value: L.value,
|
|
700
706
|
"onUpdate:value": t[4] ||= (e) => L.value = e,
|
|
701
707
|
"allow-clear": "",
|
|
@@ -703,51 +709,51 @@ var Te = {
|
|
|
703
709
|
class: "gd-contract-template-renderer__field-search",
|
|
704
710
|
placeholder: "搜索字段名称或标识"
|
|
705
711
|
}, {
|
|
706
|
-
prefix: S(() => [m(b(
|
|
712
|
+
prefix: S(() => [m(b(Ee), { "aria-hidden": "true" })]),
|
|
707
713
|
_: 1
|
|
708
714
|
}, 8, ["value"]),
|
|
709
|
-
p("div",
|
|
715
|
+
p("div", Fe, [m(b(xe), {
|
|
710
716
|
value: R.value,
|
|
711
717
|
"onUpdate:value": t[5] ||= (e) => R.value = e,
|
|
712
718
|
size: "small",
|
|
713
719
|
class: "gd-contract-template-renderer__field-filter",
|
|
714
|
-
options:
|
|
715
|
-
}, null, 8, ["value"]), m(b(
|
|
720
|
+
options: We
|
|
721
|
+
}, null, 8, ["value"]), m(b(ge), {
|
|
716
722
|
size: "small",
|
|
717
|
-
disabled: !
|
|
718
|
-
onClick:
|
|
723
|
+
disabled: !nt.value,
|
|
724
|
+
onClick: Vt
|
|
719
725
|
}, {
|
|
720
|
-
default: S(() => [...t[7] ||= [
|
|
726
|
+
default: S(() => [...t[7] ||= [ue(" 下一个未填项 ", -1)]]),
|
|
721
727
|
_: 1
|
|
722
728
|
}, 8, ["disabled"])]),
|
|
723
|
-
m(b(
|
|
724
|
-
percent:
|
|
729
|
+
m(b(be), {
|
|
730
|
+
percent: ut.value,
|
|
725
731
|
size: "small",
|
|
726
732
|
"show-info": !1
|
|
727
733
|
}, null, 8, ["percent"])
|
|
728
|
-
]),
|
|
734
|
+
]), at.value.length ? (_(), f("div", {
|
|
729
735
|
key: 1,
|
|
730
736
|
ref_key: "fieldListElement",
|
|
731
|
-
ref:
|
|
737
|
+
ref: Ke,
|
|
732
738
|
class: "gd-contract-template-renderer__field-list",
|
|
733
|
-
onKeydownCapture:
|
|
734
|
-
}, [(_(!0), f(
|
|
739
|
+
onKeydownCapture: Kt
|
|
740
|
+
}, [(_(!0), f(ce, null, me(ot.value, (t) => (_(), f("div", {
|
|
735
741
|
key: t.id,
|
|
736
742
|
class: "gd-contract-template-renderer__field-group"
|
|
737
|
-
}, [p("div",
|
|
743
|
+
}, [p("div", Ie, [p("strong", null, y(t.title), 1), p("span", null, y(t.variables.length) + " / " + y(t.totalCount) + " 项", 1)]), p("div", Le, [(_(!0), f(ce, null, me(t.variables, (t) => (_(), f("div", {
|
|
738
744
|
key: t.id || t.key,
|
|
739
745
|
"data-field-key": t.key
|
|
740
|
-
}, [
|
|
746
|
+
}, [he(e.$slots, "field", de({ ref_for: !0 }, Bt(t)), () => [m(ie, {
|
|
741
747
|
variable: t,
|
|
742
|
-
value:
|
|
743
|
-
errors:
|
|
748
|
+
value: D.value[t.key],
|
|
749
|
+
errors: jt(t.key),
|
|
744
750
|
active: P.value === t.key,
|
|
745
751
|
readonly: h.readonly,
|
|
746
752
|
disabled: h.disabled,
|
|
747
|
-
options:
|
|
748
|
-
loading:
|
|
749
|
-
"load-error":
|
|
750
|
-
registration:
|
|
753
|
+
options: Mt(t).options,
|
|
754
|
+
loading: Mt(t).loading,
|
|
755
|
+
"load-error": Mt(t).error,
|
|
756
|
+
registration: Nt(t),
|
|
751
757
|
"selector-http": h.selectorHttp,
|
|
752
758
|
"selector-url-prefix": h.selectorUrlPrefix,
|
|
753
759
|
onUpdateValue: (e) => K(t.key, e),
|
|
@@ -767,19 +773,19 @@ var Te = {
|
|
|
767
773
|
"selector-url-prefix",
|
|
768
774
|
"onUpdateValue",
|
|
769
775
|
"onFocusVariable"
|
|
770
|
-
])])], 8,
|
|
776
|
+
])])], 8, Re))), 128))])]))), 128))], 544)) : (_(), u(b(_e), {
|
|
771
777
|
key: 0,
|
|
772
778
|
class: "gd-contract-template-renderer__field-empty",
|
|
773
779
|
description: U.value.length ? "没有符合条件的填写项" : "暂无填写项",
|
|
774
|
-
image: b(
|
|
775
|
-
},
|
|
776
|
-
default: S(() => [L.value || R.value !== "all" ? (_(), u(b(
|
|
780
|
+
image: b(_e).PRESENTED_IMAGE_SIMPLE
|
|
781
|
+
}, le({
|
|
782
|
+
default: S(() => [L.value || R.value !== "all" ? (_(), u(b(ge), {
|
|
777
783
|
key: 0,
|
|
778
784
|
type: "link",
|
|
779
785
|
size: "small",
|
|
780
|
-
onClick:
|
|
786
|
+
onClick: Ut
|
|
781
787
|
}, {
|
|
782
|
-
default: S(() => [...t[9] ||= [
|
|
788
|
+
default: S(() => [...t[9] ||= [ue("清除筛选", -1)]]),
|
|
783
789
|
_: 1
|
|
784
790
|
})) : d("", !0)]),
|
|
785
791
|
_: 2
|
|
@@ -787,12 +793,12 @@ var Te = {
|
|
|
787
793
|
name: "description",
|
|
788
794
|
fn: S(() => [t[8] ||= p("span", null, "没有符合条件的填写项", -1)]),
|
|
789
795
|
key: "0"
|
|
790
|
-
} : void 0]), 1032, ["description", "image"]))])])], 2)) : d("", !0)], 2)) : (_(), f("div",
|
|
796
|
+
} : void 0]), 1032, ["description", "image"]))])])], 2)) : d("", !0)], 2)) : (_(), f("div", De, [m(b(_e), {
|
|
791
797
|
description: "暂无可渲染的合同页面",
|
|
792
|
-
image: b(
|
|
798
|
+
image: b(_e).PRESENTED_IMAGE_SIMPLE
|
|
793
799
|
}, null, 8, ["image"])]))
|
|
794
800
|
], 34));
|
|
795
801
|
}
|
|
796
802
|
});
|
|
797
803
|
//#endregion
|
|
798
|
-
export {
|
|
804
|
+
export { He as default };
|