@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.
Files changed (36) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +241 -236
  2. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +22 -19
  3. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +173 -147
  4. package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +83 -74
  5. package/dist/es/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.mjs +32 -32
  6. package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
  7. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +8 -4
  8. package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +24 -20
  9. package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +112 -112
  10. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  11. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  12. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
  13. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
  14. package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
  15. package/dist/lib/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.cjs +1 -1
  16. package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
  17. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  18. package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
  19. package/dist/lib/components/pro-contract-template-designer/src/utils/word-paste.cjs +2 -2
  20. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  21. package/dist/theme/icon.css +1 -1
  22. package/dist/theme/index.css +1 -1
  23. package/dist/theme/pro-contract-signing-flow.css +1 -1
  24. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +1 -0
  25. package/dist/types/components/contract-signing-location/src/types.d.ts +5 -0
  26. package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +24 -1
  27. package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.d.ts +1 -0
  28. package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +25 -1
  29. package/dist/types/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.d.ts +6 -2
  30. package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +5 -0
  31. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +1 -1
  32. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +1 -1
  33. package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +1 -1
  34. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +1 -1
  35. package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +2 -0
  36. 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 T, Tooltip as ye } from "ant-design-vue";
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 be = { class: "gd-ant-contract-signing-location__header" }, xe = { class: "gd-ant-contract-signing-location__header-actions" }, Se = { class: "gd-ant-contract-signing-location__placement-count" }, Ce = {
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
- }, we = ["aria-label", "aria-expanded"], Te = { class: "gd-ant-contract-signing-location__panel-stack" }, Ee = ["aria-label", "aria-expanded"], De = { class: "gd-ant-contract-signing-location__panel-stack" }, Oe = /* @__PURE__ */ he({
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: Oe }) {
61
- let E = r, D = Oe, O = d(() => s(E.sealMinSize, E.sealMaxSize)), k = u(E.modelValue ?? ne(E.contractId), { sealSizeLimit: O.value }), A = b(k), ke = x(c(k)), j = x(k.files[0]?.fileId ?? ""), M = x(k.files[0]?.pages[0]?.pageIndex ?? 0), N = x(""), P = x(!1), F = x(""), I = b([]), L = b({}), R = x(ze(E.zoom)), z = b(null), B = b(!1), V = b(!1), H = 0, U = !1, W, G = [], K = 0, q = new pe(), J = d(() => E.readonly || E.disabled), Ae = d(() => A.value.files.length <= 1), je = d(() => _t(E.height)), Y = d(() => A.value.files.find((e) => e.fileId === j.value) ?? A.value.files[0]), Me = d(() => Y.value?.pages.find((e) => e.pageIndex === M.value) ?? Y.value?.pages[0]), Ne = d(() => {
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 ? A.value.placements.filter((t) => t.fileId === e.fileId) : [];
64
- }), X = d(() => A.value.placements.find((e) => e.id === N.value)), Pe = d(() => {
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(L.value).forEach(([t, n]) => {
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(() => E.modelValue, (e) => {
77
+ C(() => T.modelValue, (e) => {
74
78
  if (!e) return;
75
- let t = u(e, { sealSizeLimit: O.value });
76
- $(t) !== $(A.value) && (ft(), A.value = t, ke.value = c(t), st(), _(() => z.value?.scrollToPage(M.value)));
77
- }, { deep: !0 }), C(O, () => {
78
- $(u(A.value, { sealSizeLimit: O.value })) !== $(A.value) && Z(A.value);
79
- }), C(() => E.zoom, (e) => {
80
- R.value = ze(e);
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
- E.contractId,
83
- E.dataProvider,
84
- E.autoLoad
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]) && He();
90
+ !n || !t || !e || (!r || e !== r[0] || t !== r[1]) && Ue();
87
91
  }, { immediate: !0 }), _e(() => {
88
- U = !0, H += 1, dt(), ft();
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
- let t = ze(e);
95
- R.value = t, D("update:zoom", t);
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 Ve() {
98
- return z.value?.fitWidth() ?? R.value;
101
+ function He() {
102
+ return R.value?.fitWidth() ?? L.value;
99
103
  }
100
- function Z(e, t = {}) {
101
- A.value = u(e, { sealSizeLimit: O.value }), t.clearError !== !1 && (F.value = ""), st();
102
- let n = c(A.value);
103
- return D("update:modelValue", n), D("change", n), n;
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 He() {
106
- let e = String(E.contractId || A.value.contractId || "").trim();
107
- if (!E.dataProvider) return Q({
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 Q({
115
+ if (!e) return Z({
112
116
  code: "CONTRACT_ID_MISSING",
113
117
  message: "缺少用于加载合同的 PaaS contractId"
114
118
  }), !1;
115
- let t = ++H;
116
- ft(), P.value = !0, F.value = "";
119
+ let t = ++V;
120
+ Q(), N.value = !0, P.value = "";
117
121
  try {
118
- let n = await E.dataProvider.loadContract({ contractId: e });
119
- if (U || t !== H) return !1;
120
- let r = oe(n, o(E.dataProvider.coordinateScale)), i = u({
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 : A.value.contractId === e ? A.value.placements : []
124
- }, { sealSizeLimit: O.value });
125
- A.value = i, ke.value = c(i), N.value = "", st();
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 D("update:modelValue", a), D("change", a), D("ready", a), Ue(), _(() => z.value?.scrollToPage(M.value)), a;
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 U || t !== H || Q(ct(e, "CONTRACT_LOAD_FAILED", "合同加载失败,请检查授权后重试")), !1;
133
+ return H || t !== V || Z(lt(e, "CONTRACT_LOAD_FAILED", "合同加载失败,请检查授权后重试")), !1;
130
134
  } finally {
131
- !U && t === H && (P.value = !1);
135
+ !H && t === V && (N.value = !1);
132
136
  }
133
137
  }
134
- async function Ue() {
135
- E.dataProvider?.loadPagePreview && await Promise.allSettled(A.value.files.map((e) => {
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 ? We(e.fileId, t.pageIndex, !0) : Promise.resolve();
141
+ return t && !t.thumbnailUrl ? Ge(e.fileId, t.pageIndex, !0) : Promise.resolve();
138
142
  }));
139
143
  }
140
- async function We(e, t, n) {
141
- let r = E.dataProvider?.loadPagePreview, i = l(A.value, e, t), a = lt(e, t, n);
142
- if (!r || !i || I.value.includes(a)) return;
143
- ut(a), I.value = [...I.value, a];
144
- let s = q.start(a);
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: A.value.contractId || E.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 (U || !q.isCurrent(a, s) || !l(A.value, e, t)) return;
154
- let ee = ce(l(A.value, e, t), i, o(E.dataProvider?.coordinateScale), n), te = A.value.files.map((r) => r.fileId === e ? {
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
- Z({
163
- ...A.value,
166
+ X({
167
+ ...k.value,
164
168
  files: te
165
169
  }, { clearError: !1 });
166
170
  } catch (n) {
167
- if (!q.isCurrent(a, s) || pt(n)) return;
168
- let r = ct(n, "CONTRACT_PREVIEW_FAILED", "合同页面预览加载失败,可切换页面或重试", {
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
- D("error", r), L.value = {
173
- ...L.value,
176
+ E("error", r), I.value = {
177
+ ...I.value,
174
178
  [a]: r.message
175
179
  };
176
180
  } finally {
177
- q.finish(a, s) && (I.value = I.value.filter((e) => e !== a));
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
- M.value = e;
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
- M.value !== e && (M.value = e), D("page-change", j.value, e);
190
+ j.value = e;
190
191
  }
191
192
  function Je(e) {
192
- dt();
193
- let t = j.value;
194
- W = setTimeout(() => {
195
- W = void 0, j.value === t && Ye(t, e);
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 Ye(e, t) {
199
- let n = A.value.files.find((t) => t.fileId === e);
200
- !n || e !== j.value || (t.forEach((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 || I.value.includes(lt(n.fileId, e, !1)) || G.some((t) => t.fileId === n.fileId && t.pageIndex === e) || G.push({
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
- }), Xe());
210
+ }), Ze());
207
211
  }
208
- async function Xe() {
209
- let e = j.value;
210
- for (G = G.filter((t) => t.fileId === e); K < 3 && G.length;) {
211
- let t = G.shift();
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(A.value, t.fileId, t.pageIndex);
214
- !n || n.previewUrl || I.value.includes(lt(t.fileId, t.pageIndex, !1)) || (K += 1, We(t.fileId, t.pageIndex, !1).finally(() => {
215
- K = Math.max(0, K - 1), Xe();
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 Ze(e) {
220
- let t = A.value.placements.find((t) => t.id === e);
221
- t && (t.fileId !== j.value && Ge(t.fileId), N.value = e, _(() => z.value?.scrollToPlacement(e)));
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 Qe(e, t = {}) {
224
- if (J.value) return;
225
- let n = t.fileId ?? Y.value?.fileId, r = t.pageIndex ?? Me.value?.pageIndex;
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(A.value, n, r);
231
+ let i = l(k.value, n, r);
228
232
  if (!i || !ae(i)) {
229
- Q({
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 = E.sealTypeOptions.find((e) => String(e.value).trim())?.value;
241
+ let a = T.sealTypeOptions.find((e) => String(e.value).trim())?.value;
238
242
  if (e === "seal" && !a) {
239
- Q({
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: E.sizeProfile,
251
- sealSizeLimit: O.value,
254
+ sizeProfile: T.sizeProfile,
255
+ sealSizeLimit: D.value,
252
256
  ...e === "seal" ? { sealType: [String(a)] } : {}
253
257
  });
254
- return Z({
255
- ...A.value,
256
- placements: [...A.value.placements, o]
257
- }), j.value = n, M.value = r, N.value = o.id, ht(o);
258
- }
259
- function $e(e, t) {
260
- J.value || Z({
261
- ...A.value,
262
- placements: A.value.placements.map((n) => {
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(A.value, n.fileId, r), { sealSizeLimit: O.value });
269
+ return se(n, t, l(k.value, n.fileId, r), { sealSizeLimit: D.value });
266
270
  })
267
271
  });
268
272
  }
269
- function et() {
270
- let e = X.value;
271
- if (!e || J.value) return;
272
- let t = l(A.value, e.fileId, e.pageIndex);
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: O.value });
280
- Z({
281
- ...A.value,
282
- placements: [...A.value.placements, n]
283
- }), N.value = n.id;
284
- }
285
- function tt(e) {
286
- J.value || (Z({
287
- ...A.value,
288
- placements: A.value.placements.filter((t) => t.id !== e)
289
- }), N.value === e && (N.value = ""));
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 c(A.value);
296
+ return le(k.value, { allowedSealTypes: T.sealTypeOptions.map((e) => e.value) });
296
297
  }
297
298
  function it() {
298
- return te(rt(), { allowedSealTypes: E.sealTypeOptions.map((e) => e.value) });
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 = it();
303
- return F.value = "", D("submit", e), e;
306
+ let e = at();
307
+ return P.value = "", E("submit", e), e;
304
308
  } catch (e) {
305
- return Q(e instanceof ee ? {
309
+ return Z(e instanceof ee ? {
306
310
  ...e.errors[0],
307
311
  cause: e
308
- } : ct(e, "CONTRACT_SIGNING_LOCATION_INVALID", "指定签署位置数据不完整")), !1;
312
+ } : lt(e, "CONTRACT_SIGNING_LOCATION_INVALID", "指定签署位置数据不完整")), !1;
309
313
  }
310
314
  }
311
- function ot() {
312
- let e = Z(c(ke.value));
313
- return N.value = "", st(!0), _(() => z.value?.scrollToPage(M.value)), e;
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 st(e = !1) {
316
- let t = (e ? void 0 : A.value.files.find((e) => e.fileId === j.value)) ?? A.value.files[0];
317
- j.value = t?.fileId ?? "", M.value = ((e ? void 0 : t?.pages.find((e) => e.pageIndex === M.value)) ?? t?.pages[0])?.pageIndex ?? 0, A.value.placements.some((e) => e.id === N.value) || (N.value = "");
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 Q(e) {
320
- F.value = e.message, D("error", e);
323
+ function Z(e) {
324
+ P.value = e.message, E("error", e);
321
325
  }
322
- function ct(e, t, n, r = {}) {
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 lt(e, t, n) {
335
+ function ut(e, t, n) {
332
336
  return `${e}:${t}:${n ? "thumbnail" : "preview"}`;
333
337
  }
334
- function ut(e) {
335
- if (!(e in L.value)) return;
336
- let t = { ...L.value };
337
- delete t[e], L.value = t;
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 dt() {
340
- W &&= (clearTimeout(W), void 0);
343
+ function ft() {
344
+ U &&= (clearTimeout(U), void 0);
341
345
  }
342
- function ft(e) {
343
- let t = e ?? (() => !0), n = new Set(q.abort(t));
344
- n.size && (I.value = I.value.filter((e) => !n.has(e))), e || (G = []);
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 = Y.value;
351
- t && We(t.fileId, e, !1);
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: He,
371
- validate: nt,
372
- getValue: rt,
373
- getOutput: it,
374
- submit: at,
375
- reset: ot,
376
- addPlacement: Qe,
377
- removePlacement: tt,
378
- fitWidth: Ve
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(je.value)
388
+ style: ge(Me.value)
385
389
  }, [
386
- m("header", be, [a[9] ||= m("div", { class: "gd-ant-contract-signing-location__title" }, [m("span", {
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", xe, [
390
- m("span", Se, ve(A.value.placements.length) + " 个位置", 1),
391
- r.dataProvider ? (y(), f(S(T), {
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: P.value,
394
- onClick: He
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(T), {
400
- disabled: J.value,
401
- onClick: ot
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
- g(S(T), {
410
+ r.showSubmitButton ? (y(), f(S(ye), {
411
+ key: 1,
407
412
  type: "primary",
408
- loading: P.value,
413
+ loading: N.value,
409
414
  disabled: r.disabled,
410
- onClick: at
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
- F.value ? (y(), me("div", Ce, [m("span", null, ve(F.value), 1), r.dataProvider && r.contractId ? (y(), f(S(T), {
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: He
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": Ae.value }]) }, [
426
- Ae.value ? p("", !0) : (y(), me("div", {
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": V.value }])
429
- }, [g(S(ye), { title: V.value ? "展开页面栏" : "收起页面栏" }, {
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": V.value ? "展开页面栏" : "收起页面栏",
434
- "aria-expanded": !V.value,
435
- onClick: a[0] ||= (e) => V.value = !V.value
436
- }, [V.value ? (y(), f(S(n), {
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, we)]),
447
+ }))], 8, Te)]),
443
448
  _: 1
444
- }, 8, ["title"]), m("div", Te, [g(fe, {
445
- files: A.value.files,
446
- "active-file-id": j.value,
447
- "loading-preview-keys": Fe.value,
448
- "error-preview-keys": Ie.value,
449
- onSelect: Ge
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: z,
459
- file: Y.value,
460
- pages: Y.value?.pages ?? [],
461
- placements: Ne.value,
462
- "selected-placement-id": N.value,
463
- readonly: J.value,
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": O.value,
466
- zoom: R.value,
467
- "preview-loading-keys": Le.value,
468
- "preview-error-map": Re.value,
469
- "active-page-index": M.value,
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) => N.value = e,
477
+ onSelect: a[1] ||= (e) => M.value = e,
473
478
  onRetry: mt,
474
- onAdd: a[2] ||= (e, t, n, r) => Qe(e, {
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) => $e(e.id, e),
480
- onRemove: tt,
481
- onVisiblePages: Je,
482
- onViewPage: Ke,
483
- onPageChange: qe,
484
- onZoomChange: Be
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": B.value }]) }, [g(S(ye), { title: B.value ? "展开属性栏" : "收起属性栏" }, {
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": B.value ? "展开属性栏" : "收起属性栏",
505
- "aria-expanded": !B.value,
506
- onClick: a[4] ||= (e) => B.value = !B.value
507
- }, [B.value ? (y(), f(S(e), {
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, Ee)]),
518
+ }))], 8, De)]),
514
519
  _: 1
515
- }, 8, ["title"]), m("div", De, [g(de, {
516
- placement: X.value,
517
- page: Pe.value,
518
- pages: Y.value?.pages ?? [],
519
- placements: Ne.value,
520
- readonly: J.value,
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": O.value,
527
+ "seal-size-limit": D.value,
523
528
  "seal-type-options": r.sealTypeOptions,
524
529
  "size-profile": r.sizeProfile,
525
- onAdd: Qe,
526
- onUpdate: a[5] ||= (e) => X.value && $e(X.value.id, e),
527
- onDuplicate: et,
528
- onRemove: tt,
529
- onLocate: Ze
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 { Oe as default };
551
+ export { ke as default };