@guodun/antdv 1.7.12 → 1.7.13
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 +370 -294
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +219 -202
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +18 -18
- package/dist/es/components/contract-signing-location/src/template-source.mjs +62 -49
- package/dist/es/components/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +37 -42
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +69 -55
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.mjs +278 -270
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +344 -343
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1046 -1000
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +120 -74
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +133 -132
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-layout-check.mjs +239 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +95 -71
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +67 -76
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -83
- package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +23 -15
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/contract-print-css/index.mjs +122 -25
- package/dist/es/contract-print.mjs +2 -0
- package/dist/es/index.mjs +21 -20
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/utils/contract-layout-check.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +50 -28
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +5 -5
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/contract-print-css/index.cjs +62 -18
- package/dist/lib/contract-print.cjs +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +9 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +7 -0
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +5 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +7 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +36 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/contract-layout-check.d.ts +104 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +4 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +2 -8
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +6 -1
- package/dist/types/contract-print-css/index.d.ts +70 -0
- package/dist/types/contract-print.d.ts +2 -0
- package/package.json +14 -2
package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs
CHANGED
|
@@ -20,28 +20,28 @@ var p = [
|
|
|
20
20
|
},
|
|
21
21
|
emits: ["status", "metrics"],
|
|
22
22
|
setup(c, { emit: h }) {
|
|
23
|
-
let g = c, _ = h, v = d(0), y = d(0), b = d("loading"),
|
|
23
|
+
let g = c, _ = h, v = d(0), y = d(0), b = d(0), x = d("loading"), S = r(() => ({
|
|
24
24
|
width: `${g.page.displayWidth}px`,
|
|
25
25
|
minHeight: `${g.page.displayHeight}px`,
|
|
26
26
|
height: `${Math.max(g.page.displayHeight, v.value)}px`
|
|
27
|
-
})),
|
|
28
|
-
function
|
|
29
|
-
v.value = e.contentHeight, y.value = e.overflowHeight, _("metrics", e),
|
|
27
|
+
})), C = r(() => t(g.page.pageDecorations, g.page.pageNumber)), w = r(() => n(g.page.pageDecorations, g.page.pageNumber, g.page.totalPages, g.page.decorationVariables, g.page.decorationValues)), T = r(() => y.value > 1 ? `第 ${g.page.pageNumber} 页正文超出纸张 ${Math.round(y.value)}px,请回模板设计器调整后再指定位置。` : b.value > 1 ? `第 ${g.page.pageNumber} 页正文超出纸张宽度 ${Math.round(b.value)}px,请回模板设计器调整后再指定位置。` : ""), E = r(() => g.page.errors[0] || T.value), D = r(() => g.page.errors.length ? "模板已安全降级展示" : "该页签署位置不可信");
|
|
28
|
+
function O(e) {
|
|
29
|
+
v.value = e.contentHeight, y.value = e.overflowHeight, b.value = e.overflowWidth, _("metrics", e), A();
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (
|
|
31
|
+
function k(e, t) {
|
|
32
|
+
if (x.value = e, e === "error") {
|
|
33
33
|
_("status", e, t);
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
A();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
if (
|
|
40
|
-
_("status",
|
|
38
|
+
function A() {
|
|
39
|
+
if (x.value !== "ready") {
|
|
40
|
+
_("status", x.value);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
if (y.value > 1) {
|
|
44
|
-
_("status", "error",
|
|
43
|
+
if (y.value > 1 || b.value > 1) {
|
|
44
|
+
_("status", "error", T.value);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
_("status", "ready");
|
|
@@ -52,20 +52,20 @@ var p = [
|
|
|
52
52
|
"data-template-page-index": c.page.pageIndex,
|
|
53
53
|
"data-page-width": c.page.displayWidth,
|
|
54
54
|
"data-page-height": c.page.displayHeight,
|
|
55
|
-
style: l(
|
|
55
|
+
style: l(S.value)
|
|
56
56
|
}, [s(e, {
|
|
57
57
|
"page-id": c.page.pageId,
|
|
58
58
|
width: c.page.displayWidth,
|
|
59
59
|
height: c.page.displayHeight,
|
|
60
60
|
"padding-top": c.page.paddingTop,
|
|
61
61
|
"padding-bottom": c.page.paddingBottom,
|
|
62
|
-
"class-names":
|
|
63
|
-
"decorations-html":
|
|
62
|
+
"class-names": C.value,
|
|
63
|
+
"decorations-html": w.value,
|
|
64
64
|
"content-html": c.page.contentHtml,
|
|
65
65
|
"font-base-url": c.fontBaseUrl,
|
|
66
66
|
title: `第 ${c.page.pageNumber} 页合同签署底图`,
|
|
67
|
-
onMetrics:
|
|
68
|
-
onStatus:
|
|
67
|
+
onMetrics: O,
|
|
68
|
+
onStatus: k
|
|
69
69
|
}, null, 8, [
|
|
70
70
|
"page-id",
|
|
71
71
|
"width",
|
|
@@ -77,7 +77,7 @@ var p = [
|
|
|
77
77
|
"content-html",
|
|
78
78
|
"font-base-url",
|
|
79
79
|
"title"
|
|
80
|
-
]),
|
|
80
|
+
]), E.value ? (u(), a("div", m, [o("strong", null, f(D.value), 1), o("span", null, f(E.value), 1)])) : i("", !0)], 12, p));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
//#endregion
|
|
@@ -1,68 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { resolveContractPagePadding as e } from "../../../contract-print-css/index.mjs";
|
|
2
|
+
import { toContractSigningRulePageSize as t } from "./constants.mjs";
|
|
3
|
+
import { normalizePageDecorations as n } from "../../pro-contract-template-designer/src/utils/page-decorations.mjs";
|
|
4
|
+
import { buildTemplateRenderPages as r, normalizeRenderValues as i, validateTemplateRenderStructure as a } from "../../pro-contract-template-designer/src/utils/template-renderer.mjs";
|
|
5
|
+
import { createContractTemplateLayoutPage as o } from "../../pro-contract-template-designer/src/utils/contract-layout-check.mjs";
|
|
4
6
|
//#region src/components/contract-signing-location/src/template-source.ts
|
|
5
|
-
function
|
|
7
|
+
function s(e) {
|
|
6
8
|
return !!(e && typeof e == "object" && e.type === "template");
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
+
function c(e) {
|
|
11
|
+
return s(e?.source);
|
|
10
12
|
}
|
|
11
|
-
function
|
|
12
|
-
if (!
|
|
13
|
+
function l(a) {
|
|
14
|
+
if (!s(a) || !m(a.template)) return [];
|
|
13
15
|
try {
|
|
14
|
-
let
|
|
15
|
-
return
|
|
16
|
-
let s =
|
|
17
|
-
...
|
|
18
|
-
pages: [
|
|
19
|
-
},
|
|
16
|
+
let o = a.template, s = Array.isArray(o.pages) ? o.pages : [], c = i(o, a.values), l = p(o), u = s.length;
|
|
17
|
+
return s.flatMap((i, a) => {
|
|
18
|
+
let s = r({
|
|
19
|
+
...o,
|
|
20
|
+
pages: [i]
|
|
21
|
+
}, c, {
|
|
20
22
|
readonly: !0,
|
|
21
23
|
disabled: !0,
|
|
22
24
|
mode: "display"
|
|
23
25
|
})[0];
|
|
24
26
|
if (!s) return [];
|
|
25
|
-
let
|
|
27
|
+
let d = h(i?.pageSize, o.pageSize, s), f = t(d), p = a + 1, m = e(n(s.pageDecorations), p);
|
|
26
28
|
return [{
|
|
27
|
-
pageIndex:
|
|
29
|
+
pageIndex: a,
|
|
28
30
|
pageId: s.id,
|
|
29
31
|
title: s.title,
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
32
|
-
displayWidth:
|
|
33
|
-
displayHeight:
|
|
32
|
+
width: f.width || d.width,
|
|
33
|
+
height: f.height || d.height,
|
|
34
|
+
displayWidth: d.width,
|
|
35
|
+
displayHeight: d.height,
|
|
34
36
|
contentHtml: s.contentHtml,
|
|
35
37
|
...s.pageDecorations ? { pageDecorations: s.pageDecorations } : {},
|
|
36
38
|
decorationVariables: s.decorationVariables,
|
|
37
39
|
decorationValues: s.decorationValues,
|
|
38
|
-
pageNumber:
|
|
39
|
-
totalPages:
|
|
40
|
-
paddingTop:
|
|
41
|
-
paddingBottom:
|
|
42
|
-
errors:
|
|
40
|
+
pageNumber: p,
|
|
41
|
+
totalPages: u,
|
|
42
|
+
paddingTop: m.top,
|
|
43
|
+
paddingBottom: m.bottom,
|
|
44
|
+
errors: l.filter((e) => !e.pageId || e.pageId === s.id).map((e) => e.message)
|
|
43
45
|
}];
|
|
44
46
|
});
|
|
45
47
|
} catch {
|
|
46
48
|
return [];
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
function u(e, t) {
|
|
52
|
+
return l(t).map((t) => o({
|
|
53
|
+
id: t.pageId,
|
|
54
|
+
title: t.title,
|
|
55
|
+
format: "Custom",
|
|
56
|
+
width: t.displayWidth,
|
|
57
|
+
height: t.displayHeight,
|
|
58
|
+
contentHtml: t.contentHtml,
|
|
59
|
+
...t.pageDecorations ? { pageDecorations: t.pageDecorations } : {},
|
|
60
|
+
decorationVariables: t.decorationVariables,
|
|
61
|
+
decorationValues: t.decorationValues
|
|
62
|
+
}, {
|
|
63
|
+
fileId: e,
|
|
64
|
+
pageIndex: t.pageIndex,
|
|
65
|
+
pageNumber: t.pageNumber,
|
|
66
|
+
totalPages: t.totalPages
|
|
67
|
+
}));
|
|
55
68
|
}
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
58
|
-
if (!
|
|
69
|
+
function d(e) {
|
|
70
|
+
if (!s(e.source)) return [];
|
|
71
|
+
if (!m(e.source.template)) return [{
|
|
59
72
|
code: "CONTRACT_TEMPLATE_MISSING",
|
|
60
73
|
message: `文件 ${e.fileName || e.fileId} 缺少可渲染的合同模板`,
|
|
61
74
|
fileId: e.fileId
|
|
62
75
|
}];
|
|
63
76
|
try {
|
|
64
77
|
let t = Array.isArray(e.source.template.pages) ? e.source.template.pages : [];
|
|
65
|
-
return
|
|
78
|
+
return p(e.source.template).map((n) => {
|
|
66
79
|
let r = n.pageId ? t.findIndex((e) => e?.id === n.pageId) : -1;
|
|
67
80
|
return {
|
|
68
81
|
code: `CONTRACT_${n.code || "TEMPLATE_INVALID"}`,
|
|
@@ -80,22 +93,22 @@ function p(e) {
|
|
|
80
93
|
}];
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
|
-
function
|
|
84
|
-
return !e || !
|
|
96
|
+
function f(e) {
|
|
97
|
+
return !e || !s(e.source) ? "" : d(e)[0]?.message ?? "";
|
|
85
98
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
99
|
+
function p(e) {
|
|
100
|
+
return a(e);
|
|
88
101
|
}
|
|
89
|
-
function
|
|
102
|
+
function m(e) {
|
|
90
103
|
return !!(e && typeof e == "object");
|
|
91
104
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
94
|
-
width:
|
|
95
|
-
height:
|
|
105
|
+
function h(e, t, n) {
|
|
106
|
+
return _(e) || _(t) || {
|
|
107
|
+
width: v(e?.width, v(t?.width, n.width)),
|
|
108
|
+
height: v(e?.height, v(t?.height, n.height))
|
|
96
109
|
};
|
|
97
110
|
}
|
|
98
|
-
var
|
|
111
|
+
var g = [
|
|
99
112
|
{
|
|
100
113
|
pointWidth: 595.5,
|
|
101
114
|
pointHeight: 842.25,
|
|
@@ -145,18 +158,18 @@ var v = [
|
|
|
145
158
|
cssHeight: 1344
|
|
146
159
|
}
|
|
147
160
|
];
|
|
148
|
-
function
|
|
161
|
+
function _(e) {
|
|
149
162
|
let t = Number(e?.width), n = Number(e?.height);
|
|
150
163
|
if (!Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0) return;
|
|
151
|
-
let r =
|
|
164
|
+
let r = g.find((e) => Math.abs(t - e.pointWidth) <= 1.1 && Math.abs(n - e.pointHeight) <= 1.1);
|
|
152
165
|
return r ? {
|
|
153
166
|
width: r.cssWidth,
|
|
154
167
|
height: r.cssHeight
|
|
155
168
|
} : void 0;
|
|
156
169
|
}
|
|
157
|
-
function
|
|
170
|
+
function v(e, t) {
|
|
158
171
|
let n = Number(e);
|
|
159
172
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
160
173
|
}
|
|
161
174
|
//#endregion
|
|
162
|
-
export {
|
|
175
|
+
export { u as buildContractSigningLayoutPages, l as buildContractSigningTemplateRenderPages, f as getContractSigningTemplateDisplayError, c as isContractSigningTemplateFile, s as isContractSigningTemplateSource, d as validateContractSigningTemplateFile };
|
|
@@ -64,6 +64,7 @@ import "./pro-contract-template-designer/src/utils/advanced-controls.mjs";
|
|
|
64
64
|
import "./pro-contract-template-designer/src/composables/use-template-designer.mjs";
|
|
65
65
|
import "./pro-contract-template-designer/src/utils/image-url.mjs";
|
|
66
66
|
import "./pro-contract-template-designer/src/utils/template-renderer.mjs";
|
|
67
|
+
import "./pro-contract-template-designer/src/utils/contract-layout-check.mjs";
|
|
67
68
|
import "./contract-signing-location/src/template-source.mjs";
|
|
68
69
|
import "./contract-signing-location/src/location-rules.mjs";
|
|
69
70
|
import "./contract-signing-location/src/page-layout.mjs";
|
|
@@ -7,6 +7,7 @@ import "./src/utils/advanced-controls.mjs";
|
|
|
7
7
|
import "./src/composables/use-template-designer.mjs";
|
|
8
8
|
import "./src/utils/image-url.mjs";
|
|
9
9
|
import "./src/utils/template-renderer.mjs";
|
|
10
|
+
import "./src/utils/contract-layout-check.mjs";
|
|
10
11
|
import "./src/utils/content-image.mjs";
|
|
11
12
|
import "./src/utils/signing-layout-presets.mjs";
|
|
12
13
|
import "./src/composables/use-template-draft-cache.mjs";
|
package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { resolveContractPagePadding as e } from "../../../contract-print-css/index.mjs";
|
|
2
|
+
import t from "./ContractPrintIframe.mjs";
|
|
3
|
+
import { buildPageDecorationClassNames as n, buildPageDecorationsHtml as r, normalizePageDecorations as i } from "./utils/page-decorations.mjs";
|
|
4
|
+
import { resolvePageSize as a } from "./composables/use-template-designer.mjs";
|
|
5
|
+
import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeStyle as f, openBlock as p, shallowRef as m, toDisplayString as h } from "vue";
|
|
5
6
|
//#region src/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var g = { class: "gd-contract-template-designer__preview-page-shell" }, _ = [
|
|
7
8
|
"data-page-id",
|
|
8
9
|
"data-page-format",
|
|
9
10
|
"data-page-label",
|
|
10
11
|
"data-page-width",
|
|
11
12
|
"data-page-height"
|
|
12
|
-
],
|
|
13
|
+
], v = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "gd-contract-template-designer__preview-font-error",
|
|
15
16
|
role: "alert"
|
|
16
|
-
},
|
|
17
|
+
}, y = /* @__PURE__ */ d({
|
|
17
18
|
name: "ContractTemplatePreviewPage",
|
|
18
19
|
__name: "ContractTemplatePreviewPage",
|
|
19
20
|
props: {
|
|
@@ -26,41 +27,35 @@ var y = { class: "gd-contract-template-designer__preview-page-shell" }, b = [
|
|
|
26
27
|
variables: {},
|
|
27
28
|
fontBaseUrl: {}
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}), T = l(() => ({
|
|
37
|
-
width: `${C.value.width}px`,
|
|
38
|
-
height: `${C.value.height}px`
|
|
39
|
-
})), E = l(() => n(S.pageDecorations, S.pageNumber)), D = l(() => r(S.pageDecorations, S.pageNumber, S.totalPages, S.variables)), O = _("");
|
|
40
|
-
function k(e, t) {
|
|
41
|
-
O.value = e === "error" ? t || "合同排版度量校验失败" : "";
|
|
30
|
+
setup(d) {
|
|
31
|
+
let y = d, b = o(() => a(y.page.pageSize, y.fallbackPageSize)), x = o(() => e(i(y.pageDecorations), y.pageNumber)), S = o(() => ({
|
|
32
|
+
width: `${b.value.width}px`,
|
|
33
|
+
height: `${b.value.height}px`
|
|
34
|
+
})), C = o(() => n(y.pageDecorations, y.pageNumber)), w = o(() => r(y.pageDecorations, y.pageNumber, y.totalPages, y.variables)), T = m("");
|
|
35
|
+
function E(e, t) {
|
|
36
|
+
T.value = e === "error" ? t || "合同排版度量校验失败" : "";
|
|
42
37
|
}
|
|
43
|
-
return (
|
|
38
|
+
return (e, n) => (p(), c("article", g, [l("section", {
|
|
44
39
|
class: "gd-contract-template-designer__preview-page",
|
|
45
|
-
"data-page-id":
|
|
46
|
-
"data-page-format":
|
|
47
|
-
"data-page-label":
|
|
48
|
-
"data-page-width":
|
|
49
|
-
"data-page-height":
|
|
50
|
-
style:
|
|
51
|
-
}, [
|
|
52
|
-
"page-id":
|
|
53
|
-
"page-format":
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
"padding-top":
|
|
57
|
-
"padding-bottom":
|
|
58
|
-
"class-names":
|
|
59
|
-
"decorations-html":
|
|
60
|
-
"content-html":
|
|
61
|
-
"font-base-url":
|
|
62
|
-
title: `第 ${
|
|
63
|
-
onStatus:
|
|
40
|
+
"data-page-id": d.page.id,
|
|
41
|
+
"data-page-format": b.value.format ?? "Custom",
|
|
42
|
+
"data-page-label": b.value.label ?? b.value.format ?? "自定义",
|
|
43
|
+
"data-page-width": b.value.width,
|
|
44
|
+
"data-page-height": b.value.height,
|
|
45
|
+
style: f(S.value)
|
|
46
|
+
}, [u(t, {
|
|
47
|
+
"page-id": d.page.id,
|
|
48
|
+
"page-format": b.value.format,
|
|
49
|
+
width: b.value.width,
|
|
50
|
+
height: b.value.height,
|
|
51
|
+
"padding-top": x.value.top,
|
|
52
|
+
"padding-bottom": x.value.bottom,
|
|
53
|
+
"class-names": C.value,
|
|
54
|
+
"decorations-html": w.value,
|
|
55
|
+
"content-html": d.contentHtml,
|
|
56
|
+
"font-base-url": d.fontBaseUrl,
|
|
57
|
+
title: `第 ${d.pageNumber} 页合同预览`,
|
|
58
|
+
onStatus: E
|
|
64
59
|
}, null, 8, [
|
|
65
60
|
"page-id",
|
|
66
61
|
"page-format",
|
|
@@ -73,8 +68,8 @@ var y = { class: "gd-contract-template-designer__preview-page-shell" }, b = [
|
|
|
73
68
|
"content-html",
|
|
74
69
|
"font-base-url",
|
|
75
70
|
"title"
|
|
76
|
-
]),
|
|
71
|
+
]), T.value ? (p(), c("div", v, h(T.value), 1)) : s("", !0)], 12, _)]));
|
|
77
72
|
}
|
|
78
73
|
});
|
|
79
74
|
//#endregion
|
|
80
|
-
export {
|
|
75
|
+
export { y as default };
|
package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { resolveContractPagePadding as e } from "../../../contract-print-css/index.mjs";
|
|
2
|
+
import t from "./ContractPrintIframe.mjs";
|
|
3
|
+
import { buildPageDecorationClassNames as n, buildPageDecorationsHtml as r, normalizePageDecorations as i } from "./utils/page-decorations.mjs";
|
|
4
|
+
import { describeContractTemplateLayoutIssue as a } from "./utils/contract-layout-check.mjs";
|
|
5
|
+
import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeStyle as f, openBlock as p, shallowRef as m, toDisplayString as h } from "vue";
|
|
4
6
|
//#region src/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
7
|
+
var g = ["data-render-page-id"], _ = {
|
|
6
8
|
key: 0,
|
|
7
9
|
class: "gd-contract-template-renderer__page-meta"
|
|
8
|
-
},
|
|
10
|
+
}, v = [
|
|
9
11
|
"data-page-id",
|
|
10
12
|
"data-page-format",
|
|
11
13
|
"data-page-width",
|
|
12
14
|
"data-page-height"
|
|
13
|
-
],
|
|
15
|
+
], y = {
|
|
14
16
|
key: 0,
|
|
15
17
|
class: "gd-contract-template-renderer__font-error",
|
|
16
18
|
role: "alert"
|
|
17
|
-
},
|
|
19
|
+
}, b = /* @__PURE__ */ d({
|
|
18
20
|
name: "ContractTemplateRendererPage",
|
|
19
21
|
__name: "ContractTemplateRendererPage",
|
|
20
22
|
props: {
|
|
@@ -32,57 +34,69 @@ var v = ["data-render-page-id"], y = {
|
|
|
32
34
|
"metrics",
|
|
33
35
|
"interaction"
|
|
34
36
|
],
|
|
35
|
-
setup(
|
|
36
|
-
let
|
|
37
|
-
width: `${
|
|
38
|
-
height: `${
|
|
39
|
-
})),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
setup(d, { emit: b }) {
|
|
38
|
+
let x = d, S = b, C = o(() => ({
|
|
39
|
+
width: `${x.page.width * x.zoom}px`,
|
|
40
|
+
height: `${x.page.height * x.zoom}px`
|
|
41
|
+
})), w = o(() => e(i(x.page.pageDecorations), x.index + 1)), T = o(() => ({
|
|
42
|
+
width: `${x.page.width}px`,
|
|
43
|
+
height: `${x.page.height}px`,
|
|
44
|
+
transform: `scale(${x.zoom})`
|
|
45
|
+
})), E = o(() => n(x.page.pageDecorations, x.index + 1)), D = o(() => r(x.page.pageDecorations, x.index + 1, x.total, x.page.decorationVariables, x.page.decorationValues)), O = m(""), k = m(), A = o(() => O.value ? O.value : k.value ? a({
|
|
46
|
+
pageIndex: x.index,
|
|
47
|
+
pageNumber: x.index + 1,
|
|
48
|
+
pageId: x.page.id,
|
|
49
|
+
kind: "overflow",
|
|
50
|
+
overflowHeight: k.value.overflowHeight,
|
|
51
|
+
overflowWidth: k.value.overflowWidth
|
|
52
|
+
})[0] ?? "" : "");
|
|
50
53
|
function j(e, t) {
|
|
51
|
-
|
|
54
|
+
e === "loading" && (k.value = void 0), O.value = e === "error" ? a({
|
|
55
|
+
pageIndex: x.index,
|
|
56
|
+
pageNumber: x.index + 1,
|
|
57
|
+
pageId: x.page.id,
|
|
58
|
+
kind: "measure-failed",
|
|
59
|
+
overflowHeight: 0,
|
|
60
|
+
overflowWidth: 0,
|
|
61
|
+
error: t
|
|
62
|
+
})[0] ?? "无法确认排版,请稍后重试" : "", S("status", e, t);
|
|
52
63
|
}
|
|
53
|
-
|
|
64
|
+
function M(e) {
|
|
65
|
+
k.value = e, S("metrics", e);
|
|
66
|
+
}
|
|
67
|
+
return (e, n) => (p(), c("article", {
|
|
54
68
|
class: "gd-contract-template-renderer__page-shell",
|
|
55
|
-
"data-render-page-id":
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
])) :
|
|
69
|
+
"data-render-page-id": d.page.id
|
|
70
|
+
}, [d.showMeta ? (p(), c("header", _, [
|
|
71
|
+
l("strong", null, "第 " + h(d.index + 1) + " / " + h(d.total) + " 页", 1),
|
|
72
|
+
l("span", null, h(d.page.title), 1),
|
|
73
|
+
l("small", null, h(d.page.format) + " · " + h(d.page.width) + " × " + h(d.page.height) + " px", 1)
|
|
74
|
+
])) : s("", !0), l("div", {
|
|
61
75
|
class: "gd-contract-template-renderer__page-frame",
|
|
62
|
-
style:
|
|
63
|
-
}, [
|
|
76
|
+
style: f(C.value)
|
|
77
|
+
}, [l("div", {
|
|
64
78
|
class: "gd-contract-template-renderer__print-page",
|
|
65
|
-
"data-page-id":
|
|
66
|
-
"data-page-format":
|
|
67
|
-
"data-page-width":
|
|
68
|
-
"data-page-height":
|
|
69
|
-
style:
|
|
70
|
-
}, [
|
|
71
|
-
"page-id":
|
|
72
|
-
"page-format":
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
75
|
-
"padding-top":
|
|
76
|
-
"padding-bottom":
|
|
77
|
-
"class-names":
|
|
78
|
-
"decorations-html":
|
|
79
|
-
"content-html":
|
|
80
|
-
"font-base-url":
|
|
81
|
-
"active-key":
|
|
82
|
-
"scroll-request":
|
|
83
|
-
title: `第 ${
|
|
84
|
-
onInteraction: n[0] ||= (e) =>
|
|
85
|
-
onMetrics:
|
|
79
|
+
"data-page-id": d.page.id,
|
|
80
|
+
"data-page-format": d.page.format,
|
|
81
|
+
"data-page-width": d.page.width,
|
|
82
|
+
"data-page-height": d.page.height,
|
|
83
|
+
style: f(T.value)
|
|
84
|
+
}, [u(t, {
|
|
85
|
+
"page-id": d.page.id,
|
|
86
|
+
"page-format": d.page.format,
|
|
87
|
+
width: d.page.width,
|
|
88
|
+
height: d.page.height,
|
|
89
|
+
"padding-top": w.value.top,
|
|
90
|
+
"padding-bottom": w.value.bottom,
|
|
91
|
+
"class-names": E.value,
|
|
92
|
+
"decorations-html": D.value,
|
|
93
|
+
"content-html": d.page.contentHtml,
|
|
94
|
+
"font-base-url": d.fontBaseUrl,
|
|
95
|
+
"active-key": d.activeKey,
|
|
96
|
+
"scroll-request": d.scrollRequest,
|
|
97
|
+
title: `第 ${d.index + 1} 页合同填写内容`,
|
|
98
|
+
onInteraction: n[0] ||= (e) => S("interaction", e),
|
|
99
|
+
onMetrics: M,
|
|
86
100
|
onStatus: j
|
|
87
101
|
}, null, 8, [
|
|
88
102
|
"page-id",
|
|
@@ -98,8 +112,8 @@ var v = ["data-render-page-id"], y = {
|
|
|
98
112
|
"active-key",
|
|
99
113
|
"scroll-request",
|
|
100
114
|
"title"
|
|
101
|
-
]), A.value ? (
|
|
115
|
+
]), A.value ? (p(), c("div", y, h(A.value), 1)) : s("", !0)], 12, v)], 4)], 8, g));
|
|
102
116
|
}
|
|
103
117
|
});
|
|
104
118
|
//#endregion
|
|
105
|
-
export {
|
|
119
|
+
export { b as default };
|