@guodun/antdv 1.7.6 → 1.7.8
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/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +152 -146
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +415 -295
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1040 -993
- package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +141 -47
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/composables/use-page-authoring.mjs +22 -21
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +37 -36
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +125 -75
- package/dist/es/components/pro-contract-template-designer/src/utils/authoring-search.mjs +34 -13
- package/dist/es/components/pro-contract-template-designer/src/utils/caret-viewport.mjs +41 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/document-outline.mjs +24 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.mjs +15 -0
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +21 -21
- package/dist/es/node_modules/@tiptap/pm/dist/transform/index.mjs +1 -0
- package/dist/es/node_modules/prosemirror-transform/dist/index.mjs +161 -67
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-page-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-search.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/caret-viewport.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/document-outline.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/node_modules/@tiptap/pm/dist/transform/index.cjs +1 -0
- package/dist/lib/node_modules/prosemirror-transform/dist/index.cjs +2 -2
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +28 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +25 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +10 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/authoring-search.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/caret-viewport.d.ts +18 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/document-outline.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.d.ts +16 -0
- package/package.json +3 -3
- package/dist/theme/dept-selector.css +0 -1
- package/dist/theme/pro-selector-group.css +0 -1
- package/dist/theme/role-selector.css +0 -1
|
@@ -1,58 +1,59 @@
|
|
|
1
1
|
import { getFieldOption as e } from "./composables/use-template-designer.mjs";
|
|
2
2
|
import { resolveFieldTypeIcon as t } from "./utils/template-tool-icons.mjs";
|
|
3
3
|
import n from "./ContractTemplatePanelTabs.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { createContractPageNavigationCache as r } from "./utils/document-outline.mjs";
|
|
5
5
|
import { matchesContractPanelSearch as i } from "./utils/panel-search.mjs";
|
|
6
|
-
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, normalizeStyle as ee, openBlock as h, reactive as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { CopyOutlined as
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, normalizeStyle as ee, onScopeDispose as te, openBlock as h, reactive as ne, renderList as g, resolveDynamicComponent as re, shallowRef as ie, toDisplayString as _, unref as v, useId as ae, vShow as y, watch as b, withCtx as x, withDirectives as S } from "vue";
|
|
7
|
+
import { Button as C, Input as oe, Select as se, Tooltip as w } from "ant-design-vue";
|
|
8
|
+
import { CopyOutlined as ce, DeleteOutlined as le, LeftOutlined as ue, PlusOutlined as de, RightOutlined as fe, SearchOutlined as pe } from "@ant-design/icons-vue";
|
|
9
9
|
//#region src/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var me = ["aria-label", "aria-expanded"], T = { class: "gd-contract-template-designer__panel-stack" }, E = { class: "gd-contract-authoring-panel__body" }, D = { class: "gd-contract-authoring-panel__search" }, O = { class: "gd-contract-authoring-panel__results" }, k = {
|
|
11
11
|
role: "status",
|
|
12
12
|
"aria-live": "polite"
|
|
13
|
-
},
|
|
13
|
+
}, A = ["id", "aria-labelledby"], j = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "gd-contract-authoring-panel__empty"
|
|
16
|
-
},
|
|
16
|
+
}, M = [
|
|
17
17
|
"aria-current",
|
|
18
18
|
"aria-label",
|
|
19
19
|
"onClick"
|
|
20
|
-
],
|
|
20
|
+
], N = {
|
|
21
21
|
class: "gd-contract-authoring-panel__page-number",
|
|
22
22
|
"aria-hidden": "true"
|
|
23
|
-
},
|
|
23
|
+
}, P = { class: "gd-contract-authoring-panel__page-copy" }, F = { class: "gd-contract-authoring-panel__item-title" }, I = { class: "gd-contract-authoring-panel__summary" }, L = { class: "gd-contract-authoring-panel__meta" }, R = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "gd-contract-authoring-panel__page-config"
|
|
26
|
-
},
|
|
26
|
+
}, z = { class: "gd-contract-authoring-panel__section-heading" }, he = ["aria-label"], ge = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "gd-contract-authoring-panel__field"
|
|
29
|
-
},
|
|
29
|
+
}, _e = { class: "gd-contract-authoring-panel__meta" }, ve = { class: "gd-contract-authoring-panel__page-actions" }, B = ["id", "aria-labelledby"], ye = {
|
|
30
30
|
key: 0,
|
|
31
31
|
class: "gd-contract-authoring-panel__empty"
|
|
32
|
-
},
|
|
32
|
+
}, be = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "gd-contract-authoring-panel__meta"
|
|
35
|
-
},
|
|
35
|
+
}, xe = { class: "gd-contract-authoring-panel__outline-page" }, Se = { class: "gd-contract-authoring-panel__outline-list" }, Ce = ["aria-label", "onClick"], we = {
|
|
36
36
|
class: "gd-contract-authoring-panel__heading-level",
|
|
37
37
|
"aria-hidden": "true"
|
|
38
|
-
},
|
|
38
|
+
}, Te = ["id", "aria-labelledby"], Ee = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "gd-contract-authoring-panel__empty"
|
|
41
|
-
},
|
|
41
|
+
}, De = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "gd-contract-authoring-panel__meta"
|
|
44
|
-
},
|
|
44
|
+
}, Oe = [
|
|
45
45
|
"aria-pressed",
|
|
46
46
|
"aria-label",
|
|
47
47
|
"onClick"
|
|
48
|
-
],
|
|
48
|
+
], ke = {
|
|
49
49
|
class: "gd-contract-authoring-panel__variable-icon",
|
|
50
50
|
"aria-hidden": "true"
|
|
51
|
-
},
|
|
51
|
+
}, Ae = { class: "gd-contract-authoring-panel__variable-copy" }, je = { class: "gd-contract-authoring-panel__item-title" }, Me = { class: "gd-contract-authoring-panel__meta" }, V = /* @__PURE__ */ p({
|
|
52
52
|
name: "ContractTemplateDesignerSidebar",
|
|
53
53
|
__name: "ContractTemplateDesignerSidebar",
|
|
54
54
|
props: {
|
|
55
55
|
collapsed: { type: Boolean },
|
|
56
|
+
fileId: {},
|
|
56
57
|
pages: {},
|
|
57
58
|
variables: {},
|
|
58
59
|
decorationVariableKeys: {},
|
|
@@ -78,12 +79,12 @@ var pe = ["aria-label", "aria-expanded"], w = { class: "gd-contract-template-des
|
|
|
78
79
|
"scrollToVariable",
|
|
79
80
|
"navigateOutline"
|
|
80
81
|
],
|
|
81
|
-
setup(p, { emit:
|
|
82
|
-
let
|
|
82
|
+
setup(p, { emit: V }) {
|
|
83
|
+
let H = p, U = V, W = `gd-contract-navigation-${ae()}`, G = ie("pages"), K = ne({
|
|
83
84
|
pages: "",
|
|
84
85
|
outline: "",
|
|
85
86
|
variables: ""
|
|
86
|
-
}),
|
|
87
|
+
}), Ne = [
|
|
87
88
|
{
|
|
88
89
|
value: "pages",
|
|
89
90
|
label: "页面"
|
|
@@ -96,233 +97,238 @@ var pe = ["aria-label", "aria-expanded"], w = { class: "gd-contract-template-des
|
|
|
96
97
|
value: "variables",
|
|
97
98
|
label: "变量"
|
|
98
99
|
}
|
|
99
|
-
],
|
|
100
|
+
], Pe = {
|
|
100
101
|
pages: "搜索页面",
|
|
101
102
|
outline: "搜索大纲",
|
|
102
103
|
variables: "搜索变量"
|
|
103
|
-
},
|
|
104
|
+
}, Fe = {
|
|
104
105
|
pages: "页名、页码或正文",
|
|
105
106
|
outline: "标题文字或所在页",
|
|
106
107
|
variables: "名称、类型或变量标识"
|
|
107
|
-
},
|
|
108
|
-
get: () =>
|
|
108
|
+
}, q = o({
|
|
109
|
+
get: () => K[G.value],
|
|
109
110
|
set: (e) => {
|
|
110
|
-
|
|
111
|
+
K[G.value] = e;
|
|
111
112
|
}
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
}), J = r();
|
|
114
|
+
b(() => H.fileId, () => J.clear(), { flush: "sync" }), b(() => JSON.stringify(H.pages.map((e) => e.id)), () => J.retainPages(H.pages)), te(() => J.clear());
|
|
115
|
+
let Y = o(() => {
|
|
116
|
+
let e = J.readPages(H.pages);
|
|
117
|
+
return H.pages.map((t, n) => {
|
|
118
|
+
let r = H.getPageSize(t);
|
|
119
|
+
return {
|
|
120
|
+
page: t,
|
|
121
|
+
number: n + 1,
|
|
122
|
+
title: t.title || `第 ${n + 1} 页`,
|
|
123
|
+
format: r.label || r.format || "自定义",
|
|
124
|
+
...e[n]
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}), X = o(() => Y.value.filter((e) => i(K.pages, e.title, `第 ${e.number} 页`, e.format, e.text))), Z = o(() => Y.value.map((e) => ({
|
|
119
128
|
...e,
|
|
120
|
-
headings: e.headings.filter((t) => i(
|
|
121
|
-
})).filter((e) => e.headings.length > 0)),
|
|
129
|
+
headings: e.headings.filter((t) => i(K.outline, t.text, e.title, `第 ${e.number} 页`))
|
|
130
|
+
})).filter((e) => e.headings.length > 0)), Ie = o(() => Y.value.reduce((e, t) => e + t.headings.length, 0)), Q = o(() => Z.value.reduce((e, t) => e + t.headings.length, 0)), Le = o(() => H.variables.map((t) => ({
|
|
122
131
|
variable: t,
|
|
123
132
|
typeLabel: e(t.type || "text").label,
|
|
124
|
-
decoration:
|
|
125
|
-
}))), $ = o(() =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
variables
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
]
|
|
142
|
-
}[K.value];
|
|
143
|
-
return J.value.trim() ? `找到 ${e} / ${t} ${n}` : `共 ${t} ${n}`;
|
|
133
|
+
decoration: H.decorationVariableKeys.includes(t.key)
|
|
134
|
+
}))), $ = o(() => Le.value.filter((e) => i(K.variables, e.variable.label, e.variable.key, e.variable.type || "text", e.typeLabel, e.decoration ? "页面装饰" : "正文"))), Re = o(() => {
|
|
135
|
+
if (H.collapsed) return "";
|
|
136
|
+
let [e, t, n] = G.value === "pages" ? [
|
|
137
|
+
X.value.length,
|
|
138
|
+
H.pages.length,
|
|
139
|
+
"页"
|
|
140
|
+
] : G.value === "outline" ? [
|
|
141
|
+
Q.value,
|
|
142
|
+
Ie.value,
|
|
143
|
+
"个标题"
|
|
144
|
+
] : [
|
|
145
|
+
$.value.length,
|
|
146
|
+
H.variables.length,
|
|
147
|
+
"个变量"
|
|
148
|
+
];
|
|
149
|
+
return q.value.trim() ? `找到 ${e} / ${t} ${n}` : `共 ${t} ${n}`;
|
|
144
150
|
});
|
|
145
|
-
function
|
|
146
|
-
(e === "pages" || e === "outline" || e === "variables") && (
|
|
151
|
+
function ze(e) {
|
|
152
|
+
(e === "pages" || e === "outline" || e === "variables") && (G.value = e);
|
|
147
153
|
}
|
|
148
154
|
return (e, r) => (h(), l("aside", {
|
|
149
|
-
class: m(["gd-contract-template-designer__sidebar gd-contract-authoring-panel", { "is-collapsed":
|
|
155
|
+
class: m(["gd-contract-template-designer__sidebar gd-contract-authoring-panel", { "is-collapsed": H.collapsed }]),
|
|
150
156
|
"aria-label": "合同内容导航"
|
|
151
|
-
}, [f(v(
|
|
152
|
-
default:
|
|
157
|
+
}, [f(v(w), { title: H.collapsed ? "展开页面栏" : "收起页面栏" }, {
|
|
158
|
+
default: x(() => [u("button", {
|
|
153
159
|
type: "button",
|
|
154
160
|
class: "gd-contract-template-designer__panel-handle gd-contract-authoring-panel__handle",
|
|
155
|
-
"aria-label":
|
|
156
|
-
"aria-expanded": !
|
|
157
|
-
onClick: r[0] ||= (e) =>
|
|
158
|
-
}, [
|
|
161
|
+
"aria-label": H.collapsed ? "展开页面栏" : "收起页面栏",
|
|
162
|
+
"aria-expanded": !H.collapsed,
|
|
163
|
+
onClick: r[0] ||= (e) => U("toggle")
|
|
164
|
+
}, [H.collapsed ? (h(), s(v(fe), {
|
|
159
165
|
key: 0,
|
|
160
166
|
"aria-hidden": "true"
|
|
161
|
-
})) : (h(), s(v(
|
|
167
|
+
})) : (h(), s(v(ue), {
|
|
162
168
|
key: 1,
|
|
163
169
|
"aria-hidden": "true"
|
|
164
|
-
}))], 8,
|
|
170
|
+
}))], 8, me)]),
|
|
165
171
|
_: 1
|
|
166
|
-
}, 8, ["title"]), u("div",
|
|
172
|
+
}, 8, ["title"]), u("div", T, [u("div", E, [
|
|
167
173
|
f(n, {
|
|
168
|
-
id:
|
|
169
|
-
"model-value":
|
|
170
|
-
items:
|
|
174
|
+
id: W,
|
|
175
|
+
"model-value": G.value,
|
|
176
|
+
items: Ne,
|
|
171
177
|
label: "导航视图",
|
|
172
|
-
"onUpdate:modelValue":
|
|
178
|
+
"onUpdate:modelValue": ze
|
|
173
179
|
}, null, 8, ["model-value"]),
|
|
174
|
-
u("div",
|
|
175
|
-
value:
|
|
176
|
-
"onUpdate:value": r[1] ||= (e) =>
|
|
180
|
+
u("div", D, [f(v(oe), {
|
|
181
|
+
value: q.value,
|
|
182
|
+
"onUpdate:value": r[1] ||= (e) => q.value = e,
|
|
177
183
|
"allow-clear": "",
|
|
178
184
|
type: "search",
|
|
179
|
-
"aria-label":
|
|
180
|
-
placeholder:
|
|
185
|
+
"aria-label": Pe[G.value],
|
|
186
|
+
placeholder: Fe[G.value]
|
|
181
187
|
}, {
|
|
182
|
-
prefix:
|
|
188
|
+
prefix: x(() => [f(v(pe), { "aria-hidden": "true" })]),
|
|
183
189
|
_: 1
|
|
184
190
|
}, 8, [
|
|
185
191
|
"value",
|
|
186
192
|
"aria-label",
|
|
187
193
|
"placeholder"
|
|
188
194
|
])]),
|
|
189
|
-
u("div",
|
|
195
|
+
u("div", O, [u("span", k, _(Re.value), 1), G.value === "pages" ? (h(), s(v(w), {
|
|
190
196
|
key: 0,
|
|
191
|
-
title:
|
|
197
|
+
title: H.pageLimitReached ? `已达 ${H.normalizedMaxPages} 页上限` : "新增页面"
|
|
192
198
|
}, {
|
|
193
|
-
default:
|
|
199
|
+
default: x(() => [f(v(C), {
|
|
194
200
|
type: "text",
|
|
195
201
|
size: "small",
|
|
196
202
|
class: "gd-contract-authoring-panel__action",
|
|
197
|
-
disabled:
|
|
203
|
+
disabled: H.readonly || H.pageLimitReached,
|
|
198
204
|
"aria-label": "新增页面",
|
|
199
|
-
onClick: r[2] ||= (e) =>
|
|
205
|
+
onClick: r[2] ||= (e) => U("addPage")
|
|
200
206
|
}, {
|
|
201
|
-
default:
|
|
207
|
+
default: x(() => [f(v(de), { "aria-hidden": "true" }), r[10] ||= d("新增", -1)]),
|
|
202
208
|
_: 1
|
|
203
209
|
}, 8, ["disabled"])]),
|
|
204
210
|
_: 1
|
|
205
211
|
}, 8, ["title"])) : c("", !0)]),
|
|
206
|
-
|
|
207
|
-
id: `${
|
|
212
|
+
S(u("section", {
|
|
213
|
+
id: `${W}-panel-pages`,
|
|
208
214
|
role: "tabpanel",
|
|
209
|
-
"aria-labelledby": `${
|
|
215
|
+
"aria-labelledby": `${W}-tab-pages`,
|
|
210
216
|
class: "gd-contract-authoring-panel__view"
|
|
211
|
-
}, [
|
|
212
|
-
X.value.length ? c("", !0) : (h(), l("div",
|
|
217
|
+
}, [!H.collapsed && G.value === "pages" ? (h(), l(a, { key: 0 }, [
|
|
218
|
+
X.value.length ? c("", !0) : (h(), l("div", j, [u("span", null, _(K.pages.trim() ? "没有匹配的页面" : "暂无页面"), 1), K.pages.trim() ? (h(), s(v(C), {
|
|
213
219
|
key: 0,
|
|
214
220
|
type: "link",
|
|
215
|
-
onClick: r[3] ||= (e) =>
|
|
221
|
+
onClick: r[3] ||= (e) => K.pages = ""
|
|
216
222
|
}, {
|
|
217
|
-
default:
|
|
223
|
+
default: x(() => [...r[11] ||= [d("清空搜索", -1)]]),
|
|
218
224
|
_: 1
|
|
219
|
-
})) : (h(), s(v(
|
|
225
|
+
})) : (h(), s(v(C), {
|
|
220
226
|
key: 1,
|
|
221
|
-
disabled:
|
|
222
|
-
onClick: r[4] ||= (e) =>
|
|
227
|
+
disabled: H.readonly || H.pageLimitReached,
|
|
228
|
+
onClick: r[4] ||= (e) => U("addPage")
|
|
223
229
|
}, {
|
|
224
|
-
default:
|
|
230
|
+
default: x(() => [...r[12] ||= [d("新增页面", -1)]]),
|
|
225
231
|
_: 1
|
|
226
232
|
}, 8, ["disabled"]))])),
|
|
227
233
|
(h(!0), l(a, null, g(X.value, (e) => (h(), l("button", {
|
|
228
234
|
key: e.page.id,
|
|
229
235
|
type: "button",
|
|
230
|
-
class: m(["gd-contract-authoring-panel__page", { "is-active":
|
|
231
|
-
"aria-current":
|
|
236
|
+
class: m(["gd-contract-authoring-panel__page", { "is-active": H.activePageId === e.page.id }]),
|
|
237
|
+
"aria-current": H.activePageId === e.page.id ? "page" : void 0,
|
|
232
238
|
"aria-label": `第 ${e.number} 页:${e.title},${e.format}`,
|
|
233
|
-
onClick: (t) =>
|
|
234
|
-
}, [u("span",
|
|
235
|
-
u("span",
|
|
236
|
-
u("span",
|
|
237
|
-
u("small",
|
|
238
|
-
])], 10,
|
|
239
|
-
|
|
240
|
-
u("div",
|
|
239
|
+
onClick: (t) => U("activatePage", e.page.id)
|
|
240
|
+
}, [u("span", N, _(e.number), 1), u("span", P, [
|
|
241
|
+
u("span", F, _(e.title), 1),
|
|
242
|
+
u("span", I, _(e.summary || "暂无正文文字"), 1),
|
|
243
|
+
u("small", L, "第 " + _(e.number) + " 页 · " + _(e.format), 1)
|
|
244
|
+
])], 10, M))), 128)),
|
|
245
|
+
H.selectedPage ? (h(), l("div", R, [
|
|
246
|
+
u("div", z, [r[13] ||= u("span", null, "页面数量", -1), u("small", {
|
|
241
247
|
class: "gd-contract-authoring-panel__meta",
|
|
242
|
-
"aria-label": `共 ${
|
|
243
|
-
}, _(
|
|
244
|
-
|
|
245
|
-
value:
|
|
246
|
-
options:
|
|
247
|
-
disabled:
|
|
248
|
+
"aria-label": `共 ${H.pages.length} 页,上限 ${H.normalizedMaxPages} 页`
|
|
249
|
+
}, _(H.pages.length) + " / " + _(H.normalizedMaxPages), 9, he)]),
|
|
250
|
+
H.normalizedPageSizeOptions.length > 1 ? (h(), l("label", ge, [r[14] ||= u("span", null, "页面格式", -1), f(v(se), {
|
|
251
|
+
value: H.selectedPageSizeOptionValue,
|
|
252
|
+
options: H.pageSizeOptions,
|
|
253
|
+
disabled: H.readonly,
|
|
248
254
|
"aria-label": "当前页面格式",
|
|
249
|
-
onChange: r[5] ||= (e) =>
|
|
255
|
+
onChange: r[5] ||= (e) => U("patchPageFormat", e)
|
|
250
256
|
}, null, 8, [
|
|
251
257
|
"value",
|
|
252
258
|
"options",
|
|
253
259
|
"disabled"
|
|
254
260
|
])])) : c("", !0),
|
|
255
|
-
u("small",
|
|
256
|
-
u("div",
|
|
257
|
-
disabled:
|
|
261
|
+
u("small", _e, _(H.selectedPageSize.width) + " × " + _(H.selectedPageSize.height) + " px", 1),
|
|
262
|
+
u("div", ve, [f(v(C), {
|
|
263
|
+
disabled: H.readonly || H.pageLimitReached,
|
|
258
264
|
"aria-label": "复制页面",
|
|
259
|
-
onClick: r[6] ||= (e) =>
|
|
265
|
+
onClick: r[6] ||= (e) => U("duplicatePage", H.selectedPage)
|
|
260
266
|
}, {
|
|
261
|
-
default:
|
|
267
|
+
default: x(() => [f(v(ce), { "aria-hidden": "true" }), r[15] ||= d("复制页 ", -1)]),
|
|
262
268
|
_: 1
|
|
263
|
-
}, 8, ["disabled"]), f(v(
|
|
269
|
+
}, 8, ["disabled"]), f(v(C), {
|
|
264
270
|
type: "text",
|
|
265
271
|
danger: "",
|
|
266
|
-
disabled:
|
|
272
|
+
disabled: H.readonly || H.pages.length <= 1,
|
|
267
273
|
"aria-label": "删除页面",
|
|
268
|
-
onClick: r[7] ||= (e) =>
|
|
274
|
+
onClick: r[7] ||= (e) => U("removePage", H.selectedPage)
|
|
269
275
|
}, {
|
|
270
|
-
default:
|
|
276
|
+
default: x(() => [f(v(le), { "aria-hidden": "true" }), r[16] ||= d("删除页 ", -1)]),
|
|
271
277
|
_: 1
|
|
272
278
|
}, 8, ["disabled"])])
|
|
273
279
|
])) : c("", !0)
|
|
274
|
-
], 8,
|
|
275
|
-
|
|
276
|
-
id: `${
|
|
280
|
+
], 64)) : c("", !0)], 8, A), [[y, G.value === "pages"]]),
|
|
281
|
+
S(u("section", {
|
|
282
|
+
id: `${W}-panel-outline`,
|
|
277
283
|
role: "tabpanel",
|
|
278
|
-
"aria-labelledby": `${
|
|
284
|
+
"aria-labelledby": `${W}-tab-outline`,
|
|
279
285
|
class: "gd-contract-authoring-panel__view"
|
|
280
|
-
}, [Q.value ? c("", !0) : (h(), l("div",
|
|
286
|
+
}, [!H.collapsed && G.value === "outline" ? (h(), l(a, { key: 0 }, [Q.value ? c("", !0) : (h(), l("div", ye, [u("span", null, _(K.outline.trim() ? "没有匹配的标题" : "正文还没有标题"), 1), K.outline.trim() ? (h(), s(v(C), {
|
|
281
287
|
key: 1,
|
|
282
288
|
type: "link",
|
|
283
|
-
onClick: r[8] ||= (e) =>
|
|
289
|
+
onClick: r[8] ||= (e) => K.outline = ""
|
|
284
290
|
}, {
|
|
285
|
-
default:
|
|
291
|
+
default: x(() => [...r[17] ||= [d("清空搜索", -1)]]),
|
|
286
292
|
_: 1
|
|
287
|
-
})) : (h(), l("small",
|
|
293
|
+
})) : (h(), l("small", be, "在正文使用标题样式后,即可在这里定位条款。"))])), (h(!0), l(a, null, g(Z.value, (e) => (h(), l("div", {
|
|
288
294
|
key: e.page.id,
|
|
289
295
|
class: "gd-contract-authoring-panel__outline-group"
|
|
290
|
-
}, [u("div",
|
|
296
|
+
}, [u("div", xe, "第 " + _(e.number) + " 页 · " + _(e.title), 1), u("ul", Se, [(h(!0), l(a, null, g(e.headings, (t) => (h(), l("li", { key: t.headingIndex }, [u("button", {
|
|
291
297
|
type: "button",
|
|
292
|
-
class: m(["gd-contract-authoring-panel__outline-item", { "is-current-page":
|
|
298
|
+
class: m(["gd-contract-authoring-panel__outline-item", { "is-current-page": H.activePageId === t.pageId }]),
|
|
293
299
|
style: ee({ "--gd-authoring-outline-depth": t.depth }),
|
|
294
300
|
"aria-label": `${t.text},第 ${e.number} 页,${t.level} 级标题`,
|
|
295
|
-
onClick: (e) =>
|
|
301
|
+
onClick: (e) => U("navigateOutline", {
|
|
296
302
|
pageId: t.pageId,
|
|
297
303
|
headingIndex: t.headingIndex
|
|
298
304
|
})
|
|
299
|
-
}, [u("small",
|
|
300
|
-
|
|
301
|
-
id: `${
|
|
305
|
+
}, [u("small", we, "H" + _(t.level), 1), u("span", null, _(t.text), 1)], 14, Ce)]))), 128))])]))), 128))], 64)) : c("", !0)], 8, B), [[y, G.value === "outline"]]),
|
|
306
|
+
S(u("section", {
|
|
307
|
+
id: `${W}-panel-variables`,
|
|
302
308
|
role: "tabpanel",
|
|
303
|
-
"aria-labelledby": `${
|
|
309
|
+
"aria-labelledby": `${W}-tab-variables`,
|
|
304
310
|
class: "gd-contract-authoring-panel__view"
|
|
305
|
-
}, [
|
|
311
|
+
}, [!H.collapsed && G.value === "variables" ? (h(), l(a, { key: 0 }, [
|
|
306
312
|
r[19] ||= u("div", { class: "gd-contract-authoring-panel__section-heading" }, [u("strong", null, "控件参数")], -1),
|
|
307
|
-
$.value.length ? c("", !0) : (h(), l("div",
|
|
313
|
+
$.value.length ? c("", !0) : (h(), l("div", Ee, [u("span", null, _(K.variables.trim() ? "没有匹配的变量" : "暂无正文控件"), 1), K.variables.trim() ? (h(), s(v(C), {
|
|
308
314
|
key: 1,
|
|
309
315
|
type: "link",
|
|
310
|
-
onClick: r[9] ||= (e) =>
|
|
316
|
+
onClick: r[9] ||= (e) => K.variables = ""
|
|
311
317
|
}, {
|
|
312
|
-
default:
|
|
318
|
+
default: x(() => [...r[18] ||= [d("清空搜索", -1)]]),
|
|
313
319
|
_: 1
|
|
314
|
-
})) : (h(), l("small",
|
|
320
|
+
})) : (h(), l("small", De, "从右侧「插入控件」添加,选中后可定位并修改属性。"))])),
|
|
315
321
|
(h(!0), l(a, null, g($.value, (e) => (h(), l("button", {
|
|
316
322
|
key: e.variable.id,
|
|
317
323
|
type: "button",
|
|
318
|
-
class: m(["gd-contract-template-designer__nav-item gd-contract-authoring-panel__variable", { "is-active":
|
|
319
|
-
"aria-pressed":
|
|
324
|
+
class: m(["gd-contract-template-designer__nav-item gd-contract-authoring-panel__variable", { "is-active": H.selectedVariableKey === e.variable.key }]),
|
|
325
|
+
"aria-pressed": H.selectedVariableKey === e.variable.key,
|
|
320
326
|
"aria-label": `定位变量:${e.variable.label}(${e.variable.key})`,
|
|
321
|
-
onClick: (t) =>
|
|
322
|
-
}, [u("span",
|
|
323
|
-
], 8,
|
|
327
|
+
onClick: (t) => U("scrollToVariable", e.variable)
|
|
328
|
+
}, [u("span", ke, [(h(), s(re(v(t)(e.variable.type))))]), u("span", Ae, [u("span", je, _(e.variable.label), 1), u("small", Me, _(e.decoration ? "页面装饰" : e.typeLabel) + " · " + _(e.variable.key), 1)])], 10, Oe))), 128))
|
|
329
|
+
], 64)) : c("", !0)], 8, Te), [[y, G.value === "variables"]])
|
|
324
330
|
])])], 2));
|
|
325
331
|
}
|
|
326
332
|
});
|
|
327
333
|
//#endregion
|
|
328
|
-
export {
|
|
334
|
+
export { V as default };
|