@guodun/antdv 1.3.2 → 1.4.0
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/index.mjs +1 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +304 -289
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +337 -326
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +41 -33
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +23 -0
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +115 -77
- package/dist/es/components/contract-signing-location/src/template-source.mjs +85 -0
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/index.mjs +8 -6
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +164 -57
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +128 -125
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +75 -49
- package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +135 -91
- package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +25 -5
- package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +5 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +347 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +171 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.mjs +166 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +4 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.mjs +36 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +202 -202
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1591 -1612
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +235 -239
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +16 -16
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +166 -166
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +100 -33
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +77 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +23 -23
- package/dist/es/components/pro-contract-template-designer/src/utils/file-tabs.mjs +14 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +121 -121
- package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +19 -0
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +23 -21
- package/dist/lib/components/contract-signing-location/index.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -0
- package/dist/lib/components/contract-signing-location/style/index.css +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- 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/SigningPlacementLayer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/file-tabs.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/contract-signing-location.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-contract-signing-flow.css +1 -1
- package/dist/types/components/contract-signing-location/index.d.ts +1 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +2 -2
- package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +6 -0
- package/dist/types/components/contract-signing-location/src/location-rules.d.ts +3 -3
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +20 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +47 -2
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +19 -3
- package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +223 -2
- package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +15 -0
- package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +12 -0
- 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 +103 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +48 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.d.ts +231 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +25 -2
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +29 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +24 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +59 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/file-tabs.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +11 -0
- package/package.json +2 -1
package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs
CHANGED
|
@@ -3,18 +3,16 @@ import { buildInitialRenderValues as t, buildTemplateRenderPages as n, isEmptyRe
|
|
|
3
3
|
import re from "./ContractTemplateRendererField.mjs";
|
|
4
4
|
import ie from "./ContractTemplateRendererHeader.mjs";
|
|
5
5
|
import ae from "./ContractTemplateRendererPage.mjs";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import oe from "./ContractTemplateRendererValidation.mjs";
|
|
7
|
+
import { Fragment as se, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as ce, createVNode as u, defineComponent as d, mergeProps as le, nextTick as ue, normalizeClass as f, onBeforeUnmount as de, openBlock as p, ref as m, renderList as fe, renderSlot as pe, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
|
|
8
|
+
import { Button as me, Empty as y, Progress as he, Tooltip as ge } from "ant-design-vue";
|
|
9
|
+
import { useElementSize as _e } from "@vueuse/core";
|
|
10
|
+
import { LeftOutlined as ve, RightOutlined as ye } from "@ant-design/icons-vue";
|
|
10
11
|
//#region src/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "gd-contract-template-renderer__validation-list"
|
|
14
|
-
}, be = ["onClick"], xe = {
|
|
12
|
+
var be = {
|
|
15
13
|
key: 2,
|
|
16
14
|
class: "gd-contract-template-renderer__empty"
|
|
17
|
-
},
|
|
15
|
+
}, xe = ["data-highlighted-variable-key"], Se = { class: "gd-contract-template-renderer__pages" }, Ce = ["aria-label", "aria-expanded"], we = { class: "gd-contract-template-renderer__panel-clip" }, Te = { class: "gd-contract-template-renderer__panel" }, Ee = { class: "gd-contract-template-renderer__panel-head" }, De = { class: "gd-contract-template-renderer__panel-head-row" }, Oe = { class: "gd-contract-template-renderer__panel-head-actions" }, ke = ["data-field-key"], Ae = .5, je = 1.5, b = .1, Me = 3e3, Ne = /* @__PURE__ */ d({
|
|
18
16
|
name: "ProContractTemplateRenderer",
|
|
19
17
|
__name: "ProContractTemplateRenderer",
|
|
20
18
|
props: {
|
|
@@ -67,265 +65,265 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
|
|
|
67
65
|
"submit",
|
|
68
66
|
"update:zoom"
|
|
69
67
|
],
|
|
70
|
-
setup(
|
|
71
|
-
let
|
|
68
|
+
setup(d, { expose: Ne, emit: Pe }) {
|
|
69
|
+
let x = d, S = Pe, Fe = m(), C = m(), Ie = m(), w = m(i(x.template, x.values)), T = m({ ...w.value }), E = m(!1), D = m([]), O = m(!1), k = m(!1), A = m(""), j = m(""), M = m(""), N = m(ft(x.zoom)), P = m(!1), F = m(!1), { width: Le } = _e(C), Re = a(() => x.readonly || x.disabled), I = a(() => te(x.template)), L = a(() => E.value ? D.value : I.value), R = a(() => (Array.isArray(x.template?.variables) ? x.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), z = a(() => P.value ? R.value.filter((e) => r(w.value[e.key])) : R.value), ze = a(() => R.value.filter((e) => r(w.value[e.key])).length), Be = a(() => {
|
|
72
70
|
let e = /* @__PURE__ */ new Map();
|
|
73
|
-
return
|
|
71
|
+
return L.value.forEach((t) => {
|
|
74
72
|
t.variableKey && e.set(t.variableKey, [...e.get(t.variableKey) ?? [], t]);
|
|
75
73
|
}), e;
|
|
76
|
-
}),
|
|
77
|
-
let e =
|
|
78
|
-
return n(
|
|
79
|
-
readonly:
|
|
80
|
-
disabled:
|
|
74
|
+
}), B = a(() => {
|
|
75
|
+
let e = x.interactionMode === "panel";
|
|
76
|
+
return n(x.template, e ? w.value : T.value, {
|
|
77
|
+
readonly: x.readonly,
|
|
78
|
+
disabled: x.disabled,
|
|
81
79
|
mode: e ? "display" : "control",
|
|
82
|
-
activeKey: e ?
|
|
80
|
+
activeKey: e ? j.value : ""
|
|
83
81
|
});
|
|
84
|
-
}),
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
}), V = a(() => B.value.length > 0), H = a(() => R.value.filter((e) => !r(w.value[e.key])).length), U = a(() => R.value.filter((e) => e.required && r(w.value[e.key])).length), Ve = a(() => R.value.length ? Math.round(H.value / R.value.length * 100) : 0), He = a(() => E.value && D.value.length === 0), Ue = a(() => E.value ? He.value ? "校验通过,模板与填写值均符合规则" : `发现 ${D.value.length} 个模板或填写问题` : I.value.length ? `模板存在 ${I.value.length} 个问题,已安全降级展示` : ""), We = a(() => E.value ? L.value.length > 0 || k.value : I.value.length > 0);
|
|
83
|
+
_(() => x.template, (e) => {
|
|
84
|
+
W(i(e, x.values), !1), J();
|
|
87
85
|
let t = Array.isArray(e?.pages) ? e.pages.map((e) => e?.id) : [];
|
|
88
|
-
t.includes(
|
|
89
|
-
}, { deep: !0 }),
|
|
90
|
-
let t = i(
|
|
91
|
-
|
|
92
|
-
}, { deep: !0 }),
|
|
93
|
-
e === "inline" && (
|
|
94
|
-
}),
|
|
95
|
-
e || (
|
|
96
|
-
}),
|
|
97
|
-
!
|
|
86
|
+
t.includes(M.value) || (M.value = t.find(Boolean) ?? ""), j.value && !R.value.some((e) => e.key === j.value) && tt();
|
|
87
|
+
}, { deep: !0 }), _(() => x.values, (e) => {
|
|
88
|
+
let t = i(x.template, e);
|
|
89
|
+
mt(t, w.value) || (W(t, !1), J());
|
|
90
|
+
}, { deep: !0 }), _(() => x.interactionMode, (e) => {
|
|
91
|
+
e === "inline" && (T.value = { ...w.value });
|
|
92
|
+
}), _(() => x.collapsiblePanel, (e) => {
|
|
93
|
+
e || (F.value = !1);
|
|
94
|
+
}), _(() => x.zoom, (e) => N.value = ft(e)), _(B, (e) => {
|
|
95
|
+
!M.value && e.length && (M.value = e[0].id);
|
|
98
96
|
}, { immediate: !0 });
|
|
99
|
-
function
|
|
100
|
-
|
|
97
|
+
function W(e, t = !0, n = {}) {
|
|
98
|
+
w.value = { ...e }, n.refreshInlineHtml !== !1 && (T.value = { ...e }), t && (S("update:values", { ...w.value }), S("change", { ...w.value }));
|
|
101
99
|
}
|
|
102
|
-
function
|
|
103
|
-
!e ||
|
|
104
|
-
...
|
|
100
|
+
function G(e, t) {
|
|
101
|
+
!e || Re.value || (W({
|
|
102
|
+
...w.value,
|
|
105
103
|
[e]: t
|
|
106
|
-
}, !0, { refreshInlineHtml:
|
|
104
|
+
}, !0, { refreshInlineHtml: x.interactionMode !== "inline" }), E.value && q());
|
|
107
105
|
}
|
|
108
|
-
function
|
|
109
|
-
if (
|
|
106
|
+
function Ge(e) {
|
|
107
|
+
if (x.interactionMode !== "inline") return;
|
|
110
108
|
let t = e.target;
|
|
111
109
|
if (!(t instanceof HTMLInputElement) && !(t instanceof HTMLTextAreaElement)) return;
|
|
112
110
|
let n = t.dataset.key || "";
|
|
113
|
-
n && (t instanceof HTMLInputElement && t.type === "checkbox" ?
|
|
111
|
+
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));
|
|
114
112
|
}
|
|
115
|
-
function
|
|
113
|
+
function Ke(e) {
|
|
116
114
|
let t = e.target;
|
|
117
115
|
if (!(t instanceof Element)) return;
|
|
118
116
|
let n = t.closest("[data-render-page-id]");
|
|
119
|
-
n?.dataset.renderPageId && (
|
|
117
|
+
n?.dataset.renderPageId && (M.value = n.dataset.renderPageId);
|
|
120
118
|
let r = t.closest("[data-contract-render-wrapper], [data-contract-render-control]")?.dataset.key || "";
|
|
121
|
-
r &&
|
|
119
|
+
r && et(r);
|
|
122
120
|
}
|
|
123
|
-
function
|
|
121
|
+
function qe(e) {
|
|
124
122
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
125
123
|
let t = e.target;
|
|
126
|
-
!(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(),
|
|
124
|
+
!(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), et(t.dataset.key));
|
|
127
125
|
}
|
|
128
|
-
function
|
|
129
|
-
return { ...
|
|
126
|
+
function K() {
|
|
127
|
+
return { ...w.value };
|
|
130
128
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
129
|
+
function Je(e) {
|
|
130
|
+
W(i(x.template, e));
|
|
133
131
|
}
|
|
134
|
-
function
|
|
135
|
-
let e = ne(
|
|
136
|
-
return
|
|
132
|
+
function q() {
|
|
133
|
+
let e = ne(x.template, w.value);
|
|
134
|
+
return Ze(e), S("validate", e), e;
|
|
137
135
|
}
|
|
138
|
-
function
|
|
139
|
-
let e = ee(
|
|
140
|
-
if ((
|
|
141
|
-
let t =
|
|
142
|
-
return
|
|
136
|
+
function Ye() {
|
|
137
|
+
let e = ee(x.template, w.value, x.validateOnSubmit);
|
|
138
|
+
if ((x.validateOnSubmit || e.length) && (Ze(e), S("validate", e)), e.length) return rt(e[0]), !1;
|
|
139
|
+
let t = K();
|
|
140
|
+
return S("submit", t), t;
|
|
143
141
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
142
|
+
function Xe() {
|
|
143
|
+
return W(t(x.template)), J(), K();
|
|
146
144
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
145
|
+
function J() {
|
|
146
|
+
E.value = !1, D.value = [], O.value = !1, k.value = !1, X();
|
|
149
147
|
}
|
|
150
|
-
function
|
|
151
|
-
if (
|
|
152
|
-
|
|
148
|
+
function Ze(e) {
|
|
149
|
+
if (D.value = e, E.value = !0, O.value = !1, e.length) {
|
|
150
|
+
k.value = !1, X();
|
|
153
151
|
return;
|
|
154
152
|
}
|
|
155
|
-
|
|
153
|
+
Qe();
|
|
156
154
|
}
|
|
157
155
|
let Y;
|
|
158
156
|
function X() {
|
|
159
157
|
Y &&= (clearTimeout(Y), void 0);
|
|
160
158
|
}
|
|
161
|
-
function
|
|
162
|
-
X(),
|
|
163
|
-
|
|
164
|
-
},
|
|
159
|
+
function Qe() {
|
|
160
|
+
X(), k.value = !0, Y = setTimeout(() => {
|
|
161
|
+
k.value = !1, Y = void 0;
|
|
162
|
+
}, Me);
|
|
165
163
|
}
|
|
166
164
|
function Z(e) {
|
|
167
|
-
|
|
165
|
+
et(e, !0);
|
|
168
166
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
167
|
+
function $e(e) {
|
|
168
|
+
x.interactionMode === "panel" && (F.value &&= !1, P.value && R.value.some((t) => t.key === e) && !z.value.some((t) => t.key === e) && (P.value = !1));
|
|
171
169
|
}
|
|
172
|
-
function
|
|
173
|
-
e && (
|
|
174
|
-
|
|
175
|
-
let n =
|
|
176
|
-
r?.dataset.renderPageId && (
|
|
170
|
+
function et(e, t = !1) {
|
|
171
|
+
e && ($e(e), j.value = e, A.value = e, ue(() => {
|
|
172
|
+
nt(e);
|
|
173
|
+
let n = C.value?.querySelector(`[data-key="${pt(e)}"]`), r = n?.closest("[data-render-page-id]");
|
|
174
|
+
r?.dataset.renderPageId && (M.value = r.dataset.renderPageId), t && n?.scrollIntoView({
|
|
177
175
|
behavior: "smooth",
|
|
178
176
|
block: "center",
|
|
179
177
|
inline: "center"
|
|
180
|
-
}),
|
|
178
|
+
}), x.interactionMode === "panel" && Ie.value?.querySelector(`[data-field-key="${pt(e)}"]`)?.scrollIntoView({
|
|
181
179
|
behavior: "smooth",
|
|
182
180
|
block: "nearest"
|
|
183
181
|
});
|
|
184
182
|
}));
|
|
185
183
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
184
|
+
function tt() {
|
|
185
|
+
j.value = "", A.value = "", nt("");
|
|
188
186
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
187
|
+
function nt(e) {
|
|
188
|
+
C.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
|
|
191
189
|
}
|
|
192
|
-
function
|
|
193
|
-
e.variableKey ? Z(e.variableKey) : e.pageId &&
|
|
190
|
+
function rt(e) {
|
|
191
|
+
e.variableKey ? Z(e.variableKey) : e.pageId && dt(e.pageId);
|
|
194
192
|
}
|
|
195
|
-
function
|
|
196
|
-
return
|
|
193
|
+
function it(e) {
|
|
194
|
+
return Be.value.get(e) ?? [];
|
|
197
195
|
}
|
|
198
|
-
function
|
|
196
|
+
function at(e) {
|
|
199
197
|
return {
|
|
200
198
|
variable: e,
|
|
201
|
-
value:
|
|
202
|
-
errors:
|
|
203
|
-
active:
|
|
204
|
-
readonly:
|
|
205
|
-
disabled:
|
|
206
|
-
updateValue: (t) =>
|
|
199
|
+
value: w.value[e.key],
|
|
200
|
+
errors: it(e.key),
|
|
201
|
+
active: j.value === e.key,
|
|
202
|
+
readonly: x.readonly,
|
|
203
|
+
disabled: x.disabled,
|
|
204
|
+
updateValue: (t) => G(e.key, t),
|
|
207
205
|
focusVariable: () => Z(e.key)
|
|
208
206
|
};
|
|
209
207
|
}
|
|
210
|
-
function
|
|
211
|
-
let e =
|
|
208
|
+
function ot() {
|
|
209
|
+
let e = R.value;
|
|
212
210
|
if (!e.length) return;
|
|
213
|
-
let t = e.findIndex((e) => e.key ===
|
|
211
|
+
let t = e.findIndex((e) => e.key === j.value), n = t < 0 ? 0 : t + 1;
|
|
214
212
|
for (let t = 0; t < e.length; t += 1) {
|
|
215
213
|
let i = e[(n + t) % e.length];
|
|
216
|
-
if (r(
|
|
214
|
+
if (r(w.value[i.key])) {
|
|
217
215
|
Z(i.key);
|
|
218
216
|
return;
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
219
|
}
|
|
222
|
-
function
|
|
223
|
-
!
|
|
220
|
+
function st() {
|
|
221
|
+
!x.collapsiblePanel || x.interactionMode !== "panel" || (F.value = !F.value);
|
|
224
222
|
}
|
|
225
223
|
function Q(e) {
|
|
226
|
-
let t =
|
|
227
|
-
return
|
|
224
|
+
let t = ft(e);
|
|
225
|
+
return N.value = t, S("update:zoom", t), t;
|
|
228
226
|
}
|
|
229
|
-
function
|
|
227
|
+
function ct() {
|
|
230
228
|
return Q(1);
|
|
231
229
|
}
|
|
232
|
-
function
|
|
233
|
-
return
|
|
230
|
+
function lt() {
|
|
231
|
+
return N.value;
|
|
234
232
|
}
|
|
235
|
-
function
|
|
236
|
-
let e = Math.max(...
|
|
237
|
-
return Q(Math.max(0,
|
|
233
|
+
function ut() {
|
|
234
|
+
let e = Math.max(...B.value.map((e) => e.width), 1);
|
|
235
|
+
return Q(Math.max(0, Le.value - 48) / e);
|
|
238
236
|
}
|
|
239
|
-
function
|
|
240
|
-
e && (
|
|
241
|
-
|
|
237
|
+
function dt(e) {
|
|
238
|
+
e && (M.value = e, ue(() => {
|
|
239
|
+
C.value?.querySelector(`[data-render-page-id="${pt(e)}"]`)?.scrollIntoView({
|
|
242
240
|
behavior: "smooth",
|
|
243
241
|
block: "start",
|
|
244
242
|
inline: "center"
|
|
245
243
|
});
|
|
246
244
|
}));
|
|
247
245
|
}
|
|
248
|
-
function
|
|
246
|
+
function ft(e) {
|
|
249
247
|
let t = Number(e);
|
|
250
|
-
return Number.isFinite(t) ? Math.min(
|
|
248
|
+
return Number.isFinite(t) ? Math.min(je, Math.max(Ae, Math.round(t * 100) / 100)) : 1;
|
|
251
249
|
}
|
|
252
|
-
function
|
|
250
|
+
function pt(e) {
|
|
253
251
|
return e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
254
252
|
}
|
|
255
|
-
function
|
|
253
|
+
function mt(e, t) {
|
|
256
254
|
let n = new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
257
255
|
return Array.from(n).every((n) => e[n] === t[n]);
|
|
258
256
|
}
|
|
259
|
-
function
|
|
260
|
-
!(e.ctrlKey || e.metaKey) || !
|
|
257
|
+
function ht(e) {
|
|
258
|
+
!(e.ctrlKey || e.metaKey) || !V.value || (e.preventDefault(), Q(e.deltaY > 0 ? N.value - b : N.value + b));
|
|
261
259
|
}
|
|
262
260
|
let $;
|
|
263
|
-
function
|
|
264
|
-
$?.removeEventListener("wheel",
|
|
265
|
-
}
|
|
266
|
-
function
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
}, { immediate: !0 }),
|
|
272
|
-
|
|
273
|
-
}),
|
|
274
|
-
getValues:
|
|
275
|
-
setValues:
|
|
276
|
-
validate:
|
|
277
|
-
submit:
|
|
278
|
-
resetValues:
|
|
261
|
+
function gt() {
|
|
262
|
+
$?.removeEventListener("wheel", ht), $ = void 0;
|
|
263
|
+
}
|
|
264
|
+
function _t(e) {
|
|
265
|
+
gt(), e && (e.addEventListener("wheel", ht, { passive: !1 }), $ = e);
|
|
266
|
+
}
|
|
267
|
+
return _(C, (e) => {
|
|
268
|
+
_t(e);
|
|
269
|
+
}, { immediate: !0 }), de(() => {
|
|
270
|
+
gt(), X();
|
|
271
|
+
}), Ne({
|
|
272
|
+
getValues: K,
|
|
273
|
+
setValues: Je,
|
|
274
|
+
validate: q,
|
|
275
|
+
submit: Ye,
|
|
276
|
+
resetValues: Xe,
|
|
279
277
|
scrollToVariable: Z,
|
|
280
278
|
setZoom: Q,
|
|
281
|
-
resetZoom:
|
|
282
|
-
getZoom:
|
|
283
|
-
fitWidth:
|
|
284
|
-
scrollToPage:
|
|
285
|
-
}), (e, t) => (
|
|
279
|
+
resetZoom: ct,
|
|
280
|
+
getZoom: lt,
|
|
281
|
+
fitWidth: ut,
|
|
282
|
+
scrollToPage: dt
|
|
283
|
+
}), (e, t) => (p(), c("section", {
|
|
286
284
|
ref_key: "rendererElement",
|
|
287
|
-
ref:
|
|
288
|
-
class:
|
|
289
|
-
"is-disabled":
|
|
290
|
-
"is-readonly":
|
|
291
|
-
"is-panel":
|
|
292
|
-
"is-inline":
|
|
285
|
+
ref: Fe,
|
|
286
|
+
class: f(["gd-contract-template-renderer", {
|
|
287
|
+
"is-disabled": d.disabled,
|
|
288
|
+
"is-readonly": d.readonly,
|
|
289
|
+
"is-panel": d.interactionMode === "panel",
|
|
290
|
+
"is-inline": d.interactionMode === "inline"
|
|
293
291
|
}]),
|
|
294
|
-
onClick:
|
|
295
|
-
onKeydown:
|
|
296
|
-
onInput:
|
|
297
|
-
onChange:
|
|
292
|
+
onClick: Ke,
|
|
293
|
+
onKeydown: qe,
|
|
294
|
+
onInput: Ge,
|
|
295
|
+
onChange: Ge
|
|
298
296
|
}, [
|
|
299
|
-
|
|
297
|
+
V.value ? (p(), o(ie, {
|
|
300
298
|
key: 0,
|
|
301
|
-
title:
|
|
302
|
-
"filled-count":
|
|
303
|
-
"total-count":
|
|
304
|
-
"required-missing-count":
|
|
305
|
-
zoom:
|
|
306
|
-
pages:
|
|
307
|
-
"active-page-id":
|
|
308
|
-
"min-zoom":
|
|
309
|
-
"max-zoom":
|
|
310
|
-
"show-toolbar":
|
|
311
|
-
"show-validate-button":
|
|
312
|
-
"show-reset-button":
|
|
313
|
-
"show-submit-button":
|
|
314
|
-
"show-panel-toggle":
|
|
315
|
-
"panel-collapsed":
|
|
316
|
-
readonly:
|
|
317
|
-
disabled:
|
|
318
|
-
onZoomIn: t[0] ||= (e) => Q(
|
|
319
|
-
onZoomOut: t[1] ||= (e) => Q(
|
|
320
|
-
onResetZoom:
|
|
321
|
-
onFitWidth:
|
|
322
|
-
onSelectPage:
|
|
323
|
-
onValidate:
|
|
324
|
-
onReset:
|
|
325
|
-
onSubmit:
|
|
326
|
-
onTogglePanel:
|
|
299
|
+
title: d.title,
|
|
300
|
+
"filled-count": H.value,
|
|
301
|
+
"total-count": R.value.length,
|
|
302
|
+
"required-missing-count": U.value,
|
|
303
|
+
zoom: N.value,
|
|
304
|
+
pages: B.value,
|
|
305
|
+
"active-page-id": M.value,
|
|
306
|
+
"min-zoom": Ae,
|
|
307
|
+
"max-zoom": je,
|
|
308
|
+
"show-toolbar": d.showToolbar,
|
|
309
|
+
"show-validate-button": d.showValidateButton,
|
|
310
|
+
"show-reset-button": d.showResetButton,
|
|
311
|
+
"show-submit-button": d.showSubmitButton,
|
|
312
|
+
"show-panel-toggle": d.interactionMode === "panel" && d.collapsiblePanel,
|
|
313
|
+
"panel-collapsed": F.value,
|
|
314
|
+
readonly: d.readonly,
|
|
315
|
+
disabled: d.disabled,
|
|
316
|
+
onZoomIn: t[0] ||= (e) => Q(N.value + b),
|
|
317
|
+
onZoomOut: t[1] ||= (e) => Q(N.value - b),
|
|
318
|
+
onResetZoom: ct,
|
|
319
|
+
onFitWidth: ut,
|
|
320
|
+
onSelectPage: dt,
|
|
321
|
+
onValidate: q,
|
|
322
|
+
onReset: Xe,
|
|
323
|
+
onSubmit: Ye,
|
|
324
|
+
onTogglePanel: st
|
|
327
325
|
}, {
|
|
328
|
-
extra:
|
|
326
|
+
extra: v(() => [pe(e.$slots, "headerExtra")]),
|
|
329
327
|
_: 3
|
|
330
328
|
}, 8, [
|
|
331
329
|
"title",
|
|
@@ -343,103 +341,101 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
|
|
|
343
341
|
"panel-collapsed",
|
|
344
342
|
"readonly",
|
|
345
343
|
"disabled"
|
|
346
|
-
])) :
|
|
347
|
-
|
|
344
|
+
])) : s("", !0),
|
|
345
|
+
We.value ? (p(), o(oe, {
|
|
348
346
|
key: 1,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}, _(e.message), 9, be))), 128))])) : c("", !0)], 2)) : c("", !0),
|
|
363
|
-
U.value ? (m(), l("div", {
|
|
347
|
+
passed: He.value,
|
|
348
|
+
summary: Ue.value,
|
|
349
|
+
errors: L.value,
|
|
350
|
+
expanded: O.value,
|
|
351
|
+
onToggle: t[2] ||= (e) => O.value = !O.value,
|
|
352
|
+
onFocusError: rt
|
|
353
|
+
}, null, 8, [
|
|
354
|
+
"passed",
|
|
355
|
+
"summary",
|
|
356
|
+
"errors",
|
|
357
|
+
"expanded"
|
|
358
|
+
])) : s("", !0),
|
|
359
|
+
V.value ? (p(), c("div", {
|
|
364
360
|
key: 3,
|
|
365
|
-
class:
|
|
366
|
-
}, [
|
|
361
|
+
class: f(["gd-contract-template-renderer__workspace", { "is-inline": d.interactionMode === "inline" }])
|
|
362
|
+
}, [l("div", {
|
|
367
363
|
ref_key: "pagesViewportElement",
|
|
368
|
-
ref:
|
|
364
|
+
ref: C,
|
|
369
365
|
class: "gd-contract-template-renderer__pages-viewport",
|
|
370
|
-
"data-highlighted-variable-key":
|
|
371
|
-
}, [
|
|
366
|
+
"data-highlighted-variable-key": A.value
|
|
367
|
+
}, [l("div", Se, [(p(!0), c(se, null, fe(B.value, (e, t) => (p(), o(ae, {
|
|
372
368
|
key: e.id,
|
|
373
369
|
page: e,
|
|
374
370
|
index: t,
|
|
375
|
-
total:
|
|
376
|
-
zoom:
|
|
377
|
-
"show-meta":
|
|
371
|
+
total: B.value.length,
|
|
372
|
+
zoom: N.value,
|
|
373
|
+
"show-meta": d.showPageMeta
|
|
378
374
|
}, null, 8, [
|
|
379
375
|
"page",
|
|
380
376
|
"index",
|
|
381
377
|
"total",
|
|
382
378
|
"zoom",
|
|
383
379
|
"show-meta"
|
|
384
|
-
]))), 128))])], 8,
|
|
380
|
+
]))), 128))])], 8, xe), d.interactionMode === "panel" ? (p(), c("div", {
|
|
385
381
|
key: 0,
|
|
386
|
-
class:
|
|
387
|
-
}, [
|
|
382
|
+
class: f(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": F.value && d.collapsiblePanel }])
|
|
383
|
+
}, [d.collapsiblePanel ? (p(), o(g(ge), {
|
|
388
384
|
key: 0,
|
|
389
|
-
title:
|
|
385
|
+
title: F.value ? "展开填写面板" : "收起填写面板"
|
|
390
386
|
}, {
|
|
391
|
-
default:
|
|
387
|
+
default: v(() => [l("button", {
|
|
392
388
|
type: "button",
|
|
393
389
|
class: "gd-contract-template-renderer__panel-handle",
|
|
394
|
-
"aria-label":
|
|
395
|
-
"aria-expanded": !
|
|
396
|
-
onClick: t[3] ||= (e) =>
|
|
397
|
-
}, [
|
|
390
|
+
"aria-label": F.value ? "展开填写面板" : "收起填写面板",
|
|
391
|
+
"aria-expanded": !F.value,
|
|
392
|
+
onClick: t[3] ||= (e) => F.value = !F.value
|
|
393
|
+
}, [F.value ? (p(), o(g(ve), {
|
|
398
394
|
key: 0,
|
|
399
395
|
"aria-hidden": "true"
|
|
400
|
-
})) : (
|
|
396
|
+
})) : (p(), o(g(ye), {
|
|
401
397
|
key: 1,
|
|
402
398
|
"aria-hidden": "true"
|
|
403
|
-
}))], 8,
|
|
399
|
+
}))], 8, Ce)]),
|
|
404
400
|
_: 1
|
|
405
|
-
}, 8, ["title"])) :
|
|
406
|
-
|
|
407
|
-
|
|
401
|
+
}, 8, ["title"])) : s("", !0), l("div", we, [l("aside", Te, [l("div", Ee, [
|
|
402
|
+
l("div", De, [l("div", null, [t[5] ||= l("strong", null, "填写项", -1), l("span", null, h(H.value) + " / " + h(R.value.length) + " 已填写", 1)]), l("span", null, h(U.value ? `${U.value} 项必填未完成` : "必填项已完成"), 1)]),
|
|
403
|
+
l("div", Oe, [u(g(me), {
|
|
408
404
|
size: "small",
|
|
409
|
-
type:
|
|
410
|
-
onClick: t[4] ||= (e) =>
|
|
405
|
+
type: P.value ? "primary" : "default",
|
|
406
|
+
onClick: t[4] ||= (e) => P.value = !P.value
|
|
411
407
|
}, {
|
|
412
|
-
default:
|
|
408
|
+
default: v(() => [...t[6] ||= [ce(" 仅看未填 ", -1)]]),
|
|
413
409
|
_: 1
|
|
414
|
-
}, 8, ["type"]),
|
|
410
|
+
}, 8, ["type"]), u(g(me), {
|
|
415
411
|
size: "small",
|
|
416
|
-
disabled: !
|
|
417
|
-
onClick:
|
|
412
|
+
disabled: !ze.value,
|
|
413
|
+
onClick: ot
|
|
418
414
|
}, {
|
|
419
|
-
default:
|
|
415
|
+
default: v(() => [...t[7] ||= [ce(" 下一个未填项 ", -1)]]),
|
|
420
416
|
_: 1
|
|
421
417
|
}, 8, ["disabled"])]),
|
|
422
|
-
|
|
423
|
-
percent:
|
|
418
|
+
u(g(he), {
|
|
419
|
+
percent: Ve.value,
|
|
424
420
|
size: "small",
|
|
425
421
|
"show-info": !1
|
|
426
422
|
}, null, 8, ["percent"])
|
|
427
|
-
]),
|
|
423
|
+
]), z.value.length ? (p(), c("div", {
|
|
428
424
|
key: 1,
|
|
429
425
|
ref_key: "fieldListElement",
|
|
430
|
-
ref:
|
|
426
|
+
ref: Ie,
|
|
431
427
|
class: "gd-contract-template-renderer__field-list"
|
|
432
|
-
}, [(
|
|
428
|
+
}, [(p(!0), c(se, null, fe(z.value, (t) => (p(), c("div", {
|
|
433
429
|
key: t.id || t.key,
|
|
434
430
|
"data-field-key": t.key
|
|
435
|
-
}, [
|
|
431
|
+
}, [pe(e.$slots, "field", le({ ref_for: !0 }, at(t)), () => [u(re, {
|
|
436
432
|
variable: t,
|
|
437
|
-
value:
|
|
438
|
-
errors:
|
|
439
|
-
active:
|
|
440
|
-
readonly:
|
|
441
|
-
disabled:
|
|
442
|
-
onUpdateValue: (e) =>
|
|
433
|
+
value: w.value[t.key],
|
|
434
|
+
errors: it(t.key),
|
|
435
|
+
active: j.value === t.key,
|
|
436
|
+
readonly: d.readonly,
|
|
437
|
+
disabled: d.disabled,
|
|
438
|
+
onUpdateValue: (e) => G(t.key, e),
|
|
443
439
|
onFocusVariable: (e) => Z(t.key)
|
|
444
440
|
}, null, 8, [
|
|
445
441
|
"variable",
|
|
@@ -450,16 +446,16 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
|
|
|
450
446
|
"disabled",
|
|
451
447
|
"onUpdateValue",
|
|
452
448
|
"onFocusVariable"
|
|
453
|
-
])])], 8,
|
|
449
|
+
])])], 8, ke))), 128))], 512)) : (p(), o(g(y), {
|
|
454
450
|
key: 0,
|
|
455
|
-
description:
|
|
456
|
-
image:
|
|
457
|
-
}, null, 8, ["description", "image"]))])])], 2)) :
|
|
451
|
+
description: R.value.length ? "暂无未填项" : "暂无填写项",
|
|
452
|
+
image: g(y).PRESENTED_IMAGE_SIMPLE
|
|
453
|
+
}, null, 8, ["description", "image"]))])])], 2)) : s("", !0)], 2)) : (p(), c("div", be, [u(g(y), {
|
|
458
454
|
description: "暂无可渲染的合同页面",
|
|
459
|
-
image:
|
|
455
|
+
image: g(y).PRESENTED_IMAGE_SIMPLE
|
|
460
456
|
}, null, 8, ["image"])]))
|
|
461
457
|
], 34));
|
|
462
458
|
}
|
|
463
459
|
});
|
|
464
460
|
//#endregion
|
|
465
|
-
export {
|
|
461
|
+
export { Ne as default };
|