@guodun/antdv 1.4.4 → 1.4.5
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 +85 -85
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- 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/ContractTemplateDesignerInspector.vue.mjs +372 -185
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +914 -853
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +214 -139
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
- package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
- package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -65
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
- package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
- package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
- package/dist/es/components/pro-selector/src/types.mjs +4 -1
- package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
- package/dist/es/components/role-selector/src/role.mjs +134 -120
- package/dist/es/index.mjs +50 -49
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/dept-selector/src/dept.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/ContractTemplateDesignerInspector.vue.cjs +2 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
- 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/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
- package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
- package/dist/lib/components/role-selector/src/role.cjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/dept-selector.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -1
- package/dist/theme/pro-selector.css +1 -1
- package/dist/theme/role-selector.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
- package/dist/types/components/pro-selector/index.d.ts +9 -0
- package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
- package/dist/types/components/pro-selector/src/types.d.ts +2 -0
- package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
- package/package.json +3 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
|
|
2
2
|
import { Button as p, Tooltip as m } from "ant-design-vue";
|
|
3
|
-
import { AuditOutlined as h, BgColorsOutlined as g, ColumnWidthOutlined as _,
|
|
3
|
+
import { AuditOutlined as h, BgColorsOutlined as g, ColumnWidthOutlined as _, CopyOutlined as v, DatabaseOutlined as y, DeleteOutlined as b, EyeOutlined as x, FormOutlined as S, FullscreenExitOutlined as C, FullscreenOutlined as w, ReloadOutlined as T, UpOutlined as E, ZoomInOutlined as D, ZoomOutOutlined as O } from "@ant-design/icons-vue";
|
|
4
4
|
//#region src/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var k = { class: "gd-contract-template-designer__workspace-meta" }, A = { class: "gd-contract-template-designer__workspace-actions" }, j = { class: "gd-contract-template-designer__workspace-controls" }, M = { class: "gd-contract-template-designer__zoom" }, N = { class: "gd-contract-template-designer__workspace-buttons" }, P = { class: "gd-contract-template-designer__page-decorations-trigger-copy" }, F = /* @__PURE__ */ o({
|
|
6
6
|
__name: "ContractTemplateDesignerWorkspaceHeader",
|
|
7
7
|
props: {
|
|
8
8
|
summary: {},
|
|
@@ -11,6 +11,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
11
11
|
showDraftCacheStatus: { type: Boolean },
|
|
12
12
|
showClearButton: { type: Boolean },
|
|
13
13
|
showSubmitDataViewer: { type: Boolean },
|
|
14
|
+
showVariableDataViewer: { type: Boolean },
|
|
14
15
|
readonly: { type: Boolean },
|
|
15
16
|
zoomPercent: {},
|
|
16
17
|
zoomOutDisabled: { type: Boolean },
|
|
@@ -35,49 +36,50 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
35
36
|
"validate",
|
|
36
37
|
"preview",
|
|
37
38
|
"submitData",
|
|
39
|
+
"variableData",
|
|
38
40
|
"togglePageDecorations",
|
|
39
41
|
"toggleChrome"
|
|
40
42
|
],
|
|
41
|
-
setup(o, { expose:
|
|
42
|
-
let
|
|
43
|
+
setup(o, { expose: F, emit: I }) {
|
|
44
|
+
let L = o, R = I, z = l(), B = e(() => [
|
|
43
45
|
{
|
|
44
46
|
key: "header",
|
|
45
47
|
label: "页眉",
|
|
46
|
-
enabled:
|
|
48
|
+
enabled: L.pageDecorationsEnabledStates.header
|
|
47
49
|
},
|
|
48
50
|
{
|
|
49
51
|
key: "footer",
|
|
50
52
|
label: "页脚",
|
|
51
|
-
enabled:
|
|
53
|
+
enabled: L.pageDecorationsEnabledStates.footer
|
|
52
54
|
},
|
|
53
55
|
{
|
|
54
56
|
key: "watermark",
|
|
55
57
|
label: "水印",
|
|
56
|
-
enabled:
|
|
58
|
+
enabled: L.pageDecorationsEnabledStates.watermark
|
|
57
59
|
}
|
|
58
|
-
]),
|
|
59
|
-
return
|
|
60
|
-
focusPageDecorations: () =>
|
|
61
|
-
focusImmersive: () =>
|
|
62
|
-
focusChromeToggle: () =>
|
|
60
|
+
]), V = e(() => `页面装饰 · ${L.pageDecorationsPresetLabel} · 启用 ${L.pageDecorationsEnabledCount}/3`), H = e(() => `页面装饰,${L.pageDecorationsPresetLabel},已启用 ${L.pageDecorationsEnabledCount}/3;${B.value.map((e) => `${e.label}${e.enabled ? "已启用" : "未启用"}`).join(",")}`);
|
|
61
|
+
return F({
|
|
62
|
+
focusPageDecorations: () => z.value?.querySelector(".gd-contract-template-designer__page-decorations-trigger")?.focus(),
|
|
63
|
+
focusImmersive: () => z.value?.querySelector(".gd-contract-template-designer__immersive-trigger")?.focus(),
|
|
64
|
+
focusChromeToggle: () => z.value?.querySelector(".gd-contract-template-designer__workspace-chrome-toggle")?.focus()
|
|
63
65
|
}), (e, l) => (c(), r("header", {
|
|
64
66
|
ref_key: "workspaceHeader",
|
|
65
|
-
ref:
|
|
67
|
+
ref: z,
|
|
66
68
|
class: "gd-contract-template-designer__workspace-header"
|
|
67
|
-
}, [i("div",
|
|
69
|
+
}, [i("div", k, [i("strong", null, u(o.summary), 1), o.showDraftCacheStatus && o.draftCacheStatusText ? (c(), r("small", {
|
|
68
70
|
key: 0,
|
|
69
71
|
class: s(["gd-contract-template-designer__draft-cache-status", o.draftCacheStatusClass])
|
|
70
|
-
}, u(o.draftCacheStatusText), 3)) : n("", !0)]), i("div",
|
|
71
|
-
i("div",
|
|
72
|
+
}, u(o.draftCacheStatusText), 3)) : n("", !0)]), i("div", A, [
|
|
73
|
+
i("div", j, [i("div", M, [
|
|
72
74
|
a(d(m), { title: "缩小" }, {
|
|
73
75
|
default: f(() => [a(d(p), {
|
|
74
76
|
size: "small",
|
|
75
77
|
class: "gd-contract-template-designer__icon-button",
|
|
76
78
|
disabled: o.zoomOutDisabled,
|
|
77
79
|
"aria-label": "缩小",
|
|
78
|
-
onClick: l[0] ||= (e) =>
|
|
80
|
+
onClick: l[0] ||= (e) => R("zoomOut")
|
|
79
81
|
}, {
|
|
80
|
-
default: f(() => [a(d(
|
|
82
|
+
default: f(() => [a(d(O), { "aria-hidden": "true" })]),
|
|
81
83
|
_: 1
|
|
82
84
|
}, 8, ["disabled"])]),
|
|
83
85
|
_: 1
|
|
@@ -89,9 +91,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
89
91
|
class: "gd-contract-template-designer__icon-button",
|
|
90
92
|
disabled: o.zoomInDisabled,
|
|
91
93
|
"aria-label": "放大",
|
|
92
|
-
onClick: l[1] ||= (e) =>
|
|
94
|
+
onClick: l[1] ||= (e) => R("zoomIn")
|
|
93
95
|
}, {
|
|
94
|
-
default: f(() => [a(d(
|
|
96
|
+
default: f(() => [a(d(D), { "aria-hidden": "true" })]),
|
|
95
97
|
_: 1
|
|
96
98
|
}, 8, ["disabled"])]),
|
|
97
99
|
_: 1
|
|
@@ -101,7 +103,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
101
103
|
size: "small",
|
|
102
104
|
class: "gd-contract-template-designer__icon-button",
|
|
103
105
|
"aria-label": "适应宽度",
|
|
104
|
-
onClick: l[2] ||= (e) =>
|
|
106
|
+
onClick: l[2] ||= (e) => R("fitWidth")
|
|
105
107
|
}, {
|
|
106
108
|
default: f(() => [a(d(_), { "aria-hidden": "true" })]),
|
|
107
109
|
_: 1
|
|
@@ -113,9 +115,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
113
115
|
size: "small",
|
|
114
116
|
class: "gd-contract-template-designer__icon-button",
|
|
115
117
|
"aria-label": "重置缩放",
|
|
116
|
-
onClick: l[3] ||= (e) =>
|
|
118
|
+
onClick: l[3] ||= (e) => R("resetZoom")
|
|
117
119
|
}, {
|
|
118
|
-
default: f(() => [a(d(
|
|
120
|
+
default: f(() => [a(d(T), { "aria-hidden": "true" })]),
|
|
119
121
|
_: 1
|
|
120
122
|
})]),
|
|
121
123
|
_: 1
|
|
@@ -125,12 +127,12 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
125
127
|
size: "small",
|
|
126
128
|
class: "gd-contract-template-designer__icon-button",
|
|
127
129
|
"aria-label": o.isFullscreen ? "退出全屏" : "全屏显示",
|
|
128
|
-
onClick: l[4] ||= (e) =>
|
|
130
|
+
onClick: l[4] ||= (e) => R("toggleFullscreen")
|
|
129
131
|
}, {
|
|
130
|
-
default: f(() => [o.isFullscreen ? (c(), t(d(
|
|
132
|
+
default: f(() => [o.isFullscreen ? (c(), t(d(C), {
|
|
131
133
|
key: 0,
|
|
132
134
|
"aria-hidden": "true"
|
|
133
|
-
})) : (c(), t(d(
|
|
135
|
+
})) : (c(), t(d(w), {
|
|
134
136
|
key: 1,
|
|
135
137
|
"aria-hidden": "true"
|
|
136
138
|
}))]),
|
|
@@ -144,15 +146,15 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
144
146
|
class: s(["gd-contract-template-designer__icon-button gd-contract-template-designer__immersive-trigger", { "is-selected": o.immersive }]),
|
|
145
147
|
"aria-pressed": o.immersive,
|
|
146
148
|
"aria-label": "沉浸写作",
|
|
147
|
-
onClick: l[5] ||= (e) =>
|
|
149
|
+
onClick: l[5] ||= (e) => R("toggleImmersive")
|
|
148
150
|
}, {
|
|
149
|
-
default: f(() => [a(d(
|
|
151
|
+
default: f(() => [a(d(S), { "aria-hidden": "true" })]),
|
|
150
152
|
_: 1
|
|
151
153
|
}, 8, ["class", "aria-pressed"])]),
|
|
152
154
|
_: 1
|
|
153
155
|
})
|
|
154
156
|
])]),
|
|
155
|
-
i("div",
|
|
157
|
+
i("div", N, [
|
|
156
158
|
o.showClearButton ? (c(), t(d(m), {
|
|
157
159
|
key: 0,
|
|
158
160
|
title: "清空合同"
|
|
@@ -163,24 +165,24 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
163
165
|
class: "gd-contract-template-designer__icon-button",
|
|
164
166
|
disabled: o.readonly,
|
|
165
167
|
"aria-label": "清空合同",
|
|
166
|
-
onClick: l[6] ||= (e) =>
|
|
168
|
+
onClick: l[6] ||= (e) => R("clear")
|
|
167
169
|
}, {
|
|
168
|
-
default: f(() => [a(d(
|
|
170
|
+
default: f(() => [a(d(b), { "aria-hidden": "true" })]),
|
|
169
171
|
_: 1
|
|
170
172
|
}, 8, ["disabled"])]),
|
|
171
173
|
_: 1
|
|
172
174
|
})) : n("", !0),
|
|
173
|
-
a(d(m), { title:
|
|
175
|
+
a(d(m), { title: V.value }, {
|
|
174
176
|
default: f(() => [a(d(p), {
|
|
175
177
|
size: "small",
|
|
176
178
|
class: s(["gd-contract-template-designer__page-decorations-trigger", { "is-selected": o.pageDecorationsOpen }]),
|
|
177
179
|
"aria-pressed": o.pageDecorationsOpen,
|
|
178
180
|
"aria-expanded": o.pageDecorationsOpen,
|
|
179
181
|
"aria-controls": o.pageDecorationsStudioId,
|
|
180
|
-
"aria-label":
|
|
181
|
-
onClick: l[7] ||= (e) =>
|
|
182
|
+
"aria-label": H.value,
|
|
183
|
+
onClick: l[7] ||= (e) => R("togglePageDecorations")
|
|
182
184
|
}, {
|
|
183
|
-
default: f(() => [a(d(g), { "aria-hidden": "true" }), i("span",
|
|
185
|
+
default: f(() => [a(d(g), { "aria-hidden": "true" }), i("span", P, [l[13] ||= i("span", null, "页面装饰", -1), i("small", null, u(o.pageDecorationsPresetLabel) + " · 启用 " + u(o.pageDecorationsEnabledCount) + "/3", 1)])]),
|
|
184
186
|
_: 1
|
|
185
187
|
}, 8, [
|
|
186
188
|
"class",
|
|
@@ -196,7 +198,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
196
198
|
size: "small",
|
|
197
199
|
class: "gd-contract-template-designer__icon-button",
|
|
198
200
|
"aria-label": "校验",
|
|
199
|
-
onClick: l[8] ||= (e) =>
|
|
201
|
+
onClick: l[8] ||= (e) => R("validate")
|
|
200
202
|
}, {
|
|
201
203
|
default: f(() => [a(d(h), { "aria-hidden": "true" })]),
|
|
202
204
|
_: 1
|
|
@@ -209,9 +211,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
209
211
|
type: "primary",
|
|
210
212
|
class: "gd-contract-template-designer__icon-button",
|
|
211
213
|
"aria-label": "预览",
|
|
212
|
-
onClick: l[9] ||= (e) =>
|
|
214
|
+
onClick: l[9] ||= (e) => R("preview")
|
|
213
215
|
}, {
|
|
214
|
-
default: f(() => [a(d(
|
|
216
|
+
default: f(() => [a(d(x), { "aria-hidden": "true" })]),
|
|
215
217
|
_: 1
|
|
216
218
|
})]),
|
|
217
219
|
_: 1
|
|
@@ -224,7 +226,22 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
224
226
|
size: "small",
|
|
225
227
|
class: "gd-contract-template-designer__icon-button",
|
|
226
228
|
"aria-label": "数据查看",
|
|
227
|
-
onClick: l[10] ||= (e) =>
|
|
229
|
+
onClick: l[10] ||= (e) => R("submitData")
|
|
230
|
+
}, {
|
|
231
|
+
default: f(() => [a(d(y), { "aria-hidden": "true" })]),
|
|
232
|
+
_: 1
|
|
233
|
+
})]),
|
|
234
|
+
_: 1
|
|
235
|
+
})) : n("", !0),
|
|
236
|
+
o.showVariableDataViewer ? (c(), t(d(m), {
|
|
237
|
+
key: 2,
|
|
238
|
+
title: "控件变量"
|
|
239
|
+
}, {
|
|
240
|
+
default: f(() => [a(d(p), {
|
|
241
|
+
size: "small",
|
|
242
|
+
class: "gd-contract-template-designer__icon-button",
|
|
243
|
+
"aria-label": "控件变量",
|
|
244
|
+
onClick: l[11] ||= (e) => R("variableData")
|
|
228
245
|
}, {
|
|
229
246
|
default: f(() => [a(d(v), { "aria-hidden": "true" })]),
|
|
230
247
|
_: 1
|
|
@@ -239,9 +256,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
239
256
|
"aria-label": "收起工具区",
|
|
240
257
|
"aria-expanded": !0,
|
|
241
258
|
"aria-controls": o.chromeControlsId,
|
|
242
|
-
onClick: l[
|
|
259
|
+
onClick: l[12] ||= (e) => R("toggleChrome")
|
|
243
260
|
}, {
|
|
244
|
-
default: f(() => [a(d(
|
|
261
|
+
default: f(() => [a(d(E), { "aria-hidden": "true" })]),
|
|
245
262
|
_: 1
|
|
246
263
|
}, 8, ["aria-controls"])]),
|
|
247
264
|
_: 1
|
|
@@ -250,4 +267,4 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
|
|
|
250
267
|
}
|
|
251
268
|
});
|
|
252
269
|
//#endregion
|
|
253
|
-
export {
|
|
270
|
+
export { F as default };
|
package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import e from "../../pro-selector-group/index.mjs";
|
|
2
|
+
import { isContractTemplateFieldType as t } from "./types.mjs";
|
|
3
|
+
import { formatContractTemplateRenderValue as n, normalizeContractTemplateJsonObject as r, normalizeContractTemplateSelectionValues as i } from "./utils/advanced-controls.mjs";
|
|
4
|
+
import { getFieldOption as ee } from "./composables/use-template-designer.mjs";
|
|
5
|
+
import { isSafeContractImageUrl as te } from "./utils/image-url.mjs";
|
|
6
|
+
import { resolveFieldTypeIcon as a } from "./utils/template-tool-icons.mjs";
|
|
7
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, mergeProps as h, normalizeClass as ne, openBlock as g, ref as _, renderList as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, withCtx as S, withModifiers as C } from "vue";
|
|
8
|
+
import { Alert as w, Button as T, Checkbox as E, DatePicker as re, Image as ie, Input as D, InputNumber as ae, Radio as oe, RadioGroup as se, Select as ce, Tooltip as O } from "ant-design-vue";
|
|
9
|
+
import { DeleteOutlined as le, EyeOutlined as ue } from "@ant-design/icons-vue";
|
|
8
10
|
//#region src/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
11
|
+
var k = { class: "gd-contract-template-renderer__field-head" }, de = { class: "gd-contract-template-renderer__field-title" }, fe = {
|
|
10
12
|
class: "gd-contract-template-renderer__field-type-icon",
|
|
11
13
|
"aria-hidden": "true"
|
|
12
|
-
},
|
|
14
|
+
}, pe = { class: "gd-contract-template-renderer__field-title-text" }, me = {
|
|
13
15
|
key: 0,
|
|
14
16
|
class: "gd-contract-template-renderer__field-required",
|
|
15
17
|
"aria-label": "必填"
|
|
16
|
-
},
|
|
18
|
+
}, A = {
|
|
17
19
|
key: 4,
|
|
20
|
+
class: "gd-contract-template-renderer__selector-field"
|
|
21
|
+
}, j = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "gd-contract-template-renderer__selector-placeholder",
|
|
24
|
+
role: "status"
|
|
25
|
+
}, M = {
|
|
26
|
+
key: 9,
|
|
18
27
|
class: "gd-contract-template-renderer__field-checkbox"
|
|
19
|
-
},
|
|
20
|
-
key:
|
|
28
|
+
}, N = {
|
|
29
|
+
key: 10,
|
|
21
30
|
class: "gd-contract-template-renderer__image-field"
|
|
22
|
-
},
|
|
31
|
+
}, P = {
|
|
23
32
|
key: 0,
|
|
24
33
|
class: "gd-contract-template-renderer__image-preview"
|
|
25
|
-
},
|
|
26
|
-
key:
|
|
34
|
+
}, F = {
|
|
35
|
+
key: 12,
|
|
27
36
|
class: "gd-contract-template-renderer__field-errors"
|
|
28
|
-
},
|
|
37
|
+
}, I = /* @__PURE__ */ m({
|
|
29
38
|
name: "ContractTemplateRendererField",
|
|
30
39
|
__name: "ContractTemplateRendererField",
|
|
31
40
|
props: {
|
|
@@ -33,138 +42,262 @@ var A = { class: "gd-contract-template-renderer__field-head" }, j = { class: "gd
|
|
|
33
42
|
value: { type: [
|
|
34
43
|
String,
|
|
35
44
|
Number,
|
|
36
|
-
Boolean
|
|
45
|
+
Boolean,
|
|
46
|
+
Object,
|
|
47
|
+
Array,
|
|
48
|
+
null
|
|
37
49
|
] },
|
|
38
50
|
errors: {},
|
|
39
51
|
active: { type: Boolean },
|
|
40
52
|
readonly: { type: Boolean },
|
|
41
|
-
disabled: { type: Boolean }
|
|
53
|
+
disabled: { type: Boolean },
|
|
54
|
+
options: {},
|
|
55
|
+
loading: { type: Boolean },
|
|
56
|
+
loadError: {},
|
|
57
|
+
registration: {},
|
|
58
|
+
selectorHttp: {},
|
|
59
|
+
selectorUrlPrefix: {}
|
|
42
60
|
},
|
|
43
61
|
emits: ["updateValue", "focusVariable"],
|
|
44
|
-
setup(
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
47
|
-
let e = Number(
|
|
62
|
+
setup(m, { emit: I }) {
|
|
63
|
+
let L = m, R = I, z = s(() => L.readonly || L.disabled), B = s(() => L.value === void 0 || L.value === null ? "" : String(L.value)), V = s(() => n(L.value)), he = s(() => {
|
|
64
|
+
if (L.value === void 0 || L.value === null || L.value === "") return;
|
|
65
|
+
let e = Number(L.value);
|
|
48
66
|
return Number.isFinite(e) ? e : void 0;
|
|
49
|
-
}),
|
|
67
|
+
}), H = s(() => L.value === !0 || L.value === "true" || L.value === "1" || L.value === "是" || L.value === "已选"), U = s(() => L.errors.length > 0), W = s(() => B.value && te(B.value) ? B.value : ""), G = s(() => t(L.variable.type) ? L.variable.type : "text"), ge = s(() => a(G.value)), _e = s(() => ee(G.value).label), K = _(!1), q = s(() => L.variable.type === "user-selector" ? "user" : L.variable.type === "role-selector" ? "role" : "dept"), ve = s(() => (Array.isArray(L.value) ? L.value : L.value ? [L.value] : []).flatMap((e) => {
|
|
68
|
+
if (!e || typeof e != "object") return [];
|
|
69
|
+
let t = e;
|
|
70
|
+
return [{
|
|
71
|
+
value: String(t.value),
|
|
72
|
+
label: t.label,
|
|
73
|
+
type: q.value
|
|
74
|
+
}];
|
|
75
|
+
})), J = s(() => (L.options ?? L.variable.options ?? []).map((e) => ({
|
|
76
|
+
...e,
|
|
77
|
+
value: e.value,
|
|
78
|
+
label: e.label
|
|
79
|
+
}))), Y = s(() => {
|
|
80
|
+
if (Array.isArray(L.value)) return L.value.map((e) => e.value);
|
|
81
|
+
if (L.value && typeof L.value == "object") return L.value.value;
|
|
82
|
+
}), X = s(() => ({
|
|
83
|
+
modelValue: L.value,
|
|
84
|
+
variable: L.variable,
|
|
85
|
+
config: r(L.variable.componentConfig),
|
|
86
|
+
readonly: L.readonly,
|
|
87
|
+
disabled: z.value,
|
|
88
|
+
options: J.value,
|
|
89
|
+
loading: !!L.loading,
|
|
90
|
+
error: L.loadError,
|
|
91
|
+
...L.registration?.resolveProps?.({
|
|
92
|
+
variable: L.variable,
|
|
93
|
+
config: r(L.variable.componentConfig)
|
|
94
|
+
}) ?? {}
|
|
95
|
+
}));
|
|
50
96
|
function Z(e) {
|
|
51
|
-
|
|
97
|
+
R("updateValue", e);
|
|
52
98
|
}
|
|
53
|
-
function
|
|
99
|
+
function ye(e) {
|
|
54
100
|
if (e === null || e === "") {
|
|
55
|
-
|
|
101
|
+
R("updateValue", void 0);
|
|
56
102
|
return;
|
|
57
103
|
}
|
|
58
104
|
let t = Number(e);
|
|
59
|
-
|
|
105
|
+
R("updateValue", Number.isFinite(t) ? t : void 0);
|
|
106
|
+
}
|
|
107
|
+
function be(e) {
|
|
108
|
+
R("updateValue", e);
|
|
109
|
+
}
|
|
110
|
+
function Q(e) {
|
|
111
|
+
let t = (e == null ? [] : Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
112
|
+
let t = e && typeof e == "object" && "value" in e ? e.value : e, n = J.value.find((e) => e.value === t);
|
|
113
|
+
return n ? [{
|
|
114
|
+
value: n.value,
|
|
115
|
+
label: n.label,
|
|
116
|
+
type: n.type || G.value
|
|
117
|
+
}] : [];
|
|
118
|
+
});
|
|
119
|
+
R("updateValue", L.variable.multiple && G.value === "select" ? t : t[0]);
|
|
120
|
+
}
|
|
121
|
+
function xe(e) {
|
|
122
|
+
R("updateValue", i(e, G.value, !!L.variable.multiple));
|
|
60
123
|
}
|
|
61
124
|
function $(e) {
|
|
62
|
-
|
|
125
|
+
let t = {
|
|
126
|
+
variable: L.variable,
|
|
127
|
+
config: r(L.variable.componentConfig)
|
|
128
|
+
};
|
|
129
|
+
R("updateValue", L.registration?.normalizeValue ? L.registration.normalizeValue(e, t) : e);
|
|
63
130
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
131
|
+
function Se(e) {
|
|
132
|
+
R("updateValue", typeof e == "string" ? e : "");
|
|
66
133
|
}
|
|
67
|
-
return (
|
|
68
|
-
class:
|
|
69
|
-
"is-active":
|
|
70
|
-
"has-error":
|
|
134
|
+
return (t, n) => (g(), u("section", {
|
|
135
|
+
class: ne(["gd-contract-template-renderer__field", {
|
|
136
|
+
"is-active": m.active,
|
|
137
|
+
"has-error": U.value
|
|
71
138
|
}]),
|
|
72
|
-
onClick:
|
|
73
|
-
onFocusin:
|
|
139
|
+
onClick: n[3] ||= (e) => R("focusVariable"),
|
|
140
|
+
onFocusin: n[4] ||= (e) => R("focusVariable")
|
|
74
141
|
}, [
|
|
75
|
-
|
|
76
|
-
default:
|
|
142
|
+
d("div", k, [d("strong", null, [d("span", de, [p(x(O), { title: _e.value }, {
|
|
143
|
+
default: S(() => [d("span", fe, [(g(), c(y(ge.value)))])]),
|
|
77
144
|
_: 1
|
|
78
|
-
}, 8, ["title"]),
|
|
79
|
-
|
|
145
|
+
}, 8, ["title"]), d("span", pe, [f(b(m.variable.label || m.variable.key) + " ", 1), m.variable.required ? (g(), u("span", me, "*")) : l("", !0)])])]), d("small", null, b(m.variable.key), 1)]),
|
|
146
|
+
m.variable.type === "text" && m.variable.multiline ? (g(), c(x(D).TextArea, {
|
|
80
147
|
key: 0,
|
|
81
|
-
value:
|
|
82
|
-
rows:
|
|
83
|
-
placeholder:
|
|
84
|
-
disabled:
|
|
148
|
+
value: B.value,
|
|
149
|
+
rows: m.variable.rows || 3,
|
|
150
|
+
placeholder: m.variable.placeholder || "",
|
|
151
|
+
disabled: z.value,
|
|
85
152
|
"onUpdate:value": Z
|
|
86
153
|
}, null, 8, [
|
|
87
154
|
"value",
|
|
88
155
|
"rows",
|
|
89
156
|
"placeholder",
|
|
90
157
|
"disabled"
|
|
91
|
-
])) : !
|
|
158
|
+
])) : !m.variable.type || m.variable.type === "text" ? (g(), c(x(D), {
|
|
92
159
|
key: 1,
|
|
93
|
-
value:
|
|
94
|
-
placeholder:
|
|
95
|
-
disabled:
|
|
160
|
+
value: B.value,
|
|
161
|
+
placeholder: m.variable.placeholder || "",
|
|
162
|
+
disabled: z.value,
|
|
96
163
|
"onUpdate:value": Z
|
|
97
164
|
}, null, 8, [
|
|
98
165
|
"value",
|
|
99
166
|
"placeholder",
|
|
100
167
|
"disabled"
|
|
101
|
-
])) :
|
|
168
|
+
])) : m.variable.type === "select" ? (g(), c(x(ce), {
|
|
102
169
|
key: 2,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
170
|
+
value: Y.value,
|
|
171
|
+
options: J.value,
|
|
172
|
+
mode: m.variable.multiple ? "multiple" : void 0,
|
|
173
|
+
placeholder: m.variable.placeholder || "请选择",
|
|
174
|
+
disabled: z.value,
|
|
175
|
+
loading: m.loading,
|
|
176
|
+
"allow-clear": "",
|
|
177
|
+
"onUpdate:value": Q
|
|
108
178
|
}, null, 8, [
|
|
109
179
|
"value",
|
|
180
|
+
"options",
|
|
181
|
+
"mode",
|
|
110
182
|
"placeholder",
|
|
111
|
-
"disabled"
|
|
112
|
-
|
|
183
|
+
"disabled",
|
|
184
|
+
"loading"
|
|
185
|
+
])) : m.variable.type === "radio" ? (g(), c(x(se), {
|
|
113
186
|
key: 3,
|
|
114
|
-
value:
|
|
115
|
-
|
|
116
|
-
placeholder: f.variable.placeholder || "",
|
|
117
|
-
disabled: H.value,
|
|
187
|
+
value: Y.value,
|
|
188
|
+
disabled: z.value,
|
|
118
189
|
"onUpdate:value": Q
|
|
190
|
+
}, {
|
|
191
|
+
default: S(() => [(g(!0), u(o, null, v(J.value, (e) => (g(), c(x(oe), {
|
|
192
|
+
key: e.value,
|
|
193
|
+
value: e.value,
|
|
194
|
+
disabled: e.disabled
|
|
195
|
+
}, {
|
|
196
|
+
default: S(() => [f(b(e.label), 1)]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, 1032, ["value", "disabled"]))), 128))]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["value", "disabled"])) : m.variable.type === "user-selector" || m.variable.type === "dept-selector" || m.variable.type === "role-selector" || m.variable.type === "org-selector" ? (g(), u("div", A, [m.registration ? (g(), c(y(m.registration?.component), h({ key: 0 }, X.value, { "onUpdate:modelValue": $ }), null, 16)) : m.variable.type === "org-selector" ? (g(), u("span", j, b(V.value || m.variable.placeholder || "组织架构占位(由宿主提供组件)"), 1)) : (g(), u(o, { key: 2 }, [p(x(T), {
|
|
201
|
+
disabled: z.value || !m.selectorHttp,
|
|
202
|
+
title: m.selectorHttp ? void 0 : "请注入 selectorHttp 后使用内置选择器",
|
|
203
|
+
onClick: n[0] ||= C((e) => K.value = !0, ["stop"])
|
|
204
|
+
}, {
|
|
205
|
+
default: S(() => [f(b(V.value || m.variable.placeholder || "请选择"), 1)]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["disabled", "title"]), p(x(e), {
|
|
208
|
+
"model-value": ve.value,
|
|
209
|
+
visible: K.value,
|
|
210
|
+
"onUpdate:visible": n[1] ||= (e) => K.value = e,
|
|
211
|
+
http: m.selectorHttp,
|
|
212
|
+
"url-prefix": m.selectorUrlPrefix,
|
|
213
|
+
type: q.value,
|
|
214
|
+
"is-single": !0,
|
|
215
|
+
"hide-slot": "",
|
|
216
|
+
"onUpdate:modelValue": xe
|
|
217
|
+
}, null, 8, [
|
|
218
|
+
"model-value",
|
|
219
|
+
"visible",
|
|
220
|
+
"http",
|
|
221
|
+
"url-prefix",
|
|
222
|
+
"type"
|
|
223
|
+
])], 64))])) : m.variable.type === "custom" && m.registration ? (g(), c(y(m.registration?.component), h({ key: 5 }, X.value, { "onUpdate:modelValue": $ }), null, 16)) : m.variable.type === "custom" ? (g(), c(x(w), {
|
|
224
|
+
key: 6,
|
|
225
|
+
type: "warning",
|
|
226
|
+
"show-icon": "",
|
|
227
|
+
message: `未注册自定义控件 ${m.variable.componentKey || "(空)"}`
|
|
228
|
+
}, null, 8, ["message"])) : m.variable.type === "date" ? (g(), c(x(re), {
|
|
229
|
+
key: 7,
|
|
230
|
+
"value-format": "YYYY-MM-DD",
|
|
231
|
+
value: B.value,
|
|
232
|
+
placeholder: m.variable.placeholder || "",
|
|
233
|
+
disabled: z.value,
|
|
234
|
+
"onUpdate:value": Se
|
|
235
|
+
}, null, 8, [
|
|
236
|
+
"value",
|
|
237
|
+
"placeholder",
|
|
238
|
+
"disabled"
|
|
239
|
+
])) : m.variable.type === "number" ? (g(), c(x(ae), {
|
|
240
|
+
key: 8,
|
|
241
|
+
value: he.value,
|
|
242
|
+
precision: m.variable.precision,
|
|
243
|
+
placeholder: m.variable.placeholder || "",
|
|
244
|
+
disabled: z.value,
|
|
245
|
+
"onUpdate:value": ye
|
|
119
246
|
}, null, 8, [
|
|
120
247
|
"value",
|
|
121
248
|
"precision",
|
|
122
249
|
"placeholder",
|
|
123
250
|
"disabled"
|
|
124
|
-
])) :
|
|
125
|
-
checked:
|
|
126
|
-
disabled:
|
|
127
|
-
"onUpdate:checked":
|
|
128
|
-
}, null, 8, ["checked", "disabled"]),
|
|
129
|
-
|
|
130
|
-
value:
|
|
131
|
-
placeholder:
|
|
132
|
-
disabled:
|
|
251
|
+
])) : m.variable.type === "checkbox" ? (g(), u("label", M, [p(x(E), {
|
|
252
|
+
checked: H.value,
|
|
253
|
+
disabled: z.value,
|
|
254
|
+
"onUpdate:checked": be
|
|
255
|
+
}, null, 8, ["checked", "disabled"]), d("span", null, b(H.value ? m.variable.checkedText || "已选" : m.variable.uncheckedText || "未选"), 1)])) : m.variable.type === "image" ? (g(), u("div", N, [
|
|
256
|
+
p(x(D), {
|
|
257
|
+
value: B.value,
|
|
258
|
+
placeholder: m.variable.placeholder || "请输入图片 URL",
|
|
259
|
+
disabled: z.value,
|
|
133
260
|
"onUpdate:value": Z
|
|
134
261
|
}, null, 8, [
|
|
135
262
|
"value",
|
|
136
263
|
"placeholder",
|
|
137
264
|
"disabled"
|
|
138
265
|
]),
|
|
139
|
-
|
|
140
|
-
default:
|
|
266
|
+
p(x(O), { title: "清除图片地址" }, {
|
|
267
|
+
default: S(() => [p(x(T), {
|
|
141
268
|
"aria-label": "清除图片地址",
|
|
142
|
-
disabled:
|
|
143
|
-
onClick:
|
|
269
|
+
disabled: z.value || !B.value,
|
|
270
|
+
onClick: n[2] ||= C((e) => Z(""), ["stop"])
|
|
144
271
|
}, {
|
|
145
|
-
icon:
|
|
272
|
+
icon: S(() => [p(x(le))]),
|
|
146
273
|
_: 1
|
|
147
274
|
}, 8, ["disabled"])]),
|
|
148
275
|
_: 1
|
|
149
276
|
}),
|
|
150
|
-
|
|
151
|
-
src:
|
|
152
|
-
alt:
|
|
153
|
-
}, null, 8, ["src", "alt"]),
|
|
154
|
-
])) : (
|
|
155
|
-
key:
|
|
156
|
-
value:
|
|
157
|
-
placeholder:
|
|
158
|
-
disabled:
|
|
277
|
+
W.value ? (g(), u("div", P, [p(x(ie), {
|
|
278
|
+
src: W.value,
|
|
279
|
+
alt: m.variable.label || m.variable.key
|
|
280
|
+
}, null, 8, ["src", "alt"]), d("span", null, [p(x(ue)), n[5] ||= f(" 点击图片预览", -1)])])) : l("", !0)
|
|
281
|
+
])) : (g(), c(x(D), {
|
|
282
|
+
key: 11,
|
|
283
|
+
value: B.value,
|
|
284
|
+
placeholder: m.variable.placeholder || "",
|
|
285
|
+
disabled: z.value,
|
|
159
286
|
"onUpdate:value": Z
|
|
160
287
|
}, null, 8, [
|
|
161
288
|
"value",
|
|
162
289
|
"placeholder",
|
|
163
290
|
"disabled"
|
|
164
291
|
])),
|
|
165
|
-
|
|
292
|
+
U.value ? (g(), u("div", F, [(g(!0), u(o, null, v(m.errors, (e) => (g(), u("span", { key: `${e.id}-${e.message}` }, b(e.message), 1))), 128))])) : l("", !0),
|
|
293
|
+
m.loadError ? (g(), c(x(w), {
|
|
294
|
+
key: 13,
|
|
295
|
+
type: "warning",
|
|
296
|
+
"show-icon": "",
|
|
297
|
+
message: m.loadError
|
|
298
|
+
}, null, 8, ["message"])) : l("", !0)
|
|
166
299
|
], 34));
|
|
167
300
|
}
|
|
168
301
|
});
|
|
169
302
|
//#endregion
|
|
170
|
-
export {
|
|
303
|
+
export { I as default };
|