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