@guodun/antdv 1.3.0 → 1.3.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/src/ContractSigningLocation.vue.mjs +241 -236
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +22 -19
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +173 -147
- package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +83 -74
- package/dist/es/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.mjs +32 -32
- package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +8 -4
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +24 -20
- package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +112 -112
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.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/ProContractSigningFlow.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.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/word-paste.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/style/index.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/src/ContractSigningLocation.vue.d.ts +1 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +5 -0
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +24 -1
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +25 -1
- package/dist/types/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.d.ts +6 -2
- package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +2 -0
- package/package.json +1 -1
|
@@ -9,13 +9,13 @@ import de from "./ContractSigningLocationInspector.mjs";
|
|
|
9
9
|
import fe from "./ContractSigningLocationNavigator.mjs";
|
|
10
10
|
import { ContractSigningPreviewRequests as pe } from "./preview-requests.mjs";
|
|
11
11
|
import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as me, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as he, nextTick as _, normalizeClass as v, normalizeStyle as ge, onBeforeUnmount as _e, openBlock as y, ref as b, shallowRef as x, toDisplayString as ve, unref as S, watch as C, withCtx as w } from "vue";
|
|
12
|
-
import { Button as
|
|
12
|
+
import { Button as ye, Tooltip as be } from "ant-design-vue";
|
|
13
13
|
//#region src/components/contract-signing-location/src/ContractSigningLocation.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
14
|
+
var xe = { class: "gd-ant-contract-signing-location__header" }, Se = { class: "gd-ant-contract-signing-location__header-actions" }, Ce = { class: "gd-ant-contract-signing-location__placement-count" }, we = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "gd-ant-contract-signing-location__error",
|
|
17
17
|
role: "alert"
|
|
18
|
-
},
|
|
18
|
+
}, Te = ["aria-label", "aria-expanded"], Ee = { class: "gd-ant-contract-signing-location__panel-stack" }, De = ["aria-label", "aria-expanded"], Oe = { class: "gd-ant-contract-signing-location__panel-stack" }, ke = /* @__PURE__ */ he({
|
|
19
19
|
name: "ContractSigningLocation",
|
|
20
20
|
__name: "ContractSigningLocation",
|
|
21
21
|
props: {
|
|
@@ -45,7 +45,11 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
45
45
|
},
|
|
46
46
|
sealMinSize: { default: 50 },
|
|
47
47
|
sealMaxSize: { default: 80 },
|
|
48
|
-
height: { default: void 0 }
|
|
48
|
+
height: { default: void 0 },
|
|
49
|
+
showSubmitButton: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
}
|
|
49
53
|
},
|
|
50
54
|
emits: [
|
|
51
55
|
"update:modelValue",
|
|
@@ -57,101 +61,101 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
57
61
|
"submit",
|
|
58
62
|
"error"
|
|
59
63
|
],
|
|
60
|
-
setup(r, { expose: he, emit:
|
|
61
|
-
let
|
|
64
|
+
setup(r, { expose: he, emit: ke }) {
|
|
65
|
+
let T = r, E = ke, D = d(() => s(T.sealMinSize, T.sealMaxSize)), O = u(T.modelValue ?? ne(T.contractId), { sealSizeLimit: D.value }), k = b(O), Ae = x(c(O)), A = x(O.files[0]?.fileId ?? ""), j = x(O.files[0]?.pages[0]?.pageIndex ?? 0), M = x(""), N = x(!1), P = x(""), F = b([]), I = b({}), L = x(Be(T.zoom)), R = b(null), z = b(!1), B = b(!1), V = 0, H = !1, U, W = [], G = 0, K = new pe(), q = d(() => T.readonly || T.disabled), je = d(() => k.value.files.length <= 1), Me = d(() => _t(T.height)), J = d(() => k.value.files.find((e) => e.fileId === A.value) ?? k.value.files[0]), Ne = d(() => J.value?.pages.find((e) => e.pageIndex === j.value) ?? J.value?.pages[0]), Pe = d(() => {
|
|
66
|
+
let e = J.value;
|
|
67
|
+
return e ? k.value.placements.filter((t) => t.fileId === e.fileId) : [];
|
|
68
|
+
}), Y = d(() => k.value.placements.find((e) => e.id === M.value)), Fe = d(() => {
|
|
62
69
|
let e = Y.value;
|
|
63
|
-
return e ?
|
|
64
|
-
}),
|
|
65
|
-
let e = X.value;
|
|
66
|
-
return e ? l(A.value, e.fileId, e.pageIndex) ?? Me.value : Me.value;
|
|
67
|
-
}), Fe = d(() => I.value.filter((e) => e.endsWith(":thumbnail")).map((e) => e.slice(0, -10))), Ie = d(() => Object.keys(L.value).filter((e) => e.endsWith(":thumbnail")).map((e) => e.slice(0, -10))), Le = d(() => I.value.filter((e) => e.endsWith(":preview")).map((e) => e.slice(0, -8))), Re = d(() => {
|
|
70
|
+
return e ? l(k.value, e.fileId, e.pageIndex) ?? Ne.value : Ne.value;
|
|
71
|
+
}), Ie = d(() => F.value.filter((e) => e.endsWith(":thumbnail")).map((e) => e.slice(0, -10))), Le = d(() => Object.keys(I.value).filter((e) => e.endsWith(":thumbnail")).map((e) => e.slice(0, -10))), Re = d(() => F.value.filter((e) => e.endsWith(":preview")).map((e) => e.slice(0, -8))), ze = d(() => {
|
|
68
72
|
let e = {};
|
|
69
|
-
return Object.entries(
|
|
73
|
+
return Object.entries(I.value).forEach(([t, n]) => {
|
|
70
74
|
t.endsWith(":preview") && (e[t.slice(0, -8)] = n);
|
|
71
75
|
}), e;
|
|
72
76
|
});
|
|
73
|
-
C(() =>
|
|
77
|
+
C(() => T.modelValue, (e) => {
|
|
74
78
|
if (!e) return;
|
|
75
|
-
let t = u(e, { sealSizeLimit:
|
|
76
|
-
$(t) !== $(
|
|
77
|
-
}, { deep: !0 }), C(
|
|
78
|
-
$(u(
|
|
79
|
-
}), C(() =>
|
|
80
|
-
|
|
79
|
+
let t = u(e, { sealSizeLimit: D.value });
|
|
80
|
+
$(t) !== $(k.value) && (Q(), k.value = t, Ae.value = c(t), ct(), _(() => R.value?.scrollToPage(j.value)));
|
|
81
|
+
}, { deep: !0 }), C(D, () => {
|
|
82
|
+
$(u(k.value, { sealSizeLimit: D.value })) !== $(k.value) && X(k.value);
|
|
83
|
+
}), C(() => T.zoom, (e) => {
|
|
84
|
+
L.value = Be(e);
|
|
81
85
|
}), C(() => [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
T.contractId,
|
|
87
|
+
T.dataProvider,
|
|
88
|
+
T.autoLoad
|
|
85
89
|
], ([e, t, n], r) => {
|
|
86
|
-
!n || !t || !e || (!r || e !== r[0] || t !== r[1]) &&
|
|
90
|
+
!n || !t || !e || (!r || e !== r[0] || t !== r[1]) && Ue();
|
|
87
91
|
}, { immediate: !0 }), _e(() => {
|
|
88
|
-
|
|
92
|
+
H = !0, V += 1, ft(), Q();
|
|
89
93
|
});
|
|
90
|
-
function ze(e) {
|
|
91
|
-
return a(e, Math.min(E.minZoom, E.maxZoom), Math.max(E.minZoom, E.maxZoom));
|
|
92
|
-
}
|
|
93
94
|
function Be(e) {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
return a(e, Math.min(T.minZoom, T.maxZoom), Math.max(T.minZoom, T.maxZoom));
|
|
96
|
+
}
|
|
97
|
+
function Ve(e) {
|
|
98
|
+
let t = Be(e);
|
|
99
|
+
L.value = t, E("update:zoom", t);
|
|
96
100
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
101
|
+
function He() {
|
|
102
|
+
return R.value?.fitWidth() ?? L.value;
|
|
99
103
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
let n = c(
|
|
103
|
-
return
|
|
104
|
+
function X(e, t = {}) {
|
|
105
|
+
k.value = u(e, { sealSizeLimit: D.value }), t.clearError !== !1 && (P.value = ""), ct();
|
|
106
|
+
let n = c(k.value);
|
|
107
|
+
return E("update:modelValue", n), E("change", n), n;
|
|
104
108
|
}
|
|
105
|
-
async function
|
|
106
|
-
let e = String(
|
|
107
|
-
if (!
|
|
109
|
+
async function Ue() {
|
|
110
|
+
let e = String(T.contractId || k.value.contractId || "").trim();
|
|
111
|
+
if (!T.dataProvider) return Z({
|
|
108
112
|
code: "CONTRACT_PROVIDER_MISSING",
|
|
109
113
|
message: "未配置合同数据提供器,请由宿主传入文件数据"
|
|
110
114
|
}), !1;
|
|
111
|
-
if (!e) return
|
|
115
|
+
if (!e) return Z({
|
|
112
116
|
code: "CONTRACT_ID_MISSING",
|
|
113
117
|
message: "缺少用于加载合同的 PaaS contractId"
|
|
114
118
|
}), !1;
|
|
115
|
-
let t = ++
|
|
116
|
-
|
|
119
|
+
let t = ++V;
|
|
120
|
+
Q(), N.value = !0, P.value = "";
|
|
117
121
|
try {
|
|
118
|
-
let n = await
|
|
119
|
-
if (
|
|
120
|
-
let r = oe(n, o(
|
|
122
|
+
let n = await T.dataProvider.loadContract({ contractId: e });
|
|
123
|
+
if (H || t !== V) return !1;
|
|
124
|
+
let r = oe(n, o(T.dataProvider.coordinateScale)), i = u({
|
|
121
125
|
...r,
|
|
122
126
|
contractId: e,
|
|
123
|
-
placements: r.placements.length ? r.placements :
|
|
124
|
-
}, { sealSizeLimit:
|
|
125
|
-
|
|
127
|
+
placements: r.placements.length ? r.placements : k.value.contractId === e ? k.value.placements : []
|
|
128
|
+
}, { sealSizeLimit: D.value });
|
|
129
|
+
k.value = i, Ae.value = c(i), M.value = "", ct();
|
|
126
130
|
let a = c(i);
|
|
127
|
-
return
|
|
131
|
+
return E("update:modelValue", a), E("change", a), E("ready", a), We(), _(() => R.value?.scrollToPage(j.value)), a;
|
|
128
132
|
} catch (e) {
|
|
129
|
-
return
|
|
133
|
+
return H || t !== V || Z(lt(e, "CONTRACT_LOAD_FAILED", "合同加载失败,请检查授权后重试")), !1;
|
|
130
134
|
} finally {
|
|
131
|
-
!
|
|
135
|
+
!H && t === V && (N.value = !1);
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
|
-
async function
|
|
135
|
-
|
|
138
|
+
async function We() {
|
|
139
|
+
T.dataProvider?.loadPagePreview && await Promise.allSettled(k.value.files.map((e) => {
|
|
136
140
|
let t = ie(e.pages);
|
|
137
|
-
return t && !t.thumbnailUrl ?
|
|
141
|
+
return t && !t.thumbnailUrl ? Ge(e.fileId, t.pageIndex, !0) : Promise.resolve();
|
|
138
142
|
}));
|
|
139
143
|
}
|
|
140
|
-
async function
|
|
141
|
-
let r =
|
|
142
|
-
if (!r || !i ||
|
|
143
|
-
|
|
144
|
-
let s =
|
|
144
|
+
async function Ge(e, t, n) {
|
|
145
|
+
let r = T.dataProvider?.loadPagePreview, i = l(k.value, e, t), a = ut(e, t, n);
|
|
146
|
+
if (!r || !i || F.value.includes(a)) return;
|
|
147
|
+
dt(a), F.value = [...F.value, a];
|
|
148
|
+
let s = K.start(a);
|
|
145
149
|
try {
|
|
146
150
|
let i = await r({
|
|
147
|
-
contractId:
|
|
151
|
+
contractId: k.value.contractId || T.contractId,
|
|
148
152
|
fileId: e,
|
|
149
153
|
pageIndex: t,
|
|
150
154
|
thumbnail: n,
|
|
151
155
|
signal: s.signal
|
|
152
156
|
});
|
|
153
|
-
if (
|
|
154
|
-
let ee = ce(l(
|
|
157
|
+
if (H || !K.isCurrent(a, s) || !l(k.value, e, t)) return;
|
|
158
|
+
let ee = ce(l(k.value, e, t), i, o(T.dataProvider?.coordinateScale), n), te = k.value.files.map((r) => r.fileId === e ? {
|
|
155
159
|
...r,
|
|
156
160
|
pages: r.pages.map((e) => e.pageIndex === t ? {
|
|
157
161
|
...e,
|
|
@@ -159,74 +163,74 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
159
163
|
...n ? { thumbnailUrl: i.url } : { previewUrl: i.url }
|
|
160
164
|
} : e)
|
|
161
165
|
} : r);
|
|
162
|
-
|
|
163
|
-
...
|
|
166
|
+
X({
|
|
167
|
+
...k.value,
|
|
164
168
|
files: te
|
|
165
169
|
}, { clearError: !1 });
|
|
166
170
|
} catch (n) {
|
|
167
|
-
if (!
|
|
168
|
-
let r =
|
|
171
|
+
if (!K.isCurrent(a, s) || pt(n)) return;
|
|
172
|
+
let r = lt(n, "CONTRACT_PREVIEW_FAILED", "合同页面预览加载失败,可切换页面或重试", {
|
|
169
173
|
fileId: e,
|
|
170
174
|
pageIndex: t
|
|
171
175
|
});
|
|
172
|
-
|
|
173
|
-
...
|
|
176
|
+
E("error", r), I.value = {
|
|
177
|
+
...I.value,
|
|
174
178
|
[a]: r.message
|
|
175
179
|
};
|
|
176
180
|
} finally {
|
|
177
|
-
|
|
181
|
+
K.finish(a, s) && (F.value = F.value.filter((e) => e !== a));
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
|
-
function Ge(e) {
|
|
181
|
-
if (e === j.value) return;
|
|
182
|
-
let t = j.value;
|
|
183
|
-
dt(), t && (ft((e) => e.startsWith(`${t}:`) && e.endsWith(":preview")), G = G.filter((t) => t.fileId === e)), j.value = e, M.value = ie(A.value.files.find((t) => t.fileId === e)?.pages)?.pageIndex ?? 0, N.value = "", D("file-change", e), D("page-change", e, M.value), _(() => z.value?.scrollToPage(M.value));
|
|
184
|
-
}
|
|
185
184
|
function Ke(e) {
|
|
186
|
-
|
|
185
|
+
if (e === A.value) return;
|
|
186
|
+
let t = A.value;
|
|
187
|
+
ft(), t && (Q((e) => e.startsWith(`${t}:`) && e.endsWith(":preview")), W = W.filter((t) => t.fileId === e)), A.value = e, j.value = ie(k.value.files.find((t) => t.fileId === e)?.pages)?.pageIndex ?? 0, M.value = "", E("file-change", e), E("page-change", e, j.value), _(() => R.value?.scrollToPage(j.value));
|
|
187
188
|
}
|
|
188
189
|
function qe(e) {
|
|
189
|
-
|
|
190
|
+
j.value = e;
|
|
190
191
|
}
|
|
191
192
|
function Je(e) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
j.value !== e && (j.value = e), E("page-change", A.value, e);
|
|
194
|
+
}
|
|
195
|
+
function Ye(e) {
|
|
196
|
+
ft();
|
|
197
|
+
let t = A.value;
|
|
198
|
+
U = setTimeout(() => {
|
|
199
|
+
U = void 0, A.value === t && Xe(t, e);
|
|
196
200
|
}, 150);
|
|
197
201
|
}
|
|
198
|
-
function
|
|
199
|
-
let n =
|
|
200
|
-
!n || e !==
|
|
202
|
+
function Xe(e, t) {
|
|
203
|
+
let n = k.value.files.find((t) => t.fileId === e);
|
|
204
|
+
!n || e !== A.value || (t.forEach((e) => {
|
|
201
205
|
let t = n.pages.find((t) => t.pageIndex === e);
|
|
202
|
-
!t || t.previewUrl ||
|
|
206
|
+
!t || t.previewUrl || F.value.includes(ut(n.fileId, e, !1)) || W.some((t) => t.fileId === n.fileId && t.pageIndex === e) || W.push({
|
|
203
207
|
fileId: n.fileId,
|
|
204
208
|
pageIndex: e
|
|
205
209
|
});
|
|
206
|
-
}),
|
|
210
|
+
}), Ze());
|
|
207
211
|
}
|
|
208
|
-
async function
|
|
209
|
-
let e =
|
|
210
|
-
for (
|
|
211
|
-
let t =
|
|
212
|
+
async function Ze() {
|
|
213
|
+
let e = A.value;
|
|
214
|
+
for (W = W.filter((t) => t.fileId === e); G < 3 && W.length;) {
|
|
215
|
+
let t = W.shift();
|
|
212
216
|
if (!t || t.fileId !== e) continue;
|
|
213
|
-
let n = l(
|
|
214
|
-
!n || n.previewUrl ||
|
|
215
|
-
|
|
217
|
+
let n = l(k.value, t.fileId, t.pageIndex);
|
|
218
|
+
!n || n.previewUrl || F.value.includes(ut(t.fileId, t.pageIndex, !1)) || (G += 1, Ge(t.fileId, t.pageIndex, !1).finally(() => {
|
|
219
|
+
G = Math.max(0, G - 1), Ze();
|
|
216
220
|
}));
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
|
-
function
|
|
220
|
-
let t =
|
|
221
|
-
t && (t.fileId !==
|
|
223
|
+
function Qe(e) {
|
|
224
|
+
let t = k.value.placements.find((t) => t.id === e);
|
|
225
|
+
t && (t.fileId !== A.value && Ke(t.fileId), M.value = e, _(() => R.value?.scrollToPlacement(e)));
|
|
222
226
|
}
|
|
223
|
-
function
|
|
224
|
-
if (
|
|
225
|
-
let n = t.fileId ??
|
|
227
|
+
function $e(e, t = {}) {
|
|
228
|
+
if (q.value) return;
|
|
229
|
+
let n = t.fileId ?? J.value?.fileId, r = t.pageIndex ?? Ne.value?.pageIndex;
|
|
226
230
|
if (!n || r === void 0) return;
|
|
227
|
-
let i = l(
|
|
231
|
+
let i = l(k.value, n, r);
|
|
228
232
|
if (!i || !ae(i)) {
|
|
229
|
-
|
|
233
|
+
Z({
|
|
230
234
|
code: "CONTRACT_PAGE_SIZE_INVALID",
|
|
231
235
|
message: "当前页面缺少有效的原始宽高,暂时不能添加签署位置",
|
|
232
236
|
fileId: n,
|
|
@@ -234,9 +238,9 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
234
238
|
});
|
|
235
239
|
return;
|
|
236
240
|
}
|
|
237
|
-
let a =
|
|
241
|
+
let a = T.sealTypeOptions.find((e) => String(e.value).trim())?.value;
|
|
238
242
|
if (e === "seal" && !a) {
|
|
239
|
-
|
|
243
|
+
Z({
|
|
240
244
|
code: "CONTRACT_SEAL_TYPES_MISSING",
|
|
241
245
|
message: "当前未配置可用的印章类型,暂时不能添加印章位置",
|
|
242
246
|
fileId: n,
|
|
@@ -247,79 +251,79 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
247
251
|
let o = re(e, n, i, {
|
|
248
252
|
signLeft: t.signLeft,
|
|
249
253
|
signTop: t.signTop,
|
|
250
|
-
sizeProfile:
|
|
251
|
-
sealSizeLimit:
|
|
254
|
+
sizeProfile: T.sizeProfile,
|
|
255
|
+
sealSizeLimit: D.value,
|
|
252
256
|
...e === "seal" ? { sealType: [String(a)] } : {}
|
|
253
257
|
});
|
|
254
|
-
return
|
|
255
|
-
...
|
|
256
|
-
placements: [...
|
|
257
|
-
}),
|
|
258
|
-
}
|
|
259
|
-
function
|
|
260
|
-
|
|
261
|
-
...
|
|
262
|
-
placements:
|
|
258
|
+
return X({
|
|
259
|
+
...k.value,
|
|
260
|
+
placements: [...k.value.placements, o]
|
|
261
|
+
}), A.value = n, j.value = r, M.value = o.id, ht(o);
|
|
262
|
+
}
|
|
263
|
+
function et(e, t) {
|
|
264
|
+
q.value || X({
|
|
265
|
+
...k.value,
|
|
266
|
+
placements: k.value.placements.map((n) => {
|
|
263
267
|
if (n.id !== e) return n;
|
|
264
268
|
let r = t.pageIndex === void 0 ? n.pageIndex : t.pageIndex;
|
|
265
|
-
return se(n, t, l(
|
|
269
|
+
return se(n, t, l(k.value, n.fileId, r), { sealSizeLimit: D.value });
|
|
266
270
|
})
|
|
267
271
|
});
|
|
268
272
|
}
|
|
269
|
-
function
|
|
270
|
-
let e =
|
|
271
|
-
if (!e ||
|
|
272
|
-
let t = l(
|
|
273
|
+
function tt() {
|
|
274
|
+
let e = Y.value;
|
|
275
|
+
if (!e || q.value) return;
|
|
276
|
+
let t = l(k.value, e.fileId, e.pageIndex);
|
|
273
277
|
if (!t) return;
|
|
274
278
|
let n = i({
|
|
275
279
|
...ht(e),
|
|
276
280
|
id: gt(),
|
|
277
281
|
signLeft: e.signLeft + 16,
|
|
278
282
|
signTop: e.signTop + 16
|
|
279
|
-
}, t, { sealSizeLimit:
|
|
280
|
-
|
|
281
|
-
...
|
|
282
|
-
placements: [...
|
|
283
|
-
}),
|
|
284
|
-
}
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
...
|
|
288
|
-
placements:
|
|
289
|
-
}),
|
|
290
|
-
}
|
|
291
|
-
function nt() {
|
|
292
|
-
return le(A.value, { allowedSealTypes: E.sealTypeOptions.map((e) => e.value) });
|
|
283
|
+
}, t, { sealSizeLimit: D.value });
|
|
284
|
+
X({
|
|
285
|
+
...k.value,
|
|
286
|
+
placements: [...k.value.placements, n]
|
|
287
|
+
}), M.value = n.id;
|
|
288
|
+
}
|
|
289
|
+
function nt(e) {
|
|
290
|
+
q.value || (X({
|
|
291
|
+
...k.value,
|
|
292
|
+
placements: k.value.placements.filter((t) => t.id !== e)
|
|
293
|
+
}), M.value === e && (M.value = ""));
|
|
293
294
|
}
|
|
294
295
|
function rt() {
|
|
295
|
-
return
|
|
296
|
+
return le(k.value, { allowedSealTypes: T.sealTypeOptions.map((e) => e.value) });
|
|
296
297
|
}
|
|
297
298
|
function it() {
|
|
298
|
-
return
|
|
299
|
+
return c(k.value);
|
|
299
300
|
}
|
|
300
301
|
function at() {
|
|
302
|
+
return te(it(), { allowedSealTypes: T.sealTypeOptions.map((e) => e.value) });
|
|
303
|
+
}
|
|
304
|
+
function ot() {
|
|
301
305
|
try {
|
|
302
|
-
let e =
|
|
303
|
-
return
|
|
306
|
+
let e = at();
|
|
307
|
+
return P.value = "", E("submit", e), e;
|
|
304
308
|
} catch (e) {
|
|
305
|
-
return
|
|
309
|
+
return Z(e instanceof ee ? {
|
|
306
310
|
...e.errors[0],
|
|
307
311
|
cause: e
|
|
308
|
-
} :
|
|
312
|
+
} : lt(e, "CONTRACT_SIGNING_LOCATION_INVALID", "指定签署位置数据不完整")), !1;
|
|
309
313
|
}
|
|
310
314
|
}
|
|
311
|
-
function
|
|
312
|
-
let e =
|
|
313
|
-
return
|
|
315
|
+
function st() {
|
|
316
|
+
let e = X(c(Ae.value));
|
|
317
|
+
return M.value = "", ct(!0), _(() => R.value?.scrollToPage(j.value)), e;
|
|
314
318
|
}
|
|
315
|
-
function
|
|
316
|
-
let t = (e ? void 0 :
|
|
317
|
-
|
|
319
|
+
function ct(e = !1) {
|
|
320
|
+
let t = (e ? void 0 : k.value.files.find((e) => e.fileId === A.value)) ?? k.value.files[0];
|
|
321
|
+
A.value = t?.fileId ?? "", j.value = ((e ? void 0 : t?.pages.find((e) => e.pageIndex === j.value)) ?? t?.pages[0])?.pageIndex ?? 0, k.value.placements.some((e) => e.id === M.value) || (M.value = "");
|
|
318
322
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
323
|
+
function Z(e) {
|
|
324
|
+
P.value = e.message, E("error", e);
|
|
321
325
|
}
|
|
322
|
-
function
|
|
326
|
+
function lt(e, t, n, r = {}) {
|
|
323
327
|
let i = typeof e == "object" && e && "status" in e ? Number(e.status) : void 0;
|
|
324
328
|
return {
|
|
325
329
|
code: t,
|
|
@@ -328,27 +332,27 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
328
332
|
cause: e
|
|
329
333
|
};
|
|
330
334
|
}
|
|
331
|
-
function
|
|
335
|
+
function ut(e, t, n) {
|
|
332
336
|
return `${e}:${t}:${n ? "thumbnail" : "preview"}`;
|
|
333
337
|
}
|
|
334
|
-
function
|
|
335
|
-
if (!(e in
|
|
336
|
-
let t = { ...
|
|
337
|
-
delete t[e],
|
|
338
|
+
function dt(e) {
|
|
339
|
+
if (!(e in I.value)) return;
|
|
340
|
+
let t = { ...I.value };
|
|
341
|
+
delete t[e], I.value = t;
|
|
338
342
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
343
|
+
function ft() {
|
|
344
|
+
U &&= (clearTimeout(U), void 0);
|
|
341
345
|
}
|
|
342
|
-
function
|
|
343
|
-
let t = e ?? (() => !0), n = new Set(
|
|
344
|
-
n.size && (
|
|
346
|
+
function Q(e) {
|
|
347
|
+
let t = e ?? (() => !0), n = new Set(K.abort(t));
|
|
348
|
+
n.size && (F.value = F.value.filter((e) => !n.has(e))), e || (W = []);
|
|
345
349
|
}
|
|
346
350
|
function pt(e) {
|
|
347
351
|
return !!(e && typeof e == "object" && "cancelled" in e && e.cancelled) || e instanceof DOMException && e.name === "AbortError";
|
|
348
352
|
}
|
|
349
353
|
function mt(e) {
|
|
350
|
-
let t =
|
|
351
|
-
t &&
|
|
354
|
+
let t = J.value;
|
|
355
|
+
t && Ge(t.fileId, e, !1);
|
|
352
356
|
}
|
|
353
357
|
function ht(e) {
|
|
354
358
|
return {
|
|
@@ -367,86 +371,87 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
367
371
|
if (typeof e == "string" && e.trim()) return { "--gd-ant-contract-signing-location-height": e.trim() };
|
|
368
372
|
}
|
|
369
373
|
return he({
|
|
370
|
-
load:
|
|
371
|
-
validate:
|
|
372
|
-
getValue:
|
|
373
|
-
getOutput:
|
|
374
|
-
submit:
|
|
375
|
-
reset:
|
|
376
|
-
addPlacement:
|
|
377
|
-
removePlacement:
|
|
378
|
-
fitWidth:
|
|
374
|
+
load: Ue,
|
|
375
|
+
validate: rt,
|
|
376
|
+
getValue: it,
|
|
377
|
+
getOutput: at,
|
|
378
|
+
submit: ot,
|
|
379
|
+
reset: st,
|
|
380
|
+
addPlacement: $e,
|
|
381
|
+
removePlacement: nt,
|
|
382
|
+
fitWidth: He
|
|
379
383
|
}), (i, a) => (y(), me("section", {
|
|
380
384
|
class: v(["gd-ant-contract-signing-location", {
|
|
381
385
|
"is-readonly": r.readonly,
|
|
382
386
|
"is-disabled": r.disabled
|
|
383
387
|
}]),
|
|
384
|
-
style: ge(
|
|
388
|
+
style: ge(Me.value)
|
|
385
389
|
}, [
|
|
386
|
-
m("header",
|
|
390
|
+
m("header", xe, [a[9] ||= m("div", { class: "gd-ant-contract-signing-location__title" }, [m("span", {
|
|
387
391
|
class: "gd-ant-contract-signing-location__title-bar",
|
|
388
392
|
"aria-hidden": "true"
|
|
389
|
-
}), m("div", null, [m("strong", null, "指定合同签署位置")])], -1), m("div",
|
|
390
|
-
m("span",
|
|
391
|
-
r.dataProvider ? (y(), f(S(
|
|
393
|
+
}), m("div", null, [m("strong", null, "指定合同签署位置")])], -1), m("div", Se, [
|
|
394
|
+
m("span", Ce, ve(k.value.placements.length) + " 个位置", 1),
|
|
395
|
+
r.dataProvider ? (y(), f(S(ye), {
|
|
392
396
|
key: 0,
|
|
393
|
-
loading:
|
|
394
|
-
onClick:
|
|
397
|
+
loading: N.value,
|
|
398
|
+
onClick: Ue
|
|
395
399
|
}, {
|
|
396
400
|
default: w(() => [g(S(t), { "aria-hidden": "true" }), a[6] ||= h(" 重新加载 ", -1)]),
|
|
397
401
|
_: 1
|
|
398
402
|
}, 8, ["loading"])) : p("", !0),
|
|
399
|
-
g(S(
|
|
400
|
-
disabled:
|
|
401
|
-
onClick:
|
|
403
|
+
g(S(ye), {
|
|
404
|
+
disabled: q.value,
|
|
405
|
+
onClick: st
|
|
402
406
|
}, {
|
|
403
407
|
default: w(() => [...a[7] ||= [h("重置", -1)]]),
|
|
404
408
|
_: 1
|
|
405
409
|
}, 8, ["disabled"]),
|
|
406
|
-
|
|
410
|
+
r.showSubmitButton ? (y(), f(S(ye), {
|
|
411
|
+
key: 1,
|
|
407
412
|
type: "primary",
|
|
408
|
-
loading:
|
|
413
|
+
loading: N.value,
|
|
409
414
|
disabled: r.disabled,
|
|
410
|
-
onClick:
|
|
415
|
+
onClick: ot
|
|
411
416
|
}, {
|
|
412
417
|
default: w(() => [...a[8] ||= [h("确认并生成规则", -1)]]),
|
|
413
418
|
_: 1
|
|
414
|
-
}, 8, ["loading", "disabled"])
|
|
419
|
+
}, 8, ["loading", "disabled"])) : p("", !0)
|
|
415
420
|
])]),
|
|
416
|
-
|
|
421
|
+
P.value ? (y(), me("div", we, [m("span", null, ve(P.value), 1), r.dataProvider && r.contractId ? (y(), f(S(ye), {
|
|
417
422
|
key: 0,
|
|
418
423
|
type: "link",
|
|
419
424
|
size: "small",
|
|
420
|
-
onClick:
|
|
425
|
+
onClick: Ue
|
|
421
426
|
}, {
|
|
422
427
|
default: w(() => [...a[10] ||= [h("重试", -1)]]),
|
|
423
428
|
_: 1
|
|
424
429
|
})) : p("", !0)])) : p("", !0),
|
|
425
|
-
m("div", { class: v(["gd-ant-contract-signing-location__body", { "is-single-file":
|
|
426
|
-
|
|
430
|
+
m("div", { class: v(["gd-ant-contract-signing-location__body", { "is-single-file": je.value }]) }, [
|
|
431
|
+
je.value ? p("", !0) : (y(), me("div", {
|
|
427
432
|
key: 0,
|
|
428
|
-
class: v(["gd-ant-contract-signing-location__navigator-wrap", { "is-collapsed":
|
|
429
|
-
}, [g(S(
|
|
433
|
+
class: v(["gd-ant-contract-signing-location__navigator-wrap", { "is-collapsed": B.value }])
|
|
434
|
+
}, [g(S(be), { title: B.value ? "展开页面栏" : "收起页面栏" }, {
|
|
430
435
|
default: w(() => [m("button", {
|
|
431
436
|
type: "button",
|
|
432
437
|
class: "gd-ant-contract-signing-location__panel-handle",
|
|
433
|
-
"aria-label":
|
|
434
|
-
"aria-expanded": !
|
|
435
|
-
onClick: a[0] ||= (e) =>
|
|
436
|
-
}, [
|
|
438
|
+
"aria-label": B.value ? "展开页面栏" : "收起页面栏",
|
|
439
|
+
"aria-expanded": !B.value,
|
|
440
|
+
onClick: a[0] ||= (e) => B.value = !B.value
|
|
441
|
+
}, [B.value ? (y(), f(S(n), {
|
|
437
442
|
key: 0,
|
|
438
443
|
"aria-hidden": "true"
|
|
439
444
|
})) : (y(), f(S(e), {
|
|
440
445
|
key: 1,
|
|
441
446
|
"aria-hidden": "true"
|
|
442
|
-
}))], 8,
|
|
447
|
+
}))], 8, Te)]),
|
|
443
448
|
_: 1
|
|
444
|
-
}, 8, ["title"]), m("div",
|
|
445
|
-
files:
|
|
446
|
-
"active-file-id":
|
|
447
|
-
"loading-preview-keys":
|
|
448
|
-
"error-preview-keys":
|
|
449
|
-
onSelect:
|
|
449
|
+
}, 8, ["title"]), m("div", Ee, [g(fe, {
|
|
450
|
+
files: k.value.files,
|
|
451
|
+
"active-file-id": A.value,
|
|
452
|
+
"loading-preview-keys": Ie.value,
|
|
453
|
+
"error-preview-keys": Le.value,
|
|
454
|
+
onSelect: Ke
|
|
450
455
|
}, null, 8, [
|
|
451
456
|
"files",
|
|
452
457
|
"active-file-id",
|
|
@@ -455,33 +460,33 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
455
460
|
])])], 2)),
|
|
456
461
|
g(ue, {
|
|
457
462
|
ref_key: "canvasRef",
|
|
458
|
-
ref:
|
|
459
|
-
file:
|
|
460
|
-
pages:
|
|
461
|
-
placements:
|
|
462
|
-
"selected-placement-id":
|
|
463
|
-
readonly:
|
|
463
|
+
ref: R,
|
|
464
|
+
file: J.value,
|
|
465
|
+
pages: J.value?.pages ?? [],
|
|
466
|
+
placements: Pe.value,
|
|
467
|
+
"selected-placement-id": M.value,
|
|
468
|
+
readonly: q.value,
|
|
464
469
|
resizable: r.resizable,
|
|
465
|
-
"seal-size-limit":
|
|
466
|
-
zoom:
|
|
467
|
-
"preview-loading-keys":
|
|
468
|
-
"preview-error-map":
|
|
469
|
-
"active-page-index":
|
|
470
|
+
"seal-size-limit": D.value,
|
|
471
|
+
zoom: L.value,
|
|
472
|
+
"preview-loading-keys": Re.value,
|
|
473
|
+
"preview-error-map": ze.value,
|
|
474
|
+
"active-page-index": j.value,
|
|
470
475
|
"min-zoom": r.minZoom,
|
|
471
476
|
"max-zoom": r.maxZoom,
|
|
472
|
-
onSelect: a[1] ||= (e) =>
|
|
477
|
+
onSelect: a[1] ||= (e) => M.value = e,
|
|
473
478
|
onRetry: mt,
|
|
474
|
-
onAdd: a[2] ||= (e, t, n, r) =>
|
|
479
|
+
onAdd: a[2] ||= (e, t, n, r) => $e(e, {
|
|
475
480
|
signLeft: t,
|
|
476
481
|
signTop: n,
|
|
477
482
|
pageIndex: r
|
|
478
483
|
}),
|
|
479
|
-
onUpdate: a[3] ||= (e) =>
|
|
480
|
-
onRemove:
|
|
481
|
-
onVisiblePages:
|
|
482
|
-
onViewPage:
|
|
483
|
-
onPageChange:
|
|
484
|
-
onZoomChange:
|
|
484
|
+
onUpdate: a[3] ||= (e) => et(e.id, e),
|
|
485
|
+
onRemove: nt,
|
|
486
|
+
onVisiblePages: Ye,
|
|
487
|
+
onViewPage: qe,
|
|
488
|
+
onPageChange: Je,
|
|
489
|
+
onZoomChange: Ve
|
|
485
490
|
}, null, 8, [
|
|
486
491
|
"file",
|
|
487
492
|
"pages",
|
|
@@ -497,36 +502,36 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
497
502
|
"min-zoom",
|
|
498
503
|
"max-zoom"
|
|
499
504
|
]),
|
|
500
|
-
m("div", { class: v(["gd-ant-contract-signing-location__inspector-wrap", { "is-collapsed":
|
|
505
|
+
m("div", { class: v(["gd-ant-contract-signing-location__inspector-wrap", { "is-collapsed": z.value }]) }, [g(S(be), { title: z.value ? "展开属性栏" : "收起属性栏" }, {
|
|
501
506
|
default: w(() => [m("button", {
|
|
502
507
|
type: "button",
|
|
503
508
|
class: "gd-ant-contract-signing-location__panel-handle",
|
|
504
|
-
"aria-label":
|
|
505
|
-
"aria-expanded": !
|
|
506
|
-
onClick: a[4] ||= (e) =>
|
|
507
|
-
}, [
|
|
509
|
+
"aria-label": z.value ? "展开属性栏" : "收起属性栏",
|
|
510
|
+
"aria-expanded": !z.value,
|
|
511
|
+
onClick: a[4] ||= (e) => z.value = !z.value
|
|
512
|
+
}, [z.value ? (y(), f(S(e), {
|
|
508
513
|
key: 0,
|
|
509
514
|
"aria-hidden": "true"
|
|
510
515
|
})) : (y(), f(S(n), {
|
|
511
516
|
key: 1,
|
|
512
517
|
"aria-hidden": "true"
|
|
513
|
-
}))], 8,
|
|
518
|
+
}))], 8, De)]),
|
|
514
519
|
_: 1
|
|
515
|
-
}, 8, ["title"]), m("div",
|
|
516
|
-
placement:
|
|
517
|
-
page:
|
|
518
|
-
pages:
|
|
519
|
-
placements:
|
|
520
|
-
readonly:
|
|
520
|
+
}, 8, ["title"]), m("div", Oe, [g(de, {
|
|
521
|
+
placement: Y.value,
|
|
522
|
+
page: Fe.value,
|
|
523
|
+
pages: J.value?.pages ?? [],
|
|
524
|
+
placements: Pe.value,
|
|
525
|
+
readonly: q.value,
|
|
521
526
|
resizable: r.resizable,
|
|
522
|
-
"seal-size-limit":
|
|
527
|
+
"seal-size-limit": D.value,
|
|
523
528
|
"seal-type-options": r.sealTypeOptions,
|
|
524
529
|
"size-profile": r.sizeProfile,
|
|
525
|
-
onAdd:
|
|
526
|
-
onUpdate: a[5] ||= (e) =>
|
|
527
|
-
onDuplicate:
|
|
528
|
-
onRemove:
|
|
529
|
-
onLocate:
|
|
530
|
+
onAdd: $e,
|
|
531
|
+
onUpdate: a[5] ||= (e) => Y.value && et(Y.value.id, e),
|
|
532
|
+
onDuplicate: tt,
|
|
533
|
+
onRemove: nt,
|
|
534
|
+
onLocate: Qe
|
|
530
535
|
}, null, 8, [
|
|
531
536
|
"placement",
|
|
532
537
|
"page",
|
|
@@ -543,4 +548,4 @@ var be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "g
|
|
|
543
548
|
}
|
|
544
549
|
});
|
|
545
550
|
//#endregion
|
|
546
|
-
export {
|
|
551
|
+
export { ke as default };
|