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