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