@guodun/antdv 1.4.8 → 1.5.2
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 +315 -286
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +316 -285
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +62 -54
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- 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/ContractPrintIframe.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.vue.mjs +136 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +10 -5
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +64 -43
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +82 -53
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +271 -265
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +762 -751
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +217 -197
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +29 -51
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +103 -103
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +24 -21
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +314 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +47 -47
- package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +216 -148
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +27 -26
- 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/ContractSigningTemplatePage.vue.cjs +1 -1
- 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-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- 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/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- 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/contract-print-document.cjs +211 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/word-paste.cjs +2 -2
- 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/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +7 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +4 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +9 -3
- package/dist/types/components/contract-signing-location/src/types.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractPrintIframe.vue.d.ts +35 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +119 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +2 -0
- package/package.json +2 -1
package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs
CHANGED
|
@@ -6,39 +6,39 @@ import { isContractSigningPageUsable as d } from "./location-rules.mjs";
|
|
|
6
6
|
import { CONTRACT_SIGNING_FALLBACK_PAGE_SIZE as f, buildPageLayouts as p, contentPointToPagePoint as m, findPageAtOffset as h, getContractSigningAutoScrollDelta as g, getPageLayoutScrollTop as _, getPageLayoutsContentSize as ee, getVisibleRange as te } from "./page-layout.mjs";
|
|
7
7
|
import { useFitWidthZoom as ne } from "../../pro-contract-template-designer/src/composables/use-fit-width-zoom.mjs";
|
|
8
8
|
import { getContractSigningPlacementVisual as re } from "./signing-visuals.mjs";
|
|
9
|
-
import { Fragment as v, computed as y, createBlock as ie, createCommentVNode as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { useElementSize as
|
|
12
|
-
import { ColumnWidthOutlined as
|
|
9
|
+
import { Fragment as v, computed as y, createBlock as ie, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as ae, createVNode as C, defineComponent as w, nextTick as oe, normalizeClass as se, normalizeStyle as T, onBeforeUnmount as ce, onMounted as le, openBlock as E, ref as ue, renderList as D, shallowRef as O, toDisplayString as k, unref as A, watch as de, withCtx as j, withKeys as fe, withModifiers as M } from "vue";
|
|
10
|
+
import { Button as N } from "ant-design-vue";
|
|
11
|
+
import { useElementSize as pe } from "@vueuse/core";
|
|
12
|
+
import { ColumnWidthOutlined as me, LeftOutlined as he, RightOutlined as ge, ZoomInOutlined as _e, ZoomOutOutlined as ve } from "@ant-design/icons-vue";
|
|
13
13
|
//#region src/components/contract-signing-location/src/ContractSigningLocationCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
14
|
+
var ye = { class: "gd-ant-contract-signing-location__workspace" }, be = { class: "gd-ant-contract-signing-location__workspace-head" }, xe = { key: 0 }, Se = { class: "gd-ant-contract-signing-location__workspace-tools" }, Ce = {
|
|
15
15
|
class: "gd-ant-contract-signing-location__page-jumper",
|
|
16
16
|
"aria-label": "页码跳转"
|
|
17
|
-
},
|
|
17
|
+
}, we = ["value", "max"], Te = {
|
|
18
18
|
class: "gd-ant-contract-signing-location__zoom-tools",
|
|
19
19
|
"aria-label": "页面缩放"
|
|
20
|
-
},
|
|
20
|
+
}, Ee = ["aria-label"], De = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "gd-ant-contract-signing-location__page-placeholder is-error",
|
|
23
23
|
role: "alert"
|
|
24
|
-
},
|
|
24
|
+
}, Oe = ["src"], ke = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "gd-ant-contract-signing-location__page-placeholder"
|
|
27
|
-
},
|
|
27
|
+
}, Ae = ["onClick"], je = ["onClick"], Me = { class: "gd-ant-contract-signing-location__render-region" }, Ne = { class: "gd-ant-contract-signing-location__render-region-content" }, Pe = { class: "is-horizontal is-top" }, Fe = { class: "is-horizontal is-bottom" }, Ie = { class: "is-vertical is-left" }, Le = { class: "is-vertical is-right" }, Re = {
|
|
28
28
|
key: 1,
|
|
29
29
|
class: "gd-ant-contract-signing-location__snap-guides",
|
|
30
30
|
"aria-hidden": "true"
|
|
31
|
-
},
|
|
31
|
+
}, ze = [
|
|
32
32
|
"title",
|
|
33
33
|
"aria-label",
|
|
34
34
|
"aria-pressed",
|
|
35
35
|
"onClick",
|
|
36
36
|
"onPointerdown",
|
|
37
37
|
"onKeydown"
|
|
38
|
-
],
|
|
38
|
+
], Be = { class: "gd-ant-contract-signing-location__placement-body" }, Ve = ["src", "alt"], He = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "gd-ant-contract-signing-location__placement-badge"
|
|
41
|
-
},
|
|
41
|
+
}, Ue = ["onPointerdown"], We = /* @__PURE__ */ w({
|
|
42
42
|
name: "ContractSigningLocationCanvas",
|
|
43
43
|
__name: "ContractSigningLocationCanvas",
|
|
44
44
|
props: {
|
|
@@ -55,7 +55,8 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
55
55
|
minZoom: {},
|
|
56
56
|
maxZoom: {},
|
|
57
57
|
sealSizeLimit: {},
|
|
58
|
-
sealTypeOptions: {}
|
|
58
|
+
sealTypeOptions: {},
|
|
59
|
+
fontBaseUrl: {}
|
|
59
60
|
},
|
|
60
61
|
emits: [
|
|
61
62
|
"select",
|
|
@@ -67,10 +68,11 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
67
68
|
"view-page",
|
|
68
69
|
"page-change",
|
|
69
70
|
"zoom-change",
|
|
70
|
-
"scroll-to-ready"
|
|
71
|
+
"scroll-to-ready",
|
|
72
|
+
"template-status"
|
|
71
73
|
],
|
|
72
|
-
setup(
|
|
73
|
-
let
|
|
74
|
+
setup(w, { expose: We, emit: Ge }) {
|
|
75
|
+
let Ke = [
|
|
74
76
|
"nw",
|
|
75
77
|
"n",
|
|
76
78
|
"ne",
|
|
@@ -79,41 +81,41 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
79
81
|
"s",
|
|
80
82
|
"sw",
|
|
81
83
|
"w"
|
|
82
|
-
],
|
|
84
|
+
], P = w, F = Ge, I = ue(null), L = ue(null), qe = O(1), R = O(P.activePageIndex), Je = O({
|
|
83
85
|
start: 0,
|
|
84
86
|
end: -1
|
|
85
|
-
}), { width:
|
|
86
|
-
viewportWidth:
|
|
87
|
-
widestPageWidth: y(() => Math.max(...
|
|
87
|
+
}), { width: Ye } = pe(I), { fitWidth: Xe, markUserAdjusted: Ze } = ne({
|
|
88
|
+
viewportWidth: Ye,
|
|
89
|
+
widestPageWidth: y(() => Math.max(...P.pages.map((e) => e.displayWidth || e.width || f.width), f.width)),
|
|
88
90
|
padding: 48,
|
|
89
|
-
minZoom: () =>
|
|
90
|
-
maxZoom: () =>
|
|
91
|
-
getZoom: () =>
|
|
92
|
-
applyZoom: (e) => (
|
|
93
|
-
}),
|
|
94
|
-
let e =
|
|
95
|
-
return
|
|
96
|
-
}),
|
|
91
|
+
minZoom: () => P.minZoom,
|
|
92
|
+
maxZoom: () => P.maxZoom,
|
|
93
|
+
getZoom: () => P.zoom,
|
|
94
|
+
applyZoom: (e) => (F("zoom-change", e), e)
|
|
95
|
+
}), z = O([]), Qe = O(), B = O(), V, H = 0, U, $e, et, tt, W = y(() => p(P.pages, P.zoom, 16)), nt = y(() => ee(W.value)), G = y(() => u(P.file)), rt = y(() => c(P.file?.source)), it = y(() => new Map(rt.value.map((e) => [e.pageIndex, e]))), at = y(() => l(P.file)), ot = y(() => {
|
|
96
|
+
let e = Je.value;
|
|
97
|
+
return W.value.length ? e.end < e.start ? W.value.slice(0, 2) : W.value.slice(e.start, e.end + 1) : [];
|
|
98
|
+
}), st = y(() => ot.value.flatMap((e) => {
|
|
97
99
|
let t = q(e.pageIndex);
|
|
98
100
|
return t ? [{
|
|
99
101
|
layout: e,
|
|
100
102
|
page: t,
|
|
101
103
|
logical: J(t),
|
|
102
|
-
templatePage:
|
|
104
|
+
templatePage: it.value.get(e.pageIndex)
|
|
103
105
|
}] : [];
|
|
104
|
-
})),
|
|
105
|
-
function
|
|
106
|
+
})), ct = y(() => P.pages.find((e) => e.pageIndex === R.value) ?? P.pages[0]), lt = y(() => Math.min(P.minZoom, P.maxZoom)), ut = y(() => Math.max(P.minZoom, P.maxZoom)), dt = y(() => P.placements.find((e) => e.id === P.selectedPlacementId)), ft = /* @__PURE__ */ new Date(), K = /* @__PURE__ */ new Map(), pt = O({});
|
|
107
|
+
function mt(e) {
|
|
106
108
|
return JSON.stringify([
|
|
107
109
|
e.signType,
|
|
108
110
|
e.sealType ?? [],
|
|
109
|
-
|
|
111
|
+
P.sealTypeOptions ?? []
|
|
110
112
|
]);
|
|
111
113
|
}
|
|
112
|
-
function
|
|
113
|
-
let t =
|
|
114
|
+
function ht(e) {
|
|
115
|
+
let t = mt(e), n = K.get(t);
|
|
114
116
|
if (n) return n;
|
|
115
117
|
let r = re(e, {
|
|
116
|
-
sealTypeOptions:
|
|
118
|
+
sealTypeOptions: P.sealTypeOptions,
|
|
117
119
|
date: ft
|
|
118
120
|
});
|
|
119
121
|
if (K.size >= 128) {
|
|
@@ -122,37 +124,60 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
122
124
|
}
|
|
123
125
|
return K.set(t, r), r;
|
|
124
126
|
}
|
|
125
|
-
let
|
|
127
|
+
let gt = y(() => {
|
|
126
128
|
let e = /* @__PURE__ */ new WeakMap();
|
|
127
|
-
return
|
|
128
|
-
e.set(t,
|
|
129
|
+
return P.placements.forEach((t) => {
|
|
130
|
+
e.set(t, ht(t));
|
|
129
131
|
}), e;
|
|
130
132
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
|
-
X(), Z(),
|
|
133
|
+
de(() => P.activePageIndex, (e) => {
|
|
134
|
+
R.value = e, Nt() || Q(e);
|
|
135
|
+
}), de(() => P.pages.map((e) => e.pageIndex).join(","), () => {
|
|
136
|
+
pt.value = {}, F("template-status", G.value ? "loading" : "ready"), oe(() => {
|
|
137
|
+
X(), Z(), F("scroll-to-ready");
|
|
136
138
|
});
|
|
137
|
-
}),
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
}), de(() => st.value.map((e) => e.layout.pageIndex).join(","), () => {
|
|
140
|
+
vt();
|
|
141
|
+
}), de(() => P.zoom, (e, t) => {
|
|
142
|
+
if (!I.value || t == null || e === t) return;
|
|
143
|
+
let n = jt(), r = p(P.pages, t, 16), i = h(r, n.layoutScrollTop + 1) ?? r[0];
|
|
140
144
|
if (!i) return;
|
|
141
|
-
|
|
145
|
+
et = {
|
|
142
146
|
pageIndex: i.pageIndex,
|
|
143
147
|
offsetInPage: n.layoutScrollTop - i.top
|
|
144
148
|
};
|
|
145
149
|
let a = e / Math.max(.01, t);
|
|
146
|
-
|
|
147
|
-
}), ue(() => {
|
|
148
|
-
X(), Z(), P("scroll-to-ready"), !(typeof ResizeObserver > "u" || !F.value) && (H = new ResizeObserver(() => {
|
|
149
|
-
X(), Z();
|
|
150
|
-
}), H.observe(F.value));
|
|
150
|
+
oe(() => Ft(a));
|
|
151
151
|
}), le(() => {
|
|
152
|
-
|
|
152
|
+
X(), Z(), F("scroll-to-ready"), !(typeof ResizeObserver > "u" || !I.value) && (tt = new ResizeObserver(() => {
|
|
153
|
+
X(), Z();
|
|
154
|
+
}), tt.observe(I.value));
|
|
155
|
+
}), ce(() => {
|
|
156
|
+
Qt(), Ut(), U && clearTimeout(U), tt?.disconnect(), tt = void 0;
|
|
153
157
|
});
|
|
154
158
|
function q(e) {
|
|
155
|
-
return
|
|
159
|
+
return P.pages.find((t) => t.pageIndex === e);
|
|
160
|
+
}
|
|
161
|
+
function _t(e, t, n) {
|
|
162
|
+
pt.value = {
|
|
163
|
+
...pt.value,
|
|
164
|
+
[e]: {
|
|
165
|
+
status: t,
|
|
166
|
+
detail: n
|
|
167
|
+
}
|
|
168
|
+
}, vt();
|
|
169
|
+
}
|
|
170
|
+
function vt() {
|
|
171
|
+
if (!G.value) {
|
|
172
|
+
F("template-status", "ready");
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let e = st.value.filter((e) => e.templatePage).map((e) => pt.value[e.layout.pageIndex]), t = e.find((e) => e?.status === "error");
|
|
176
|
+
if (t) {
|
|
177
|
+
F("template-status", "error", t.detail);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
F("template-status", e.length > 0 && e.every((e) => e?.status === "ready") ? "ready" : "loading");
|
|
156
181
|
}
|
|
157
182
|
function J(e) {
|
|
158
183
|
return e && d(e) ? {
|
|
@@ -168,23 +193,23 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
168
193
|
height: Number.isFinite(n) && n > 0 ? n : e.height
|
|
169
194
|
};
|
|
170
195
|
}
|
|
171
|
-
function
|
|
172
|
-
return `${
|
|
196
|
+
function yt(e) {
|
|
197
|
+
return `${P.file?.fileId ?? ""}:${e}`;
|
|
173
198
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
199
|
+
function bt(e) {
|
|
200
|
+
return P.previewLoadingKeys.includes(yt(e));
|
|
176
201
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
202
|
+
function xt(e) {
|
|
203
|
+
return P.previewErrorMap[yt(e)] || "";
|
|
179
204
|
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
205
|
+
function St(e) {
|
|
206
|
+
return P.placements.filter((t) => t.pageIndex === e);
|
|
182
207
|
}
|
|
183
|
-
function
|
|
184
|
-
let t =
|
|
208
|
+
function Ct(e) {
|
|
209
|
+
let t = dt.value;
|
|
185
210
|
return t && t.pageIndex === e.pageIndex ? r(t, e) : void 0;
|
|
186
211
|
}
|
|
187
|
-
function
|
|
212
|
+
function wt(e) {
|
|
188
213
|
let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n);
|
|
189
214
|
return {
|
|
190
215
|
left: `${t.signLeft * r.width / Math.max(1, a.width)}px`,
|
|
@@ -193,7 +218,7 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
193
218
|
height: `${t.signHeight * r.height / Math.max(1, a.height)}px`
|
|
194
219
|
};
|
|
195
220
|
}
|
|
196
|
-
function
|
|
221
|
+
function Tt(e) {
|
|
197
222
|
let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n), o = r.width / Math.max(1, a.width), s = r.height / Math.max(1, a.height);
|
|
198
223
|
return {
|
|
199
224
|
"--gd-contract-sign-left": `${t.signLeft * o}px`,
|
|
@@ -202,31 +227,31 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
202
227
|
"--gd-contract-sign-bottom": `${(t.signTop + t.signHeight) * s}px`
|
|
203
228
|
};
|
|
204
229
|
}
|
|
205
|
-
function
|
|
230
|
+
function Et(e, t) {
|
|
206
231
|
let n = Y(t), r = J(t), i = e.axis === "x" ? n.width / Math.max(1, r.width) : n.height / Math.max(1, r.height);
|
|
207
232
|
return e.axis === "x" ? { left: `${e.position * i}px` } : { top: `${e.position * i}px` };
|
|
208
233
|
}
|
|
209
|
-
function
|
|
234
|
+
function Dt(e, t) {
|
|
210
235
|
return n(e, t, {
|
|
211
|
-
sealSizeLimit:
|
|
236
|
+
sealSizeLimit: P.sealSizeLimit,
|
|
212
237
|
sealTypes: e.sealType,
|
|
213
|
-
sealTypeOptions:
|
|
238
|
+
sealTypeOptions: P.sealTypeOptions
|
|
214
239
|
});
|
|
215
240
|
}
|
|
216
|
-
function
|
|
217
|
-
return
|
|
241
|
+
function Ot(e) {
|
|
242
|
+
return gt.value.get(e) ?? ht(e);
|
|
218
243
|
}
|
|
219
|
-
function
|
|
220
|
-
return t(e,
|
|
244
|
+
function kt(e) {
|
|
245
|
+
return t(e, P.resizable, P.readonly) && e.id === P.selectedPlacementId;
|
|
221
246
|
}
|
|
222
|
-
function
|
|
247
|
+
function At(e) {
|
|
223
248
|
return {
|
|
224
249
|
...e,
|
|
225
250
|
sealType: e.sealType ? [...e.sealType] : void 0
|
|
226
251
|
};
|
|
227
252
|
}
|
|
228
|
-
function
|
|
229
|
-
let e =
|
|
253
|
+
function jt() {
|
|
254
|
+
let e = I.value, t = L.value;
|
|
230
255
|
if (!e) return {
|
|
231
256
|
layoutScrollTop: 0,
|
|
232
257
|
viewportHeight: 0
|
|
@@ -237,8 +262,8 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
237
262
|
viewportHeight: e.clientHeight
|
|
238
263
|
};
|
|
239
264
|
}
|
|
240
|
-
function
|
|
241
|
-
let n =
|
|
265
|
+
function Mt(e, t) {
|
|
266
|
+
let n = L.value;
|
|
242
267
|
if (n) {
|
|
243
268
|
let r = n.getBoundingClientRect();
|
|
244
269
|
return {
|
|
@@ -246,7 +271,7 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
246
271
|
y: t - r.top
|
|
247
272
|
};
|
|
248
273
|
}
|
|
249
|
-
let r =
|
|
274
|
+
let r = I.value;
|
|
250
275
|
if (!r) return {
|
|
251
276
|
x: e,
|
|
252
277
|
y: t
|
|
@@ -257,147 +282,147 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
257
282
|
y: t - i.top + r.scrollTop - o
|
|
258
283
|
};
|
|
259
284
|
}
|
|
260
|
-
function
|
|
285
|
+
function Nt() {
|
|
261
286
|
return !!(document.activeElement && document.activeElement.tagName === "INPUT");
|
|
262
287
|
}
|
|
263
288
|
function X() {
|
|
264
|
-
let e =
|
|
265
|
-
|
|
266
|
-
let t = h(
|
|
289
|
+
let e = jt();
|
|
290
|
+
Je.value = te(W.value, e.layoutScrollTop, e.viewportHeight, 1);
|
|
291
|
+
let t = h(W.value, e.layoutScrollTop + 1);
|
|
267
292
|
if (t) {
|
|
268
|
-
let e =
|
|
269
|
-
|
|
293
|
+
let e = R.value !== t.pageIndex;
|
|
294
|
+
R.value = t.pageIndex, Nt() || Q(t.pageIndex), e && F("view-page", t.pageIndex);
|
|
270
295
|
}
|
|
271
296
|
}
|
|
272
297
|
function Z() {
|
|
273
|
-
let e =
|
|
274
|
-
|
|
298
|
+
let e = Je.value;
|
|
299
|
+
F("visible-pages", W.value.slice(Math.max(0, e.start), e.end + 1).map((e) => e.pageIndex));
|
|
275
300
|
}
|
|
276
|
-
function
|
|
277
|
-
X(),
|
|
278
|
-
Z(),
|
|
301
|
+
function Pt() {
|
|
302
|
+
X(), U && clearTimeout(U), U = setTimeout(() => {
|
|
303
|
+
Z(), R.value !== $e && ($e = R.value, F("page-change", R.value));
|
|
279
304
|
}, 80);
|
|
280
305
|
}
|
|
281
|
-
function
|
|
282
|
-
let t =
|
|
283
|
-
if (
|
|
284
|
-
let i =
|
|
306
|
+
function Ft(e) {
|
|
307
|
+
let t = I.value, n = L.value, r = et;
|
|
308
|
+
if (et = void 0, !t || !n || !r) return;
|
|
309
|
+
let i = W.value.find((e) => e.pageIndex === r.pageIndex);
|
|
285
310
|
i && (t.scrollTop = n.offsetTop + i.top + r.offsetInPage * e, X());
|
|
286
311
|
}
|
|
287
|
-
function
|
|
288
|
-
let t =
|
|
289
|
-
t && (
|
|
290
|
-
let r = _(
|
|
312
|
+
function It(e) {
|
|
313
|
+
let t = I.value, n = L.value;
|
|
314
|
+
t && (R.value = e, Q(e), F("page-change", e), $e = e, oe(() => {
|
|
315
|
+
let r = _(W.value, e);
|
|
291
316
|
t.scrollTop = (n?.offsetTop ?? 0) + r, X(), Z();
|
|
292
317
|
}));
|
|
293
318
|
}
|
|
294
|
-
function
|
|
295
|
-
let t =
|
|
319
|
+
function Lt(e) {
|
|
320
|
+
let t = P.placements.find((t) => t.id === e), n = I.value, r = L.value;
|
|
296
321
|
if (!t || !n) return;
|
|
297
|
-
let a =
|
|
298
|
-
a && (
|
|
299
|
-
let e =
|
|
300
|
-
(l < d || u > f) && (n.scrollTop = (r?.offsetTop ?? 0) + Math.max(0, l - 24)), X(), Z(),
|
|
322
|
+
let a = W.value.find((e) => e.pageIndex === t.pageIndex);
|
|
323
|
+
a && (R.value = t.pageIndex, Q(t.pageIndex), oe(() => {
|
|
324
|
+
let e = jt(), o = q(t.pageIndex), s = Y(o), c = J(o), l = a.top + i(t).signTop * s.height / Math.max(1, c.height) * P.zoom, u = l + i(t).signHeight * s.height / Math.max(1, c.height) * P.zoom, d = e.layoutScrollTop, f = d + e.viewportHeight;
|
|
325
|
+
(l < d || u > f) && (n.scrollTop = (r?.offsetTop ?? 0) + Math.max(0, l - 24)), X(), Z(), F("page-change", t.pageIndex);
|
|
301
326
|
}));
|
|
302
327
|
}
|
|
303
328
|
function Q(e) {
|
|
304
|
-
let t =
|
|
305
|
-
|
|
329
|
+
let t = P.pages.findIndex((t) => t.pageIndex === e);
|
|
330
|
+
qe.value = t >= 0 ? t + 1 : 1;
|
|
306
331
|
}
|
|
307
|
-
function
|
|
308
|
-
let t =
|
|
309
|
-
r &&
|
|
332
|
+
function Rt(e) {
|
|
333
|
+
let t = P.pages.findIndex((e) => e.pageIndex === R.value), n = Math.min(P.pages.length - 1, Math.max(0, (t < 0 ? 0 : t) + e)), r = P.pages[n];
|
|
334
|
+
r && It(r.pageIndex);
|
|
310
335
|
}
|
|
311
|
-
function
|
|
336
|
+
function zt(e) {
|
|
312
337
|
let t = Number(e.target.value);
|
|
313
338
|
if (!Number.isFinite(t)) {
|
|
314
|
-
Q(
|
|
339
|
+
Q(R.value);
|
|
315
340
|
return;
|
|
316
341
|
}
|
|
317
|
-
let n = Math.min(
|
|
318
|
-
r ?
|
|
342
|
+
let n = Math.min(P.pages.length, Math.max(1, Math.round(t))) - 1, r = P.pages[n];
|
|
343
|
+
r ? It(r.pageIndex) : Q(R.value);
|
|
319
344
|
}
|
|
320
|
-
function
|
|
321
|
-
t === "user" &&
|
|
345
|
+
function Bt(e, t = "user") {
|
|
346
|
+
t === "user" && Ze(), F("zoom-change", e);
|
|
322
347
|
}
|
|
323
|
-
function
|
|
324
|
-
e.target.closest(".gd-ant-contract-signing-location__placement") ||
|
|
348
|
+
function Vt(e) {
|
|
349
|
+
e.target.closest(".gd-ant-contract-signing-location__placement") || F("select", "");
|
|
325
350
|
}
|
|
326
|
-
function
|
|
327
|
-
window.addEventListener("pointermove",
|
|
351
|
+
function Ht() {
|
|
352
|
+
window.addEventListener("pointermove", Kt, { passive: !1 }), window.addEventListener("pointerup", $), window.addEventListener("pointercancel", $);
|
|
328
353
|
}
|
|
329
|
-
function
|
|
330
|
-
window.removeEventListener("pointermove",
|
|
354
|
+
function Ut() {
|
|
355
|
+
window.removeEventListener("pointermove", Kt), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $);
|
|
331
356
|
}
|
|
332
|
-
function
|
|
333
|
-
e.stopPropagation(),
|
|
357
|
+
function Wt(e, t, n) {
|
|
358
|
+
e.stopPropagation(), F("select", t.id);
|
|
334
359
|
let r = q(t.pageIndex);
|
|
335
|
-
if (
|
|
336
|
-
let i =
|
|
337
|
-
o.focus({ preventScroll: !0 }),
|
|
360
|
+
if (P.readonly || !r || !d(r) || e.button !== 0) return;
|
|
361
|
+
let i = Mt(e.clientX, e.clientY), a = m(W.value, P.pages, i.x, i.y), o = e.currentTarget;
|
|
362
|
+
o.focus({ preventScroll: !0 }), B.value = {
|
|
338
363
|
pointerId: e.pointerId,
|
|
339
364
|
mode: n ? "resize" : "move",
|
|
340
365
|
handle: n,
|
|
341
366
|
placementId: t.id,
|
|
342
367
|
startX: e.clientX,
|
|
343
368
|
startY: e.clientY,
|
|
344
|
-
origin:
|
|
369
|
+
origin: At(t),
|
|
345
370
|
grabOffsetX: (a?.x ?? t.signLeft) - t.signLeft,
|
|
346
371
|
grabOffsetY: (a?.y ?? t.signTop) - t.signTop
|
|
347
|
-
},
|
|
372
|
+
}, V = {
|
|
348
373
|
clientX: e.clientX,
|
|
349
374
|
clientY: e.clientY,
|
|
350
375
|
pointerId: e.pointerId
|
|
351
|
-
},
|
|
376
|
+
}, Ht(), Zt();
|
|
352
377
|
try {
|
|
353
378
|
o.setPointerCapture(e.pointerId);
|
|
354
379
|
} catch {}
|
|
355
380
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
381
|
+
function Gt(e, t, n) {
|
|
382
|
+
Wt(e, t, n);
|
|
358
383
|
}
|
|
359
|
-
function
|
|
360
|
-
let t =
|
|
361
|
-
!t || t.pointerId !== e.pointerId || (e.preventDefault(),
|
|
384
|
+
function Kt(e) {
|
|
385
|
+
let t = B.value;
|
|
386
|
+
!t || t.pointerId !== e.pointerId || (e.preventDefault(), V = {
|
|
362
387
|
clientX: e.clientX,
|
|
363
388
|
clientY: e.clientY,
|
|
364
389
|
pointerId: e.pointerId
|
|
365
|
-
},
|
|
390
|
+
}, qt(V));
|
|
366
391
|
}
|
|
367
392
|
function $(e) {
|
|
368
|
-
|
|
393
|
+
B.value?.pointerId === e.pointerId && (B.value = void 0, V = void 0, z.value = [], Qe.value = void 0, Qt(), Ut());
|
|
369
394
|
}
|
|
370
|
-
function
|
|
371
|
-
let t =
|
|
395
|
+
function qt(e) {
|
|
396
|
+
let t = B.value;
|
|
372
397
|
if (!t) return;
|
|
373
398
|
if (t.mode === "resize") {
|
|
374
|
-
|
|
399
|
+
Jt(t, e);
|
|
375
400
|
return;
|
|
376
401
|
}
|
|
377
|
-
let n =
|
|
402
|
+
let n = Mt(e.clientX, e.clientY), r = m(W.value, P.pages, n.x, n.y);
|
|
378
403
|
if (!r) return;
|
|
379
|
-
let i =
|
|
404
|
+
let i = Xt(r.pageIndex, t.origin.pageIndex);
|
|
380
405
|
if (!i || !d(i)) return;
|
|
381
|
-
let a = s(
|
|
406
|
+
let a = s(Dt({
|
|
382
407
|
...t.origin,
|
|
383
408
|
pageIndex: i.pageIndex,
|
|
384
409
|
signLeft: r.x - t.grabOffsetX,
|
|
385
410
|
signTop: r.y - t.grabOffsetY
|
|
386
|
-
}, i),
|
|
387
|
-
|
|
411
|
+
}, i), St(i.pageIndex), P.zoom, void 0, i), o = Dt(a.placement, i);
|
|
412
|
+
z.value = a.guides, Qe.value = i.pageIndex, F("update", o);
|
|
388
413
|
}
|
|
389
|
-
function
|
|
414
|
+
function Jt(e, t) {
|
|
390
415
|
let n = q(e.origin.pageIndex), r = e.handle;
|
|
391
416
|
if (!n || !r || !d(n)) return;
|
|
392
|
-
let a =
|
|
417
|
+
let a = W.value.find((e) => e.pageIndex === n.pageIndex);
|
|
393
418
|
if (!a) return;
|
|
394
|
-
let o =
|
|
419
|
+
let o = Mt(t.clientX, t.clientY), s = Y(n), c = n.width / Math.max(1, s.width * P.zoom), l = n.height / Math.max(1, s.height * P.zoom), u = (o.x - a.left) * c, f = (o.y - a.top) * l;
|
|
395
420
|
if (e.origin.signType === "seal") {
|
|
396
|
-
|
|
421
|
+
Yt(e, n, r, u, f);
|
|
397
422
|
return;
|
|
398
423
|
}
|
|
399
424
|
let p = i(e.origin), m = p.signLeft, h = p.signTop, g = p.signLeft + p.signWidth, _ = p.signTop + p.signHeight;
|
|
400
|
-
r.includes("w") && (m = u), r.includes("e") && (g = u), r.includes("n") && (h = f), r.includes("s") && (_ = f), g - m < 8 && (r.includes("w") ? m = g - 8 : g = m + 8), _ - h < 8 && (r.includes("n") ? h = _ - 8 : _ = h + 8),
|
|
425
|
+
r.includes("w") && (m = u), r.includes("e") && (g = u), r.includes("n") && (h = f), r.includes("s") && (_ = f), g - m < 8 && (r.includes("w") ? m = g - 8 : g = m + 8), _ - h < 8 && (r.includes("n") ? h = _ - 8 : _ = h + 8), F("update", Dt({
|
|
401
426
|
...e.origin,
|
|
402
427
|
signLeft: m,
|
|
403
428
|
signTop: h,
|
|
@@ -405,38 +430,38 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
405
430
|
signHeight: _ - h
|
|
406
431
|
}, n));
|
|
407
432
|
}
|
|
408
|
-
function
|
|
409
|
-
let a = o(e.origin, n, r, i, t,
|
|
410
|
-
|
|
433
|
+
function Yt(e, t, n, r, i) {
|
|
434
|
+
let a = o(e.origin, n, r, i, t, P.sealSizeLimit);
|
|
435
|
+
F("update", Dt({
|
|
411
436
|
...e.origin,
|
|
412
437
|
...a
|
|
413
438
|
}, t));
|
|
414
439
|
}
|
|
415
|
-
function
|
|
440
|
+
function Xt(e, t) {
|
|
416
441
|
let n = q(e);
|
|
417
442
|
return n && d(n) ? n : q(t);
|
|
418
443
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
444
|
+
function Zt() {
|
|
445
|
+
Qt();
|
|
421
446
|
let e = () => {
|
|
422
|
-
let t =
|
|
423
|
-
if (!t || !n || !
|
|
424
|
-
|
|
447
|
+
let t = B.value, n = I.value;
|
|
448
|
+
if (!t || !n || !V) {
|
|
449
|
+
H = 0;
|
|
425
450
|
return;
|
|
426
451
|
}
|
|
427
|
-
let r = n.getBoundingClientRect(), i = g(
|
|
428
|
-
i !== 0 && (n.scrollTop += i, X(),
|
|
452
|
+
let r = n.getBoundingClientRect(), i = g(V.clientY, r);
|
|
453
|
+
i !== 0 && (n.scrollTop += i, X(), qt(V)), H = requestAnimationFrame(e);
|
|
429
454
|
};
|
|
430
|
-
|
|
455
|
+
H = requestAnimationFrame(e);
|
|
431
456
|
}
|
|
432
|
-
function
|
|
433
|
-
|
|
457
|
+
function Qt() {
|
|
458
|
+
H &&= (cancelAnimationFrame(H), 0);
|
|
434
459
|
}
|
|
435
|
-
function
|
|
460
|
+
function $t(e, t) {
|
|
436
461
|
let n = q(t.pageIndex);
|
|
437
|
-
if (
|
|
462
|
+
if (P.readonly || !n || !d(n)) return;
|
|
438
463
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
439
|
-
e.preventDefault(),
|
|
464
|
+
e.preventDefault(), F("remove", t.id);
|
|
440
465
|
return;
|
|
441
466
|
}
|
|
442
467
|
let r = e.shiftKey ? 10 : 1, i = 0, o = 0;
|
|
@@ -447,204 +472,210 @@ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class:
|
|
|
447
472
|
else return;
|
|
448
473
|
e.preventDefault();
|
|
449
474
|
let s = Y(n), c = J(n);
|
|
450
|
-
|
|
475
|
+
F("update", a(t, i * s.width / Math.max(1, c.width), o * s.height / Math.max(1, c.height), n, Y(n), { sealSizeLimit: P.sealSizeLimit }));
|
|
451
476
|
}
|
|
452
|
-
function
|
|
477
|
+
function en(e) {
|
|
453
478
|
let t = e.dataTransfer?.getData("application/x-gd-contract-signing-location") || e.dataTransfer?.getData("text/plain");
|
|
454
479
|
if (t) try {
|
|
455
480
|
let e = JSON.parse(t);
|
|
456
|
-
return
|
|
481
|
+
return nn(e.type) ? e.type : void 0;
|
|
457
482
|
} catch {
|
|
458
|
-
return
|
|
483
|
+
return nn(t) ? t : void 0;
|
|
459
484
|
}
|
|
460
485
|
}
|
|
461
|
-
function
|
|
462
|
-
if (
|
|
463
|
-
let t =
|
|
486
|
+
function tn(e) {
|
|
487
|
+
if (P.readonly) return;
|
|
488
|
+
let t = en(e);
|
|
464
489
|
if (!t) return;
|
|
465
490
|
e.preventDefault();
|
|
466
|
-
let n =
|
|
467
|
-
r &&
|
|
491
|
+
let n = Mt(e.clientX, e.clientY), r = m(W.value, P.pages, n.x, n.y);
|
|
492
|
+
r && F("add", t, r.x, r.y, r.pageIndex);
|
|
468
493
|
}
|
|
469
|
-
function
|
|
494
|
+
function nn(e) {
|
|
470
495
|
return e === "seal" || e === "signature" || e === "date";
|
|
471
496
|
}
|
|
472
|
-
return
|
|
473
|
-
scrollToPage:
|
|
474
|
-
scrollToPlacement:
|
|
475
|
-
fitWidth:
|
|
476
|
-
}), (t, n) => (
|
|
477
|
-
|
|
497
|
+
return We({
|
|
498
|
+
scrollToPage: It,
|
|
499
|
+
scrollToPlacement: Lt,
|
|
500
|
+
fitWidth: Xe
|
|
501
|
+
}), (t, n) => (E(), x("main", ye, [S("header", be, [S("div", null, [S("strong", null, k(w.file?.fileName || "合同页面"), 1), ct.value ? (E(), x("span", xe, "第 " + k(ct.value.displayPageNumber) + " 页 · " + k(G.value ? "HTML" : "PDF") + " " + k(ct.value.width) + " × " + k(ct.value.height), 1)) : b("", !0)]), S("div", Se, [S("div", Ce, [
|
|
502
|
+
C(A(N), {
|
|
478
503
|
size: "small",
|
|
479
|
-
disabled:
|
|
504
|
+
disabled: qe.value <= 1,
|
|
480
505
|
"aria-label": "上一页",
|
|
481
|
-
onClick: n[0] ||= (e) =>
|
|
506
|
+
onClick: n[0] ||= (e) => Rt(-1)
|
|
482
507
|
}, {
|
|
483
|
-
default:
|
|
508
|
+
default: j(() => [C(A(he), { "aria-hidden": "true" })]),
|
|
484
509
|
_: 1
|
|
485
510
|
}, 8, ["disabled"]),
|
|
486
|
-
|
|
487
|
-
n[6] ||=
|
|
488
|
-
|
|
489
|
-
value:
|
|
511
|
+
S("label", null, [
|
|
512
|
+
n[6] ||= ae(" 第 ", -1),
|
|
513
|
+
S("input", {
|
|
514
|
+
value: qe.value,
|
|
490
515
|
type: "number",
|
|
491
516
|
min: "1",
|
|
492
|
-
max: Math.max(1,
|
|
493
|
-
onChange:
|
|
494
|
-
onKeydown:
|
|
495
|
-
}, null, 40,
|
|
496
|
-
|
|
517
|
+
max: Math.max(1, w.pages.length),
|
|
518
|
+
onChange: zt,
|
|
519
|
+
onKeydown: fe(zt, ["enter"])
|
|
520
|
+
}, null, 40, we),
|
|
521
|
+
ae(" / " + k(w.pages.length) + " 页 ", 1)
|
|
497
522
|
]),
|
|
498
|
-
|
|
523
|
+
C(A(N), {
|
|
499
524
|
size: "small",
|
|
500
|
-
disabled:
|
|
525
|
+
disabled: qe.value >= w.pages.length,
|
|
501
526
|
"aria-label": "下一页",
|
|
502
|
-
onClick: n[1] ||= (e) =>
|
|
527
|
+
onClick: n[1] ||= (e) => Rt(1)
|
|
503
528
|
}, {
|
|
504
|
-
default:
|
|
529
|
+
default: j(() => [C(A(ge), { "aria-hidden": "true" })]),
|
|
505
530
|
_: 1
|
|
506
531
|
}, 8, ["disabled"])
|
|
507
|
-
]),
|
|
508
|
-
|
|
532
|
+
]), S("div", Te, [
|
|
533
|
+
C(A(N), {
|
|
509
534
|
size: "small",
|
|
510
|
-
disabled:
|
|
535
|
+
disabled: w.zoom <= lt.value,
|
|
511
536
|
"aria-label": "缩小页面",
|
|
512
|
-
onClick: n[2] ||= (e) =>
|
|
537
|
+
onClick: n[2] ||= (e) => Bt(w.zoom - .1)
|
|
513
538
|
}, {
|
|
514
|
-
default:
|
|
539
|
+
default: j(() => [C(A(ve), { "aria-hidden": "true" })]),
|
|
515
540
|
_: 1
|
|
516
541
|
}, 8, ["disabled"]),
|
|
517
|
-
|
|
542
|
+
S("button", {
|
|
518
543
|
type: "button",
|
|
519
|
-
onClick: n[3] ||= (e) =>
|
|
520
|
-
},
|
|
521
|
-
|
|
544
|
+
onClick: n[3] ||= (e) => Bt(1)
|
|
545
|
+
}, k(Math.round(w.zoom * 100)) + "%", 1),
|
|
546
|
+
C(A(N), {
|
|
522
547
|
size: "small",
|
|
523
|
-
disabled:
|
|
548
|
+
disabled: w.zoom >= ut.value,
|
|
524
549
|
"aria-label": "放大页面",
|
|
525
|
-
onClick: n[4] ||= (e) =>
|
|
550
|
+
onClick: n[4] ||= (e) => Bt(w.zoom + .1)
|
|
526
551
|
}, {
|
|
527
|
-
default:
|
|
552
|
+
default: j(() => [C(A(_e), { "aria-hidden": "true" })]),
|
|
528
553
|
_: 1
|
|
529
554
|
}, 8, ["disabled"]),
|
|
530
|
-
|
|
555
|
+
C(A(N), {
|
|
531
556
|
size: "small",
|
|
532
557
|
"aria-label": "适应宽度",
|
|
533
558
|
title: "适应宽度",
|
|
534
|
-
onClick:
|
|
559
|
+
onClick: A(Xe)
|
|
535
560
|
}, {
|
|
536
|
-
default:
|
|
561
|
+
default: j(() => [C(A(me), { "aria-hidden": "true" })]),
|
|
537
562
|
_: 1
|
|
538
563
|
}, 8, ["onClick"])
|
|
539
|
-
])])]),
|
|
564
|
+
])])]), S("div", {
|
|
540
565
|
ref_key: "scrollRef",
|
|
541
|
-
ref:
|
|
566
|
+
ref: I,
|
|
542
567
|
class: "gd-ant-contract-signing-location__canvas-scroll",
|
|
543
|
-
onScrollPassive:
|
|
544
|
-
onClick:
|
|
545
|
-
onDragover: n[5] ||=
|
|
546
|
-
onDrop:
|
|
547
|
-
}, [
|
|
568
|
+
onScrollPassive: Pt,
|
|
569
|
+
onClick: Vt,
|
|
570
|
+
onDragover: n[5] ||= M(() => {}, ["prevent"]),
|
|
571
|
+
onDrop: tn
|
|
572
|
+
}, [w.pages.length ? (E(), x("div", {
|
|
548
573
|
key: 1,
|
|
549
574
|
ref_key: "stackRef",
|
|
550
|
-
ref:
|
|
575
|
+
ref: L,
|
|
551
576
|
class: "gd-ant-contract-signing-location__page-stack",
|
|
552
|
-
style:
|
|
553
|
-
width: `${
|
|
554
|
-
height: `${
|
|
577
|
+
style: T({
|
|
578
|
+
width: `${nt.value.width}px`,
|
|
579
|
+
height: `${nt.value.height}px`
|
|
555
580
|
})
|
|
556
|
-
}, [(
|
|
581
|
+
}, [(E(!0), x(v, null, D(st.value, (t) => (E(), x("div", {
|
|
557
582
|
key: t.layout.pageIndex,
|
|
558
583
|
class: "gd-ant-contract-signing-location__page-shell",
|
|
559
|
-
style:
|
|
584
|
+
style: T({
|
|
560
585
|
top: `${t.layout.top}px`,
|
|
561
586
|
left: `${t.layout.left}px`,
|
|
562
587
|
width: `${t.layout.width}px`,
|
|
563
588
|
height: `${t.layout.height}px`
|
|
564
589
|
})
|
|
565
|
-
}, [
|
|
590
|
+
}, [S("div", {
|
|
566
591
|
class: "gd-ant-contract-signing-location__page",
|
|
567
|
-
style:
|
|
592
|
+
style: T({
|
|
568
593
|
width: `${Y(t.page).width}px`,
|
|
569
594
|
height: `${Y(t.page).height}px`,
|
|
570
|
-
transform: `scale(${
|
|
595
|
+
transform: `scale(${w.zoom})`
|
|
571
596
|
}),
|
|
572
|
-
"aria-label": `${
|
|
573
|
-
}, [
|
|
597
|
+
"aria-label": `${w.file?.fileName || "合同"}第 ${t.page.displayPageNumber} 页`
|
|
598
|
+
}, [G.value && t.templatePage ? (E(), ie(e, {
|
|
574
599
|
key: 0,
|
|
575
|
-
page: t.templatePage
|
|
576
|
-
|
|
600
|
+
page: t.templatePage,
|
|
601
|
+
"font-base-url": w.fontBaseUrl,
|
|
602
|
+
onStatus: (e, n) => _t(t.layout.pageIndex, e, n)
|
|
603
|
+
}, null, 8, [
|
|
604
|
+
"page",
|
|
605
|
+
"font-base-url",
|
|
606
|
+
"onStatus"
|
|
607
|
+
])) : G.value ? (E(), x("div", De, [n[8] ||= S("strong", null, "模板页面无法渲染", -1), S("span", null, k(at.value || "页面结构无效,请回到模板设计器修复后重试。"), 1)])) : t.page.previewUrl ? (E(), x("img", {
|
|
577
608
|
key: 2,
|
|
578
609
|
class: "gd-ant-contract-signing-location__page-image",
|
|
579
610
|
src: t.page.previewUrl,
|
|
580
611
|
alt: "合同页面预览"
|
|
581
|
-
}, null, 8,
|
|
582
|
-
n[9] ||=
|
|
583
|
-
|
|
584
|
-
|
|
612
|
+
}, null, 8, Oe)) : (E(), x("div", ke, [bt(t.layout.pageIndex) ? (E(), x(v, { key: 0 }, [S("strong", null, "第 " + k(t.page.displayPageNumber) + " 页加载中…", 1), S("span", null, k(t.page.width) + " × " + k(t.page.height), 1)], 64)) : xt(t.layout.pageIndex) ? (E(), x(v, { key: 1 }, [
|
|
613
|
+
n[9] ||= S("strong", null, "合同页面预览加载失败", -1),
|
|
614
|
+
S("span", null, k(xt(t.layout.pageIndex)), 1),
|
|
615
|
+
S("button", {
|
|
585
616
|
type: "button",
|
|
586
|
-
onClick:
|
|
587
|
-
}, "重试当前页", 8,
|
|
588
|
-
], 64)) :
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
n[12] ||=
|
|
592
|
-
], 64)) : (
|
|
593
|
-
n[10] ||=
|
|
594
|
-
n[11] ||=
|
|
595
|
-
|
|
617
|
+
onClick: M((e) => F("retry", t.layout.pageIndex), ["stop"])
|
|
618
|
+
}, "重试当前页", 8, Ae)
|
|
619
|
+
], 64)) : A(d)(t.page) ? (E(), x(v, { key: 3 }, [
|
|
620
|
+
S("strong", null, "第 " + k(t.page.displayPageNumber) + " 页", 1),
|
|
621
|
+
S("span", null, k(t.page.width) + " × " + k(t.page.height), 1),
|
|
622
|
+
n[12] ||= S("small", null, "等待 dataProvider 返回页面预览图", -1)
|
|
623
|
+
], 64)) : (E(), x(v, { key: 2 }, [
|
|
624
|
+
n[10] ||= S("strong", null, "页面元数据不完整", -1),
|
|
625
|
+
n[11] ||= S("span", null, "缺少有效的原始宽高,无法安全计算签署坐标。", -1),
|
|
626
|
+
S("button", {
|
|
596
627
|
type: "button",
|
|
597
|
-
onClick:
|
|
598
|
-
}, "重新加载页面", 8,
|
|
599
|
-
], 64))])),
|
|
600
|
-
|
|
628
|
+
onClick: M((e) => F("retry", t.layout.pageIndex), ["stop"])
|
|
629
|
+
}, "重新加载页面", 8, je)
|
|
630
|
+
], 64))])), S("div", Me, [S("div", Ne, [
|
|
631
|
+
dt.value && dt.value.pageIndex === t.layout.pageIndex ? (E(), x("div", {
|
|
601
632
|
key: 0,
|
|
602
633
|
class: "gd-ant-contract-signing-location__coordinate-guides",
|
|
603
|
-
style:
|
|
634
|
+
style: T(Tt(dt.value)),
|
|
604
635
|
"aria-hidden": "true"
|
|
605
636
|
}, [
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
], 4)) :
|
|
611
|
-
|
|
637
|
+
S("span", Pe, [S("small", null, "上 " + k(Ct(t.page)?.top), 1)]),
|
|
638
|
+
S("span", Fe, [S("small", null, "下 " + k(Ct(t.page)?.bottom), 1)]),
|
|
639
|
+
S("span", Ie, [S("small", null, "左 " + k(Ct(t.page)?.left), 1)]),
|
|
640
|
+
S("span", Le, [S("small", null, "右 " + k(Ct(t.page)?.right), 1)])
|
|
641
|
+
], 4)) : b("", !0),
|
|
642
|
+
z.value.length && Qe.value === t.layout.pageIndex ? (E(), x("div", Re, [(E(!0), x(v, null, D(z.value, (e, n) => (E(), x("span", {
|
|
612
643
|
key: `${e.axis}-${n}`,
|
|
613
|
-
class:
|
|
614
|
-
style:
|
|
615
|
-
}, null, 6))), 128))])) :
|
|
616
|
-
(
|
|
644
|
+
class: se(e.axis === "x" ? "is-vertical" : "is-horizontal"),
|
|
645
|
+
style: T(Et(e, t.page))
|
|
646
|
+
}, null, 6))), 128))])) : b("", !0),
|
|
647
|
+
(E(!0), x(v, null, D(St(t.layout.pageIndex), (e) => (E(), x("button", {
|
|
617
648
|
key: e.id,
|
|
618
649
|
type: "button",
|
|
619
|
-
class:
|
|
620
|
-
style:
|
|
621
|
-
title:
|
|
622
|
-
"aria-label":
|
|
623
|
-
"aria-pressed": e.id ===
|
|
624
|
-
onClick:
|
|
625
|
-
onPointerdown: (t) =>
|
|
650
|
+
class: se(["gd-ant-contract-signing-location__placement", [`is-${e.signType}`, { "is-selected": e.id === w.selectedPlacementId }]]),
|
|
651
|
+
style: T(wt(e)),
|
|
652
|
+
title: Ot(e).alt,
|
|
653
|
+
"aria-label": Ot(e).alt,
|
|
654
|
+
"aria-pressed": e.id === w.selectedPlacementId,
|
|
655
|
+
onClick: M((t) => F("select", e.id), ["stop"]),
|
|
656
|
+
onPointerdown: (t) => Wt(t, e),
|
|
626
657
|
onLostpointercapture: $,
|
|
627
|
-
onKeydown: (t) =>
|
|
658
|
+
onKeydown: (t) => $t(t, e)
|
|
628
659
|
}, [
|
|
629
|
-
|
|
660
|
+
S("span", Be, [S("img", {
|
|
630
661
|
class: "gd-ant-contract-signing-location__placement-visual",
|
|
631
|
-
src:
|
|
632
|
-
alt:
|
|
662
|
+
src: Ot(e).dataUrl,
|
|
663
|
+
alt: Ot(e).alt,
|
|
633
664
|
draggable: "false"
|
|
634
|
-
}, null, 8,
|
|
635
|
-
e.mustSign ? (
|
|
636
|
-
(
|
|
665
|
+
}, null, 8, Ve)]),
|
|
666
|
+
e.mustSign ? (E(), x("span", He, "必签")) : b("", !0),
|
|
667
|
+
(E(!0), x(v, null, D(kt(e) ? Ke : [], (t) => (E(), x("i", {
|
|
637
668
|
key: t,
|
|
638
|
-
class:
|
|
639
|
-
onPointerdown:
|
|
640
|
-
}, null, 42,
|
|
641
|
-
], 46,
|
|
642
|
-
])])], 12,
|
|
669
|
+
class: se(["gd-ant-contract-signing-location__resize-handle", `is-${t}`]),
|
|
670
|
+
onPointerdown: M((n) => Gt(n, e, t), ["stop"])
|
|
671
|
+
}, null, 42, Ue))), 128))
|
|
672
|
+
], 46, ze))), 128))
|
|
673
|
+
])])], 12, Ee)], 4))), 128))], 4)) : (E(), x("div", {
|
|
643
674
|
key: 0,
|
|
644
|
-
class:
|
|
675
|
+
class: se(["gd-ant-contract-signing-location__canvas-state", { "is-error": G.value && at.value }]),
|
|
645
676
|
role: "status"
|
|
646
|
-
}, [
|
|
677
|
+
}, [G.value && at.value ? (E(), x(v, { key: 0 }, [n[7] ||= S("strong", null, "合同模板无法渲染", -1), S("span", null, k(at.value), 1)], 64)) : (E(), x(v, { key: 1 }, [ae("请选择可用的合同页面")], 64))], 2))], 544)]));
|
|
647
678
|
}
|
|
648
679
|
});
|
|
649
680
|
//#endregion
|
|
650
|
-
export {
|
|
681
|
+
export { We as default };
|