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