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