@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1
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/components/avatar/index.esm.js +138 -1526
- package/components/avatar/index.umd.cjs +1 -6
- package/components/button/index.css +1 -1
- package/components/button/index.esm.js +15951 -15410
- package/components/button/index.umd.cjs +27 -27
- package/components/calendar/index.esm.js +269 -255
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +243 -229
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +32 -32
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +473 -456
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.css +1 -1
- package/components/component/index.esm.js +2503 -2239
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +1064 -954
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +1 -1
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +3894 -3058
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +91 -77
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +220 -215
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +145 -131
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +336 -329
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1611 -1536
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +219 -219
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/external-container/index.esm.js +179 -178
- package/components/external-container/index.umd.cjs +1 -1
- package/components/fieldset/index.esm.js +285 -221
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -0
- package/components/filter-bar/index.esm.js +1512 -1290
- package/components/filter-bar/index.umd.cjs +7 -7
- package/components/filter-condition-editor/index.esm.js +851 -831
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +520 -501
- package/components/flow-canvas/index.umd.cjs +8 -8
- package/components/image/index.esm.js +101 -79
- package/components/image/index.umd.cjs +3 -3
- package/components/language-textbox/index.esm.js +330 -251
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-nav/index.esm.js +399 -313
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +3 -0
- package/components/locale/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +997 -976
- package/components/lookup/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +725 -705
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +542 -522
- package/components/message-box/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +95 -308
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +115 -107
- package/components/number-range/index.umd.cjs +2 -2
- package/components/order/index.esm.js +56 -54
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +135 -123
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +266 -222
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +402 -375
- package/components/property-panel/index.umd.cjs +4 -4
- package/components/query-solution/index.esm.js +3171 -3061
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1620 -1608
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/scroll-navbar/index.esm.js +150 -136
- package/components/scroll-navbar/index.umd.cjs +2 -2
- package/components/section/index.esm.js +323 -311
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +850 -830
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/step/index.esm.js +991 -224
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +356 -334
- package/components/tabs/index.umd.cjs +1 -1
- package/components/wizard/index.esm.js +159 -162
- package/components/wizard/index.umd.cjs +1 -1
- package/designer/avatar/index.esm.js +1721 -0
- package/designer/avatar/index.umd.cjs +6 -0
- package/designer/button-edit/index.esm.js +2 -1
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +693 -659
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +90 -78
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/date-picker/index.esm.js +203 -203
- package/designer/date-picker/index.umd.cjs +1 -1
- package/designer/drawer/index.esm.js +181 -167
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +228 -206
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +10014 -9692
- package/designer/farris-designer.all.umd.cjs +18 -18
- package/designer/index.css +1 -1
- package/designer/input-group/index.esm.js +15 -15
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/nav/index.esm.js +1719 -0
- package/designer/nav/index.umd.cjs +6 -0
- package/designer/number-spinner/index.esm.js +8 -7
- package/designer/number-spinner/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +133 -125
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +864 -863
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +245 -183
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.css +1 -1
- package/designer/tabs/index.esm.js +3667 -2810
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +26 -17
- package/designer/time-picker/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +69 -37
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/designer/wizard/index.esm.js +110 -110
- package/designer/wizard/index.umd.cjs +3 -3
- package/farris.all.esm.js +39993 -39089
- package/farris.all.umd.cjs +36 -36
- package/index.css +1 -1
- package/locales/filter-bar/ui/en.json +1 -0
- package/locales/filter-bar/ui/zh-CHS.json +1 -0
- package/locales/filter-bar/ui/zh-CHT.json +1 -0
- package/locales/ui/en.json +1 -0
- package/locales/ui/zh-CHS.json +1 -0
- package/locales/ui/zh-CHT.json +1 -0
- package/package.json +1 -1
- package/types/avatar/designer.d.ts +28 -0
- package/types/avatar/index.d.ts +0 -15
- package/types/avatar/src/composition/types.d.ts +3 -0
- package/types/avatar/src/composition/use-file.d.ts +19 -0
- package/types/avatar/src/composition/use-image.d.ts +1 -1
- package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
- package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
- package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
- package/types/components.d.ts +3 -0
- package/types/condition/index.d.ts +18 -6
- package/types/condition/src/condition-fields.component.d.ts +9 -3
- package/types/condition/src/condition-fields.design.component.d.ts +9 -3
- package/types/condition/src/condition-list.component.d.ts +9 -3
- package/types/condition/src/condition.props.d.ts +11 -0
- package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
- package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
- package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
- package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
- package/types/dynamic-view/src/components/maps.d.ts +130 -4
- package/types/filter-bar/src/composition/types.d.ts +2 -0
- package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
- package/types/filter-bar/src/locale/locale.d.ts +2 -1
- package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
- package/types/language-textbox/index.d.ts +65 -2
- package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
- package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
- package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/lookup/src/composition/use-compat.d.ts +28 -0
- package/types/lookup/src/composition/use-state.d.ts +1 -0
- package/types/message-box/src/message-box.service.d.ts +2 -1
- package/types/nav/designer.d.ts +28 -0
- package/types/nav/index.d.ts +24 -20
- package/types/nav/src/designer/nav.design.props.d.ts +29 -0
- package/types/nav/src/designer/use-design-rules.d.ts +3 -0
- package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
- package/types/nav/src/schema/schema-mapper.d.ts +4 -0
- package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
- package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
- package/types/section/src/designer/section.design.props.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +39 -0
- package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
- package/types/step/src/designer/use-designer-rules.d.ts +3 -0
- package/types/step/src/designer/use-step-creator.d.ts +6 -0
- package/types/step/src/property-config/step.property-config.d.ts +15 -0
- package/types/step/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +4 -0
- package/types/tabs/src/tabs.props.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -3
- package/types/tooltip/src/tooltip.component.d.ts +2 -2
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { cloneDeep as ee } from "lodash-es";
|
|
9
|
-
import { FormSchemaEntityField$Type as N, FormSchemaEntityFieldType$Type as te, withInstall as ie } from "../common/index.esm.js";
|
|
10
|
-
function ne(g, n, e) {
|
|
11
|
-
return n;
|
|
1
|
+
import { withInstall as K } from "../common/index.esm.js";
|
|
2
|
+
import { computed as p, defineComponent as H, ref as C, watch as E, createVNode as d } from "vue";
|
|
3
|
+
import { resolveAppearance as v, createPropsResolver as h } from "../dynamic-resolver/index.esm.js";
|
|
4
|
+
import { LocaleService as Q } from "../locale/index.esm.js";
|
|
5
|
+
import { FNotifyService as R } from "../notify/index.esm.js";
|
|
6
|
+
function D(e, g, o) {
|
|
7
|
+
return g;
|
|
12
8
|
}
|
|
13
|
-
const
|
|
14
|
-
["appearance",
|
|
15
|
-
|
|
9
|
+
const S = /* @__PURE__ */ new Map([
|
|
10
|
+
["appearance", v],
|
|
11
|
+
["imageType", v]
|
|
12
|
+
]), T = "https://json-schema.org/draft/2020-12/schema", j = "https://farris-design.gitee.io/avatar.schema.json", P = "avatar", I = "A Farris Component", F = "object", w = {
|
|
16
13
|
id: {
|
|
17
14
|
description: "The unique identifier for avatar",
|
|
18
15
|
type: "string"
|
|
@@ -46,13 +43,15 @@ const re = /* @__PURE__ */ new Map([
|
|
|
46
43
|
},
|
|
47
44
|
avatarWidth: {
|
|
48
45
|
description: "",
|
|
49
|
-
type: "number"
|
|
50
|
-
|
|
46
|
+
type: "number"
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
description: "",
|
|
50
|
+
type: "string"
|
|
51
51
|
},
|
|
52
52
|
avatarHeight: {
|
|
53
53
|
description: "",
|
|
54
|
-
type: "number"
|
|
55
|
-
default: 100
|
|
54
|
+
type: "number"
|
|
56
55
|
},
|
|
57
56
|
readonly: {
|
|
58
57
|
description: "",
|
|
@@ -61,37 +60,31 @@ const re = /* @__PURE__ */ new Map([
|
|
|
61
60
|
},
|
|
62
61
|
cover: {
|
|
63
62
|
description: "",
|
|
64
|
-
type: "string"
|
|
65
|
-
default: ""
|
|
66
|
-
},
|
|
67
|
-
tabindex: {
|
|
68
|
-
description: "",
|
|
69
|
-
type: "number",
|
|
70
|
-
default: -1
|
|
63
|
+
type: "string"
|
|
71
64
|
},
|
|
72
65
|
visible: {
|
|
73
66
|
description: "",
|
|
74
67
|
type: "boolean",
|
|
75
68
|
default: !0
|
|
76
69
|
}
|
|
77
|
-
},
|
|
70
|
+
}, N = [
|
|
78
71
|
"id",
|
|
79
72
|
"type"
|
|
80
|
-
],
|
|
73
|
+
], x = [
|
|
81
74
|
"id",
|
|
82
75
|
"appearance",
|
|
83
76
|
"binding",
|
|
84
77
|
"visible"
|
|
85
|
-
],
|
|
86
|
-
$schema:
|
|
87
|
-
$id:
|
|
88
|
-
title:
|
|
89
|
-
description:
|
|
90
|
-
type:
|
|
91
|
-
properties:
|
|
92
|
-
required:
|
|
93
|
-
ignore:
|
|
94
|
-
},
|
|
78
|
+
], V = {
|
|
79
|
+
$schema: T,
|
|
80
|
+
$id: j,
|
|
81
|
+
title: P,
|
|
82
|
+
description: I,
|
|
83
|
+
type: F,
|
|
84
|
+
properties: w,
|
|
85
|
+
required: N,
|
|
86
|
+
ignore: x
|
|
87
|
+
}, m = {
|
|
95
88
|
/**
|
|
96
89
|
* 头像宽度
|
|
97
90
|
*/
|
|
@@ -105,15 +98,16 @@ const re = /* @__PURE__ */ new Map([
|
|
|
105
98
|
*/
|
|
106
99
|
cover: { type: String },
|
|
107
100
|
/**
|
|
108
|
-
* 只读
|
|
101
|
+
* 只读 readonly废弃
|
|
109
102
|
*/
|
|
110
103
|
readonly: { type: Boolean, default: !1 },
|
|
104
|
+
visible: { type: Boolean, default: !0 },
|
|
111
105
|
/**
|
|
112
106
|
* 头像形状
|
|
113
107
|
*/
|
|
114
108
|
shape: { type: String, default: "circle" },
|
|
115
109
|
/**
|
|
116
|
-
*
|
|
110
|
+
* 允许头像上传大小, 单位MB
|
|
117
111
|
*/
|
|
118
112
|
maxSize: { type: Number, default: 1 },
|
|
119
113
|
/**
|
|
@@ -127,1521 +121,139 @@ const re = /* @__PURE__ */ new Map([
|
|
|
127
121
|
/**
|
|
128
122
|
* 支持的头像类型
|
|
129
123
|
*/
|
|
130
|
-
imageType: { type: Array, default: [
|
|
131
|
-
},
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return f.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null;
|
|
136
|
-
}
|
|
137
|
-
function d(f) {
|
|
138
|
-
return f.indexOf("data:image/") > -1;
|
|
139
|
-
}
|
|
140
|
-
function o(f) {
|
|
141
|
-
return "data:image/jpeg;base64," + f;
|
|
142
|
-
}
|
|
143
|
-
const p = E(() => {
|
|
144
|
-
var u;
|
|
145
|
-
if (!g.imageType || !g.imageType.length)
|
|
146
|
-
return "";
|
|
147
|
-
const f = (u = g.imageType) == null ? void 0 : u.map((h) => (h === "jpg" && (h = "jpeg"), `image/${h}`));
|
|
148
|
-
return !f || !f.length ? "image/*" : f.join(",");
|
|
149
|
-
}), c = E(() => {
|
|
150
|
-
const f = t.value || g.cover || i;
|
|
151
|
-
return s(f) || d(f) ? f : o(f);
|
|
152
|
-
}), l = E(() => r.value ? "" : g.title);
|
|
153
|
-
function m() {
|
|
154
|
-
r.value || e && e.value && e.value.click();
|
|
155
|
-
}
|
|
156
|
-
return { acceptTypes: p, imageSource: c, imageTitle: l, onClickImage: m };
|
|
157
|
-
}
|
|
158
|
-
const M = /* @__PURE__ */ U({
|
|
159
|
-
name: "FAvatar",
|
|
160
|
-
props: T,
|
|
161
|
-
emits: ["change", "update:modelValue"],
|
|
162
|
-
setup(g, n) {
|
|
163
|
-
const e = E(() => ({
|
|
164
|
-
"f-avatar": !0,
|
|
165
|
-
"f-avatar-readonly": g.readonly,
|
|
166
|
-
"f-avatar-circle": g.shape === "circle",
|
|
167
|
-
"f-avatar-square": g.shape === "square"
|
|
168
|
-
})), t = F(g.modelValue), i = E(() => ({
|
|
169
|
-
width: g.avatarWidth + "px",
|
|
170
|
-
height: g.avatarHeight + "px"
|
|
171
|
-
})), r = !1;
|
|
172
|
-
function s() {
|
|
173
|
-
return "";
|
|
174
|
-
}
|
|
175
|
-
function d() {
|
|
176
|
-
}
|
|
177
|
-
const o = F(null), {
|
|
178
|
-
acceptTypes: p,
|
|
179
|
-
imageSource: c,
|
|
180
|
-
onClickImage: l
|
|
181
|
-
} = L(g, n, o, t);
|
|
182
|
-
return () => C("div", {
|
|
183
|
-
class: e.value,
|
|
184
|
-
style: i.value,
|
|
185
|
-
onClick: l
|
|
186
|
-
}, [r, C("img", {
|
|
187
|
-
title: g.title,
|
|
188
|
-
class: "f-avatar-image",
|
|
189
|
-
src: c.value,
|
|
190
|
-
onError: s
|
|
191
|
-
}, null), !g.readonly && C("div", {
|
|
192
|
-
class: "f-avatar-icon"
|
|
193
|
-
}, [C("span", {
|
|
194
|
-
class: "f-icon f-icon-camera"
|
|
195
|
-
}, null)]), C("input", {
|
|
196
|
-
ref: "file",
|
|
197
|
-
name: "file-input",
|
|
198
|
-
type: "file",
|
|
199
|
-
class: "f-avatar-upload",
|
|
200
|
-
accept: p.value,
|
|
201
|
-
onChange: d,
|
|
202
|
-
style: "display: none;"
|
|
203
|
-
}, null)]);
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
function me(g) {
|
|
207
|
-
const { formSchemaUtils: n, formStateMachineUtils: e } = g;
|
|
208
|
-
function t(o, p = "") {
|
|
209
|
-
return {
|
|
210
|
-
path: p + o.code,
|
|
211
|
-
field: o.id,
|
|
212
|
-
fullPath: o.code
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function i(o, p = "") {
|
|
216
|
-
const c = n.getViewModelById(o);
|
|
217
|
-
return c ? c.states.map((l) => t(l, p)) : [];
|
|
218
|
-
}
|
|
219
|
-
function r(o) {
|
|
220
|
-
const p = n.getRootViewModelId(), c = i(o);
|
|
221
|
-
if (o === p)
|
|
222
|
-
return c;
|
|
223
|
-
const l = i(p, "root-component.");
|
|
224
|
-
return [...c, ...l];
|
|
225
|
-
}
|
|
226
|
-
function s(o) {
|
|
227
|
-
return o.binding && o.binding.path || o.id || "";
|
|
228
|
-
}
|
|
229
|
-
function d() {
|
|
230
|
-
return e && e.getRenderStates() || [];
|
|
124
|
+
imageType: { type: Array, default: [] }
|
|
125
|
+
}, G = h(m, V, S, D);
|
|
126
|
+
function k(e, g, o, n) {
|
|
127
|
+
function c(A) {
|
|
128
|
+
return A.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null;
|
|
231
129
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
constructor(n) {
|
|
236
|
-
y(this, "sessionVariables", [
|
|
237
|
-
{
|
|
238
|
-
key: "CurrentSysOrgName",
|
|
239
|
-
name: "当前组织Name",
|
|
240
|
-
description: "当前组织Name"
|
|
241
|
-
},
|
|
242
|
-
// {
|
|
243
|
-
// key: "CurrentSysOrgCode",
|
|
244
|
-
// name: "当前组织Code",
|
|
245
|
-
// description: "当前组织Code"
|
|
246
|
-
// },
|
|
247
|
-
{
|
|
248
|
-
key: "CurrentSysOrgId",
|
|
249
|
-
name: "当前组织Id",
|
|
250
|
-
description: "当前组织Id"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
key: "CurrentUserName",
|
|
254
|
-
name: "当前用户Name",
|
|
255
|
-
description: "当前用户Name"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
key: "CurrentUserCode",
|
|
259
|
-
name: "当前用户Code",
|
|
260
|
-
description: "当前用户Code"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
key: "CurrentUserId",
|
|
264
|
-
name: "当前用户Id",
|
|
265
|
-
description: "当前用户Id"
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
key: "CurrentLanguage",
|
|
269
|
-
name: "当前语言编号",
|
|
270
|
-
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
|
|
271
|
-
}
|
|
272
|
-
]);
|
|
273
|
-
y(this, "expressionNames", {
|
|
274
|
-
compute: "计算表达式",
|
|
275
|
-
dependency: "依赖表达式",
|
|
276
|
-
validate: "验证表达式",
|
|
277
|
-
dataPicking: "帮助前表达式",
|
|
278
|
-
visible: "可见表达式",
|
|
279
|
-
readonly: "只读表达式",
|
|
280
|
-
required: "必填表达式"
|
|
281
|
-
});
|
|
282
|
-
y(this, "getExpressionConverter", (n, e) => ({
|
|
283
|
-
convertFrom: (t, i, r, s) => {
|
|
284
|
-
const d = r.getExpressionRuleValue(n, e || i);
|
|
285
|
-
return d && d.value || "";
|
|
286
|
-
},
|
|
287
|
-
convertTo: (t, i, r, s, d) => {
|
|
288
|
-
var o;
|
|
289
|
-
if (i === "dataPicking" && (r != null && r.target)) {
|
|
290
|
-
const p = `${r.target}_dataPicking`;
|
|
291
|
-
((o = r.rules) == null ? void 0 : o.some(
|
|
292
|
-
(l) => l.id === p && l.value
|
|
293
|
-
)) ? t.dictPickingExpressionId = p : delete t.dictPickingExpressionId;
|
|
294
|
-
}
|
|
295
|
-
s.updateExpression(r);
|
|
296
|
-
}
|
|
297
|
-
}));
|
|
298
|
-
this.formSchemaService = n;
|
|
299
|
-
}
|
|
300
|
-
getExpressionRule(n, e) {
|
|
301
|
-
const t = this.formSchemaService.getExpressions();
|
|
302
|
-
if (!t)
|
|
303
|
-
return "";
|
|
304
|
-
const i = t.find((s) => s.target === n);
|
|
305
|
-
if (!i)
|
|
306
|
-
return "";
|
|
307
|
-
const r = i.rules.find((s) => s.type === e);
|
|
308
|
-
return r || "";
|
|
309
|
-
}
|
|
310
|
-
// 获取上下文表单变量
|
|
311
|
-
getContextFormVariables() {
|
|
312
|
-
const { module: n } = this.formSchemaService.getFormSchema();
|
|
313
|
-
if (!n.viewmodels || n.viewmodels.length === 0)
|
|
314
|
-
return [];
|
|
315
|
-
const e = this.formSchemaService.getRootViewModelId(), t = this.formSchemaService.getViewModelById(e);
|
|
316
|
-
if (!t || !t.states || t.states.length === 0)
|
|
317
|
-
return [];
|
|
318
|
-
const i = [];
|
|
319
|
-
return t.states.filter((r) => r.category === "remote").forEach((r) => {
|
|
320
|
-
i.push({
|
|
321
|
-
key: r.code,
|
|
322
|
-
name: r.name,
|
|
323
|
-
description: r.name,
|
|
324
|
-
category: r.category
|
|
325
|
-
});
|
|
326
|
-
}), i;
|
|
327
|
-
}
|
|
328
|
-
createTreeNode(n, e, t = "label") {
|
|
329
|
-
return {
|
|
330
|
-
id: n.id,
|
|
331
|
-
name: n.name,
|
|
332
|
-
bindingPath: n[t],
|
|
333
|
-
parents: e,
|
|
334
|
-
type: "field"
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
buildEntityFieldsTreeData(n = null, e) {
|
|
338
|
-
const t = [];
|
|
339
|
-
return n == null || n.forEach((i) => {
|
|
340
|
-
var d;
|
|
341
|
-
const r = this.createTreeNode(i, e);
|
|
342
|
-
let s = [];
|
|
343
|
-
(d = i.type) != null && d.fields && (s = this.buildEntityFieldsTreeData(i.type.fields, [...e, i.label])), t.push({
|
|
344
|
-
data: r,
|
|
345
|
-
children: s,
|
|
346
|
-
expanded: !0
|
|
347
|
-
});
|
|
348
|
-
}), t;
|
|
349
|
-
}
|
|
350
|
-
buildChildEntityTreeData(n = null, e) {
|
|
351
|
-
const t = [];
|
|
352
|
-
return n == null || n.forEach((i) => {
|
|
353
|
-
var o, p;
|
|
354
|
-
const r = this.createTreeNode(i, e);
|
|
355
|
-
r.type = "entity";
|
|
356
|
-
const s = this.buildEntityFieldsTreeData((o = i.type) == null ? void 0 : o.fields, [...e, i.label]), d = this.buildChildEntityTreeData((p = i.type) == null ? void 0 : p.entities, [...e, i.label]);
|
|
357
|
-
d != null && d.length && (s == null || s.push(...d)), t.push({
|
|
358
|
-
data: r,
|
|
359
|
-
children: s || [],
|
|
360
|
-
// 空值回退
|
|
361
|
-
expanded: !0
|
|
362
|
-
});
|
|
363
|
-
}), t;
|
|
364
|
-
}
|
|
365
|
-
getEntitiesTreeData() {
|
|
366
|
-
const n = this.formSchemaService.getSchemaEntities();
|
|
367
|
-
if (!(n != null && n.length))
|
|
368
|
-
return [];
|
|
369
|
-
const e = n[0];
|
|
370
|
-
if (!(e != null && e.type))
|
|
371
|
-
return [];
|
|
372
|
-
const t = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), i = this.buildChildEntityTreeData(e.type.entities, [e.code]);
|
|
373
|
-
return i != null && i.length && (t == null || t.push(...i)), {
|
|
374
|
-
entityCode: e.code,
|
|
375
|
-
fields: [{
|
|
376
|
-
data: this.createTreeNode(e, [], "code"),
|
|
377
|
-
children: t || []
|
|
378
|
-
}]
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
getEntitiesAndVariables() {
|
|
382
|
-
return {
|
|
383
|
-
entities: this.getEntitiesTreeData(),
|
|
384
|
-
variables: {
|
|
385
|
-
session: {
|
|
386
|
-
name: "系统变量",
|
|
387
|
-
items: this.sessionVariables,
|
|
388
|
-
visible: !1
|
|
389
|
-
},
|
|
390
|
-
forms: {
|
|
391
|
-
name: "表单变量",
|
|
392
|
-
items: this.getContextFormVariables(),
|
|
393
|
-
visible: !0
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
onBeforeOpenExpression(n, e, t) {
|
|
399
|
-
const i = t === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, e), s = this.getEntitiesAndVariables(), d = {
|
|
400
|
-
message: ["validate", "required", "dataPicking"].includes(e) && r ? r.message : "",
|
|
401
|
-
...s
|
|
402
|
-
};
|
|
403
|
-
return r.messageType != null && (d.messageType = r.messageType), d;
|
|
404
|
-
}
|
|
405
|
-
buildRule(n, e, t, i) {
|
|
406
|
-
const { expression: r, message: s, messageType: d } = e, o = {
|
|
407
|
-
id: `${n}_${t}`,
|
|
408
|
-
type: t,
|
|
409
|
-
value: r
|
|
410
|
-
};
|
|
411
|
-
return (t === "validate" || t === "dataPicking" || t === "required") && (o.message = s), t === "dataPicking" && (o.messageType = d), t === "validate" && i && (o.elementId = i), o;
|
|
412
|
-
}
|
|
413
|
-
getExpressionData() {
|
|
414
|
-
const { expressions: n } = this.formSchemaService.getFormSchema().module;
|
|
415
|
-
return n || [];
|
|
416
|
-
}
|
|
417
|
-
updateExpression(n, e, t, i) {
|
|
418
|
-
const r = e === "Field" ? n.binding.field : n.id, s = this.buildRule(r, t, i, n.type === "form-group" ? n.id : "");
|
|
419
|
-
let o = this.getExpressionData().find((c) => c.targetType === e && c.target === r);
|
|
420
|
-
const p = (c) => c.value.trim() === "";
|
|
421
|
-
if (o) {
|
|
422
|
-
const c = o.rules.find((l) => l.id === s.id);
|
|
423
|
-
if (c)
|
|
424
|
-
p(s) ? o.rules = o.rules.filter((l) => l.id !== s.id) : (Object.assign(c, s), i === "validate" && n.type === "form-group" && (c.elementId = n.id));
|
|
425
|
-
else {
|
|
426
|
-
if (p(s))
|
|
427
|
-
return null;
|
|
428
|
-
o.rules = o.rules || [], o.rules.push(s);
|
|
429
|
-
}
|
|
430
|
-
} else {
|
|
431
|
-
if (p(s))
|
|
432
|
-
return null;
|
|
433
|
-
o = {
|
|
434
|
-
target: `${r}`,
|
|
435
|
-
rules: [s],
|
|
436
|
-
targetType: e
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
return o;
|
|
130
|
+
const s = ["image/image", "image/webp", "image/png", "image/svg", "image/gif", "image/jpg", "image/jpeg", "image/bmp"];
|
|
131
|
+
function B(A) {
|
|
132
|
+
return A.indexOf("data:image/") > -1;
|
|
440
133
|
}
|
|
441
|
-
|
|
442
|
-
return
|
|
443
|
-
var o, p;
|
|
444
|
-
const d = e === "Field" ? (o = n == null ? void 0 : n.binding) == null ? void 0 : o.field : n.id;
|
|
445
|
-
return r[s] = {
|
|
446
|
-
hide: e === "Field" ? !!((p = n == null ? void 0 : n.binding) != null && p.field) : !1,
|
|
447
|
-
description: "",
|
|
448
|
-
title: this.expressionNames[s],
|
|
449
|
-
type: "string",
|
|
450
|
-
$converter: this.getExpressionConverter(d),
|
|
451
|
-
refreshPanelAfterChanged: !0,
|
|
452
|
-
editor: {
|
|
453
|
-
type: "expression-editor",
|
|
454
|
-
singleExpand: !1,
|
|
455
|
-
dialogTitle: `${this.expressionNames[s]}编辑器`,
|
|
456
|
-
showMessage: s === "validate" || s === "dataPicking" || s === "required",
|
|
457
|
-
showMessageType: s === "dataPicking",
|
|
458
|
-
beforeOpen: () => this.onBeforeOpenExpression(n, s, e),
|
|
459
|
-
onSubmitModal: (c) => {
|
|
460
|
-
const l = this.updateExpression(n, e, c, s);
|
|
461
|
-
if (i) {
|
|
462
|
-
const m = this.buildRule(d, c, s);
|
|
463
|
-
i(m);
|
|
464
|
-
}
|
|
465
|
-
return l;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}, r;
|
|
469
|
-
}, {});
|
|
134
|
+
function u(A) {
|
|
135
|
+
return A ? "data:image/jpeg;base64," + A : "";
|
|
470
136
|
}
|
|
471
|
-
|
|
472
|
-
const i = e === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, t), s = {
|
|
473
|
-
value: r && r.value,
|
|
474
|
-
targetId: i,
|
|
475
|
-
targetType: e,
|
|
476
|
-
expressionType: t
|
|
477
|
-
};
|
|
478
|
-
return r && r.message && (s.message = r.message), s;
|
|
479
|
-
}
|
|
480
|
-
getExpressionConfig(n, e, t = ["compute", "dependency", "validate"], i) {
|
|
481
|
-
return {
|
|
482
|
-
description: "表达式",
|
|
483
|
-
title: "表达式",
|
|
484
|
-
hide: !n.binding,
|
|
485
|
-
properties: {
|
|
486
|
-
...this.getExpressionEditorOptions(n, e, t, i)
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
getExpressionOptions(n, e, t) {
|
|
491
|
-
const i = this.getExpressionInfo(n, e, t);
|
|
492
|
-
return {
|
|
493
|
-
dialogTitle: `${this.expressionNames[t]}编辑器`,
|
|
494
|
-
singleExpand: !1,
|
|
495
|
-
showMessage: t === "required",
|
|
496
|
-
beforeOpen: () => this.onBeforeOpenExpression(n, t, e),
|
|
497
|
-
expressionInfo: i
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
class fe {
|
|
502
|
-
constructor(n, e) {
|
|
503
|
-
y(this, "componentId");
|
|
504
|
-
y(this, "viewModelId");
|
|
505
|
-
y(this, "eventsEditorUtils");
|
|
506
|
-
y(this, "formSchemaUtils");
|
|
507
|
-
y(this, "formMetadataConverter");
|
|
508
|
-
y(this, "designViewModelUtils");
|
|
509
|
-
y(this, "designViewModelField");
|
|
510
|
-
y(this, "controlCreatorUtils");
|
|
511
|
-
y(this, "designerHostService");
|
|
512
|
-
y(this, "designerContext");
|
|
513
|
-
y(this, "schemaService", null);
|
|
514
|
-
y(this, "metadataService", null);
|
|
515
|
-
y(this, "propertyConfig", {
|
|
516
|
-
type: "object",
|
|
517
|
-
categories: {}
|
|
518
|
-
});
|
|
519
|
-
var t;
|
|
520
|
-
this.componentId = n, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((t = this.formSchemaUtils) == null ? void 0 : t.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService, this.designerContext = e.designerContext;
|
|
521
|
-
}
|
|
522
|
-
getFormDesignerInstance() {
|
|
523
|
-
var n, e;
|
|
524
|
-
return (e = (n = this.designerContext) == null ? void 0 : n.instances) == null ? void 0 : e.formDesigner.value;
|
|
525
|
-
}
|
|
526
|
-
getTableInfo() {
|
|
527
|
-
var n;
|
|
528
|
-
return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
|
|
529
|
-
}
|
|
530
|
-
setDesignViewModelField(n) {
|
|
531
|
-
var t;
|
|
532
|
-
const e = n.binding && n.binding.type === "Form" && n.binding.field;
|
|
533
|
-
if (e) {
|
|
534
|
-
if (!this.designViewModelField) {
|
|
535
|
-
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
536
|
-
this.designViewModelField = i.fields.find((r) => r.id === e);
|
|
537
|
-
}
|
|
538
|
-
n.updateOn = (t = this.designViewModelField) == null ? void 0 : t.updateOn;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
getBasicPropConfig(n) {
|
|
542
|
-
return {
|
|
543
|
-
description: "Basic Information",
|
|
544
|
-
title: "基本信息",
|
|
545
|
-
properties: {
|
|
546
|
-
id: {
|
|
547
|
-
description: "组件标识",
|
|
548
|
-
title: "标识",
|
|
549
|
-
type: "string",
|
|
550
|
-
readonly: !0
|
|
551
|
-
},
|
|
552
|
-
type: {
|
|
553
|
-
description: "组件类型",
|
|
554
|
-
title: "控件类型",
|
|
555
|
-
type: "select",
|
|
556
|
-
editor: {
|
|
557
|
-
type: "combo-list",
|
|
558
|
-
textField: "name",
|
|
559
|
-
valueField: "value",
|
|
560
|
-
idField: "value",
|
|
561
|
-
editable: !1,
|
|
562
|
-
data: [{ value: n.type, name: a[n.type] && a[n.type].name }]
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
getAppearanceConfig(n = null, e = {}, t) {
|
|
569
|
-
const i = {
|
|
570
|
-
title: "外观",
|
|
571
|
-
description: "Appearance"
|
|
572
|
-
}, r = {
|
|
573
|
-
class: {
|
|
574
|
-
title: "class样式",
|
|
575
|
-
type: "string",
|
|
576
|
-
description: "组件的CSS样式",
|
|
577
|
-
$converter: "/converter/appearance.converter",
|
|
578
|
-
parentPropertyID: "appearance"
|
|
579
|
-
},
|
|
580
|
-
style: {
|
|
581
|
-
title: "style样式",
|
|
582
|
-
type: "string",
|
|
583
|
-
description: "组件的样式",
|
|
584
|
-
$converter: "/converter/appearance.converter",
|
|
585
|
-
parentPropertyID: "appearance"
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
for (const s in e)
|
|
589
|
-
r[s] = Object.assign(r[s] || {}, e[s]);
|
|
590
|
-
return {
|
|
591
|
-
...i,
|
|
592
|
-
properties: { ...r },
|
|
593
|
-
setPropertyRelates(s, d) {
|
|
594
|
-
if (s) {
|
|
595
|
-
switch (s && s.propertyID) {
|
|
596
|
-
case "class":
|
|
597
|
-
case "style": {
|
|
598
|
-
V.value++;
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
t && t(s, n, d);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
*
|
|
609
|
-
* @param propertyData
|
|
610
|
-
* @param propertyTypes
|
|
611
|
-
* @param propertyName
|
|
612
|
-
* @param constInfos
|
|
613
|
-
* @param variableInfos
|
|
614
|
-
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
615
|
-
* @returns
|
|
616
|
-
*/
|
|
617
|
-
getPropertyEditorParams(n, e = [], t = "visible", i = {}, r = {}, s = "") {
|
|
618
|
-
const { getVariables: d, getControlName: o, getStateMachines: p } = me(this.designerHostService), c = this.getRealTargetType(n), l = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], m = {
|
|
619
|
-
type: "property-editor",
|
|
620
|
-
propertyTypes: l
|
|
621
|
-
};
|
|
622
|
-
return l.map((f) => {
|
|
623
|
-
switch (f) {
|
|
624
|
-
case "Const":
|
|
625
|
-
Object.assign(m, {
|
|
626
|
-
constType: "enum",
|
|
627
|
-
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
|
|
628
|
-
}, i);
|
|
629
|
-
break;
|
|
630
|
-
case "Expression":
|
|
631
|
-
m.expressionConfig = this.getExpressionOptions(n, c, s || t);
|
|
632
|
-
break;
|
|
633
|
-
case "StateMachine":
|
|
634
|
-
m.stateMachines = p();
|
|
635
|
-
break;
|
|
636
|
-
case "Variable":
|
|
637
|
-
Object.assign(m, {
|
|
638
|
-
controlName: o(n),
|
|
639
|
-
newVariablePrefix: "is",
|
|
640
|
-
newVariableType: "Boolean",
|
|
641
|
-
variables: d(this.viewModelId),
|
|
642
|
-
parentComponentId: this.componentId === "root-component" ? "" : "root-component",
|
|
643
|
-
onBeforeOpenVariables: (u) => {
|
|
644
|
-
u.value = d(this.viewModelId);
|
|
645
|
-
}
|
|
646
|
-
}, r), this.designerContext.designerMode === "PC_RTC" && (m.newVariablePrefix = "ext_" + m.newVariablePrefix);
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
}), m;
|
|
650
|
-
}
|
|
651
|
-
getVisibleProperty(n, e = "") {
|
|
137
|
+
const l = p(() => {
|
|
652
138
|
var r;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
/**
|
|
664
|
-
* 获取行为
|
|
665
|
-
* @param propertyData
|
|
666
|
-
* @param viewModelId
|
|
667
|
-
* @returns
|
|
668
|
-
*/
|
|
669
|
-
getBehaviorConfig(n, e = "", t = {}, i) {
|
|
670
|
-
const r = {
|
|
671
|
-
title: "行为",
|
|
672
|
-
description: ""
|
|
673
|
-
}, s = this.getVisibleProperty(n, e);
|
|
674
|
-
for (const o in t)
|
|
675
|
-
s[o] = Object.assign(s[o] || {}, t[o]);
|
|
676
|
-
const d = this;
|
|
677
|
-
return {
|
|
678
|
-
...r,
|
|
679
|
-
properties: { ...s },
|
|
680
|
-
setPropertyRelates(o, p) {
|
|
681
|
-
if (o) {
|
|
682
|
-
switch (o.propertyID) {
|
|
683
|
-
case "disabled":
|
|
684
|
-
case "readonly":
|
|
685
|
-
case "visible":
|
|
686
|
-
d.afterMutilEditorChanged(n, o);
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
i && i(o, p);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* 当多值编辑器变更时
|
|
696
|
-
* @param propertyData
|
|
697
|
-
* @param changeObject
|
|
698
|
-
*/
|
|
699
|
-
afterMutilEditorChanged(n, e) {
|
|
700
|
-
this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, n);
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
*
|
|
704
|
-
* @param propertyId
|
|
705
|
-
* @param componentInstance
|
|
706
|
-
* @returns
|
|
707
|
-
*/
|
|
708
|
-
updateElementByParentContainer(n, e) {
|
|
709
|
-
const t = e && e.parent && e.parent.schema;
|
|
710
|
-
if (!t)
|
|
711
|
-
return;
|
|
712
|
-
const i = t.contents.findIndex((s) => s.id === n), r = ee(t.contents[i]);
|
|
713
|
-
t.contents.splice(i, 1), t.contents.splice(i, 0, r), D();
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
717
|
-
* @param changeObject
|
|
718
|
-
* @param viewModelId
|
|
719
|
-
* @returns
|
|
720
|
-
*/
|
|
721
|
-
addNewVariableToViewModel(n, e) {
|
|
722
|
-
const t = n.propertyValue;
|
|
723
|
-
if (!(t && typeof t == "object") || !(t.type === "Variable" && t.isNewVariable))
|
|
724
|
-
return;
|
|
725
|
-
const s = {
|
|
726
|
-
id: t.field,
|
|
727
|
-
category: "locale",
|
|
728
|
-
code: t.fullPath,
|
|
729
|
-
name: t.fullPath,
|
|
730
|
-
type: t.newVariableType || "String",
|
|
731
|
-
isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
|
|
732
|
-
};
|
|
733
|
-
delete t.newVariableType, delete t.isNewVariable, this.formSchemaUtils.getVariableByCode(s.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s);
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* 更新表达式到expressions节点
|
|
737
|
-
* @param changeObject
|
|
738
|
-
*/
|
|
739
|
-
updateExpressionValue(n) {
|
|
740
|
-
const e = n.propertyValue;
|
|
741
|
-
if (!((e && e.type) === "Expression" && e.expressionInfo))
|
|
742
|
-
return;
|
|
743
|
-
const { expressionId: r, expressionInfo: s } = e, { targetId: d, targetType: o, expressionType: p, value: c, message: l } = s, m = this.formSchemaUtils.getModule();
|
|
744
|
-
m.expressions = m.expressions || [];
|
|
745
|
-
const { expressions: f } = m;
|
|
746
|
-
let u = f.find((A) => A.target === d);
|
|
747
|
-
u || (u = { target: d, rules: [], targetType: o }, f.push(u));
|
|
748
|
-
const h = u.rules.find((A) => A.type === p);
|
|
749
|
-
if (h)
|
|
750
|
-
h.value = c, h.message = l;
|
|
751
|
-
else {
|
|
752
|
-
const A = { id: r, type: p, value: c, message: l };
|
|
753
|
-
u.rules.push(A);
|
|
754
|
-
}
|
|
755
|
-
delete e.expressionInfo;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* 属性类型切换为非表达式后,清除原表达式
|
|
759
|
-
* @param changeObject
|
|
760
|
-
* @param propertyData
|
|
761
|
-
* @returns
|
|
762
|
-
*/
|
|
763
|
-
clearExpression(n, e) {
|
|
764
|
-
const t = n.propertyValue;
|
|
765
|
-
if (t && t.type === "Expression")
|
|
766
|
-
return;
|
|
767
|
-
const r = n.propertyID, s = this.formSchemaUtils.getExpressions(), d = e.binding ? e.binding.field : e.id, o = s.find((p) => p.target === d);
|
|
768
|
-
!o || !o.rules || (o.rules = o.rules.filter((p) => p.type !== r));
|
|
769
|
-
}
|
|
770
|
-
getExpressionOptions(n, e, t) {
|
|
771
|
-
return new q(this.formSchemaUtils).getExpressionOptions(n, e, t);
|
|
772
|
-
}
|
|
773
|
-
getRealTargetType(n) {
|
|
774
|
-
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(n.type) > -1 ? "Button" : n.binding && n.binding.field ? "Field" : "Container";
|
|
775
|
-
}
|
|
776
|
-
createBaseEventProperty(n) {
|
|
777
|
-
const e = {};
|
|
778
|
-
return e[this.viewModelId] = {
|
|
779
|
-
type: "events-editor",
|
|
780
|
-
editor: {
|
|
781
|
-
initialData: n,
|
|
782
|
-
viewSourceHandle: (t) => {
|
|
783
|
-
var i;
|
|
784
|
-
((i = t.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(t);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}, e;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
const I = class I {
|
|
791
|
-
/**
|
|
792
|
-
* 根据绑定字段类型获取可用的输入类控件
|
|
793
|
-
*/
|
|
794
|
-
static getEditorTypesByMDataType(n, e = !1, t = "") {
|
|
795
|
-
if (e)
|
|
796
|
-
return [{ key: a["language-textbox"].type, value: a["language-textbox"].name }];
|
|
797
|
-
let i = I.fieldControlTypeMapping[n];
|
|
798
|
-
if (t === "data-grid-column" && (i != null && i.length)) {
|
|
799
|
-
const r = [a["check-group"].type, a["radio-group"].type, a.image.type, a["rich-text-editor"].type];
|
|
800
|
-
i = i.filter((s) => !r.includes(s.key));
|
|
801
|
-
}
|
|
802
|
-
return i;
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* 获取所有输入类控件
|
|
806
|
-
*/
|
|
807
|
-
static getAllInputTypes() {
|
|
808
|
-
const n = [];
|
|
809
|
-
for (const e in I.fieldControlTypeMapping)
|
|
810
|
-
I.fieldControlTypeMapping[e].forEach((t) => {
|
|
811
|
-
n.find((i) => i.key === t.key && i.value === t.value) || n.push({ key: t.key, value: t.value });
|
|
812
|
-
});
|
|
813
|
-
return n;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* 提供schema字段基础属性和DOM控件属性的映射
|
|
817
|
-
* @param control 控件元数据
|
|
818
|
-
*/
|
|
819
|
-
static mappingDomPropAndSchemaProp(n, e) {
|
|
820
|
-
var r;
|
|
821
|
-
const t = (r = n.editor) == null ? void 0 : r.type, i = [];
|
|
822
|
-
return (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && e && e.categoryId && e.categoryId.indexOf("gridFieldEditor") < 0 && i.push({ domField: "title", schemaField: "name" }), i.push({ domField: "label", schemaField: "name" }), i.push({ domField: "editor.required", schemaField: "require" }), i.push({ domField: "editor.readonly", schemaField: "readonly" }), (t === a["input-group"].type || t === a.textarea.type || t === a["number-spinner"].type) && i.push({ domField: "editor.maxLength", schemaField: "type.length" }), t === a["number-spinner"].type && i.push({ domField: "editor.precision", schemaField: "type.precision" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "formatter.precision", schemaField: "type.precision" }), (t === a["combo-list"].type || t === a["radio-group"].type) && i.push({ domField: "editor.data", schemaField: "type.enumValues" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "formatter.data", schemaField: "type.enumValues" }), t === a["date-picker"].type && (i.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), i.push({ domField: "editor.fieldType", schemaField: "type.name" })), t === a["number-spinner"].type && (i.push({ domField: "editor.max", schemaField: "editor.maxValue" }), i.push({ domField: "editor.min", schemaField: "editor.minValue" })), t === a.lookup.type && (i.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), i.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), i.push({ domField: "editor.textField", schemaField: "editor.textField" }), i.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), i.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), i.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), i.push({ domField: "path", schemaField: "bindingPath" }), i.push({ domField: "binding.path", schemaField: "bindingField" }), i.push({ domField: "binding.fullPath", schemaField: "path" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "field", schemaField: "bindingPath" }), i;
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* <字段类型,可配置的控件类型列表>的映射
|
|
827
|
-
*/
|
|
828
|
-
y(I, "fieldControlTypeMapping", {
|
|
829
|
-
String: [
|
|
830
|
-
{ key: a["input-group"].type, value: a["input-group"].name },
|
|
831
|
-
{ key: a.lookup.type, value: a.lookup.name },
|
|
832
|
-
{ key: a.image.type, value: a.image.name },
|
|
833
|
-
{ key: a["date-picker"].type, value: a["date-picker"].name },
|
|
834
|
-
{ key: a.switch.type, value: a.switch.name },
|
|
835
|
-
{ key: a["check-box"].type, value: a["check-box"].name },
|
|
836
|
-
{ key: a["check-group"].type, value: a["check-group"].name },
|
|
837
|
-
{ key: a["radio-group"].type, value: a["radio-group"].name },
|
|
838
|
-
{ key: a["combo-list"].type, value: a["combo-list"].name },
|
|
839
|
-
{ key: a.textarea.type, value: a.textarea.name },
|
|
840
|
-
{ key: a["time-picker"].type, value: a["time-picker"].name }
|
|
841
|
-
],
|
|
842
|
-
Text: [
|
|
843
|
-
{ key: a.textarea.type, value: a.textarea.name },
|
|
844
|
-
{ key: a.lookup.type, value: a.lookup.name },
|
|
845
|
-
{ key: a.image.type, value: a.image.name },
|
|
846
|
-
{ key: a["rich-text-editor"].type, value: a["rich-text-editor"].name }
|
|
847
|
-
],
|
|
848
|
-
Decimal: [
|
|
849
|
-
{ key: a["number-spinner"].type, value: a["number-spinner"].name }
|
|
850
|
-
],
|
|
851
|
-
Integer: [
|
|
852
|
-
{ key: a["number-spinner"].type, value: a["number-spinner"].name }
|
|
853
|
-
],
|
|
854
|
-
Number: [
|
|
855
|
-
{ key: a["number-spinner"].type, value: a["number-spinner"].name },
|
|
856
|
-
{ key: a.switch.type, value: a.switch.name },
|
|
857
|
-
{ key: a["check-box"].type, value: a["check-box"].name }
|
|
858
|
-
],
|
|
859
|
-
BigNumber: [
|
|
860
|
-
{ key: a["number-spinner"].type, value: a["number-spinner"].name }
|
|
861
|
-
],
|
|
862
|
-
Date: [
|
|
863
|
-
{ key: a["date-picker"].type, value: a["date-picker"].name }
|
|
864
|
-
],
|
|
865
|
-
DateTime: [
|
|
866
|
-
{ key: a["date-picker"].type, value: a["date-picker"].name }
|
|
867
|
-
],
|
|
868
|
-
Boolean: [
|
|
869
|
-
{ key: a.switch.type, value: a.switch.name },
|
|
870
|
-
{ key: a["check-box"].type, value: a["check-box"].name }
|
|
871
|
-
],
|
|
872
|
-
Enum: [
|
|
873
|
-
{ key: a["combo-list"].type, value: a["combo-list"].name },
|
|
874
|
-
{ key: a["radio-group"].type, value: a["radio-group"].name }
|
|
875
|
-
],
|
|
876
|
-
Object: [
|
|
877
|
-
{ key: a.lookup.type, value: a.lookup.name },
|
|
878
|
-
{ key: a["combo-list"].type, value: a["combo-list"].name },
|
|
879
|
-
{ key: a["radio-group"].type, value: a["radio-group"].name }
|
|
880
|
-
]
|
|
881
|
-
});
|
|
882
|
-
let S = I;
|
|
883
|
-
var P = /* @__PURE__ */ ((g) => (g.Form = "Form", g.Variable = "Variable", g))(P || {});
|
|
884
|
-
class he {
|
|
885
|
-
constructor() {
|
|
886
|
-
/** 控件标题 */
|
|
887
|
-
y(this, "label", "");
|
|
888
|
-
/** 控件id */
|
|
889
|
-
y(this, "id", "");
|
|
890
|
-
/** 每个控件占用的栅格数 */
|
|
891
|
-
y(this, "columnInSM", 12);
|
|
892
|
-
y(this, "columnInMD", 6);
|
|
893
|
-
y(this, "columnInLG", 3);
|
|
894
|
-
y(this, "columnInEL", 2);
|
|
895
|
-
/** 每个控件占用的列数 */
|
|
896
|
-
y(this, "displayWidthInSM", 1);
|
|
897
|
-
y(this, "displayWidthInMD", 1);
|
|
898
|
-
y(this, "displayWidthInLG", 1);
|
|
899
|
-
y(this, "displayWidthInEL", 1);
|
|
900
|
-
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
901
|
-
y(this, "displayColumnCountAtBreakPoint", "md");
|
|
902
|
-
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
903
|
-
y(this, "tagRow", 0);
|
|
904
|
-
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
905
|
-
y(this, "showTopBorder", 0);
|
|
906
|
-
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
907
|
-
y(this, "group", 1);
|
|
908
|
-
/** 控件是否符合标准的class配置(设计器用的) */
|
|
909
|
-
y(this, "isSupportedClass", !0);
|
|
910
|
-
/** 控件所在分组id(设计器用的) */
|
|
911
|
-
y(this, "fieldSetId", "");
|
|
912
|
-
}
|
|
139
|
+
if (!e.imageType || !e.imageType.length)
|
|
140
|
+
return s;
|
|
141
|
+
const A = (r = e.imageType) == null ? void 0 : r.map((i) => (i === "jpg" && (i = "jpeg"), `image/${i}`));
|
|
142
|
+
return !A || !A.length ? "image/*" : A.join(",");
|
|
143
|
+
}), f = p(() => c(n.value) || B(n.value) ? n.value : u(n.value)), a = p(() => e.readonly ? "" : e.title);
|
|
144
|
+
function t() {
|
|
145
|
+
e.readonly || o && o.value && o.value.click();
|
|
146
|
+
}
|
|
147
|
+
return { acceptTypes: l, imageSource: f, imageTitle: a, onClickImage: t };
|
|
913
148
|
}
|
|
914
|
-
function
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
function s(c, l, m, f = !1) {
|
|
928
|
-
let u = !1;
|
|
929
|
-
c.contents.forEach((h) => {
|
|
930
|
-
if (h.type === "fieldset") {
|
|
931
|
-
m += 1, s(h, l, m, !0), u = !0;
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
u && (m += 1, u = !1);
|
|
935
|
-
const A = h.appearance && h.appearance.class, v = new he();
|
|
936
|
-
A ? r(A, v) : v.isSupportedClass = !1, v.label = h.label || h.id, v.id = h.id, v.group = m, f && (v.fieldSetId = c.id), e === h.id && (n = m), t.set(h.id, h), l.push(v);
|
|
149
|
+
function J(e, g, o, n, c) {
|
|
150
|
+
const s = new R();
|
|
151
|
+
function B(a) {
|
|
152
|
+
n.value = a;
|
|
153
|
+
}
|
|
154
|
+
function u(a) {
|
|
155
|
+
return new Promise((A, r) => {
|
|
156
|
+
const i = new FileReader();
|
|
157
|
+
i.readAsDataURL(a), i.onload = () => {
|
|
158
|
+
A({ state: "done", content: i.result });
|
|
159
|
+
}, i.onerror = function() {
|
|
160
|
+
r({ state: "error", content: i.result });
|
|
161
|
+
};
|
|
937
162
|
});
|
|
938
163
|
}
|
|
939
|
-
function
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
function o(c, l) {
|
|
947
|
-
l = l || c.id;
|
|
948
|
-
const { result: m, message: f, formNode: u } = d(l);
|
|
949
|
-
if (!m)
|
|
950
|
-
return { result: m, message: f };
|
|
951
|
-
e = c.id, i = [], t.clear();
|
|
952
|
-
const h = u.contents[0].type === a.fieldset.type ? 0 : 1;
|
|
953
|
-
s(u, i, h);
|
|
954
|
-
const A = i.find((b) => !b.isSupportedClass);
|
|
955
|
-
return {
|
|
956
|
-
defaultState: {
|
|
957
|
-
defaultGroupNumber: n || 1,
|
|
958
|
-
model: A ? "customize" : "standard"
|
|
959
|
-
},
|
|
960
|
-
importData: i
|
|
164
|
+
function l(a) {
|
|
165
|
+
const t = {
|
|
166
|
+
size: a.size,
|
|
167
|
+
name: a.name,
|
|
168
|
+
type: a.type,
|
|
169
|
+
lastModified: String(a.lastModified)
|
|
961
170
|
};
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
const u = [];
|
|
969
|
-
return c.forEach((h) => {
|
|
970
|
-
var b;
|
|
971
|
-
const A = t.get(h.id), v = A.appearance && A.appearance.class;
|
|
972
|
-
if (v) {
|
|
973
|
-
const w = v.split(" ").filter((O) => !O.startsWith("col-")), x = "col-" + h.columnInSM, H = "col-md-" + h.columnInMD, G = "col-xl-" + h.columnInLG, W = "col-el-" + h.columnInEL, Q = [x, H, G, W].concat(w);
|
|
974
|
-
A.appearance.class = Q.join(" ");
|
|
975
|
-
}
|
|
976
|
-
if (h.fieldSetId) {
|
|
977
|
-
const k = f.contents.find((x) => x.id === h.fieldSetId), w = u.find((x) => x.id === h.fieldSetId);
|
|
978
|
-
w ? (b = w.contents) == null || b.push(A) : (u.push(k), k.contents = [A]);
|
|
979
|
-
} else
|
|
980
|
-
u.push(A);
|
|
981
|
-
}), f.contents = u, f.id;
|
|
982
|
-
}
|
|
983
|
-
return {
|
|
984
|
-
checkCanFindFormNode: d,
|
|
985
|
-
checkCanOpenLayoutEditor: o,
|
|
986
|
-
changeFormControlsByResponseLayoutConfig: p,
|
|
987
|
-
getResonseFormLayoutConfig: s
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
const Ae = (g) => C(Z, null, [C("h5", null, [z("代码示例")]), C("pre", {
|
|
991
|
-
style: "background-color: #f5f5f5; padding: 10px; border-radius: 5px;"
|
|
992
|
-
}, [C("code", null, [`
|
|
993
|
-
<h3>Tips:</h3>
|
|
994
|
-
<span style="color: blue;">
|
|
995
|
-
自定义提示内容
|
|
996
|
-
</span>
|
|
997
|
-
`])])]);
|
|
998
|
-
class ve extends fe {
|
|
999
|
-
constructor(e, t) {
|
|
1000
|
-
super(e, t);
|
|
1001
|
-
y(this, "responseLayoutEditorFunction");
|
|
1002
|
-
/** 控件绑定的变量 */
|
|
1003
|
-
y(this, "bindingVarible");
|
|
1004
|
-
y(this, "formGroupEvents", [
|
|
1005
|
-
{
|
|
1006
|
-
label: "fieldValueChanging",
|
|
1007
|
-
name: "绑定字段值变化前事件"
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
label: "fieldValueChanged",
|
|
1011
|
-
name: "绑定字段值变化后事件"
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
label: "onClickLabel",
|
|
1015
|
-
name: "点击标签事件"
|
|
1016
|
-
}
|
|
1017
|
-
]);
|
|
1018
|
-
y(this, "numberEditorOptions", {
|
|
1019
|
-
type: "number-spinner",
|
|
1020
|
-
useThousands: !1,
|
|
1021
|
-
keyboard: !1,
|
|
1022
|
-
showButton: !1
|
|
171
|
+
u(a).then((A) => {
|
|
172
|
+
A.state === "done" && (B(A.content), t.state = A.state, t.base64 = A.content, g.emit("imageChange", t)), c.value = !1;
|
|
173
|
+
}).catch((A) => {
|
|
174
|
+
c.value = !1;
|
|
175
|
+
const r = Q.getLocaleValue("avatar.uploadError");
|
|
176
|
+
s.error({ message: r, position: "top-center" });
|
|
1023
177
|
});
|
|
1024
|
-
this.responseLayoutEditorFunction = ye(this.formSchemaUtils);
|
|
1025
|
-
}
|
|
1026
|
-
getCommonPropertyConfig(e, t, i = "Card") {
|
|
1027
|
-
if (this.propertyConfig.categories.basic = this.getBasicProperties(e, t, i), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, t), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "form-group"), i === "Card") {
|
|
1028
|
-
const r = this.getTipsConfig(e);
|
|
1029
|
-
this.propertyConfig.categories.behavior.properties = { ...this.propertyConfig.categories.behavior.properties, ...r }, ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group"].includes(e.editor.type) && (this.propertyConfig.categories.expansion = this.getExpandProperties(e));
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
getPropertyConfig(e, t) {
|
|
1033
|
-
return this.getCommonPropertyConfig(e, t, "Card"), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig.categories.expressions = this.getExpressionConfig(e, "Field"), this.propertyConfig.categories.eventsEditor = this.getEventPropertyConfig(e), this.propertyConfig;
|
|
1034
|
-
}
|
|
1035
|
-
getGridFieldEdtiorPropConfig(e, t) {
|
|
1036
|
-
return this.propertyConfig.categories = {}, this.getCommonPropertyConfig(e, t, "Grid"), this.getGridFieldEdtiorProperties ? this.propertyConfig.categories.editor = this.getGridFieldEdtiorProperties(e) : this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig.categories.expressons = this.getExpressionConfig(e, "Field"), this.propertyConfig.categories;
|
|
1037
|
-
}
|
|
1038
|
-
getBasicProperties(e, t, i = "Card") {
|
|
1039
|
-
var p;
|
|
1040
|
-
const r = this;
|
|
1041
|
-
this.setDesignViewModelField(e);
|
|
1042
|
-
const { canChangeControlType: s, editorTypeList: d } = this.getAvailableEditorType(e), o = {
|
|
1043
|
-
description: "Basic Information",
|
|
1044
|
-
title: "基本信息",
|
|
1045
|
-
properties: {
|
|
1046
|
-
id: {
|
|
1047
|
-
description: "组件标识",
|
|
1048
|
-
title: "标识",
|
|
1049
|
-
type: "string",
|
|
1050
|
-
readonly: !0
|
|
1051
|
-
},
|
|
1052
|
-
type: {
|
|
1053
|
-
description: "编辑器类型",
|
|
1054
|
-
title: "编辑器类型",
|
|
1055
|
-
type: "string",
|
|
1056
|
-
$converter: "/converter/change-editor.converter",
|
|
1057
|
-
parentPropertyID: "editor",
|
|
1058
|
-
editor: {
|
|
1059
|
-
type: "combo-list",
|
|
1060
|
-
textField: "value",
|
|
1061
|
-
valueField: "key",
|
|
1062
|
-
idField: "key",
|
|
1063
|
-
editable: !1,
|
|
1064
|
-
data: d,
|
|
1065
|
-
readonly: !s
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
label: {
|
|
1069
|
-
title: "标签",
|
|
1070
|
-
type: "string",
|
|
1071
|
-
$converter: "/converter/form-group-label.converter"
|
|
1072
|
-
},
|
|
1073
|
-
showLabelType: {
|
|
1074
|
-
description: "标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",
|
|
1075
|
-
title: "标签显示",
|
|
1076
|
-
type: "enum",
|
|
1077
|
-
editor: {
|
|
1078
|
-
data: [{ id: "visible", name: "显示" }, { id: "reserve-space", name: "占位" }, { id: "none", name: "不显示" }]
|
|
1079
|
-
},
|
|
1080
|
-
defaultValue: ((p = e.editor) == null ? void 0 : p.type) === "image" ? "none" : "visible"
|
|
1081
|
-
},
|
|
1082
|
-
binding: {
|
|
1083
|
-
description: "绑定的表单字段",
|
|
1084
|
-
title: "绑定",
|
|
1085
|
-
editor: {
|
|
1086
|
-
type: "binding-selector",
|
|
1087
|
-
bindingType: { enable: !0 },
|
|
1088
|
-
editorParams: {
|
|
1089
|
-
componentSchema: e,
|
|
1090
|
-
needSyncToViewModel: !0,
|
|
1091
|
-
viewModelId: this.viewModelId,
|
|
1092
|
-
designerHostService: this.designerHostService,
|
|
1093
|
-
disableOccupiedFields: !0
|
|
1094
|
-
},
|
|
1095
|
-
textField: "bindingField"
|
|
1096
|
-
},
|
|
1097
|
-
refreshPanelAfterChanged: !0,
|
|
1098
|
-
readonly: this.formSchemaUtils.designerMode === "PC_RTC" && !e.isRtcControl
|
|
1099
|
-
}
|
|
1100
|
-
},
|
|
1101
|
-
setPropertyRelates(c, l, m) {
|
|
1102
|
-
if (c)
|
|
1103
|
-
switch (c && c.propertyID) {
|
|
1104
|
-
case "type": {
|
|
1105
|
-
r.changeControlType(e, c, t);
|
|
1106
|
-
break;
|
|
1107
|
-
}
|
|
1108
|
-
case "label": {
|
|
1109
|
-
c.needRefreshControlTree = !0;
|
|
1110
|
-
break;
|
|
1111
|
-
}
|
|
1112
|
-
case "binding": {
|
|
1113
|
-
r.changeBindingField(e, c, m);
|
|
1114
|
-
break;
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
};
|
|
1119
|
-
return i.toLocaleLowerCase() !== "card" && delete o.properties.showLabelType, o;
|
|
1120
|
-
}
|
|
1121
|
-
getExpandProperties(e) {
|
|
1122
|
-
const t = this, i = ["Const", "Variable"], r = this.getPropertyEditorParams(e, i, "expandable"), s = this.getPropertyEditorParams(e, i, "expandDisabled");
|
|
1123
|
-
return {
|
|
1124
|
-
description: "Expand Information",
|
|
1125
|
-
title: "扩展区域",
|
|
1126
|
-
properties: {
|
|
1127
|
-
expandable: {
|
|
1128
|
-
description: "是否启用扩展区域",
|
|
1129
|
-
title: "启用扩展区域",
|
|
1130
|
-
refreshPanelAfterChanged: !0,
|
|
1131
|
-
$converter: "/converter/property-editor.converter",
|
|
1132
|
-
editor: r
|
|
1133
|
-
},
|
|
1134
|
-
expandMode: {
|
|
1135
|
-
description: "扩展模式 text | button",
|
|
1136
|
-
title: "扩展模式",
|
|
1137
|
-
type: "enum",
|
|
1138
|
-
refreshPanelAfterChanged: !0,
|
|
1139
|
-
$converter: "/converter/property-editor.converter",
|
|
1140
|
-
editor: {
|
|
1141
|
-
data: [{ id: "text", name: "静态文本" }, { id: "button", name: "交互按钮" }]
|
|
1142
|
-
},
|
|
1143
|
-
defaultValue: "text",
|
|
1144
|
-
visible: !!e.editor.expandable
|
|
1145
|
-
},
|
|
1146
|
-
expandContent: {
|
|
1147
|
-
$converter: "/converter/property-editor.converter",
|
|
1148
|
-
description: "扩展内容",
|
|
1149
|
-
title: "扩展内容",
|
|
1150
|
-
type: "string",
|
|
1151
|
-
visible: !!e.editor.expandable
|
|
1152
|
-
},
|
|
1153
|
-
expandDisabled: {
|
|
1154
|
-
$converter: "/converter/property-editor.converter",
|
|
1155
|
-
description: "是否隐藏扩展区域",
|
|
1156
|
-
title: "隐藏扩展区域",
|
|
1157
|
-
editor: s,
|
|
1158
|
-
visible: !!e.editor.expandable
|
|
1159
|
-
}
|
|
1160
|
-
},
|
|
1161
|
-
setPropertyRelates(o, p) {
|
|
1162
|
-
if (o)
|
|
1163
|
-
switch (o.propertyID) {
|
|
1164
|
-
case "expandable":
|
|
1165
|
-
case "expandDisabled":
|
|
1166
|
-
t.afterMutilEditorChanged(e, o);
|
|
1167
|
-
break;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
/**
|
|
1173
|
-
* 校验控件是否支持切换类型
|
|
1174
|
-
* @param control 控件
|
|
1175
|
-
*/
|
|
1176
|
-
checkCanChangeControlType(e, t) {
|
|
1177
|
-
if (!e.binding)
|
|
1178
|
-
return !1;
|
|
1179
|
-
if (e.binding.type === "Variable") {
|
|
1180
|
-
if (this.bindingVarible = this.formSchemaUtils.getVariableById(e.binding.field), !this.bindingVarible)
|
|
1181
|
-
return !1;
|
|
1182
|
-
} else if (!this.designViewModelField || this.designViewModelField.$type !== N.SimpleField)
|
|
1183
|
-
return !1;
|
|
1184
|
-
return !0;
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* 获取可选的编辑器类型
|
|
1188
|
-
*/
|
|
1189
|
-
getAvailableEditorType(e) {
|
|
1190
|
-
var r;
|
|
1191
|
-
const t = this.checkCanChangeControlType(e, this.viewModelId);
|
|
1192
|
-
if (!t)
|
|
1193
|
-
return {
|
|
1194
|
-
canChangeControlType: !1,
|
|
1195
|
-
editorTypeList: [{
|
|
1196
|
-
key: e.editor.type,
|
|
1197
|
-
value: ((r = a[e.editor.type]) == null ? void 0 : r.name) || e.editor.type
|
|
1198
|
-
}]
|
|
1199
|
-
};
|
|
1200
|
-
let i = [];
|
|
1201
|
-
return this.designViewModelField && this.designViewModelField.$type === N.SimpleField ? i = S.getEditorTypesByMDataType(this.designViewModelField.type.name, this.designViewModelField.multiLanguage) : this.bindingVarible && (i = S.getEditorTypesByMDataType(this.bindingVarible.type, !1)), { canChangeControlType: t, editorTypeList: i };
|
|
1202
|
-
}
|
|
1203
|
-
changeBindingField(e, t, i) {
|
|
1204
|
-
t.needRefreshEntityTree = !0;
|
|
1205
178
|
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
return {
|
|
1209
|
-
title: "外观",
|
|
1210
|
-
description: "Appearance",
|
|
1211
|
-
properties: {
|
|
1212
|
-
class: {
|
|
1213
|
-
title: "class样式",
|
|
1214
|
-
type: "string",
|
|
1215
|
-
description: "组件的CSS样式",
|
|
1216
|
-
$converter: "/converter/appearance.converter",
|
|
1217
|
-
parentPropertyID: "appearance"
|
|
1218
|
-
},
|
|
1219
|
-
style: {
|
|
1220
|
-
title: "style样式",
|
|
1221
|
-
type: "string",
|
|
1222
|
-
description: "组件的内联样式",
|
|
1223
|
-
$converter: "/converter/appearance.converter",
|
|
1224
|
-
parentPropertyID: "appearance"
|
|
1225
|
-
},
|
|
1226
|
-
fill: {
|
|
1227
|
-
title: "填充宽度",
|
|
1228
|
-
description: "启用后,控件占满父容器宽度",
|
|
1229
|
-
type: "boolean",
|
|
1230
|
-
parentPropertyID: "appearance"
|
|
1231
|
-
},
|
|
1232
|
-
responseLayout: {
|
|
1233
|
-
description: "响应式列宽",
|
|
1234
|
-
title: "响应式列宽",
|
|
1235
|
-
type: "boolean",
|
|
1236
|
-
visible: !0,
|
|
1237
|
-
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
1238
|
-
refreshPanelAfterChanged: !0,
|
|
1239
|
-
editor: {
|
|
1240
|
-
type: "response-layout-editor-setting",
|
|
1241
|
-
beforeOpen: () => i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e, i.componentId)
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
},
|
|
1245
|
-
setPropertyRelates(r, s) {
|
|
1246
|
-
if (r)
|
|
1247
|
-
switch (r && r.propertyID) {
|
|
1248
|
-
case "responseLayout":
|
|
1249
|
-
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(r.propertyValue, i.componentId || e.id), i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId), i.updateElementByParentContainer(e.id, t), delete e.responseLayout;
|
|
1250
|
-
break;
|
|
1251
|
-
case "class":
|
|
1252
|
-
i.updateUnifiedLayoutAfterControlChanged(r.propertyValue, e.id, this.componentId), V.value++;
|
|
1253
|
-
break;
|
|
1254
|
-
case "style": {
|
|
1255
|
-
V.value++;
|
|
1256
|
-
break;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
}
|
|
1262
|
-
getEditorProperties(e) {
|
|
1263
|
-
return this.getComponentConfig(e);
|
|
1264
|
-
}
|
|
1265
|
-
/**
|
|
1266
|
-
* 卡片控件:切换控件类型后事件
|
|
1267
|
-
* @param propertyData 控件DOM属性
|
|
1268
|
-
* @param newControlType 新控件类型
|
|
1269
|
-
*/
|
|
1270
|
-
changeControlType(e, t, i) {
|
|
1271
|
-
const r = t.propertyValue, s = i && i.parent && i.parent.schema;
|
|
1272
|
-
if (!s)
|
|
179
|
+
function f(a) {
|
|
180
|
+
if (e.readonly)
|
|
1273
181
|
return;
|
|
1274
|
-
const
|
|
1275
|
-
if (
|
|
182
|
+
const t = a.target, A = t.files;
|
|
183
|
+
if (!A || !A[0])
|
|
1276
184
|
return;
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
m.editor || (m.editor = {}), m.editor.$type = r, this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, m, !1), p = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, r);
|
|
1282
|
-
}
|
|
1283
|
-
p || (p = this.controlCreatorUtils.createFormGroupWithoutField(r)), Object.assign(p, {
|
|
1284
|
-
id: o.id,
|
|
1285
|
-
appearance: o.appearance,
|
|
1286
|
-
size: o.size,
|
|
1287
|
-
label: o.label,
|
|
1288
|
-
binding: o.binding
|
|
1289
|
-
}), Object.prototype.hasOwnProperty.call(o, "visible") && Object.assign(p, { visible: o.visible }), o.editor && ["readonly", "required", "placeholder"].map((c) => {
|
|
1290
|
-
Object.prototype.hasOwnProperty.call(o.editor, c) && (p.editor[c] = o.editor[c]);
|
|
1291
|
-
}), i != null && i.updateContextSchema ? i.updateContextSchema(p) : (i.schema = Object.assign(o, p), Object.assign(e, p)), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
1292
|
-
(c) => c.classList.remove("dgComponentSelected")
|
|
1293
|
-
), Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(
|
|
1294
|
-
(c) => c.classList.remove("dgComponentFocused")
|
|
1295
|
-
), V.value++, $(() => {
|
|
1296
|
-
this.getFormDesignerInstance().reloadPropertyPanel();
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
getTipsConfig(e) {
|
|
1300
|
-
return ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "textarea", "rich-text-editor"].includes(e.editor.type) ? {
|
|
1301
|
-
enableTips: {
|
|
1302
|
-
refreshPanelAfterChanged: !0,
|
|
1303
|
-
description: "",
|
|
1304
|
-
title: "启用提示",
|
|
1305
|
-
type: "boolean",
|
|
1306
|
-
default: !1
|
|
1307
|
-
},
|
|
1308
|
-
tipsContent: {
|
|
1309
|
-
description: "提示内容",
|
|
1310
|
-
title: "提示内容",
|
|
1311
|
-
type: "string",
|
|
1312
|
-
editor: {
|
|
1313
|
-
type: "code-editor",
|
|
1314
|
-
language: "html",
|
|
1315
|
-
leftTemplate: Ae
|
|
1316
|
-
},
|
|
1317
|
-
visible: !!e.enableTips
|
|
1318
|
-
}
|
|
1319
|
-
} : {};
|
|
1320
|
-
}
|
|
1321
|
-
getComponentConfig(e, t = {}, i = {}, r) {
|
|
1322
|
-
var m, f;
|
|
1323
|
-
const s = Object.assign({
|
|
1324
|
-
description: "编辑器",
|
|
1325
|
-
title: "编辑器",
|
|
1326
|
-
type: "input-group",
|
|
1327
|
-
$converter: "/converter/property-editor.converter",
|
|
1328
|
-
parentPropertyID: "editor"
|
|
1329
|
-
}, t), d = (m = e.binding) != null && m.field ? [] : ["Const", "Variable", "StateMachine"], o = this.getPropertyEditorParams(e, d, "readonly"), p = this.getPropertyEditorParams(e, d, "required"), c = {
|
|
1330
|
-
readonly: {
|
|
1331
|
-
description: "",
|
|
1332
|
-
title: "只读",
|
|
1333
|
-
editor: o
|
|
1334
|
-
},
|
|
1335
|
-
required: {
|
|
1336
|
-
description: "",
|
|
1337
|
-
title: "必填",
|
|
1338
|
-
type: "boolean",
|
|
1339
|
-
editor: p,
|
|
1340
|
-
visible: !!((f = e.binding) != null && f.field)
|
|
1341
|
-
},
|
|
1342
|
-
placeholder: {
|
|
1343
|
-
description: "当控件没有值时在输入框中显示的文本",
|
|
1344
|
-
title: "提示文本",
|
|
1345
|
-
type: "string"
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
for (const u in i)
|
|
1349
|
-
c[u] = Object.assign(c[u] || {}, i[u]);
|
|
1350
|
-
const l = this;
|
|
1351
|
-
return {
|
|
1352
|
-
...s,
|
|
1353
|
-
properties: { ...c },
|
|
1354
|
-
setPropertyRelates(u, h) {
|
|
1355
|
-
if (u) {
|
|
1356
|
-
switch (u.propertyID) {
|
|
1357
|
-
case "readonly":
|
|
1358
|
-
case "required":
|
|
1359
|
-
l.afterMutilEditorChanged(e, u);
|
|
1360
|
-
break;
|
|
1361
|
-
}
|
|
1362
|
-
r && r.bind(l)(u, e, h);
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
}
|
|
1367
|
-
/**
|
|
1368
|
-
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
1369
|
-
* @param controlClass 控件样式
|
|
1370
|
-
* @param controlId 控件Id
|
|
1371
|
-
* @param componentId 控件所在组件id
|
|
1372
|
-
*/
|
|
1373
|
-
updateUnifiedLayoutAfterControlChanged(e, t, i) {
|
|
1374
|
-
const r = e.split(" ");
|
|
1375
|
-
let s = r.find((l) => /^col-([1-9]|10|11|12)$/.test(l)), d = r.find((l) => /^col-md-([1-9]|10|11|12)$/.test(l)), o = r.find((l) => /^col-xl-([1-9]|10|11|12)$/.test(l)), p = r.find((l) => /^col-el-([1-9]|10|11|12)$/.test(l));
|
|
1376
|
-
s = s || "col-12", d = d || "col-md-" + s.replace("col-", ""), o = o || "col-xl-" + d.replace("col-md-", ""), p = p || "col-el-" + o.replace("col-xl-", "");
|
|
1377
|
-
const c = {
|
|
1378
|
-
id: t,
|
|
1379
|
-
columnInSM: parseInt(s.replace("col-", ""), 10),
|
|
1380
|
-
columnInMD: parseInt(d.replace("col-md-", ""), 10),
|
|
1381
|
-
columnInLG: parseInt(o.replace("col-xl-", ""), 10),
|
|
1382
|
-
columnInEL: parseInt(p.replace("col-el-", ""), 10)
|
|
1383
|
-
};
|
|
1384
|
-
this.updateUnifiedLayoutAfterResponseLayoutChanged(i, c);
|
|
1385
|
-
}
|
|
1386
|
-
/**
|
|
1387
|
-
* 修改控件布局配置后更新Form统一布局配置
|
|
1388
|
-
* @param componentId 组件Id
|
|
1389
|
-
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
1390
|
-
*/
|
|
1391
|
-
updateUnifiedLayoutAfterResponseLayoutChanged(e, t) {
|
|
1392
|
-
const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
|
|
1393
|
-
if (!i || !i.unifiedLayout)
|
|
185
|
+
const r = A[0].type, i = A[0].size / 1024 / 1024 < e.maxSize;
|
|
186
|
+
if (o.value && o.value.split(",").indexOf(r) < 0) {
|
|
187
|
+
const y = Q.getLocaleValue("avatar.typeError");
|
|
188
|
+
s.error({ message: y, position: "top-center" }), t.value = "";
|
|
1394
189
|
return;
|
|
1395
|
-
const r = [];
|
|
1396
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i, r, 1), t) {
|
|
1397
|
-
const u = r.find((h) => h.id === t.id);
|
|
1398
|
-
Object.assign(u || {}, t);
|
|
1399
190
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
uniqueColClassInLG: m,
|
|
1405
|
-
uniqueColClassInEL: f
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
/**
|
|
1409
|
-
* 校验宽度样式值是否一致
|
|
1410
|
-
*/
|
|
1411
|
-
checkIsUniqueColumn(e) {
|
|
1412
|
-
const t = new Set(e);
|
|
1413
|
-
return Array.from(t).length === 1;
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* 枚举项编辑器
|
|
1417
|
-
* @param propertyData
|
|
1418
|
-
* @param valueField
|
|
1419
|
-
* @param textField
|
|
1420
|
-
* @returns
|
|
1421
|
-
*/
|
|
1422
|
-
getItemCollectionEditor(e, t, i) {
|
|
1423
|
-
return t = t || "value", i = i || "name", {
|
|
1424
|
-
editor: {
|
|
1425
|
-
columns: [
|
|
1426
|
-
{ field: t, title: "值", dataType: "string" },
|
|
1427
|
-
{ field: i, title: "名称", dataType: "string" }
|
|
1428
|
-
// { field: 'disabled', title: '禁用', dataType: 'boolean', editor: { type: 'switch' } },
|
|
1429
|
-
],
|
|
1430
|
-
type: "item-collection-editor",
|
|
1431
|
-
valueField: t,
|
|
1432
|
-
nameField: i,
|
|
1433
|
-
requiredFields: [t, i],
|
|
1434
|
-
uniqueFields: [t, i],
|
|
1435
|
-
readonly: this.checkEnumDataReadonly(e)
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* 判断枚举数据是否只读
|
|
1441
|
-
* 1、没有绑定信息或者绑定变量,可以新增、删除、修改
|
|
1442
|
-
* 2、绑定类型为字段,且字段为枚举字段,则不可新增、删除、修改枚举值。只能从be修改然后同步到表单上。
|
|
1443
|
-
* @param propertyData 下拉框控件属性值
|
|
1444
|
-
*/
|
|
1445
|
-
checkEnumDataReadonly(e) {
|
|
1446
|
-
return !e.binding || e.binding.type !== "Form" ? !1 : !!(this.designViewModelField && this.designViewModelField.type && this.designViewModelField.type.$type === te.EnumType);
|
|
1447
|
-
}
|
|
1448
|
-
/**
|
|
1449
|
-
* 将字段值变化前事件、变化后事件追加到交互面板
|
|
1450
|
-
* 注意:因为绑定字段值变化后事件与下拉框的值变化事件(valueChanged)重名,所以这里将事件label都重命名下
|
|
1451
|
-
*/
|
|
1452
|
-
appendFieldValueChangeEvents(e, t) {
|
|
1453
|
-
e.binding && e.binding.type === P.Form && e.binding.field ? (t.find((i) => i.label === "fieldValueChanging"), t.find((i) => i.label === "fieldValueChanged"), this.designViewModelField && (e.fieldValueChanging = this.designViewModelField.valueChanging, e.fieldValueChanged = this.designViewModelField.valueChanged)) : t = t.filter((i) => i.label !== "fieldValueChanging" && i.label !== "fieldValueChanged");
|
|
1454
|
-
}
|
|
1455
|
-
getControlMethodType(e) {
|
|
1456
|
-
if (!e.binding)
|
|
1457
|
-
return e.type;
|
|
1458
|
-
switch (e.binding.type) {
|
|
1459
|
-
case P.Form:
|
|
1460
|
-
return e.binding.path || e.type;
|
|
1461
|
-
case P.Variable:
|
|
1462
|
-
return e.binding.fullPath || e.type;
|
|
191
|
+
if (!i) {
|
|
192
|
+
const y = Q.getLocaleValue("avatar.sizeError") + e.maxSize + "MB!";
|
|
193
|
+
s.error({ message: y, position: "top-center" }), t.value = "";
|
|
194
|
+
return;
|
|
1463
195
|
}
|
|
1464
|
-
|
|
1465
|
-
}
|
|
1466
|
-
/**
|
|
1467
|
-
* 组装输入类控件的交互面板:包含标签超链、绑定字段值变化前后事件等。
|
|
1468
|
-
* @param propertyData 属性值
|
|
1469
|
-
* @param viewModelId 视图模型id
|
|
1470
|
-
* @param showPosition 面板展示位置
|
|
1471
|
-
* @param customEvent 输入控件特有的事件配置
|
|
1472
|
-
*/
|
|
1473
|
-
getEventPropertyConfig(e, t = "card", i, r) {
|
|
1474
|
-
const s = this;
|
|
1475
|
-
let d = [...this.formGroupEvents];
|
|
1476
|
-
if (["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group"].includes(e.editor.type) && d.push({
|
|
1477
|
-
lable: "onClear",
|
|
1478
|
-
name: "清空事件"
|
|
1479
|
-
}), i && (d = d.concat(i)), d.length === 0)
|
|
1480
|
-
return {
|
|
1481
|
-
title: "事件",
|
|
1482
|
-
hideTitle: !0,
|
|
1483
|
-
properties: {},
|
|
1484
|
-
tabId: "commands",
|
|
1485
|
-
tabName: "交互",
|
|
1486
|
-
hide: !0
|
|
1487
|
-
};
|
|
1488
|
-
this.appendFieldValueChangeEvents(e, d);
|
|
1489
|
-
const p = s.eventsEditorUtils.formProperties(e, s.viewModelId, d);
|
|
1490
|
-
return {
|
|
1491
|
-
title: "事件",
|
|
1492
|
-
hideTitle: !0,
|
|
1493
|
-
properties: s.createBaseEventProperty(p),
|
|
1494
|
-
tabId: "commands",
|
|
1495
|
-
tabName: "交互",
|
|
1496
|
-
setPropertyRelates(m, f) {
|
|
1497
|
-
const u = m.propertyValue;
|
|
1498
|
-
delete e[s.viewModelId], u && (u.setPropertyRelates = this.setPropertyRelates, u.controlInfo = { type: s.getControlMethodType(e), name: e.title }, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, u.events, u)), r && r(m, f, u);
|
|
1499
|
-
const h = s.designViewModelUtils.getDgViewModel(s.viewModelId);
|
|
1500
|
-
h && s.designViewModelField && h.changeField(s.designViewModelField.id, { valueChanging: e.fieldValueChanging, valueChanged: e.fieldValueChanged });
|
|
1501
|
-
}
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
getExpressionConfig(e, t, i = ["compute", "dependency", "validate"], r) {
|
|
1505
|
-
return new q(this.formSchemaUtils).getExpressionConfig(
|
|
1506
|
-
e,
|
|
1507
|
-
t,
|
|
1508
|
-
i,
|
|
1509
|
-
r
|
|
1510
|
-
);
|
|
1511
|
-
}
|
|
1512
|
-
getBindingDataType() {
|
|
1513
|
-
return this.designViewModelField ? this.designViewModelField.type.name === "Number" ? "number" : this.designViewModelField.type.name === "String" ? "string" : "boolean" : "boolean";
|
|
1514
|
-
}
|
|
1515
|
-
getEditor() {
|
|
1516
|
-
return this.getBindingDataType() === "number" ? this.numberEditorOptions : {};
|
|
1517
|
-
}
|
|
1518
|
-
updatePropertyValue(e, t, i) {
|
|
1519
|
-
var r;
|
|
1520
|
-
e.editor[t] !== i ? e.editor[t] = i : (r = this.getFormDesignerInstance()) == null || r.reloadPropertyPanel();
|
|
1521
|
-
}
|
|
1522
|
-
setBooleanValue(e, t, i) {
|
|
1523
|
-
let r = i;
|
|
1524
|
-
this.getBindingDataType() === "string" && (r = (r || "").trim() || (t === "trueValue" ? "true" : "false"));
|
|
1525
|
-
const d = t === "trueValue" ? "falseValue" : "trueValue";
|
|
1526
|
-
e.editor[d] === r && (r = r + 1), this.updatePropertyValue(e, t, r);
|
|
1527
|
-
}
|
|
1528
|
-
getBooleanValueConverter() {
|
|
1529
|
-
return {
|
|
1530
|
-
convertFrom: (e, t) => e.editor[t],
|
|
1531
|
-
convertTo: (e, t, i) => {
|
|
1532
|
-
this.setBooleanValue(e, t, i);
|
|
1533
|
-
}
|
|
1534
|
-
};
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
class be extends ve {
|
|
1538
|
-
constructor(n, e) {
|
|
1539
|
-
super(n, e);
|
|
1540
|
-
}
|
|
1541
|
-
getEditorProperties(n) {
|
|
1542
|
-
return {
|
|
1543
|
-
description: "编辑器",
|
|
1544
|
-
title: "编辑器",
|
|
1545
|
-
type: "avatar",
|
|
1546
|
-
$converter: "/converter/property-editor.converter",
|
|
1547
|
-
parentPropertyID: "editor",
|
|
1548
|
-
properties: {
|
|
1549
|
-
readonly: {
|
|
1550
|
-
description: "",
|
|
1551
|
-
title: "只读",
|
|
1552
|
-
type: "boolean"
|
|
1553
|
-
},
|
|
1554
|
-
avatarWidth: {
|
|
1555
|
-
description: "",
|
|
1556
|
-
title: "头像宽度",
|
|
1557
|
-
type: "number"
|
|
1558
|
-
},
|
|
1559
|
-
avatarHeight: {
|
|
1560
|
-
description: "",
|
|
1561
|
-
title: "头像高度",
|
|
1562
|
-
type: "number"
|
|
1563
|
-
},
|
|
1564
|
-
cover: {
|
|
1565
|
-
description: "",
|
|
1566
|
-
title: "封面",
|
|
1567
|
-
type: "string"
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
};
|
|
196
|
+
c.value = !0, l(A[0]), t.value = "";
|
|
1571
197
|
}
|
|
198
|
+
return { onFileChange: f };
|
|
1572
199
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
return new be(i, n).getPropertyConfig(e, r);
|
|
1577
|
-
}
|
|
1578
|
-
return {
|
|
1579
|
-
getPropsConfig: t
|
|
1580
|
-
};
|
|
1581
|
-
}
|
|
1582
|
-
const Ee = /* @__PURE__ */ U({
|
|
1583
|
-
name: "FAvatarDesign",
|
|
1584
|
-
props: T,
|
|
200
|
+
const U = /* @__PURE__ */ H({
|
|
201
|
+
name: "FAvatar",
|
|
202
|
+
props: m,
|
|
1585
203
|
emits: ["change", "update:modelValue"],
|
|
1586
|
-
setup(
|
|
1587
|
-
const
|
|
1588
|
-
J(() => {
|
|
1589
|
-
e.value.componentInstance = s;
|
|
1590
|
-
}), n.expose(s.value);
|
|
1591
|
-
const d = E(() => ({
|
|
204
|
+
setup(e, g) {
|
|
205
|
+
const o = C(), n = "data:image/jpeg;base64,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", c = "data:image/jpeg;base64,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", s = p(() => ({
|
|
1592
206
|
"f-avatar": !0,
|
|
1593
|
-
"f-avatar-readonly":
|
|
1594
|
-
"f-avatar-circle":
|
|
1595
|
-
"f-avatar-square":
|
|
1596
|
-
})),
|
|
1597
|
-
width:
|
|
1598
|
-
height:
|
|
1599
|
-
})),
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
207
|
+
"f-avatar-readonly": e.readonly,
|
|
208
|
+
"f-avatar-circle": e.shape === "circle",
|
|
209
|
+
"f-avatar-square": e.shape === "square"
|
|
210
|
+
})), B = p(() => ({
|
|
211
|
+
width: e.avatarWidth + "px",
|
|
212
|
+
height: e.avatarHeight + "px"
|
|
213
|
+
})), u = C(!1), l = C(e.modelValue || n), {
|
|
214
|
+
acceptTypes: f,
|
|
215
|
+
imageSource: a,
|
|
216
|
+
onClickImage: t
|
|
217
|
+
} = k(e, g, o, l), {
|
|
218
|
+
onFileChange: A
|
|
219
|
+
} = J(e, g, f, l, u);
|
|
220
|
+
E(() => e.modelValue, (i) => {
|
|
221
|
+
l.value = i || n;
|
|
222
|
+
});
|
|
223
|
+
function r() {
|
|
224
|
+
l.value = c;
|
|
1604
225
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
class:
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}, [c, C("img", {
|
|
1616
|
-
title: g.title,
|
|
226
|
+
return () => d("div", {
|
|
227
|
+
class: s.value,
|
|
228
|
+
style: B.value,
|
|
229
|
+
onClick: t
|
|
230
|
+
}, [u.value && d("div", {
|
|
231
|
+
class: "f-avatar-upload-loading"
|
|
232
|
+
}, [d("div", {
|
|
233
|
+
class: "loading-inner"
|
|
234
|
+
}, [Q.getLocaleValue("avatar.loading")])]), d("img", {
|
|
235
|
+
title: e.title,
|
|
1617
236
|
class: "f-avatar-image",
|
|
1618
|
-
src:
|
|
1619
|
-
onError:
|
|
1620
|
-
}, null), !
|
|
237
|
+
src: a.value,
|
|
238
|
+
onError: r
|
|
239
|
+
}, null), !e.readonly && d("div", {
|
|
1621
240
|
class: "f-avatar-icon"
|
|
1622
|
-
}, [
|
|
241
|
+
}, [d("span", {
|
|
1623
242
|
class: "f-icon f-icon-camera"
|
|
1624
|
-
}, null)]),
|
|
1625
|
-
ref:
|
|
243
|
+
}, null)]), !e.readonly && d("input", {
|
|
244
|
+
ref: o,
|
|
1626
245
|
name: "file-input",
|
|
1627
246
|
type: "file",
|
|
1628
247
|
class: "f-avatar-upload",
|
|
1629
|
-
accept:
|
|
1630
|
-
onChange:
|
|
248
|
+
accept: f.value,
|
|
249
|
+
onChange: A,
|
|
1631
250
|
style: "display: none;"
|
|
1632
251
|
}, null)]);
|
|
1633
252
|
}
|
|
1634
|
-
});
|
|
1635
|
-
M.register = (g, n, e, t) => {
|
|
1636
|
-
g.avatar = M, n.avatar = R;
|
|
1637
|
-
};
|
|
1638
|
-
M.registerDesigner = (g, n, e) => {
|
|
1639
|
-
g.avatar = Ee, n.avatar = R;
|
|
1640
|
-
};
|
|
1641
|
-
const Se = ie(M);
|
|
253
|
+
}), M = K(U);
|
|
1642
254
|
export {
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
255
|
+
U as FAvatar,
|
|
256
|
+
m as avatarProps,
|
|
257
|
+
M as default,
|
|
258
|
+
G as propsResolver
|
|
1647
259
|
};
|