@guodun/antdv 1.7.13 → 1.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +4 -2
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +654 -639
- package/dist/es/components/pro-contract-template-designer/src/SigningLayoutCustomModal.vue.mjs +72 -59
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-layout-check.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-layout-presets.mjs +77 -61
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/contract-print-css/index.mjs +12 -5
- package/dist/es/index.mjs +12 -12
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.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/SigningLayoutCustomModal.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/contract-layout-check.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-layout-presets.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/contract-print-css/index.cjs +12 -5
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/signing-layout-presets.d.ts +9 -0
- package/package.json +1 -1
package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs
CHANGED
|
@@ -4,53 +4,53 @@ import { isContractTemplateFieldType as re } from "./types.mjs";
|
|
|
4
4
|
import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CHECKBOX_FIELD_TYPE as oe, DEFAULT_CUSTOM_FIELD_TYPES as se, DEFAULT_FIELD_STYLE as ce, DEFAULT_FIELD_TYPES as s, DEFAULT_IMAGE_FIELD_TYPE as le, DEFAULT_PAGE_SIZE as ue, buildTemplatePreviewPages as de, cloneTemplateValue as c, constrainTemplatePageSizes as fe, createBlankPage as pe, createBlankTemplate as me, createDefaultPage as he, createTemplateBodySync as ge, createTemplateVariable as _e, exportTemplateValue as ve, getFieldOption as ye, getPageSizeKey as be, normalizeContractTemplateMaxPages as xe, normalizePageSizeOptions as Se, normalizeTemplateValue as Ce, resolvePageSize as we, syncTemplateVariablesWithPages as Te, validateContractTemplateVariableKey as Ee, validateTemplateValue as De } from "./composables/use-template-designer.mjs";
|
|
5
5
|
import { isSafeContractImageUrl as Oe } from "./utils/image-url.mjs";
|
|
6
6
|
import { buildTemplateVariableData as ke } from "./utils/template-renderer.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { useFitWidthZoom as
|
|
9
|
-
import { normalizeContractImageDimension as
|
|
10
|
-
import { SIGNING_LAYOUT_PRESETS as
|
|
11
|
-
import { inferContextVariableLabel as
|
|
12
|
-
import { captureCaretViewport as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { resolveFieldTypeIcon as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useTemplateAuthoring as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { DEFAULT_DRAFT_CACHE_INTERVAL as
|
|
28
|
-
import { useAutoPagination as
|
|
29
|
-
import { resolveSetActiveFileIdOptions as
|
|
30
|
-
import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as
|
|
31
|
-
import { useDraftCacheSession as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
7
|
+
import { buildContractTemplateLayoutPages as Ae, createContractTemplateLayoutChecker as je, describeContractTemplateLayoutIssue as Me, isContractTemplateLayoutAbortError as Ne } from "./utils/contract-layout-check.mjs";
|
|
8
|
+
import { useFitWidthZoom as Pe } from "./composables/use-fit-width-zoom.mjs";
|
|
9
|
+
import { normalizeContractImageDimension as Fe, processContractImageFile as Ie } from "./utils/content-image.mjs";
|
|
10
|
+
import { SIGNING_LAYOUT_PRESETS as Le, SIGNING_LAYOUT_PRESET_KEYS as Re, isSigningLayoutPresetKey as ze } from "./utils/signing-layout-presets.mjs";
|
|
11
|
+
import { inferContextVariableLabel as Be, resolveContextVariableWidth as Ve } from "./utils/context-variable.mjs";
|
|
12
|
+
import { captureCaretViewport as He } from "./utils/caret-viewport.mjs";
|
|
13
|
+
import Ue from "./DesignerPage.mjs";
|
|
14
|
+
import We from "./TableContextMenu.mjs";
|
|
15
|
+
import Ge from "./ContractTemplateDesignerWorkspaceHeader.mjs";
|
|
16
|
+
import { resolveFieldTypeIcon as Ke } from "./utils/template-tool-icons.mjs";
|
|
17
|
+
import qe from "./ContractTemplateDesignerToolbar.mjs";
|
|
18
|
+
import Je from "./ContractTemplateAuthoringBar.mjs";
|
|
19
|
+
import { useTemplateAuthoring as Ye } from "./composables/use-template-authoring.mjs";
|
|
20
|
+
import Xe from "./ContractTemplateTextContextMenu.mjs";
|
|
21
|
+
import Ze from "./ContractTemplateTextBubbleMenu.mjs";
|
|
22
|
+
import Qe from "./ContractTemplateImageContextMenu.mjs";
|
|
23
|
+
import $e from "./ContractTemplatePreviewModal.mjs";
|
|
24
|
+
import et from "./ContractTemplateSubmitDataModal.mjs";
|
|
25
|
+
import tt from "./ContractTemplateVariableDataModal.mjs";
|
|
26
|
+
import nt from "./SigningLayoutCustomModal.mjs";
|
|
27
|
+
import { DEFAULT_DRAFT_CACHE_INTERVAL as rt, DEFAULT_DRAFT_CACHE_KEY as it, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as at, formatDraftCacheSavedAt as ot } from "./composables/use-template-draft-cache.mjs";
|
|
28
|
+
import { useAutoPagination as st } from "./composables/use-auto-pagination.mjs";
|
|
29
|
+
import { resolveSetActiveFileIdOptions as ct } from "./composables/use-designer-files.mjs";
|
|
30
|
+
import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as lt, createContractTemplateFile as ut, exportContractTemplateFiles as dt, moveContractTemplateFile as ft, normalizeContractTemplateFiles as pt, removeContractTemplateFile as mt, renameContractTemplateFile as ht, replaceContractTemplateFile as gt, resolveContractTemplateActiveFileId as _t } from "./composables/use-template-files.mjs";
|
|
31
|
+
import { useDraftCacheSession as vt } from "./composables/use-draft-cache-session.mjs";
|
|
32
|
+
import yt from "./ContractTemplateFileBar.mjs";
|
|
33
|
+
import bt from "./ContractTemplateDesignerSidebar.mjs";
|
|
34
|
+
import xt from "./ContractTemplateDesignerInspector.mjs";
|
|
35
|
+
import St from "./ContractTemplatePageDecorationsStudio.mjs";
|
|
36
36
|
import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
|
|
37
|
-
import { isSameEditorState as
|
|
38
|
-
import { clampContextMenuPosition as
|
|
39
|
-
import { Fragment as
|
|
40
|
-
import { Alert as
|
|
41
|
-
import { useElementSize as
|
|
42
|
-
import { CompressOutlined as
|
|
37
|
+
import { isSameEditorState as Ct } from "./utils/editor-state.mjs";
|
|
38
|
+
import { clampContextMenuPosition as wt, clampContextMenuToElement as Tt } from "./utils/context-menu-viewport.mjs";
|
|
39
|
+
import { Fragment as Et, Teleport as Dt, computed as f, createBlock as Ot, createCommentVNode as p, createElementBlock as kt, createElementVNode as m, createVNode as h, defineComponent as g, isRef as At, nextTick as _, normalizeClass as jt, normalizeStyle as Mt, onBeforeUnmount as Nt, onMounted as Pt, openBlock as v, ref as y, renderList as Ft, toDisplayString as It, toRaw as Lt, unref as b, useId as Rt, vShow as zt, watch as x, withCtx as Bt, withDirectives as Vt } from "vue";
|
|
40
|
+
import { Alert as Ht, Modal as Ut, Tooltip as Wt, message as Gt } from "ant-design-vue";
|
|
41
|
+
import { useElementSize as Kt } from "@vueuse/core";
|
|
42
|
+
import { CompressOutlined as qt, DownOutlined as Jt } from "@ant-design/icons-vue";
|
|
43
43
|
//#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
|
|
44
|
-
var
|
|
44
|
+
var Yt = {
|
|
45
45
|
key: 2,
|
|
46
46
|
class: "gd-contract-template-designer__validation"
|
|
47
|
-
},
|
|
47
|
+
}, Xt = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "gd-contract-template-designer__validation-list"
|
|
50
|
-
},
|
|
50
|
+
}, Zt = ["onClick"], Qt = {
|
|
51
51
|
class: "gd-contract-template-designer__sr-status",
|
|
52
52
|
"aria-live": "polite"
|
|
53
|
-
},
|
|
53
|
+
}, $t = .5, en = 1.5, tn = .1, nn = 300, rn = 500, an = 128, on = 108, sn = 48, cn = 24, ln = 10, un = 48, dn = 8, fn = 300, pn = "contract-template-layout-warning", mn = /* @__PURE__ */ g({
|
|
54
54
|
name: "ProContractTemplateDesigner",
|
|
55
55
|
__name: "ProContractTemplateDesigner",
|
|
56
56
|
props: {
|
|
@@ -117,8 +117,8 @@ var Jt = {
|
|
|
117
117
|
type: Boolean,
|
|
118
118
|
default: !0
|
|
119
119
|
},
|
|
120
|
-
draftCacheKey: { default:
|
|
121
|
-
draftCacheInterval: { default:
|
|
120
|
+
draftCacheKey: { default: it },
|
|
121
|
+
draftCacheInterval: { default: rt },
|
|
122
122
|
draftCacheMaxBytes: { default: l },
|
|
123
123
|
showDraftCacheStatus: {
|
|
124
124
|
type: Boolean,
|
|
@@ -142,61 +142,61 @@ var Jt = {
|
|
|
142
142
|
"image-error",
|
|
143
143
|
"layout-warning"
|
|
144
144
|
],
|
|
145
|
-
setup(s, { expose:
|
|
146
|
-
let l = s, g =
|
|
147
|
-
function gn() {
|
|
148
|
-
return hn.value;
|
|
149
|
-
}
|
|
145
|
+
setup(s, { expose: rt, emit: it }) {
|
|
146
|
+
let l = s, g = it, mn = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), hn = y(), gn = y();
|
|
150
147
|
function _n() {
|
|
151
|
-
|
|
152
|
-
return Ve(t, () => e === jn && !jr && !U.value && t?.isConnected !== !1);
|
|
148
|
+
return gn.value;
|
|
153
149
|
}
|
|
154
150
|
function vn() {
|
|
155
|
-
|
|
151
|
+
let e = Mn, t = gn.value;
|
|
152
|
+
return He(t, () => e === Mn && !Mr && !U.value && t?.isConnected !== !1);
|
|
153
|
+
}
|
|
154
|
+
function yn() {
|
|
155
|
+
Mn += 1;
|
|
156
156
|
}
|
|
157
|
-
let
|
|
158
|
-
S.value ? (C.value =
|
|
159
|
-
let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(),
|
|
157
|
+
let bn = y(), xn = y(), Sn = y(), Cn = `gd-contract-template-page-decorations-studio-${Rt()}`, wn = `gd-contract-template-workspace-chrome-${Rt()}`, Tn = y(), En = y(), Dn = y(), On = "", kn = "", An, jn, Mn = 0, Nn = ge(), Pn = /* @__PURE__ */ new Map(), Fn = y(!1), S = f(() => Fn.value || Array.isArray(l.files)), In = pt(l.files, l.modelValue, l.pageSize), Ln = lt(In, l.pageSizeOptions), Rn = S.value ? Ln.files : In, zn = _t(Rn, l.activeFileId), C = y(Rn), w = y(zn), Bn = Ce((Rn.find((e) => e.id === zn) ?? Rn[0])?.template ?? l.modelValue, l.pageSize), T = y(fe(Bn, l.pageSizeOptions));
|
|
158
|
+
S.value ? (C.value = gt(C.value, w.value, T.value), d(C.value) !== d(In) && X(C.value)) : l.modelValue && d(T.value) !== d(Bn) && oa(T.value);
|
|
159
|
+
let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(), Vn = y(!1), Hn = y(""), Un = y(!1), Wn = y(), Gn = y(), Kn = y(""), qn = y(!1), Jn = y(""), Yn = y(!1), Xn = y({
|
|
160
160
|
values: {},
|
|
161
161
|
variables: []
|
|
162
|
-
}), j = y(1), M = y(!1),
|
|
162
|
+
}), j = y(1), M = y(!1), Zn = y(!1), Qn = y(!1), N = y(!1), $n = y(!1), er = y(), P = y(!1), tr = y("header"), nr = y(!1), rr = y({}), ir = y(""), F = y(!1), I = y(!1), ar = y(!1), or = y(!1), sr = y(!1), cr = y(!1), lr = y(!1), ur = y(""), dr = y(), fr = y(), pr = y(""), mr = y(!1), L = y(), hr = y(), R = y(), gr = y(), _r = y(!1), vr, yr = y(!1), br, xr = y(!1), Sr = y(""), z = y(), Cr = y(), B = y(), wr = y(), Tr = y(), Er = y(), V = y(""), H = y(at("idle", "暂无本地草稿")), Dr = y({
|
|
163
163
|
rows: 3,
|
|
164
164
|
cols: 3,
|
|
165
165
|
withHeaderRow: !0
|
|
166
|
-
}),
|
|
166
|
+
}), Or = /* @__PURE__ */ new WeakSet(), kr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), Ar, jr, Mr = !1, Nr = !1, Pr, Fr, U = f(() => l.readonly || l.disabled), { panel: Ir, query: Lr, replacement: Rr, matchCase: zr, matches: Br, currentIndex: Vr, currentMatch: Hr, feedback: Ur, highlightQuery: Wr, open: Gr, close: Kr, navigate: qr, replaceCurrent: Jr, replaceAll: Yr, handleKeydown: Xr } = Ye({
|
|
167
167
|
pages: () => T.value.pages,
|
|
168
168
|
fileId: () => w.value,
|
|
169
169
|
readonly: () => U.value,
|
|
170
|
-
root: () =>
|
|
170
|
+
root: () => hn.value,
|
|
171
171
|
pageRefs: A,
|
|
172
172
|
activatePage: Go,
|
|
173
173
|
beforeOpen: () => {
|
|
174
|
-
$(),
|
|
174
|
+
$(), Bs(), N.value = !1;
|
|
175
175
|
},
|
|
176
|
-
focusPanel: () =>
|
|
177
|
-
focusTrigger: (e) =>
|
|
178
|
-
}),
|
|
176
|
+
focusPanel: () => Dn.value?.focusPanel(),
|
|
177
|
+
focusTrigger: (e) => Dn.value?.focusTrigger(e)
|
|
178
|
+
}), Zr = f(() => !!(L.value || Ir.value || z.value || B.value || F.value || I.value || nr.value || ar.value || or.value || sr.value || cr.value || lr.value)), Qr = f(() => !!l.enableDraftCache && !U.value), $r = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), ei = f(() => Wn.value ? de(Wn.value) : []), ti = f(() => (Gn.value ?? []).map((e) => ({
|
|
179
179
|
file: e,
|
|
180
180
|
pages: de(e.template)
|
|
181
|
-
}))),
|
|
181
|
+
}))), ni = f(() => ti.value.find((e) => e.file.id === Kn.value) ?? ti.value[0]), W = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), ri = f(() => we(W.value?.pageSize, T.value.pageSize)), ii = f(() => O.value && k.value.length === 0), ai = f(() => O.value ? ii.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), oi = f(() => {
|
|
182
182
|
let e = W.value?.title || "合同正文";
|
|
183
|
-
return `${S.value &&
|
|
184
|
-
}),
|
|
183
|
+
return `${S.value && $r.value ? `${$r.value.name} · ` : ""}${e} · ${ri.value.label} · 共 ${T.value.pages.length} 页`;
|
|
184
|
+
}), si = f(() => ({
|
|
185
185
|
none: "无装饰",
|
|
186
186
|
"page-number": "标准页码",
|
|
187
187
|
"internal-review": "内部审阅",
|
|
188
188
|
draft: "草稿",
|
|
189
189
|
custom: "自定义"
|
|
190
|
-
})[ee(T.value.pageDecorations)]),
|
|
190
|
+
})[ee(T.value.pageDecorations)]), ci = f(() => {
|
|
191
191
|
let e = o(T.value.pageDecorations);
|
|
192
192
|
return {
|
|
193
193
|
header: e.header.enabled,
|
|
194
194
|
footer: e.footer.enabled,
|
|
195
195
|
watermark: e.watermark.enabled
|
|
196
196
|
};
|
|
197
|
-
}),
|
|
197
|
+
}), li = f(() => Object.values(ci.value).filter(Boolean).length), ui = f(() => {
|
|
198
198
|
switch (H.value.type) {
|
|
199
|
-
case "saved": return `草稿已缓存 ${
|
|
199
|
+
case "saved": return `草稿已缓存 ${ot(H.value.savedAt)}`;
|
|
200
200
|
case "restored": return "已恢复本地草稿";
|
|
201
201
|
case "too-large": return "草稿过大,未缓存";
|
|
202
202
|
case "unavailable":
|
|
@@ -205,23 +205,23 @@ var Jt = {
|
|
|
205
205
|
case "cleared": return "草稿缓存已清理";
|
|
206
206
|
default: return "";
|
|
207
207
|
}
|
|
208
|
-
}),
|
|
208
|
+
}), di = f(() => ({
|
|
209
209
|
"is-success": H.value.type === "saved" || H.value.type === "restored",
|
|
210
210
|
"is-warning": H.value.type === "too-large",
|
|
211
211
|
"is-error": H.value.type === "unavailable" || H.value.type === "read-failed" || H.value.type === "write-failed"
|
|
212
|
-
})),
|
|
212
|
+
})), fi = f(() => `${Math.round(j.value * 100)}%`), pi = f(() => i(l.fontFamilies, l.fontFamilyMode)), mi = f(() => pi.value.map((e) => ({
|
|
213
213
|
label: e.label,
|
|
214
214
|
value: e.value
|
|
215
|
-
}))),
|
|
215
|
+
}))), hi = r, gi = [...e.map((e) => ({
|
|
216
216
|
label: e.label,
|
|
217
217
|
value: e.format
|
|
218
|
-
}))],
|
|
218
|
+
}))], _i = [{
|
|
219
219
|
label: "实线",
|
|
220
220
|
value: "solid"
|
|
221
221
|
}, {
|
|
222
222
|
label: "虚线",
|
|
223
223
|
value: "dashed"
|
|
224
|
-
}],
|
|
224
|
+
}], vi = [
|
|
225
225
|
{
|
|
226
226
|
label: "完整显示",
|
|
227
227
|
value: "contain"
|
|
@@ -234,10 +234,10 @@ var Jt = {
|
|
|
234
234
|
label: "拉伸填充",
|
|
235
235
|
value: "fill"
|
|
236
236
|
}
|
|
237
|
-
],
|
|
237
|
+
], yi = f(() => Se(l.pageSizeOptions)), bi = f(() => yi.value.map((e) => ({
|
|
238
238
|
label: `${e.label} · ${e.width} × ${e.height}`,
|
|
239
239
|
value: be(e)
|
|
240
|
-
}))),
|
|
240
|
+
}))), xi = f(() => be(ri.value)), Si = f(() => l.draftCacheKey), G = f(() => T.value.variables.find((e) => e.key === E.value)), Ci = f(() => {
|
|
241
241
|
let e = [
|
|
242
242
|
...l.variableTypes,
|
|
243
243
|
...l.showImageControl ? [le] : [],
|
|
@@ -247,23 +247,23 @@ var Jt = {
|
|
|
247
247
|
...l.showCustomControls ? se : []
|
|
248
248
|
].filter((e) => re(e?.type));
|
|
249
249
|
return Array.from(new Map(e.map((e) => [e.type, e])).values());
|
|
250
|
-
}),
|
|
251
|
-
let e = [...
|
|
250
|
+
}), wi = f(() => {
|
|
251
|
+
let e = [...Re.map((e) => Le[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
|
|
252
252
|
return Array.from(new Map(e.map((e) => [e.key, e])).values());
|
|
253
|
-
}),
|
|
253
|
+
}), Ti = f(() => Ci.value.map((e) => ({
|
|
254
254
|
...e,
|
|
255
|
-
icon:
|
|
255
|
+
icon: Ke(e.type),
|
|
256
256
|
group: e.type === "select" || e.type === "radio" ? "basic" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
|
|
257
|
-
}))),
|
|
258
|
-
let e =
|
|
257
|
+
}))), Ei = f(() => xe(l.maxPages)), Di = f(() => T.value.pages.length >= Ei.value), Oi = f(() => {
|
|
258
|
+
let e = Nn.collectKeys(T.value);
|
|
259
259
|
return Array.from(a(T.value.pageDecorations)).filter((t) => !e.has(t));
|
|
260
|
-
}), { scheduleAutoPaginate:
|
|
260
|
+
}), { scheduleAutoPaginate: ki, scheduleFullPagination: K, resetPagination: Ai, disposePagination: ji } = st({
|
|
261
261
|
templateValue: T,
|
|
262
262
|
readonlyState: U,
|
|
263
|
-
isAutoPaginating:
|
|
264
|
-
pendingPaginationPageId:
|
|
263
|
+
isAutoPaginating: Vn,
|
|
264
|
+
pendingPaginationPageId: Hn,
|
|
265
265
|
activePageId: D,
|
|
266
|
-
normalizedMaxPages:
|
|
266
|
+
normalizedMaxPages: Ei,
|
|
267
267
|
pageRefs: A,
|
|
268
268
|
applyPagesChange: (e) => {
|
|
269
269
|
T.value = {
|
|
@@ -273,35 +273,35 @@ var Jt = {
|
|
|
273
273
|
},
|
|
274
274
|
getPageSize: ya,
|
|
275
275
|
notifyPageLimit: xa,
|
|
276
|
-
captureViewport:
|
|
277
|
-
}), { saveDraftCache:
|
|
278
|
-
draftCacheWritable:
|
|
276
|
+
captureViewport: vn
|
|
277
|
+
}), { saveDraftCache: Mi, loadDraftCache: Ni, clearDraftCache: Pi, restoreDraftCacheIfNeeded: Fi, stopDraftCacheTimer: Ii, restartDraftCacheTimer: Li, resetDraftFingerprint: Ri } = vt({
|
|
278
|
+
draftCacheWritable: Qr,
|
|
279
279
|
multipleFilesMode: S,
|
|
280
280
|
filesValue: C,
|
|
281
281
|
activeFileIdValue: w,
|
|
282
282
|
templateValue: T,
|
|
283
|
-
draftCacheKey:
|
|
283
|
+
draftCacheKey: Si,
|
|
284
284
|
draftCacheInterval: () => l.draftCacheInterval,
|
|
285
285
|
draftCacheMaxBytes: () => l.draftCacheMaxBytes,
|
|
286
286
|
pageSize: () => l.pageSize,
|
|
287
287
|
pageSizeOptions: () => l.pageSizeOptions,
|
|
288
|
-
syncActiveFileSnapshot:
|
|
289
|
-
syncPageEditors: () => (na(),
|
|
288
|
+
syncActiveFileSnapshot: Y,
|
|
289
|
+
syncPageEditors: () => (na(), J()),
|
|
290
290
|
setActiveFileId: sa,
|
|
291
|
-
emitFilesChange:
|
|
292
|
-
commit:
|
|
291
|
+
emitFilesChange: X,
|
|
292
|
+
commit: Z,
|
|
293
293
|
updateDraftCacheStatus: ca,
|
|
294
294
|
scheduleFullPagination: K,
|
|
295
295
|
activePageId: D,
|
|
296
296
|
selectedVariableKey: E
|
|
297
|
-
}),
|
|
298
|
-
let e =
|
|
297
|
+
}), zi = f(() => {
|
|
298
|
+
let e = Sr.value.trim().toLowerCase(), t = T.value.variables;
|
|
299
299
|
return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
|
|
300
|
-
}),
|
|
300
|
+
}), Bi = f(() => Math.max(sn, ri.value.width - an)), Vi = f(() => Math.max(cn, ri.value.height - on)), q = f(() => rr.value[D.value] ?? Yi()), Hi = f(() => q.value.hasMixedBlockFormats ? void 0 : q.value.currentHeadingLevel ?? "paragraph"), Ui = f(() => q.value.fontFamily || t), Wi = f(() => q.value.fontSize ?? ce.fontSize ?? 14), Gi = f(() => q.value.textColor || ce.color || "#1f2937"), Ki = f(() => G.value?.style?.fontFamily || ce.fontFamily || t), qi = f(() => {
|
|
301
301
|
let e = n.map((e) => ({
|
|
302
302
|
label: `${e}px`,
|
|
303
303
|
value: e
|
|
304
|
-
})), t =
|
|
304
|
+
})), t = $i(Wi.value), r = $i(ir.value), i = /* @__PURE__ */ new Map();
|
|
305
305
|
return r && !n.includes(r) && i.set(r, {
|
|
306
306
|
label: `使用 ${r}px`,
|
|
307
307
|
value: r
|
|
@@ -312,89 +312,89 @@ var Jt = {
|
|
|
312
312
|
});
|
|
313
313
|
x(() => l.modelValue, (e, t) => {
|
|
314
314
|
if (!e || S.value) return;
|
|
315
|
-
if (e !== t &&
|
|
316
|
-
|
|
315
|
+
if (e !== t && jn && Lt(e) === Lt(jn)) {
|
|
316
|
+
kn = "";
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
if (d(e) ===
|
|
320
|
-
|
|
319
|
+
if (d(e) === kn) {
|
|
320
|
+
kn = "";
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
let n = Ce(e, l.pageSize), r = fe(n, l.pageSizeOptions), i = d(r) !== d(T.value), a = d(r) ===
|
|
324
|
-
a && (
|
|
323
|
+
let n = Ce(e, l.pageSize), r = fe(n, l.pageSizeOptions), i = d(r) !== d(T.value), a = d(r) === kn;
|
|
324
|
+
a && (kn = ""), (i || !a) && (kn = "", yn(), Ai(), Nn.clear(), ta(), T.value = r, C.value = gt(C.value, w.value, r), D.value = r.pages[0]?.id ?? "", E.value = "", K()), d(r) !== d(n) && oa(r);
|
|
325
325
|
}, { deep: !0 }), x(() => l.files, (e, t) => {
|
|
326
326
|
if (!Array.isArray(e)) return;
|
|
327
|
-
if (e !== t &&
|
|
328
|
-
|
|
327
|
+
if (e !== t && An && Lt(e) === Lt(An)) {
|
|
328
|
+
On = "";
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
|
-
if (d(e) ===
|
|
332
|
-
|
|
331
|
+
if (d(e) === On) {
|
|
332
|
+
On = "";
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
|
-
let n =
|
|
336
|
-
i ===
|
|
337
|
-
let o =
|
|
335
|
+
let n = pt(e, void 0, l.pageSize), r = lt(n, l.pageSizeOptions).files, i = d(r), a = d(C.value);
|
|
336
|
+
i === On && (On = "");
|
|
337
|
+
let o = _t(r, l.activeFileId || w.value);
|
|
338
338
|
i === a ? o !== w.value && sa(o, {
|
|
339
339
|
syncCurrent: !1,
|
|
340
340
|
shouldEmit: !1
|
|
341
|
-
}) : (
|
|
341
|
+
}) : (On = "", C.value = r, sa(o, {
|
|
342
342
|
syncCurrent: !1,
|
|
343
343
|
shouldEmit: !1,
|
|
344
344
|
forceRefresh: !0
|
|
345
|
-
})), i !== d(n) &&
|
|
345
|
+
})), i !== d(n) && X(r);
|
|
346
346
|
}, { deep: !0 }), x(() => l.activeFileId, (e) => {
|
|
347
347
|
!S.value || !e || e === w.value || sa(e, {
|
|
348
348
|
syncCurrent: !0,
|
|
349
349
|
shouldEmit: !1
|
|
350
350
|
});
|
|
351
351
|
});
|
|
352
|
-
function
|
|
352
|
+
function Ji(e, t) {
|
|
353
353
|
let n = d(C.value);
|
|
354
|
-
|
|
355
|
-
let { files: r } =
|
|
356
|
-
return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [],
|
|
354
|
+
Y(!1);
|
|
355
|
+
let { files: r } = lt(pt(C.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === w.value);
|
|
356
|
+
return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], X(r, "")), i;
|
|
357
357
|
}
|
|
358
358
|
x([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
|
|
359
359
|
if (S.value) {
|
|
360
|
-
|
|
360
|
+
Ji(e, t), K();
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
363
|
let n = fe(Ce(T.value, e), t);
|
|
364
|
-
d(n) !== d(T.value) &&
|
|
365
|
-
}, { deep: !0 }), x(
|
|
364
|
+
d(n) !== d(T.value) && Z(n), K();
|
|
365
|
+
}, { deep: !0 }), x(Ei, () => {
|
|
366
366
|
K();
|
|
367
367
|
}), x(U, (e) => {
|
|
368
368
|
e ? ($(), F.value = !1, I.value = !1) : K();
|
|
369
369
|
}), x(D, () => {
|
|
370
370
|
R.value = void 0;
|
|
371
371
|
}), x([
|
|
372
|
-
|
|
372
|
+
Zr,
|
|
373
373
|
P,
|
|
374
|
-
|
|
374
|
+
Un
|
|
375
375
|
], () => {
|
|
376
|
-
|
|
376
|
+
Us();
|
|
377
377
|
}), x(() => [
|
|
378
378
|
l.enableDraftCache,
|
|
379
|
-
|
|
379
|
+
Si.value,
|
|
380
380
|
l.draftCacheInterval,
|
|
381
381
|
U.value
|
|
382
382
|
], () => {
|
|
383
|
-
|
|
383
|
+
Ri(), Li();
|
|
384
384
|
}), x(M, (e) => {
|
|
385
385
|
if (!(typeof document > "u")) {
|
|
386
386
|
if (e) {
|
|
387
|
-
|
|
387
|
+
Ar = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
|
-
document.body.style.overflow =
|
|
390
|
+
document.body.style.overflow = Ar ?? "", Ar = void 0;
|
|
391
391
|
}
|
|
392
|
+
}), Pt(() => {
|
|
393
|
+
Fi(), Li(), K(), document.fonts?.ready.then(K), document.fonts?.addEventListener("loadingdone", K), window.addEventListener("pointerdown", Zs, !0), window.addEventListener("pointerup", Js), window.addEventListener("keydown", ec, !0), window.addEventListener("keydown", tc), window.addEventListener("resize", Ys), window.addEventListener("scroll", Qs, !0);
|
|
392
394
|
}), Nt(() => {
|
|
393
|
-
|
|
394
|
-
}), Mt(() => {
|
|
395
|
-
vn(), Ai(), na(), jr = !0, us !== void 0 && clearTimeout(us), Q?.abort(), ls.dispose(), M.value && typeof document < "u" && (document.body.style.overflow = kr ?? ""), document.fonts?.removeEventListener("loadingdone", K), window.removeEventListener("pointerdown", Xs, !0), window.removeEventListener("pointerup", qs), window.removeEventListener("keydown", $s, !0), window.removeEventListener("keydown", ec), window.removeEventListener("resize", Js), window.removeEventListener("scroll", Zs, !0), yr !== void 0 && cancelAnimationFrame(yr), Fi();
|
|
395
|
+
yn(), ji(), na(), Mr = !0, us !== void 0 && clearTimeout(us), ds?.abort(), ls.dispose(), M.value && typeof document < "u" && (document.body.style.overflow = Ar ?? ""), document.fonts?.removeEventListener("loadingdone", K), window.removeEventListener("pointerdown", Zs, !0), window.removeEventListener("pointerup", Js), window.removeEventListener("keydown", ec, !0), window.removeEventListener("keydown", tc), window.removeEventListener("resize", Ys), window.removeEventListener("scroll", Qs, !0), br !== void 0 && cancelAnimationFrame(br), Ii();
|
|
396
396
|
});
|
|
397
|
-
function
|
|
397
|
+
function Yi() {
|
|
398
398
|
return {
|
|
399
399
|
isFocused: !1,
|
|
400
400
|
canUndo: !1,
|
|
@@ -413,26 +413,26 @@ var Jt = {
|
|
|
413
413
|
hasMixedBlockFormats: !1
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Xi(e) {
|
|
417
417
|
return e === "left" || e === "center" || e === "right";
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Zi(e) {
|
|
420
420
|
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function Qi(e, t = Wi.value) {
|
|
423
423
|
let n = Number(e);
|
|
424
|
-
return Number.isFinite(n) ? Math.min(
|
|
424
|
+
return Number.isFinite(n) ? Math.min(un, Math.max(ln, Math.round(n))) : t;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function $i(e) {
|
|
427
427
|
let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
|
|
428
428
|
if (!t) return;
|
|
429
429
|
let n = Number(t[1]);
|
|
430
|
-
if (Number.isFinite(n)) return Math.min(
|
|
430
|
+
if (Number.isFinite(n)) return Math.min(un, Math.max(ln, Math.round(n)));
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function J(e = T.value) {
|
|
433
433
|
let t = !1, n = e.pages.map((e) => {
|
|
434
434
|
let n = A.get(e.id)?.getContentSnapshot(e), r = n?.contentHtml ?? e.contentHtml, i = n?.contentJson ?? e.contentJson;
|
|
435
|
-
return r === e.contentHtml &&
|
|
435
|
+
return r === e.contentHtml && Lt(i) === Lt(e.contentJson) ? e : (t = !0, {
|
|
436
436
|
...e,
|
|
437
437
|
contentHtml: r,
|
|
438
438
|
contentJson: i
|
|
@@ -444,26 +444,26 @@ var Jt = {
|
|
|
444
444
|
} : e;
|
|
445
445
|
}
|
|
446
446
|
function ea() {
|
|
447
|
-
|
|
447
|
+
Pr !== void 0 && (clearTimeout(Pr), Pr = void 0), Fr !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(Fr), Fr = void 0;
|
|
448
448
|
}
|
|
449
449
|
function ta() {
|
|
450
|
-
|
|
450
|
+
Nr = !1, ea();
|
|
451
451
|
}
|
|
452
452
|
function na() {
|
|
453
|
-
let e =
|
|
453
|
+
let e = Nr;
|
|
454
454
|
ta(), e && aa();
|
|
455
455
|
}
|
|
456
456
|
function ra() {
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
Nr = !0, ea(), Pr = setTimeout(() => {
|
|
458
|
+
Pr = void 0;
|
|
459
459
|
let e = () => {
|
|
460
|
-
if (
|
|
461
|
-
if (
|
|
462
|
-
|
|
460
|
+
if (Fr = void 0, !(!Nr || Mr)) {
|
|
461
|
+
if (Vn.value) return ra();
|
|
462
|
+
Nr = !1, aa();
|
|
463
463
|
}
|
|
464
464
|
};
|
|
465
|
-
typeof requestIdleCallback == "function" ?
|
|
466
|
-
},
|
|
465
|
+
typeof requestIdleCallback == "function" ? Fr = requestIdleCallback(e, { timeout: rn }) : e();
|
|
466
|
+
}, nn);
|
|
467
467
|
}
|
|
468
468
|
function ia(e) {
|
|
469
469
|
let t = T.value.pages, n = t.findIndex((t) => t.id === e.id);
|
|
@@ -477,39 +477,39 @@ var Jt = {
|
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
479
|
function aa() {
|
|
480
|
-
let e =
|
|
481
|
-
E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""),
|
|
480
|
+
let e = J(), t = Nn.sync(e);
|
|
481
|
+
E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), Z(t, { normalizedBody: !0 });
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Y(e = !1) {
|
|
484
484
|
na();
|
|
485
|
-
let t = c(
|
|
485
|
+
let t = c(J());
|
|
486
486
|
if (!S.value) return t;
|
|
487
|
-
let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i =
|
|
488
|
-
return C.value = i, r && e &&
|
|
487
|
+
let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i = gt(C.value, w.value, t);
|
|
488
|
+
return C.value = i, r && e && X(i), t;
|
|
489
489
|
}
|
|
490
490
|
function oa(e) {
|
|
491
491
|
let t = c(e);
|
|
492
|
-
|
|
492
|
+
jn = t, kn = d(e), g("update:modelValue", t), g("change", c(e));
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function X(e, t = w.value) {
|
|
495
495
|
if (!S.value) return;
|
|
496
496
|
let n = u(e), r = u(n);
|
|
497
|
-
C.value = n,
|
|
497
|
+
C.value = n, An = r, On = d(r), g("update:files", r), g("files-change", u(r));
|
|
498
498
|
let i = r.find((e) => e.id === t);
|
|
499
499
|
i && g("file-change", u([i])[0]);
|
|
500
500
|
}
|
|
501
501
|
function sa(e, t = {}) {
|
|
502
|
-
let { syncCurrent: n, shouldEmit: r, forceRefresh: i } =
|
|
503
|
-
if ((o || i) && C.value.some((e) => e.id === a) && (
|
|
502
|
+
let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = ct(t), a = _t(C.value, e), o = a !== w.value;
|
|
503
|
+
if ((o || i) && C.value.some((e) => e.id === a) && (yn(), Ai()), n ? Y(!0) : ta(), !o && !i) return;
|
|
504
504
|
let ee = C.value.find((e) => e.id === a);
|
|
505
|
-
ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "",
|
|
505
|
+
ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", rr.value = {}, A.clear(), Nn.clear(), Pn.clear(), O.value = !1, k.value = [], Un.value = !1, Wn.value = void 0, Gn.value = void 0, Ri(), r && o && g("update:activeFileId", a), n && o && Qr.value && Mi(), _(() => {
|
|
506
506
|
K();
|
|
507
507
|
}));
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Z(e, t = {}) {
|
|
510
510
|
ta();
|
|
511
511
|
let n = t.normalizedBody ? e : fe(Ce(e, l.pageSize), l.pageSizeOptions);
|
|
512
|
-
return t.normalizedBody || (
|
|
512
|
+
return t.normalizedBody || (Nn.clear(), Pn.clear()), T.value = n, O.value = !1, k.value = [], S.value ? X(gt(C.value, w.value, n)) : (C.value = gt(C.value, w.value, n), oa(n)), n;
|
|
513
513
|
}
|
|
514
514
|
function ca(e, t = e.type !== "unchanged") {
|
|
515
515
|
H.value = e, t && g("draft-cache-change", { ...e });
|
|
@@ -521,80 +521,84 @@ var Jt = {
|
|
|
521
521
|
t ? A.set(e, t) : A.delete(e);
|
|
522
522
|
}
|
|
523
523
|
function da(e) {
|
|
524
|
-
|
|
524
|
+
if (U.value) return;
|
|
525
|
+
let t = W.value?.id ?? D.value;
|
|
526
|
+
$(), sr.value = !1, Q({
|
|
525
527
|
type: "insert-signing-layout",
|
|
526
|
-
preset:
|
|
528
|
+
preset: ze(e.key) ? e.key : void 0,
|
|
527
529
|
options: e.options
|
|
528
|
-
});
|
|
530
|
+
}), ms(t);
|
|
529
531
|
}
|
|
530
532
|
function fa(e) {
|
|
531
|
-
|
|
533
|
+
if (U.value) return;
|
|
534
|
+
let t = W.value?.id ?? D.value;
|
|
535
|
+
$(), Q({
|
|
532
536
|
type: "insert-signing-layout",
|
|
533
537
|
options: e
|
|
534
|
-
});
|
|
538
|
+
}, t), ms(t);
|
|
535
539
|
}
|
|
536
540
|
function pa() {
|
|
537
|
-
|
|
541
|
+
sr.value = !1, lr.value = !0;
|
|
538
542
|
}
|
|
539
543
|
function ma(e) {
|
|
540
|
-
$(),
|
|
544
|
+
$(), cr.value = !1, Q({
|
|
541
545
|
type: "insert-signing-mark",
|
|
542
546
|
mark: { markType: e }
|
|
543
547
|
});
|
|
544
548
|
}
|
|
545
|
-
function
|
|
549
|
+
function Q(e, t = W.value?.id ?? D.value) {
|
|
546
550
|
U.value || A.get(t)?.runCommand(e);
|
|
547
551
|
}
|
|
548
552
|
function ha(e) {
|
|
549
|
-
|
|
553
|
+
Q(e), $();
|
|
550
554
|
}
|
|
551
555
|
function ga(e) {
|
|
552
556
|
let t = L.value?.pageId;
|
|
553
557
|
t && (A.get(t)?.focus(), V.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
|
|
554
558
|
}
|
|
555
559
|
function _a(e) {
|
|
556
|
-
let t =
|
|
560
|
+
let t = Z(Te(e));
|
|
557
561
|
return E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), t;
|
|
558
562
|
}
|
|
559
563
|
function va(e) {
|
|
560
|
-
ia(e), ra(),
|
|
564
|
+
ia(e), ra(), ki(e.id);
|
|
561
565
|
}
|
|
562
566
|
function ya(e) {
|
|
563
567
|
let t = we(e?.pageSize, T.value.pageSize), n = `${be(t)}:${t.label ?? ""}`;
|
|
564
|
-
return
|
|
568
|
+
return Pn.get(n) || (Pn.set(n, t), t);
|
|
565
569
|
}
|
|
566
570
|
function ba(e) {
|
|
567
571
|
if (U.value || !W.value) return;
|
|
568
|
-
let t =
|
|
572
|
+
let t = yi.value.find((t) => be(t) === e);
|
|
569
573
|
if (!t) return;
|
|
570
574
|
let n = W.value.id, r = we(t, T.value.pageSize);
|
|
571
|
-
|
|
575
|
+
Z({
|
|
572
576
|
...T.value,
|
|
573
577
|
pages: T.value.pages.map((e) => e.id === n ? {
|
|
574
578
|
...e,
|
|
575
579
|
pageSize: r
|
|
576
580
|
} : e)
|
|
577
|
-
}),
|
|
581
|
+
}), ki(n);
|
|
578
582
|
}
|
|
579
583
|
function xa(e) {
|
|
580
|
-
let t =
|
|
584
|
+
let t = Ei.value;
|
|
581
585
|
V.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
|
|
582
586
|
}
|
|
583
587
|
function Sa() {
|
|
584
588
|
if (U.value) return;
|
|
585
|
-
if (
|
|
589
|
+
if (Di.value) {
|
|
586
590
|
xa("add");
|
|
587
591
|
return;
|
|
588
592
|
}
|
|
589
|
-
let e = he(T.value.pages.length + 1,
|
|
590
|
-
|
|
593
|
+
let e = he(T.value.pages.length + 1, ri.value);
|
|
594
|
+
Z({
|
|
591
595
|
...T.value,
|
|
592
596
|
pages: [...T.value.pages, e]
|
|
593
597
|
}), D.value = e.id, K();
|
|
594
598
|
}
|
|
595
599
|
function Ca(e) {
|
|
596
600
|
if (U.value) return;
|
|
597
|
-
if (
|
|
601
|
+
if (Di.value) {
|
|
598
602
|
xa("duplicate");
|
|
599
603
|
return;
|
|
600
604
|
}
|
|
@@ -607,7 +611,7 @@ var Jt = {
|
|
|
607
611
|
}).pages[0], r = pe(t + 2, ya(e), n.contentHtml, n.contentJson);
|
|
608
612
|
r.title = `${e.title || `第 ${t + 1} 页`}副本`;
|
|
609
613
|
let i = [...T.value.pages];
|
|
610
|
-
i.splice(t + 1, 0, r),
|
|
614
|
+
i.splice(t + 1, 0, r), Z({
|
|
611
615
|
...T.value,
|
|
612
616
|
pages: i
|
|
613
617
|
}), D.value = r.id, K();
|
|
@@ -623,7 +627,7 @@ var Jt = {
|
|
|
623
627
|
D.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "", K();
|
|
624
628
|
}
|
|
625
629
|
function Ta(e) {
|
|
626
|
-
U.value || T.value.pages.length <= 1 ||
|
|
630
|
+
U.value || T.value.pages.length <= 1 || Ut.confirm({
|
|
627
631
|
title: "删除合同页面",
|
|
628
632
|
content: "删除页面会同时移除页面正文,是否继续?",
|
|
629
633
|
okText: "确认删除",
|
|
@@ -645,20 +649,20 @@ var Jt = {
|
|
|
645
649
|
...e,
|
|
646
650
|
type: t,
|
|
647
651
|
key: e.key || Ea(t),
|
|
648
|
-
label: e.label || ye(t,
|
|
649
|
-
},
|
|
652
|
+
label: e.label || ye(t, Ci.value).label
|
|
653
|
+
}, Ci.value, l.defaultVariableStyle);
|
|
650
654
|
}
|
|
651
655
|
function Oa(e, t = W.value?.id ?? T.value.pages[0].id, n) {
|
|
652
656
|
if (U.value) return e;
|
|
653
657
|
let r = A.get(t)?.insertVariable(e, n), i = !T.value.variables.some((t) => t.key === e.key);
|
|
654
|
-
return
|
|
658
|
+
return Z({
|
|
655
659
|
...T.value,
|
|
656
660
|
pages: r ? T.value.pages.map((e) => e.id === r.id ? r : e) : T.value.pages,
|
|
657
661
|
variables: i ? [...T.value.variables, e] : T.value.variables
|
|
658
|
-
}), E.value = e.key, D.value = t, i && g("variable-add", e),
|
|
662
|
+
}), E.value = e.key, D.value = t, i && g("variable-add", e), ki(t), e;
|
|
659
663
|
}
|
|
660
664
|
function ka(e) {
|
|
661
|
-
let { width: t, height: n, ...r } = e, i =
|
|
665
|
+
let { width: t, height: n, ...r } = e, i = Fe(t), a = Fe(n);
|
|
662
666
|
return {
|
|
663
667
|
...r,
|
|
664
668
|
...i === void 0 ? {} : { width: i },
|
|
@@ -666,7 +670,7 @@ var Jt = {
|
|
|
666
670
|
};
|
|
667
671
|
}
|
|
668
672
|
function Aa(e = {}) {
|
|
669
|
-
let t =
|
|
673
|
+
let t = Fe(dr.value), n = Fe(fr.value);
|
|
670
674
|
return {
|
|
671
675
|
...e,
|
|
672
676
|
...t === void 0 ? {} : { width: t },
|
|
@@ -674,7 +678,7 @@ var Jt = {
|
|
|
674
678
|
};
|
|
675
679
|
}
|
|
676
680
|
function ja() {
|
|
677
|
-
|
|
681
|
+
ur.value = "", dr.value = void 0, fr.value = void 0, pr.value = "";
|
|
678
682
|
}
|
|
679
683
|
function Ma(e, t = W.value?.id ?? T.value.pages[0]?.id, n) {
|
|
680
684
|
let r = ka({
|
|
@@ -687,20 +691,20 @@ var Jt = {
|
|
|
687
691
|
return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
|
|
688
692
|
}
|
|
689
693
|
async function Pa(e, t) {
|
|
690
|
-
t === "toolbar" && (
|
|
694
|
+
t === "toolbar" && (mr.value = !0, pr.value = "");
|
|
691
695
|
try {
|
|
692
|
-
let n = await
|
|
696
|
+
let n = await Ie(e, {
|
|
693
697
|
source: t,
|
|
694
698
|
compression: l.imageCompression,
|
|
695
699
|
upload: l.imageUpload
|
|
696
700
|
});
|
|
697
|
-
return
|
|
701
|
+
return Mr ? void 0 : n.src;
|
|
698
702
|
} catch (e) {
|
|
699
703
|
let n = Na(e);
|
|
700
|
-
t === "toolbar" && (
|
|
704
|
+
t === "toolbar" && (pr.value = n.message), V.value = n.message, g("image-error", n, t);
|
|
701
705
|
return;
|
|
702
706
|
} finally {
|
|
703
|
-
t === "toolbar" && (
|
|
707
|
+
t === "toolbar" && (mr.value = !1);
|
|
704
708
|
}
|
|
705
709
|
}
|
|
706
710
|
let Fa = 0;
|
|
@@ -708,7 +712,7 @@ var Jt = {
|
|
|
708
712
|
let t = e.replacedFontFamilies.filter(Boolean);
|
|
709
713
|
if (!t.length) return;
|
|
710
714
|
let n = Date.now();
|
|
711
|
-
n - Fa < 800 || (Fa = n,
|
|
715
|
+
n - Fa < 800 || (Fa = n, Gt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
|
|
712
716
|
}
|
|
713
717
|
async function La(e) {
|
|
714
718
|
return await Pa(e, "paste") ?? null;
|
|
@@ -716,9 +720,9 @@ var Jt = {
|
|
|
716
720
|
async function Ra(e, t = {}) {
|
|
717
721
|
if (U.value) return;
|
|
718
722
|
let n = W.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Pa(e, "toolbar");
|
|
719
|
-
if (
|
|
723
|
+
if (Mr) return;
|
|
720
724
|
if (!i || !Oe(i)) {
|
|
721
|
-
typeof e == "string" && (
|
|
725
|
+
typeof e == "string" && (pr.value = "请输入安全的图片 URL");
|
|
722
726
|
return;
|
|
723
727
|
}
|
|
724
728
|
if (n && !A.has(n)) return;
|
|
@@ -726,21 +730,21 @@ var Jt = {
|
|
|
726
730
|
...t,
|
|
727
731
|
src: i
|
|
728
732
|
}, n, r);
|
|
729
|
-
return a && (
|
|
733
|
+
return a && (or.value = !1, ja(), V.value = "已插入图片"), a;
|
|
730
734
|
}
|
|
731
735
|
function za() {
|
|
732
|
-
U.value ||
|
|
736
|
+
U.value || mr.value || ($(), pr.value = "", En.value && (En.value.value = ""), En.value?.click());
|
|
733
737
|
}
|
|
734
738
|
async function Ba(e) {
|
|
735
739
|
let t = e.target.files?.[0];
|
|
736
740
|
t && await Ra(t, Aa({ alt: t.name }));
|
|
737
741
|
}
|
|
738
742
|
async function Va() {
|
|
739
|
-
let e =
|
|
743
|
+
let e = ur.value;
|
|
740
744
|
await Ra(e, Aa());
|
|
741
745
|
}
|
|
742
746
|
function Ha(e) {
|
|
743
|
-
co(e),
|
|
747
|
+
co(e), ar.value = !1;
|
|
744
748
|
}
|
|
745
749
|
function Ua() {
|
|
746
750
|
$(), Sa();
|
|
@@ -776,7 +780,7 @@ var Jt = {
|
|
|
776
780
|
let e = r.findIndex((e) => e.id === n);
|
|
777
781
|
e >= 0 && (r[e] = a);
|
|
778
782
|
}
|
|
779
|
-
}),
|
|
783
|
+
}), Z({
|
|
780
784
|
...T.value,
|
|
781
785
|
pages: r,
|
|
782
786
|
variables: T.value.variables.map((t) => t.id === e.id ? e : t),
|
|
@@ -797,7 +801,7 @@ var Jt = {
|
|
|
797
801
|
U.value || !G.value || qa({ key: e });
|
|
798
802
|
}
|
|
799
803
|
function Ya(e) {
|
|
800
|
-
U.value || (
|
|
804
|
+
U.value || (Z({
|
|
801
805
|
...T.value,
|
|
802
806
|
pageDecorations: o(e)
|
|
803
807
|
}), K());
|
|
@@ -818,7 +822,7 @@ var Jt = {
|
|
|
818
822
|
$a({ fontFamily: String(e || "").trim() || t });
|
|
819
823
|
}
|
|
820
824
|
function to(e) {
|
|
821
|
-
$a({ fontSize:
|
|
825
|
+
$a({ fontSize: Qi(e, G.value?.style?.fontSize ?? 14) });
|
|
822
826
|
}
|
|
823
827
|
function no(e) {
|
|
824
828
|
G.value && qa({
|
|
@@ -842,7 +846,7 @@ var Jt = {
|
|
|
842
846
|
let e = t.findIndex((e) => e.id === r);
|
|
843
847
|
e >= 0 && (t[e] = i);
|
|
844
848
|
}
|
|
845
|
-
}),
|
|
849
|
+
}), Z({
|
|
846
850
|
...T.value,
|
|
847
851
|
pages: t,
|
|
848
852
|
variables: T.value.variables.filter((t) => t.id !== e.id),
|
|
@@ -863,19 +867,19 @@ var Jt = {
|
|
|
863
867
|
key: ao(`${e.key || e.type}_copy`),
|
|
864
868
|
label: `${e.label}副本`,
|
|
865
869
|
style: { ...e.style }
|
|
866
|
-
},
|
|
870
|
+
}, Ci.value, l.defaultVariableStyle));
|
|
867
871
|
}
|
|
868
872
|
function so(e) {
|
|
869
|
-
return U.value ? void 0 : Oa(T.value.variables.find((t) => t.key === e.key) ?? _e(e,
|
|
873
|
+
return U.value ? void 0 : Oa(T.value.variables.find((t) => t.key === e.key) ?? _e(e, Ci.value, l.defaultVariableStyle));
|
|
870
874
|
}
|
|
871
875
|
function co(e) {
|
|
872
876
|
if (!U.value) return Oa(Da({ type: e }));
|
|
873
877
|
}
|
|
874
878
|
function lo(e) {
|
|
875
879
|
if (U.value || !re(e)) return;
|
|
876
|
-
let t = L.value, n =
|
|
880
|
+
let t = L.value, n = Ci.value.find((t) => t.type === e);
|
|
877
881
|
if (!t || !n) return;
|
|
878
|
-
let r =
|
|
882
|
+
let r = Be(t.leadingText) || n.label, i = Ve(t.selectionWidth, sn, Bi.value), a = uo();
|
|
879
883
|
Oa(Da({
|
|
880
884
|
type: e,
|
|
881
885
|
label: r,
|
|
@@ -893,25 +897,25 @@ var Jt = {
|
|
|
893
897
|
t && (Oa(e, t.pageId), V.value = `已绑定到${e.label},沿用原控件尺寸`, $());
|
|
894
898
|
}
|
|
895
899
|
function po(e) {
|
|
896
|
-
return ye(e.type && re(e.type) ? e.type : "text",
|
|
900
|
+
return ye(e.type && re(e.type) ? e.type : "text", Ci.value).label;
|
|
897
901
|
}
|
|
898
902
|
function mo() {
|
|
899
|
-
T.value.variables.length && (
|
|
900
|
-
|
|
903
|
+
T.value.variables.length && (xr.value = !0, _(() => {
|
|
904
|
+
Ns(), hr.value?.focusBindSearch();
|
|
901
905
|
}));
|
|
902
906
|
}
|
|
903
907
|
function ho(e, t) {
|
|
904
908
|
e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
905
909
|
}
|
|
906
910
|
function go(e) {
|
|
907
|
-
return j.value = Math.round(Math.min(
|
|
911
|
+
return j.value = Math.round(Math.min(en, Math.max($t, Number.isFinite(e) ? e : 1)) * 100) / 100, j.value;
|
|
908
912
|
}
|
|
909
|
-
let { width: _o } =
|
|
913
|
+
let { width: _o } = Kt(gn), { fitWidth: vo, applyAutoFit: yo, markUserAdjusted: bo, userAdjusted: xo } = Pe({
|
|
910
914
|
viewportWidth: _o,
|
|
911
915
|
widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => ya(e).width), ue.width) + 10),
|
|
912
916
|
padding: 48,
|
|
913
|
-
minZoom:
|
|
914
|
-
maxZoom:
|
|
917
|
+
minZoom: $t,
|
|
918
|
+
maxZoom: en,
|
|
915
919
|
getZoom: () => j.value,
|
|
916
920
|
applyZoom: go
|
|
917
921
|
});
|
|
@@ -925,79 +929,79 @@ var Jt = {
|
|
|
925
929
|
return j.value;
|
|
926
930
|
}
|
|
927
931
|
function To() {
|
|
928
|
-
So(j.value +
|
|
932
|
+
So(j.value + tn);
|
|
929
933
|
}
|
|
930
934
|
function Eo() {
|
|
931
|
-
So(j.value -
|
|
935
|
+
So(j.value - tn);
|
|
932
936
|
}
|
|
933
937
|
function Do() {
|
|
934
|
-
$(),
|
|
938
|
+
$(), Bs(), M.value = !M.value;
|
|
935
939
|
}
|
|
936
940
|
x(_o, (e) => {
|
|
937
|
-
|
|
941
|
+
$n.value && !xo.value && e > 0 && vo();
|
|
938
942
|
});
|
|
939
943
|
function Oo(e) {
|
|
940
|
-
N.value ?
|
|
944
|
+
N.value ? Tn.value?.focus() : e();
|
|
941
945
|
}
|
|
942
946
|
function ko() {
|
|
943
|
-
$(),
|
|
947
|
+
$(), Bs(), P.value = !1, jr = {
|
|
944
948
|
fullscreen: M.value,
|
|
945
|
-
sidebar:
|
|
946
|
-
inspector:
|
|
949
|
+
sidebar: Zn.value,
|
|
950
|
+
inspector: Qn.value,
|
|
947
951
|
chrome: N.value,
|
|
948
952
|
zoom: j.value,
|
|
949
953
|
userAdjusted: xo.value
|
|
950
|
-
}, M.value = !0,
|
|
951
|
-
U.value ?
|
|
954
|
+
}, M.value = !0, Zn.value = !0, Qn.value = !0, N.value = !0, $n.value = !0, _(() => {
|
|
955
|
+
U.value ? er.value?.focus() : A.get(D.value)?.focus();
|
|
952
956
|
});
|
|
953
957
|
}
|
|
954
958
|
function Ao() {
|
|
955
|
-
let e =
|
|
956
|
-
|
|
959
|
+
let e = jr;
|
|
960
|
+
$n.value = !1, jr = void 0, e && (M.value = e.fullscreen, Zn.value = e.sidebar, Qn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? So(e.zoom) : yo(), _(() => Oo(() => xn.value?.focusImmersive())));
|
|
957
961
|
}
|
|
958
962
|
function jo() {
|
|
959
|
-
|
|
963
|
+
$n.value ? Ao() : ko();
|
|
960
964
|
}
|
|
961
965
|
function Mo() {
|
|
962
966
|
$(), R.value = void 0;
|
|
963
|
-
let e =
|
|
964
|
-
S.value ? (
|
|
967
|
+
let e = Y(!1);
|
|
968
|
+
S.value ? (Gn.value = u(C.value), Wn.value = void 0, Kn.value = w.value || C.value[0]?.id || "") : (Wn.value = c(e), Gn.value = void 0, Kn.value = ""), Un.value = !0;
|
|
965
969
|
}
|
|
966
970
|
function No() {
|
|
967
|
-
|
|
971
|
+
Un.value = !1, Wn.value = void 0, Gn.value = void 0, Kn.value = "";
|
|
968
972
|
}
|
|
969
973
|
function Po() {
|
|
970
|
-
return
|
|
974
|
+
return gs();
|
|
971
975
|
}
|
|
972
976
|
function Fo() {
|
|
973
977
|
$();
|
|
974
978
|
let e = Po();
|
|
975
|
-
return
|
|
979
|
+
return Jn.value = JSON.stringify(e, null, 2), qn.value = !0, e;
|
|
976
980
|
}
|
|
977
981
|
function Io() {
|
|
978
|
-
|
|
982
|
+
qn.value = !1;
|
|
979
983
|
}
|
|
980
984
|
function Lo() {
|
|
981
|
-
return ke(
|
|
985
|
+
return ke(Y(!1));
|
|
982
986
|
}
|
|
983
987
|
function Ro() {
|
|
984
988
|
$();
|
|
985
989
|
let e = Lo();
|
|
986
|
-
return
|
|
990
|
+
return Xn.value = e, Yn.value = !0, e;
|
|
987
991
|
}
|
|
988
992
|
function zo() {
|
|
989
|
-
|
|
993
|
+
Yn.value = !1;
|
|
990
994
|
}
|
|
991
995
|
function Bo() {
|
|
992
|
-
$(), R.value = void 0, F.value = !1, I.value = !1, E.value = "", D.value = "",
|
|
996
|
+
$(), R.value = void 0, F.value = !1, I.value = !1, E.value = "", D.value = "", Un.value = !1, Wn.value = void 0, Gn.value = void 0, qn.value = !1, Jn.value = "", Yn.value = !1, Xn.value = {
|
|
993
997
|
values: {},
|
|
994
998
|
variables: []
|
|
995
|
-
},
|
|
996
|
-
let e =
|
|
999
|
+
}, rr.value = {}, yn(), Ai();
|
|
1000
|
+
let e = Z(me(ue));
|
|
997
1001
|
return D.value = e.pages[0]?.id ?? "", c(e);
|
|
998
1002
|
}
|
|
999
1003
|
function Vo() {
|
|
1000
|
-
U.value || ($(),
|
|
1004
|
+
U.value || ($(), Ut.confirm({
|
|
1001
1005
|
title: "清空合同内容",
|
|
1002
1006
|
content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
|
|
1003
1007
|
okText: "确认清空",
|
|
@@ -1009,7 +1013,7 @@ var Jt = {
|
|
|
1009
1013
|
}));
|
|
1010
1014
|
}
|
|
1011
1015
|
function Ho(e) {
|
|
1012
|
-
let t =
|
|
1016
|
+
let t = J().pages, n = t.find((e) => e.id === D.value);
|
|
1013
1017
|
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}'`));
|
|
1014
1018
|
}
|
|
1015
1019
|
function Uo(e) {
|
|
@@ -1042,52 +1046,52 @@ var Jt = {
|
|
|
1042
1046
|
P.value = !0;
|
|
1043
1047
|
}
|
|
1044
1048
|
function Yo() {
|
|
1045
|
-
P.value = !1, _(() => Oo(() =>
|
|
1049
|
+
P.value = !1, _(() => Oo(() => xn.value?.focusPageDecorations()));
|
|
1046
1050
|
}
|
|
1047
1051
|
function Xo() {
|
|
1048
|
-
return na(), c(
|
|
1052
|
+
return na(), c(J());
|
|
1049
1053
|
}
|
|
1050
1054
|
function Zo(e) {
|
|
1051
|
-
|
|
1055
|
+
yn(), Ai(), Z(e), K();
|
|
1052
1056
|
}
|
|
1053
1057
|
function Qo() {
|
|
1054
|
-
let e =
|
|
1055
|
-
return S.value ? u(C.value) : u(
|
|
1058
|
+
let e = Y(!1);
|
|
1059
|
+
return S.value ? u(C.value) : u(gt(C.value, w.value, e));
|
|
1056
1060
|
}
|
|
1057
1061
|
function $o(e, t) {
|
|
1058
|
-
let n =
|
|
1059
|
-
|
|
1062
|
+
let n = lt(pt(e, void 0, l.pageSize), l.pageSizeOptions), r = C.value;
|
|
1063
|
+
Fn.value = !0, Y(!1), C.value = n.files, sa(_t(C.value, t ?? w.value), {
|
|
1060
1064
|
syncCurrent: !1,
|
|
1061
1065
|
shouldEmit: !0,
|
|
1062
1066
|
forceRefresh: !0
|
|
1063
|
-
}), d(r) !== d(C.value) &&
|
|
1067
|
+
}), d(r) !== d(C.value) && X(C.value, "");
|
|
1064
1068
|
}
|
|
1065
1069
|
function es(e) {
|
|
1066
1070
|
if (U.value) return;
|
|
1067
|
-
|
|
1068
|
-
let t =
|
|
1069
|
-
return C.value = [...C.value, t],
|
|
1071
|
+
Fn.value = !0, Y(!0);
|
|
1072
|
+
let t = ut(e || `合同文件 ${C.value.length + 1}`, l.pageSize);
|
|
1073
|
+
return C.value = [...C.value, t], X(C.value, ""), g("file-add", u([t])[0]), sa(t.id, {
|
|
1070
1074
|
syncCurrent: !1,
|
|
1071
1075
|
shouldEmit: !0,
|
|
1072
1076
|
forceRefresh: !0
|
|
1073
1077
|
}), u([t])[0];
|
|
1074
1078
|
}
|
|
1075
1079
|
function ts(e) {
|
|
1076
|
-
!S.value && !C.value.some((t) => t.id === e) || (
|
|
1080
|
+
!S.value && !C.value.some((t) => t.id === e) || (Fn.value = !0, sa(e));
|
|
1077
1081
|
}
|
|
1078
1082
|
function ns(e, t) {
|
|
1079
1083
|
if (U.value) return;
|
|
1080
|
-
|
|
1081
|
-
let n =
|
|
1082
|
-
if (r) return C.value = n,
|
|
1084
|
+
Fn.value = !0, Y(!1);
|
|
1085
|
+
let n = ht(C.value, e, t), r = n.find((t) => t.id === e);
|
|
1086
|
+
if (r) return C.value = n, X(n, e), u([r])[0];
|
|
1083
1087
|
}
|
|
1084
1088
|
function rs(e) {
|
|
1085
1089
|
if (U.value || C.value.length <= 1) return;
|
|
1086
|
-
|
|
1090
|
+
Fn.value = !0, Y(!1);
|
|
1087
1091
|
let t = C.value.find((t) => t.id === e);
|
|
1088
1092
|
if (!t) return;
|
|
1089
|
-
let n =
|
|
1090
|
-
if (n.length !== C.value.length) return C.value = n,
|
|
1093
|
+
let n = mt(C.value, e);
|
|
1094
|
+
if (n.length !== C.value.length) return C.value = n, X(n, ""), g("file-remove", u([t])[0]), w.value === e && sa(_t(n, n[0]?.id), {
|
|
1091
1095
|
syncCurrent: !1,
|
|
1092
1096
|
shouldEmit: !0,
|
|
1093
1097
|
forceRefresh: !0
|
|
@@ -1096,7 +1100,7 @@ var Jt = {
|
|
|
1096
1100
|
function is(e) {
|
|
1097
1101
|
if (U.value || C.value.length <= 1) return;
|
|
1098
1102
|
let t = C.value.find((t) => t.id === e);
|
|
1099
|
-
t &&
|
|
1103
|
+
t && Ut.confirm({
|
|
1100
1104
|
title: "删除合同文件",
|
|
1101
1105
|
content: `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
|
|
1102
1106
|
okText: "确认删除",
|
|
@@ -1109,16 +1113,16 @@ var Jt = {
|
|
|
1109
1113
|
}
|
|
1110
1114
|
function as(e, t) {
|
|
1111
1115
|
if (U.value) return;
|
|
1112
|
-
|
|
1113
|
-
let n = C.value.findIndex((t) => t.id === e), r =
|
|
1114
|
-
if (!(!a || n === i)) return C.value = r,
|
|
1116
|
+
Fn.value = !0, Y(!1);
|
|
1117
|
+
let n = C.value.findIndex((t) => t.id === e), r = ft(C.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
|
|
1118
|
+
if (!(!a || n === i)) return C.value = r, X(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
|
|
1115
1119
|
}
|
|
1116
1120
|
function os() {
|
|
1117
|
-
|
|
1118
|
-
let e =
|
|
1121
|
+
Y(!1);
|
|
1122
|
+
let e = vs(S.value ? C.value.flatMap((e) => De(e.template, { maxPages: Ei.value }).map((t) => ({
|
|
1119
1123
|
...t,
|
|
1120
1124
|
fileId: e.id
|
|
1121
|
-
}))) : De(
|
|
1125
|
+
}))) : De(J(), { maxPages: Ei.value }));
|
|
1122
1126
|
return k.value = e, O.value = !0, g("validate", e), e;
|
|
1123
1127
|
}
|
|
1124
1128
|
function ss(e) {
|
|
@@ -1131,7 +1135,7 @@ var Jt = {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
let t = te(e);
|
|
1133
1137
|
if (t) {
|
|
1134
|
-
P.value = !0, _(() =>
|
|
1138
|
+
P.value = !0, _(() => Sn.value?.focusField(t));
|
|
1135
1139
|
return;
|
|
1136
1140
|
}
|
|
1137
1141
|
if (e.variableKey) {
|
|
@@ -1152,124 +1156,135 @@ var Jt = {
|
|
|
1152
1156
|
function cs(e) {
|
|
1153
1157
|
return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
|
|
1154
1158
|
}
|
|
1155
|
-
let ls =
|
|
1156
|
-
function
|
|
1157
|
-
return S.value ? (
|
|
1159
|
+
let ls = je(), us, ds;
|
|
1160
|
+
function fs() {
|
|
1161
|
+
return S.value ? (Y(!1), C.value.map((e) => ({
|
|
1158
1162
|
fileId: e.id,
|
|
1159
1163
|
template: e.template
|
|
1160
|
-
}))) : [{ template:
|
|
1164
|
+
}))) : [{ template: J() }];
|
|
1165
|
+
}
|
|
1166
|
+
function ps(e = {}) {
|
|
1167
|
+
if (na(), !e.pageId) return ls.check(fs(), { signal: e.signal });
|
|
1168
|
+
let t = {
|
|
1169
|
+
template: J(),
|
|
1170
|
+
...S.value ? { fileId: w.value } : {}
|
|
1171
|
+
}, n = Ae(t).filter((t) => t.pageId === e.pageId);
|
|
1172
|
+
return ls.check([{
|
|
1173
|
+
...t,
|
|
1174
|
+
layoutPages: n
|
|
1175
|
+
}], { signal: e.signal });
|
|
1161
1176
|
}
|
|
1162
|
-
function
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
let e = new AbortController();
|
|
1169
|
-
Q = e;
|
|
1170
|
-
let t;
|
|
1177
|
+
function ms(e) {
|
|
1178
|
+
!e && !l.checkLayoutOnExport || typeof window > "u" || (us !== void 0 && clearTimeout(us), ds?.abort(), ds = void 0, us = setTimeout(() => {
|
|
1179
|
+
us = void 0;
|
|
1180
|
+
let t = new AbortController();
|
|
1181
|
+
ds = t;
|
|
1182
|
+
let n;
|
|
1171
1183
|
try {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1184
|
+
n = ps({
|
|
1185
|
+
pageId: e,
|
|
1186
|
+
signal: t.signal
|
|
1187
|
+
});
|
|
1188
|
+
} catch (e) {
|
|
1189
|
+
ds = void 0, console.error("[GD-SIGN-COORD] 合同模板排版预检启动失败", e);
|
|
1175
1190
|
return;
|
|
1176
1191
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
key:
|
|
1180
|
-
content:
|
|
1192
|
+
n.then((e) => {
|
|
1193
|
+
ds === t && (ds = void 0, g("layout-warning", e), e.length && Gt.warning({
|
|
1194
|
+
key: pn,
|
|
1195
|
+
content: hs(e),
|
|
1181
1196
|
duration: 6
|
|
1182
1197
|
}));
|
|
1183
|
-
}, (
|
|
1184
|
-
|
|
1198
|
+
}, (e) => {
|
|
1199
|
+
Ne(e) || ds !== t || (ds = void 0, console.error("[GD-SIGN-COORD] 合同模板排版预检失败", e));
|
|
1185
1200
|
});
|
|
1186
|
-
},
|
|
1201
|
+
}, e ? 0 : fn));
|
|
1187
1202
|
}
|
|
1188
|
-
function
|
|
1189
|
-
let [t] = e, n = t.fileId ? C.value.find((e) => e.id === t.fileId)?.name : void 0, r =
|
|
1203
|
+
function hs(e) {
|
|
1204
|
+
let [t] = e, n = t.fileId ? C.value.find((e) => e.id === t.fileId)?.name : void 0, r = Me(t, "design")[0] ?? "存在排版问题", i = n ? `${n}:` : "";
|
|
1190
1205
|
return e.length > 1 ? `${i}${r}(另有 ${e.length - 1} 处排版问题)` : `${i}${r}`;
|
|
1191
1206
|
}
|
|
1192
|
-
function
|
|
1207
|
+
function gs() {
|
|
1193
1208
|
na();
|
|
1194
|
-
let e = ve(
|
|
1195
|
-
return
|
|
1209
|
+
let e = ve(J());
|
|
1210
|
+
return ms(), e;
|
|
1196
1211
|
}
|
|
1197
|
-
function
|
|
1198
|
-
let e =
|
|
1199
|
-
return
|
|
1212
|
+
function _s() {
|
|
1213
|
+
let e = Y(!1), t = dt(S.value ? C.value : gt(C.value, w.value, e));
|
|
1214
|
+
return ms(), t;
|
|
1200
1215
|
}
|
|
1201
|
-
function
|
|
1216
|
+
function vs(e) {
|
|
1202
1217
|
let t = /* @__PURE__ */ new Set();
|
|
1203
1218
|
return e.filter((e) => {
|
|
1204
1219
|
let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
|
|
1205
1220
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
1206
1221
|
});
|
|
1207
1222
|
}
|
|
1208
|
-
function
|
|
1223
|
+
function ys(e) {
|
|
1209
1224
|
k.value = [...e], O.value = !0;
|
|
1210
1225
|
}
|
|
1211
|
-
function
|
|
1226
|
+
function bs() {
|
|
1212
1227
|
k.value = [], O.value = !1;
|
|
1213
1228
|
}
|
|
1214
|
-
function
|
|
1229
|
+
function xs() {
|
|
1215
1230
|
A.get(W.value?.id ?? D.value)?.focus();
|
|
1216
1231
|
}
|
|
1217
|
-
function
|
|
1218
|
-
|
|
1232
|
+
function Ss(e) {
|
|
1233
|
+
Xi(e) && Q({
|
|
1219
1234
|
type: "set-text-align",
|
|
1220
1235
|
value: e
|
|
1221
1236
|
});
|
|
1222
1237
|
}
|
|
1223
|
-
function
|
|
1224
|
-
(e === "paragraph" ||
|
|
1238
|
+
function Cs(e) {
|
|
1239
|
+
(e === "paragraph" || Zi(e)) && Q({
|
|
1225
1240
|
type: "apply-block-style",
|
|
1226
1241
|
format: e
|
|
1227
1242
|
});
|
|
1228
1243
|
}
|
|
1229
|
-
function
|
|
1230
|
-
let t =
|
|
1231
|
-
t && (
|
|
1244
|
+
function ws(e) {
|
|
1245
|
+
let t = $i(e);
|
|
1246
|
+
t && (Q({
|
|
1232
1247
|
type: "set-font-size",
|
|
1233
1248
|
value: t
|
|
1234
|
-
}),
|
|
1249
|
+
}), ir.value = "");
|
|
1235
1250
|
}
|
|
1236
|
-
function
|
|
1251
|
+
function Ts(e) {
|
|
1237
1252
|
let t = String(e || "").trim();
|
|
1238
1253
|
if (!t) {
|
|
1239
|
-
|
|
1254
|
+
Q({ type: "unset-font-family" });
|
|
1240
1255
|
return;
|
|
1241
1256
|
}
|
|
1242
|
-
|
|
1257
|
+
Q({
|
|
1243
1258
|
type: "set-font-family",
|
|
1244
1259
|
value: t
|
|
1245
1260
|
});
|
|
1246
1261
|
}
|
|
1247
|
-
function Ts(e) {
|
|
1248
|
-
Es(e.target?.value ?? "");
|
|
1249
|
-
}
|
|
1250
1262
|
function Es(e) {
|
|
1263
|
+
Ds(e.target?.value ?? "");
|
|
1264
|
+
}
|
|
1265
|
+
function Ds(e) {
|
|
1251
1266
|
let t = e.trim();
|
|
1252
|
-
t &&
|
|
1267
|
+
t && Q({
|
|
1253
1268
|
type: "set-color",
|
|
1254
1269
|
value: t
|
|
1255
1270
|
});
|
|
1256
1271
|
}
|
|
1257
|
-
function
|
|
1258
|
-
|
|
1259
|
-
}
|
|
1260
|
-
function Os() {
|
|
1261
|
-
rr.value.trim() && Cs(rr.value);
|
|
1272
|
+
function Os(e) {
|
|
1273
|
+
ir.value = e;
|
|
1262
1274
|
}
|
|
1263
|
-
function ks(
|
|
1264
|
-
|
|
1275
|
+
function ks() {
|
|
1276
|
+
ir.value.trim() && ws(ir.value);
|
|
1265
1277
|
}
|
|
1266
1278
|
function As(e) {
|
|
1267
|
-
e
|
|
1279
|
+
e.key === "Enter" && (e.preventDefault(), ks());
|
|
1268
1280
|
}
|
|
1269
1281
|
function js(e) {
|
|
1282
|
+
e || (ks(), ir.value = "");
|
|
1283
|
+
}
|
|
1284
|
+
function Ms(e) {
|
|
1270
1285
|
if (U.value) return;
|
|
1271
|
-
D.value = e.pageId, F.value = !1, I.value = !1, z.value = void 0, B.value = void 0,
|
|
1272
|
-
let t =
|
|
1286
|
+
D.value = e.pageId, F.value = !1, I.value = !1, z.value = void 0, B.value = void 0, xr.value = !1, Sr.value = "";
|
|
1287
|
+
let t = wt(e.clientX, e.clientY, 304, 300);
|
|
1273
1288
|
L.value = {
|
|
1274
1289
|
pageId: e.pageId,
|
|
1275
1290
|
x: t.x,
|
|
@@ -1278,207 +1293,207 @@ var Jt = {
|
|
|
1278
1293
|
selectionWidth: e.selectionWidth,
|
|
1279
1294
|
leadingText: e.leadingText
|
|
1280
1295
|
}, _(() => {
|
|
1281
|
-
|
|
1296
|
+
Ns(), hr.value?.focusFirstButton();
|
|
1282
1297
|
});
|
|
1283
1298
|
}
|
|
1284
|
-
function
|
|
1285
|
-
let e =
|
|
1299
|
+
function Ns() {
|
|
1300
|
+
let e = hr.value?.getMenuElement(), t = L.value;
|
|
1286
1301
|
if (!e || !t) return;
|
|
1287
|
-
let n =
|
|
1302
|
+
let n = Tt(t.x, t.y, e);
|
|
1288
1303
|
L.value = {
|
|
1289
1304
|
...t,
|
|
1290
1305
|
x: n.x,
|
|
1291
1306
|
y: n.y
|
|
1292
1307
|
};
|
|
1293
1308
|
}
|
|
1294
|
-
function
|
|
1309
|
+
function Ps(e) {
|
|
1295
1310
|
if (U.value) return;
|
|
1296
1311
|
D.value = e.pageId, F.value = !1, I.value = !1, L.value = void 0, B.value = void 0;
|
|
1297
|
-
let t =
|
|
1312
|
+
let t = wt(e.clientX, e.clientY, 248, 400);
|
|
1298
1313
|
z.value = {
|
|
1299
1314
|
...e,
|
|
1300
1315
|
x: t.x,
|
|
1301
1316
|
y: t.y
|
|
1302
1317
|
}, _(() => {
|
|
1303
|
-
let e =
|
|
1318
|
+
let e = Cr.value?.getMenuElement(), t = z.value;
|
|
1304
1319
|
if (e && t) {
|
|
1305
|
-
let n =
|
|
1320
|
+
let n = Tt(t.x, t.y, e);
|
|
1306
1321
|
z.value = {
|
|
1307
1322
|
...t,
|
|
1308
1323
|
x: n.x,
|
|
1309
1324
|
y: n.y
|
|
1310
1325
|
};
|
|
1311
1326
|
}
|
|
1312
|
-
|
|
1327
|
+
Cr.value?.focusFirstItem();
|
|
1313
1328
|
});
|
|
1314
1329
|
}
|
|
1315
|
-
function
|
|
1330
|
+
function Fs(e) {
|
|
1316
1331
|
if (U.value) return;
|
|
1317
|
-
D.value = e.pageId, F.value = !1, I.value = !1, L.value = void 0, z.value = void 0,
|
|
1318
|
-
let t =
|
|
1332
|
+
D.value = e.pageId, F.value = !1, I.value = !1, L.value = void 0, z.value = void 0, Tr.value = e.image.width, Er.value = e.image.height, E.value = "";
|
|
1333
|
+
let t = wt(e.clientX, e.clientY, 288, 196);
|
|
1319
1334
|
B.value = {
|
|
1320
1335
|
pageId: e.pageId,
|
|
1321
1336
|
image: e.image,
|
|
1322
1337
|
x: t.x,
|
|
1323
1338
|
y: t.y
|
|
1324
1339
|
}, _(() => {
|
|
1325
|
-
|
|
1340
|
+
Is(), wr.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
|
|
1326
1341
|
});
|
|
1327
1342
|
}
|
|
1328
|
-
function
|
|
1329
|
-
let e =
|
|
1343
|
+
function Is() {
|
|
1344
|
+
let e = wr.value?.getMenuElement(), t = B.value;
|
|
1330
1345
|
if (!e || !t) return;
|
|
1331
|
-
let n =
|
|
1346
|
+
let n = Tt(t.x, t.y, e);
|
|
1332
1347
|
B.value = {
|
|
1333
1348
|
...t,
|
|
1334
1349
|
x: n.x,
|
|
1335
1350
|
y: n.y
|
|
1336
1351
|
};
|
|
1337
1352
|
}
|
|
1338
|
-
function
|
|
1353
|
+
function Ls() {
|
|
1339
1354
|
let e = B.value;
|
|
1340
1355
|
!e || U.value || (A.get(e.pageId)?.updateSelectedContentImage({
|
|
1341
|
-
width:
|
|
1342
|
-
height:
|
|
1356
|
+
width: Fe(Tr.value),
|
|
1357
|
+
height: Fe(Er.value)
|
|
1343
1358
|
}) && (V.value = "已更新图片尺寸"), $());
|
|
1344
1359
|
}
|
|
1345
|
-
function
|
|
1360
|
+
function Rs() {
|
|
1346
1361
|
let e = B.value;
|
|
1347
1362
|
!e || U.value || (A.get(e.pageId)?.updateSelectedContentImage({
|
|
1348
1363
|
width: void 0,
|
|
1349
1364
|
height: void 0
|
|
1350
1365
|
}) && (V.value = "已恢复图片自然尺寸"), $());
|
|
1351
1366
|
}
|
|
1352
|
-
function
|
|
1353
|
-
e.type === "table" ?
|
|
1367
|
+
function zs(e) {
|
|
1368
|
+
e.type === "table" ? Ps(e) : e.type === "image" ? Fs(e) : Ms(e);
|
|
1354
1369
|
}
|
|
1355
1370
|
function $() {
|
|
1356
|
-
L.value = void 0, z.value = void 0, B.value = void 0,
|
|
1357
|
-
}
|
|
1358
|
-
function zs() {
|
|
1359
|
-
Gr(!1), F.value = !1, I.value = !1, tr.value = !1, ir.value = !1, ar.value = !1, or.value = !1, sr.value = !1;
|
|
1371
|
+
L.value = void 0, z.value = void 0, B.value = void 0, xr.value = !1, Sr.value = "";
|
|
1360
1372
|
}
|
|
1361
1373
|
function Bs() {
|
|
1362
|
-
|
|
1374
|
+
Kr(!1), F.value = !1, I.value = !1, nr.value = !1, ar.value = !1, or.value = !1, sr.value = !1, cr.value = !1;
|
|
1363
1375
|
}
|
|
1364
|
-
|
|
1376
|
+
function Vs() {
|
|
1377
|
+
Bs(), N.value = !N.value, _(() => Oo(() => xn.value?.focusChromeToggle()));
|
|
1378
|
+
}
|
|
1379
|
+
let Hs = [
|
|
1365
1380
|
".gd-contract-template-designer__context-menu",
|
|
1366
1381
|
".gd-contract-template-designer__bubble-menu",
|
|
1367
1382
|
".gd-contract-template-designer__bubble-menu-popup"
|
|
1368
1383
|
].join(",");
|
|
1369
|
-
function
|
|
1370
|
-
let e = U.value ||
|
|
1384
|
+
function Us() {
|
|
1385
|
+
let e = U.value || yr.value || _r.value || Zr.value || P.value || Un.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
|
|
1371
1386
|
if (!n) {
|
|
1372
1387
|
R.value = void 0;
|
|
1373
1388
|
return;
|
|
1374
1389
|
}
|
|
1375
|
-
let r = n.top - 40 -
|
|
1390
|
+
let r = n.top - 40 - dn, i = r >= 12 ? r : n.bottom + dn, a = wt((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
|
|
1376
1391
|
R.value = {
|
|
1377
1392
|
pageId: t,
|
|
1378
1393
|
x: a.x,
|
|
1379
1394
|
y: a.y
|
|
1380
|
-
}, _(() =>
|
|
1395
|
+
}, _(() => Ws(n));
|
|
1381
1396
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let t =
|
|
1397
|
+
function Ws(e) {
|
|
1398
|
+
let t = gr.value?.getMenuElement(), n = R.value;
|
|
1384
1399
|
if (!t || !n) return;
|
|
1385
|
-
let r = t.getBoundingClientRect(), i = e.top - r.height -
|
|
1400
|
+
let r = t.getBoundingClientRect(), i = e.top - r.height - dn, a = i >= 12 ? i : e.bottom + dn, o = Tt((e.left + e.right) / 2 - r.width / 2, a, t);
|
|
1386
1401
|
R.value = {
|
|
1387
1402
|
...n,
|
|
1388
1403
|
x: o.x,
|
|
1389
1404
|
y: o.y
|
|
1390
1405
|
};
|
|
1391
1406
|
}
|
|
1392
|
-
function
|
|
1407
|
+
function Gs() {
|
|
1393
1408
|
let e = R.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
|
|
1394
|
-
|
|
1409
|
+
vr = t ? {
|
|
1395
1410
|
pageId: e,
|
|
1396
1411
|
...t
|
|
1397
|
-
} : void 0,
|
|
1398
|
-
}
|
|
1399
|
-
function Gs(e) {
|
|
1400
|
-
if (!gr.value) return;
|
|
1401
|
-
let t = _r, n = A.get(e)?.getSelectionRange();
|
|
1402
|
-
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (gr.value = !1, _r = void 0);
|
|
1412
|
+
} : void 0, _r.value = !0, R.value = void 0;
|
|
1403
1413
|
}
|
|
1404
|
-
function Ks() {
|
|
1405
|
-
!
|
|
1406
|
-
|
|
1407
|
-
|
|
1414
|
+
function Ks(e) {
|
|
1415
|
+
if (!_r.value) return;
|
|
1416
|
+
let t = vr, n = A.get(e)?.getSelectionRange();
|
|
1417
|
+
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (_r.value = !1, vr = void 0);
|
|
1408
1418
|
}
|
|
1409
1419
|
function qs() {
|
|
1410
|
-
|
|
1420
|
+
!R.value || br !== void 0 || (br = requestAnimationFrame(() => {
|
|
1421
|
+
br = void 0, Us();
|
|
1422
|
+
}));
|
|
1411
1423
|
}
|
|
1412
1424
|
function Js() {
|
|
1413
|
-
|
|
1425
|
+
yr.value && (yr.value = !1, Us());
|
|
1414
1426
|
}
|
|
1415
|
-
function Ys(
|
|
1416
|
-
|
|
1427
|
+
function Ys() {
|
|
1428
|
+
$(), qs();
|
|
1417
1429
|
}
|
|
1418
|
-
function Xs(e) {
|
|
1419
|
-
|
|
1420
|
-
t?.closest(".ProseMirror") && (vr.value = !0, R.value = void 0), !(!L.value && !z.value && !B.value && !R.value) && (t?.closest(Vs) || ($(), R.value && Ws()));
|
|
1430
|
+
function Xs(e, t) {
|
|
1431
|
+
A.get(R.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
|
|
1421
1432
|
}
|
|
1422
1433
|
function Zs(e) {
|
|
1423
|
-
|
|
1434
|
+
let t = e.target instanceof Element ? e.target : null;
|
|
1435
|
+
t?.closest(".ProseMirror") && (yr.value = !0, R.value = void 0), !(!L.value && !z.value && !B.value && !R.value) && (t?.closest(Hs) || ($(), R.value && Gs()));
|
|
1424
1436
|
}
|
|
1425
1437
|
function Qs(e) {
|
|
1426
|
-
|
|
1438
|
+
(e.target instanceof Element ? e.target : null)?.closest(Hs) || ($(), qs());
|
|
1439
|
+
}
|
|
1440
|
+
function $s(e) {
|
|
1441
|
+
let t = hn.value;
|
|
1427
1442
|
if (!t || typeof document > "u") return !1;
|
|
1428
1443
|
let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
|
|
1429
1444
|
return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
|
|
1430
1445
|
}
|
|
1431
|
-
function
|
|
1446
|
+
function ec(e) {
|
|
1432
1447
|
if (e.key !== "Escape" || !P.value || typeof document > "u") return;
|
|
1433
|
-
let t =
|
|
1448
|
+
let t = hn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
|
|
1434
1449
|
if (!t) return;
|
|
1435
|
-
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(
|
|
1450
|
+
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(kr) || r?.closest(kr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
|
|
1436
1451
|
if (i || a && o) {
|
|
1437
|
-
|
|
1452
|
+
Or.add(e);
|
|
1438
1453
|
return;
|
|
1439
1454
|
}
|
|
1440
|
-
!
|
|
1455
|
+
!Zr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), Yo());
|
|
1441
1456
|
}
|
|
1442
|
-
function
|
|
1457
|
+
function tc(e) {
|
|
1443
1458
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
|
|
1444
|
-
if (!
|
|
1445
|
-
e.preventDefault(),
|
|
1459
|
+
if (!Qr.value || !$s(e)) return;
|
|
1460
|
+
e.preventDefault(), Mi();
|
|
1446
1461
|
return;
|
|
1447
1462
|
}
|
|
1448
1463
|
if (e.key === "Escape") {
|
|
1449
|
-
if (
|
|
1450
|
-
|
|
1464
|
+
if (Or.has(e)) {
|
|
1465
|
+
Or.delete(e);
|
|
1451
1466
|
return;
|
|
1452
1467
|
}
|
|
1453
|
-
let t =
|
|
1454
|
-
if (!t && P.value && Yo(), $(),
|
|
1468
|
+
let t = Zr.value, n = t || P.value;
|
|
1469
|
+
if (!t && P.value && Yo(), $(), Bs(), n && e.stopPropagation(), !n) {
|
|
1455
1470
|
if (R.value) {
|
|
1456
|
-
|
|
1471
|
+
Gs(), e.stopPropagation();
|
|
1457
1472
|
return;
|
|
1458
1473
|
}
|
|
1459
|
-
|
|
1474
|
+
$n.value ? Ao() : M.value = !1;
|
|
1460
1475
|
}
|
|
1461
1476
|
}
|
|
1462
1477
|
}
|
|
1463
|
-
function
|
|
1464
|
-
e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (
|
|
1465
|
-
let n =
|
|
1466
|
-
n &&
|
|
1467
|
-
...
|
|
1478
|
+
function nc(e, t) {
|
|
1479
|
+
e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (Ks(e), Us());
|
|
1480
|
+
let n = rr.value[e];
|
|
1481
|
+
n && Ct(n, t) || (rr.value = {
|
|
1482
|
+
...rr.value,
|
|
1468
1483
|
[e]: t
|
|
1469
1484
|
});
|
|
1470
1485
|
}
|
|
1471
|
-
function
|
|
1472
|
-
|
|
1486
|
+
function rc(e = Dr.value.rows, t = Dr.value.cols) {
|
|
1487
|
+
Q({
|
|
1473
1488
|
type: "insert-table",
|
|
1474
1489
|
options: {
|
|
1475
1490
|
rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
|
|
1476
1491
|
cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
|
|
1477
|
-
withHeaderRow: !!
|
|
1492
|
+
withHeaderRow: !!Dr.value.withHeaderRow
|
|
1478
1493
|
}
|
|
1479
1494
|
}), F.value = !1, $();
|
|
1480
1495
|
}
|
|
1481
|
-
let
|
|
1496
|
+
let ic = {
|
|
1482
1497
|
"delete-table-row": {
|
|
1483
1498
|
label: "删除当前行",
|
|
1484
1499
|
countKey: "deleteRow"
|
|
@@ -1492,18 +1507,18 @@ var Jt = {
|
|
|
1492
1507
|
countKey: "deleteTable"
|
|
1493
1508
|
}
|
|
1494
1509
|
};
|
|
1495
|
-
function
|
|
1510
|
+
function ac(e) {
|
|
1496
1511
|
let t = z.value;
|
|
1497
1512
|
if (!t) return;
|
|
1498
1513
|
let n = () => {
|
|
1499
|
-
|
|
1500
|
-
}, r =
|
|
1514
|
+
Q(e, t.pageId), $();
|
|
1515
|
+
}, r = ic[e.type];
|
|
1501
1516
|
if (!r) {
|
|
1502
1517
|
n();
|
|
1503
1518
|
return;
|
|
1504
1519
|
}
|
|
1505
1520
|
let i = t.affectedVariableCounts[r.countKey];
|
|
1506
|
-
$(),
|
|
1521
|
+
$(), Ut.confirm({
|
|
1507
1522
|
title: r.label,
|
|
1508
1523
|
content: i ? `此操作将移除 ${i} 个正文变量节点,是否继续?` : "此操作将修改表格结构,是否继续?",
|
|
1509
1524
|
okText: "确认",
|
|
@@ -1513,8 +1528,8 @@ var Jt = {
|
|
|
1513
1528
|
onCancel: () => A.get(t.pageId)?.focus()
|
|
1514
1529
|
});
|
|
1515
1530
|
}
|
|
1516
|
-
function
|
|
1517
|
-
let t =
|
|
1531
|
+
function oc(e) {
|
|
1532
|
+
let t = Cr.value?.getMenuElement();
|
|
1518
1533
|
if (!t) return;
|
|
1519
1534
|
if (e.key === "Escape") {
|
|
1520
1535
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -1537,23 +1552,23 @@ var Jt = {
|
|
|
1537
1552
|
let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
|
|
1538
1553
|
e.preventDefault(), n[r]?.focus();
|
|
1539
1554
|
}
|
|
1540
|
-
function
|
|
1555
|
+
function sc(e) {
|
|
1541
1556
|
if (e.key !== "Escape") return;
|
|
1542
1557
|
e.preventDefault(), e.stopPropagation();
|
|
1543
1558
|
let t = L.value?.pageId;
|
|
1544
1559
|
$(), A.get(t ?? "")?.focus();
|
|
1545
1560
|
}
|
|
1546
|
-
function
|
|
1561
|
+
function cc(e) {
|
|
1547
1562
|
if (e.key !== "Escape") return;
|
|
1548
1563
|
e.preventDefault(), e.stopPropagation();
|
|
1549
1564
|
let t = B.value?.pageId;
|
|
1550
1565
|
$(), A.get(t ?? "")?.focus();
|
|
1551
1566
|
}
|
|
1552
|
-
function
|
|
1553
|
-
|
|
1567
|
+
function lc(e) {
|
|
1568
|
+
Q({ type: e }), I.value = !1, $();
|
|
1554
1569
|
}
|
|
1555
|
-
return
|
|
1556
|
-
checkLayout:
|
|
1570
|
+
return rt({
|
|
1571
|
+
checkLayout: ps,
|
|
1557
1572
|
getValue: Xo,
|
|
1558
1573
|
setValue: Zo,
|
|
1559
1574
|
getFiles: Qo,
|
|
@@ -1564,17 +1579,17 @@ var Jt = {
|
|
|
1564
1579
|
removeFile: rs,
|
|
1565
1580
|
moveFile: as,
|
|
1566
1581
|
validate: os,
|
|
1567
|
-
exportTemplate:
|
|
1568
|
-
exportFiles:
|
|
1582
|
+
exportTemplate: gs,
|
|
1583
|
+
exportFiles: _s,
|
|
1569
1584
|
getSubmitData: Po,
|
|
1570
1585
|
clearTemplate: Bo,
|
|
1571
|
-
saveDraftCache:
|
|
1572
|
-
loadDraftCache:
|
|
1573
|
-
clearDraftCache:
|
|
1586
|
+
saveDraftCache: Mi,
|
|
1587
|
+
loadDraftCache: Ni,
|
|
1588
|
+
clearDraftCache: Pi,
|
|
1574
1589
|
getDraftCacheStatus: la,
|
|
1575
1590
|
insertVariable: so,
|
|
1576
1591
|
insertImage: Ra,
|
|
1577
|
-
focus:
|
|
1592
|
+
focus: xs,
|
|
1578
1593
|
openPreview: Mo,
|
|
1579
1594
|
closePreview: No,
|
|
1580
1595
|
openSubmitDataViewer: Fo,
|
|
@@ -1582,27 +1597,27 @@ var Jt = {
|
|
|
1582
1597
|
getVariableData: Lo,
|
|
1583
1598
|
openVariableDataViewer: Ro,
|
|
1584
1599
|
closeVariableDataViewer: zo,
|
|
1585
|
-
setServerValidationErrors:
|
|
1586
|
-
clearValidationErrors:
|
|
1600
|
+
setServerValidationErrors: ys,
|
|
1601
|
+
clearValidationErrors: bs,
|
|
1587
1602
|
scrollToVariable: Wo,
|
|
1588
1603
|
scrollToPage: qo,
|
|
1589
1604
|
setZoom: So,
|
|
1590
1605
|
resetZoom: Co,
|
|
1591
1606
|
getZoom: wo,
|
|
1592
1607
|
fitWidth: vo
|
|
1593
|
-
}), (e, t) => (v(),
|
|
1608
|
+
}), (e, t) => (v(), kt("div", {
|
|
1594
1609
|
ref_key: "designerElement",
|
|
1595
|
-
ref:
|
|
1596
|
-
class:
|
|
1610
|
+
ref: hn,
|
|
1611
|
+
class: jt(["gd-contract-template-designer", {
|
|
1597
1612
|
"is-disabled": s.disabled,
|
|
1598
1613
|
"is-readonly": U.value,
|
|
1599
1614
|
"is-fullscreen": M.value,
|
|
1600
|
-
"is-immersive":
|
|
1615
|
+
"is-immersive": $n.value
|
|
1601
1616
|
}]),
|
|
1602
|
-
style:
|
|
1603
|
-
onKeydownCapture: t[31] ||= (...e) => b(
|
|
1617
|
+
style: Mt(mn.value),
|
|
1618
|
+
onKeydownCapture: t[31] ||= (...e) => b(Xr) && b(Xr)(...e)
|
|
1604
1619
|
}, [
|
|
1605
|
-
S.value ? (v(),
|
|
1620
|
+
S.value ? (v(), Ot(yt, {
|
|
1606
1621
|
key: 0,
|
|
1607
1622
|
files: C.value,
|
|
1608
1623
|
"active-file-id": w.value,
|
|
@@ -1617,28 +1632,28 @@ var Jt = {
|
|
|
1617
1632
|
"active-file-id",
|
|
1618
1633
|
"readonly"
|
|
1619
1634
|
])) : p("", !0),
|
|
1620
|
-
m("div", { class:
|
|
1621
|
-
"is-sidebar-collapsed":
|
|
1622
|
-
"is-inspector-collapsed":
|
|
1635
|
+
m("div", { class: jt(["gd-contract-template-designer__layout", {
|
|
1636
|
+
"is-sidebar-collapsed": Zn.value,
|
|
1637
|
+
"is-inspector-collapsed": Qn.value
|
|
1623
1638
|
}]) }, [
|
|
1624
|
-
h(
|
|
1625
|
-
collapsed:
|
|
1639
|
+
h(bt, {
|
|
1640
|
+
collapsed: Zn.value,
|
|
1626
1641
|
"file-id": w.value,
|
|
1627
1642
|
pages: T.value.pages,
|
|
1628
1643
|
variables: T.value.variables,
|
|
1629
|
-
"decoration-variable-keys":
|
|
1644
|
+
"decoration-variable-keys": Oi.value,
|
|
1630
1645
|
"active-page-id": D.value,
|
|
1631
1646
|
"selected-variable-key": E.value,
|
|
1632
|
-
"normalized-max-pages":
|
|
1633
|
-
"page-limit-reached":
|
|
1647
|
+
"normalized-max-pages": Ei.value,
|
|
1648
|
+
"page-limit-reached": Di.value,
|
|
1634
1649
|
"selected-page": W.value,
|
|
1635
|
-
"selected-page-size":
|
|
1636
|
-
"normalized-page-size-options":
|
|
1637
|
-
"page-size-options":
|
|
1638
|
-
"selected-page-size-option-value":
|
|
1650
|
+
"selected-page-size": ri.value,
|
|
1651
|
+
"normalized-page-size-options": yi.value,
|
|
1652
|
+
"page-size-options": bi.value,
|
|
1653
|
+
"selected-page-size-option-value": xi.value,
|
|
1639
1654
|
readonly: U.value,
|
|
1640
1655
|
"get-page-size": ya,
|
|
1641
|
-
onToggle: t[1] ||= (e) =>
|
|
1656
|
+
onToggle: t[1] ||= (e) => Zn.value = !Zn.value,
|
|
1642
1657
|
onAddPage: Sa,
|
|
1643
1658
|
onActivatePage: Go,
|
|
1644
1659
|
onNavigateOutline: Ko,
|
|
@@ -1665,34 +1680,34 @@ var Jt = {
|
|
|
1665
1680
|
]),
|
|
1666
1681
|
m("main", {
|
|
1667
1682
|
ref_key: "workspaceElement",
|
|
1668
|
-
ref:
|
|
1683
|
+
ref: bn,
|
|
1669
1684
|
class: "gd-contract-template-designer__workspace"
|
|
1670
1685
|
}, [
|
|
1671
|
-
|
|
1672
|
-
id:
|
|
1686
|
+
Vt(m("div", {
|
|
1687
|
+
id: wn,
|
|
1673
1688
|
class: "gd-contract-template-designer__workspace-chrome"
|
|
1674
|
-
}, [h(
|
|
1689
|
+
}, [h(Ge, {
|
|
1675
1690
|
ref_key: "workspaceHeaderElement",
|
|
1676
|
-
ref:
|
|
1677
|
-
summary:
|
|
1678
|
-
"draft-cache-status-text":
|
|
1679
|
-
"draft-cache-status-class":
|
|
1691
|
+
ref: xn,
|
|
1692
|
+
summary: oi.value,
|
|
1693
|
+
"draft-cache-status-text": ui.value,
|
|
1694
|
+
"draft-cache-status-class": di.value,
|
|
1680
1695
|
"show-draft-cache-status": s.showDraftCacheStatus,
|
|
1681
1696
|
"show-clear-button": s.showClearButton,
|
|
1682
1697
|
"show-submit-data-viewer": s.showSubmitDataViewer,
|
|
1683
1698
|
"show-variable-data-viewer": s.showVariableDataViewer,
|
|
1684
1699
|
readonly: U.value,
|
|
1685
|
-
"zoom-percent":
|
|
1686
|
-
"zoom-out-disabled": j.value <=
|
|
1687
|
-
"zoom-in-disabled": j.value >=
|
|
1700
|
+
"zoom-percent": fi.value,
|
|
1701
|
+
"zoom-out-disabled": j.value <= $t,
|
|
1702
|
+
"zoom-in-disabled": j.value >= en,
|
|
1688
1703
|
"is-fullscreen": M.value,
|
|
1689
|
-
immersive:
|
|
1704
|
+
immersive: $n.value,
|
|
1690
1705
|
"page-decorations-open": P.value,
|
|
1691
|
-
"page-decorations-studio-id":
|
|
1692
|
-
"page-decorations-preset-label":
|
|
1693
|
-
"page-decorations-enabled-count":
|
|
1694
|
-
"page-decorations-enabled-states":
|
|
1695
|
-
"chrome-controls-id":
|
|
1706
|
+
"page-decorations-studio-id": Cn,
|
|
1707
|
+
"page-decorations-preset-label": si.value,
|
|
1708
|
+
"page-decorations-enabled-count": li.value,
|
|
1709
|
+
"page-decorations-enabled-states": ci.value,
|
|
1710
|
+
"chrome-controls-id": wn,
|
|
1696
1711
|
onZoomOut: Eo,
|
|
1697
1712
|
onZoomIn: To,
|
|
1698
1713
|
onFitWidth: b(vo),
|
|
@@ -1705,29 +1720,29 @@ var Jt = {
|
|
|
1705
1720
|
onSubmitData: Fo,
|
|
1706
1721
|
onVariableData: Ro,
|
|
1707
1722
|
onTogglePageDecorations: Jo,
|
|
1708
|
-
onToggleChrome:
|
|
1723
|
+
onToggleChrome: Vs
|
|
1709
1724
|
}, {
|
|
1710
|
-
authoring:
|
|
1725
|
+
authoring: Bt(() => [h(Je, {
|
|
1711
1726
|
ref_key: "authoringBarElement",
|
|
1712
|
-
ref:
|
|
1727
|
+
ref: Dn,
|
|
1713
1728
|
compact: "",
|
|
1714
|
-
query: b(
|
|
1715
|
-
"onUpdate:query": t[2] ||= (e) =>
|
|
1716
|
-
replacement: b(
|
|
1717
|
-
"onUpdate:replacement": t[3] ||= (e) =>
|
|
1718
|
-
"match-case": b(
|
|
1719
|
-
"onUpdate:matchCase": t[4] ||= (e) =>
|
|
1720
|
-
panel: b(
|
|
1729
|
+
query: b(Lr),
|
|
1730
|
+
"onUpdate:query": t[2] ||= (e) => At(Lr) ? Lr.value = e : null,
|
|
1731
|
+
replacement: b(Rr),
|
|
1732
|
+
"onUpdate:replacement": t[3] ||= (e) => At(Rr) ? Rr.value = e : null,
|
|
1733
|
+
"match-case": b(zr),
|
|
1734
|
+
"onUpdate:matchCase": t[4] ||= (e) => At(zr) ? zr.value = e : null,
|
|
1735
|
+
panel: b(Ir),
|
|
1721
1736
|
readonly: U.value,
|
|
1722
|
-
total: b(
|
|
1723
|
-
"current-index": b(
|
|
1724
|
-
"current-page": b(
|
|
1725
|
-
feedback: b(
|
|
1726
|
-
onOpen: b(
|
|
1727
|
-
onClose: t[5] ||= (e) => b(
|
|
1728
|
-
onNavigate: b(
|
|
1729
|
-
onReplaceCurrent: b(
|
|
1730
|
-
onReplaceAll: b(
|
|
1737
|
+
total: b(Br).length,
|
|
1738
|
+
"current-index": b(Vr),
|
|
1739
|
+
"current-page": b(Hr) ? b(Hr).pageIndex + 1 : void 0,
|
|
1740
|
+
feedback: b(Ur),
|
|
1741
|
+
onOpen: b(Gr),
|
|
1742
|
+
onClose: t[5] ||= (e) => b(Kr)(),
|
|
1743
|
+
onNavigate: b(qr),
|
|
1744
|
+
onReplaceCurrent: b(Jr),
|
|
1745
|
+
onReplaceAll: b(Yr)
|
|
1731
1746
|
}, null, 8, [
|
|
1732
1747
|
"query",
|
|
1733
1748
|
"replacement",
|
|
@@ -1763,51 +1778,51 @@ var Jt = {
|
|
|
1763
1778
|
"page-decorations-enabled-count",
|
|
1764
1779
|
"page-decorations-enabled-states",
|
|
1765
1780
|
"onFitWidth"
|
|
1766
|
-
]), h(
|
|
1767
|
-
"variable-insert-popover-open":
|
|
1768
|
-
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) =>
|
|
1769
|
-
"signing-layout-popover-open":
|
|
1770
|
-
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) =>
|
|
1771
|
-
"signing-mark-popover-open":
|
|
1772
|
-
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) =>
|
|
1773
|
-
"image-insert-popover-open":
|
|
1774
|
-
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) =>
|
|
1775
|
-
"image-insert-url":
|
|
1776
|
-
"onUpdate:imageInsertUrl": t[10] ||= (e) =>
|
|
1777
|
-
"image-insert-width":
|
|
1778
|
-
"onUpdate:imageInsertWidth": t[11] ||= (e) =>
|
|
1779
|
-
"image-insert-height":
|
|
1780
|
-
"onUpdate:imageInsertHeight": t[12] ||= (e) =>
|
|
1781
|
+
]), h(qe, {
|
|
1782
|
+
"variable-insert-popover-open": ar.value,
|
|
1783
|
+
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => ar.value = e,
|
|
1784
|
+
"signing-layout-popover-open": sr.value,
|
|
1785
|
+
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => sr.value = e,
|
|
1786
|
+
"signing-mark-popover-open": cr.value,
|
|
1787
|
+
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => cr.value = e,
|
|
1788
|
+
"image-insert-popover-open": or.value,
|
|
1789
|
+
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => or.value = e,
|
|
1790
|
+
"image-insert-url": ur.value,
|
|
1791
|
+
"onUpdate:imageInsertUrl": t[10] ||= (e) => ur.value = e,
|
|
1792
|
+
"image-insert-width": dr.value,
|
|
1793
|
+
"onUpdate:imageInsertWidth": t[11] ||= (e) => dr.value = e,
|
|
1794
|
+
"image-insert-height": fr.value,
|
|
1795
|
+
"onUpdate:imageInsertHeight": t[12] ||= (e) => fr.value = e,
|
|
1781
1796
|
"table-insert-popover-open": F.value,
|
|
1782
1797
|
"onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => F.value = e,
|
|
1783
1798
|
"table-actions-popover-open": I.value,
|
|
1784
1799
|
"onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => I.value = e,
|
|
1785
|
-
"table-insert-draft":
|
|
1786
|
-
"onUpdate:tableInsertDraft": t[15] ||= (e) =>
|
|
1787
|
-
"toolbar-more-open":
|
|
1788
|
-
"onUpdate:toolbarMoreOpen": t[16] ||= (e) =>
|
|
1800
|
+
"table-insert-draft": Dr.value,
|
|
1801
|
+
"onUpdate:tableInsertDraft": t[15] ||= (e) => Dr.value = e,
|
|
1802
|
+
"toolbar-more-open": nr.value,
|
|
1803
|
+
"onUpdate:toolbarMoreOpen": t[16] ||= (e) => nr.value = e,
|
|
1789
1804
|
readonly: U.value,
|
|
1790
1805
|
"editor-state": q.value,
|
|
1791
|
-
"current-block-format":
|
|
1792
|
-
"block-format-options":
|
|
1793
|
-
"font-family-select-options":
|
|
1794
|
-
"current-editor-font-family":
|
|
1795
|
-
"font-size-preset-options":
|
|
1796
|
-
"current-editor-font-size":
|
|
1797
|
-
"editor-font-size-search-value":
|
|
1798
|
-
"current-editor-text-color":
|
|
1799
|
-
"body-control-tool-items":
|
|
1800
|
-
"signing-layout-presets":
|
|
1801
|
-
"page-limit-reached":
|
|
1802
|
-
"normalized-max-pages":
|
|
1803
|
-
"image-processing":
|
|
1804
|
-
"image-insert-error":
|
|
1805
|
-
onCommand: t[17] ||= (e) =>
|
|
1806
|
-
onPatchBlockFormat:
|
|
1807
|
-
onPatchFontFamily:
|
|
1808
|
-
onPatchFontSize:
|
|
1809
|
-
onPatchColor:
|
|
1810
|
-
onPatchTextAlign:
|
|
1806
|
+
"current-block-format": Hi.value,
|
|
1807
|
+
"block-format-options": gi,
|
|
1808
|
+
"font-family-select-options": mi.value,
|
|
1809
|
+
"current-editor-font-family": Ui.value,
|
|
1810
|
+
"font-size-preset-options": qi.value,
|
|
1811
|
+
"current-editor-font-size": Wi.value,
|
|
1812
|
+
"editor-font-size-search-value": ir.value,
|
|
1813
|
+
"current-editor-text-color": Gi.value,
|
|
1814
|
+
"body-control-tool-items": Ti.value,
|
|
1815
|
+
"signing-layout-presets": wi.value,
|
|
1816
|
+
"page-limit-reached": Di.value,
|
|
1817
|
+
"normalized-max-pages": Ei.value,
|
|
1818
|
+
"image-processing": mr.value,
|
|
1819
|
+
"image-insert-error": pr.value,
|
|
1820
|
+
onCommand: t[17] ||= (e) => Q(e),
|
|
1821
|
+
onPatchBlockFormat: Cs,
|
|
1822
|
+
onPatchFontFamily: Ts,
|
|
1823
|
+
onPatchFontSize: ws,
|
|
1824
|
+
onPatchColor: Es,
|
|
1825
|
+
onPatchTextAlign: Ss,
|
|
1811
1826
|
onInsertVariable: Ha,
|
|
1812
1827
|
onInsertSigningLayout: da,
|
|
1813
1828
|
onInsertSigningMark: ma,
|
|
@@ -1815,57 +1830,57 @@ var Jt = {
|
|
|
1815
1830
|
onOpenImageFile: za,
|
|
1816
1831
|
onInsertImageUrl: Va,
|
|
1817
1832
|
onAddPage: Sa,
|
|
1818
|
-
onInsertTable:
|
|
1819
|
-
onTableAction:
|
|
1820
|
-
onFontSizeSearch:
|
|
1821
|
-
onFontSizeCommit:
|
|
1822
|
-
onFontSizeDropdownChange:
|
|
1823
|
-
onFontSizeKeydown:
|
|
1824
|
-
}, 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), [[
|
|
1825
|
-
N.value ? (v(),
|
|
1833
|
+
onInsertTable: rc,
|
|
1834
|
+
onTableAction: lc,
|
|
1835
|
+
onFontSizeSearch: Os,
|
|
1836
|
+
onFontSizeCommit: ks,
|
|
1837
|
+
onFontSizeDropdownChange: js,
|
|
1838
|
+
onFontSizeKeydown: As
|
|
1839
|
+
}, 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), [[zt, !N.value]]),
|
|
1840
|
+
N.value ? (v(), Ot(b(Wt), {
|
|
1826
1841
|
key: 0,
|
|
1827
1842
|
title: "展开工具区"
|
|
1828
1843
|
}, {
|
|
1829
|
-
default:
|
|
1844
|
+
default: Bt(() => [m("button", {
|
|
1830
1845
|
ref_key: "workspaceChromeHandleElement",
|
|
1831
|
-
ref:
|
|
1846
|
+
ref: Tn,
|
|
1832
1847
|
type: "button",
|
|
1833
1848
|
class: "gd-contract-template-designer__workspace-chrome-handle",
|
|
1834
1849
|
"aria-label": "展开工具区",
|
|
1835
1850
|
"aria-expanded": !1,
|
|
1836
|
-
"aria-controls":
|
|
1837
|
-
onClick:
|
|
1838
|
-
}, [h(b(
|
|
1851
|
+
"aria-controls": wn,
|
|
1852
|
+
onClick: Vs
|
|
1853
|
+
}, [h(b(Jt), { "aria-hidden": "true" })], 512)]),
|
|
1839
1854
|
_: 1
|
|
1840
1855
|
})) : p("", !0),
|
|
1841
|
-
|
|
1856
|
+
$n.value && !P.value ? (v(), kt("button", {
|
|
1842
1857
|
key: 1,
|
|
1843
1858
|
ref_key: "immersiveExitElement",
|
|
1844
|
-
ref:
|
|
1859
|
+
ref: er,
|
|
1845
1860
|
type: "button",
|
|
1846
1861
|
class: "gd-contract-template-designer__immersive-exit",
|
|
1847
1862
|
"aria-label": "退出沉浸写作",
|
|
1848
1863
|
onClick: Ao
|
|
1849
1864
|
}, [
|
|
1850
|
-
h(b(
|
|
1865
|
+
h(b(qt), { "aria-hidden": "true" }),
|
|
1851
1866
|
t[32] ||= m("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
|
|
1852
1867
|
t[33] ||= m("kbd", null, "Esc", -1)
|
|
1853
1868
|
], 512)) : p("", !0),
|
|
1854
|
-
O.value ? (v(),
|
|
1855
|
-
type:
|
|
1856
|
-
message:
|
|
1869
|
+
O.value ? (v(), kt("section", Yt, [h(b(Ht), {
|
|
1870
|
+
type: ii.value ? "success" : "error",
|
|
1871
|
+
message: ai.value,
|
|
1857
1872
|
"show-icon": ""
|
|
1858
|
-
}, null, 8, ["type", "message"]), k.value.length ? (v(),
|
|
1873
|
+
}, null, 8, ["type", "message"]), k.value.length ? (v(), kt("div", Xt, [(v(!0), kt(Et, null, Ft(k.value, (e) => (v(), kt("button", {
|
|
1859
1874
|
key: `${e.id}-${e.message}`,
|
|
1860
1875
|
type: "button",
|
|
1861
1876
|
class: "gd-contract-template-designer__validation-item",
|
|
1862
1877
|
onClick: (t) => ss(e)
|
|
1863
|
-
}, [m("span", null,
|
|
1878
|
+
}, [m("span", null, It(e.message), 1), m("small", null, It(cs(e)), 1)], 8, Zt))), 128))])) : p("", !0)])) : p("", !0),
|
|
1864
1879
|
m("div", {
|
|
1865
1880
|
ref_key: "canvasElement",
|
|
1866
|
-
ref:
|
|
1881
|
+
ref: gn,
|
|
1867
1882
|
class: "gd-contract-template-designer__canvas"
|
|
1868
|
-
}, [(v(!0),
|
|
1883
|
+
}, [(v(!0), kt(Et, null, Ft(T.value.pages, (e, n) => (v(), Ot(Ue, {
|
|
1869
1884
|
key: `${w.value}:${e.id}`,
|
|
1870
1885
|
ref_for: !0,
|
|
1871
1886
|
ref: (t) => ua(e.id, t),
|
|
@@ -1881,19 +1896,19 @@ var Jt = {
|
|
|
1881
1896
|
disabled: s.disabled,
|
|
1882
1897
|
zoom: j.value,
|
|
1883
1898
|
"process-image-file": La,
|
|
1884
|
-
"search-query": b(
|
|
1885
|
-
"search-match-case": b(
|
|
1886
|
-
"active-search-match": b(
|
|
1887
|
-
"get-scroll-container":
|
|
1899
|
+
"search-query": b(Wr),
|
|
1900
|
+
"search-match-case": b(zr),
|
|
1901
|
+
"active-search-match": b(Hr)?.pageId === e.id ? b(Hr) : void 0,
|
|
1902
|
+
"get-scroll-container": _n,
|
|
1888
1903
|
onPageUpdate: va,
|
|
1889
1904
|
onVariableDrop: Wa,
|
|
1890
1905
|
onVariableSelect: Ga,
|
|
1891
1906
|
onEditorFocus: t[18] ||= (e) => Go(e, !1),
|
|
1892
|
-
onEditorReady: b(
|
|
1893
|
-
onCompositionEnd: b(
|
|
1894
|
-
onPageLayoutChange: b(
|
|
1895
|
-
onEditorStateChange:
|
|
1896
|
-
onEditorContextMenu:
|
|
1907
|
+
onEditorReady: b(ki),
|
|
1908
|
+
onCompositionEnd: b(ki),
|
|
1909
|
+
onPageLayoutChange: b(ki),
|
|
1910
|
+
onEditorStateChange: nc,
|
|
1911
|
+
onEditorContextMenu: zs,
|
|
1897
1912
|
onWordPaste: Ia,
|
|
1898
1913
|
onVariableMoveBlocked: t[19] ||= (e) => V.value = "变量只能在当前页内移动,跨页移动尚未支持。"
|
|
1899
1914
|
}, null, 8, [
|
|
@@ -1916,24 +1931,24 @@ var Jt = {
|
|
|
1916
1931
|
"onPageLayoutChange"
|
|
1917
1932
|
]))), 128))], 512)
|
|
1918
1933
|
], 512),
|
|
1919
|
-
h(
|
|
1920
|
-
collapsed:
|
|
1934
|
+
h(xt, {
|
|
1935
|
+
collapsed: Qn.value,
|
|
1921
1936
|
readonly: s.readonly,
|
|
1922
1937
|
disabled: s.disabled,
|
|
1923
|
-
"body-control-tool-items":
|
|
1938
|
+
"body-control-tool-items": Ti.value,
|
|
1924
1939
|
"selected-variable": G.value,
|
|
1925
1940
|
variables: T.value.variables,
|
|
1926
|
-
"current-variable-font-family":
|
|
1927
|
-
"font-family-select-options":
|
|
1928
|
-
"text-align-options": b(
|
|
1929
|
-
"border-style-options":
|
|
1930
|
-
"object-fit-options":
|
|
1931
|
-
"selected-variable-width-max":
|
|
1932
|
-
"selected-variable-height-max":
|
|
1933
|
-
"min-font-size":
|
|
1934
|
-
"max-font-size":
|
|
1941
|
+
"current-variable-font-family": Ki.value,
|
|
1942
|
+
"font-family-select-options": mi.value,
|
|
1943
|
+
"text-align-options": b(hi),
|
|
1944
|
+
"border-style-options": _i,
|
|
1945
|
+
"object-fit-options": vi,
|
|
1946
|
+
"selected-variable-width-max": Bi.value,
|
|
1947
|
+
"selected-variable-height-max": Vi.value,
|
|
1948
|
+
"min-font-size": ln,
|
|
1949
|
+
"max-font-size": un,
|
|
1935
1950
|
"default-multiline-rows": b(3),
|
|
1936
|
-
onToggle: t[20] ||= (e) =>
|
|
1951
|
+
onToggle: t[20] ||= (e) => Qn.value = !Qn.value,
|
|
1937
1952
|
onVariableDragStart: ho,
|
|
1938
1953
|
onInsertVariable: co,
|
|
1939
1954
|
onDuplicateVariable: oo,
|
|
@@ -1963,18 +1978,18 @@ var Jt = {
|
|
|
1963
1978
|
"default-multiline-rows"
|
|
1964
1979
|
])
|
|
1965
1980
|
], 2),
|
|
1966
|
-
|
|
1981
|
+
Vt(h(St, {
|
|
1967
1982
|
ref_key: "pageDecorationsStudioElement",
|
|
1968
|
-
ref:
|
|
1969
|
-
id:
|
|
1983
|
+
ref: Sn,
|
|
1984
|
+
id: Cn,
|
|
1970
1985
|
open: P.value,
|
|
1971
1986
|
decorations: T.value.pageDecorations,
|
|
1972
1987
|
variables: T.value.variables,
|
|
1973
|
-
"font-family-options":
|
|
1988
|
+
"font-family-options": mi.value,
|
|
1974
1989
|
readonly: s.readonly,
|
|
1975
1990
|
disabled: s.disabled,
|
|
1976
|
-
"active-tab":
|
|
1977
|
-
"onUpdate:activeTab": t[21] ||= (e) =>
|
|
1991
|
+
"active-tab": tr.value,
|
|
1992
|
+
"onUpdate:activeTab": t[21] ||= (e) => tr.value = e,
|
|
1978
1993
|
onChange: Ya,
|
|
1979
1994
|
onClose: Yo
|
|
1980
1995
|
}, null, 8, [
|
|
@@ -1985,39 +2000,39 @@ var Jt = {
|
|
|
1985
2000
|
"readonly",
|
|
1986
2001
|
"disabled",
|
|
1987
2002
|
"active-tab"
|
|
1988
|
-
]), [[
|
|
1989
|
-
(v(), Dt
|
|
1990
|
-
z.value ? (v(),
|
|
2003
|
+
]), [[zt, P.value]]),
|
|
2004
|
+
(v(), Ot(Dt, { to: "body" }, [
|
|
2005
|
+
z.value ? (v(), Ot(We, {
|
|
1991
2006
|
key: 0,
|
|
1992
2007
|
ref_key: "tableContextMenuElement",
|
|
1993
|
-
ref:
|
|
2008
|
+
ref: Cr,
|
|
1994
2009
|
capabilities: z.value.capabilities,
|
|
1995
2010
|
"active-alignment": z.value.activeAlignment,
|
|
1996
|
-
style:
|
|
2011
|
+
style: Mt({
|
|
1997
2012
|
left: `${z.value.x}px`,
|
|
1998
2013
|
top: `${z.value.y}px`
|
|
1999
2014
|
}),
|
|
2000
|
-
onExecute:
|
|
2001
|
-
onKeydown:
|
|
2015
|
+
onExecute: ac,
|
|
2016
|
+
onKeydown: oc
|
|
2002
2017
|
}, null, 8, [
|
|
2003
2018
|
"capabilities",
|
|
2004
2019
|
"active-alignment",
|
|
2005
2020
|
"style"
|
|
2006
2021
|
])) : p("", !0),
|
|
2007
|
-
B.value ? (v(),
|
|
2022
|
+
B.value ? (v(), Ot(Qe, {
|
|
2008
2023
|
key: 1,
|
|
2009
2024
|
ref_key: "imageContextMenuElement",
|
|
2010
|
-
ref:
|
|
2011
|
-
width:
|
|
2012
|
-
"onUpdate:width": t[22] ||= (e) =>
|
|
2013
|
-
height:
|
|
2014
|
-
"onUpdate:height": t[23] ||= (e) =>
|
|
2025
|
+
ref: wr,
|
|
2026
|
+
width: Tr.value,
|
|
2027
|
+
"onUpdate:width": t[22] ||= (e) => Tr.value = e,
|
|
2028
|
+
height: Er.value,
|
|
2029
|
+
"onUpdate:height": t[23] ||= (e) => Er.value = e,
|
|
2015
2030
|
x: B.value.x,
|
|
2016
2031
|
y: B.value.y,
|
|
2017
2032
|
readonly: U.value,
|
|
2018
|
-
onRestore:
|
|
2019
|
-
onApply:
|
|
2020
|
-
onKeydown:
|
|
2033
|
+
onRestore: Rs,
|
|
2034
|
+
onApply: Ls,
|
|
2035
|
+
onKeydown: cc
|
|
2021
2036
|
}, null, 8, [
|
|
2022
2037
|
"width",
|
|
2023
2038
|
"height",
|
|
@@ -2025,21 +2040,21 @@ var Jt = {
|
|
|
2025
2040
|
"y",
|
|
2026
2041
|
"readonly"
|
|
2027
2042
|
])) : p("", !0),
|
|
2028
|
-
L.value ? (v(),
|
|
2043
|
+
L.value ? (v(), Ot(Xe, {
|
|
2029
2044
|
key: 2,
|
|
2030
2045
|
ref_key: "textContextMenuElement",
|
|
2031
|
-
ref:
|
|
2032
|
-
"bind-open":
|
|
2033
|
-
"onUpdate:bindOpen": t[24] ||= (e) =>
|
|
2034
|
-
"bind-keyword":
|
|
2035
|
-
"onUpdate:bindKeyword": t[25] ||= (e) =>
|
|
2046
|
+
ref: hr,
|
|
2047
|
+
"bind-open": xr.value,
|
|
2048
|
+
"onUpdate:bindOpen": t[24] ||= (e) => xr.value = e,
|
|
2049
|
+
"bind-keyword": Sr.value,
|
|
2050
|
+
"onUpdate:bindKeyword": t[25] ||= (e) => Sr.value = e,
|
|
2036
2051
|
x: L.value.x,
|
|
2037
2052
|
y: L.value.y,
|
|
2038
2053
|
"has-selection": L.value.hasSelection,
|
|
2039
2054
|
"editor-state": q.value,
|
|
2040
|
-
"current-editor-text-color":
|
|
2041
|
-
"body-control-tool-items":
|
|
2042
|
-
"text-menu-bindable-variables":
|
|
2055
|
+
"current-editor-text-color": Gi.value,
|
|
2056
|
+
"body-control-tool-items": Ti.value,
|
|
2057
|
+
"text-menu-bindable-variables": zi.value,
|
|
2043
2058
|
"variables-count": T.value.variables.length,
|
|
2044
2059
|
"resolve-bind-variable-type-label": po,
|
|
2045
2060
|
onCommand: ha,
|
|
@@ -2048,8 +2063,8 @@ var Jt = {
|
|
|
2048
2063
|
onInsertVariable: lo,
|
|
2049
2064
|
onBindVariable: fo,
|
|
2050
2065
|
onOpenBindPanel: mo,
|
|
2051
|
-
onKeydown:
|
|
2052
|
-
onPatchColor:
|
|
2066
|
+
onKeydown: sc,
|
|
2067
|
+
onPatchColor: Ds
|
|
2053
2068
|
}, null, 8, [
|
|
2054
2069
|
"bind-open",
|
|
2055
2070
|
"bind-keyword",
|
|
@@ -2062,27 +2077,27 @@ var Jt = {
|
|
|
2062
2077
|
"text-menu-bindable-variables",
|
|
2063
2078
|
"variables-count"
|
|
2064
2079
|
])) : p("", !0),
|
|
2065
|
-
R.value ? (v(),
|
|
2080
|
+
R.value ? (v(), Ot(Ze, {
|
|
2066
2081
|
key: 3,
|
|
2067
2082
|
ref_key: "textBubbleElement",
|
|
2068
|
-
ref:
|
|
2083
|
+
ref: gr,
|
|
2069
2084
|
x: R.value.x,
|
|
2070
2085
|
y: R.value.y,
|
|
2071
2086
|
"editor-state": q.value,
|
|
2072
|
-
"font-size-preset-options":
|
|
2073
|
-
"current-editor-font-size":
|
|
2074
|
-
"editor-font-size-search-value":
|
|
2075
|
-
"current-editor-text-color":
|
|
2076
|
-
"text-align-options": b(
|
|
2077
|
-
onCommand:
|
|
2078
|
-
onPatchFontSize:
|
|
2079
|
-
onPatchTextAlign:
|
|
2080
|
-
onPatchColor:
|
|
2081
|
-
onFontSizeSearch:
|
|
2082
|
-
onFontSizeCommit:
|
|
2083
|
-
onFontSizeDropdownChange:
|
|
2084
|
-
onFontSizeKeydown:
|
|
2085
|
-
onMore:
|
|
2087
|
+
"font-size-preset-options": qi.value,
|
|
2088
|
+
"current-editor-font-size": Wi.value,
|
|
2089
|
+
"editor-font-size-search-value": ir.value,
|
|
2090
|
+
"current-editor-text-color": Gi.value,
|
|
2091
|
+
"text-align-options": b(hi),
|
|
2092
|
+
onCommand: Q,
|
|
2093
|
+
onPatchFontSize: ws,
|
|
2094
|
+
onPatchTextAlign: Ss,
|
|
2095
|
+
onPatchColor: Ds,
|
|
2096
|
+
onFontSizeSearch: Os,
|
|
2097
|
+
onFontSizeCommit: ks,
|
|
2098
|
+
onFontSizeDropdownChange: js,
|
|
2099
|
+
onFontSizeKeydown: As,
|
|
2100
|
+
onMore: Xs
|
|
2086
2101
|
}, null, 8, [
|
|
2087
2102
|
"x",
|
|
2088
2103
|
"y",
|
|
@@ -2096,7 +2111,7 @@ var Jt = {
|
|
|
2096
2111
|
])),
|
|
2097
2112
|
m("input", {
|
|
2098
2113
|
ref_key: "imageFileInputElement",
|
|
2099
|
-
ref:
|
|
2114
|
+
ref: En,
|
|
2100
2115
|
class: "gd-contract-template-designer__hidden-file-input",
|
|
2101
2116
|
type: "file",
|
|
2102
2117
|
accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
|
|
@@ -2104,17 +2119,17 @@ var Jt = {
|
|
|
2104
2119
|
"aria-hidden": "true",
|
|
2105
2120
|
onChange: Ba
|
|
2106
2121
|
}, null, 544),
|
|
2107
|
-
m("span",
|
|
2108
|
-
h(
|
|
2109
|
-
open:
|
|
2110
|
-
"onUpdate:open": t[26] ||= (e) =>
|
|
2111
|
-
"preview-pages":
|
|
2112
|
-
"preview-file-groups":
|
|
2113
|
-
"preview-active-group":
|
|
2114
|
-
"preview-snapshot":
|
|
2122
|
+
m("span", Qt, It(V.value), 1),
|
|
2123
|
+
h($e, {
|
|
2124
|
+
open: Un.value,
|
|
2125
|
+
"onUpdate:open": t[26] ||= (e) => Un.value = e,
|
|
2126
|
+
"preview-pages": ei.value,
|
|
2127
|
+
"preview-file-groups": ti.value,
|
|
2128
|
+
"preview-active-group": ni.value,
|
|
2129
|
+
"preview-snapshot": Wn.value,
|
|
2115
2130
|
"font-base-url": s.contractFontBaseUrl,
|
|
2116
2131
|
onCancel: No,
|
|
2117
|
-
onSelectFile: t[27] ||= (e) =>
|
|
2132
|
+
onSelectFile: t[27] ||= (e) => Kn.value = e
|
|
2118
2133
|
}, null, 8, [
|
|
2119
2134
|
"open",
|
|
2120
2135
|
"preview-pages",
|
|
@@ -2123,26 +2138,26 @@ var Jt = {
|
|
|
2123
2138
|
"preview-snapshot",
|
|
2124
2139
|
"font-base-url"
|
|
2125
2140
|
]),
|
|
2126
|
-
h(
|
|
2127
|
-
open:
|
|
2128
|
-
"onUpdate:open": t[28] ||= (e) =>
|
|
2129
|
-
json:
|
|
2141
|
+
h(et, {
|
|
2142
|
+
open: qn.value,
|
|
2143
|
+
"onUpdate:open": t[28] ||= (e) => qn.value = e,
|
|
2144
|
+
json: Jn.value,
|
|
2130
2145
|
onCancel: Io
|
|
2131
2146
|
}, null, 8, ["open", "json"]),
|
|
2132
|
-
h(
|
|
2133
|
-
open:
|
|
2134
|
-
"onUpdate:open": t[29] ||= (e) =>
|
|
2135
|
-
data:
|
|
2136
|
-
"file-name":
|
|
2147
|
+
h(tt, {
|
|
2148
|
+
open: Yn.value,
|
|
2149
|
+
"onUpdate:open": t[29] ||= (e) => Yn.value = e,
|
|
2150
|
+
data: Xn.value,
|
|
2151
|
+
"file-name": $r.value?.name,
|
|
2137
2152
|
onCancel: zo
|
|
2138
2153
|
}, null, 8, [
|
|
2139
2154
|
"open",
|
|
2140
2155
|
"data",
|
|
2141
2156
|
"file-name"
|
|
2142
2157
|
]),
|
|
2143
|
-
h(
|
|
2144
|
-
open:
|
|
2145
|
-
"onUpdate:open": t[30] ||= (e) =>
|
|
2158
|
+
h(nt, {
|
|
2159
|
+
open: lr.value,
|
|
2160
|
+
"onUpdate:open": t[30] ||= (e) => lr.value = e,
|
|
2146
2161
|
disabled: U.value,
|
|
2147
2162
|
onInsert: fa
|
|
2148
2163
|
}, null, 8, ["open", "disabled"])
|
|
@@ -2150,4 +2165,4 @@ var Jt = {
|
|
|
2150
2165
|
}
|
|
2151
2166
|
});
|
|
2152
2167
|
//#endregion
|
|
2153
|
-
export {
|
|
2168
|
+
export { mn as default };
|