@guodun/antdv 1.4.3 → 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/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +66 -13
- package/dist/es/components/contract-signing-location/src/constants.mjs +27 -17
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +2 -2
- package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -36
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- package/dist/es/components/index.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +2 -1
- 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/ContractTemplatePreviewPage.vue.mjs +4 -4
- 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/DesignerPage.vue.mjs +50 -50
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +948 -887
- 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 +225 -150
- 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/page-decorations.mjs +17 -17
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +14 -14
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +168 -137
- 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/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/constants.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/contract-signing-location/style/index.css +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/ContractTemplatePreviewPage.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/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/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/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -1
- 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/contract-signing-location.css +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/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +3 -1
- package/dist/types/components/contract-signing-location/src/constants.d.ts +18 -0
- package/dist/types/components/contract-signing-location/src/coordinates.d.ts +6 -0
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +17 -0
- 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 +5 -1
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 };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, openBlock as s, ref as c, toDisplayString as l, unref as u, watch as d, withCtx as f } from "vue";
|
|
2
|
+
import { Button as p, Modal as m, Tooltip as h, message as g } from "ant-design-vue";
|
|
3
|
+
import { CheckOutlined as _, CopyOutlined as v } from "@ant-design/icons-vue";
|
|
4
|
+
//#region src/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var y = { class: "gd-contract-template-designer__variable-data-grid" }, b = { class: "gd-contract-template-designer__variable-data-section" }, x = { class: "gd-contract-template-designer__variable-data-section-head" }, S = { class: "gd-contract-template-designer__variable-data-code" }, C = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "gd-contract-template-designer__variable-data-error"
|
|
8
|
+
}, w = { class: "gd-contract-template-designer__variable-data-section" }, T = { class: "gd-contract-template-designer__variable-data-section-head" }, E = { class: "gd-contract-template-designer__variable-data-code" }, D = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "gd-contract-template-designer__variable-data-error"
|
|
11
|
+
}, O = /* @__PURE__ */ o({
|
|
12
|
+
__name: "ContractTemplateVariableDataModal",
|
|
13
|
+
props: {
|
|
14
|
+
open: { type: Boolean },
|
|
15
|
+
data: {},
|
|
16
|
+
fileName: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:open", "cancel"],
|
|
19
|
+
setup(o, { emit: O }) {
|
|
20
|
+
let k = o, A = O, j = c(), M = c(), N = c(""), P = c(), F = e(() => JSON.stringify(k.data.values, null, 2)), I = e(() => JSON.stringify(k.data.variables, null, 2));
|
|
21
|
+
d(() => k.open, (e) => {
|
|
22
|
+
e || (j.value = void 0, M.value = void 0, N.value = "", P.value = void 0);
|
|
23
|
+
});
|
|
24
|
+
async function L(e) {
|
|
25
|
+
let t = e === "values" ? F.value : I.value;
|
|
26
|
+
j.value = e, M.value = void 0, N.value = "", P.value = void 0;
|
|
27
|
+
try {
|
|
28
|
+
if (typeof navigator > "u" || !navigator.clipboard?.writeText) throw Error("当前浏览器未授权剪贴板操作");
|
|
29
|
+
await navigator.clipboard.writeText(t), M.value = e, g.success(e === "values" ? "控件值对象已复制" : "控件变量定义已复制");
|
|
30
|
+
} catch (t) {
|
|
31
|
+
let n = t instanceof Error ? t.message : "未知错误";
|
|
32
|
+
N.value = `复制失败:${n}`, P.value = e, g.error(`复制失败:${n}`);
|
|
33
|
+
} finally {
|
|
34
|
+
j.value = void 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return (e, c) => (s(), t(u(m), {
|
|
38
|
+
open: o.open,
|
|
39
|
+
title: o.fileName ? `控件变量 · ${o.fileName}` : "控件变量",
|
|
40
|
+
width: "min(1100px, calc(100vw - 48px))",
|
|
41
|
+
centered: "",
|
|
42
|
+
footer: null,
|
|
43
|
+
"wrap-class-name": "gd-contract-template-designer__variable-data-modal",
|
|
44
|
+
"onUpdate:open": c[2] ||= (e) => A("update:open", e),
|
|
45
|
+
onCancel: c[3] ||= (e) => A("cancel")
|
|
46
|
+
}, {
|
|
47
|
+
default: f(() => [i("div", y, [i("section", b, [
|
|
48
|
+
i("div", x, [c[4] ||= i("div", null, [i("strong", null, "接口请求值"), i("small", null, "按控件 key 生成,可直接作为请求 body")], -1), a(u(h), { title: "复制接口请求值" }, {
|
|
49
|
+
default: f(() => [a(u(p), {
|
|
50
|
+
size: "small",
|
|
51
|
+
class: "gd-contract-template-designer__icon-button",
|
|
52
|
+
loading: j.value === "values",
|
|
53
|
+
"aria-label": "复制接口请求值",
|
|
54
|
+
onClick: c[0] ||= (e) => L("values")
|
|
55
|
+
}, {
|
|
56
|
+
default: f(() => [M.value === "values" ? (s(), t(u(_), {
|
|
57
|
+
key: 1,
|
|
58
|
+
"aria-hidden": "true"
|
|
59
|
+
})) : (s(), t(u(v), {
|
|
60
|
+
key: 0,
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}))]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["loading"])]),
|
|
65
|
+
_: 1
|
|
66
|
+
})]),
|
|
67
|
+
i("pre", S, l(F.value), 1),
|
|
68
|
+
N.value && P.value === "values" ? (s(), r("small", C, l(N.value), 1)) : n("", !0)
|
|
69
|
+
]), i("section", w, [
|
|
70
|
+
i("div", T, [c[5] ||= i("div", null, [i("strong", null, "控件变量定义"), i("small", null, "当前文件完整 variables 数组")], -1), a(u(h), { title: "复制控件变量定义" }, {
|
|
71
|
+
default: f(() => [a(u(p), {
|
|
72
|
+
size: "small",
|
|
73
|
+
class: "gd-contract-template-designer__icon-button",
|
|
74
|
+
loading: j.value === "variables",
|
|
75
|
+
"aria-label": "复制控件变量定义",
|
|
76
|
+
onClick: c[1] ||= (e) => L("variables")
|
|
77
|
+
}, {
|
|
78
|
+
default: f(() => [M.value === "variables" ? (s(), t(u(_), {
|
|
79
|
+
key: 1,
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
})) : (s(), t(u(v), {
|
|
82
|
+
key: 0,
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}))]),
|
|
85
|
+
_: 1
|
|
86
|
+
}, 8, ["loading"])]),
|
|
87
|
+
_: 1
|
|
88
|
+
})]),
|
|
89
|
+
i("pre", E, l(I.value), 1),
|
|
90
|
+
N.value && P.value === "variables" ? (s(), r("small", D, l(N.value), 1)) : n("", !0)
|
|
91
|
+
])])]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["open", "title"]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//#endregion
|
|
97
|
+
export { O as default };
|