@guodun/antdv 1.6.2 → 1.6.4
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/dept-selector/src/DeptSelector.vue.mjs +52 -46
- package/dist/es/components/dept-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +67 -106
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +791 -794
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +2 -9
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +34 -36
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-menu-tree/src/pro-menu-tree.mjs +108 -103
- package/dist/es/components/pro-menu-tree/src/types.mjs +4 -0
- package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +50 -44
- package/dist/es/components/pro-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +47 -40
- package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +50 -44
- package/dist/es/components/role-selector/src/types.mjs +5 -1
- package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +242 -233
- package/dist/es/components/selector-core/selection-theme.mjs +35 -0
- package/dist/es/components/selector-core/useSelectorData.mjs +1 -1
- package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
- package/dist/lib/components/dept-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +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/composables/use-template-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-menu-tree/src/pro-menu-tree.cjs +1 -1
- package/dist/lib/components/pro-menu-tree/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
- package/dist/lib/components/role-selector/src/types.cjs +1 -1
- package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
- package/dist/lib/components/selector-core/selection-theme.cjs +1 -0
- package/dist/lib/components/selector-core/useSelectorData.cjs +1 -1
- package/dist/theme/dept-selector.css +1 -0
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-menu-tree.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -0
- package/dist/theme/role-selector.css +1 -0
- package/dist/theme/selector-core.css +1 -1
- package/dist/types/components/dept-selector/index.d.ts +15 -0
- package/dist/types/components/dept-selector/src/DeptSelector.vue.d.ts +9 -0
- package/dist/types/components/dept-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +2 -4
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +0 -4
- package/dist/types/components/pro-menu-tree/index.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector/index.d.ts +59 -2
- package/dist/types/components/pro-selector/src/ProUserSelector.vue.d.ts +9 -0
- package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +28 -4
- package/dist/types/components/pro-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector-group/index.d.ts +3 -0
- package/dist/types/components/pro-selector-group/src/index.vue.d.ts +1 -0
- package/dist/types/components/pro-selector-group/src/types.d.ts +5 -0
- package/dist/types/components/role-selector/index.d.ts +30 -0
- package/dist/types/components/role-selector/src/RoleSelector.vue.d.ts +9 -0
- package/dist/types/components/role-selector/src/types.d.ts +9 -2
- package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -0
- package/dist/types/components/selector-core/selection-theme.d.ts +20 -0
- package/package.json +3 -3
- package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +0 -56
- package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +0 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +0 -10
package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs
CHANGED
|
@@ -138,45 +138,44 @@ var Vt = {
|
|
|
138
138
|
let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(), Sn = y(!1), Cn = y(""), wn = y(!1), Tn = y(), En = y(), Dn = y(""), On = y(!1), kn = y(""), An = y(!1), jn = y({
|
|
139
139
|
values: {},
|
|
140
140
|
variables: []
|
|
141
|
-
}), j = y(1), M = y(!1), Mn = y(!1), Nn = y(!1), N = y(!1),
|
|
141
|
+
}), j = y(1), M = y(!1), Mn = y(!1), Nn = y(!1), N = y(!1), P = y(!1), Pn = y(), F = y(!1), Fn = y("header"), In = y(!1), Ln = y({}), Rn = y(""), I = y(!1), L = y(!1), zn = y(!1), Bn = y(!1), Vn = y(!1), Hn = y(!1), Un = y(!1), Wn = y(""), Gn = y(), Kn = y(), qn = y(""), Jn = y(!1), R = y(), Yn = y(), z = y(), Xn = y(), Zn = y(!1), Qn, $n = y(!1), er, tr = y(!1), nr = y(""), B = y(), rr = y(), V = y(), ir = y(), ar = y(), or = y(), H = y(""), U = y(Qe("idle", "暂无本地草稿")), sr = y({
|
|
142
142
|
rows: 3,
|
|
143
143
|
cols: 3,
|
|
144
144
|
withHeaderRow: !0
|
|
145
|
-
}),
|
|
145
|
+
}), cr = /* @__PURE__ */ new WeakSet(), lr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), ur, dr, fr = !1, pr = !1, mr, W = f(() => l.readonly || l.disabled), { panel: hr, query: gr, replacement: _r, matchCase: vr, matches: yr, currentIndex: br, currentMatch: xr, feedback: Sr, highlightQuery: Cr, open: wr, close: Tr, navigate: Er, replaceCurrent: Dr, replaceAll: Or, handleKeydown: kr } = He({
|
|
146
146
|
pages: () => T.value.pages,
|
|
147
147
|
fileId: () => w.value,
|
|
148
|
-
readonly: () =>
|
|
148
|
+
readonly: () => W.value,
|
|
149
149
|
root: () => rn.value,
|
|
150
150
|
pageRefs: A,
|
|
151
|
-
activatePage:
|
|
151
|
+
activatePage: bo,
|
|
152
152
|
beforeOpen: () => {
|
|
153
|
-
$(),
|
|
153
|
+
$(), cs(), N.value = !1;
|
|
154
154
|
},
|
|
155
155
|
focusPanel: () => pn.value?.focusPanel(),
|
|
156
|
-
focusTrigger: (e) => pn.value?.focusTrigger(e)
|
|
157
|
-
|
|
158
|
-
}), Mr = f(() => !!(L.value || gr.value || z.value || B.value || F.value || I.value || Ln.value || Bn.value || Vn.value || Hn.value || Un.value || Wn.value)), Nr = f(() => !!l.enableDraftCache && !U.value), Pr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), Fr = f(() => Tn.value ? le(Tn.value) : []), Ir = f(() => (En.value ?? []).map((e) => ({
|
|
156
|
+
focusTrigger: (e) => pn.value?.focusTrigger(e)
|
|
157
|
+
}), Ar = f(() => !!(R.value || hr.value || B.value || V.value || I.value || L.value || In.value || zn.value || Bn.value || Vn.value || Hn.value || Un.value)), jr = f(() => !!l.enableDraftCache && !W.value), Mr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), Nr = f(() => Tn.value ? le(Tn.value) : []), Pr = f(() => (En.value ?? []).map((e) => ({
|
|
159
158
|
file: e,
|
|
160
159
|
pages: le(e.template)
|
|
161
|
-
}))),
|
|
162
|
-
let e =
|
|
163
|
-
return `${S.value &&
|
|
164
|
-
}),
|
|
160
|
+
}))), Fr = f(() => Pr.value.find((e) => e.file.id === Dn.value) ?? Pr.value[0]), G = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), Ir = f(() => Se(G.value?.pageSize, T.value.pageSize)), Lr = f(() => O.value && k.value.length === 0), Rr = f(() => O.value ? Lr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), zr = f(() => {
|
|
161
|
+
let e = G.value?.title || "合同正文";
|
|
162
|
+
return `${S.value && Mr.value ? `${Mr.value.name} · ` : ""}${e} · ${Ir.value.label} · 共 ${T.value.pages.length} 页`;
|
|
163
|
+
}), Br = f(() => ({
|
|
165
164
|
none: "无装饰",
|
|
166
165
|
"page-number": "标准页码",
|
|
167
166
|
"internal-review": "内部审阅",
|
|
168
167
|
draft: "草稿",
|
|
169
168
|
custom: "自定义"
|
|
170
|
-
})[ee(T.value.pageDecorations)]),
|
|
169
|
+
})[ee(T.value.pageDecorations)]), Vr = f(() => {
|
|
171
170
|
let e = o(T.value.pageDecorations);
|
|
172
171
|
return {
|
|
173
172
|
header: e.header.enabled,
|
|
174
173
|
footer: e.footer.enabled,
|
|
175
174
|
watermark: e.watermark.enabled
|
|
176
175
|
};
|
|
177
|
-
}),
|
|
178
|
-
switch (
|
|
179
|
-
case "saved": return `草稿已缓存 ${$e(
|
|
176
|
+
}), Hr = f(() => Object.values(Vr.value).filter(Boolean).length), Ur = f(() => {
|
|
177
|
+
switch (U.value.type) {
|
|
178
|
+
case "saved": return `草稿已缓存 ${$e(U.value.savedAt)}`;
|
|
180
179
|
case "restored": return "已恢复本地草稿";
|
|
181
180
|
case "too-large": return "草稿过大,未缓存";
|
|
182
181
|
case "unavailable":
|
|
@@ -185,23 +184,23 @@ var Vt = {
|
|
|
185
184
|
case "cleared": return "草稿缓存已清理";
|
|
186
185
|
default: return "";
|
|
187
186
|
}
|
|
188
|
-
}),
|
|
189
|
-
"is-success":
|
|
190
|
-
"is-warning":
|
|
191
|
-
"is-error":
|
|
192
|
-
})),
|
|
187
|
+
}), Wr = f(() => ({
|
|
188
|
+
"is-success": U.value.type === "saved" || U.value.type === "restored",
|
|
189
|
+
"is-warning": U.value.type === "too-large",
|
|
190
|
+
"is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
|
|
191
|
+
})), Gr = f(() => `${Math.round(j.value * 100)}%`), Kr = f(() => i(l.fontFamilies, l.fontFamilyMode)), qr = f(() => Kr.value.map((e) => ({
|
|
193
192
|
label: e.label,
|
|
194
193
|
value: e.value
|
|
195
|
-
}))),
|
|
194
|
+
}))), Jr = r, Yr = [...e.map((e) => ({
|
|
196
195
|
label: e.label,
|
|
197
196
|
value: e.format
|
|
198
|
-
}))],
|
|
197
|
+
}))], Xr = [{
|
|
199
198
|
label: "实线",
|
|
200
199
|
value: "solid"
|
|
201
200
|
}, {
|
|
202
201
|
label: "虚线",
|
|
203
202
|
value: "dashed"
|
|
204
|
-
}],
|
|
203
|
+
}], Zr = [
|
|
205
204
|
{
|
|
206
205
|
label: "完整显示",
|
|
207
206
|
value: "contain"
|
|
@@ -214,10 +213,10 @@ var Vt = {
|
|
|
214
213
|
label: "拉伸填充",
|
|
215
214
|
value: "fill"
|
|
216
215
|
}
|
|
217
|
-
],
|
|
216
|
+
], Qr = f(() => be(l.pageSizeOptions)), $r = f(() => Qr.value.map((e) => ({
|
|
218
217
|
label: `${e.label} · ${e.width} × ${e.height}`,
|
|
219
218
|
value: ve(e)
|
|
220
|
-
}))),
|
|
219
|
+
}))), ei = f(() => ve(Ir.value)), ti = f(() => l.draftCacheKey), K = f(() => T.value.variables.find((e) => e.key === E.value)), ni = f(() => {
|
|
221
220
|
let e = [
|
|
222
221
|
...l.variableTypes,
|
|
223
222
|
...l.showAdvancedChoiceControls ? ie : [],
|
|
@@ -225,56 +224,56 @@ var Vt = {
|
|
|
225
224
|
...l.showCustomControls ? oe : []
|
|
226
225
|
].filter((e) => re(e?.type));
|
|
227
226
|
return Array.from(new Map(e.map((e) => [e.type, e])).values());
|
|
228
|
-
}),
|
|
227
|
+
}), ri = f(() => {
|
|
229
228
|
let e = [...Me.map((e) => je[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
|
|
230
229
|
return Array.from(new Map(e.map((e) => [e.key, e])).values());
|
|
231
|
-
}),
|
|
230
|
+
}), ii = f(() => ni.value.map((e) => ({
|
|
232
231
|
...e,
|
|
233
232
|
icon: ze(e.type),
|
|
234
233
|
group: e.type === "select" || e.type === "radio" ? "advanced-choice" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
|
|
235
|
-
}))),
|
|
234
|
+
}))), ai = f(() => ye(l.maxPages)), oi = f(() => T.value.pages.length >= ai.value), si = f(() => {
|
|
236
235
|
let e = ue(T.value);
|
|
237
236
|
return Array.from(a(T.value.pageDecorations)).filter((t) => !e.has(t));
|
|
238
|
-
}), { scheduleAutoPaginate:
|
|
237
|
+
}), { scheduleAutoPaginate: q } = et({
|
|
239
238
|
templateValue: T,
|
|
240
|
-
readonlyState:
|
|
239
|
+
readonlyState: W,
|
|
241
240
|
isAutoPaginating: Sn,
|
|
242
241
|
pendingPaginationPageId: Cn,
|
|
243
242
|
activePageId: D,
|
|
244
|
-
normalizedMaxPages:
|
|
243
|
+
normalizedMaxPages: ai,
|
|
245
244
|
pageRefs: A,
|
|
246
|
-
syncPageEditors:
|
|
247
|
-
commitBodyChange:
|
|
248
|
-
getPageSize:
|
|
249
|
-
notifyPageLimit:
|
|
250
|
-
}), { saveDraftCache:
|
|
251
|
-
draftCacheWritable:
|
|
245
|
+
syncPageEditors: Ai,
|
|
246
|
+
commitBodyChange: Ki,
|
|
247
|
+
getPageSize: Ji,
|
|
248
|
+
notifyPageLimit: Xi
|
|
249
|
+
}), { saveDraftCache: ci, loadDraftCache: li, clearDraftCache: ui, restoreDraftCacheIfNeeded: di, stopDraftCacheTimer: fi, restartDraftCacheTimer: pi, resetDraftFingerprint: mi } = dt({
|
|
250
|
+
draftCacheWritable: jr,
|
|
252
251
|
multipleFilesMode: S,
|
|
253
252
|
filesValue: C,
|
|
254
253
|
activeFileIdValue: w,
|
|
255
254
|
templateValue: T,
|
|
256
|
-
draftCacheKey:
|
|
255
|
+
draftCacheKey: ti,
|
|
257
256
|
draftCacheInterval: () => l.draftCacheInterval,
|
|
258
257
|
draftCacheMaxBytes: () => l.draftCacheMaxBytes,
|
|
259
258
|
pageSize: () => l.pageSize,
|
|
260
259
|
pageSizeOptions: () => l.pageSizeOptions,
|
|
261
|
-
syncActiveFileSnapshot:
|
|
262
|
-
syncPageEditors:
|
|
263
|
-
setActiveFileId:
|
|
264
|
-
emitFilesChange:
|
|
265
|
-
commit:
|
|
266
|
-
updateDraftCacheStatus:
|
|
267
|
-
scheduleAutoPaginate:
|
|
260
|
+
syncActiveFileSnapshot: Y,
|
|
261
|
+
syncPageEditors: Ai,
|
|
262
|
+
setActiveFileId: Ii,
|
|
263
|
+
emitFilesChange: X,
|
|
264
|
+
commit: Z,
|
|
265
|
+
updateDraftCacheStatus: Li,
|
|
266
|
+
scheduleAutoPaginate: q,
|
|
268
267
|
activePageId: D,
|
|
269
268
|
selectedVariableKey: E
|
|
270
|
-
}),
|
|
271
|
-
let e =
|
|
269
|
+
}), hi = f(() => {
|
|
270
|
+
let e = nr.value.trim().toLowerCase(), t = T.value.variables;
|
|
272
271
|
return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
|
|
273
|
-
}),
|
|
272
|
+
}), gi = f(() => Math.max(Zt, Ir.value.width - Yt)), _i = f(() => Math.max(Qt, Ir.value.height - Xt)), J = f(() => Ln.value[D.value] ?? Ti()), vi = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), yi = f(() => J.value.fontFamily || t), bi = f(() => J.value.fontSize ?? se.fontSize ?? 14), xi = f(() => J.value.textColor || se.color || "#1f2937"), Si = f(() => K.value?.style?.fontFamily || se.fontFamily || t), Ci = f(() => {
|
|
274
273
|
let e = n.map((e) => ({
|
|
275
274
|
label: `${e}px`,
|
|
276
275
|
value: e
|
|
277
|
-
})), t =
|
|
276
|
+
})), t = ki(bi.value), r = ki(Rn.value), i = /* @__PURE__ */ new Map();
|
|
278
277
|
return r && !n.includes(r) && i.set(r, {
|
|
279
278
|
label: `使用 ${r}px`,
|
|
280
279
|
value: r
|
|
@@ -286,16 +285,16 @@ var Vt = {
|
|
|
286
285
|
x(() => l.modelValue, (e) => {
|
|
287
286
|
if (!e || S.value) return;
|
|
288
287
|
let t = xe(e, l.pageSize), n = de(t, l.pageSizeOptions), r = d(n) !== d(T.value), i = d(n), a = i === hn;
|
|
289
|
-
a && (hn = ""), (r || !a) && (T.value = n, C.value = lt(C.value, w.value, n), D.value = n.pages[0]?.id ?? "", E.value = "",
|
|
288
|
+
a && (hn = ""), (r || !a) && (T.value = n, C.value = lt(C.value, w.value, n), D.value = n.pages[0]?.id ?? "", E.value = "", q(D.value)), d(n) !== d(t) && (hn = i, g("update:modelValue", c(n)), g("change", c(n)));
|
|
290
289
|
}, { deep: !0 }), x(() => l.files, (e) => {
|
|
291
290
|
if (!Array.isArray(e)) return;
|
|
292
291
|
let t = ot(e, void 0, l.pageSize), n = nt(t, l.pageSizeOptions).files, r = d(n), i = d(C.value);
|
|
293
292
|
r === mn && (mn = "");
|
|
294
293
|
let a = ut(n, l.activeFileId || w.value);
|
|
295
|
-
if (r === i ? a !== w.value &&
|
|
294
|
+
if (r === i ? a !== w.value && Ii(a, {
|
|
296
295
|
syncCurrent: !1,
|
|
297
296
|
shouldEmit: !1
|
|
298
|
-
}) : (C.value = n,
|
|
297
|
+
}) : (C.value = n, Ii(a, {
|
|
299
298
|
syncCurrent: !1,
|
|
300
299
|
shouldEmit: !1,
|
|
301
300
|
forceRefresh: !0
|
|
@@ -304,57 +303,57 @@ var Vt = {
|
|
|
304
303
|
mn = d(e), g("update:files", e), g("files-change", u(e));
|
|
305
304
|
}
|
|
306
305
|
}, { deep: !0 }), x(() => l.activeFileId, (e) => {
|
|
307
|
-
!S.value || !e || e === w.value ||
|
|
306
|
+
!S.value || !e || e === w.value || Ii(e, {
|
|
308
307
|
syncCurrent: !0,
|
|
309
308
|
shouldEmit: !1
|
|
310
309
|
});
|
|
311
310
|
});
|
|
312
|
-
function
|
|
311
|
+
function wi(e, t) {
|
|
313
312
|
let n = d(C.value);
|
|
314
|
-
|
|
313
|
+
Y(!1);
|
|
315
314
|
let { files: r } = nt(ot(C.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === w.value);
|
|
316
|
-
return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [],
|
|
315
|
+
return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], X(r, "")), i;
|
|
317
316
|
}
|
|
318
317
|
x([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
|
|
319
318
|
if (S.value) {
|
|
320
|
-
|
|
319
|
+
wi(e, t), q(D.value);
|
|
321
320
|
return;
|
|
322
321
|
}
|
|
323
322
|
let n = de(xe(T.value, e), t);
|
|
324
|
-
d(n) !== d(T.value) &&
|
|
325
|
-
}, { deep: !0 }), x(
|
|
326
|
-
|
|
327
|
-
}), x(
|
|
328
|
-
e && ($(),
|
|
323
|
+
d(n) !== d(T.value) && Z(n), q(D.value);
|
|
324
|
+
}, { deep: !0 }), x(ai, () => {
|
|
325
|
+
q(T.value.pages[0]?.id);
|
|
326
|
+
}), x(W, (e) => {
|
|
327
|
+
e && ($(), I.value = !1, L.value = !1);
|
|
329
328
|
}), x(D, () => {
|
|
330
|
-
|
|
329
|
+
z.value = void 0;
|
|
331
330
|
}), x([
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
Ar,
|
|
332
|
+
F,
|
|
334
333
|
wn
|
|
335
334
|
], () => {
|
|
336
|
-
|
|
335
|
+
ds();
|
|
337
336
|
}), x(() => [
|
|
338
337
|
l.enableDraftCache,
|
|
339
|
-
|
|
338
|
+
ti.value,
|
|
340
339
|
l.draftCacheInterval,
|
|
341
|
-
|
|
340
|
+
W.value
|
|
342
341
|
], () => {
|
|
343
|
-
|
|
342
|
+
mi(), pi();
|
|
344
343
|
}), x(M, (e) => {
|
|
345
344
|
if (!(typeof document > "u")) {
|
|
346
345
|
if (e) {
|
|
347
|
-
|
|
346
|
+
ur = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
348
347
|
return;
|
|
349
348
|
}
|
|
350
|
-
document.body.style.overflow =
|
|
349
|
+
document.body.style.overflow = ur ?? "", ur = void 0;
|
|
351
350
|
}
|
|
352
351
|
}), Dt(() => {
|
|
353
|
-
|
|
352
|
+
di(), pi(), q(D.value), window.addEventListener("pointerdown", ys, !0), window.addEventListener("pointerup", gs), window.addEventListener("keydown", Ss, !0), window.addEventListener("keydown", Cs), window.addEventListener("resize", _s), window.addEventListener("scroll", bs, !0);
|
|
354
353
|
}), Et(() => {
|
|
355
|
-
|
|
354
|
+
Mi(), fr = !0, M.value && typeof document < "u" && (document.body.style.overflow = ur ?? ""), window.removeEventListener("pointerdown", ys, !0), window.removeEventListener("pointerup", gs), window.removeEventListener("keydown", Ss, !0), window.removeEventListener("keydown", Cs), window.removeEventListener("resize", _s), window.removeEventListener("scroll", bs, !0), er !== void 0 && cancelAnimationFrame(er), fi();
|
|
356
355
|
});
|
|
357
|
-
function
|
|
356
|
+
function Ti() {
|
|
358
357
|
return {
|
|
359
358
|
isFocused: !1,
|
|
360
359
|
canUndo: !1,
|
|
@@ -373,23 +372,23 @@ var Vt = {
|
|
|
373
372
|
hasMixedBlockFormats: !1
|
|
374
373
|
};
|
|
375
374
|
}
|
|
376
|
-
function
|
|
375
|
+
function Ei(e) {
|
|
377
376
|
return e === "left" || e === "center" || e === "right";
|
|
378
377
|
}
|
|
379
|
-
function
|
|
378
|
+
function Di(e) {
|
|
380
379
|
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
|
|
381
380
|
}
|
|
382
|
-
function
|
|
381
|
+
function Oi(e, t = bi.value) {
|
|
383
382
|
let n = Number(e);
|
|
384
383
|
return Number.isFinite(n) ? Math.min(en, Math.max($t, Math.round(n))) : t;
|
|
385
384
|
}
|
|
386
|
-
function
|
|
385
|
+
function ki(e) {
|
|
387
386
|
let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
|
|
388
387
|
if (!t) return;
|
|
389
388
|
let n = Number(t[1]);
|
|
390
389
|
if (Number.isFinite(n)) return Math.min(en, Math.max($t, Math.round(n)));
|
|
391
390
|
}
|
|
392
|
-
function
|
|
391
|
+
function Ai(e = T.value) {
|
|
393
392
|
return {
|
|
394
393
|
...e,
|
|
395
394
|
pages: e.pages.map((e) => {
|
|
@@ -402,19 +401,19 @@ var Vt = {
|
|
|
402
401
|
})
|
|
403
402
|
};
|
|
404
403
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
404
|
+
function ji() {
|
|
405
|
+
pr = !1, mr &&= (clearTimeout(mr), void 0);
|
|
407
406
|
}
|
|
408
|
-
function
|
|
409
|
-
let e =
|
|
410
|
-
|
|
407
|
+
function Mi() {
|
|
408
|
+
let e = pr;
|
|
409
|
+
ji(), e && Fi();
|
|
411
410
|
}
|
|
412
|
-
function
|
|
413
|
-
|
|
414
|
-
|
|
411
|
+
function Ni() {
|
|
412
|
+
pr = !0, mr && clearTimeout(mr), mr = setTimeout(() => {
|
|
413
|
+
mr = void 0, !(!pr || fr) && (pr = !1, Fi());
|
|
415
414
|
}, Jt);
|
|
416
415
|
}
|
|
417
|
-
function
|
|
416
|
+
function Pi(e) {
|
|
418
417
|
let t = T.value.pages, n = t.findIndex((t) => t.id === e.id);
|
|
419
418
|
if (n < 0) return;
|
|
420
419
|
let r = t[n];
|
|
@@ -425,121 +424,121 @@ var Vt = {
|
|
|
425
424
|
pages: i
|
|
426
425
|
};
|
|
427
426
|
}
|
|
428
|
-
function
|
|
429
|
-
let e = Ce(
|
|
430
|
-
E.value && !e.variables.some((e) => e.key === E.value) && (E.value = ""),
|
|
427
|
+
function Fi() {
|
|
428
|
+
let e = Ce(Ai());
|
|
429
|
+
E.value && !e.variables.some((e) => e.key === E.value) && (E.value = ""), Z(e);
|
|
431
430
|
}
|
|
432
|
-
function
|
|
433
|
-
|
|
434
|
-
let t = c(
|
|
431
|
+
function Y(e = !1) {
|
|
432
|
+
Mi();
|
|
433
|
+
let t = c(Ai());
|
|
435
434
|
if (!S.value) return t;
|
|
436
435
|
let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i = lt(C.value, w.value, t);
|
|
437
|
-
return C.value = i, r && e &&
|
|
436
|
+
return C.value = i, r && e && X(i), t;
|
|
438
437
|
}
|
|
439
|
-
function
|
|
438
|
+
function X(e, t = w.value) {
|
|
440
439
|
if (!S.value) return;
|
|
441
440
|
let n = u(e);
|
|
442
441
|
C.value = n, mn = d(n), g("update:files", u(n)), g("files-change", u(n));
|
|
443
442
|
let r = n.find((e) => e.id === t);
|
|
444
443
|
r && g("file-change", u([r])[0]);
|
|
445
444
|
}
|
|
446
|
-
function
|
|
445
|
+
function Ii(e, t = {}) {
|
|
447
446
|
let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = tt(t), a = ut(C.value, e), o = a !== w.value;
|
|
448
|
-
if (n ?
|
|
447
|
+
if (n ? Y(!0) : ji(), !o && !i) return;
|
|
449
448
|
let ee = C.value.find((e) => e.id === a);
|
|
450
|
-
ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "",
|
|
451
|
-
|
|
449
|
+
ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", Ln.value = {}, A.clear(), Cn.value = "", O.value = !1, k.value = [], wn.value = !1, Tn.value = void 0, En.value = void 0, mi(), r && o && g("update:activeFileId", a), n && o && jr.value && ci(), _(() => {
|
|
450
|
+
q(D.value);
|
|
452
451
|
}));
|
|
453
452
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
453
|
+
function Z(e) {
|
|
454
|
+
ji();
|
|
456
455
|
let t = de(xe(e, l.pageSize), l.pageSizeOptions);
|
|
457
|
-
return T.value = t, O.value = !1, k.value = [], S.value ?
|
|
456
|
+
return T.value = t, O.value = !1, k.value = [], S.value ? X(lt(C.value, w.value, t)) : (C.value = lt(C.value, w.value, t), hn = d(t), g("update:modelValue", c(t)), g("change", c(t))), t;
|
|
458
457
|
}
|
|
459
|
-
function
|
|
460
|
-
|
|
458
|
+
function Li(e, t = e.type !== "unchanged") {
|
|
459
|
+
U.value = e, t && g("draft-cache-change", { ...e });
|
|
461
460
|
}
|
|
462
|
-
function
|
|
463
|
-
return { ...
|
|
461
|
+
function Ri() {
|
|
462
|
+
return { ...U.value };
|
|
464
463
|
}
|
|
465
|
-
function
|
|
464
|
+
function zi(e, t) {
|
|
466
465
|
t ? A.set(e, t) : A.delete(e);
|
|
467
466
|
}
|
|
468
|
-
function
|
|
469
|
-
$(),
|
|
467
|
+
function Bi(e) {
|
|
468
|
+
$(), Vn.value = !1, Q({
|
|
470
469
|
type: "insert-signing-layout",
|
|
471
470
|
preset: Ne(e.key) ? e.key : void 0,
|
|
472
471
|
options: e.options
|
|
473
472
|
});
|
|
474
473
|
}
|
|
475
|
-
function
|
|
476
|
-
$(),
|
|
474
|
+
function Vi(e) {
|
|
475
|
+
$(), Q({
|
|
477
476
|
type: "insert-signing-layout",
|
|
478
477
|
options: e
|
|
479
478
|
});
|
|
480
479
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
480
|
+
function Hi() {
|
|
481
|
+
Vn.value = !1, Un.value = !0;
|
|
483
482
|
}
|
|
484
|
-
function
|
|
485
|
-
$(),
|
|
483
|
+
function Ui(e) {
|
|
484
|
+
$(), Hn.value = !1, Q({
|
|
486
485
|
type: "insert-signing-mark",
|
|
487
486
|
mark: { markType: e }
|
|
488
487
|
});
|
|
489
488
|
}
|
|
490
|
-
function
|
|
491
|
-
|
|
489
|
+
function Q(e, t = G.value?.id ?? D.value) {
|
|
490
|
+
W.value || A.get(t)?.runCommand(e);
|
|
492
491
|
}
|
|
493
|
-
function
|
|
494
|
-
|
|
492
|
+
function Wi(e) {
|
|
493
|
+
Q(e), $();
|
|
495
494
|
}
|
|
496
|
-
function
|
|
497
|
-
let t =
|
|
498
|
-
t && (A.get(t)?.focus(),
|
|
495
|
+
function Gi(e) {
|
|
496
|
+
let t = R.value?.pageId;
|
|
497
|
+
t && (A.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
|
|
499
498
|
}
|
|
500
|
-
function
|
|
501
|
-
let t =
|
|
499
|
+
function Ki(e) {
|
|
500
|
+
let t = Z(Ce(e));
|
|
502
501
|
return E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), t;
|
|
503
502
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
503
|
+
function qi(e) {
|
|
504
|
+
Pi(e), Ni(), q(e.id);
|
|
506
505
|
}
|
|
507
|
-
function
|
|
506
|
+
function Ji(e) {
|
|
508
507
|
return Se(e?.pageSize, T.value.pageSize);
|
|
509
508
|
}
|
|
510
|
-
function
|
|
511
|
-
if (
|
|
512
|
-
let t =
|
|
509
|
+
function Yi(e) {
|
|
510
|
+
if (W.value || !G.value) return;
|
|
511
|
+
let t = Qr.value.find((t) => ve(t) === e);
|
|
513
512
|
if (!t) return;
|
|
514
|
-
let n =
|
|
515
|
-
|
|
513
|
+
let n = G.value.id, r = Se(t, T.value.pageSize);
|
|
514
|
+
Z({
|
|
516
515
|
...T.value,
|
|
517
516
|
pages: T.value.pages.map((e) => e.id === n ? {
|
|
518
517
|
...e,
|
|
519
518
|
pageSize: r
|
|
520
519
|
} : e)
|
|
521
|
-
}),
|
|
520
|
+
}), q(n);
|
|
522
521
|
}
|
|
523
|
-
function
|
|
524
|
-
let t =
|
|
525
|
-
|
|
522
|
+
function Xi(e) {
|
|
523
|
+
let t = ai.value;
|
|
524
|
+
H.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
|
|
526
525
|
}
|
|
527
|
-
function
|
|
528
|
-
if (
|
|
529
|
-
if (
|
|
530
|
-
|
|
526
|
+
function Zi() {
|
|
527
|
+
if (W.value) return;
|
|
528
|
+
if (oi.value) {
|
|
529
|
+
Xi("add");
|
|
531
530
|
return;
|
|
532
531
|
}
|
|
533
|
-
let e = me(T.value.pages.length + 1,
|
|
534
|
-
|
|
532
|
+
let e = me(T.value.pages.length + 1, Ir.value);
|
|
533
|
+
Z({
|
|
535
534
|
...T.value,
|
|
536
535
|
pages: [...T.value.pages, e]
|
|
537
536
|
}), D.value = e.id;
|
|
538
537
|
}
|
|
539
|
-
function
|
|
540
|
-
if (
|
|
541
|
-
if (
|
|
542
|
-
|
|
538
|
+
function Qi(e) {
|
|
539
|
+
if (W.value) return;
|
|
540
|
+
if (oi.value) {
|
|
541
|
+
Xi("duplicate");
|
|
543
542
|
return;
|
|
544
543
|
}
|
|
545
544
|
let t = T.value.pages.findIndex((t) => t.id === e.id);
|
|
@@ -548,60 +547,60 @@ var Vt = {
|
|
|
548
547
|
pages: [e],
|
|
549
548
|
variables: [],
|
|
550
549
|
pageSize: T.value.pageSize
|
|
551
|
-
}).pages[0], r = fe(t + 2,
|
|
550
|
+
}).pages[0], r = fe(t + 2, Ji(e), n.contentHtml, n.contentJson);
|
|
552
551
|
r.title = `${e.title || `第 ${t + 1} 页`}副本`;
|
|
553
552
|
let i = [...T.value.pages];
|
|
554
|
-
i.splice(t + 1, 0, r),
|
|
553
|
+
i.splice(t + 1, 0, r), Z({
|
|
555
554
|
...T.value,
|
|
556
555
|
pages: i
|
|
557
556
|
}), D.value = r.id;
|
|
558
557
|
}
|
|
559
|
-
function
|
|
560
|
-
if (
|
|
558
|
+
function $i(e) {
|
|
559
|
+
if (W.value || T.value.pages.length <= 1) return;
|
|
561
560
|
let t = T.value.pages.findIndex((t) => t.id === e.id);
|
|
562
561
|
if (t < 0) return;
|
|
563
|
-
let n = T.value.pages.filter((t) => t.id !== e.id), r =
|
|
562
|
+
let n = T.value.pages.filter((t) => t.id !== e.id), r = Ki({
|
|
564
563
|
...T.value,
|
|
565
564
|
pages: n
|
|
566
565
|
});
|
|
567
566
|
D.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "";
|
|
568
567
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
568
|
+
function ea(e) {
|
|
569
|
+
W.value || T.value.pages.length <= 1 || Ft.confirm({
|
|
571
570
|
title: "删除合同页面",
|
|
572
571
|
content: "删除页面会同时移除页面正文,是否继续?",
|
|
573
572
|
okText: "确认删除",
|
|
574
573
|
okType: "danger",
|
|
575
574
|
cancelText: "取消",
|
|
576
575
|
onOk: () => {
|
|
577
|
-
|
|
576
|
+
$i(e);
|
|
578
577
|
}
|
|
579
578
|
});
|
|
580
579
|
}
|
|
581
|
-
function
|
|
580
|
+
function ta(e) {
|
|
582
581
|
let t = new Set(T.value.variables.map((e) => e.key)), n = 1;
|
|
583
582
|
for (; t.has(`${e}_${n}`);) n += 1;
|
|
584
583
|
return `${e}_${n}`;
|
|
585
584
|
}
|
|
586
|
-
function
|
|
585
|
+
function na(e) {
|
|
587
586
|
let t = e.type ?? "text";
|
|
588
587
|
return he({
|
|
589
588
|
...e,
|
|
590
589
|
type: t,
|
|
591
|
-
key: e.key ||
|
|
592
|
-
label: e.label || _e(t,
|
|
593
|
-
},
|
|
590
|
+
key: e.key || ta(t),
|
|
591
|
+
label: e.label || _e(t, ni.value).label
|
|
592
|
+
}, ni.value, l.defaultVariableStyle);
|
|
594
593
|
}
|
|
595
|
-
function
|
|
596
|
-
if (
|
|
594
|
+
function ra(e, t = G.value?.id ?? T.value.pages[0].id, n) {
|
|
595
|
+
if (W.value) return e;
|
|
597
596
|
let r = A.get(t)?.insertVariable(e, n), i = !T.value.variables.some((t) => t.key === e.key);
|
|
598
|
-
return
|
|
597
|
+
return Z({
|
|
599
598
|
...T.value,
|
|
600
599
|
pages: r ? T.value.pages.map((e) => e.id === r.id ? r : e) : T.value.pages,
|
|
601
600
|
variables: i ? [...T.value.variables, e] : T.value.variables
|
|
602
|
-
}), E.value = e.key, D.value = t, i && g("variable-add", e),
|
|
601
|
+
}), E.value = e.key, D.value = t, i && g("variable-add", e), q(t), e;
|
|
603
602
|
}
|
|
604
|
-
function
|
|
603
|
+
function ia(e) {
|
|
605
604
|
let { width: t, height: n, ...r } = e, i = ke(t), a = ke(n);
|
|
606
605
|
return {
|
|
607
606
|
...r,
|
|
@@ -609,103 +608,103 @@ var Vt = {
|
|
|
609
608
|
...a === void 0 ? {} : { height: a }
|
|
610
609
|
};
|
|
611
610
|
}
|
|
612
|
-
function
|
|
613
|
-
let t = ke(
|
|
611
|
+
function aa(e = {}) {
|
|
612
|
+
let t = ke(Gn.value), n = ke(Kn.value);
|
|
614
613
|
return {
|
|
615
614
|
...e,
|
|
616
615
|
...t === void 0 ? {} : { width: t },
|
|
617
616
|
...n === void 0 ? {} : { height: n }
|
|
618
617
|
};
|
|
619
618
|
}
|
|
620
|
-
function
|
|
621
|
-
|
|
619
|
+
function oa() {
|
|
620
|
+
Wn.value = "", Gn.value = void 0, Kn.value = void 0, qn.value = "";
|
|
622
621
|
}
|
|
623
|
-
function
|
|
624
|
-
let r =
|
|
622
|
+
function sa(e, t = G.value?.id ?? T.value.pages[0]?.id, n) {
|
|
623
|
+
let r = ia({
|
|
625
624
|
...e,
|
|
626
625
|
src: e.src.trim()
|
|
627
626
|
});
|
|
628
|
-
if (!(
|
|
627
|
+
if (!(W.value || !t || !Ee(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, E.value = "", r.src;
|
|
629
628
|
}
|
|
630
|
-
function
|
|
629
|
+
function ca(e) {
|
|
631
630
|
return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
|
|
632
631
|
}
|
|
633
|
-
async function
|
|
634
|
-
t === "toolbar" && (
|
|
632
|
+
async function la(e, t) {
|
|
633
|
+
t === "toolbar" && (Jn.value = !0, qn.value = "");
|
|
635
634
|
try {
|
|
636
635
|
let n = await Ae(e, {
|
|
637
636
|
source: t,
|
|
638
637
|
compression: l.imageCompression,
|
|
639
638
|
upload: l.imageUpload
|
|
640
639
|
});
|
|
641
|
-
return
|
|
640
|
+
return fr ? void 0 : n.src;
|
|
642
641
|
} catch (e) {
|
|
643
|
-
let n =
|
|
644
|
-
t === "toolbar" && (
|
|
642
|
+
let n = ca(e);
|
|
643
|
+
t === "toolbar" && (qn.value = n.message), H.value = n.message, g("image-error", n, t);
|
|
645
644
|
return;
|
|
646
645
|
} finally {
|
|
647
|
-
t === "toolbar" && (
|
|
646
|
+
t === "toolbar" && (Jn.value = !1);
|
|
648
647
|
}
|
|
649
648
|
}
|
|
650
|
-
let
|
|
651
|
-
function
|
|
649
|
+
let ua = 0;
|
|
650
|
+
function da(e) {
|
|
652
651
|
let t = e.replacedFontFamilies.filter(Boolean);
|
|
653
652
|
if (!t.length) return;
|
|
654
653
|
let n = Date.now();
|
|
655
|
-
n -
|
|
654
|
+
n - ua < 800 || (ua = n, Lt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
|
|
656
655
|
}
|
|
657
|
-
async function
|
|
658
|
-
return await
|
|
656
|
+
async function fa(e) {
|
|
657
|
+
return await la(e, "paste") ?? null;
|
|
659
658
|
}
|
|
660
|
-
async function
|
|
661
|
-
if (
|
|
662
|
-
let n =
|
|
663
|
-
if (
|
|
659
|
+
async function pa(e, t = {}) {
|
|
660
|
+
if (W.value) return;
|
|
661
|
+
let n = G.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await la(e, "toolbar");
|
|
662
|
+
if (fr) return;
|
|
664
663
|
if (!i || !Ee(i)) {
|
|
665
|
-
typeof e == "string" && (
|
|
664
|
+
typeof e == "string" && (qn.value = "请输入安全的图片 URL");
|
|
666
665
|
return;
|
|
667
666
|
}
|
|
668
667
|
if (n && !A.has(n)) return;
|
|
669
|
-
let a =
|
|
668
|
+
let a = sa({
|
|
670
669
|
...t,
|
|
671
670
|
src: i
|
|
672
671
|
}, n, r);
|
|
673
|
-
return a && (
|
|
672
|
+
return a && (Bn.value = !1, oa(), H.value = "已插入图片"), a;
|
|
674
673
|
}
|
|
675
|
-
function
|
|
676
|
-
|
|
674
|
+
function ma() {
|
|
675
|
+
W.value || Jn.value || ($(), qn.value = "", fn.value && (fn.value.value = ""), fn.value?.click());
|
|
677
676
|
}
|
|
678
|
-
async function
|
|
677
|
+
async function ha(e) {
|
|
679
678
|
let t = e.target.files?.[0];
|
|
680
|
-
t && await
|
|
679
|
+
t && await pa(t, aa({ alt: t.name }));
|
|
681
680
|
}
|
|
682
|
-
async function
|
|
683
|
-
let e =
|
|
684
|
-
await
|
|
681
|
+
async function ga() {
|
|
682
|
+
let e = Wn.value;
|
|
683
|
+
await pa(e, aa());
|
|
685
684
|
}
|
|
686
|
-
function
|
|
687
|
-
|
|
685
|
+
function _a(e) {
|
|
686
|
+
La(e), zn.value = !1;
|
|
688
687
|
}
|
|
689
|
-
function
|
|
690
|
-
$(),
|
|
688
|
+
function va() {
|
|
689
|
+
$(), Zi();
|
|
691
690
|
}
|
|
692
|
-
function
|
|
693
|
-
$(),
|
|
691
|
+
function ya(e, t, n, r) {
|
|
692
|
+
$(), ra(na({ type: t }), e, {
|
|
694
693
|
left: n,
|
|
695
694
|
top: r
|
|
696
695
|
});
|
|
697
696
|
}
|
|
698
|
-
function
|
|
697
|
+
function ba(e) {
|
|
699
698
|
$(), E.value = e;
|
|
700
699
|
}
|
|
701
|
-
function
|
|
700
|
+
function xa(e) {
|
|
702
701
|
let t = T.value.variables.find((t) => t.id === e.id);
|
|
703
702
|
if (!t) return;
|
|
704
703
|
let n = e.key.trim();
|
|
705
704
|
if (n !== t.key) {
|
|
706
705
|
let t = we(n, T.value.variables, e.id);
|
|
707
706
|
if (t) {
|
|
708
|
-
|
|
707
|
+
H.value = t;
|
|
709
708
|
return;
|
|
710
709
|
}
|
|
711
710
|
}
|
|
@@ -721,66 +720,66 @@ var Vt = {
|
|
|
721
720
|
let e = r.findIndex((e) => e.id === n);
|
|
722
721
|
e >= 0 && (r[e] = o);
|
|
723
722
|
}
|
|
724
|
-
}),
|
|
723
|
+
}), Z({
|
|
725
724
|
...T.value,
|
|
726
725
|
pages: r,
|
|
727
726
|
variables: T.value.variables.map((t) => t.id === e.id ? e : t),
|
|
728
727
|
...i !== e.key && T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, i, e.key) } : {}
|
|
729
|
-
}), E.value = e.key,
|
|
728
|
+
}), E.value = e.key, q(a || D.value);
|
|
730
729
|
}
|
|
731
|
-
function
|
|
732
|
-
|
|
733
|
-
...
|
|
730
|
+
function Sa(e) {
|
|
731
|
+
K.value && xa({
|
|
732
|
+
...K.value,
|
|
734
733
|
...e,
|
|
735
734
|
style: {
|
|
736
|
-
...
|
|
735
|
+
...K.value.style,
|
|
737
736
|
...e.style
|
|
738
737
|
}
|
|
739
738
|
});
|
|
740
739
|
}
|
|
741
|
-
function
|
|
742
|
-
|
|
740
|
+
function Ca(e) {
|
|
741
|
+
W.value || !K.value || Sa({ key: e });
|
|
743
742
|
}
|
|
744
|
-
function
|
|
745
|
-
|
|
743
|
+
function wa(e) {
|
|
744
|
+
W.value || (Z({
|
|
746
745
|
...T.value,
|
|
747
746
|
pageDecorations: o(e)
|
|
748
|
-
}),
|
|
747
|
+
}), q(T.value.pages[0]?.id));
|
|
748
|
+
}
|
|
749
|
+
function Ta(e) {
|
|
750
|
+
(e === "left" || e === "center" || e === "right") && Sa({ style: { textAlign: e } });
|
|
749
751
|
}
|
|
750
752
|
function Ea(e) {
|
|
751
|
-
(e === "
|
|
753
|
+
(e === "solid" || e === "dashed") && Sa({ style: { borderStyle: e } });
|
|
752
754
|
}
|
|
753
755
|
function Da(e) {
|
|
754
|
-
(e === "
|
|
756
|
+
(e === "contain" || e === "cover" || e === "fill") && Sa({ style: { objectFit: e } });
|
|
755
757
|
}
|
|
756
758
|
function Oa(e) {
|
|
757
|
-
(
|
|
759
|
+
Sa({ style: e });
|
|
758
760
|
}
|
|
759
761
|
function ka(e) {
|
|
760
|
-
|
|
762
|
+
Oa({ fontFamily: String(e || "").trim() || t });
|
|
761
763
|
}
|
|
762
764
|
function Aa(e) {
|
|
763
|
-
|
|
765
|
+
Oa({ fontSize: Oi(e, K.value?.style?.fontSize ?? 14) });
|
|
764
766
|
}
|
|
765
767
|
function ja(e) {
|
|
766
|
-
|
|
767
|
-
}
|
|
768
|
-
function Ma(e) {
|
|
769
|
-
G.value && Q({
|
|
768
|
+
K.value && Sa({
|
|
770
769
|
multiline: e,
|
|
771
|
-
rows:
|
|
772
|
-
lineHeight:
|
|
770
|
+
rows: K.value.rows || 3,
|
|
771
|
+
lineHeight: K.value.lineHeight || 28,
|
|
773
772
|
style: e ? { underline: !0 } : void 0
|
|
774
773
|
});
|
|
775
774
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
775
|
+
function Ma(e) {
|
|
776
|
+
K.value && Sa({
|
|
778
777
|
rows: Number(e || 3),
|
|
779
|
-
lineHeight:
|
|
778
|
+
lineHeight: K.value.lineHeight || 28
|
|
780
779
|
});
|
|
781
780
|
}
|
|
782
|
-
function
|
|
783
|
-
if (
|
|
781
|
+
function Na(e) {
|
|
782
|
+
if (W.value) return;
|
|
784
783
|
let t = [...T.value.pages];
|
|
785
784
|
A.forEach((n, r) => {
|
|
786
785
|
let i = n.removeVariable(e.key);
|
|
@@ -788,259 +787,259 @@ var Vt = {
|
|
|
788
787
|
let e = t.findIndex((e) => e.id === r);
|
|
789
788
|
e >= 0 && (t[e] = i);
|
|
790
789
|
}
|
|
791
|
-
}),
|
|
790
|
+
}), Z({
|
|
792
791
|
...T.value,
|
|
793
792
|
pages: t,
|
|
794
793
|
variables: T.value.variables.filter((t) => t.id !== e.id),
|
|
795
794
|
...T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, e.key) } : {}
|
|
796
795
|
}), E.value = "";
|
|
797
796
|
}
|
|
798
|
-
function
|
|
797
|
+
function Pa(e) {
|
|
799
798
|
let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(T.value.variables.map((e) => e.key));
|
|
800
799
|
if (!n.has(t)) return t;
|
|
801
800
|
let r = 2;
|
|
802
801
|
for (; n.has(`${t}_${r}`);) r += 1;
|
|
803
802
|
return `${t}_${r}`;
|
|
804
803
|
}
|
|
805
|
-
function
|
|
806
|
-
|
|
804
|
+
function Fa(e) {
|
|
805
|
+
W.value || ra(he({
|
|
807
806
|
...e,
|
|
808
807
|
id: void 0,
|
|
809
|
-
key:
|
|
808
|
+
key: Pa(`${e.key || e.type}_copy`),
|
|
810
809
|
label: `${e.label}副本`,
|
|
811
810
|
style: { ...e.style }
|
|
812
|
-
},
|
|
811
|
+
}, ni.value, l.defaultVariableStyle));
|
|
812
|
+
}
|
|
813
|
+
function Ia(e) {
|
|
814
|
+
return W.value ? void 0 : ra(T.value.variables.find((t) => t.key === e.key) ?? he(e, ni.value, l.defaultVariableStyle));
|
|
813
815
|
}
|
|
814
816
|
function La(e) {
|
|
815
|
-
|
|
817
|
+
if (!W.value) return ra(na({ type: e }));
|
|
816
818
|
}
|
|
817
819
|
function Ra(e) {
|
|
818
|
-
if (
|
|
819
|
-
|
|
820
|
-
function za(e) {
|
|
821
|
-
if (U.value || !re(e)) return;
|
|
822
|
-
let t = L.value, n = ii.value.find((t) => t.type === e);
|
|
820
|
+
if (W.value || !re(e)) return;
|
|
821
|
+
let t = R.value, n = ni.value.find((t) => t.type === e);
|
|
823
822
|
if (!t || !n) return;
|
|
824
|
-
let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt,
|
|
825
|
-
|
|
823
|
+
let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt, gi.value), a = za();
|
|
824
|
+
ra(na({
|
|
826
825
|
type: e,
|
|
827
826
|
label: r,
|
|
828
827
|
...i ? { width: i } : {},
|
|
829
828
|
...a ? { style: a } : {}
|
|
830
|
-
}), t.pageId),
|
|
829
|
+
}), t.pageId), H.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
|
|
831
830
|
}
|
|
832
|
-
function
|
|
833
|
-
let e =
|
|
831
|
+
function za() {
|
|
832
|
+
let e = J.value, t = {};
|
|
834
833
|
return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
|
|
835
834
|
}
|
|
836
|
-
function
|
|
837
|
-
if (
|
|
838
|
-
let t =
|
|
839
|
-
t && (
|
|
835
|
+
function Ba(e) {
|
|
836
|
+
if (W.value) return;
|
|
837
|
+
let t = R.value;
|
|
838
|
+
t && (ra(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
|
|
840
839
|
}
|
|
841
|
-
function
|
|
842
|
-
return _e(e.type && re(e.type) ? e.type : "text",
|
|
840
|
+
function Va(e) {
|
|
841
|
+
return _e(e.type && re(e.type) ? e.type : "text", ni.value).label;
|
|
843
842
|
}
|
|
844
|
-
function
|
|
845
|
-
T.value.variables.length && (
|
|
846
|
-
|
|
843
|
+
function Ha() {
|
|
844
|
+
T.value.variables.length && (tr.value = !0, _(() => {
|
|
845
|
+
ts(), Yn.value?.focusBindSearch();
|
|
847
846
|
}));
|
|
848
847
|
}
|
|
849
|
-
function
|
|
848
|
+
function Ua(e, t) {
|
|
850
849
|
e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
851
850
|
}
|
|
852
|
-
function
|
|
851
|
+
function Wa(e) {
|
|
853
852
|
return j.value = Math.round(Math.min(Kt, Math.max(Gt, Number.isFinite(e) ? e : 1)) * 100) / 100, j.value;
|
|
854
853
|
}
|
|
855
|
-
let { width:
|
|
856
|
-
viewportWidth:
|
|
857
|
-
widestPageWidth: f(() => Math.max(...T.value.pages.map((e) =>
|
|
854
|
+
let { width: Ga } = Rt(an), { fitWidth: Ka, applyAutoFit: qa, markUserAdjusted: Ja, userAdjusted: Ya } = Oe({
|
|
855
|
+
viewportWidth: Ga,
|
|
856
|
+
widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => Ji(e).width), ce.width) + 10),
|
|
858
857
|
padding: 48,
|
|
859
858
|
minZoom: Gt,
|
|
860
859
|
maxZoom: Kt,
|
|
861
860
|
getZoom: () => j.value,
|
|
862
|
-
applyZoom:
|
|
861
|
+
applyZoom: Wa
|
|
863
862
|
});
|
|
864
|
-
function
|
|
865
|
-
return
|
|
863
|
+
function Xa(e) {
|
|
864
|
+
return Ja(), Wa(e);
|
|
865
|
+
}
|
|
866
|
+
function Za() {
|
|
867
|
+
return qa();
|
|
866
868
|
}
|
|
867
869
|
function Qa() {
|
|
868
|
-
return
|
|
870
|
+
return j.value;
|
|
869
871
|
}
|
|
870
872
|
function $a() {
|
|
871
|
-
|
|
873
|
+
Xa(j.value + qt);
|
|
872
874
|
}
|
|
873
875
|
function eo() {
|
|
874
|
-
|
|
876
|
+
Xa(j.value - qt);
|
|
875
877
|
}
|
|
876
878
|
function to() {
|
|
877
|
-
|
|
878
|
-
}
|
|
879
|
-
function no() {
|
|
880
|
-
$(), ls(), M.value = !M.value;
|
|
879
|
+
$(), cs(), M.value = !M.value;
|
|
881
880
|
}
|
|
882
|
-
x(
|
|
883
|
-
|
|
881
|
+
x(Ga, (e) => {
|
|
882
|
+
P.value && !Ya.value && e > 0 && Ka();
|
|
884
883
|
});
|
|
885
|
-
function
|
|
884
|
+
function no(e) {
|
|
886
885
|
N.value ? dn.value?.focus() : e();
|
|
887
886
|
}
|
|
888
|
-
function
|
|
889
|
-
$(),
|
|
887
|
+
function ro() {
|
|
888
|
+
$(), cs(), F.value = !1, dr = {
|
|
890
889
|
fullscreen: M.value,
|
|
891
890
|
sidebar: Mn.value,
|
|
892
891
|
inspector: Nn.value,
|
|
893
892
|
chrome: N.value,
|
|
894
893
|
zoom: j.value,
|
|
895
|
-
userAdjusted:
|
|
896
|
-
}, M.value = !0, Mn.value = !0, Nn.value = !0, N.value = !0,
|
|
897
|
-
|
|
894
|
+
userAdjusted: Ya.value
|
|
895
|
+
}, M.value = !0, Mn.value = !0, Nn.value = !0, N.value = !0, P.value = !0, _(() => {
|
|
896
|
+
W.value ? Pn.value?.focus() : A.get(D.value)?.focus();
|
|
898
897
|
});
|
|
899
898
|
}
|
|
899
|
+
function io() {
|
|
900
|
+
let e = dr;
|
|
901
|
+
P.value = !1, dr = void 0, e && (M.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? Xa(e.zoom) : qa(), _(() => no(() => sn.value?.focusImmersive())));
|
|
902
|
+
}
|
|
900
903
|
function ao() {
|
|
901
|
-
|
|
902
|
-
Pn.value = !1, fr = void 0, e && (M.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? Za(e.zoom) : Ja(), _(() => ro(() => sn.value?.focusImmersive())));
|
|
904
|
+
P.value ? io() : ro();
|
|
903
905
|
}
|
|
904
906
|
function oo() {
|
|
905
|
-
|
|
907
|
+
$(), z.value = void 0;
|
|
908
|
+
let e = Y(!1);
|
|
909
|
+
S.value ? (En.value = u(C.value), Tn.value = void 0, Dn.value = w.value || C.value[0]?.id || "") : (Tn.value = c(e), En.value = void 0, Dn.value = ""), wn.value = !0;
|
|
906
910
|
}
|
|
907
911
|
function so() {
|
|
908
|
-
|
|
909
|
-
let e = J(!1);
|
|
910
|
-
S.value ? (En.value = u(C.value), Tn.value = void 0, Dn.value = w.value || C.value[0]?.id || "") : (Tn.value = c(e), En.value = void 0, Dn.value = ""), wn.value = !0;
|
|
912
|
+
wn.value = !1, Tn.value = void 0, En.value = void 0, Dn.value = "";
|
|
911
913
|
}
|
|
912
914
|
function co() {
|
|
913
|
-
|
|
915
|
+
return Ro();
|
|
914
916
|
}
|
|
915
917
|
function lo() {
|
|
916
|
-
return zo();
|
|
917
|
-
}
|
|
918
|
-
function uo() {
|
|
919
918
|
$();
|
|
920
|
-
let e =
|
|
919
|
+
let e = co();
|
|
921
920
|
return kn.value = JSON.stringify(e, null, 2), On.value = !0, e;
|
|
922
921
|
}
|
|
923
|
-
function
|
|
922
|
+
function uo() {
|
|
924
923
|
On.value = !1;
|
|
925
924
|
}
|
|
926
|
-
function
|
|
927
|
-
return De(
|
|
925
|
+
function fo() {
|
|
926
|
+
return De(Y(!1));
|
|
928
927
|
}
|
|
929
|
-
function
|
|
928
|
+
function po() {
|
|
930
929
|
$();
|
|
931
|
-
let e =
|
|
930
|
+
let e = fo();
|
|
932
931
|
return jn.value = e, An.value = !0, e;
|
|
933
932
|
}
|
|
934
|
-
function
|
|
933
|
+
function mo() {
|
|
935
934
|
An.value = !1;
|
|
936
935
|
}
|
|
937
|
-
function
|
|
938
|
-
$(),
|
|
936
|
+
function ho() {
|
|
937
|
+
$(), z.value = void 0, I.value = !1, L.value = !1, E.value = "", D.value = "", wn.value = !1, Tn.value = void 0, En.value = void 0, On.value = !1, kn.value = "", An.value = !1, jn.value = {
|
|
939
938
|
values: {},
|
|
940
939
|
variables: []
|
|
941
|
-
},
|
|
942
|
-
let e =
|
|
940
|
+
}, Ln.value = {}, Cn.value = "";
|
|
941
|
+
let e = Z(pe(ce));
|
|
943
942
|
return D.value = e.pages[0]?.id ?? "", c(e);
|
|
944
943
|
}
|
|
945
|
-
function
|
|
946
|
-
|
|
944
|
+
function go() {
|
|
945
|
+
W.value || ($(), Ft.confirm({
|
|
947
946
|
title: "清空合同内容",
|
|
948
947
|
content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
|
|
949
948
|
okText: "确认清空",
|
|
950
949
|
okType: "danger",
|
|
951
950
|
cancelText: "取消",
|
|
952
951
|
onOk: () => {
|
|
953
|
-
|
|
952
|
+
ho();
|
|
954
953
|
}
|
|
955
954
|
}));
|
|
956
955
|
}
|
|
957
|
-
function
|
|
958
|
-
let t =
|
|
956
|
+
function _o(e) {
|
|
957
|
+
let t = Ai().pages, n = t.find((e) => e.id === D.value);
|
|
959
958
|
return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
|
|
960
959
|
}
|
|
961
|
-
function
|
|
960
|
+
function vo(e) {
|
|
962
961
|
$(), E.value = e.key;
|
|
963
|
-
let t =
|
|
962
|
+
let t = _o(e);
|
|
964
963
|
t && (D.value = t.id, _(() => {
|
|
965
964
|
A.get(t.id)?.scrollIntoVariable(e.key);
|
|
966
965
|
}));
|
|
967
966
|
}
|
|
968
|
-
function
|
|
967
|
+
function yo(e) {
|
|
969
968
|
let t = T.value.variables.find((t) => t.key === e || t.id === e);
|
|
970
|
-
t &&
|
|
969
|
+
t && vo(t);
|
|
971
970
|
}
|
|
972
|
-
function
|
|
971
|
+
function bo(e, t = !0) {
|
|
973
972
|
$(), D.value = e, t && _(() => {
|
|
974
973
|
A.get(e)?.scrollIntoPage();
|
|
975
974
|
});
|
|
976
975
|
}
|
|
977
|
-
function
|
|
978
|
-
|
|
976
|
+
function xo(e) {
|
|
977
|
+
bo(e.pageId, !1), A.get(e.pageId)?.focusHeading(e.headingIndex);
|
|
979
978
|
}
|
|
980
|
-
function
|
|
981
|
-
T.value.pages.some((t) => t.id === e) &&
|
|
979
|
+
function So(e) {
|
|
980
|
+
T.value.pages.some((t) => t.id === e) && bo(e);
|
|
982
981
|
}
|
|
983
|
-
function
|
|
984
|
-
if (
|
|
985
|
-
|
|
982
|
+
function Co() {
|
|
983
|
+
if (F.value) {
|
|
984
|
+
wo();
|
|
986
985
|
return;
|
|
987
986
|
}
|
|
988
|
-
|
|
987
|
+
F.value = !0;
|
|
989
988
|
}
|
|
990
|
-
function
|
|
991
|
-
|
|
989
|
+
function wo() {
|
|
990
|
+
F.value = !1, _(() => no(() => sn.value?.focusPageDecorations()));
|
|
992
991
|
}
|
|
993
|
-
function
|
|
994
|
-
return
|
|
992
|
+
function To() {
|
|
993
|
+
return Mi(), c(Ai());
|
|
995
994
|
}
|
|
996
|
-
function
|
|
997
|
-
|
|
995
|
+
function Eo(e) {
|
|
996
|
+
q(Z(xe(e, l.pageSize)).pages[0]?.id);
|
|
998
997
|
}
|
|
999
|
-
function
|
|
1000
|
-
let e =
|
|
998
|
+
function Do() {
|
|
999
|
+
let e = Y(!1);
|
|
1001
1000
|
return S.value ? u(C.value) : u(lt(C.value, w.value, e));
|
|
1002
1001
|
}
|
|
1003
|
-
function
|
|
1002
|
+
function Oo(e, t) {
|
|
1004
1003
|
let n = nt(ot(e, void 0, l.pageSize), l.pageSizeOptions), r = C.value;
|
|
1005
|
-
gn.value = !0,
|
|
1004
|
+
gn.value = !0, Y(!1), C.value = n.files, Ii(ut(C.value, t ?? w.value), {
|
|
1006
1005
|
syncCurrent: !1,
|
|
1007
1006
|
shouldEmit: !0,
|
|
1008
1007
|
forceRefresh: !0
|
|
1009
|
-
}), d(r) !== d(C.value) &&
|
|
1008
|
+
}), d(r) !== d(C.value) && X(C.value, "");
|
|
1010
1009
|
}
|
|
1011
|
-
function
|
|
1012
|
-
if (
|
|
1013
|
-
gn.value = !0,
|
|
1010
|
+
function ko(e) {
|
|
1011
|
+
if (W.value) return;
|
|
1012
|
+
gn.value = !0, Y(!0);
|
|
1014
1013
|
let t = rt(e || `合同文件 ${C.value.length + 1}`, l.pageSize);
|
|
1015
|
-
return C.value = [...C.value, t],
|
|
1014
|
+
return C.value = [...C.value, t], X(C.value, ""), g("file-add", u([t])[0]), Ii(t.id, {
|
|
1016
1015
|
syncCurrent: !1,
|
|
1017
1016
|
shouldEmit: !0,
|
|
1018
1017
|
forceRefresh: !0
|
|
1019
1018
|
}), u([t])[0];
|
|
1020
1019
|
}
|
|
1021
|
-
function
|
|
1022
|
-
!S.value && !C.value.some((t) => t.id === e) || (gn.value = !0,
|
|
1020
|
+
function Ao(e) {
|
|
1021
|
+
!S.value && !C.value.some((t) => t.id === e) || (gn.value = !0, Ii(e));
|
|
1023
1022
|
}
|
|
1024
|
-
function
|
|
1025
|
-
if (
|
|
1026
|
-
gn.value = !0,
|
|
1023
|
+
function jo(e, t) {
|
|
1024
|
+
if (W.value) return;
|
|
1025
|
+
gn.value = !0, Y(!1);
|
|
1027
1026
|
let n = ct(C.value, e, t), r = n.find((t) => t.id === e);
|
|
1028
|
-
if (r) return C.value = n,
|
|
1027
|
+
if (r) return C.value = n, X(n, e), u([r])[0];
|
|
1029
1028
|
}
|
|
1030
|
-
function
|
|
1031
|
-
if (
|
|
1032
|
-
gn.value = !0,
|
|
1029
|
+
function Mo(e) {
|
|
1030
|
+
if (W.value || C.value.length <= 1) return;
|
|
1031
|
+
gn.value = !0, Y(!1);
|
|
1033
1032
|
let t = C.value.find((t) => t.id === e);
|
|
1034
1033
|
if (!t) return;
|
|
1035
1034
|
let n = st(C.value, e);
|
|
1036
|
-
if (n.length !== C.value.length) return C.value = n,
|
|
1035
|
+
if (n.length !== C.value.length) return C.value = n, X(n, ""), g("file-remove", u([t])[0]), w.value === e && Ii(ut(n, n[0]?.id), {
|
|
1037
1036
|
syncCurrent: !1,
|
|
1038
1037
|
shouldEmit: !0,
|
|
1039
1038
|
forceRefresh: !0
|
|
1040
1039
|
}), u([t])[0];
|
|
1041
1040
|
}
|
|
1042
|
-
function
|
|
1043
|
-
if (
|
|
1041
|
+
function No(e) {
|
|
1042
|
+
if (W.value || C.value.length <= 1) return;
|
|
1044
1043
|
let t = C.value.find((t) => t.id === e);
|
|
1045
1044
|
t && Ft.confirm({
|
|
1046
1045
|
title: "删除合同文件",
|
|
@@ -1049,27 +1048,27 @@ var Vt = {
|
|
|
1049
1048
|
okType: "danger",
|
|
1050
1049
|
cancelText: "取消",
|
|
1051
1050
|
onOk: () => {
|
|
1052
|
-
|
|
1051
|
+
Mo(e);
|
|
1053
1052
|
}
|
|
1054
1053
|
});
|
|
1055
1054
|
}
|
|
1056
|
-
function
|
|
1057
|
-
if (
|
|
1058
|
-
gn.value = !0,
|
|
1055
|
+
function Po(e, t) {
|
|
1056
|
+
if (W.value) return;
|
|
1057
|
+
gn.value = !0, Y(!1);
|
|
1059
1058
|
let n = C.value.findIndex((t) => t.id === e), r = at(C.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
|
|
1060
|
-
if (!(!a || n === i)) return C.value = r,
|
|
1059
|
+
if (!(!a || n === i)) return C.value = r, X(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
|
|
1061
1060
|
}
|
|
1062
|
-
function
|
|
1063
|
-
|
|
1064
|
-
let e =
|
|
1061
|
+
function Fo() {
|
|
1062
|
+
Y(!1);
|
|
1063
|
+
let e = Bo(S.value ? C.value.flatMap((e) => Te(e.template, { maxPages: ai.value }).map((t) => ({
|
|
1065
1064
|
...t,
|
|
1066
1065
|
fileId: e.id
|
|
1067
|
-
}))) : Te(
|
|
1066
|
+
}))) : Te(Ai(), { maxPages: ai.value }));
|
|
1068
1067
|
return k.value = e, O.value = !0, g("validate", e), e;
|
|
1069
1068
|
}
|
|
1070
|
-
function
|
|
1069
|
+
function Io(e) {
|
|
1071
1070
|
if (e.fileId && e.fileId !== w.value) {
|
|
1072
|
-
|
|
1071
|
+
Ao(e.fileId), _(() => Io({
|
|
1073
1072
|
...e,
|
|
1074
1073
|
fileId: void 0
|
|
1075
1074
|
}));
|
|
@@ -1077,107 +1076,107 @@ var Vt = {
|
|
|
1077
1076
|
}
|
|
1078
1077
|
let t = te(e);
|
|
1079
1078
|
if (t) {
|
|
1080
|
-
|
|
1079
|
+
F.value = !0, _(() => cn.value?.focusField(t));
|
|
1081
1080
|
return;
|
|
1082
1081
|
}
|
|
1083
1082
|
if (e.variableKey) {
|
|
1084
|
-
|
|
1083
|
+
yo(e.variableKey);
|
|
1085
1084
|
return;
|
|
1086
1085
|
}
|
|
1087
1086
|
if (e.pageId) {
|
|
1088
|
-
|
|
1087
|
+
So(e.pageId);
|
|
1089
1088
|
return;
|
|
1090
1089
|
}
|
|
1091
1090
|
let n = T.value.variables.find((t) => t.id === e.id || t.key === e.id);
|
|
1092
1091
|
if (n) {
|
|
1093
|
-
|
|
1092
|
+
vo(n);
|
|
1094
1093
|
return;
|
|
1095
1094
|
}
|
|
1096
|
-
T.value.pages.some((t) => t.id === e.id) &&
|
|
1095
|
+
T.value.pages.some((t) => t.id === e.id) && bo(e.id);
|
|
1097
1096
|
}
|
|
1098
|
-
function
|
|
1097
|
+
function Lo(e) {
|
|
1099
1098
|
return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
|
|
1100
1099
|
}
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1100
|
+
function Ro() {
|
|
1101
|
+
return Mi(), ge(Ai());
|
|
1103
1102
|
}
|
|
1104
|
-
function
|
|
1105
|
-
let e =
|
|
1103
|
+
function zo() {
|
|
1104
|
+
let e = Y(!1);
|
|
1106
1105
|
return it(S.value ? C.value : lt(C.value, w.value, e));
|
|
1107
1106
|
}
|
|
1108
|
-
function
|
|
1107
|
+
function Bo(e) {
|
|
1109
1108
|
let t = /* @__PURE__ */ new Set();
|
|
1110
1109
|
return e.filter((e) => {
|
|
1111
1110
|
let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
|
|
1112
1111
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
1113
1112
|
});
|
|
1114
1113
|
}
|
|
1115
|
-
function
|
|
1114
|
+
function Vo(e) {
|
|
1116
1115
|
k.value = [...e], O.value = !0;
|
|
1117
1116
|
}
|
|
1118
|
-
function
|
|
1117
|
+
function Ho() {
|
|
1119
1118
|
k.value = [], O.value = !1;
|
|
1120
1119
|
}
|
|
1121
|
-
function
|
|
1122
|
-
A.get(
|
|
1120
|
+
function Uo() {
|
|
1121
|
+
A.get(G.value?.id ?? D.value)?.focus();
|
|
1123
1122
|
}
|
|
1124
|
-
function
|
|
1125
|
-
|
|
1123
|
+
function Wo(e) {
|
|
1124
|
+
Ei(e) && Q({
|
|
1126
1125
|
type: "set-text-align",
|
|
1127
1126
|
value: e
|
|
1128
1127
|
});
|
|
1129
1128
|
}
|
|
1130
|
-
function
|
|
1131
|
-
(e === "paragraph" ||
|
|
1129
|
+
function Go(e) {
|
|
1130
|
+
(e === "paragraph" || Di(e)) && Q({
|
|
1132
1131
|
type: "apply-block-style",
|
|
1133
1132
|
format: e
|
|
1134
1133
|
});
|
|
1135
1134
|
}
|
|
1136
|
-
function
|
|
1137
|
-
let t =
|
|
1138
|
-
t && (
|
|
1135
|
+
function Ko(e) {
|
|
1136
|
+
let t = ki(e);
|
|
1137
|
+
t && (Q({
|
|
1139
1138
|
type: "set-font-size",
|
|
1140
1139
|
value: t
|
|
1141
|
-
}),
|
|
1140
|
+
}), Rn.value = "");
|
|
1142
1141
|
}
|
|
1143
|
-
function
|
|
1142
|
+
function qo(e) {
|
|
1144
1143
|
let t = String(e || "").trim();
|
|
1145
1144
|
if (!t) {
|
|
1146
|
-
|
|
1145
|
+
Q({ type: "unset-font-family" });
|
|
1147
1146
|
return;
|
|
1148
1147
|
}
|
|
1149
|
-
|
|
1148
|
+
Q({
|
|
1150
1149
|
type: "set-font-family",
|
|
1151
1150
|
value: t
|
|
1152
1151
|
});
|
|
1153
1152
|
}
|
|
1154
|
-
function
|
|
1155
|
-
|
|
1153
|
+
function Jo(e) {
|
|
1154
|
+
Yo(e.target?.value ?? "");
|
|
1156
1155
|
}
|
|
1157
|
-
function
|
|
1156
|
+
function Yo(e) {
|
|
1158
1157
|
let t = e.trim();
|
|
1159
|
-
t &&
|
|
1158
|
+
t && Q({
|
|
1160
1159
|
type: "set-color",
|
|
1161
1160
|
value: t
|
|
1162
1161
|
});
|
|
1163
1162
|
}
|
|
1164
|
-
function
|
|
1165
|
-
|
|
1163
|
+
function Xo(e) {
|
|
1164
|
+
Rn.value = e;
|
|
1165
|
+
}
|
|
1166
|
+
function Zo() {
|
|
1167
|
+
Rn.value.trim() && Ko(Rn.value);
|
|
1166
1168
|
}
|
|
1167
|
-
function Qo() {
|
|
1168
|
-
|
|
1169
|
+
function Qo(e) {
|
|
1170
|
+
e.key === "Enter" && (e.preventDefault(), Zo());
|
|
1169
1171
|
}
|
|
1170
1172
|
function $o(e) {
|
|
1171
|
-
e
|
|
1173
|
+
e || (Zo(), Rn.value = "");
|
|
1172
1174
|
}
|
|
1173
1175
|
function es(e) {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
function ts(e) {
|
|
1177
|
-
if (U.value) return;
|
|
1178
|
-
D.value = e.pageId, F.value = !1, I.value = !1, z.value = void 0, B.value = void 0, nr.value = !1, rr.value = "";
|
|
1176
|
+
if (W.value) return;
|
|
1177
|
+
D.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
|
|
1179
1178
|
let t = _t(e.clientX, e.clientY, 304, 300);
|
|
1180
|
-
|
|
1179
|
+
R.value = {
|
|
1181
1180
|
pageId: e.pageId,
|
|
1182
1181
|
x: t.x,
|
|
1183
1182
|
y: t.y,
|
|
@@ -1185,207 +1184,207 @@ var Vt = {
|
|
|
1185
1184
|
selectionWidth: e.selectionWidth,
|
|
1186
1185
|
leadingText: e.leadingText
|
|
1187
1186
|
}, _(() => {
|
|
1188
|
-
|
|
1187
|
+
ts(), Yn.value?.focusFirstButton();
|
|
1189
1188
|
});
|
|
1190
1189
|
}
|
|
1191
|
-
function
|
|
1192
|
-
let e =
|
|
1190
|
+
function ts() {
|
|
1191
|
+
let e = Yn.value?.getMenuElement(), t = R.value;
|
|
1193
1192
|
if (!e || !t) return;
|
|
1194
1193
|
let n = vt(t.x, t.y, e);
|
|
1195
|
-
|
|
1194
|
+
R.value = {
|
|
1196
1195
|
...t,
|
|
1197
1196
|
x: n.x,
|
|
1198
1197
|
y: n.y
|
|
1199
1198
|
};
|
|
1200
1199
|
}
|
|
1201
|
-
function
|
|
1202
|
-
if (
|
|
1203
|
-
D.value = e.pageId,
|
|
1200
|
+
function ns(e) {
|
|
1201
|
+
if (W.value) return;
|
|
1202
|
+
D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
|
|
1204
1203
|
let t = _t(e.clientX, e.clientY, 248, 400);
|
|
1205
|
-
|
|
1204
|
+
B.value = {
|
|
1206
1205
|
...e,
|
|
1207
1206
|
x: t.x,
|
|
1208
1207
|
y: t.y
|
|
1209
1208
|
}, _(() => {
|
|
1210
|
-
let e =
|
|
1209
|
+
let e = rr.value?.getMenuElement(), t = B.value;
|
|
1211
1210
|
if (e && t) {
|
|
1212
1211
|
let n = vt(t.x, t.y, e);
|
|
1213
|
-
|
|
1212
|
+
B.value = {
|
|
1214
1213
|
...t,
|
|
1215
1214
|
x: n.x,
|
|
1216
1215
|
y: n.y
|
|
1217
1216
|
};
|
|
1218
1217
|
}
|
|
1219
|
-
|
|
1218
|
+
rr.value?.focusFirstItem();
|
|
1220
1219
|
});
|
|
1221
1220
|
}
|
|
1222
|
-
function
|
|
1223
|
-
if (
|
|
1224
|
-
D.value = e.pageId,
|
|
1221
|
+
function rs(e) {
|
|
1222
|
+
if (W.value) return;
|
|
1223
|
+
D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, ar.value = e.image.width, or.value = e.image.height, E.value = "";
|
|
1225
1224
|
let t = _t(e.clientX, e.clientY, 288, 196);
|
|
1226
|
-
|
|
1225
|
+
V.value = {
|
|
1227
1226
|
pageId: e.pageId,
|
|
1228
1227
|
image: e.image,
|
|
1229
1228
|
x: t.x,
|
|
1230
1229
|
y: t.y
|
|
1231
1230
|
}, _(() => {
|
|
1232
|
-
|
|
1231
|
+
is(), ir.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
|
|
1233
1232
|
});
|
|
1234
1233
|
}
|
|
1235
|
-
function
|
|
1236
|
-
let e =
|
|
1234
|
+
function is() {
|
|
1235
|
+
let e = ir.value?.getMenuElement(), t = V.value;
|
|
1237
1236
|
if (!e || !t) return;
|
|
1238
1237
|
let n = vt(t.x, t.y, e);
|
|
1239
|
-
|
|
1238
|
+
V.value = {
|
|
1240
1239
|
...t,
|
|
1241
1240
|
x: n.x,
|
|
1242
1241
|
y: n.y
|
|
1243
1242
|
};
|
|
1244
1243
|
}
|
|
1244
|
+
function as() {
|
|
1245
|
+
let e = V.value;
|
|
1246
|
+
!e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
|
|
1247
|
+
width: ke(ar.value),
|
|
1248
|
+
height: ke(or.value)
|
|
1249
|
+
}) && (H.value = "已更新图片尺寸"), $());
|
|
1250
|
+
}
|
|
1245
1251
|
function os() {
|
|
1246
|
-
let e =
|
|
1247
|
-
!e ||
|
|
1248
|
-
width: ke(or.value),
|
|
1249
|
-
height: ke(sr.value)
|
|
1250
|
-
}) && (V.value = "已更新图片尺寸"), $());
|
|
1251
|
-
}
|
|
1252
|
-
function ss() {
|
|
1253
|
-
let e = B.value;
|
|
1254
|
-
!e || U.value || (A.get(e.pageId)?.updateSelectedContentImage({
|
|
1252
|
+
let e = V.value;
|
|
1253
|
+
!e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
|
|
1255
1254
|
width: void 0,
|
|
1256
1255
|
height: void 0
|
|
1257
|
-
}) && (
|
|
1256
|
+
}) && (H.value = "已恢复图片自然尺寸"), $());
|
|
1258
1257
|
}
|
|
1259
|
-
function
|
|
1260
|
-
e.type === "table" ?
|
|
1258
|
+
function ss(e) {
|
|
1259
|
+
e.type === "table" ? ns(e) : e.type === "image" ? rs(e) : es(e);
|
|
1261
1260
|
}
|
|
1262
1261
|
function $() {
|
|
1263
|
-
|
|
1262
|
+
R.value = void 0, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
|
|
1264
1263
|
}
|
|
1265
|
-
function
|
|
1266
|
-
|
|
1264
|
+
function cs() {
|
|
1265
|
+
Tr(!1), I.value = !1, L.value = !1, In.value = !1, zn.value = !1, Bn.value = !1, Vn.value = !1, Hn.value = !1;
|
|
1267
1266
|
}
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1267
|
+
function ls() {
|
|
1268
|
+
cs(), N.value = !N.value, _(() => no(() => sn.value?.focusChromeToggle()));
|
|
1270
1269
|
}
|
|
1271
|
-
let
|
|
1270
|
+
let us = [
|
|
1272
1271
|
".gd-contract-template-designer__context-menu",
|
|
1273
1272
|
".gd-contract-template-designer__bubble-menu",
|
|
1274
1273
|
".gd-contract-template-designer__bubble-menu-popup"
|
|
1275
1274
|
].join(",");
|
|
1276
|
-
function
|
|
1277
|
-
let e =
|
|
1275
|
+
function ds() {
|
|
1276
|
+
let e = W.value || $n.value || Zn.value || Ar.value || F.value || wn.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
|
|
1278
1277
|
if (!n) {
|
|
1279
|
-
|
|
1278
|
+
z.value = void 0;
|
|
1280
1279
|
return;
|
|
1281
1280
|
}
|
|
1282
1281
|
let r = n.top - 40 - tn, i = r >= 12 ? r : n.bottom + tn, a = _t((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
|
|
1283
|
-
|
|
1282
|
+
z.value = {
|
|
1284
1283
|
pageId: t,
|
|
1285
1284
|
x: a.x,
|
|
1286
1285
|
y: a.y
|
|
1287
|
-
}, _(() =>
|
|
1286
|
+
}, _(() => fs(n));
|
|
1288
1287
|
}
|
|
1289
|
-
function
|
|
1290
|
-
let t =
|
|
1288
|
+
function fs(e) {
|
|
1289
|
+
let t = Xn.value?.getMenuElement(), n = z.value;
|
|
1291
1290
|
if (!t || !n) return;
|
|
1292
1291
|
let r = t.getBoundingClientRect(), i = e.top - r.height - tn, a = i >= 12 ? i : e.bottom + tn, o = vt((e.left + e.right) / 2 - r.width / 2, a, t);
|
|
1293
|
-
|
|
1292
|
+
z.value = {
|
|
1294
1293
|
...n,
|
|
1295
1294
|
x: o.x,
|
|
1296
1295
|
y: o.y
|
|
1297
1296
|
};
|
|
1298
1297
|
}
|
|
1299
|
-
function
|
|
1300
|
-
let e =
|
|
1301
|
-
|
|
1298
|
+
function ps() {
|
|
1299
|
+
let e = z.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
|
|
1300
|
+
Qn = t ? {
|
|
1302
1301
|
pageId: e,
|
|
1303
1302
|
...t
|
|
1304
|
-
} : void 0,
|
|
1303
|
+
} : void 0, Zn.value = !0, z.value = void 0;
|
|
1305
1304
|
}
|
|
1306
|
-
function
|
|
1307
|
-
if (!
|
|
1308
|
-
let t =
|
|
1309
|
-
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (
|
|
1305
|
+
function ms(e) {
|
|
1306
|
+
if (!Zn.value) return;
|
|
1307
|
+
let t = Qn, n = A.get(e)?.getSelectionRange();
|
|
1308
|
+
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (Zn.value = !1, Qn = void 0);
|
|
1310
1309
|
}
|
|
1311
|
-
function
|
|
1312
|
-
!
|
|
1313
|
-
|
|
1310
|
+
function hs() {
|
|
1311
|
+
!z.value || er !== void 0 || (er = requestAnimationFrame(() => {
|
|
1312
|
+
er = void 0, ds();
|
|
1314
1313
|
}));
|
|
1315
1314
|
}
|
|
1315
|
+
function gs() {
|
|
1316
|
+
$n.value && ($n.value = !1, ds());
|
|
1317
|
+
}
|
|
1316
1318
|
function _s() {
|
|
1317
|
-
|
|
1319
|
+
$(), hs();
|
|
1318
1320
|
}
|
|
1319
|
-
function vs() {
|
|
1320
|
-
|
|
1321
|
+
function vs(e, t) {
|
|
1322
|
+
A.get(z.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
|
|
1321
1323
|
}
|
|
1322
|
-
function ys(e
|
|
1323
|
-
|
|
1324
|
+
function ys(e) {
|
|
1325
|
+
let t = e.target instanceof Element ? e.target : null;
|
|
1326
|
+
t?.closest(".ProseMirror") && ($n.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(us) || ($(), z.value && ps()));
|
|
1324
1327
|
}
|
|
1325
1328
|
function bs(e) {
|
|
1326
|
-
|
|
1327
|
-
t?.closest(".ProseMirror") && (er.value = !0, R.value = void 0), !(!L.value && !z.value && !B.value && !R.value) && (t?.closest(ds) || ($(), R.value && ms()));
|
|
1329
|
+
(e.target instanceof Element ? e.target : null)?.closest(us) || ($(), hs());
|
|
1328
1330
|
}
|
|
1329
1331
|
function xs(e) {
|
|
1330
|
-
(e.target instanceof Element ? e.target : null)?.closest(ds) || ($(), gs());
|
|
1331
|
-
}
|
|
1332
|
-
function Ss(e) {
|
|
1333
1332
|
let t = rn.value;
|
|
1334
1333
|
if (!t || typeof document > "u") return !1;
|
|
1335
1334
|
let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
|
|
1336
1335
|
return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
|
|
1337
1336
|
}
|
|
1338
|
-
function
|
|
1339
|
-
if (e.key !== "Escape" || !
|
|
1337
|
+
function Ss(e) {
|
|
1338
|
+
if (e.key !== "Escape" || !F.value || typeof document > "u") return;
|
|
1340
1339
|
let t = rn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
|
|
1341
1340
|
if (!t) return;
|
|
1342
|
-
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(
|
|
1341
|
+
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(lr) || r?.closest(lr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
|
|
1343
1342
|
if (i || a && o) {
|
|
1344
|
-
|
|
1343
|
+
cr.add(e);
|
|
1345
1344
|
return;
|
|
1346
1345
|
}
|
|
1347
|
-
!
|
|
1346
|
+
!Ar.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), wo());
|
|
1348
1347
|
}
|
|
1349
|
-
function
|
|
1348
|
+
function Cs(e) {
|
|
1350
1349
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
|
|
1351
|
-
if (!
|
|
1352
|
-
e.preventDefault(),
|
|
1350
|
+
if (!jr.value || !xs(e)) return;
|
|
1351
|
+
e.preventDefault(), ci();
|
|
1353
1352
|
return;
|
|
1354
1353
|
}
|
|
1355
1354
|
if (e.key === "Escape") {
|
|
1356
|
-
if (
|
|
1357
|
-
|
|
1355
|
+
if (cr.has(e)) {
|
|
1356
|
+
cr.delete(e);
|
|
1358
1357
|
return;
|
|
1359
1358
|
}
|
|
1360
|
-
let t =
|
|
1361
|
-
if (!t &&
|
|
1362
|
-
if (
|
|
1363
|
-
|
|
1359
|
+
let t = Ar.value, n = t || F.value;
|
|
1360
|
+
if (!t && F.value && wo(), $(), cs(), n && e.stopPropagation(), !n) {
|
|
1361
|
+
if (z.value) {
|
|
1362
|
+
ps(), e.stopPropagation();
|
|
1364
1363
|
return;
|
|
1365
1364
|
}
|
|
1366
|
-
|
|
1365
|
+
P.value ? io() : M.value = !1;
|
|
1367
1366
|
}
|
|
1368
1367
|
}
|
|
1369
1368
|
}
|
|
1370
|
-
function
|
|
1371
|
-
e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (
|
|
1372
|
-
let n =
|
|
1373
|
-
n && gt(n, t) || (
|
|
1374
|
-
...
|
|
1369
|
+
function ws(e, t) {
|
|
1370
|
+
e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (ms(e), ds());
|
|
1371
|
+
let n = Ln.value[e];
|
|
1372
|
+
n && gt(n, t) || (Ln.value = {
|
|
1373
|
+
...Ln.value,
|
|
1375
1374
|
[e]: t
|
|
1376
1375
|
});
|
|
1377
1376
|
}
|
|
1378
|
-
function
|
|
1379
|
-
|
|
1377
|
+
function Ts(e = sr.value.rows, t = sr.value.cols) {
|
|
1378
|
+
Q({
|
|
1380
1379
|
type: "insert-table",
|
|
1381
1380
|
options: {
|
|
1382
1381
|
rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
|
|
1383
1382
|
cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
|
|
1384
|
-
withHeaderRow: !!
|
|
1383
|
+
withHeaderRow: !!sr.value.withHeaderRow
|
|
1385
1384
|
}
|
|
1386
|
-
}),
|
|
1385
|
+
}), I.value = !1, $();
|
|
1387
1386
|
}
|
|
1388
|
-
let
|
|
1387
|
+
let Es = {
|
|
1389
1388
|
"delete-table-row": {
|
|
1390
1389
|
label: "删除当前行",
|
|
1391
1390
|
countKey: "deleteRow"
|
|
@@ -1399,12 +1398,12 @@ var Vt = {
|
|
|
1399
1398
|
countKey: "deleteTable"
|
|
1400
1399
|
}
|
|
1401
1400
|
};
|
|
1402
|
-
function
|
|
1403
|
-
let t =
|
|
1401
|
+
function Ds(e) {
|
|
1402
|
+
let t = B.value;
|
|
1404
1403
|
if (!t) return;
|
|
1405
1404
|
let n = () => {
|
|
1406
|
-
|
|
1407
|
-
}, r =
|
|
1405
|
+
Q(e, t.pageId), $();
|
|
1406
|
+
}, r = Es[e.type];
|
|
1408
1407
|
if (!r) {
|
|
1409
1408
|
n();
|
|
1410
1409
|
return;
|
|
@@ -1420,12 +1419,12 @@ var Vt = {
|
|
|
1420
1419
|
onCancel: () => A.get(t.pageId)?.focus()
|
|
1421
1420
|
});
|
|
1422
1421
|
}
|
|
1423
|
-
function
|
|
1424
|
-
let t =
|
|
1422
|
+
function Os(e) {
|
|
1423
|
+
let t = rr.value?.getMenuElement();
|
|
1425
1424
|
if (!t) return;
|
|
1426
1425
|
if (e.key === "Escape") {
|
|
1427
1426
|
e.preventDefault(), e.stopPropagation();
|
|
1428
|
-
let t =
|
|
1427
|
+
let t = B.value?.pageId;
|
|
1429
1428
|
$(), A.get(t ?? "")?.focus();
|
|
1430
1429
|
return;
|
|
1431
1430
|
}
|
|
@@ -1444,80 +1443,80 @@ var Vt = {
|
|
|
1444
1443
|
let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
|
|
1445
1444
|
e.preventDefault(), n[r]?.focus();
|
|
1446
1445
|
}
|
|
1447
|
-
function
|
|
1446
|
+
function ks(e) {
|
|
1448
1447
|
if (e.key !== "Escape") return;
|
|
1449
1448
|
e.preventDefault(), e.stopPropagation();
|
|
1450
|
-
let t =
|
|
1449
|
+
let t = R.value?.pageId;
|
|
1451
1450
|
$(), A.get(t ?? "")?.focus();
|
|
1452
1451
|
}
|
|
1453
|
-
function
|
|
1452
|
+
function As(e) {
|
|
1454
1453
|
if (e.key !== "Escape") return;
|
|
1455
1454
|
e.preventDefault(), e.stopPropagation();
|
|
1456
|
-
let t =
|
|
1455
|
+
let t = V.value?.pageId;
|
|
1457
1456
|
$(), A.get(t ?? "")?.focus();
|
|
1458
1457
|
}
|
|
1459
|
-
function
|
|
1460
|
-
|
|
1458
|
+
function js(e) {
|
|
1459
|
+
Q({ type: e }), L.value = !1, $();
|
|
1461
1460
|
}
|
|
1462
1461
|
return Xe({
|
|
1463
|
-
getValue:
|
|
1464
|
-
setValue:
|
|
1465
|
-
getFiles:
|
|
1466
|
-
setFiles:
|
|
1467
|
-
addFile:
|
|
1468
|
-
selectFile:
|
|
1469
|
-
renameFile:
|
|
1470
|
-
removeFile:
|
|
1471
|
-
moveFile:
|
|
1472
|
-
validate:
|
|
1473
|
-
exportTemplate:
|
|
1474
|
-
exportFiles:
|
|
1475
|
-
getSubmitData:
|
|
1476
|
-
clearTemplate:
|
|
1477
|
-
saveDraftCache:
|
|
1478
|
-
loadDraftCache:
|
|
1479
|
-
clearDraftCache:
|
|
1480
|
-
getDraftCacheStatus:
|
|
1481
|
-
insertVariable:
|
|
1482
|
-
insertImage:
|
|
1483
|
-
focus:
|
|
1484
|
-
openPreview:
|
|
1485
|
-
closePreview:
|
|
1486
|
-
openSubmitDataViewer:
|
|
1487
|
-
closeSubmitDataViewer:
|
|
1488
|
-
getVariableData:
|
|
1489
|
-
openVariableDataViewer:
|
|
1490
|
-
closeVariableDataViewer:
|
|
1491
|
-
setServerValidationErrors:
|
|
1492
|
-
clearValidationErrors:
|
|
1493
|
-
scrollToVariable:
|
|
1494
|
-
scrollToPage:
|
|
1495
|
-
setZoom:
|
|
1496
|
-
resetZoom:
|
|
1497
|
-
getZoom:
|
|
1498
|
-
fitWidth:
|
|
1462
|
+
getValue: To,
|
|
1463
|
+
setValue: Eo,
|
|
1464
|
+
getFiles: Do,
|
|
1465
|
+
setFiles: Oo,
|
|
1466
|
+
addFile: ko,
|
|
1467
|
+
selectFile: Ao,
|
|
1468
|
+
renameFile: jo,
|
|
1469
|
+
removeFile: Mo,
|
|
1470
|
+
moveFile: Po,
|
|
1471
|
+
validate: Fo,
|
|
1472
|
+
exportTemplate: Ro,
|
|
1473
|
+
exportFiles: zo,
|
|
1474
|
+
getSubmitData: co,
|
|
1475
|
+
clearTemplate: ho,
|
|
1476
|
+
saveDraftCache: ci,
|
|
1477
|
+
loadDraftCache: li,
|
|
1478
|
+
clearDraftCache: ui,
|
|
1479
|
+
getDraftCacheStatus: Ri,
|
|
1480
|
+
insertVariable: Ia,
|
|
1481
|
+
insertImage: pa,
|
|
1482
|
+
focus: Uo,
|
|
1483
|
+
openPreview: oo,
|
|
1484
|
+
closePreview: so,
|
|
1485
|
+
openSubmitDataViewer: lo,
|
|
1486
|
+
closeSubmitDataViewer: uo,
|
|
1487
|
+
getVariableData: fo,
|
|
1488
|
+
openVariableDataViewer: po,
|
|
1489
|
+
closeVariableDataViewer: mo,
|
|
1490
|
+
setServerValidationErrors: Vo,
|
|
1491
|
+
clearValidationErrors: Ho,
|
|
1492
|
+
scrollToVariable: yo,
|
|
1493
|
+
scrollToPage: So,
|
|
1494
|
+
setZoom: Xa,
|
|
1495
|
+
resetZoom: Za,
|
|
1496
|
+
getZoom: Qa,
|
|
1497
|
+
fitWidth: Ka
|
|
1499
1498
|
}), (e, t) => (v(), St("div", {
|
|
1500
1499
|
ref_key: "designerElement",
|
|
1501
1500
|
ref: rn,
|
|
1502
1501
|
class: wt(["gd-contract-template-designer", {
|
|
1503
1502
|
"is-disabled": s.disabled,
|
|
1504
|
-
"is-readonly":
|
|
1503
|
+
"is-readonly": W.value,
|
|
1505
1504
|
"is-fullscreen": M.value,
|
|
1506
|
-
"is-immersive":
|
|
1505
|
+
"is-immersive": P.value
|
|
1507
1506
|
}]),
|
|
1508
1507
|
style: Tt(nn.value),
|
|
1509
|
-
onKeydownCapture: t[31] ||= (...e) => b(
|
|
1508
|
+
onKeydownCapture: t[31] ||= (...e) => b(kr) && b(kr)(...e)
|
|
1510
1509
|
}, [
|
|
1511
1510
|
S.value ? (v(), xt(ft, {
|
|
1512
1511
|
key: 0,
|
|
1513
1512
|
files: C.value,
|
|
1514
1513
|
"active-file-id": w.value,
|
|
1515
|
-
readonly:
|
|
1516
|
-
onSelect:
|
|
1517
|
-
onAdd: t[0] ||= (e) =>
|
|
1518
|
-
onRename:
|
|
1519
|
-
onRemove:
|
|
1520
|
-
onMove:
|
|
1514
|
+
readonly: W.value,
|
|
1515
|
+
onSelect: Ao,
|
|
1516
|
+
onAdd: t[0] ||= (e) => ko(),
|
|
1517
|
+
onRename: jo,
|
|
1518
|
+
onRemove: No,
|
|
1519
|
+
onMove: Po
|
|
1521
1520
|
}, null, 8, [
|
|
1522
1521
|
"files",
|
|
1523
1522
|
"active-file-id",
|
|
@@ -1531,26 +1530,26 @@ var Vt = {
|
|
|
1531
1530
|
collapsed: Mn.value,
|
|
1532
1531
|
pages: T.value.pages,
|
|
1533
1532
|
variables: T.value.variables,
|
|
1534
|
-
"decoration-variable-keys":
|
|
1533
|
+
"decoration-variable-keys": si.value,
|
|
1535
1534
|
"active-page-id": D.value,
|
|
1536
1535
|
"selected-variable-key": E.value,
|
|
1537
|
-
"normalized-max-pages":
|
|
1538
|
-
"page-limit-reached":
|
|
1539
|
-
"selected-page":
|
|
1540
|
-
"selected-page-size":
|
|
1541
|
-
"normalized-page-size-options":
|
|
1542
|
-
"page-size-options":
|
|
1543
|
-
"selected-page-size-option-value":
|
|
1544
|
-
readonly:
|
|
1545
|
-
"get-page-size":
|
|
1536
|
+
"normalized-max-pages": ai.value,
|
|
1537
|
+
"page-limit-reached": oi.value,
|
|
1538
|
+
"selected-page": G.value,
|
|
1539
|
+
"selected-page-size": Ir.value,
|
|
1540
|
+
"normalized-page-size-options": Qr.value,
|
|
1541
|
+
"page-size-options": $r.value,
|
|
1542
|
+
"selected-page-size-option-value": ei.value,
|
|
1543
|
+
readonly: W.value,
|
|
1544
|
+
"get-page-size": Ji,
|
|
1546
1545
|
onToggle: t[1] ||= (e) => Mn.value = !Mn.value,
|
|
1547
|
-
onAddPage:
|
|
1548
|
-
onActivatePage:
|
|
1549
|
-
onNavigateOutline:
|
|
1550
|
-
onDuplicatePage:
|
|
1551
|
-
onRemovePage:
|
|
1552
|
-
onPatchPageFormat:
|
|
1553
|
-
onScrollToVariable:
|
|
1546
|
+
onAddPage: Zi,
|
|
1547
|
+
onActivatePage: bo,
|
|
1548
|
+
onNavigateOutline: xo,
|
|
1549
|
+
onDuplicatePage: Qi,
|
|
1550
|
+
onRemovePage: ea,
|
|
1551
|
+
onPatchPageFormat: Yi,
|
|
1552
|
+
onScrollToVariable: vo
|
|
1554
1553
|
}, null, 8, [
|
|
1555
1554
|
"collapsed",
|
|
1556
1555
|
"pages",
|
|
@@ -1578,61 +1577,60 @@ var Vt = {
|
|
|
1578
1577
|
}, [h(Re, {
|
|
1579
1578
|
ref_key: "workspaceHeaderElement",
|
|
1580
1579
|
ref: sn,
|
|
1581
|
-
summary:
|
|
1582
|
-
"draft-cache-status-text":
|
|
1583
|
-
"draft-cache-status-class":
|
|
1580
|
+
summary: zr.value,
|
|
1581
|
+
"draft-cache-status-text": Ur.value,
|
|
1582
|
+
"draft-cache-status-class": Wr.value,
|
|
1584
1583
|
"show-draft-cache-status": s.showDraftCacheStatus,
|
|
1585
1584
|
"show-clear-button": s.showClearButton,
|
|
1586
1585
|
"show-submit-data-viewer": s.showSubmitDataViewer,
|
|
1587
1586
|
"show-variable-data-viewer": s.showVariableDataViewer,
|
|
1588
|
-
readonly:
|
|
1589
|
-
"zoom-percent":
|
|
1587
|
+
readonly: W.value,
|
|
1588
|
+
"zoom-percent": Gr.value,
|
|
1590
1589
|
"zoom-out-disabled": j.value <= Gt,
|
|
1591
1590
|
"zoom-in-disabled": j.value >= Kt,
|
|
1592
1591
|
"is-fullscreen": M.value,
|
|
1593
|
-
immersive:
|
|
1594
|
-
"page-decorations-open":
|
|
1592
|
+
immersive: P.value,
|
|
1593
|
+
"page-decorations-open": F.value,
|
|
1595
1594
|
"page-decorations-studio-id": ln,
|
|
1596
|
-
"page-decorations-preset-label":
|
|
1597
|
-
"page-decorations-enabled-count":
|
|
1598
|
-
"page-decorations-enabled-states":
|
|
1595
|
+
"page-decorations-preset-label": Br.value,
|
|
1596
|
+
"page-decorations-enabled-count": Hr.value,
|
|
1597
|
+
"page-decorations-enabled-states": Vr.value,
|
|
1599
1598
|
"chrome-controls-id": un,
|
|
1600
|
-
onZoomOut:
|
|
1601
|
-
onZoomIn:
|
|
1602
|
-
onFitWidth: b(
|
|
1603
|
-
onResetZoom:
|
|
1604
|
-
onToggleFullscreen:
|
|
1605
|
-
onToggleImmersive:
|
|
1606
|
-
onClear:
|
|
1607
|
-
onValidate:
|
|
1608
|
-
onPreview:
|
|
1609
|
-
onSubmitData:
|
|
1610
|
-
onVariableData:
|
|
1611
|
-
onTogglePageDecorations:
|
|
1612
|
-
onToggleChrome:
|
|
1599
|
+
onZoomOut: eo,
|
|
1600
|
+
onZoomIn: $a,
|
|
1601
|
+
onFitWidth: b(Ka),
|
|
1602
|
+
onResetZoom: Za,
|
|
1603
|
+
onToggleFullscreen: to,
|
|
1604
|
+
onToggleImmersive: ao,
|
|
1605
|
+
onClear: go,
|
|
1606
|
+
onValidate: Fo,
|
|
1607
|
+
onPreview: oo,
|
|
1608
|
+
onSubmitData: lo,
|
|
1609
|
+
onVariableData: po,
|
|
1610
|
+
onTogglePageDecorations: Co,
|
|
1611
|
+
onToggleChrome: ls
|
|
1613
1612
|
}, {
|
|
1614
1613
|
authoring: Mt(() => [h(Ve, {
|
|
1615
1614
|
ref_key: "authoringBarElement",
|
|
1616
1615
|
ref: pn,
|
|
1617
1616
|
compact: "",
|
|
1618
|
-
query: b(
|
|
1619
|
-
"onUpdate:query": t[2] ||= (e) => Ct(
|
|
1620
|
-
replacement: b(
|
|
1621
|
-
"onUpdate:replacement": t[3] ||= (e) => Ct(
|
|
1622
|
-
"match-case": b(
|
|
1623
|
-
"onUpdate:matchCase": t[4] ||= (e) => Ct(
|
|
1624
|
-
panel: b(
|
|
1625
|
-
readonly:
|
|
1626
|
-
total: b(
|
|
1627
|
-
"current-index": b(
|
|
1628
|
-
"current-page": b(
|
|
1629
|
-
feedback: b(
|
|
1630
|
-
onOpen: b(
|
|
1631
|
-
onClose: t[5] ||= (e) => b(
|
|
1632
|
-
onNavigate: b(
|
|
1633
|
-
onReplaceCurrent: b(
|
|
1634
|
-
onReplaceAll: b(
|
|
1635
|
-
onInsertSnippet: b(Ar)
|
|
1617
|
+
query: b(gr),
|
|
1618
|
+
"onUpdate:query": t[2] ||= (e) => Ct(gr) ? gr.value = e : null,
|
|
1619
|
+
replacement: b(_r),
|
|
1620
|
+
"onUpdate:replacement": t[3] ||= (e) => Ct(_r) ? _r.value = e : null,
|
|
1621
|
+
"match-case": b(vr),
|
|
1622
|
+
"onUpdate:matchCase": t[4] ||= (e) => Ct(vr) ? vr.value = e : null,
|
|
1623
|
+
panel: b(hr),
|
|
1624
|
+
readonly: W.value,
|
|
1625
|
+
total: b(yr).length,
|
|
1626
|
+
"current-index": b(br),
|
|
1627
|
+
"current-page": b(xr) ? b(xr).pageIndex + 1 : void 0,
|
|
1628
|
+
feedback: b(Sr),
|
|
1629
|
+
onOpen: b(wr),
|
|
1630
|
+
onClose: t[5] ||= (e) => b(Tr)(),
|
|
1631
|
+
onNavigate: b(Er),
|
|
1632
|
+
onReplaceCurrent: b(Dr),
|
|
1633
|
+
onReplaceAll: b(Or)
|
|
1636
1634
|
}, null, 8, [
|
|
1637
1635
|
"query",
|
|
1638
1636
|
"replacement",
|
|
@@ -1646,8 +1644,7 @@ var Vt = {
|
|
|
1646
1644
|
"onOpen",
|
|
1647
1645
|
"onNavigate",
|
|
1648
1646
|
"onReplaceCurrent",
|
|
1649
|
-
"onReplaceAll"
|
|
1650
|
-
"onInsertSnippet"
|
|
1647
|
+
"onReplaceAll"
|
|
1651
1648
|
])]),
|
|
1652
1649
|
_: 1
|
|
1653
1650
|
}, 8, [
|
|
@@ -1670,63 +1667,63 @@ var Vt = {
|
|
|
1670
1667
|
"page-decorations-enabled-states",
|
|
1671
1668
|
"onFitWidth"
|
|
1672
1669
|
]), h(Be, {
|
|
1673
|
-
"variable-insert-popover-open":
|
|
1674
|
-
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) =>
|
|
1675
|
-
"signing-layout-popover-open":
|
|
1676
|
-
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) =>
|
|
1677
|
-
"signing-mark-popover-open":
|
|
1678
|
-
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) =>
|
|
1679
|
-
"image-insert-popover-open":
|
|
1680
|
-
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) =>
|
|
1681
|
-
"image-insert-url":
|
|
1682
|
-
"onUpdate:imageInsertUrl": t[10] ||= (e) =>
|
|
1683
|
-
"image-insert-width":
|
|
1684
|
-
"onUpdate:imageInsertWidth": t[11] ||= (e) =>
|
|
1685
|
-
"image-insert-height":
|
|
1686
|
-
"onUpdate:imageInsertHeight": t[12] ||= (e) =>
|
|
1687
|
-
"table-insert-popover-open":
|
|
1688
|
-
"onUpdate:tableInsertPopoverOpen": t[13] ||= (e) =>
|
|
1689
|
-
"table-actions-popover-open":
|
|
1690
|
-
"onUpdate:tableActionsPopoverOpen": t[14] ||= (e) =>
|
|
1691
|
-
"table-insert-draft":
|
|
1692
|
-
"onUpdate:tableInsertDraft": t[15] ||= (e) =>
|
|
1693
|
-
"toolbar-more-open":
|
|
1694
|
-
"onUpdate:toolbarMoreOpen": t[16] ||= (e) =>
|
|
1695
|
-
readonly:
|
|
1696
|
-
"editor-state":
|
|
1697
|
-
"current-block-format":
|
|
1698
|
-
"block-format-options":
|
|
1699
|
-
"font-family-select-options":
|
|
1700
|
-
"current-editor-font-family":
|
|
1701
|
-
"font-size-preset-options":
|
|
1702
|
-
"current-editor-font-size":
|
|
1703
|
-
"editor-font-size-search-value":
|
|
1704
|
-
"current-editor-text-color":
|
|
1705
|
-
"body-control-tool-items":
|
|
1706
|
-
"signing-layout-presets":
|
|
1707
|
-
"page-limit-reached":
|
|
1708
|
-
"normalized-max-pages":
|
|
1709
|
-
"image-processing":
|
|
1710
|
-
"image-insert-error":
|
|
1711
|
-
onCommand: t[17] ||= (e) =>
|
|
1712
|
-
onPatchBlockFormat:
|
|
1713
|
-
onPatchFontFamily:
|
|
1714
|
-
onPatchFontSize:
|
|
1715
|
-
onPatchColor:
|
|
1716
|
-
onPatchTextAlign:
|
|
1717
|
-
onInsertVariable:
|
|
1718
|
-
onInsertSigningLayout:
|
|
1719
|
-
onInsertSigningMark:
|
|
1720
|
-
onOpenSigningLayoutCustom:
|
|
1721
|
-
onOpenImageFile:
|
|
1722
|
-
onInsertImageUrl:
|
|
1723
|
-
onAddPage:
|
|
1724
|
-
onInsertTable:
|
|
1725
|
-
onTableAction:
|
|
1726
|
-
onFontSizeSearch:
|
|
1727
|
-
onFontSizeCommit:
|
|
1728
|
-
onFontSizeDropdownChange:
|
|
1729
|
-
onFontSizeKeydown:
|
|
1670
|
+
"variable-insert-popover-open": zn.value,
|
|
1671
|
+
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => zn.value = e,
|
|
1672
|
+
"signing-layout-popover-open": Vn.value,
|
|
1673
|
+
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Vn.value = e,
|
|
1674
|
+
"signing-mark-popover-open": Hn.value,
|
|
1675
|
+
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => Hn.value = e,
|
|
1676
|
+
"image-insert-popover-open": Bn.value,
|
|
1677
|
+
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Bn.value = e,
|
|
1678
|
+
"image-insert-url": Wn.value,
|
|
1679
|
+
"onUpdate:imageInsertUrl": t[10] ||= (e) => Wn.value = e,
|
|
1680
|
+
"image-insert-width": Gn.value,
|
|
1681
|
+
"onUpdate:imageInsertWidth": t[11] ||= (e) => Gn.value = e,
|
|
1682
|
+
"image-insert-height": Kn.value,
|
|
1683
|
+
"onUpdate:imageInsertHeight": t[12] ||= (e) => Kn.value = e,
|
|
1684
|
+
"table-insert-popover-open": I.value,
|
|
1685
|
+
"onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => I.value = e,
|
|
1686
|
+
"table-actions-popover-open": L.value,
|
|
1687
|
+
"onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => L.value = e,
|
|
1688
|
+
"table-insert-draft": sr.value,
|
|
1689
|
+
"onUpdate:tableInsertDraft": t[15] ||= (e) => sr.value = e,
|
|
1690
|
+
"toolbar-more-open": In.value,
|
|
1691
|
+
"onUpdate:toolbarMoreOpen": t[16] ||= (e) => In.value = e,
|
|
1692
|
+
readonly: W.value,
|
|
1693
|
+
"editor-state": J.value,
|
|
1694
|
+
"current-block-format": vi.value,
|
|
1695
|
+
"block-format-options": Yr,
|
|
1696
|
+
"font-family-select-options": qr.value,
|
|
1697
|
+
"current-editor-font-family": yi.value,
|
|
1698
|
+
"font-size-preset-options": Ci.value,
|
|
1699
|
+
"current-editor-font-size": bi.value,
|
|
1700
|
+
"editor-font-size-search-value": Rn.value,
|
|
1701
|
+
"current-editor-text-color": xi.value,
|
|
1702
|
+
"body-control-tool-items": ii.value,
|
|
1703
|
+
"signing-layout-presets": ri.value,
|
|
1704
|
+
"page-limit-reached": oi.value,
|
|
1705
|
+
"normalized-max-pages": ai.value,
|
|
1706
|
+
"image-processing": Jn.value,
|
|
1707
|
+
"image-insert-error": qn.value,
|
|
1708
|
+
onCommand: t[17] ||= (e) => Q(e),
|
|
1709
|
+
onPatchBlockFormat: Go,
|
|
1710
|
+
onPatchFontFamily: qo,
|
|
1711
|
+
onPatchFontSize: Ko,
|
|
1712
|
+
onPatchColor: Jo,
|
|
1713
|
+
onPatchTextAlign: Wo,
|
|
1714
|
+
onInsertVariable: _a,
|
|
1715
|
+
onInsertSigningLayout: Bi,
|
|
1716
|
+
onInsertSigningMark: Ui,
|
|
1717
|
+
onOpenSigningLayoutCustom: Hi,
|
|
1718
|
+
onOpenImageFile: ma,
|
|
1719
|
+
onInsertImageUrl: ga,
|
|
1720
|
+
onAddPage: Zi,
|
|
1721
|
+
onInsertTable: Ts,
|
|
1722
|
+
onTableAction: js,
|
|
1723
|
+
onFontSizeSearch: Xo,
|
|
1724
|
+
onFontSizeCommit: Zo,
|
|
1725
|
+
onFontSizeDropdownChange: $o,
|
|
1726
|
+
onFontSizeKeydown: Qo
|
|
1730
1727
|
}, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[jt, !N.value]]),
|
|
1731
1728
|
N.value ? (v(), xt(b(It), {
|
|
1732
1729
|
key: 0,
|
|
@@ -1740,33 +1737,33 @@ var Vt = {
|
|
|
1740
1737
|
"aria-label": "展开工具区",
|
|
1741
1738
|
"aria-expanded": !1,
|
|
1742
1739
|
"aria-controls": un,
|
|
1743
|
-
onClick:
|
|
1740
|
+
onClick: ls
|
|
1744
1741
|
}, [h(b(Bt), { "aria-hidden": "true" })], 512)]),
|
|
1745
1742
|
_: 1
|
|
1746
1743
|
})) : p("", !0),
|
|
1747
|
-
|
|
1744
|
+
P.value && !F.value ? (v(), St("button", {
|
|
1748
1745
|
key: 1,
|
|
1749
1746
|
ref_key: "immersiveExitElement",
|
|
1750
|
-
ref:
|
|
1747
|
+
ref: Pn,
|
|
1751
1748
|
type: "button",
|
|
1752
1749
|
class: "gd-contract-template-designer__immersive-exit",
|
|
1753
1750
|
"aria-label": "退出沉浸写作",
|
|
1754
|
-
onClick:
|
|
1751
|
+
onClick: io
|
|
1755
1752
|
}, [
|
|
1756
1753
|
h(b(zt), { "aria-hidden": "true" }),
|
|
1757
1754
|
t[32] ||= m("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
|
|
1758
1755
|
t[33] ||= m("kbd", null, "Esc", -1)
|
|
1759
1756
|
], 512)) : p("", !0),
|
|
1760
1757
|
O.value ? (v(), St("section", Vt, [h(b(Pt), {
|
|
1761
|
-
type:
|
|
1762
|
-
message:
|
|
1758
|
+
type: Lr.value ? "success" : "error",
|
|
1759
|
+
message: Rr.value,
|
|
1763
1760
|
"show-icon": ""
|
|
1764
1761
|
}, null, 8, ["type", "message"]), k.value.length ? (v(), St("div", Ht, [(v(!0), St(yt, null, Ot(k.value, (e) => (v(), St("button", {
|
|
1765
1762
|
key: `${e.id}-${e.message}`,
|
|
1766
1763
|
type: "button",
|
|
1767
1764
|
class: "gd-contract-template-designer__validation-item",
|
|
1768
|
-
onClick: (t) =>
|
|
1769
|
-
}, [m("span", null, kt(e.message), 1), m("small", null, kt(
|
|
1765
|
+
onClick: (t) => Io(e)
|
|
1766
|
+
}, [m("span", null, kt(e.message), 1), m("small", null, kt(Lo(e)), 1)], 8, Ut))), 128))])) : p("", !0)])) : p("", !0),
|
|
1770
1767
|
m("div", {
|
|
1771
1768
|
ref_key: "canvasElement",
|
|
1772
1769
|
ref: an,
|
|
@@ -1774,10 +1771,10 @@ var Vt = {
|
|
|
1774
1771
|
}, [(v(!0), St(yt, null, Ot(T.value.pages, (e, n) => (v(), xt(Ie, {
|
|
1775
1772
|
key: `${w.value}:${e.id}`,
|
|
1776
1773
|
ref_for: !0,
|
|
1777
|
-
ref: (t) =>
|
|
1774
|
+
ref: (t) => zi(e.id, t),
|
|
1778
1775
|
page: e,
|
|
1779
1776
|
"page-index": n,
|
|
1780
|
-
"page-size":
|
|
1777
|
+
"page-size": Ji(e),
|
|
1781
1778
|
"page-decorations": T.value.pageDecorations,
|
|
1782
1779
|
"total-pages": T.value.pages.length,
|
|
1783
1780
|
variables: T.value.variables,
|
|
@@ -1786,18 +1783,18 @@ var Vt = {
|
|
|
1786
1783
|
readonly: s.readonly,
|
|
1787
1784
|
disabled: s.disabled,
|
|
1788
1785
|
zoom: j.value,
|
|
1789
|
-
"process-image-file":
|
|
1790
|
-
"search-query": b(
|
|
1791
|
-
"search-match-case": b(
|
|
1792
|
-
"active-search-match": b(
|
|
1793
|
-
onPageUpdate:
|
|
1794
|
-
onVariableDrop:
|
|
1795
|
-
onVariableSelect:
|
|
1796
|
-
onEditorFocus: t[18] ||= (e) =>
|
|
1797
|
-
onEditorStateChange:
|
|
1798
|
-
onEditorContextMenu:
|
|
1799
|
-
onWordPaste:
|
|
1800
|
-
onVariableMoveBlocked: t[19] ||= (e) =>
|
|
1786
|
+
"process-image-file": fa,
|
|
1787
|
+
"search-query": b(Cr),
|
|
1788
|
+
"search-match-case": b(vr),
|
|
1789
|
+
"active-search-match": b(xr)?.pageId === e.id ? b(xr) : void 0,
|
|
1790
|
+
onPageUpdate: qi,
|
|
1791
|
+
onVariableDrop: ya,
|
|
1792
|
+
onVariableSelect: ba,
|
|
1793
|
+
onEditorFocus: t[18] ||= (e) => bo(e, !1),
|
|
1794
|
+
onEditorStateChange: ws,
|
|
1795
|
+
onEditorContextMenu: ss,
|
|
1796
|
+
onWordPaste: da,
|
|
1797
|
+
onVariableMoveBlocked: t[19] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
|
|
1801
1798
|
}, null, 8, [
|
|
1802
1799
|
"page",
|
|
1803
1800
|
"page-index",
|
|
@@ -1819,34 +1816,34 @@ var Vt = {
|
|
|
1819
1816
|
collapsed: Nn.value,
|
|
1820
1817
|
readonly: s.readonly,
|
|
1821
1818
|
disabled: s.disabled,
|
|
1822
|
-
"body-control-tool-items":
|
|
1823
|
-
"selected-variable":
|
|
1819
|
+
"body-control-tool-items": ii.value,
|
|
1820
|
+
"selected-variable": K.value,
|
|
1824
1821
|
variables: T.value.variables,
|
|
1825
|
-
"current-variable-font-family":
|
|
1826
|
-
"font-family-select-options":
|
|
1827
|
-
"text-align-options": b(
|
|
1828
|
-
"border-style-options":
|
|
1829
|
-
"object-fit-options":
|
|
1830
|
-
"selected-variable-width-max":
|
|
1831
|
-
"selected-variable-height-max":
|
|
1822
|
+
"current-variable-font-family": Si.value,
|
|
1823
|
+
"font-family-select-options": qr.value,
|
|
1824
|
+
"text-align-options": b(Jr),
|
|
1825
|
+
"border-style-options": Xr,
|
|
1826
|
+
"object-fit-options": Zr,
|
|
1827
|
+
"selected-variable-width-max": gi.value,
|
|
1828
|
+
"selected-variable-height-max": _i.value,
|
|
1832
1829
|
"min-font-size": $t,
|
|
1833
1830
|
"max-font-size": en,
|
|
1834
1831
|
"default-multiline-rows": b(3),
|
|
1835
1832
|
onToggle: t[20] ||= (e) => Nn.value = !Nn.value,
|
|
1836
|
-
onVariableDragStart:
|
|
1837
|
-
onInsertVariable:
|
|
1838
|
-
onDuplicateVariable:
|
|
1839
|
-
onRemoveVariable:
|
|
1840
|
-
onPatchVariable:
|
|
1841
|
-
onRenameVariable:
|
|
1842
|
-
onPatchStyle:
|
|
1843
|
-
onPatchMultiline:
|
|
1844
|
-
onPatchRows:
|
|
1845
|
-
onPatchFontFamily:
|
|
1846
|
-
onPatchFontSize:
|
|
1847
|
-
onPatchTextAlign:
|
|
1848
|
-
onPatchBorderStyle:
|
|
1849
|
-
onPatchObjectFit:
|
|
1833
|
+
onVariableDragStart: Ua,
|
|
1834
|
+
onInsertVariable: La,
|
|
1835
|
+
onDuplicateVariable: Fa,
|
|
1836
|
+
onRemoveVariable: Na,
|
|
1837
|
+
onPatchVariable: Sa,
|
|
1838
|
+
onRenameVariable: Ca,
|
|
1839
|
+
onPatchStyle: Oa,
|
|
1840
|
+
onPatchMultiline: ja,
|
|
1841
|
+
onPatchRows: Ma,
|
|
1842
|
+
onPatchFontFamily: ka,
|
|
1843
|
+
onPatchFontSize: Aa,
|
|
1844
|
+
onPatchTextAlign: Ta,
|
|
1845
|
+
onPatchBorderStyle: Ea,
|
|
1846
|
+
onPatchObjectFit: Da
|
|
1850
1847
|
}, null, 8, [
|
|
1851
1848
|
"collapsed",
|
|
1852
1849
|
"readonly",
|
|
@@ -1866,16 +1863,16 @@ var Vt = {
|
|
|
1866
1863
|
ref_key: "pageDecorationsStudioElement",
|
|
1867
1864
|
ref: cn,
|
|
1868
1865
|
id: ln,
|
|
1869
|
-
open:
|
|
1866
|
+
open: F.value,
|
|
1870
1867
|
decorations: T.value.pageDecorations,
|
|
1871
1868
|
variables: T.value.variables,
|
|
1872
|
-
"font-family-options":
|
|
1869
|
+
"font-family-options": qr.value,
|
|
1873
1870
|
readonly: s.readonly,
|
|
1874
1871
|
disabled: s.disabled,
|
|
1875
|
-
"active-tab":
|
|
1876
|
-
"onUpdate:activeTab": t[21] ||= (e) =>
|
|
1877
|
-
onChange:
|
|
1878
|
-
onClose:
|
|
1872
|
+
"active-tab": Fn.value,
|
|
1873
|
+
"onUpdate:activeTab": t[21] ||= (e) => Fn.value = e,
|
|
1874
|
+
onChange: wa,
|
|
1875
|
+
onClose: wo
|
|
1879
1876
|
}, null, 8, [
|
|
1880
1877
|
"open",
|
|
1881
1878
|
"decorations",
|
|
@@ -1884,39 +1881,39 @@ var Vt = {
|
|
|
1884
1881
|
"readonly",
|
|
1885
1882
|
"disabled",
|
|
1886
1883
|
"active-tab"
|
|
1887
|
-
]), [[jt,
|
|
1884
|
+
]), [[jt, F.value]]),
|
|
1888
1885
|
(v(), xt(bt, { to: "body" }, [
|
|
1889
|
-
|
|
1886
|
+
B.value ? (v(), xt(Le, {
|
|
1890
1887
|
key: 0,
|
|
1891
1888
|
ref_key: "tableContextMenuElement",
|
|
1892
|
-
ref:
|
|
1893
|
-
capabilities:
|
|
1894
|
-
"active-alignment":
|
|
1889
|
+
ref: rr,
|
|
1890
|
+
capabilities: B.value.capabilities,
|
|
1891
|
+
"active-alignment": B.value.activeAlignment,
|
|
1895
1892
|
style: Tt({
|
|
1896
|
-
left: `${
|
|
1897
|
-
top: `${
|
|
1893
|
+
left: `${B.value.x}px`,
|
|
1894
|
+
top: `${B.value.y}px`
|
|
1898
1895
|
}),
|
|
1899
|
-
onExecute:
|
|
1900
|
-
onKeydown:
|
|
1896
|
+
onExecute: Ds,
|
|
1897
|
+
onKeydown: Os
|
|
1901
1898
|
}, null, 8, [
|
|
1902
1899
|
"capabilities",
|
|
1903
1900
|
"active-alignment",
|
|
1904
1901
|
"style"
|
|
1905
1902
|
])) : p("", !0),
|
|
1906
|
-
|
|
1903
|
+
V.value ? (v(), xt(Ge, {
|
|
1907
1904
|
key: 1,
|
|
1908
1905
|
ref_key: "imageContextMenuElement",
|
|
1909
|
-
ref:
|
|
1910
|
-
width:
|
|
1911
|
-
"onUpdate:width": t[22] ||= (e) =>
|
|
1912
|
-
height:
|
|
1913
|
-
"onUpdate:height": t[23] ||= (e) =>
|
|
1914
|
-
x:
|
|
1915
|
-
y:
|
|
1916
|
-
readonly:
|
|
1917
|
-
onRestore:
|
|
1918
|
-
onApply:
|
|
1919
|
-
onKeydown:
|
|
1906
|
+
ref: ir,
|
|
1907
|
+
width: ar.value,
|
|
1908
|
+
"onUpdate:width": t[22] ||= (e) => ar.value = e,
|
|
1909
|
+
height: or.value,
|
|
1910
|
+
"onUpdate:height": t[23] ||= (e) => or.value = e,
|
|
1911
|
+
x: V.value.x,
|
|
1912
|
+
y: V.value.y,
|
|
1913
|
+
readonly: W.value,
|
|
1914
|
+
onRestore: os,
|
|
1915
|
+
onApply: as,
|
|
1916
|
+
onKeydown: As
|
|
1920
1917
|
}, null, 8, [
|
|
1921
1918
|
"width",
|
|
1922
1919
|
"height",
|
|
@@ -1924,31 +1921,31 @@ var Vt = {
|
|
|
1924
1921
|
"y",
|
|
1925
1922
|
"readonly"
|
|
1926
1923
|
])) : p("", !0),
|
|
1927
|
-
|
|
1924
|
+
R.value ? (v(), xt(Ue, {
|
|
1928
1925
|
key: 2,
|
|
1929
1926
|
ref_key: "textContextMenuElement",
|
|
1930
|
-
ref:
|
|
1931
|
-
"bind-open":
|
|
1932
|
-
"onUpdate:bindOpen": t[24] ||= (e) =>
|
|
1933
|
-
"bind-keyword":
|
|
1934
|
-
"onUpdate:bindKeyword": t[25] ||= (e) =>
|
|
1935
|
-
x:
|
|
1936
|
-
y:
|
|
1937
|
-
"has-selection":
|
|
1938
|
-
"editor-state":
|
|
1939
|
-
"current-editor-text-color":
|
|
1940
|
-
"body-control-tool-items":
|
|
1941
|
-
"text-menu-bindable-variables":
|
|
1927
|
+
ref: Yn,
|
|
1928
|
+
"bind-open": tr.value,
|
|
1929
|
+
"onUpdate:bindOpen": t[24] ||= (e) => tr.value = e,
|
|
1930
|
+
"bind-keyword": nr.value,
|
|
1931
|
+
"onUpdate:bindKeyword": t[25] ||= (e) => nr.value = e,
|
|
1932
|
+
x: R.value.x,
|
|
1933
|
+
y: R.value.y,
|
|
1934
|
+
"has-selection": R.value.hasSelection,
|
|
1935
|
+
"editor-state": J.value,
|
|
1936
|
+
"current-editor-text-color": xi.value,
|
|
1937
|
+
"body-control-tool-items": ii.value,
|
|
1938
|
+
"text-menu-bindable-variables": hi.value,
|
|
1942
1939
|
"variables-count": T.value.variables.length,
|
|
1943
|
-
"resolve-bind-variable-type-label":
|
|
1944
|
-
onCommand:
|
|
1945
|
-
onClipboard:
|
|
1946
|
-
onAddPage:
|
|
1947
|
-
onInsertVariable:
|
|
1948
|
-
onBindVariable:
|
|
1949
|
-
onOpenBindPanel:
|
|
1950
|
-
onKeydown:
|
|
1951
|
-
onPatchColor:
|
|
1940
|
+
"resolve-bind-variable-type-label": Va,
|
|
1941
|
+
onCommand: Wi,
|
|
1942
|
+
onClipboard: Gi,
|
|
1943
|
+
onAddPage: va,
|
|
1944
|
+
onInsertVariable: Ra,
|
|
1945
|
+
onBindVariable: Ba,
|
|
1946
|
+
onOpenBindPanel: Ha,
|
|
1947
|
+
onKeydown: ks,
|
|
1948
|
+
onPatchColor: Yo
|
|
1952
1949
|
}, null, 8, [
|
|
1953
1950
|
"bind-open",
|
|
1954
1951
|
"bind-keyword",
|
|
@@ -1961,27 +1958,27 @@ var Vt = {
|
|
|
1961
1958
|
"text-menu-bindable-variables",
|
|
1962
1959
|
"variables-count"
|
|
1963
1960
|
])) : p("", !0),
|
|
1964
|
-
|
|
1961
|
+
z.value ? (v(), xt(We, {
|
|
1965
1962
|
key: 3,
|
|
1966
1963
|
ref_key: "textBubbleElement",
|
|
1967
|
-
ref:
|
|
1968
|
-
x:
|
|
1969
|
-
y:
|
|
1970
|
-
"editor-state":
|
|
1971
|
-
"font-size-preset-options":
|
|
1972
|
-
"current-editor-font-size":
|
|
1973
|
-
"editor-font-size-search-value":
|
|
1974
|
-
"current-editor-text-color":
|
|
1975
|
-
"text-align-options": b(
|
|
1976
|
-
onCommand:
|
|
1977
|
-
onPatchFontSize:
|
|
1978
|
-
onPatchTextAlign:
|
|
1979
|
-
onPatchColor:
|
|
1980
|
-
onFontSizeSearch:
|
|
1981
|
-
onFontSizeCommit:
|
|
1982
|
-
onFontSizeDropdownChange:
|
|
1983
|
-
onFontSizeKeydown:
|
|
1984
|
-
onMore:
|
|
1964
|
+
ref: Xn,
|
|
1965
|
+
x: z.value.x,
|
|
1966
|
+
y: z.value.y,
|
|
1967
|
+
"editor-state": J.value,
|
|
1968
|
+
"font-size-preset-options": Ci.value,
|
|
1969
|
+
"current-editor-font-size": bi.value,
|
|
1970
|
+
"editor-font-size-search-value": Rn.value,
|
|
1971
|
+
"current-editor-text-color": xi.value,
|
|
1972
|
+
"text-align-options": b(Jr),
|
|
1973
|
+
onCommand: Q,
|
|
1974
|
+
onPatchFontSize: Ko,
|
|
1975
|
+
onPatchTextAlign: Wo,
|
|
1976
|
+
onPatchColor: Yo,
|
|
1977
|
+
onFontSizeSearch: Xo,
|
|
1978
|
+
onFontSizeCommit: Zo,
|
|
1979
|
+
onFontSizeDropdownChange: $o,
|
|
1980
|
+
onFontSizeKeydown: Qo,
|
|
1981
|
+
onMore: vs
|
|
1985
1982
|
}, null, 8, [
|
|
1986
1983
|
"x",
|
|
1987
1984
|
"y",
|
|
@@ -2001,18 +1998,18 @@ var Vt = {
|
|
|
2001
1998
|
accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
|
|
2002
1999
|
tabindex: "-1",
|
|
2003
2000
|
"aria-hidden": "true",
|
|
2004
|
-
onChange:
|
|
2001
|
+
onChange: ha
|
|
2005
2002
|
}, null, 544),
|
|
2006
|
-
m("span", Wt, kt(
|
|
2003
|
+
m("span", Wt, kt(H.value), 1),
|
|
2007
2004
|
h(Ke, {
|
|
2008
2005
|
open: wn.value,
|
|
2009
2006
|
"onUpdate:open": t[26] ||= (e) => wn.value = e,
|
|
2010
|
-
"preview-pages":
|
|
2011
|
-
"preview-file-groups":
|
|
2012
|
-
"preview-active-group":
|
|
2007
|
+
"preview-pages": Nr.value,
|
|
2008
|
+
"preview-file-groups": Pr.value,
|
|
2009
|
+
"preview-active-group": Fr.value,
|
|
2013
2010
|
"preview-snapshot": Tn.value,
|
|
2014
2011
|
"font-base-url": s.contractFontBaseUrl,
|
|
2015
|
-
onCancel:
|
|
2012
|
+
onCancel: so,
|
|
2016
2013
|
onSelectFile: t[27] ||= (e) => Dn.value = e
|
|
2017
2014
|
}, null, 8, [
|
|
2018
2015
|
"open",
|
|
@@ -2026,24 +2023,24 @@ var Vt = {
|
|
|
2026
2023
|
open: On.value,
|
|
2027
2024
|
"onUpdate:open": t[28] ||= (e) => On.value = e,
|
|
2028
2025
|
json: kn.value,
|
|
2029
|
-
onCancel:
|
|
2026
|
+
onCancel: uo
|
|
2030
2027
|
}, null, 8, ["open", "json"]),
|
|
2031
2028
|
h(Je, {
|
|
2032
2029
|
open: An.value,
|
|
2033
2030
|
"onUpdate:open": t[29] ||= (e) => An.value = e,
|
|
2034
2031
|
data: jn.value,
|
|
2035
|
-
"file-name":
|
|
2036
|
-
onCancel:
|
|
2032
|
+
"file-name": Mr.value?.name,
|
|
2033
|
+
onCancel: mo
|
|
2037
2034
|
}, null, 8, [
|
|
2038
2035
|
"open",
|
|
2039
2036
|
"data",
|
|
2040
2037
|
"file-name"
|
|
2041
2038
|
]),
|
|
2042
2039
|
h(Ye, {
|
|
2043
|
-
open:
|
|
2044
|
-
"onUpdate:open": t[30] ||= (e) =>
|
|
2045
|
-
disabled:
|
|
2046
|
-
onInsert:
|
|
2040
|
+
open: Un.value,
|
|
2041
|
+
"onUpdate:open": t[30] ||= (e) => Un.value = e,
|
|
2042
|
+
disabled: W.value,
|
|
2043
|
+
onInsert: Vi
|
|
2047
2044
|
}, null, 8, ["open", "disabled"])
|
|
2048
2045
|
], 38));
|
|
2049
2046
|
}
|