@guodun/antdv 1.4.1 → 1.4.2

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.
Files changed (116) hide show
  1. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +208 -180
  2. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
  3. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
  4. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
  5. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
  6. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +215 -0
  7. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
  11. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
  12. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
  13. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
  14. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
  15. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
  16. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
  17. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
  18. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.mjs +5 -0
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
  23. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +313 -267
  24. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1278 -2293
  25. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
  26. package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
  27. package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
  28. package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
  29. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
  30. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
  31. package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
  32. package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
  33. package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
  34. package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
  35. package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
  36. package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
  37. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
  38. package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
  39. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
  40. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  41. package/dist/es/index.mjs +20 -20
  42. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -1
  43. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
  44. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
  45. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
  46. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
  47. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
  48. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
  49. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
  50. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
  51. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
  52. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
  53. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
  54. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
  55. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
  56. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
  57. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
  58. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.cjs +1 -0
  64. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  65. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  66. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -0
  67. package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
  68. package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
  69. package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +1 -0
  70. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  71. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -2
  72. package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
  73. package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
  74. package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
  75. package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
  76. package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
  78. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
  79. package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
  80. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  81. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  82. package/dist/lib/index.cjs +1 -1
  83. package/dist/theme/icon.css +1 -1
  84. package/dist/theme/index.css +1 -1
  85. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +3 -0
  86. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
  87. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
  88. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +50 -0
  89. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
  90. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
  91. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
  92. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
  93. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
  94. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
  95. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
  96. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
  97. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
  98. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
  99. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +8 -32
  100. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +366 -12
  101. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
  102. package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
  103. package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
  104. package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
  105. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
  106. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
  107. package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
  108. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
  109. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
  110. package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
  111. package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +22 -0
  112. package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
  113. package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
  114. package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
  115. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
  116. package/package.json +1 -1
@@ -0,0 +1,550 @@
1
+ import { createPageDecorationPreset as e, normalizePageDecorations as t, resolvePageDecorationPreset as n, validatePageDecorations as ee } from "./utils/page-decorations.mjs";
2
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, renderList as m, shallowRef as h, toDisplayString as g, unref as _, watch as v, withCtx as y, withKeys as b } from "vue";
3
+ import { Alert as te, Button as x, Dropdown as S, Input as C, InputNumber as w, Menu as T, MenuItem as E, Modal as ne, Select as D, Switch as O, TabPane as k, Tabs as re, Tooltip as ie } from "ant-design-vue";
4
+ import { DownOutlined as A, ReloadOutlined as ae } from "@ant-design/icons-vue";
5
+ //#region src/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue?vue&type=script&setup=true&lang.ts
6
+ var oe = {
7
+ key: 0,
8
+ class: "gd-contract-template-designer__panel-head"
9
+ }, se = { class: "gd-contract-template-designer__decoration-plan" }, ce = { class: "gd-contract-template-designer__form-row is-compact" }, le = { class: "gd-contract-template-designer__decoration-tab-label" }, ue = { class: "gd-contract-template-designer__decoration-form" }, de = { class: "gd-contract-template-designer__switch-row" }, fe = { class: "gd-contract-template-designer__switch-row" }, pe = {
10
+ key: 0,
11
+ class: "gd-contract-template-designer__switch-row"
12
+ }, me = { class: "gd-contract-template-designer__decoration-slots-grid" }, he = ["data-decoration-slot", "data-page-decoration-path"], ge = { class: "gd-contract-template-designer__form-row is-compact" }, _e = { class: "gd-contract-template-designer__decoration-advanced" }, ve = { class: "gd-contract-template-designer__decoration-advanced-content" }, ye = { class: "gd-contract-template-designer__form-row is-compact" }, be = { class: "gd-contract-template-designer__decoration-control-grid" }, xe = { class: "gd-contract-template-designer__unit-control" }, j = { class: "gd-contract-template-designer__unit-control" }, M = { class: "gd-contract-template-designer__color-control" }, Se = [
13
+ "value",
14
+ "disabled",
15
+ "aria-label",
16
+ "onInput"
17
+ ], Ce = { class: "gd-contract-template-designer__switch-row" }, we = {
18
+ key: 0,
19
+ class: "gd-contract-template-designer__color-row"
20
+ }, Te = { class: "gd-contract-template-designer__color-control" }, Ee = [
21
+ "value",
22
+ "disabled",
23
+ "aria-label",
24
+ "onInput"
25
+ ], De = { class: "gd-contract-template-designer__decoration-tab-label" }, Oe = { class: "gd-contract-template-designer__decoration-form" }, ke = { class: "gd-contract-template-designer__switch-row" }, Ae = { class: "gd-contract-template-designer__switch-row" }, je = {
26
+ class: "gd-contract-template-designer__decoration-slot-editor gd-contract-template-designer__decoration-watermark-editor",
27
+ "data-page-decoration-path": "watermark.text"
28
+ }, Me = { class: "gd-contract-template-designer__form-row is-compact" }, Ne = { class: "gd-contract-template-designer__form-row is-compact" }, Pe = {
29
+ key: 0,
30
+ class: "gd-contract-template-designer__form-row is-compact"
31
+ }, Fe = { class: "gd-contract-template-designer__decoration-advanced" }, Ie = { class: "gd-contract-template-designer__decoration-advanced-content" }, Le = { class: "gd-contract-template-designer__decoration-control-grid" }, Re = { class: "gd-contract-template-designer__unit-control" }, ze = { class: "gd-contract-template-designer__unit-control" }, Be = { class: "gd-contract-template-designer__unit-control" }, Ve = { class: "gd-contract-template-designer__color-control" }, He = ["value", "disabled"], N = /* @__PURE__ */ d({
32
+ name: "ContractTemplatePageDecorationsInspector",
33
+ __name: "ContractTemplatePageDecorationsInspector",
34
+ props: {
35
+ decorations: {},
36
+ variables: {},
37
+ fontFamilyOptions: {},
38
+ readonly: { type: Boolean },
39
+ disabled: { type: Boolean },
40
+ activeTab: {},
41
+ embedded: {
42
+ type: Boolean,
43
+ default: !1
44
+ }
45
+ },
46
+ emits: ["change", "update:activeTab"],
47
+ setup(d, { expose: N, emit: Ue }) {
48
+ let P = d, F = Ue, I = i(() => t(P.decorations)), L = i(() => P.readonly || P.disabled), R = h("header"), z = h(""), B = i(() => n(I.value)), V = i(() => ee(I.value, P.variables)), We = i(() => {
49
+ let e = /* @__PURE__ */ new Map();
50
+ return V.value.forEach((t) => {
51
+ let n = t.id.replace(/-\d+-\d+$/, "");
52
+ e.set(n, [...e.get(n) ?? [], t.message.replace(/^.*?:/, "")]);
53
+ }), e;
54
+ }), H = i(() => P.variables.filter((e) => e.type !== "image")), Ge = [
55
+ {
56
+ label: "无装饰",
57
+ value: "none"
58
+ },
59
+ {
60
+ label: "标准页码",
61
+ value: "page-number"
62
+ },
63
+ {
64
+ label: "内部审阅",
65
+ value: "internal-review"
66
+ },
67
+ {
68
+ label: "草稿",
69
+ value: "draft"
70
+ }
71
+ ], Ke = {
72
+ none: "无装饰",
73
+ "page-number": "标准页码",
74
+ "internal-review": "内部审阅",
75
+ draft: "草稿",
76
+ custom: "自定义"
77
+ }, qe = i(() => ({
78
+ value: B.value,
79
+ label: Ke[B.value]
80
+ })), Je = [{
81
+ label: "常规",
82
+ value: 400
83
+ }, {
84
+ label: "加粗",
85
+ value: 600
86
+ }], Ye = [{
87
+ label: "居中单个",
88
+ value: "single"
89
+ }, {
90
+ label: "全页平铺",
91
+ value: "tiled"
92
+ }], Xe = [
93
+ {
94
+ label: "稀疏 2×3",
95
+ value: "sparse"
96
+ },
97
+ {
98
+ label: "标准 3×4",
99
+ value: "normal"
100
+ },
101
+ {
102
+ label: "密集 4×6",
103
+ value: "dense"
104
+ }
105
+ ], Ze = {
106
+ left: "左侧",
107
+ center: "居中",
108
+ right: "右侧"
109
+ }, U = [
110
+ "left",
111
+ "center",
112
+ "right"
113
+ ], Qe = [{
114
+ key: "header",
115
+ label: "页眉"
116
+ }, {
117
+ key: "footer",
118
+ label: "页脚"
119
+ }];
120
+ v(() => P.activeTab, (e) => {
121
+ e && (R.value = e);
122
+ }, { immediate: !0 }), v(R, (e) => F("update:activeTab", e));
123
+ function W(e) {
124
+ F("change", t(e));
125
+ }
126
+ function G(e, t) {
127
+ W({
128
+ ...I.value,
129
+ [e]: {
130
+ ...I.value[e],
131
+ ...t
132
+ }
133
+ });
134
+ }
135
+ function K(e, t, n) {
136
+ G(e, { slots: {
137
+ ...I.value[e].slots,
138
+ [t]: n
139
+ } });
140
+ }
141
+ function q(e) {
142
+ W({
143
+ ...I.value,
144
+ watermark: {
145
+ ...I.value.watermark,
146
+ ...e
147
+ }
148
+ });
149
+ }
150
+ function $e(e) {
151
+ W({
152
+ ...I.value,
153
+ pageNumbering: { countFirstPage: e }
154
+ });
155
+ }
156
+ function J(e, t, n) {
157
+ K(e, t, `${I.value[e].slots[t]}${n}`.slice(0, 240));
158
+ }
159
+ function et(e) {
160
+ q({ text: `${I.value.watermark.text}${e}`.slice(0, 240) });
161
+ }
162
+ function Y(e, t) {
163
+ t ? z.value = e : z.value === e && (z.value = "");
164
+ }
165
+ function X(e, t) {
166
+ z.value === t && (e.preventDefault(), e.stopPropagation(), z.value = "");
167
+ }
168
+ function Z(t) {
169
+ F("change", e(t));
170
+ }
171
+ function Q(e) {
172
+ let t = typeof e == "object" && e && "value" in e ? e.value : e;
173
+ if (L.value || t === "custom") return;
174
+ let n = t;
175
+ if (n !== B.value) {
176
+ if (B.value !== "custom") {
177
+ Z(n);
178
+ return;
179
+ }
180
+ ne.confirm({
181
+ title: "应用装饰方案",
182
+ content: "将覆盖当前自定义设置,是否继续?",
183
+ okText: "应用",
184
+ cancelText: "取消",
185
+ onOk: () => {
186
+ Z(n);
187
+ }
188
+ });
189
+ }
190
+ }
191
+ function tt() {
192
+ Q("none");
193
+ }
194
+ function $(e) {
195
+ return We.value.get(e) ?? [];
196
+ }
197
+ return N({ resetToDefault: tt }), (e, t) => (p(), s("section", { class: f(["gd-contract-template-designer__panel gd-contract-template-designer__panel--decorations", { "is-embedded": P.embedded }]) }, [
198
+ P.embedded ? o("", !0) : (p(), s("div", oe, [t[15] ||= c("strong", null, "页面装饰", -1), u(_(ie), { title: "恢复默认" }, {
199
+ default: y(() => [u(_(x), {
200
+ size: "small",
201
+ class: "gd-contract-template-designer__icon-button",
202
+ disabled: L.value,
203
+ "aria-label": "恢复页面装饰默认值",
204
+ onClick: t[0] ||= (e) => Q("none")
205
+ }, {
206
+ default: y(() => [u(_(ae), { "aria-hidden": "true" })]),
207
+ _: 1
208
+ }, 8, ["disabled"])]),
209
+ _: 1
210
+ })])),
211
+ c("div", se, [c("label", ce, [t[16] ||= c("span", null, "方案", -1), u(_(D), {
212
+ value: qe.value,
213
+ options: Ge,
214
+ "label-in-value": "",
215
+ "popup-class-name": "gd-contract-template-designer__page-decorations-select-popup",
216
+ disabled: L.value,
217
+ "aria-label": "页面装饰方案",
218
+ onChange: Q
219
+ }, null, 8, ["value", "disabled"])])]),
220
+ V.value.length ? (p(), a(_(te), {
221
+ key: 1,
222
+ class: "gd-contract-template-designer__decoration-errors",
223
+ type: "error",
224
+ "show-icon": "",
225
+ message: `${V.value.length} 个配置错误`
226
+ }, {
227
+ description: y(() => [c("ul", null, [(p(!0), s(r, null, m(V.value.slice(0, 3), (e) => (p(), s("li", { key: e.id }, g(e.message), 1))), 128))])]),
228
+ _: 1
229
+ }, 8, ["message"])) : o("", !0),
230
+ u(_(re), {
231
+ "active-key": R.value,
232
+ "onUpdate:activeKey": t[14] ||= (e) => R.value = e,
233
+ size: "small",
234
+ class: "gd-contract-template-designer__decoration-tabs"
235
+ }, {
236
+ default: y(() => [(p(), s(r, null, m(Qe, (e) => u(_(k), { key: e.key }, {
237
+ tab: y(() => [c("span", le, [l(g(e.label) + " ", 1), c("i", {
238
+ class: f({ "is-enabled": I.value[e.key].enabled }),
239
+ "aria-hidden": "true"
240
+ }, null, 2)])]),
241
+ default: y(() => [c("div", ue, [
242
+ c("label", de, [t[17] ||= c("span", null, "启用", -1), u(_(O), {
243
+ checked: I.value[e.key].enabled,
244
+ disabled: L.value,
245
+ onChange: (t) => G(e.key, { enabled: !!t })
246
+ }, null, 8, [
247
+ "checked",
248
+ "disabled",
249
+ "onChange"
250
+ ])]),
251
+ c("label", fe, [t[18] ||= c("span", null, "第 1 页显示", -1), u(_(O), {
252
+ checked: I.value[e.key].showOnFirstPage,
253
+ disabled: L.value,
254
+ onChange: (t) => G(e.key, { showOnFirstPage: !!t })
255
+ }, null, 8, [
256
+ "checked",
257
+ "disabled",
258
+ "onChange"
259
+ ])]),
260
+ e.key === "footer" ? (p(), s("label", pe, [t[19] ||= c("span", null, "首页计入页码", -1), u(_(O), {
261
+ checked: I.value.pageNumbering.countFirstPage,
262
+ disabled: L.value,
263
+ onChange: t[1] ||= (e) => $e(!!e)
264
+ }, null, 8, ["checked", "disabled"])])) : o("", !0),
265
+ c("div", me, [(p(), s(r, null, m(U, (n) => c("div", {
266
+ key: n,
267
+ class: "gd-contract-template-designer__decoration-slot-editor",
268
+ "data-decoration-slot": n,
269
+ "data-page-decoration-path": `${e.key}.slots.${n}`
270
+ }, [
271
+ c("label", ge, [c("span", null, g(Ze[n]), 1), u(_(C), {
272
+ value: I.value[e.key].slots[n],
273
+ maxlength: _(240),
274
+ disabled: L.value,
275
+ status: $(`${e.key}.slots.${n}`).length ? "error" : void 0,
276
+ "aria-invalid": $(`${e.key}.slots.${n}`).length ? "true" : void 0,
277
+ "onUpdate:value": (t) => K(e.key, n, String(t))
278
+ }, null, 8, [
279
+ "value",
280
+ "maxlength",
281
+ "disabled",
282
+ "status",
283
+ "aria-invalid",
284
+ "onUpdate:value"
285
+ ])]),
286
+ u(_(S), {
287
+ trigger: ["click"],
288
+ open: z.value === `${e.key}.${n}`,
289
+ disabled: L.value,
290
+ "overlay-class-name": "gd-contract-template-designer__page-decorations-dropdown-popup",
291
+ onOpenChange: (t) => Y(`${e.key}.${n}`, t)
292
+ }, {
293
+ overlay: y(() => [u(_(T), { onKeydown: b((t) => X(t, `${e.key}.${n}`), ["esc"]) }, {
294
+ default: y(() => [
295
+ u(_(E), { onClick: (t) => J(e.key, n, "{pageNumber}") }, {
296
+ default: y(() => [...t[21] ||= [l(" 页码 {pageNumber} ", -1)]]),
297
+ _: 1
298
+ }, 8, ["onClick"]),
299
+ u(_(E), { onClick: (t) => J(e.key, n, "{totalPages}") }, {
300
+ default: y(() => [...t[22] ||= [l(" 总页数 {totalPages} ", -1)]]),
301
+ _: 1
302
+ }, 8, ["onClick"]),
303
+ (p(!0), s(r, null, m(H.value, (t) => (p(), a(_(E), {
304
+ key: t.id,
305
+ onClick: (ee) => J(e.key, n, `\${{${t.key}}}`)
306
+ }, {
307
+ default: y(() => [l(g(t.label) + " · " + g(t.key), 1)]),
308
+ _: 2
309
+ }, 1032, ["onClick"]))), 128)),
310
+ H.value.length ? o("", !0) : (p(), a(_(E), {
311
+ key: 0,
312
+ disabled: ""
313
+ }, {
314
+ default: y(() => [...t[23] ||= [l(" 暂无可用模板变量 ", -1)]]),
315
+ _: 1
316
+ }))
317
+ ]),
318
+ _: 2
319
+ }, 1032, ["onKeydown"])]),
320
+ default: y(() => [u(_(x), {
321
+ size: "small",
322
+ disabled: L.value,
323
+ onKeydown: b((t) => X(t, `${e.key}.${n}`), ["esc"])
324
+ }, {
325
+ default: y(() => [t[20] ||= l(" 插入 ", -1), u(_(A), { "aria-hidden": "true" })]),
326
+ _: 1
327
+ }, 8, ["disabled", "onKeydown"])]),
328
+ _: 2
329
+ }, 1032, [
330
+ "open",
331
+ "disabled",
332
+ "onOpenChange"
333
+ ]),
334
+ (p(!0), s(r, null, m($(`${e.key}.slots.${n}`), (e) => (p(), s("small", {
335
+ key: e,
336
+ class: "gd-contract-template-designer__form-error"
337
+ }, g(e), 1))), 128))
338
+ ], 8, he)), 64))]),
339
+ c("details", _e, [t[32] ||= c("summary", null, "高级设置", -1), c("div", ve, [
340
+ c("label", ye, [t[24] ||= c("span", null, "字体", -1), u(_(D), {
341
+ value: I.value[e.key].fontFamily,
342
+ options: d.fontFamilyOptions,
343
+ "popup-class-name": "gd-contract-template-designer__page-decorations-select-popup",
344
+ disabled: L.value,
345
+ onChange: (t) => G(e.key, { fontFamily: String(t) })
346
+ }, null, 8, [
347
+ "value",
348
+ "options",
349
+ "disabled",
350
+ "onChange"
351
+ ])]),
352
+ c("div", be, [
353
+ c("label", null, [t[26] ||= c("span", null, "字号", -1), c("span", xe, [u(_(w), {
354
+ value: I.value[e.key].fontSize,
355
+ min: 10,
356
+ max: 24,
357
+ disabled: L.value,
358
+ "aria-label": `${e.label}字号`,
359
+ onChange: (t) => G(e.key, { fontSize: Number(t || 12) })
360
+ }, null, 8, [
361
+ "value",
362
+ "disabled",
363
+ "aria-label",
364
+ "onChange"
365
+ ]), t[25] ||= c("small", null, "px", -1)])]),
366
+ c("label", null, [t[27] ||= c("span", null, "字重", -1), u(_(D), {
367
+ value: I.value[e.key].fontWeight,
368
+ options: Je,
369
+ "popup-class-name": "gd-contract-template-designer__page-decorations-select-popup",
370
+ disabled: L.value,
371
+ "aria-label": `${e.label}字重`,
372
+ onChange: (t) => G(e.key, { fontWeight: t === 600 ? 600 : 400 })
373
+ }, null, 8, [
374
+ "value",
375
+ "disabled",
376
+ "aria-label",
377
+ "onChange"
378
+ ])]),
379
+ c("label", null, [t[29] ||= c("span", null, "距边缘", -1), c("span", j, [u(_(w), {
380
+ value: I.value[e.key].offset,
381
+ min: 12,
382
+ max: 48,
383
+ disabled: L.value,
384
+ "aria-label": `${e.label}距页面边缘`,
385
+ onChange: (t) => G(e.key, { offset: Number(t || 24) })
386
+ }, null, 8, [
387
+ "value",
388
+ "disabled",
389
+ "aria-label",
390
+ "onChange"
391
+ ]), t[28] ||= c("small", null, "px", -1)])]),
392
+ c("label", null, [t[30] ||= c("span", null, "颜色", -1), c("span", M, [c("input", {
393
+ type: "color",
394
+ value: I.value[e.key].color,
395
+ disabled: L.value,
396
+ "aria-label": `${e.label}颜色`,
397
+ onInput: (t) => G(e.key, { color: t.target.value })
398
+ }, null, 40, Se), c("code", null, g(I.value[e.key].color.toUpperCase()), 1)])])
399
+ ]),
400
+ c("label", Ce, [c("span", null, g(e.key === "header" ? "底部" : "顶部") + "分隔线 · 1px", 1), u(_(O), {
401
+ checked: I.value[e.key].divider.enabled,
402
+ disabled: L.value,
403
+ onChange: (t) => G(e.key, { divider: {
404
+ ...I.value[e.key].divider,
405
+ enabled: !!t
406
+ } })
407
+ }, null, 8, [
408
+ "checked",
409
+ "disabled",
410
+ "onChange"
411
+ ])]),
412
+ I.value[e.key].divider.enabled ? (p(), s("label", we, [t[31] ||= c("span", null, "线条颜色", -1), c("span", Te, [c("input", {
413
+ type: "color",
414
+ value: I.value[e.key].divider.color,
415
+ disabled: L.value,
416
+ "aria-label": `${e.label}分隔线颜色`,
417
+ onInput: (t) => G(e.key, { divider: {
418
+ ...I.value[e.key].divider,
419
+ color: t.target.value
420
+ } })
421
+ }, null, 40, Ee), c("code", null, g(I.value[e.key].divider.color.toUpperCase()), 1)])])) : o("", !0)
422
+ ])])
423
+ ])]),
424
+ _: 2
425
+ }, 1024)), 64)), u(_(k), { key: "watermark" }, {
426
+ tab: y(() => [c("span", De, [t[33] ||= l(" 水印 ", -1), c("i", {
427
+ class: f({ "is-enabled": I.value.watermark.enabled }),
428
+ "aria-hidden": "true"
429
+ }, null, 2)])]),
430
+ default: y(() => [c("div", Oe, [
431
+ c("label", ke, [t[34] ||= c("span", null, "启用", -1), u(_(O), {
432
+ checked: I.value.watermark.enabled,
433
+ disabled: L.value,
434
+ onChange: t[2] ||= (e) => q({ enabled: !!e })
435
+ }, null, 8, ["checked", "disabled"])]),
436
+ c("label", Ae, [t[35] ||= c("span", null, "第 1 页显示", -1), u(_(O), {
437
+ checked: I.value.watermark.showOnFirstPage,
438
+ disabled: L.value,
439
+ onChange: t[3] ||= (e) => q({ showOnFirstPage: !!e })
440
+ }, null, 8, ["checked", "disabled"])]),
441
+ c("div", je, [
442
+ c("label", Me, [t[36] ||= c("span", null, "内容", -1), u(_(C), {
443
+ value: I.value.watermark.text,
444
+ maxlength: _(240),
445
+ disabled: L.value,
446
+ status: $("watermark.text").length ? "error" : void 0,
447
+ "aria-invalid": $("watermark.text").length ? "true" : void 0,
448
+ "onUpdate:value": t[4] ||= (e) => q({ text: String(e) })
449
+ }, null, 8, [
450
+ "value",
451
+ "maxlength",
452
+ "disabled",
453
+ "status",
454
+ "aria-invalid"
455
+ ])]),
456
+ u(_(S), {
457
+ trigger: ["click"],
458
+ open: z.value === "watermark",
459
+ disabled: L.value,
460
+ "overlay-class-name": "gd-contract-template-designer__page-decorations-dropdown-popup",
461
+ onOpenChange: t[7] ||= (e) => Y("watermark", e)
462
+ }, {
463
+ overlay: y(() => [u(_(T), { onKeydown: t[6] ||= b((e) => X(e, "watermark"), ["esc"]) }, {
464
+ default: y(() => [(p(!0), s(r, null, m(H.value, (e) => (p(), a(_(E), {
465
+ key: e.id,
466
+ onClick: (t) => et(`\${{${e.key}}}`)
467
+ }, {
468
+ default: y(() => [l(g(e.label) + " · " + g(e.key), 1)]),
469
+ _: 2
470
+ }, 1032, ["onClick"]))), 128)), H.value.length ? o("", !0) : (p(), a(_(E), {
471
+ key: 0,
472
+ disabled: ""
473
+ }, {
474
+ default: y(() => [...t[38] ||= [l(" 暂无可用模板变量 ", -1)]]),
475
+ _: 1
476
+ }))]),
477
+ _: 1
478
+ })]),
479
+ default: y(() => [u(_(x), {
480
+ size: "small",
481
+ disabled: L.value,
482
+ onKeydown: t[5] ||= b((e) => X(e, "watermark"), ["esc"])
483
+ }, {
484
+ default: y(() => [t[37] ||= l(" 插入 ", -1), u(_(A), { "aria-hidden": "true" })]),
485
+ _: 1
486
+ }, 8, ["disabled"])]),
487
+ _: 1
488
+ }, 8, ["open", "disabled"]),
489
+ (p(!0), s(r, null, m($("watermark.text"), (e) => (p(), s("small", {
490
+ key: e,
491
+ class: "gd-contract-template-designer__form-error"
492
+ }, g(e), 1))), 128))
493
+ ]),
494
+ c("label", Ne, [t[39] ||= c("span", null, "布局", -1), u(_(D), {
495
+ value: I.value.watermark.layout,
496
+ options: Ye,
497
+ "popup-class-name": "gd-contract-template-designer__page-decorations-select-popup",
498
+ disabled: L.value,
499
+ onChange: t[8] ||= (e) => q({ layout: e === "tiled" ? "tiled" : "single" })
500
+ }, null, 8, ["value", "disabled"])]),
501
+ I.value.watermark.layout === "tiled" ? (p(), s("label", Pe, [t[40] ||= c("span", null, "密度", -1), u(_(D), {
502
+ value: I.value.watermark.density,
503
+ options: Xe,
504
+ "popup-class-name": "gd-contract-template-designer__page-decorations-select-popup",
505
+ disabled: L.value,
506
+ onChange: t[9] ||= (e) => q({ density: e === "sparse" || e === "dense" ? e : "normal" })
507
+ }, null, 8, ["value", "disabled"])])) : o("", !0),
508
+ c("details", Fe, [t[48] ||= c("summary", null, "高级设置", -1), c("div", Ie, [c("div", Le, [
509
+ c("label", null, [t[42] ||= c("span", null, "字号", -1), c("span", Re, [u(_(w), {
510
+ value: I.value.watermark.fontSize,
511
+ min: 12,
512
+ max: 72,
513
+ disabled: L.value,
514
+ "aria-label": "水印字号",
515
+ onChange: t[10] ||= (e) => q({ fontSize: Number(e || 36) })
516
+ }, null, 8, ["value", "disabled"]), t[41] ||= c("small", null, "px", -1)])]),
517
+ c("label", null, [t[44] ||= c("span", null, "透明度", -1), c("span", ze, [u(_(w), {
518
+ value: Math.round(I.value.watermark.opacity * 100),
519
+ min: 4,
520
+ max: 50,
521
+ disabled: L.value,
522
+ "aria-label": "水印透明度",
523
+ onChange: t[11] ||= (e) => q({ opacity: Number(e || 14) / 100 })
524
+ }, null, 8, ["value", "disabled"]), t[43] ||= c("small", null, "%", -1)])]),
525
+ c("label", null, [t[46] ||= c("span", null, "角度", -1), c("span", Be, [u(_(w), {
526
+ value: I.value.watermark.rotation,
527
+ min: -90,
528
+ max: 90,
529
+ disabled: L.value,
530
+ "aria-label": "水印角度",
531
+ onChange: t[12] ||= (e) => q({ rotation: Number(e ?? -30) })
532
+ }, null, 8, ["value", "disabled"]), t[45] ||= c("small", null, "°", -1)])]),
533
+ c("label", null, [t[47] ||= c("span", null, "颜色", -1), c("span", Ve, [c("input", {
534
+ type: "color",
535
+ value: I.value.watermark.color,
536
+ disabled: L.value,
537
+ "aria-label": "水印颜色",
538
+ onInput: t[13] ||= (e) => q({ color: e.target.value })
539
+ }, null, 40, He), c("code", null, g(I.value.watermark.color.toUpperCase()), 1)])])
540
+ ])])])
541
+ ])]),
542
+ _: 1
543
+ })]),
544
+ _: 1
545
+ }, 8, ["active-key"])
546
+ ], 2));
547
+ }
548
+ });
549
+ //#endregion
550
+ export { N as default };
@@ -0,0 +1,5 @@
1
+ import e from "./ContractTemplatePageDecorationsStudio.vue.mjs";
2
+ //#region src/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,117 @@
1
+ import { normalizePageDecorations as e, resolvePageDecorationPreset as t } from "./utils/page-decorations.mjs";
2
+ import n from "./ContractTemplatePageDecorationsInspector.mjs";
3
+ import { computed as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, toDisplayString as p, unref as m, watch as h, withCtx as g } from "vue";
4
+ import { Button as _, Tooltip as v } from "ant-design-vue";
5
+ import { BgColorsOutlined as y, CloseOutlined as b, ReloadOutlined as x } from "@ant-design/icons-vue";
6
+ //#region src/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue?vue&type=script&setup=true&lang.ts
7
+ var S = ["id", "aria-hidden"], C = { class: "gd-contract-template-designer__page-decorations-studio-head" }, w = { class: "gd-contract-template-designer__page-decorations-studio-title" }, T = {
8
+ class: "gd-contract-template-designer__page-decorations-studio-icon",
9
+ "aria-hidden": "true"
10
+ }, E = { class: "gd-contract-template-designer__page-decorations-studio-actions" }, D = { class: "gd-contract-template-designer__page-decorations-studio-body" }, O = { class: "gd-contract-template-designer__page-decorations-studio-form-section" }, k = { class: "gd-contract-template-designer__page-decorations-studio-footer" }, A = /* @__PURE__ */ c({
11
+ name: "ContractTemplatePageDecorationsStudio",
12
+ __name: "ContractTemplatePageDecorationsStudio",
13
+ props: {
14
+ id: {},
15
+ open: { type: Boolean },
16
+ decorations: {},
17
+ variables: {},
18
+ fontFamilyOptions: {},
19
+ readonly: { type: Boolean },
20
+ disabled: { type: Boolean },
21
+ activeTab: {}
22
+ },
23
+ emits: [
24
+ "close",
25
+ "change",
26
+ "update:activeTab"
27
+ ],
28
+ setup(c, { expose: A, emit: j }) {
29
+ let M = c, N = j, P = f(), F = f(), I = f("header"), L = r(() => e(M.decorations)), R = r(() => t(L.value)), z = {
30
+ none: "无装饰",
31
+ "page-number": "标准页码",
32
+ "internal-review": "内部审阅",
33
+ draft: "草稿",
34
+ custom: "自定义"
35
+ }, B = r(() => z[R.value]), V = r(() => [
36
+ L.value.header.enabled,
37
+ L.value.footer.enabled,
38
+ L.value.watermark.enabled
39
+ ].filter(Boolean).length);
40
+ h(() => M.activeTab, (e) => {
41
+ e && (I.value = e);
42
+ }, { immediate: !0 }), h(I, (e) => N("update:activeTab", e));
43
+ function H() {
44
+ l(() => P.value?.querySelector("[data-page-decoration-studio-focus]")?.focus());
45
+ }
46
+ function U() {
47
+ F.value?.resetToDefault();
48
+ }
49
+ async function W(e) {
50
+ I.value = e.startsWith("header.") ? "header" : e.startsWith("footer.") ? "footer" : "watermark", await l(), await l();
51
+ let t = P.value?.querySelector(`[data-page-decoration-path="${e}"] input`);
52
+ t?.scrollIntoView({ block: "nearest" }), t?.focus();
53
+ }
54
+ return h(() => M.open, (e) => {
55
+ e && H();
56
+ }), A({ focusField: W }), (e, t) => (d(), i("aside", {
57
+ id: M.id,
58
+ ref_key: "studioRoot",
59
+ ref: P,
60
+ class: u(["gd-contract-template-designer__page-decorations-studio", { "is-open": M.open }]),
61
+ "aria-label": "页面装饰配置",
62
+ "aria-hidden": M.open ? void 0 : "true"
63
+ }, [
64
+ a("header", C, [a("div", w, [a("span", T, [s(m(y))]), a("div", null, [t[4] ||= a("strong", null, "页面装饰", -1), a("small", null, p(B.value) + " · 启用 " + p(V.value) + "/3", 1)])]), a("div", E, [s(m(v), { title: "关闭页面装饰" }, {
65
+ default: g(() => [s(m(_), {
66
+ size: "small",
67
+ class: "gd-contract-template-designer__icon-button",
68
+ "aria-label": "关闭页面装饰",
69
+ "data-page-decoration-studio-focus": "",
70
+ onClick: t[0] ||= (e) => N("close")
71
+ }, {
72
+ default: g(() => [s(m(b), { "aria-hidden": "true" })]),
73
+ _: 1
74
+ })]),
75
+ _: 1
76
+ })])]),
77
+ a("div", D, [a("section", O, [s(n, {
78
+ ref_key: "inspectorRef",
79
+ ref: F,
80
+ decorations: M.decorations,
81
+ variables: M.variables,
82
+ "font-family-options": M.fontFamilyOptions,
83
+ readonly: M.readonly,
84
+ disabled: M.disabled,
85
+ embedded: "",
86
+ "active-tab": I.value,
87
+ "onUpdate:activeTab": t[1] ||= (e) => I.value = e,
88
+ onChange: t[2] ||= (e) => N("change", e)
89
+ }, null, 8, [
90
+ "decorations",
91
+ "variables",
92
+ "font-family-options",
93
+ "readonly",
94
+ "disabled",
95
+ "active-tab"
96
+ ])])]),
97
+ a("footer", k, [t[7] ||= a("span", null, "修改实时生效", -1), a("div", null, [s(m(_), {
98
+ size: "small",
99
+ disabled: M.readonly || M.disabled,
100
+ "data-page-decoration-studio-reset": "",
101
+ onClick: U
102
+ }, {
103
+ default: g(() => [s(m(x), { "aria-hidden": "true" }), t[5] ||= o(" 恢复默认 ", -1)]),
104
+ _: 1
105
+ }, 8, ["disabled"]), s(m(_), {
106
+ size: "small",
107
+ type: "primary",
108
+ onClick: t[3] ||= (e) => N("close")
109
+ }, {
110
+ default: g(() => [...t[6] ||= [o("完成", -1)]]),
111
+ _: 1
112
+ })])])
113
+ ], 10, S));
114
+ }
115
+ });
116
+ //#endregion
117
+ export { A as default };
@@ -0,0 +1,5 @@
1
+ import e from "./ContractTemplatePreviewModal.vue.mjs";
2
+ //#region src/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };