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