@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,58 +1,58 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
import { resolveAppearance as
|
|
6
|
-
import { DgControl as
|
|
7
|
-
import { useGuid as
|
|
8
|
-
import { useConditionValue as
|
|
9
|
-
import { useCondition as
|
|
10
|
-
import { FNotifyService as
|
|
11
|
-
import { LocaleService as
|
|
12
|
-
import { cloneDeep as
|
|
13
|
-
import { FDynamicFormGroup as
|
|
14
|
-
import { radioGroupProps as
|
|
15
|
-
import { useDataSource as
|
|
16
|
-
import { DgControl as
|
|
17
|
-
const
|
|
18
|
-
["appearance",
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var qe = (t, i, e) => i in t ? We(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e;
|
|
3
|
+
var E = (t, i, e) => qe(t, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { ref as F, computed as W, createVNode as y, defineComponent as Q, inject as X, onMounted as ee, mergeProps as je, createTextVNode as j, Fragment as ie, Teleport as ze, nextTick as ne, provide as me, watch as ge, onUnmounted as ve } from "vue";
|
|
5
|
+
import { resolveAppearance as Ge, getSchemaByType as ae, createPropsResolver as De } from "../dynamic-resolver/index.esm.js";
|
|
6
|
+
import { DgControl as v, canvasChanged as J, refreshCanvas as He, useDesignerComponent as Qe } from "../designer-canvas/index.esm.js";
|
|
7
|
+
import { useGuid as de, getMaxZIndex as _e, getCustomClass as Xe, getCustomStyle as he, FormSchemaEntityField$Type as ce, FormSchemaEntityFieldType$Type as Ze } from "../common/index.esm.js";
|
|
8
|
+
import { useConditionValue as Je, useConditionUtils as re, FConditionFields as ue, FConditionFieldsDesign as fe } from "../condition/index.esm.js";
|
|
9
|
+
import { useCondition as Ye, useSolutionUtils as ye } from "../query-solution/index.esm.js";
|
|
10
|
+
import { FNotifyService as Ke } from "../notify/index.esm.js";
|
|
11
|
+
import { LocaleService as oe } from "../locale/index.esm.js";
|
|
12
|
+
import { cloneDeep as Z, isPlainObject as pe } from "lodash-es";
|
|
13
|
+
import { FDynamicFormGroup as et, useTypeResolver as be } from "../dynamic-form/index.esm.js";
|
|
14
|
+
import { radioGroupProps as tt } from "../radio-group/index.esm.js";
|
|
15
|
+
import { useDataSource as it, FComboListContainer as nt } from "../combo-list/index.esm.js";
|
|
16
|
+
import { DgControl as rt } from "../designer-canvas/index.esm.js/";
|
|
17
|
+
const Ce = /* @__PURE__ */ new Map([
|
|
18
|
+
["appearance", Ge]
|
|
19
19
|
]);
|
|
20
|
-
function
|
|
21
|
-
const e =
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
20
|
+
function ot(t, i) {
|
|
21
|
+
const e = i == null ? void 0 : i.formSchemaUtils, n = t.parentComponentInstance, r = "54bddc89-5f7e-4b91-9c45-80dd6606cfe9";
|
|
22
|
+
function l() {
|
|
23
|
+
const u = ae(v["content-container"].type), f = ae(v["filter-bar"].type);
|
|
24
|
+
if (!u || !f)
|
|
25
25
|
return;
|
|
26
26
|
const o = Math.random().toString(36).substr(2, 4);
|
|
27
|
-
Object.assign(
|
|
27
|
+
Object.assign(u, {
|
|
28
28
|
id: "filter-container-" + o,
|
|
29
29
|
appearance: {
|
|
30
30
|
class: "f-filter-container"
|
|
31
31
|
},
|
|
32
|
-
contents: [
|
|
33
|
-
}), Object.assign(
|
|
32
|
+
contents: [f]
|
|
33
|
+
}), Object.assign(f, {
|
|
34
34
|
id: "filter-" + o,
|
|
35
35
|
fields: []
|
|
36
36
|
});
|
|
37
|
-
const
|
|
38
|
-
return
|
|
37
|
+
const c = n.belongedComponentId, g = e.getViewModelIdByComponentId(c), d = e.getViewModelById(g);
|
|
38
|
+
return d != null && d.states && (d.states.find((p) => p.code === "originalFilterConditionList") || d.states.push(
|
|
39
39
|
{
|
|
40
|
-
id:
|
|
40
|
+
id: de().guid(),
|
|
41
41
|
category: "locale",
|
|
42
42
|
code: "originalFilterConditionList",
|
|
43
43
|
name: "筛选条过滤条件",
|
|
44
44
|
type: "String"
|
|
45
45
|
}
|
|
46
|
-
)), { filterBar:
|
|
46
|
+
)), { filterBar: f, filterBarContainer: u };
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
48
|
+
function s() {
|
|
49
|
+
const u = e.getViewModelIdByComponentId(n.belongedComponentId), f = e.getViewModelById(u);
|
|
50
50
|
let o;
|
|
51
|
-
if (
|
|
52
|
-
if (o =
|
|
51
|
+
if (f && f.commands) {
|
|
52
|
+
if (o = f.commands.find((c) => c.handlerName === "Filter" && c.cmpId === r), !o)
|
|
53
53
|
o = {
|
|
54
|
-
id:
|
|
55
|
-
code: `${
|
|
54
|
+
id: de().guid(),
|
|
55
|
+
code: `${f.id.replace(/-/g, "").replace("component", "").replace("viewmodel", "")}Filter1`,
|
|
56
56
|
name: "过滤并加载数据1",
|
|
57
57
|
params: [
|
|
58
58
|
{
|
|
@@ -70,48 +70,48 @@ function it(i, t) {
|
|
|
70
70
|
],
|
|
71
71
|
handlerName: "Filter",
|
|
72
72
|
cmpId: r
|
|
73
|
-
},
|
|
73
|
+
}, f.commands.push(o);
|
|
74
74
|
else if (o.params && o.params.length) {
|
|
75
|
-
const
|
|
76
|
-
|
|
75
|
+
const c = o.params.find((g) => g.name === "filter");
|
|
76
|
+
c && (c.value = `{UISTATE~/#{${n.belongedComponentId}}/originalFilterConditionList}`);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
return { filterInGridViewModel: o };
|
|
80
80
|
}
|
|
81
|
-
function m(
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
81
|
+
function m(u) {
|
|
82
|
+
const f = e.getCommands();
|
|
83
|
+
if (!f)
|
|
84
84
|
return;
|
|
85
|
-
let o =
|
|
85
|
+
let o = f.find((c) => c.id === r);
|
|
86
86
|
o || (o = {
|
|
87
87
|
id: r,
|
|
88
88
|
path: "igix/Web/WebCmp/bo-webcmp/metadata/webcmd/data-commands",
|
|
89
89
|
name: "LoadCommands.webcmd",
|
|
90
90
|
refedHandlers: []
|
|
91
|
-
}, e.getCommands().push(o)),
|
|
91
|
+
}, e.getCommands().push(o)), u && !o.refedHandlers.find((c) => c.host === u.id) && o.refedHandlers.push(
|
|
92
92
|
{
|
|
93
|
-
host:
|
|
93
|
+
host: u.id,
|
|
94
94
|
handler: "Filter"
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
function a() {
|
|
99
|
-
const { filterBar:
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return
|
|
99
|
+
const { filterBar: u, filterBarContainer: f } = l(), { filterInGridViewModel: o } = s();
|
|
100
|
+
u && o && (u.onQuery = o.code), m(o);
|
|
101
|
+
const c = i == null ? void 0 : i.useFormCommand;
|
|
102
|
+
return c && c.checkCommands(), f;
|
|
103
103
|
}
|
|
104
104
|
return { createFilterBar: a };
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Fe(t, i, e, n) {
|
|
107
107
|
if (e.parentComponentInstance && n) {
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
return
|
|
108
|
+
const s = ot(e, n).createFilterBar();
|
|
109
|
+
if (s)
|
|
110
|
+
return s;
|
|
111
111
|
}
|
|
112
|
-
return
|
|
112
|
+
return i;
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const lt = "https://json-schema.org/draft/2020-12/schema", st = "https://farris-design.gitee.io/filter-bar.schema.json", at = "filter-bar", dt = "A Farris Component", ct = "object", ut = {
|
|
115
115
|
id: {
|
|
116
116
|
description: "The unique identifier for filter-bar",
|
|
117
117
|
type: "string"
|
|
@@ -154,22 +154,55 @@ const nt = "https://json-schema.org/draft/2020-12/schema", rt = "https://farris-
|
|
|
154
154
|
resetText: {
|
|
155
155
|
description: "",
|
|
156
156
|
type: "string"
|
|
157
|
+
},
|
|
158
|
+
filterText: {
|
|
159
|
+
description: "",
|
|
160
|
+
type: "string"
|
|
161
|
+
},
|
|
162
|
+
filterType: {
|
|
163
|
+
description: "",
|
|
164
|
+
type: "string",
|
|
165
|
+
default: "light"
|
|
166
|
+
},
|
|
167
|
+
tileShowType: {
|
|
168
|
+
description: "",
|
|
169
|
+
type: "string",
|
|
170
|
+
default: "multiline"
|
|
171
|
+
},
|
|
172
|
+
liveSearch: {
|
|
173
|
+
description: "",
|
|
174
|
+
type: "boolean",
|
|
175
|
+
default: !0
|
|
176
|
+
},
|
|
177
|
+
allInOneAlign: {
|
|
178
|
+
description: "",
|
|
179
|
+
type: "string",
|
|
180
|
+
default: "left"
|
|
181
|
+
},
|
|
182
|
+
lineLabelWidth: {
|
|
183
|
+
description: "",
|
|
184
|
+
type: "string",
|
|
185
|
+
default: "fixed"
|
|
186
|
+
},
|
|
187
|
+
itemClass: {
|
|
188
|
+
description: "",
|
|
189
|
+
type: "string"
|
|
157
190
|
}
|
|
158
|
-
},
|
|
191
|
+
}, ft = [
|
|
159
192
|
"id",
|
|
160
193
|
"type"
|
|
161
|
-
],
|
|
194
|
+
], pt = {
|
|
162
195
|
onQuery: "查询事件"
|
|
163
|
-
},
|
|
164
|
-
$schema:
|
|
165
|
-
$id:
|
|
166
|
-
title:
|
|
167
|
-
description:
|
|
168
|
-
type:
|
|
169
|
-
properties:
|
|
170
|
-
required:
|
|
171
|
-
events:
|
|
172
|
-
},
|
|
196
|
+
}, we = {
|
|
197
|
+
$schema: lt,
|
|
198
|
+
$id: st,
|
|
199
|
+
title: at,
|
|
200
|
+
description: dt,
|
|
201
|
+
type: ct,
|
|
202
|
+
properties: ut,
|
|
203
|
+
required: ft,
|
|
204
|
+
events: pt
|
|
205
|
+
}, le = {
|
|
173
206
|
/** 指定已设的筛选条件列表 */
|
|
174
207
|
defaultValues: {
|
|
175
208
|
type: Array,
|
|
@@ -185,134 +218,165 @@ const nt = "https://json-schema.org/draft/2020-12/schema", rt = "https://farris-
|
|
|
185
218
|
disabled: { type: Boolean, default: !1 },
|
|
186
219
|
/** 清空值文字 */
|
|
187
220
|
resetText: { type: String, default: "清空筛选" },
|
|
221
|
+
/** 筛选按钮文本 */
|
|
222
|
+
filterText: { type: String, default: "筛选" },
|
|
188
223
|
customClass: { type: String, default: "" },
|
|
189
|
-
customStyle: { type: String, default: "" }
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
224
|
+
customStyle: { type: String, default: "" },
|
|
225
|
+
// 筛选类型:轻量 | 平铺
|
|
226
|
+
filterType: { type: String, default: "light" },
|
|
227
|
+
// 平铺筛选的展示方式:单行展示、多行展示、所有在一行(会出现滚动条)
|
|
228
|
+
tileShowType: { type: String, default: "multiline" },
|
|
229
|
+
// 是否即时搜索
|
|
230
|
+
liveSearch: { type: Boolean, default: !0 },
|
|
231
|
+
// 是否左对齐--all-in-one时才生效
|
|
232
|
+
allInOneAlign: { type: String, default: "left" },
|
|
233
|
+
// 行展示方式下,标签是否自动宽度自动
|
|
234
|
+
lineLabelWidth: { type: String, default: "fixed" },
|
|
235
|
+
// 项的样式
|
|
236
|
+
itemClass: { type: String, default: "" }
|
|
237
|
+
}, mt = De(le, we, Ce, Fe);
|
|
238
|
+
function te() {
|
|
239
|
+
const { getLocaleValue: t } = oe;
|
|
193
240
|
return {
|
|
194
|
-
confirm:
|
|
195
|
-
cancel:
|
|
196
|
-
advancedFilter:
|
|
197
|
-
clearAll:
|
|
198
|
-
expand:
|
|
199
|
-
fold:
|
|
200
|
-
require:
|
|
241
|
+
confirm: t("filterBar.confirm"),
|
|
242
|
+
cancel: t("filterBar.cancel"),
|
|
243
|
+
advancedFilter: t("filterBar.advancedFilter"),
|
|
244
|
+
clearAll: t("filterBar.clearAll"),
|
|
245
|
+
expand: t("filterBar.expand"),
|
|
246
|
+
fold: t("filterBar.fold"),
|
|
247
|
+
require: t("filterBar.require")
|
|
201
248
|
};
|
|
202
249
|
}
|
|
203
|
-
function
|
|
204
|
-
return
|
|
250
|
+
function gt(t) {
|
|
251
|
+
return oe.getRealPropertyValue(t, "清空筛选", "filterBar.reset");
|
|
252
|
+
}
|
|
253
|
+
function vt(t) {
|
|
254
|
+
return oe.getRealPropertyValue(t, "筛选", "filterBar.filter");
|
|
205
255
|
}
|
|
206
|
-
function
|
|
207
|
-
const r =
|
|
208
|
-
|
|
209
|
-
const a = /* @__PURE__ */ new Map(), { createConditionValue:
|
|
210
|
-
let
|
|
211
|
-
function
|
|
212
|
-
return !
|
|
213
|
-
}
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
function
|
|
218
|
-
const P = Array.isArray(
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
return
|
|
256
|
+
function ht(t, i, e, n) {
|
|
257
|
+
const r = F([]), l = F([]), s = F([]), m = F("");
|
|
258
|
+
F(t.mode);
|
|
259
|
+
const a = /* @__PURE__ */ new Map(), { createConditionValue: u } = Je(), { convertToControls: f } = re("filter-bar"), o = Ye(t, i), { getFilterConditions: c } = o, { fieldToCondition: g, judgeLoadNewValue: d } = ye(), p = new Ke(), h = te();
|
|
260
|
+
let b = "[]";
|
|
261
|
+
function w(x) {
|
|
262
|
+
return !t.disabled && !x.value.isEmpty();
|
|
263
|
+
}
|
|
264
|
+
function O(x) {
|
|
265
|
+
l.value = f(x), l.value.reduce((P, C) => (P.set(C.labelCode, C), P), a);
|
|
266
|
+
}
|
|
267
|
+
function L(x) {
|
|
268
|
+
const P = Array.isArray(x) ? x : [];
|
|
269
|
+
s.value = l.value.map((C) => {
|
|
270
|
+
const B = P.find((S) => S.id === C.id);
|
|
271
|
+
if (B) {
|
|
272
|
+
const S = g(C, B.value);
|
|
273
|
+
return d(S, C) && S.value.clear(), S;
|
|
224
274
|
}
|
|
225
|
-
return
|
|
275
|
+
return g(C);
|
|
226
276
|
});
|
|
227
277
|
}
|
|
228
|
-
function T(
|
|
229
|
-
|
|
278
|
+
function T(x) {
|
|
279
|
+
s.value = s.value.filter((P) => P.id !== x.id), r.value = r.value.filter((P) => P.fieldCode !== x.fieldCode), l.value = l.value.filter((P) => P.id !== x.id), i.emit("remove", x.fieldCode);
|
|
230
280
|
}
|
|
231
|
-
function
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
var
|
|
235
|
-
return P.value && !((
|
|
281
|
+
function V() {
|
|
282
|
+
var x;
|
|
283
|
+
t.disabled ? e.value = !1 : t.filterType === "tile" ? e.value = !0 : e.value = ((x = s.value) == null ? void 0 : x.findIndex((P) => {
|
|
284
|
+
var C;
|
|
285
|
+
return P.value && !((C = P.value) != null && C.isEmpty());
|
|
236
286
|
})) > -1;
|
|
237
287
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
var E;
|
|
244
|
-
k();
|
|
245
|
-
const I = [];
|
|
246
|
-
(l.value || []).map((x) => {
|
|
247
|
-
x.required && (!x.value || x.value.isEmpty()) && I.push(x.fieldName || "");
|
|
248
|
-
});
|
|
249
|
-
const P = (E = l.value) == null ? void 0 : E.filter((x) => {
|
|
250
|
-
var $;
|
|
251
|
-
return x.value && !(($ = x.value) != null && $.isEmpty());
|
|
288
|
+
function A() {
|
|
289
|
+
var P;
|
|
290
|
+
const x = (P = s.value) == null ? void 0 : P.filter((C) => {
|
|
291
|
+
var B;
|
|
292
|
+
return C.value && !((B = C.value) != null && B.isEmpty());
|
|
252
293
|
});
|
|
253
|
-
|
|
254
|
-
|
|
294
|
+
return c(x, l.value);
|
|
295
|
+
}
|
|
296
|
+
function R(x = !0) {
|
|
297
|
+
const P = A(), C = JSON.stringify(P || []);
|
|
298
|
+
C !== b && (x && i.emit("conditionChange", P), b = C);
|
|
299
|
+
}
|
|
300
|
+
function k() {
|
|
301
|
+
console.log("====================进入查询方法==================================");
|
|
302
|
+
const x = [];
|
|
303
|
+
if ((s.value || []).map((P) => {
|
|
304
|
+
P.required && (!P.value || P.value.isEmpty()) && x.push(P.fieldName || "");
|
|
305
|
+
}), x.length > 0) {
|
|
306
|
+
p.warning({ message: h.require.replace("[fields]", x.join(",")), position: "top-center" });
|
|
255
307
|
return;
|
|
256
308
|
}
|
|
257
|
-
|
|
258
|
-
U(A, I);
|
|
309
|
+
i.emit("query", A());
|
|
259
310
|
}
|
|
260
|
-
function
|
|
261
|
-
|
|
311
|
+
function I(x, P, C = !0) {
|
|
312
|
+
O(x), L(P), V(), C && (R(), k());
|
|
262
313
|
}
|
|
263
|
-
function
|
|
264
|
-
|
|
314
|
+
function $(x) {
|
|
315
|
+
x.value.clear(), r.value = r.value.filter((P) => P.fieldCode !== x.fieldCode), i.emit("clear", x.fieldCode), V(), R(), t.liveSearch && k();
|
|
265
316
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
317
|
+
function N() {
|
|
318
|
+
s.value.forEach((x) => x.value.clear());
|
|
268
319
|
}
|
|
269
|
-
function
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}),
|
|
320
|
+
function U() {
|
|
321
|
+
s.value.forEach((x) => {
|
|
322
|
+
x.value.clear();
|
|
323
|
+
}), i.emit("reset"), V(), R(), t.liveSearch && k(), n.resizeFilerBar();
|
|
273
324
|
}
|
|
274
325
|
return {
|
|
275
|
-
clearAll:
|
|
276
|
-
clearFilterItem:
|
|
326
|
+
clearAll: N,
|
|
327
|
+
clearFilterItem: $,
|
|
277
328
|
currentFilterId: m,
|
|
278
|
-
filterFields:
|
|
279
|
-
filterItems:
|
|
329
|
+
filterFields: l,
|
|
330
|
+
filterItems: s,
|
|
280
331
|
fieldMap: a,
|
|
281
|
-
loadFilterItems:
|
|
332
|
+
loadFilterItems: I,
|
|
282
333
|
removeFilterItem: T,
|
|
283
|
-
reset:
|
|
284
|
-
shouldShowClearButtonInFilterItem:
|
|
285
|
-
handleQuery:
|
|
334
|
+
reset: U,
|
|
335
|
+
shouldShowClearButtonInFilterItem: w,
|
|
336
|
+
handleQuery: k,
|
|
337
|
+
updateResetButtonState: V,
|
|
338
|
+
handleConditionChange: R
|
|
286
339
|
};
|
|
287
340
|
}
|
|
288
|
-
function
|
|
289
|
-
const r =
|
|
290
|
-
clearAll:
|
|
291
|
-
reset:
|
|
341
|
+
function yt(t, i, e, n) {
|
|
342
|
+
const r = F([]), l = te(), s = F(l.advancedFilter), m = F(gt(t.resetText)), a = F(!1), {
|
|
343
|
+
clearAll: u,
|
|
344
|
+
reset: f,
|
|
292
345
|
filterItems: o
|
|
293
346
|
} = e;
|
|
294
|
-
function
|
|
347
|
+
function c() {
|
|
295
348
|
r.value = o.value.filter((h) => h.isExtend);
|
|
296
349
|
}
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
function
|
|
350
|
+
c();
|
|
351
|
+
const g = W(() => r.value && r.value.length > 0);
|
|
352
|
+
function d(h) {
|
|
300
353
|
a.value = !0;
|
|
301
354
|
}
|
|
302
355
|
function p(h) {
|
|
303
|
-
|
|
356
|
+
t.mode === "display-only" ? u() : f();
|
|
304
357
|
}
|
|
305
|
-
return () =>
|
|
306
|
-
class: "f-filter-toolbars"
|
|
307
|
-
|
|
358
|
+
return () => y("div", {
|
|
359
|
+
class: "f-filter-toolbars",
|
|
360
|
+
style: "flex-shrink:0;"
|
|
361
|
+
}, [t.filterType === "light" && g.value && y("button", {
|
|
308
362
|
class: "btn btn-link",
|
|
309
|
-
onClick: (h) =>
|
|
310
|
-
}, [
|
|
363
|
+
onClick: (h) => d()
|
|
364
|
+
}, [s.value]), t.filterType === "light" && n.value && y("button", {
|
|
311
365
|
class: "btn btn-link",
|
|
312
366
|
onClick: (h) => p()
|
|
313
|
-
}, [m.value])
|
|
367
|
+
}, [m.value]), t.filterType === "tile" && g.value && y("button", {
|
|
368
|
+
class: "btn btn-secondary filter-search-btn-reset",
|
|
369
|
+
onClick: (h) => d()
|
|
370
|
+
}, [y("span", {
|
|
371
|
+
class: "f-icon f-icon-filtrate"
|
|
372
|
+
}, null)]), t.filterType === "tile" && !t.liveSearch && y("button", {
|
|
373
|
+
class: "btn btn-secondary filter-search-btn-reset",
|
|
374
|
+
onClick: (h) => p()
|
|
375
|
+
}, [y("span", {
|
|
376
|
+
class: "f-icon f-icon-remove"
|
|
377
|
+
}, null)])]);
|
|
314
378
|
}
|
|
315
|
-
const
|
|
379
|
+
const bt = {
|
|
316
380
|
filterItem: { type: Object, default: null },
|
|
317
381
|
position: { type: Object, default: null },
|
|
318
382
|
/**
|
|
@@ -321,457 +385,507 @@ const gt = {
|
|
|
321
385
|
reference: {
|
|
322
386
|
type: Object
|
|
323
387
|
}
|
|
324
|
-
},
|
|
388
|
+
}, Ct = Object.assign({}, tt), Ft = /* @__PURE__ */ Q({
|
|
325
389
|
name: "FFilterRadioGroup",
|
|
326
|
-
props:
|
|
390
|
+
props: Ct,
|
|
327
391
|
emits: ["update:modelValue", "change"],
|
|
328
|
-
setup(
|
|
329
|
-
const e =
|
|
392
|
+
setup(t, i) {
|
|
393
|
+
const e = F(), {
|
|
330
394
|
dataSource: n,
|
|
331
395
|
displayText: r,
|
|
332
|
-
modelValue:
|
|
333
|
-
} =
|
|
334
|
-
function
|
|
335
|
-
r.value = m.map((
|
|
396
|
+
modelValue: l
|
|
397
|
+
} = it(t);
|
|
398
|
+
function s(m) {
|
|
399
|
+
r.value = m.map((u) => u[t.textField]).join(t.separator);
|
|
336
400
|
let a = "";
|
|
337
|
-
m.length === 1 ? a = m[0][
|
|
401
|
+
m.length === 1 ? a = m[0][t.valueField] : a = m.map((u) => u[t.valueField]).join(t.separator), l.value !== a && (l.value = a, i.emit("update:modelValue", l.value), i.emit("change", l.value));
|
|
338
402
|
}
|
|
339
|
-
return () =>
|
|
403
|
+
return () => y(nt, {
|
|
340
404
|
style: "margin: -2px -15px;padding: 0;",
|
|
341
405
|
ref: e,
|
|
342
|
-
idField:
|
|
343
|
-
valueField:
|
|
344
|
-
textField:
|
|
345
|
-
titleField:
|
|
406
|
+
idField: t.valueField,
|
|
407
|
+
valueField: t.valueField,
|
|
408
|
+
textField: t.textField,
|
|
409
|
+
titleField: t.titleField,
|
|
346
410
|
dataSource: n.value,
|
|
347
|
-
selectedValues:
|
|
411
|
+
selectedValues: l.value,
|
|
348
412
|
multiSelect: !1,
|
|
349
413
|
enableSearch: !1,
|
|
350
414
|
onSelectionChange: (m) => {
|
|
351
|
-
|
|
415
|
+
s(m);
|
|
352
416
|
}
|
|
353
417
|
}, null);
|
|
354
418
|
}
|
|
355
|
-
}),
|
|
419
|
+
}), wt = /* @__PURE__ */ Q({
|
|
356
420
|
name: "FFilterBarItemCondition",
|
|
357
|
-
props:
|
|
421
|
+
props: bt,
|
|
358
422
|
emits: ["cancel", "confirm", "clearFilter"],
|
|
359
|
-
setup(
|
|
360
|
-
const e =
|
|
423
|
+
setup(t, i) {
|
|
424
|
+
const e = F(Z(t.filterItem)), n = F(), r = te(), l = F("0px"), s = F("0px"), m = F("0px"), a = F("auto"), u = W(() => ({
|
|
361
425
|
left: a.value === "auto" ? "26px" : "auto",
|
|
362
426
|
right: a.value
|
|
363
|
-
})),
|
|
364
|
-
left:
|
|
365
|
-
top:
|
|
366
|
-
})), o =
|
|
427
|
+
})), f = W(() => ({
|
|
428
|
+
left: l.value,
|
|
429
|
+
top: s.value
|
|
430
|
+
})), o = W(() => ({
|
|
367
431
|
width: m.value === "0px" ? null : m.value,
|
|
368
432
|
maxWidth: m.value === "0px" ? null : m.value
|
|
369
|
-
})),
|
|
370
|
-
useFilterItemsComposition:
|
|
371
|
-
resolveEditorProps:
|
|
372
|
-
} =
|
|
433
|
+
})), c = F(), {
|
|
434
|
+
useFilterItemsComposition: g,
|
|
435
|
+
resolveEditorProps: d
|
|
436
|
+
} = X("useFilterItemsComposition"), {
|
|
373
437
|
fieldMap: p
|
|
374
|
-
} =
|
|
438
|
+
} = g, {
|
|
375
439
|
renderFieldConditionEditor: h,
|
|
376
|
-
conditionChangeHandler:
|
|
377
|
-
} =
|
|
378
|
-
let
|
|
379
|
-
const T =
|
|
380
|
-
function
|
|
381
|
-
var q,
|
|
382
|
-
if (!
|
|
440
|
+
conditionChangeHandler: b
|
|
441
|
+
} = re("filter-bar"), w = F("");
|
|
442
|
+
let O = !1, L = {};
|
|
443
|
+
const T = F(!0);
|
|
444
|
+
function V() {
|
|
445
|
+
var q, G;
|
|
446
|
+
if (!t.reference || !c.value)
|
|
383
447
|
return;
|
|
384
|
-
const
|
|
385
|
-
let
|
|
386
|
-
const
|
|
387
|
-
|
|
448
|
+
const C = (q = t.reference) == null ? void 0 : q.getBoundingClientRect();
|
|
449
|
+
let B = (G = c.value) == null ? void 0 : G.getBoundingClientRect().width;
|
|
450
|
+
const S = document.body.clientWidth - C.x - 30, M = document.body.clientWidth - C.y - 30;
|
|
451
|
+
B > S && B > M && (B = Math.max(S, M)), C.left > document.body.clientWidth - B - 20 ? (l.value = C.left + C.width - B + "px", s.value = C.top + C.height + "px", a.value = "26px") : (l.value = C.left + "px", s.value = C.top + C.height + "px", a.value = "auto"), m.value = B + "px";
|
|
388
452
|
}
|
|
389
|
-
function
|
|
390
|
-
|
|
391
|
-
value:
|
|
392
|
-
editor:
|
|
393
|
-
option:
|
|
453
|
+
function A(C, B, S, M) {
|
|
454
|
+
O = !0, L = {
|
|
455
|
+
value: B,
|
|
456
|
+
editor: S,
|
|
457
|
+
option: M
|
|
394
458
|
};
|
|
395
459
|
}
|
|
396
|
-
function
|
|
460
|
+
function R() {
|
|
397
461
|
if (!n.value)
|
|
398
462
|
return !1;
|
|
399
|
-
const
|
|
400
|
-
return
|
|
463
|
+
const C = n.value.parentElement, B = Array.from(C.children);
|
|
464
|
+
return B ? !!B.find((M) => !M || !M.classList ? !1 : M.classList.contains("popover") && M.style.visibility === "visible") : !1;
|
|
401
465
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
466
|
+
function k(C, B, S, M) {
|
|
467
|
+
b(C, B, S, M), i.emit("confirm", e.value);
|
|
404
468
|
}
|
|
405
|
-
function
|
|
469
|
+
function I() {
|
|
406
470
|
const {
|
|
407
|
-
id:
|
|
408
|
-
editor:
|
|
409
|
-
needEmitChange:
|
|
410
|
-
} = h(p, e.value,
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
return T.value = !1,
|
|
471
|
+
id: C,
|
|
472
|
+
editor: B,
|
|
473
|
+
needEmitChange: S
|
|
474
|
+
} = h(p, e.value, A);
|
|
475
|
+
if (w.value = "filter-panel--" + B.type, B.type === "radio-group") {
|
|
476
|
+
const M = d(B.type, B);
|
|
477
|
+
return T.value = !1, y(Ft, je(M, {
|
|
414
478
|
modelValue: e.value.value.value,
|
|
415
479
|
"onUpdate:modelValue": (q) => e.value.value.value = q,
|
|
416
480
|
onChange: (q) => {
|
|
417
|
-
|
|
481
|
+
k(e.value, q, B);
|
|
418
482
|
}
|
|
419
483
|
}), {
|
|
420
|
-
default: () => [
|
|
484
|
+
default: () => [j(" ")]
|
|
421
485
|
});
|
|
422
486
|
}
|
|
423
|
-
return
|
|
487
|
+
return y(et, {
|
|
424
488
|
showLabelType: "force-none",
|
|
425
|
-
id:
|
|
426
|
-
key:
|
|
427
|
-
editor:
|
|
489
|
+
id: C,
|
|
490
|
+
key: C,
|
|
491
|
+
editor: B,
|
|
428
492
|
modelValue: e.value.value.value,
|
|
429
|
-
"onUpdate:modelValue": (
|
|
430
|
-
onChange: (
|
|
431
|
-
|
|
493
|
+
"onUpdate:modelValue": (M) => e.value.value.value = M,
|
|
494
|
+
onChange: (M, q) => {
|
|
495
|
+
S && A(e.value, M, B, q);
|
|
432
496
|
}
|
|
433
497
|
}, null);
|
|
434
498
|
}
|
|
435
|
-
|
|
436
|
-
|
|
499
|
+
ee(() => {
|
|
500
|
+
V();
|
|
437
501
|
});
|
|
438
|
-
function
|
|
439
|
-
const
|
|
440
|
-
["input", "radio-group", "switch"].findIndex((
|
|
502
|
+
function $(C) {
|
|
503
|
+
const B = w.value.replace("filter-panel--", "");
|
|
504
|
+
["input", "radio-group", "switch"].findIndex((S) => S === B) > -1 ? i.emit("cancel") : R() || i.emit("cancel");
|
|
441
505
|
}
|
|
442
|
-
function
|
|
443
|
-
|
|
506
|
+
function N(C) {
|
|
507
|
+
C.stopPropagation(), O && b(e.value, L.value, L.editor, L.option), i.emit("confirm", e.value);
|
|
444
508
|
}
|
|
445
|
-
function
|
|
446
|
-
e.value.value.clear(),
|
|
509
|
+
function U(C) {
|
|
510
|
+
e.value.value.clear(), C.stopPropagation(), i.emit("confirm", e.value);
|
|
447
511
|
}
|
|
448
|
-
function
|
|
449
|
-
const
|
|
512
|
+
function x() {
|
|
513
|
+
const C = _e();
|
|
450
514
|
return {
|
|
451
|
-
zIndex: Math.max(
|
|
515
|
+
zIndex: Math.max(C, 1050)
|
|
452
516
|
};
|
|
453
517
|
}
|
|
454
|
-
const
|
|
455
|
-
return () =>
|
|
518
|
+
const P = x();
|
|
519
|
+
return () => y("div", {
|
|
456
520
|
class: "f-filter-panel-wrapper can-close",
|
|
457
521
|
ref: n,
|
|
458
|
-
onClick:
|
|
522
|
+
onClick: $,
|
|
459
523
|
style: {
|
|
460
|
-
zIndex:
|
|
524
|
+
zIndex: P
|
|
461
525
|
}
|
|
462
|
-
}, [
|
|
463
|
-
class: "f-filter-panel " +
|
|
464
|
-
ref:
|
|
465
|
-
style:
|
|
466
|
-
}, [
|
|
526
|
+
}, [y("div", {
|
|
527
|
+
class: "f-filter-panel " + w.value,
|
|
528
|
+
ref: c,
|
|
529
|
+
style: f.value
|
|
530
|
+
}, [y("div", {
|
|
467
531
|
class: "f-filter-panel-inner",
|
|
468
532
|
style: o.value,
|
|
469
|
-
onClick: (
|
|
470
|
-
}, [
|
|
533
|
+
onClick: (C) => C.stopPropagation()
|
|
534
|
+
}, [y("div", {
|
|
471
535
|
class: "f-filter-panel-arrow",
|
|
472
|
-
style:
|
|
473
|
-
}, null),
|
|
536
|
+
style: u.value
|
|
537
|
+
}, null), I(), T.value && y("div", {
|
|
474
538
|
class: "f-filter-panel-footer"
|
|
475
|
-
}, [
|
|
539
|
+
}, [y("div", {
|
|
476
540
|
class: "filter-panel-clear"
|
|
477
|
-
}, [
|
|
541
|
+
}, [y("button", {
|
|
478
542
|
class: "btn btn-link",
|
|
479
|
-
onClick:
|
|
543
|
+
onClick: U,
|
|
480
544
|
style: "padding-left:0;"
|
|
481
|
-
}, [r.clearAll])]),
|
|
545
|
+
}, [r.clearAll])]), y("div", {
|
|
482
546
|
class: "filter-panel-btns"
|
|
483
|
-
}, [
|
|
547
|
+
}, [y("button", {
|
|
484
548
|
class: "btn btn-secondary can-close",
|
|
485
|
-
onClick:
|
|
486
|
-
}, [r.cancel]),
|
|
549
|
+
onClick: $
|
|
550
|
+
}, [r.cancel]), y("button", {
|
|
487
551
|
class: "filter-panel-submit btn btn-primary",
|
|
488
|
-
onClick:
|
|
552
|
+
onClick: N
|
|
489
553
|
}, [r.confirm])])])])])]);
|
|
490
554
|
}
|
|
491
|
-
}),
|
|
555
|
+
}), xe = {
|
|
492
556
|
filterItem: { type: Object, default: null },
|
|
493
|
-
disabled: { type: Boolean, default: !1 }
|
|
494
|
-
|
|
557
|
+
disabled: { type: Boolean, default: !1 },
|
|
558
|
+
customClass: { type: String, default: "" }
|
|
559
|
+
}, xt = /* @__PURE__ */ Q({
|
|
495
560
|
name: "FFilterBarItem",
|
|
496
|
-
props:
|
|
561
|
+
props: xe,
|
|
497
562
|
emits: ["confirm"],
|
|
498
|
-
setup(
|
|
499
|
-
const e =
|
|
563
|
+
setup(t, i) {
|
|
564
|
+
const e = F(t.filterItem), {
|
|
500
565
|
useFilterItemsComposition: n
|
|
501
|
-
} =
|
|
566
|
+
} = X("useFilterItemsComposition"), {
|
|
502
567
|
clearFilterItem: r,
|
|
503
|
-
currentFilterId:
|
|
504
|
-
removeFilterItem:
|
|
568
|
+
currentFilterId: l,
|
|
569
|
+
removeFilterItem: s,
|
|
505
570
|
shouldShowClearButtonInFilterItem: m
|
|
506
|
-
} = n, a =
|
|
507
|
-
|
|
571
|
+
} = n, a = F(!1), u = F(!1), f = F(), o = F(""), c = F(), g = function() {
|
|
572
|
+
const T = {
|
|
508
573
|
"f-filter-item": !0,
|
|
509
|
-
"f-state-disabled":
|
|
574
|
+
"f-state-disabled": t.disabled,
|
|
510
575
|
"f-filter-item-actived": !e.value.value.isEmpty(),
|
|
511
576
|
// 'f-filter-item-last': index === filterItems.value.length - 1,
|
|
512
|
-
"f-filter-item-edit": e.value.id ===
|
|
577
|
+
"f-filter-item-edit": e.value.id === l.value || a.value
|
|
513
578
|
};
|
|
579
|
+
return Xe(T, t.customClass);
|
|
514
580
|
};
|
|
515
|
-
|
|
516
|
-
function
|
|
517
|
-
|
|
581
|
+
W(() => !t.disabled && t.mode === "editable");
|
|
582
|
+
function d(T) {
|
|
583
|
+
t.disabled || (t.mode === "display-only" ? s(e.value) : r(e.value));
|
|
518
584
|
}
|
|
519
585
|
function p(T) {
|
|
520
|
-
|
|
586
|
+
t.disabled || (a.value = !0);
|
|
521
587
|
}
|
|
522
588
|
function h() {
|
|
523
589
|
a.value = !1;
|
|
524
590
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
591
|
+
function b() {
|
|
592
|
+
c.value && c.value.scrollWidth > c.value.clientWidth ? o.value = c.value.innerHTML : o.value = "";
|
|
527
593
|
}
|
|
528
|
-
function
|
|
529
|
-
a.value = !1, e.value.value = T.value,
|
|
530
|
-
|
|
594
|
+
function w(T) {
|
|
595
|
+
a.value = !1, e.value.value = T.value, i.emit("confirm", T), ne(() => {
|
|
596
|
+
b();
|
|
531
597
|
});
|
|
532
598
|
}
|
|
533
|
-
function
|
|
534
|
-
|
|
599
|
+
function O() {
|
|
600
|
+
u.value = t.disabled ? !1 : m(e.value);
|
|
535
601
|
}
|
|
536
|
-
function
|
|
537
|
-
|
|
602
|
+
function L() {
|
|
603
|
+
u.value = !1;
|
|
538
604
|
}
|
|
539
|
-
return
|
|
540
|
-
|
|
541
|
-
}), () =>
|
|
605
|
+
return ee(() => {
|
|
606
|
+
b();
|
|
607
|
+
}), () => y("div", {
|
|
542
608
|
key: e.value.id,
|
|
543
609
|
id: e.value.id,
|
|
544
|
-
class:
|
|
545
|
-
onMouseenter: () =>
|
|
546
|
-
onMouseleave: () =>
|
|
547
|
-
}, [
|
|
610
|
+
class: g(),
|
|
611
|
+
onMouseenter: () => O(),
|
|
612
|
+
onMouseleave: () => L()
|
|
613
|
+
}, [y("div", {
|
|
548
614
|
class: "f-filter-item-inner",
|
|
549
|
-
ref:
|
|
615
|
+
ref: f,
|
|
550
616
|
onClick: (T) => p()
|
|
551
|
-
}, [e.value.required &&
|
|
617
|
+
}, [e.value.required && y("span", {
|
|
552
618
|
class: "f-filter-item-required text-danger"
|
|
553
|
-
}, [
|
|
619
|
+
}, [j("*")]), y("span", {
|
|
554
620
|
class: "f-filter-item-text"
|
|
555
|
-
}, [e.value.fieldName]), !e.value.value.isEmpty() &&
|
|
621
|
+
}, [e.value.fieldName]), !e.value.value.isEmpty() && y(ie, null, [y("span", {
|
|
556
622
|
class: "f-filter-item-tip"
|
|
557
|
-
}, [
|
|
623
|
+
}, [j(":")]), y("span", {
|
|
558
624
|
class: "f-filter-item-content",
|
|
559
|
-
ref:
|
|
625
|
+
ref: c,
|
|
560
626
|
title: o.value
|
|
561
|
-
}, [e.value.value.getDisplayText()])]), !
|
|
627
|
+
}, [e.value.value.getDisplayText()])]), !t.disabled && y("span", {
|
|
562
628
|
class: "f-filter-item-arrow f-icon f-icon-arrow-chevron-down"
|
|
563
|
-
}, null)]),
|
|
629
|
+
}, null)]), u.value && y("span", {
|
|
564
630
|
class: "mr-3 f-filter-item-clear",
|
|
565
|
-
onClick: (T) =>
|
|
566
|
-
}, [
|
|
631
|
+
onClick: (T) => d()
|
|
632
|
+
}, [y("span", {
|
|
567
633
|
class: "f-icon f-icon-close-circle"
|
|
568
|
-
}, null)]), a.value &&
|
|
634
|
+
}, null)]), a.value && y(ze, {
|
|
569
635
|
to: "body"
|
|
570
636
|
}, {
|
|
571
|
-
default: () => [
|
|
637
|
+
default: () => [y(wt, {
|
|
572
638
|
filterItem: e.value,
|
|
573
|
-
reference:
|
|
574
|
-
onConfirm:
|
|
639
|
+
reference: f.value,
|
|
640
|
+
onConfirm: w,
|
|
575
641
|
onCancel: h
|
|
576
642
|
}, null)]
|
|
577
643
|
})]);
|
|
578
644
|
}
|
|
579
645
|
});
|
|
580
|
-
function
|
|
581
|
-
const e =
|
|
646
|
+
function Ie(t, i) {
|
|
647
|
+
const e = F(null), n = 15;
|
|
582
648
|
let r = 0;
|
|
583
|
-
function
|
|
584
|
-
var
|
|
585
|
-
if (!
|
|
649
|
+
function l(a = -1, u = -1) {
|
|
650
|
+
var d;
|
|
651
|
+
if (!t.value)
|
|
586
652
|
return;
|
|
587
|
-
const
|
|
588
|
-
if (!
|
|
653
|
+
const f = (d = t.value) == null ? void 0 : d.querySelector(".f-filter-list");
|
|
654
|
+
if (!f)
|
|
589
655
|
return;
|
|
590
|
-
const o =
|
|
591
|
-
if (!o || o.length === 0 || (a < 0 && (a =
|
|
656
|
+
const o = f.children;
|
|
657
|
+
if (!o || o.length === 0 || (a < 0 && (a = t.value.clientWidth), r = u < 0 ? r : u, Math.abs(a - r) < n))
|
|
592
658
|
return;
|
|
593
659
|
Array.from(o).forEach((p) => {
|
|
594
660
|
p.style.display = "flex";
|
|
595
|
-
}),
|
|
596
|
-
let
|
|
661
|
+
}), i.value = f.clientWidth < f.scrollWidth;
|
|
662
|
+
let c = !1, g = 0;
|
|
597
663
|
for (let p = 0; p < o.length; p++) {
|
|
598
|
-
const h = o[p],
|
|
599
|
-
!
|
|
664
|
+
const h = o[p], b = Math.ceil(h.offsetWidth + (parseFloat(getComputedStyle(h).marginRight) || 0) + parseFloat(getComputedStyle(h).marginLeft));
|
|
665
|
+
!c && g + b <= a ? g += b : (h.style.display = "none", c = !0);
|
|
600
666
|
}
|
|
601
667
|
r = a;
|
|
602
668
|
}
|
|
603
|
-
function
|
|
604
|
-
var
|
|
605
|
-
if (!
|
|
669
|
+
function s() {
|
|
670
|
+
var u, f;
|
|
671
|
+
if (!t.value)
|
|
606
672
|
return;
|
|
607
|
-
(
|
|
608
|
-
const a = ((
|
|
673
|
+
(u = e.value) == null || u.unobserve(t.value);
|
|
674
|
+
const a = ((f = t.value.querySelector(".f-filter-list")) == null ? void 0 : f.children) || [];
|
|
609
675
|
Array.from(a).forEach((o) => {
|
|
610
676
|
o.style.display = "flex";
|
|
611
677
|
}), r = 0;
|
|
612
678
|
}
|
|
613
679
|
function m() {
|
|
614
|
-
if (!
|
|
680
|
+
if (!t.value)
|
|
615
681
|
return;
|
|
616
|
-
const a = new ResizeObserver((
|
|
617
|
-
const
|
|
618
|
-
|
|
682
|
+
const a = new ResizeObserver((u) => {
|
|
683
|
+
const f = u[0].contentRect.width;
|
|
684
|
+
l(f);
|
|
619
685
|
});
|
|
620
|
-
return a.observe(
|
|
686
|
+
return a.observe(t.value), e.value = a, a;
|
|
621
687
|
}
|
|
622
688
|
return {
|
|
623
689
|
setupWidthObserver: m,
|
|
624
|
-
cancelWidthObserver:
|
|
625
|
-
handleVisibleChildren:
|
|
690
|
+
cancelWidthObserver: s,
|
|
691
|
+
handleVisibleChildren: l
|
|
626
692
|
};
|
|
627
693
|
}
|
|
628
|
-
const
|
|
694
|
+
const H = /* @__PURE__ */ Q({
|
|
629
695
|
name: "FFilterBar",
|
|
630
|
-
props:
|
|
696
|
+
props: le,
|
|
631
697
|
emits: ["clear", "remove", "reset", "conditionChange", "change", "query"],
|
|
632
|
-
setup(
|
|
633
|
-
const e =
|
|
634
|
-
cancelWidthObserver:
|
|
635
|
-
setupWidthObserver:
|
|
636
|
-
handleVisibleChildren:
|
|
637
|
-
} =
|
|
698
|
+
setup(t, i) {
|
|
699
|
+
const e = F(!1), n = F(!1), r = F(null), l = F(!1), s = F(vt(t.filterText)), m = F(0), a = Ie(r, n), {
|
|
700
|
+
cancelWidthObserver: u,
|
|
701
|
+
setupWidthObserver: f,
|
|
702
|
+
handleVisibleChildren: o
|
|
703
|
+
} = a, c = {
|
|
638
704
|
resizeFilerBar: () => {
|
|
639
|
-
e.value ||
|
|
640
|
-
|
|
705
|
+
e.value || ne(() => {
|
|
706
|
+
o(-1, 0);
|
|
641
707
|
});
|
|
642
708
|
}
|
|
643
|
-
},
|
|
644
|
-
filterFields:
|
|
645
|
-
filterItems:
|
|
646
|
-
loadFilterItems:
|
|
647
|
-
handleQuery:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
} =
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
709
|
+
}, g = ht(t, i, l, c), {
|
|
710
|
+
filterFields: d,
|
|
711
|
+
filterItems: p,
|
|
712
|
+
loadFilterItems: h,
|
|
713
|
+
handleQuery: b,
|
|
714
|
+
updateResetButtonState: w,
|
|
715
|
+
handleConditionChange: O
|
|
716
|
+
} = g, {
|
|
717
|
+
resolveEditorProps: L
|
|
718
|
+
} = be();
|
|
719
|
+
me("useFilterItemsComposition", {
|
|
720
|
+
useFilterItemsComposition: g,
|
|
721
|
+
resolveEditorProps: L
|
|
654
722
|
});
|
|
655
|
-
const
|
|
656
|
-
const
|
|
657
|
-
display:
|
|
723
|
+
const T = te(), V = W(() => {
|
|
724
|
+
const S = {
|
|
725
|
+
display: t.filterType === "tile" || d.value && d.value.length ? "" : "none"
|
|
658
726
|
};
|
|
659
|
-
return
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}),
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
727
|
+
return he(S, t == null ? void 0 : t.customStyle);
|
|
728
|
+
}), A = F();
|
|
729
|
+
h(t.fields, t.defaultValues, !!(t.defaultValues && t.defaultValues.length > 0)), ge([() => t.defaultValues, () => t.fields], ([S, M]) => {
|
|
730
|
+
h(M, S), m.value++, c.resizeFilerBar();
|
|
731
|
+
}), ee(() => {
|
|
732
|
+
if (f(), t.filterType === "tile" && t.tileShowType === "all-in-one") {
|
|
733
|
+
const S = A.value.querySelector(".condition-div");
|
|
734
|
+
S.scrollWidth > S.clientWidth && (A.value.className = A.value.className + " all-in-one--item-fill");
|
|
735
|
+
}
|
|
736
|
+
}), ve(() => {
|
|
737
|
+
u();
|
|
667
738
|
});
|
|
668
|
-
const
|
|
739
|
+
const R = W(() => ({
|
|
669
740
|
"f-filter-list": !0,
|
|
670
741
|
"f-filter-list-extend": e.value
|
|
671
742
|
// 'f-utils-overflow-hidden': true
|
|
672
|
-
})),
|
|
743
|
+
})), k = W(() => ({
|
|
673
744
|
"extend-btn-arrow": !0,
|
|
674
745
|
"f-icon": !0,
|
|
675
746
|
"f-icon-arrow-chevron-up": e.value,
|
|
676
747
|
"f-icon-arrow-chevron-down": !e.value
|
|
677
|
-
})),
|
|
678
|
-
function
|
|
679
|
-
e.value = !e.value, e.value ?
|
|
748
|
+
})), I = W(() => !e.value && n.value);
|
|
749
|
+
function $() {
|
|
750
|
+
e.value = !e.value, e.value ? u() : f();
|
|
680
751
|
}
|
|
681
|
-
const N =
|
|
682
|
-
function M
|
|
683
|
-
|
|
752
|
+
const N = yt(t, i, g, l);
|
|
753
|
+
function U(S, M = !0) {
|
|
754
|
+
i.emit("change", S), M && w(), O(), t.liveSearch && b(), M && c.resizeFilerBar();
|
|
684
755
|
}
|
|
685
|
-
function
|
|
686
|
-
return
|
|
687
|
-
class:
|
|
688
|
-
key:
|
|
689
|
-
}, [
|
|
690
|
-
filterItem:
|
|
691
|
-
onConfirm:
|
|
692
|
-
disabled:
|
|
756
|
+
function x() {
|
|
757
|
+
return y("div", {
|
|
758
|
+
class: R.value,
|
|
759
|
+
key: t.id + "-main-" + m.value
|
|
760
|
+
}, [p.value.map((S, M) => !S.isExtend && y(xt, {
|
|
761
|
+
filterItem: S,
|
|
762
|
+
onConfirm: U,
|
|
763
|
+
disabled: t.disabled || S.disabled
|
|
693
764
|
}, null)), e.value && N()]);
|
|
694
765
|
}
|
|
695
|
-
function
|
|
696
|
-
return
|
|
766
|
+
function P() {
|
|
767
|
+
return I.value && y("div", {
|
|
697
768
|
class: "f-filter-list-ellipsis",
|
|
698
|
-
onClick: (
|
|
699
|
-
}, [
|
|
769
|
+
onClick: (S) => $()
|
|
770
|
+
}, [j("...")]);
|
|
771
|
+
}
|
|
772
|
+
function C() {
|
|
773
|
+
O(), b();
|
|
774
|
+
}
|
|
775
|
+
function B() {
|
|
776
|
+
let S = "", M;
|
|
777
|
+
t.tileShowType !== "all-in-one" && (S = t.lineLabelWidth === "auto" ? " filter-item-wrap" : "", M = t.tileShowType === "single" ? "col-12" + S : S ? "col-12 col-md-6 col-xl-3 col-el-2" + S : void 0);
|
|
778
|
+
const q = t.tileShowType === "multiline";
|
|
779
|
+
return y("div", {
|
|
780
|
+
class: "f-list-filter d-flex list-filter--" + t.tileShowType + t.customClass,
|
|
781
|
+
style: V.value
|
|
782
|
+
}, [t.tileShowType !== "all-in-one" && y("div", {
|
|
783
|
+
class: "flex-fill"
|
|
784
|
+
}, [y(ue, {
|
|
785
|
+
fields: d.value,
|
|
786
|
+
conditions: p.value,
|
|
787
|
+
itemClass: M,
|
|
788
|
+
autoResponse: q,
|
|
789
|
+
onValueChange: (G, _) => U(_)
|
|
790
|
+
}, null), j(" ")]), t.tileShowType === "all-in-one" && y("div", {
|
|
791
|
+
class: "filter-inputs-main-basis-wrapper" + t.customClass,
|
|
792
|
+
ref: A,
|
|
793
|
+
style: V.value
|
|
794
|
+
}, [y(ue, {
|
|
795
|
+
style: "flex-wrap:nowrap!important;overflow-x:auto;",
|
|
796
|
+
fields: d.value,
|
|
797
|
+
customClass: t.allInOneAlign === "right" ? "justify-content-end" : "",
|
|
798
|
+
conditions: p.value,
|
|
799
|
+
itemClass: "filter-input-list filter-item-wrap",
|
|
800
|
+
autoResponse: !1,
|
|
801
|
+
onValueChange: (G, _) => U(_)
|
|
802
|
+
}, null)]), !t.liveSearch && y("div", {
|
|
803
|
+
class: "filter-search-btn filter-search-btn--filter",
|
|
804
|
+
onClick: C
|
|
805
|
+
}, [y("button", {
|
|
806
|
+
class: "btn btn-primary"
|
|
807
|
+
}, [s.value])]), N()]);
|
|
700
808
|
}
|
|
701
|
-
return () =>
|
|
702
|
-
class: "f-filter-wrapper " +
|
|
809
|
+
return () => t.filterType === "light" ? y("div", {
|
|
810
|
+
class: "f-filter-wrapper " + t.customClass,
|
|
703
811
|
style: V.value
|
|
704
|
-
}, [
|
|
812
|
+
}, [y("div", {
|
|
705
813
|
class: "f-filter-wrapper-inner f-utils-fill"
|
|
706
|
-
}, [
|
|
814
|
+
}, [y("div", {
|
|
707
815
|
class: "f-filter-main f-utils-fill"
|
|
708
|
-
}, [
|
|
816
|
+
}, [y("div", {
|
|
709
817
|
class: "f-filter-list-wrapper flex-fill",
|
|
710
818
|
ref: r
|
|
711
|
-
}, [
|
|
819
|
+
}, [x()]), P(), !e.value && N()]), !t.liveSearch && y("div", {
|
|
820
|
+
class: "filter-search-btn filter-search-btn--filter",
|
|
821
|
+
style: "margin:0 8px 0 0;",
|
|
822
|
+
onClick: C
|
|
823
|
+
}, [y("button", {
|
|
824
|
+
class: "btn btn-primary"
|
|
825
|
+
}, [s.value])]), n.value && y("div", {
|
|
712
826
|
class: "f-filter-extend-btn"
|
|
713
|
-
}, [
|
|
827
|
+
}, [y("button", {
|
|
714
828
|
class: "btn btn-link",
|
|
715
|
-
onClick:
|
|
716
|
-
}, [
|
|
829
|
+
onClick: $
|
|
830
|
+
}, [y("span", {
|
|
717
831
|
class: "extend-btn-text"
|
|
718
|
-
}, [e.value ?
|
|
719
|
-
class:
|
|
720
|
-
}, null)])])])]);
|
|
832
|
+
}, [e.value ? T.fold : T.expand]), y("span", {
|
|
833
|
+
class: k.value
|
|
834
|
+
}, null)])])])]) : B();
|
|
721
835
|
}
|
|
722
836
|
});
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
const e =
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
function a(
|
|
729
|
-
return !
|
|
837
|
+
function It(t, i) {
|
|
838
|
+
F([]);
|
|
839
|
+
const e = F([]), n = F([]), r = F("");
|
|
840
|
+
F(!1), F(t.mode);
|
|
841
|
+
const l = /* @__PURE__ */ new Map(), { convertToControls: s } = re("filter-bar"), { fieldToCondition: m } = ye();
|
|
842
|
+
function a(c) {
|
|
843
|
+
return !c.value.isEmpty();
|
|
730
844
|
}
|
|
731
|
-
function c
|
|
732
|
-
e.value =
|
|
845
|
+
function u(c) {
|
|
846
|
+
e.value = Z(c), e.value.reduce((g, d) => (g.set(d.labelCode, d), g), l);
|
|
733
847
|
}
|
|
734
|
-
function
|
|
735
|
-
n.value = e.value.map((
|
|
848
|
+
function f(c) {
|
|
849
|
+
n.value = e.value.map((g) => m(g));
|
|
736
850
|
}
|
|
737
|
-
function o(
|
|
738
|
-
c
|
|
851
|
+
function o(c, g) {
|
|
852
|
+
u(c), f();
|
|
739
853
|
}
|
|
740
|
-
return o(
|
|
854
|
+
return o(t.fields), {
|
|
741
855
|
currentFilterId: r,
|
|
742
856
|
filterFields: e,
|
|
743
857
|
filterItems: n,
|
|
744
|
-
fieldMap:
|
|
858
|
+
fieldMap: l,
|
|
745
859
|
loadFilterItems: o,
|
|
746
860
|
shouldShowClearButtonInFilterItem: a
|
|
747
861
|
};
|
|
748
862
|
}
|
|
749
|
-
function
|
|
750
|
-
const n =
|
|
751
|
-
filterItems:
|
|
863
|
+
function St(t, i, e) {
|
|
864
|
+
const n = F([]), r = F("更多筛选"), {
|
|
865
|
+
filterItems: l
|
|
752
866
|
} = e;
|
|
753
|
-
function
|
|
754
|
-
n.value =
|
|
867
|
+
function s() {
|
|
868
|
+
n.value = l.value.filter((a) => a.isExtend);
|
|
755
869
|
}
|
|
756
|
-
|
|
757
|
-
const m =
|
|
758
|
-
return () =>
|
|
870
|
+
s();
|
|
871
|
+
const m = W(() => n.value && n.value.length > 0);
|
|
872
|
+
return () => y("div", {
|
|
759
873
|
class: "f-filter-toolbars"
|
|
760
|
-
}, [m.value &&
|
|
874
|
+
}, [m.value && y("button", {
|
|
761
875
|
class: "btn btn-link"
|
|
762
876
|
}, [r.value])]);
|
|
763
877
|
}
|
|
764
|
-
const
|
|
878
|
+
const Tt = /* @__PURE__ */ Q({
|
|
765
879
|
name: "FFilterBarItemDesign",
|
|
766
|
-
props:
|
|
880
|
+
props: xe,
|
|
767
881
|
emits: ["confirm"],
|
|
768
|
-
setup(
|
|
769
|
-
const e =
|
|
882
|
+
setup(t, i) {
|
|
883
|
+
const e = F(t.filterItem), {
|
|
770
884
|
useFilterItemsComposition: n
|
|
771
|
-
} =
|
|
885
|
+
} = X("useFilterItemsComposition"), {
|
|
772
886
|
currentFilterId: r,
|
|
773
|
-
shouldShowClearButtonInFilterItem:
|
|
774
|
-
} = n,
|
|
887
|
+
shouldShowClearButtonInFilterItem: l
|
|
888
|
+
} = n, s = F(t.disabled), m = function() {
|
|
775
889
|
return {
|
|
776
890
|
"f-filter-item": !0,
|
|
777
891
|
"f-filter-item-actived": !e.value.value.isEmpty(),
|
|
@@ -779,60 +893,60 @@ const wt = /* @__PURE__ */ Q({
|
|
|
779
893
|
"f-filter-item-edit": e.value.id === r.value
|
|
780
894
|
};
|
|
781
895
|
};
|
|
782
|
-
return () =>
|
|
896
|
+
return () => y("div", {
|
|
783
897
|
key: e.value.id,
|
|
784
898
|
id: e.value.id,
|
|
785
899
|
class: m()
|
|
786
|
-
}, [
|
|
900
|
+
}, [y("div", {
|
|
787
901
|
class: "f-filter-item-inner"
|
|
788
|
-
}, [e.value.required &&
|
|
902
|
+
}, [e.value.required && y("span", {
|
|
789
903
|
class: "f-filter-item-required text-danger"
|
|
790
|
-
}, [
|
|
904
|
+
}, [j("*")]), y("span", {
|
|
791
905
|
class: "f-filter-item-text"
|
|
792
|
-
}, [e.value.fieldName]), e.value.value.getDisplayText() &&
|
|
906
|
+
}, [e.value.fieldName]), e.value.value.getDisplayText() && y(ie, null, [y("span", {
|
|
793
907
|
class: "f-filter-item-tip"
|
|
794
|
-
}, [
|
|
908
|
+
}, [j(":")]), y("span", {
|
|
795
909
|
class: "f-filter-item-content"
|
|
796
|
-
}, [e.value.value.getDisplayText()])]), !
|
|
910
|
+
}, [e.value.value.getDisplayText()])]), !s.value && y("span", {
|
|
797
911
|
class: "f-filter-item-arrow f-icon f-icon-arrow-chevron-down"
|
|
798
|
-
}, null)]),
|
|
912
|
+
}, null)]), l(e.value) && y("span", {
|
|
799
913
|
class: "mr-3 f-filter-item-clear"
|
|
800
|
-
}, [
|
|
914
|
+
}, [y("span", {
|
|
801
915
|
class: "f-icon f-icon-close-circle"
|
|
802
916
|
}, null)])]);
|
|
803
917
|
}
|
|
804
918
|
});
|
|
805
|
-
function
|
|
806
|
-
const { formSchemaUtils:
|
|
807
|
-
function n(a,
|
|
919
|
+
function Et(t) {
|
|
920
|
+
const { formSchemaUtils: i, formStateMachineUtils: e } = t;
|
|
921
|
+
function n(a, u = "") {
|
|
808
922
|
return {
|
|
809
|
-
path:
|
|
923
|
+
path: u + a.code,
|
|
810
924
|
field: a.id,
|
|
811
925
|
fullPath: a.code
|
|
812
926
|
};
|
|
813
927
|
}
|
|
814
|
-
function r(a,
|
|
815
|
-
const
|
|
816
|
-
return
|
|
817
|
-
}
|
|
818
|
-
function s(a) {
|
|
819
|
-
const c = t.getRootViewModelId(), u = r(a);
|
|
820
|
-
if (a === c)
|
|
821
|
-
return u;
|
|
822
|
-
const o = r(c, "root-component.");
|
|
823
|
-
return [...u, ...o];
|
|
928
|
+
function r(a, u = "") {
|
|
929
|
+
const f = i.getViewModelById(a);
|
|
930
|
+
return f ? f.states.map((o) => n(o, u)) : [];
|
|
824
931
|
}
|
|
825
932
|
function l(a) {
|
|
933
|
+
const u = i.getRootViewModelId(), f = r(a);
|
|
934
|
+
if (a === u)
|
|
935
|
+
return f;
|
|
936
|
+
const o = r(u, "root-component.");
|
|
937
|
+
return [...f, ...o];
|
|
938
|
+
}
|
|
939
|
+
function s(a) {
|
|
826
940
|
return a.binding && a.binding.path || a.id || "";
|
|
827
941
|
}
|
|
828
942
|
function m() {
|
|
829
943
|
return e && e.getRenderStates() || [];
|
|
830
944
|
}
|
|
831
|
-
return { getVariables:
|
|
945
|
+
return { getVariables: l, getControlName: s, getStateMachines: m };
|
|
832
946
|
}
|
|
833
|
-
class
|
|
834
|
-
constructor(
|
|
835
|
-
|
|
947
|
+
class Se {
|
|
948
|
+
constructor(i) {
|
|
949
|
+
E(this, "sessionVariables", [
|
|
836
950
|
{
|
|
837
951
|
key: "CurrentSysOrgName",
|
|
838
952
|
name: "当前组织Name",
|
|
@@ -869,7 +983,7 @@ class we {
|
|
|
869
983
|
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
|
|
870
984
|
}
|
|
871
985
|
]);
|
|
872
|
-
|
|
986
|
+
E(this, "expressionNames", {
|
|
873
987
|
compute: "计算表达式",
|
|
874
988
|
dependency: "依赖表达式",
|
|
875
989
|
validate: "验证表达式",
|
|
@@ -878,94 +992,94 @@ class we {
|
|
|
878
992
|
readonly: "只读表达式",
|
|
879
993
|
required: "必填表达式"
|
|
880
994
|
});
|
|
881
|
-
|
|
882
|
-
convertFrom: (n, r,
|
|
883
|
-
const m =
|
|
995
|
+
E(this, "getExpressionConverter", (i, e) => ({
|
|
996
|
+
convertFrom: (n, r, l, s) => {
|
|
997
|
+
const m = l.getExpressionRuleValue(i, e || r);
|
|
884
998
|
return m && m.value || "";
|
|
885
999
|
},
|
|
886
|
-
convertTo: (n, r,
|
|
1000
|
+
convertTo: (n, r, l, s, m) => {
|
|
887
1001
|
var a;
|
|
888
|
-
if (r === "dataPicking" && (
|
|
889
|
-
const
|
|
890
|
-
((a =
|
|
891
|
-
(o) => o.id ===
|
|
892
|
-
)) ? n.dictPickingExpressionId =
|
|
1002
|
+
if (r === "dataPicking" && (l != null && l.target)) {
|
|
1003
|
+
const u = `${l.target}_dataPicking`;
|
|
1004
|
+
((a = l.rules) == null ? void 0 : a.some(
|
|
1005
|
+
(o) => o.id === u && o.value
|
|
1006
|
+
)) ? n.dictPickingExpressionId = u : delete n.dictPickingExpressionId;
|
|
893
1007
|
}
|
|
894
|
-
|
|
1008
|
+
s.updateExpression(l);
|
|
895
1009
|
}
|
|
896
1010
|
}));
|
|
897
|
-
this.formSchemaService =
|
|
1011
|
+
this.formSchemaService = i;
|
|
898
1012
|
}
|
|
899
|
-
getExpressionRule(
|
|
1013
|
+
getExpressionRule(i, e) {
|
|
900
1014
|
const n = this.formSchemaService.getExpressions();
|
|
901
1015
|
if (!n)
|
|
902
1016
|
return "";
|
|
903
|
-
const r = n.find((
|
|
1017
|
+
const r = n.find((s) => s.target === i);
|
|
904
1018
|
if (!r)
|
|
905
1019
|
return "";
|
|
906
|
-
const
|
|
907
|
-
return
|
|
1020
|
+
const l = r.rules.find((s) => s.type === e);
|
|
1021
|
+
return l || "";
|
|
908
1022
|
}
|
|
909
1023
|
// 获取上下文表单变量
|
|
910
1024
|
getContextFormVariables() {
|
|
911
|
-
const { module:
|
|
912
|
-
if (!
|
|
1025
|
+
const { module: i } = this.formSchemaService.getFormSchema();
|
|
1026
|
+
if (!i.viewmodels || i.viewmodels.length === 0)
|
|
913
1027
|
return [];
|
|
914
1028
|
const e = this.formSchemaService.getRootViewModelId(), n = this.formSchemaService.getViewModelById(e);
|
|
915
1029
|
if (!n || !n.states || n.states.length === 0)
|
|
916
1030
|
return [];
|
|
917
1031
|
const r = [];
|
|
918
|
-
return n.states.filter((
|
|
1032
|
+
return n.states.filter((l) => l.category === "remote").forEach((l) => {
|
|
919
1033
|
r.push({
|
|
920
|
-
key:
|
|
921
|
-
name:
|
|
922
|
-
description:
|
|
923
|
-
category:
|
|
1034
|
+
key: l.code,
|
|
1035
|
+
name: l.name,
|
|
1036
|
+
description: l.name,
|
|
1037
|
+
category: l.category
|
|
924
1038
|
});
|
|
925
1039
|
}), r;
|
|
926
1040
|
}
|
|
927
|
-
createTreeNode(
|
|
1041
|
+
createTreeNode(i, e, n = "label") {
|
|
928
1042
|
return {
|
|
929
|
-
id:
|
|
930
|
-
name:
|
|
931
|
-
bindingPath:
|
|
1043
|
+
id: i.id,
|
|
1044
|
+
name: i.name,
|
|
1045
|
+
bindingPath: i[n],
|
|
932
1046
|
parents: e,
|
|
933
1047
|
type: "field"
|
|
934
1048
|
};
|
|
935
1049
|
}
|
|
936
|
-
buildEntityFieldsTreeData(
|
|
1050
|
+
buildEntityFieldsTreeData(i = null, e) {
|
|
937
1051
|
const n = [];
|
|
938
|
-
return
|
|
1052
|
+
return i == null || i.forEach((r) => {
|
|
939
1053
|
var m;
|
|
940
|
-
const
|
|
941
|
-
let
|
|
942
|
-
(m = r.type) != null && m.fields && (
|
|
943
|
-
data:
|
|
944
|
-
children:
|
|
1054
|
+
const l = this.createTreeNode(r, e);
|
|
1055
|
+
let s = [];
|
|
1056
|
+
(m = r.type) != null && m.fields && (s = this.buildEntityFieldsTreeData(r.type.fields, [...e, r.label])), n.push({
|
|
1057
|
+
data: l,
|
|
1058
|
+
children: s,
|
|
945
1059
|
expanded: !0
|
|
946
1060
|
});
|
|
947
1061
|
}), n;
|
|
948
1062
|
}
|
|
949
|
-
buildChildEntityTreeData(
|
|
1063
|
+
buildChildEntityTreeData(i = null, e) {
|
|
950
1064
|
const n = [];
|
|
951
|
-
return
|
|
952
|
-
var a,
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
m != null && m.length && (
|
|
957
|
-
data:
|
|
958
|
-
children:
|
|
1065
|
+
return i == null || i.forEach((r) => {
|
|
1066
|
+
var a, u;
|
|
1067
|
+
const l = this.createTreeNode(r, e);
|
|
1068
|
+
l.type = "entity";
|
|
1069
|
+
const s = this.buildEntityFieldsTreeData((a = r.type) == null ? void 0 : a.fields, [...e, r.label]), m = this.buildChildEntityTreeData((u = r.type) == null ? void 0 : u.entities, [...e, r.label]);
|
|
1070
|
+
m != null && m.length && (s == null || s.push(...m)), n.push({
|
|
1071
|
+
data: l,
|
|
1072
|
+
children: s || [],
|
|
959
1073
|
// 空值回退
|
|
960
1074
|
expanded: !0
|
|
961
1075
|
});
|
|
962
1076
|
}), n;
|
|
963
1077
|
}
|
|
964
1078
|
getEntitiesTreeData() {
|
|
965
|
-
const
|
|
966
|
-
if (!(
|
|
1079
|
+
const i = this.formSchemaService.getSchemaEntities();
|
|
1080
|
+
if (!(i != null && i.length))
|
|
967
1081
|
return [];
|
|
968
|
-
const e =
|
|
1082
|
+
const e = i[0];
|
|
969
1083
|
if (!(e != null && e.type))
|
|
970
1084
|
return [];
|
|
971
1085
|
const n = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), r = this.buildChildEntityTreeData(e.type.entities, [e.code]);
|
|
@@ -994,150 +1108,150 @@ class we {
|
|
|
994
1108
|
}
|
|
995
1109
|
};
|
|
996
1110
|
}
|
|
997
|
-
onBeforeOpenExpression(
|
|
998
|
-
const r = n === "Field" ?
|
|
999
|
-
message: ["validate", "required", "dataPicking"].includes(e) &&
|
|
1000
|
-
...
|
|
1111
|
+
onBeforeOpenExpression(i, e, n) {
|
|
1112
|
+
const r = n === "Field" ? i.binding.field : i.id, l = this.getExpressionRule(r, e), s = this.getEntitiesAndVariables(), m = {
|
|
1113
|
+
message: ["validate", "required", "dataPicking"].includes(e) && l ? l.message : "",
|
|
1114
|
+
...s
|
|
1001
1115
|
};
|
|
1002
|
-
return
|
|
1116
|
+
return l.messageType != null && (m.messageType = l.messageType), m;
|
|
1003
1117
|
}
|
|
1004
|
-
buildRule(
|
|
1005
|
-
const { expression:
|
|
1006
|
-
id: `${
|
|
1118
|
+
buildRule(i, e, n, r) {
|
|
1119
|
+
const { expression: l, message: s, messageType: m } = e, a = {
|
|
1120
|
+
id: `${i}_${n}`,
|
|
1007
1121
|
type: n,
|
|
1008
|
-
value:
|
|
1122
|
+
value: l
|
|
1009
1123
|
};
|
|
1010
|
-
return (n === "validate" || n === "dataPicking" || n === "required") && (a.message =
|
|
1124
|
+
return (n === "validate" || n === "dataPicking" || n === "required") && (a.message = s), n === "dataPicking" && (a.messageType = m), n === "validate" && r && (a.elementId = r), a;
|
|
1011
1125
|
}
|
|
1012
1126
|
getExpressionData() {
|
|
1013
|
-
const { expressions:
|
|
1014
|
-
return
|
|
1127
|
+
const { expressions: i } = this.formSchemaService.getFormSchema().module;
|
|
1128
|
+
return i || [];
|
|
1015
1129
|
}
|
|
1016
|
-
updateExpression(
|
|
1017
|
-
const
|
|
1018
|
-
let a = this.getExpressionData().find((
|
|
1019
|
-
const
|
|
1130
|
+
updateExpression(i, e, n, r) {
|
|
1131
|
+
const l = e === "Field" ? i.binding.field : i.id, s = this.buildRule(l, n, r, i.type === "form-group" ? i.id : "");
|
|
1132
|
+
let a = this.getExpressionData().find((f) => f.targetType === e && f.target === l);
|
|
1133
|
+
const u = (f) => f.value.trim() === "";
|
|
1020
1134
|
if (a) {
|
|
1021
|
-
const
|
|
1022
|
-
if (
|
|
1023
|
-
|
|
1135
|
+
const f = a.rules.find((o) => o.id === s.id);
|
|
1136
|
+
if (f)
|
|
1137
|
+
u(s) ? a.rules = a.rules.filter((o) => o.id !== s.id) : (Object.assign(f, s), r === "validate" && i.type === "form-group" && (f.elementId = i.id));
|
|
1024
1138
|
else {
|
|
1025
|
-
if (
|
|
1139
|
+
if (u(s))
|
|
1026
1140
|
return null;
|
|
1027
|
-
a.rules = a.rules || [], a.rules.push(
|
|
1141
|
+
a.rules = a.rules || [], a.rules.push(s);
|
|
1028
1142
|
}
|
|
1029
1143
|
} else {
|
|
1030
|
-
if (
|
|
1144
|
+
if (u(s))
|
|
1031
1145
|
return null;
|
|
1032
1146
|
a = {
|
|
1033
|
-
target: `${
|
|
1034
|
-
rules: [
|
|
1147
|
+
target: `${l}`,
|
|
1148
|
+
rules: [s],
|
|
1035
1149
|
targetType: e
|
|
1036
1150
|
};
|
|
1037
1151
|
}
|
|
1038
1152
|
return a;
|
|
1039
1153
|
}
|
|
1040
|
-
getExpressionEditorOptions(
|
|
1041
|
-
return n.reduce((
|
|
1042
|
-
var a,
|
|
1043
|
-
const m = e === "Field" ? (a =
|
|
1044
|
-
return s
|
|
1045
|
-
hide: e === "Field" ? !!((
|
|
1154
|
+
getExpressionEditorOptions(i, e, n, r) {
|
|
1155
|
+
return n.reduce((l, s) => {
|
|
1156
|
+
var a, u;
|
|
1157
|
+
const m = e === "Field" ? (a = i == null ? void 0 : i.binding) == null ? void 0 : a.field : i.id;
|
|
1158
|
+
return l[s] = {
|
|
1159
|
+
hide: e === "Field" ? !!((u = i == null ? void 0 : i.binding) != null && u.field) : !1,
|
|
1046
1160
|
description: "",
|
|
1047
|
-
title: this.expressionNames[
|
|
1161
|
+
title: this.expressionNames[s],
|
|
1048
1162
|
type: "string",
|
|
1049
1163
|
$converter: this.getExpressionConverter(m),
|
|
1050
1164
|
refreshPanelAfterChanged: !0,
|
|
1051
1165
|
editor: {
|
|
1052
1166
|
type: "expression-editor",
|
|
1053
1167
|
singleExpand: !1,
|
|
1054
|
-
dialogTitle: `${this.expressionNames[
|
|
1055
|
-
showMessage:
|
|
1056
|
-
showMessageType:
|
|
1057
|
-
beforeOpen: () => this.onBeforeOpenExpression(
|
|
1058
|
-
onSubmitModal: (
|
|
1059
|
-
const o = this.updateExpression(
|
|
1168
|
+
dialogTitle: `${this.expressionNames[s]}编辑器`,
|
|
1169
|
+
showMessage: s === "validate" || s === "dataPicking" || s === "required",
|
|
1170
|
+
showMessageType: s === "dataPicking",
|
|
1171
|
+
beforeOpen: () => this.onBeforeOpenExpression(i, s, e),
|
|
1172
|
+
onSubmitModal: (f) => {
|
|
1173
|
+
const o = this.updateExpression(i, e, f, s);
|
|
1060
1174
|
if (r) {
|
|
1061
|
-
const
|
|
1062
|
-
r(
|
|
1175
|
+
const c = this.buildRule(m, f, s);
|
|
1176
|
+
r(c);
|
|
1063
1177
|
}
|
|
1064
1178
|
return o;
|
|
1065
1179
|
}
|
|
1066
1180
|
}
|
|
1067
|
-
},
|
|
1181
|
+
}, l;
|
|
1068
1182
|
}, {});
|
|
1069
1183
|
}
|
|
1070
|
-
getExpressionInfo(
|
|
1071
|
-
const r = e === "Field" ?
|
|
1072
|
-
value:
|
|
1184
|
+
getExpressionInfo(i, e, n) {
|
|
1185
|
+
const r = e === "Field" ? i.binding.field : i.id, l = this.getExpressionRule(r, n), s = {
|
|
1186
|
+
value: l && l.value,
|
|
1073
1187
|
targetId: r,
|
|
1074
1188
|
targetType: e,
|
|
1075
1189
|
expressionType: n
|
|
1076
1190
|
};
|
|
1077
|
-
return
|
|
1191
|
+
return l && l.message && (s.message = l.message), s;
|
|
1078
1192
|
}
|
|
1079
|
-
getExpressionConfig(
|
|
1193
|
+
getExpressionConfig(i, e, n = ["compute", "dependency", "validate"], r) {
|
|
1080
1194
|
return {
|
|
1081
1195
|
description: "表达式",
|
|
1082
1196
|
title: "表达式",
|
|
1083
|
-
hide: !
|
|
1197
|
+
hide: !i.binding,
|
|
1084
1198
|
properties: {
|
|
1085
|
-
...this.getExpressionEditorOptions(
|
|
1199
|
+
...this.getExpressionEditorOptions(i, e, n, r)
|
|
1086
1200
|
}
|
|
1087
1201
|
};
|
|
1088
1202
|
}
|
|
1089
|
-
getExpressionOptions(
|
|
1090
|
-
const r = this.getExpressionInfo(
|
|
1203
|
+
getExpressionOptions(i, e, n) {
|
|
1204
|
+
const r = this.getExpressionInfo(i, e, n);
|
|
1091
1205
|
return {
|
|
1092
1206
|
dialogTitle: `${this.expressionNames[n]}编辑器`,
|
|
1093
1207
|
singleExpand: !1,
|
|
1094
1208
|
showMessage: n === "required",
|
|
1095
|
-
beforeOpen: () => this.onBeforeOpenExpression(
|
|
1209
|
+
beforeOpen: () => this.onBeforeOpenExpression(i, n, e),
|
|
1096
1210
|
expressionInfo: r
|
|
1097
1211
|
};
|
|
1098
1212
|
}
|
|
1099
1213
|
}
|
|
1100
|
-
class
|
|
1101
|
-
constructor(
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1214
|
+
class Mt {
|
|
1215
|
+
constructor(i, e) {
|
|
1216
|
+
E(this, "componentId");
|
|
1217
|
+
E(this, "viewModelId");
|
|
1218
|
+
E(this, "eventsEditorUtils");
|
|
1219
|
+
E(this, "formSchemaUtils");
|
|
1220
|
+
E(this, "formMetadataConverter");
|
|
1221
|
+
E(this, "designViewModelUtils");
|
|
1222
|
+
E(this, "designViewModelField");
|
|
1223
|
+
E(this, "controlCreatorUtils");
|
|
1224
|
+
E(this, "designerHostService");
|
|
1225
|
+
E(this, "designerContext");
|
|
1226
|
+
E(this, "schemaService", null);
|
|
1227
|
+
E(this, "metadataService", null);
|
|
1228
|
+
E(this, "propertyConfig", {
|
|
1115
1229
|
type: "object",
|
|
1116
1230
|
categories: {}
|
|
1117
1231
|
});
|
|
1118
1232
|
var n;
|
|
1119
|
-
this.componentId =
|
|
1233
|
+
this.componentId = i, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((n = this.formSchemaUtils) == null ? void 0 : n.getViewModelIdByComponentId(i)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService, this.designerContext = e.designerContext;
|
|
1120
1234
|
}
|
|
1121
1235
|
getFormDesignerInstance() {
|
|
1122
|
-
var
|
|
1123
|
-
return (e = (
|
|
1236
|
+
var i, e;
|
|
1237
|
+
return (e = (i = this.designerContext) == null ? void 0 : i.instances) == null ? void 0 : e.formDesigner.value;
|
|
1124
1238
|
}
|
|
1125
1239
|
getTableInfo() {
|
|
1126
|
-
var
|
|
1127
|
-
return (
|
|
1240
|
+
var i;
|
|
1241
|
+
return (i = this.schemaService) == null ? void 0 : i.getTableInfoByViewModelId(this.viewModelId);
|
|
1128
1242
|
}
|
|
1129
|
-
setDesignViewModelField(
|
|
1243
|
+
setDesignViewModelField(i) {
|
|
1130
1244
|
var n;
|
|
1131
|
-
const e =
|
|
1245
|
+
const e = i.binding && i.binding.type === "Form" && i.binding.field;
|
|
1132
1246
|
if (e) {
|
|
1133
1247
|
if (!this.designViewModelField) {
|
|
1134
1248
|
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
1135
|
-
this.designViewModelField = r.fields.find((
|
|
1249
|
+
this.designViewModelField = r.fields.find((l) => l.id === e);
|
|
1136
1250
|
}
|
|
1137
|
-
|
|
1251
|
+
i.updateOn = (n = this.designViewModelField) == null ? void 0 : n.updateOn;
|
|
1138
1252
|
}
|
|
1139
1253
|
}
|
|
1140
|
-
getBasicPropConfig(
|
|
1254
|
+
getBasicPropConfig(i) {
|
|
1141
1255
|
return {
|
|
1142
1256
|
description: "Basic Information",
|
|
1143
1257
|
title: "基本信息",
|
|
@@ -1158,17 +1272,17 @@ class xt {
|
|
|
1158
1272
|
valueField: "value",
|
|
1159
1273
|
idField: "value",
|
|
1160
1274
|
editable: !1,
|
|
1161
|
-
data: [{ value:
|
|
1275
|
+
data: [{ value: i.type, name: v[i.type] && v[i.type].name }]
|
|
1162
1276
|
}
|
|
1163
1277
|
}
|
|
1164
1278
|
}
|
|
1165
1279
|
};
|
|
1166
1280
|
}
|
|
1167
|
-
getAppearanceConfig(
|
|
1281
|
+
getAppearanceConfig(i = null, e = {}, n) {
|
|
1168
1282
|
const r = {
|
|
1169
1283
|
title: "外观",
|
|
1170
1284
|
description: "Appearance"
|
|
1171
|
-
},
|
|
1285
|
+
}, l = {
|
|
1172
1286
|
class: {
|
|
1173
1287
|
title: "class样式",
|
|
1174
1288
|
type: "string",
|
|
@@ -1184,21 +1298,21 @@ class xt {
|
|
|
1184
1298
|
parentPropertyID: "appearance"
|
|
1185
1299
|
}
|
|
1186
1300
|
};
|
|
1187
|
-
for (const
|
|
1188
|
-
s
|
|
1301
|
+
for (const s in e)
|
|
1302
|
+
l[s] = Object.assign(l[s] || {}, e[s]);
|
|
1189
1303
|
return {
|
|
1190
1304
|
...r,
|
|
1191
|
-
properties: { ...
|
|
1192
|
-
setPropertyRelates(
|
|
1193
|
-
if (
|
|
1194
|
-
switch (
|
|
1305
|
+
properties: { ...l },
|
|
1306
|
+
setPropertyRelates(s, m) {
|
|
1307
|
+
if (s) {
|
|
1308
|
+
switch (s && s.propertyID) {
|
|
1195
1309
|
case "class":
|
|
1196
1310
|
case "style": {
|
|
1197
|
-
|
|
1311
|
+
J.value++;
|
|
1198
1312
|
break;
|
|
1199
1313
|
}
|
|
1200
1314
|
}
|
|
1201
|
-
n && n(
|
|
1315
|
+
n && n(s, i, m);
|
|
1202
1316
|
}
|
|
1203
1317
|
}
|
|
1204
1318
|
};
|
|
@@ -1213,49 +1327,49 @@ class xt {
|
|
|
1213
1327
|
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
1214
1328
|
* @returns
|
|
1215
1329
|
*/
|
|
1216
|
-
getPropertyEditorParams(
|
|
1217
|
-
const { getVariables: m, getControlName: a, getStateMachines:
|
|
1330
|
+
getPropertyEditorParams(i, e = [], n = "visible", r = {}, l = {}, s = "") {
|
|
1331
|
+
const { getVariables: m, getControlName: a, getStateMachines: u } = Et(this.designerHostService), f = this.getRealTargetType(i), o = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], c = {
|
|
1218
1332
|
type: "property-editor",
|
|
1219
1333
|
propertyTypes: o
|
|
1220
1334
|
};
|
|
1221
|
-
return o.map((
|
|
1222
|
-
switch (
|
|
1335
|
+
return o.map((g) => {
|
|
1336
|
+
switch (g) {
|
|
1223
1337
|
case "Const":
|
|
1224
|
-
Object.assign(
|
|
1338
|
+
Object.assign(c, {
|
|
1225
1339
|
constType: "enum",
|
|
1226
1340
|
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
|
|
1227
1341
|
}, r);
|
|
1228
1342
|
break;
|
|
1229
1343
|
case "Expression":
|
|
1230
|
-
|
|
1344
|
+
c.expressionConfig = this.getExpressionOptions(i, f, s || n);
|
|
1231
1345
|
break;
|
|
1232
1346
|
case "StateMachine":
|
|
1233
|
-
|
|
1347
|
+
c.stateMachines = u();
|
|
1234
1348
|
break;
|
|
1235
1349
|
case "Variable":
|
|
1236
|
-
Object.assign(
|
|
1237
|
-
controlName: a(
|
|
1350
|
+
Object.assign(c, {
|
|
1351
|
+
controlName: a(i),
|
|
1238
1352
|
newVariablePrefix: "is",
|
|
1239
1353
|
newVariableType: "Boolean",
|
|
1240
1354
|
variables: m(this.viewModelId),
|
|
1241
1355
|
parentComponentId: this.componentId === "root-component" ? "" : "root-component",
|
|
1242
|
-
onBeforeOpenVariables: (
|
|
1243
|
-
|
|
1356
|
+
onBeforeOpenVariables: (d) => {
|
|
1357
|
+
d.value = m(this.viewModelId);
|
|
1244
1358
|
}
|
|
1245
|
-
},
|
|
1359
|
+
}, l), this.designerContext.designerMode === "PC_RTC" && (c.newVariablePrefix = "ext_" + c.newVariablePrefix);
|
|
1246
1360
|
break;
|
|
1247
1361
|
}
|
|
1248
|
-
}),
|
|
1362
|
+
}), c;
|
|
1249
1363
|
}
|
|
1250
|
-
getVisibleProperty(
|
|
1251
|
-
var
|
|
1364
|
+
getVisibleProperty(i, e = "") {
|
|
1365
|
+
var l;
|
|
1252
1366
|
let n = ["Const", "Variable", "StateMachine", "Expression"];
|
|
1253
|
-
return e === "gridFieldEditor" ? n = ["Const", "Expression"] : e === "form-group" && !((
|
|
1367
|
+
return e === "gridFieldEditor" ? n = ["Const", "Expression"] : e === "form-group" && !((l = i.binding) != null && l.field) ? n = ["Const", "Variable", "StateMachine"] : (e === "dataGrid" || e === "treeGrid" || e === "wizard") && (n = ["Const", "Variable", "Expression"]), {
|
|
1254
1368
|
visible: {
|
|
1255
1369
|
title: "是否可见",
|
|
1256
1370
|
type: "boolean",
|
|
1257
1371
|
description: "运行时组件是否可见",
|
|
1258
|
-
editor: this.getPropertyEditorParams(
|
|
1372
|
+
editor: this.getPropertyEditorParams(i, n, "visible")
|
|
1259
1373
|
}
|
|
1260
1374
|
};
|
|
1261
1375
|
}
|
|
@@ -1265,27 +1379,27 @@ class xt {
|
|
|
1265
1379
|
* @param viewModelId
|
|
1266
1380
|
* @returns
|
|
1267
1381
|
*/
|
|
1268
|
-
getBehaviorConfig(
|
|
1269
|
-
const
|
|
1382
|
+
getBehaviorConfig(i, e = "", n = {}, r) {
|
|
1383
|
+
const l = {
|
|
1270
1384
|
title: "行为",
|
|
1271
1385
|
description: ""
|
|
1272
|
-
},
|
|
1386
|
+
}, s = this.getVisibleProperty(i, e);
|
|
1273
1387
|
for (const a in n)
|
|
1274
|
-
|
|
1388
|
+
s[a] = Object.assign(s[a] || {}, n[a]);
|
|
1275
1389
|
const m = this;
|
|
1276
1390
|
return {
|
|
1277
|
-
...
|
|
1278
|
-
properties: { ...
|
|
1279
|
-
setPropertyRelates(a,
|
|
1391
|
+
...l,
|
|
1392
|
+
properties: { ...s },
|
|
1393
|
+
setPropertyRelates(a, u) {
|
|
1280
1394
|
if (a) {
|
|
1281
1395
|
switch (a.propertyID) {
|
|
1282
1396
|
case "disabled":
|
|
1283
1397
|
case "readonly":
|
|
1284
1398
|
case "visible":
|
|
1285
|
-
m.afterMutilEditorChanged(
|
|
1399
|
+
m.afterMutilEditorChanged(i, a);
|
|
1286
1400
|
break;
|
|
1287
1401
|
}
|
|
1288
|
-
r && r(a,
|
|
1402
|
+
r && r(a, u);
|
|
1289
1403
|
}
|
|
1290
1404
|
}
|
|
1291
1405
|
};
|
|
@@ -1295,8 +1409,8 @@ class xt {
|
|
|
1295
1409
|
* @param propertyData
|
|
1296
1410
|
* @param changeObject
|
|
1297
1411
|
*/
|
|
1298
|
-
afterMutilEditorChanged(
|
|
1299
|
-
this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e,
|
|
1412
|
+
afterMutilEditorChanged(i, e) {
|
|
1413
|
+
this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, i);
|
|
1300
1414
|
}
|
|
1301
1415
|
/**
|
|
1302
1416
|
*
|
|
@@ -1304,12 +1418,12 @@ class xt {
|
|
|
1304
1418
|
* @param componentInstance
|
|
1305
1419
|
* @returns
|
|
1306
1420
|
*/
|
|
1307
|
-
updateElementByParentContainer(
|
|
1421
|
+
updateElementByParentContainer(i, e) {
|
|
1308
1422
|
const n = e && e.parent && e.parent.schema;
|
|
1309
1423
|
if (!n)
|
|
1310
1424
|
return;
|
|
1311
|
-
const r = n.contents.findIndex((
|
|
1312
|
-
n.contents.splice(r, 1), n.contents.splice(r, 0,
|
|
1425
|
+
const r = n.contents.findIndex((s) => s.id === i), l = Z(n.contents[r]);
|
|
1426
|
+
n.contents.splice(r, 1), n.contents.splice(r, 0, l), He();
|
|
1313
1427
|
}
|
|
1314
1428
|
/**
|
|
1315
1429
|
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
@@ -1317,11 +1431,11 @@ class xt {
|
|
|
1317
1431
|
* @param viewModelId
|
|
1318
1432
|
* @returns
|
|
1319
1433
|
*/
|
|
1320
|
-
addNewVariableToViewModel(
|
|
1321
|
-
const n =
|
|
1434
|
+
addNewVariableToViewModel(i, e) {
|
|
1435
|
+
const n = i.propertyValue;
|
|
1322
1436
|
if (!(n && typeof n == "object") || !(n.type === "Variable" && n.isNewVariable))
|
|
1323
1437
|
return;
|
|
1324
|
-
const
|
|
1438
|
+
const s = {
|
|
1325
1439
|
id: n.field,
|
|
1326
1440
|
category: "locale",
|
|
1327
1441
|
code: n.fullPath,
|
|
@@ -1329,27 +1443,27 @@ class xt {
|
|
|
1329
1443
|
type: n.newVariableType || "String",
|
|
1330
1444
|
isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
|
|
1331
1445
|
};
|
|
1332
|
-
delete n.newVariableType, delete n.isNewVariable, this.formSchemaUtils.getVariableByCode(
|
|
1446
|
+
delete n.newVariableType, delete n.isNewVariable, this.formSchemaUtils.getVariableByCode(s.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s);
|
|
1333
1447
|
}
|
|
1334
1448
|
/**
|
|
1335
1449
|
* 更新表达式到expressions节点
|
|
1336
1450
|
* @param changeObject
|
|
1337
1451
|
*/
|
|
1338
|
-
updateExpressionValue(
|
|
1339
|
-
const e =
|
|
1452
|
+
updateExpressionValue(i) {
|
|
1453
|
+
const e = i.propertyValue;
|
|
1340
1454
|
if (!((e && e.type) === "Expression" && e.expressionInfo))
|
|
1341
1455
|
return;
|
|
1342
|
-
const { expressionId:
|
|
1343
|
-
|
|
1344
|
-
const { expressions:
|
|
1345
|
-
let
|
|
1346
|
-
|
|
1347
|
-
const p =
|
|
1456
|
+
const { expressionId: l, expressionInfo: s } = e, { targetId: m, targetType: a, expressionType: u, value: f, message: o } = s, c = this.formSchemaUtils.getModule();
|
|
1457
|
+
c.expressions = c.expressions || [];
|
|
1458
|
+
const { expressions: g } = c;
|
|
1459
|
+
let d = g.find((h) => h.target === m);
|
|
1460
|
+
d || (d = { target: m, rules: [], targetType: a }, g.push(d));
|
|
1461
|
+
const p = d.rules.find((h) => h.type === u);
|
|
1348
1462
|
if (p)
|
|
1349
|
-
p.value =
|
|
1463
|
+
p.value = f, p.message = o;
|
|
1350
1464
|
else {
|
|
1351
|
-
const h = { id:
|
|
1352
|
-
|
|
1465
|
+
const h = { id: l, type: u, value: f, message: o };
|
|
1466
|
+
d.rules.push(h);
|
|
1353
1467
|
}
|
|
1354
1468
|
delete e.expressionInfo;
|
|
1355
1469
|
}
|
|
@@ -1359,25 +1473,25 @@ class xt {
|
|
|
1359
1473
|
* @param propertyData
|
|
1360
1474
|
* @returns
|
|
1361
1475
|
*/
|
|
1362
|
-
clearExpression(
|
|
1363
|
-
const n =
|
|
1476
|
+
clearExpression(i, e) {
|
|
1477
|
+
const n = i.propertyValue;
|
|
1364
1478
|
if (n && n.type === "Expression")
|
|
1365
1479
|
return;
|
|
1366
|
-
const
|
|
1367
|
-
!a || !a.rules || (a.rules = a.rules.filter((
|
|
1480
|
+
const l = i.propertyID, s = this.formSchemaUtils.getExpressions(), m = e.binding ? e.binding.field : e.id, a = s.find((u) => u.target === m);
|
|
1481
|
+
!a || !a.rules || (a.rules = a.rules.filter((u) => u.type !== l));
|
|
1368
1482
|
}
|
|
1369
|
-
getExpressionOptions(
|
|
1370
|
-
return new
|
|
1483
|
+
getExpressionOptions(i, e, n) {
|
|
1484
|
+
return new Se(this.formSchemaUtils).getExpressionOptions(i, e, n);
|
|
1371
1485
|
}
|
|
1372
|
-
getRealTargetType(
|
|
1373
|
-
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(
|
|
1486
|
+
getRealTargetType(i) {
|
|
1487
|
+
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(i.type) > -1 ? "Button" : i.binding && i.binding.field ? "Field" : "Container";
|
|
1374
1488
|
}
|
|
1375
|
-
createBaseEventProperty(
|
|
1489
|
+
createBaseEventProperty(i) {
|
|
1376
1490
|
const e = {};
|
|
1377
1491
|
return e[this.viewModelId] = {
|
|
1378
1492
|
type: "events-editor",
|
|
1379
1493
|
editor: {
|
|
1380
|
-
initialData:
|
|
1494
|
+
initialData: i,
|
|
1381
1495
|
viewSourceHandle: (n) => {
|
|
1382
1496
|
var r;
|
|
1383
1497
|
((r = n.controller) == null ? void 0 : r.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(n);
|
|
@@ -1386,17 +1500,17 @@ class xt {
|
|
|
1386
1500
|
}, e;
|
|
1387
1501
|
}
|
|
1388
1502
|
}
|
|
1389
|
-
const
|
|
1503
|
+
const D = class D {
|
|
1390
1504
|
/**
|
|
1391
1505
|
* 根据绑定字段类型获取可用的输入类控件
|
|
1392
1506
|
*/
|
|
1393
|
-
static getEditorTypesByMDataType(
|
|
1507
|
+
static getEditorTypesByMDataType(i, e = !1, n = "") {
|
|
1394
1508
|
if (e)
|
|
1395
|
-
return [{ key:
|
|
1396
|
-
let r =
|
|
1509
|
+
return [{ key: v["language-textbox"].type, value: v["language-textbox"].name }];
|
|
1510
|
+
let r = D.fieldControlTypeMapping[i];
|
|
1397
1511
|
if (n === "data-grid-column" && (r != null && r.length)) {
|
|
1398
|
-
const
|
|
1399
|
-
r = r.filter((
|
|
1512
|
+
const l = [v["check-group"].type, v["radio-group"].type, v.image.type, v["rich-text-editor"].type];
|
|
1513
|
+
r = r.filter((s) => !l.includes(s.key));
|
|
1400
1514
|
}
|
|
1401
1515
|
return r;
|
|
1402
1516
|
}
|
|
@@ -1404,203 +1518,204 @@ const G = class G {
|
|
|
1404
1518
|
* 获取所有输入类控件
|
|
1405
1519
|
*/
|
|
1406
1520
|
static getAllInputTypes() {
|
|
1407
|
-
const
|
|
1408
|
-
for (const e in
|
|
1409
|
-
|
|
1410
|
-
|
|
1521
|
+
const i = [];
|
|
1522
|
+
for (const e in D.fieldControlTypeMapping)
|
|
1523
|
+
D.fieldControlTypeMapping[e].forEach((n) => {
|
|
1524
|
+
i.find((r) => r.key === n.key && r.value === n.value) || i.push({ key: n.key, value: n.value });
|
|
1411
1525
|
});
|
|
1412
|
-
return
|
|
1526
|
+
return i;
|
|
1413
1527
|
}
|
|
1414
1528
|
/**
|
|
1415
1529
|
* 提供schema字段基础属性和DOM控件属性的映射
|
|
1416
1530
|
* @param control 控件元数据
|
|
1417
1531
|
*/
|
|
1418
|
-
static mappingDomPropAndSchemaProp(
|
|
1419
|
-
var
|
|
1420
|
-
const n = (
|
|
1421
|
-
return (
|
|
1532
|
+
static mappingDomPropAndSchemaProp(i, e) {
|
|
1533
|
+
var l;
|
|
1534
|
+
const n = (l = i.editor) == null ? void 0 : l.type, r = [];
|
|
1535
|
+
return (i.type === v["data-grid-column"].type || i.type === v["tree-grid-column"].type) && e && e.categoryId && e.categoryId.indexOf("gridFieldEditor") < 0 && r.push({ domField: "title", schemaField: "name" }), r.push({ domField: "label", schemaField: "name" }), r.push({ domField: "editor.required", schemaField: "require" }), r.push({ domField: "editor.readonly", schemaField: "readonly" }), (n === v["input-group"].type || n === v.textarea.type || n === v["number-spinner"].type) && r.push({ domField: "editor.maxLength", schemaField: "type.length" }), n === v["number-spinner"].type && r.push({ domField: "editor.precision", schemaField: "type.precision" }), (i.type === v["data-grid-column"].type || i.type === v["tree-grid-column"].type) && r.push({ domField: "formatter.precision", schemaField: "type.precision" }), (n === v["combo-list"].type || n === v["radio-group"].type) && r.push({ domField: "editor.data", schemaField: "type.enumValues" }), (i.type === v["data-grid-column"].type || i.type === v["tree-grid-column"].type) && r.push({ domField: "formatter.data", schemaField: "type.enumValues" }), n === v["date-picker"].type && (r.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), r.push({ domField: "editor.fieldType", schemaField: "type.name" })), n === v["number-spinner"].type && (r.push({ domField: "editor.max", schemaField: "editor.maxValue" }), r.push({ domField: "editor.min", schemaField: "editor.minValue" })), n === v.lookup.type && (r.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), r.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), r.push({ domField: "editor.textField", schemaField: "editor.textField" }), r.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), r.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), r.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), r.push({ domField: "path", schemaField: "bindingPath" }), r.push({ domField: "binding.path", schemaField: "bindingField" }), r.push({ domField: "binding.fullPath", schemaField: "path" }), (i.type === v["data-grid-column"].type || i.type === v["tree-grid-column"].type) && r.push({ domField: "field", schemaField: "bindingPath" }), r;
|
|
1422
1536
|
}
|
|
1423
1537
|
};
|
|
1424
1538
|
/**
|
|
1425
1539
|
* <字段类型,可配置的控件类型列表>的映射
|
|
1426
1540
|
*/
|
|
1427
|
-
|
|
1541
|
+
E(D, "fieldControlTypeMapping", {
|
|
1428
1542
|
String: [
|
|
1429
|
-
{ key:
|
|
1430
|
-
{ key:
|
|
1431
|
-
{ key:
|
|
1432
|
-
{ key:
|
|
1433
|
-
{ key:
|
|
1434
|
-
{ key:
|
|
1435
|
-
{ key:
|
|
1436
|
-
{ key:
|
|
1437
|
-
{ key:
|
|
1438
|
-
{ key:
|
|
1439
|
-
{ key:
|
|
1543
|
+
{ key: v["input-group"].type, value: v["input-group"].name },
|
|
1544
|
+
{ key: v.lookup.type, value: v.lookup.name },
|
|
1545
|
+
{ key: v.image.type, value: v.image.name },
|
|
1546
|
+
{ key: v["date-picker"].type, value: v["date-picker"].name },
|
|
1547
|
+
{ key: v.switch.type, value: v.switch.name },
|
|
1548
|
+
{ key: v["check-box"].type, value: v["check-box"].name },
|
|
1549
|
+
{ key: v["check-group"].type, value: v["check-group"].name },
|
|
1550
|
+
{ key: v["radio-group"].type, value: v["radio-group"].name },
|
|
1551
|
+
{ key: v["combo-list"].type, value: v["combo-list"].name },
|
|
1552
|
+
{ key: v.textarea.type, value: v.textarea.name },
|
|
1553
|
+
{ key: v["time-picker"].type, value: v["time-picker"].name }
|
|
1440
1554
|
],
|
|
1441
1555
|
Text: [
|
|
1442
|
-
{ key:
|
|
1443
|
-
{ key:
|
|
1444
|
-
{ key:
|
|
1445
|
-
{ key:
|
|
1556
|
+
{ key: v.textarea.type, value: v.textarea.name },
|
|
1557
|
+
{ key: v.lookup.type, value: v.lookup.name },
|
|
1558
|
+
{ key: v.image.type, value: v.image.name },
|
|
1559
|
+
{ key: v.avatar.type, value: v.avatar.name },
|
|
1560
|
+
{ key: v["rich-text-editor"].type, value: v["rich-text-editor"].name }
|
|
1446
1561
|
],
|
|
1447
1562
|
Decimal: [
|
|
1448
|
-
{ key:
|
|
1563
|
+
{ key: v["number-spinner"].type, value: v["number-spinner"].name }
|
|
1449
1564
|
],
|
|
1450
1565
|
Integer: [
|
|
1451
|
-
{ key:
|
|
1566
|
+
{ key: v["number-spinner"].type, value: v["number-spinner"].name }
|
|
1452
1567
|
],
|
|
1453
1568
|
Number: [
|
|
1454
|
-
{ key:
|
|
1455
|
-
{ key:
|
|
1456
|
-
{ key:
|
|
1569
|
+
{ key: v["number-spinner"].type, value: v["number-spinner"].name },
|
|
1570
|
+
{ key: v.switch.type, value: v.switch.name },
|
|
1571
|
+
{ key: v["check-box"].type, value: v["check-box"].name }
|
|
1457
1572
|
],
|
|
1458
1573
|
BigNumber: [
|
|
1459
|
-
{ key:
|
|
1574
|
+
{ key: v["number-spinner"].type, value: v["number-spinner"].name }
|
|
1460
1575
|
],
|
|
1461
1576
|
Date: [
|
|
1462
|
-
{ key:
|
|
1577
|
+
{ key: v["date-picker"].type, value: v["date-picker"].name }
|
|
1463
1578
|
],
|
|
1464
1579
|
DateTime: [
|
|
1465
|
-
{ key:
|
|
1580
|
+
{ key: v["date-picker"].type, value: v["date-picker"].name }
|
|
1466
1581
|
],
|
|
1467
1582
|
Boolean: [
|
|
1468
|
-
{ key:
|
|
1469
|
-
{ key:
|
|
1583
|
+
{ key: v.switch.type, value: v.switch.name },
|
|
1584
|
+
{ key: v["check-box"].type, value: v["check-box"].name }
|
|
1470
1585
|
],
|
|
1471
1586
|
Enum: [
|
|
1472
|
-
{ key:
|
|
1473
|
-
{ key:
|
|
1587
|
+
{ key: v["combo-list"].type, value: v["combo-list"].name },
|
|
1588
|
+
{ key: v["radio-group"].type, value: v["radio-group"].name }
|
|
1474
1589
|
],
|
|
1475
1590
|
Object: [
|
|
1476
|
-
{ key:
|
|
1477
|
-
{ key:
|
|
1478
|
-
{ key:
|
|
1591
|
+
{ key: v.lookup.type, value: v.lookup.name },
|
|
1592
|
+
{ key: v["combo-list"].type, value: v["combo-list"].name },
|
|
1593
|
+
{ key: v["radio-group"].type, value: v["radio-group"].name }
|
|
1479
1594
|
]
|
|
1480
1595
|
});
|
|
1481
|
-
let
|
|
1482
|
-
var
|
|
1483
|
-
class
|
|
1596
|
+
let K = D;
|
|
1597
|
+
var Y = /* @__PURE__ */ ((t) => (t.Form = "Form", t.Variable = "Variable", t))(Y || {});
|
|
1598
|
+
class kt {
|
|
1484
1599
|
constructor() {
|
|
1485
1600
|
/** 控件标题 */
|
|
1486
|
-
|
|
1601
|
+
E(this, "label", "");
|
|
1487
1602
|
/** 控件id */
|
|
1488
|
-
|
|
1603
|
+
E(this, "id", "");
|
|
1489
1604
|
/** 每个控件占用的栅格数 */
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1605
|
+
E(this, "columnInSM", 12);
|
|
1606
|
+
E(this, "columnInMD", 6);
|
|
1607
|
+
E(this, "columnInLG", 3);
|
|
1608
|
+
E(this, "columnInEL", 2);
|
|
1494
1609
|
/** 每个控件占用的列数 */
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1610
|
+
E(this, "displayWidthInSM", 1);
|
|
1611
|
+
E(this, "displayWidthInMD", 1);
|
|
1612
|
+
E(this, "displayWidthInLG", 1);
|
|
1613
|
+
E(this, "displayWidthInEL", 1);
|
|
1499
1614
|
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
1500
|
-
|
|
1615
|
+
E(this, "displayColumnCountAtBreakPoint", "md");
|
|
1501
1616
|
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
1502
|
-
|
|
1617
|
+
E(this, "tagRow", 0);
|
|
1503
1618
|
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
1504
|
-
|
|
1619
|
+
E(this, "showTopBorder", 0);
|
|
1505
1620
|
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
1506
|
-
|
|
1621
|
+
E(this, "group", 1);
|
|
1507
1622
|
/** 控件是否符合标准的class配置(设计器用的) */
|
|
1508
|
-
|
|
1623
|
+
E(this, "isSupportedClass", !0);
|
|
1509
1624
|
/** 控件所在分组id(设计器用的) */
|
|
1510
|
-
|
|
1625
|
+
E(this, "fieldSetId", "");
|
|
1511
1626
|
}
|
|
1512
1627
|
}
|
|
1513
|
-
function
|
|
1514
|
-
let
|
|
1628
|
+
function Pt(t) {
|
|
1629
|
+
let i, e;
|
|
1515
1630
|
const n = /* @__PURE__ */ new Map();
|
|
1516
1631
|
let r = [];
|
|
1517
|
-
function
|
|
1518
|
-
const
|
|
1519
|
-
if (
|
|
1632
|
+
function l(f, o) {
|
|
1633
|
+
const g = f.split(" ").filter((w) => w.startsWith("col-"));
|
|
1634
|
+
if (g.length === 0) {
|
|
1520
1635
|
o.isSupportedClass = !1;
|
|
1521
1636
|
return;
|
|
1522
1637
|
}
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1638
|
+
let d = g.find((w) => /^col-([1-9]|10|11|12)$/.test(w)), p = g.find((w) => /^col-md-([1-9]|10|11|12)$/.test(w)), h = g.find((w) => /^col-xl-([1-9]|10|11|12)$/.test(w)), b = g.find((w) => /^col-el-([1-9]|10|11|12)$/.test(w));
|
|
1639
|
+
d = d || "col-12", o.columnInSM = parseInt(d.replace("col-", ""), 10), o.displayWidthInSM = o.columnInSM / 12, o.displayWidthInSM !== 1 && (o.isSupportedClass = !1), p = p || "col-md-" + o.columnInSM, o.columnInMD = parseInt(p.replace("col-md-", ""), 10), o.displayWidthInMD = o.columnInMD / 6, [1, 2].includes(o.displayWidthInMD) || (o.isSupportedClass = !1), h = h || "col-xl-" + o.columnInMD, o.columnInLG = parseInt(h.replace("col-xl-", ""), 10), o.displayWidthInLG = o.columnInLG / 3, [1, 2, 3, 4].includes(o.displayWidthInLG) || (o.isSupportedClass = !1), b = b || "col-el-" + o.columnInLG, o.columnInEL = parseInt(b.replace("col-el-", ""), 10), o.displayWidthInEL = o.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(o.displayWidthInEL) || (o.isSupportedClass = !1);
|
|
1525
1640
|
}
|
|
1526
|
-
function
|
|
1527
|
-
let
|
|
1528
|
-
|
|
1641
|
+
function s(f, o, c, g = !1) {
|
|
1642
|
+
let d = !1;
|
|
1643
|
+
f.contents.forEach((p) => {
|
|
1529
1644
|
if (p.type === "fieldset") {
|
|
1530
|
-
|
|
1645
|
+
c += 1, s(p, o, c, !0), d = !0;
|
|
1531
1646
|
return;
|
|
1532
1647
|
}
|
|
1533
|
-
|
|
1534
|
-
const h = p.appearance && p.appearance.class,
|
|
1535
|
-
h ?
|
|
1648
|
+
d && (c += 1, d = !1);
|
|
1649
|
+
const h = p.appearance && p.appearance.class, b = new kt();
|
|
1650
|
+
h ? l(h, b) : b.isSupportedClass = !1, b.label = p.label || p.id, b.id = p.id, b.group = c, g && (b.fieldSetId = f.id), e === p.id && (i = c), n.set(p.id, p), o.push(b);
|
|
1536
1651
|
});
|
|
1537
1652
|
}
|
|
1538
|
-
function m(
|
|
1539
|
-
const o =
|
|
1653
|
+
function m(f) {
|
|
1654
|
+
const o = t.getComponentById(f);
|
|
1540
1655
|
if (!o || !o.componentType || !o.componentType.startsWith("form"))
|
|
1541
1656
|
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
1542
|
-
const
|
|
1543
|
-
return !
|
|
1544
|
-
}
|
|
1545
|
-
function a(
|
|
1546
|
-
o = o ||
|
|
1547
|
-
const { result:
|
|
1548
|
-
if (!
|
|
1549
|
-
return { result:
|
|
1550
|
-
e =
|
|
1551
|
-
const p =
|
|
1552
|
-
|
|
1553
|
-
const h = r.find((
|
|
1657
|
+
const c = t.selectNode(o, (g) => g.type === v["response-form"].type);
|
|
1658
|
+
return !c || !c.contents || c.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: c };
|
|
1659
|
+
}
|
|
1660
|
+
function a(f, o) {
|
|
1661
|
+
o = o || f.id;
|
|
1662
|
+
const { result: c, message: g, formNode: d } = m(o);
|
|
1663
|
+
if (!c)
|
|
1664
|
+
return { result: c, message: g };
|
|
1665
|
+
e = f.id, r = [], n.clear();
|
|
1666
|
+
const p = d.contents[0].type === v.fieldset.type ? 0 : 1;
|
|
1667
|
+
s(d, r, p);
|
|
1668
|
+
const h = r.find((w) => !w.isSupportedClass);
|
|
1554
1669
|
return {
|
|
1555
1670
|
defaultState: {
|
|
1556
|
-
defaultGroupNumber:
|
|
1671
|
+
defaultGroupNumber: i || 1,
|
|
1557
1672
|
model: h ? "customize" : "standard"
|
|
1558
1673
|
},
|
|
1559
1674
|
importData: r
|
|
1560
1675
|
};
|
|
1561
1676
|
}
|
|
1562
|
-
function
|
|
1677
|
+
function u(f, o) {
|
|
1563
1678
|
o = o;
|
|
1564
|
-
const { result:
|
|
1565
|
-
if (!
|
|
1679
|
+
const { result: c, formNode: g } = m(o);
|
|
1680
|
+
if (!c)
|
|
1566
1681
|
return "";
|
|
1567
|
-
const
|
|
1568
|
-
return
|
|
1569
|
-
var
|
|
1570
|
-
const h = n.get(p.id),
|
|
1571
|
-
if (
|
|
1572
|
-
const
|
|
1573
|
-
h.appearance.class =
|
|
1682
|
+
const d = [];
|
|
1683
|
+
return f.forEach((p) => {
|
|
1684
|
+
var w;
|
|
1685
|
+
const h = n.get(p.id), b = h.appearance && h.appearance.class;
|
|
1686
|
+
if (b) {
|
|
1687
|
+
const L = b.split(" ").filter((I) => !I.startsWith("col-")), T = "col-" + p.columnInSM, V = "col-md-" + p.columnInMD, A = "col-xl-" + p.columnInLG, R = "col-el-" + p.columnInEL, k = [T, V, A, R].concat(L);
|
|
1688
|
+
h.appearance.class = k.join(" ");
|
|
1574
1689
|
}
|
|
1575
1690
|
if (p.fieldSetId) {
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1691
|
+
const O = g.contents.find((T) => T.id === p.fieldSetId), L = d.find((T) => T.id === p.fieldSetId);
|
|
1692
|
+
L ? (w = L.contents) == null || w.push(h) : (d.push(O), O.contents = [h]);
|
|
1578
1693
|
} else
|
|
1579
|
-
|
|
1580
|
-
}),
|
|
1694
|
+
d.push(h);
|
|
1695
|
+
}), g.contents = d, g.id;
|
|
1581
1696
|
}
|
|
1582
1697
|
return {
|
|
1583
1698
|
checkCanFindFormNode: m,
|
|
1584
1699
|
checkCanOpenLayoutEditor: a,
|
|
1585
|
-
changeFormControlsByResponseLayoutConfig:
|
|
1586
|
-
getResonseFormLayoutConfig:
|
|
1700
|
+
changeFormControlsByResponseLayoutConfig: u,
|
|
1701
|
+
getResonseFormLayoutConfig: s
|
|
1587
1702
|
};
|
|
1588
1703
|
}
|
|
1589
|
-
const
|
|
1704
|
+
const Vt = (t) => y(ie, null, [y("h5", null, [j("代码示例")]), y("pre", {
|
|
1590
1705
|
style: "background-color: #f5f5f5; padding: 10px; border-radius: 5px;"
|
|
1591
|
-
}, [
|
|
1706
|
+
}, [y("code", null, [`
|
|
1592
1707
|
<h3>Tips:</h3>
|
|
1593
1708
|
<span style="color: blue;">
|
|
1594
1709
|
自定义提示内容
|
|
1595
1710
|
</span>
|
|
1596
1711
|
`])])]);
|
|
1597
|
-
class
|
|
1712
|
+
class Bt extends Mt {
|
|
1598
1713
|
constructor(e, n) {
|
|
1599
1714
|
super(e, n);
|
|
1600
|
-
|
|
1715
|
+
E(this, "responseLayoutEditorFunction");
|
|
1601
1716
|
/** 控件绑定的变量 */
|
|
1602
|
-
|
|
1603
|
-
|
|
1717
|
+
E(this, "bindingVarible");
|
|
1718
|
+
E(this, "formGroupEvents", [
|
|
1604
1719
|
{
|
|
1605
1720
|
label: "fieldValueChanging",
|
|
1606
1721
|
name: "绑定字段值变化前事件"
|
|
@@ -1611,21 +1726,21 @@ class Mt extends xt {
|
|
|
1611
1726
|
},
|
|
1612
1727
|
{
|
|
1613
1728
|
label: "onClickLabel",
|
|
1614
|
-
name: "
|
|
1729
|
+
name: "标签点击事件"
|
|
1615
1730
|
}
|
|
1616
1731
|
]);
|
|
1617
|
-
|
|
1732
|
+
E(this, "numberEditorOptions", {
|
|
1618
1733
|
type: "number-spinner",
|
|
1619
1734
|
useThousands: !1,
|
|
1620
1735
|
keyboard: !1,
|
|
1621
1736
|
showButton: !1
|
|
1622
1737
|
});
|
|
1623
|
-
this.responseLayoutEditorFunction =
|
|
1738
|
+
this.responseLayoutEditorFunction = Pt(this.formSchemaUtils);
|
|
1624
1739
|
}
|
|
1625
1740
|
getCommonPropertyConfig(e, n, r = "Card") {
|
|
1626
1741
|
if (this.propertyConfig.categories.basic = this.getBasicProperties(e, n, r), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, n), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "form-group"), r === "Card") {
|
|
1627
|
-
const
|
|
1628
|
-
this.propertyConfig.categories.behavior.properties = { ...this.propertyConfig.categories.behavior.properties, ...
|
|
1742
|
+
const l = this.getTipsConfig(e);
|
|
1743
|
+
this.propertyConfig.categories.behavior.properties = { ...this.propertyConfig.categories.behavior.properties, ...l }, ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "language-textbox"].includes(e.editor.type) && (this.propertyConfig.categories.expansion = this.getExpandProperties(e));
|
|
1629
1744
|
}
|
|
1630
1745
|
}
|
|
1631
1746
|
getPropertyConfig(e, n) {
|
|
@@ -1635,10 +1750,10 @@ class Mt extends xt {
|
|
|
1635
1750
|
return this.propertyConfig.categories = {}, this.getCommonPropertyConfig(e, n, "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;
|
|
1636
1751
|
}
|
|
1637
1752
|
getBasicProperties(e, n, r = "Card") {
|
|
1638
|
-
var
|
|
1639
|
-
const
|
|
1753
|
+
var u;
|
|
1754
|
+
const l = this;
|
|
1640
1755
|
this.setDesignViewModelField(e);
|
|
1641
|
-
const { canChangeControlType:
|
|
1756
|
+
const { canChangeControlType: s, editorTypeList: m } = this.getAvailableEditorType(e), a = {
|
|
1642
1757
|
description: "Basic Information",
|
|
1643
1758
|
title: "基本信息",
|
|
1644
1759
|
properties: {
|
|
@@ -1661,7 +1776,7 @@ class Mt extends xt {
|
|
|
1661
1776
|
idField: "key",
|
|
1662
1777
|
editable: !1,
|
|
1663
1778
|
data: m,
|
|
1664
|
-
readonly: !
|
|
1779
|
+
readonly: !s
|
|
1665
1780
|
}
|
|
1666
1781
|
},
|
|
1667
1782
|
label: {
|
|
@@ -1676,7 +1791,7 @@ class Mt extends xt {
|
|
|
1676
1791
|
editor: {
|
|
1677
1792
|
data: [{ id: "visible", name: "显示" }, { id: "reserve-space", name: "占位" }, { id: "none", name: "不显示" }]
|
|
1678
1793
|
},
|
|
1679
|
-
defaultValue: ((
|
|
1794
|
+
defaultValue: ((u = e.editor) == null ? void 0 : u.type) === "image" ? "none" : "visible"
|
|
1680
1795
|
},
|
|
1681
1796
|
binding: {
|
|
1682
1797
|
description: "绑定的表单字段",
|
|
@@ -1697,19 +1812,19 @@ class Mt extends xt {
|
|
|
1697
1812
|
readonly: this.formSchemaUtils.designerMode === "PC_RTC" && !e.isRtcControl
|
|
1698
1813
|
}
|
|
1699
1814
|
},
|
|
1700
|
-
setPropertyRelates(
|
|
1701
|
-
if (
|
|
1702
|
-
switch (
|
|
1815
|
+
setPropertyRelates(f, o, c) {
|
|
1816
|
+
if (f)
|
|
1817
|
+
switch (f && f.propertyID) {
|
|
1703
1818
|
case "type": {
|
|
1704
|
-
|
|
1819
|
+
l.changeControlType(e, f, n);
|
|
1705
1820
|
break;
|
|
1706
1821
|
}
|
|
1707
1822
|
case "label": {
|
|
1708
|
-
|
|
1823
|
+
f.needRefreshControlTree = !0;
|
|
1709
1824
|
break;
|
|
1710
1825
|
}
|
|
1711
1826
|
case "binding": {
|
|
1712
|
-
|
|
1827
|
+
l.changeBindingField(e, f, c);
|
|
1713
1828
|
break;
|
|
1714
1829
|
}
|
|
1715
1830
|
}
|
|
@@ -1718,7 +1833,7 @@ class Mt extends xt {
|
|
|
1718
1833
|
return r.toLocaleLowerCase() !== "card" && delete a.properties.showLabelType, a;
|
|
1719
1834
|
}
|
|
1720
1835
|
getExpandProperties(e) {
|
|
1721
|
-
const n = this, r = ["Const", "Variable"],
|
|
1836
|
+
const n = this, r = ["Const", "Variable"], l = this.getPropertyEditorParams(e, r, "expandable"), s = this.getPropertyEditorParams(e, r, "expandDisabled");
|
|
1722
1837
|
return {
|
|
1723
1838
|
description: "Expand Information",
|
|
1724
1839
|
title: "扩展区域",
|
|
@@ -1728,7 +1843,7 @@ class Mt extends xt {
|
|
|
1728
1843
|
title: "启用扩展区域",
|
|
1729
1844
|
refreshPanelAfterChanged: !0,
|
|
1730
1845
|
$converter: "/converter/property-editor.converter",
|
|
1731
|
-
editor:
|
|
1846
|
+
editor: l
|
|
1732
1847
|
},
|
|
1733
1848
|
expandMode: {
|
|
1734
1849
|
description: "扩展模式 text | button",
|
|
@@ -1753,11 +1868,11 @@ class Mt extends xt {
|
|
|
1753
1868
|
$converter: "/converter/property-editor.converter",
|
|
1754
1869
|
description: "是否隐藏扩展区域",
|
|
1755
1870
|
title: "隐藏扩展区域",
|
|
1756
|
-
editor:
|
|
1871
|
+
editor: s,
|
|
1757
1872
|
visible: !!e.editor.expandable
|
|
1758
1873
|
}
|
|
1759
1874
|
},
|
|
1760
|
-
setPropertyRelates(a,
|
|
1875
|
+
setPropertyRelates(a, u) {
|
|
1761
1876
|
if (a)
|
|
1762
1877
|
switch (a.propertyID) {
|
|
1763
1878
|
case "expandable":
|
|
@@ -1778,7 +1893,7 @@ class Mt extends xt {
|
|
|
1778
1893
|
if (e.binding.type === "Variable") {
|
|
1779
1894
|
if (this.bindingVarible = this.formSchemaUtils.getVariableById(e.binding.field), !this.bindingVarible)
|
|
1780
1895
|
return !1;
|
|
1781
|
-
} else if (!this.designViewModelField || this.designViewModelField.$type !==
|
|
1896
|
+
} else if (!this.designViewModelField || this.designViewModelField.$type !== ce.SimpleField)
|
|
1782
1897
|
return !1;
|
|
1783
1898
|
return !0;
|
|
1784
1899
|
}
|
|
@@ -1786,18 +1901,18 @@ class Mt extends xt {
|
|
|
1786
1901
|
* 获取可选的编辑器类型
|
|
1787
1902
|
*/
|
|
1788
1903
|
getAvailableEditorType(e) {
|
|
1789
|
-
var
|
|
1904
|
+
var l;
|
|
1790
1905
|
const n = this.checkCanChangeControlType(e, this.viewModelId);
|
|
1791
1906
|
if (!n)
|
|
1792
1907
|
return {
|
|
1793
1908
|
canChangeControlType: !1,
|
|
1794
1909
|
editorTypeList: [{
|
|
1795
1910
|
key: e.editor.type,
|
|
1796
|
-
value: ((
|
|
1911
|
+
value: ((l = v[e.editor.type]) == null ? void 0 : l.name) || e.editor.type
|
|
1797
1912
|
}]
|
|
1798
1913
|
};
|
|
1799
1914
|
let r = [];
|
|
1800
|
-
return this.designViewModelField && this.designViewModelField.$type ===
|
|
1915
|
+
return this.designViewModelField && this.designViewModelField.$type === ce.SimpleField ? r = K.getEditorTypesByMDataType(this.designViewModelField.type.name, this.designViewModelField.multiLanguage) : this.bindingVarible && (r = K.getEditorTypesByMDataType(this.bindingVarible.type, !1)), { canChangeControlType: n, editorTypeList: r };
|
|
1801
1916
|
}
|
|
1802
1917
|
changeBindingField(e, n, r) {
|
|
1803
1918
|
n.needRefreshEntityTree = !0;
|
|
@@ -1841,17 +1956,17 @@ class Mt extends xt {
|
|
|
1841
1956
|
}
|
|
1842
1957
|
}
|
|
1843
1958
|
},
|
|
1844
|
-
setPropertyRelates(
|
|
1845
|
-
if (
|
|
1846
|
-
switch (
|
|
1959
|
+
setPropertyRelates(l, s) {
|
|
1960
|
+
if (l)
|
|
1961
|
+
switch (l && l.propertyID) {
|
|
1847
1962
|
case "responseLayout":
|
|
1848
|
-
r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(
|
|
1963
|
+
r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue, r.componentId || e.id), r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId), r.updateElementByParentContainer(e.id, n), delete e.responseLayout;
|
|
1849
1964
|
break;
|
|
1850
1965
|
case "class":
|
|
1851
|
-
r.updateUnifiedLayoutAfterControlChanged(
|
|
1966
|
+
r.updateUnifiedLayoutAfterControlChanged(l.propertyValue, e.id, this.componentId), J.value++;
|
|
1852
1967
|
break;
|
|
1853
1968
|
case "style": {
|
|
1854
|
-
|
|
1969
|
+
J.value++;
|
|
1855
1970
|
break;
|
|
1856
1971
|
}
|
|
1857
1972
|
}
|
|
@@ -1867,36 +1982,36 @@ class Mt extends xt {
|
|
|
1867
1982
|
* @param newControlType 新控件类型
|
|
1868
1983
|
*/
|
|
1869
1984
|
changeControlType(e, n, r) {
|
|
1870
|
-
const
|
|
1871
|
-
if (!
|
|
1985
|
+
const l = n.propertyValue, s = r && r.parent && r.parent.schema;
|
|
1986
|
+
if (!s)
|
|
1872
1987
|
return;
|
|
1873
|
-
const m =
|
|
1988
|
+
const m = s.contents.findIndex((f) => f.id === e.id);
|
|
1874
1989
|
if (m === -1)
|
|
1875
1990
|
return;
|
|
1876
|
-
const a =
|
|
1877
|
-
let
|
|
1991
|
+
const a = s.contents[m];
|
|
1992
|
+
let u;
|
|
1878
1993
|
if (this.designViewModelField) {
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1994
|
+
const c = this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find((d) => d.id === this.designViewModelField.id).fieldSchema || {};
|
|
1995
|
+
c.editor || (c.editor = {}), c.editor.$type = l, this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, c, !1), u = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l);
|
|
1881
1996
|
}
|
|
1882
|
-
|
|
1997
|
+
u || (u = this.controlCreatorUtils.createFormGroupWithoutField(l)), Object.assign(u, {
|
|
1883
1998
|
id: a.id,
|
|
1884
1999
|
appearance: a.appearance,
|
|
1885
2000
|
size: a.size,
|
|
1886
2001
|
label: a.label,
|
|
1887
2002
|
binding: a.binding
|
|
1888
|
-
}), Object.prototype.hasOwnProperty.call(a, "visible") && Object.assign(
|
|
1889
|
-
Object.prototype.hasOwnProperty.call(a.editor,
|
|
1890
|
-
}), r != null && r.updateContextSchema ? r.updateContextSchema(
|
|
1891
|
-
(
|
|
2003
|
+
}), Object.prototype.hasOwnProperty.call(a, "visible") && Object.assign(u, { visible: a.visible }), a.editor && ["readonly", "required", "placeholder"].map((f) => {
|
|
2004
|
+
Object.prototype.hasOwnProperty.call(a.editor, f) && (u.editor[f] = a.editor[f]);
|
|
2005
|
+
}), r != null && r.updateContextSchema ? r.updateContextSchema(u) : (r.schema = Object.assign(a, u), Object.assign(e, u)), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
2006
|
+
(f) => f.classList.remove("dgComponentSelected")
|
|
1892
2007
|
), Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(
|
|
1893
|
-
(
|
|
1894
|
-
),
|
|
2008
|
+
(f) => f.classList.remove("dgComponentFocused")
|
|
2009
|
+
), J.value++, ne(() => {
|
|
1895
2010
|
this.getFormDesignerInstance().reloadPropertyPanel();
|
|
1896
2011
|
});
|
|
1897
2012
|
}
|
|
1898
2013
|
getTipsConfig(e) {
|
|
1899
|
-
return ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "textarea", "rich-text-editor"].includes(e.editor.type) ? {
|
|
2014
|
+
return ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "textarea", "rich-text-editor", "language-textbox"].includes(e.editor.type) ? {
|
|
1900
2015
|
enableTips: {
|
|
1901
2016
|
refreshPanelAfterChanged: !0,
|
|
1902
2017
|
description: "",
|
|
@@ -1911,21 +2026,21 @@ class Mt extends xt {
|
|
|
1911
2026
|
editor: {
|
|
1912
2027
|
type: "code-editor",
|
|
1913
2028
|
language: "html",
|
|
1914
|
-
leftTemplate:
|
|
2029
|
+
leftTemplate: Vt
|
|
1915
2030
|
},
|
|
1916
2031
|
visible: !!e.enableTips
|
|
1917
2032
|
}
|
|
1918
2033
|
} : {};
|
|
1919
2034
|
}
|
|
1920
|
-
getComponentConfig(e, n = {}, r = {},
|
|
1921
|
-
var
|
|
1922
|
-
const
|
|
2035
|
+
getComponentConfig(e, n = {}, r = {}, l) {
|
|
2036
|
+
var c, g;
|
|
2037
|
+
const s = Object.assign({
|
|
1923
2038
|
description: "编辑器",
|
|
1924
2039
|
title: "编辑器",
|
|
1925
2040
|
type: "input-group",
|
|
1926
2041
|
$converter: "/converter/property-editor.converter",
|
|
1927
2042
|
parentPropertyID: "editor"
|
|
1928
|
-
}, n), m = (
|
|
2043
|
+
}, n), m = (c = e.binding) != null && c.field ? [] : ["Const", "Variable", "StateMachine"], a = this.getPropertyEditorParams(e, m, "readonly"), u = this.getPropertyEditorParams(e, m, "required"), f = {
|
|
1929
2044
|
readonly: {
|
|
1930
2045
|
description: "",
|
|
1931
2046
|
title: "只读",
|
|
@@ -1935,8 +2050,8 @@ class Mt extends xt {
|
|
|
1935
2050
|
description: "",
|
|
1936
2051
|
title: "必填",
|
|
1937
2052
|
type: "boolean",
|
|
1938
|
-
editor:
|
|
1939
|
-
visible: !!((
|
|
2053
|
+
editor: u,
|
|
2054
|
+
visible: !!((g = e.binding) != null && g.field)
|
|
1940
2055
|
},
|
|
1941
2056
|
placeholder: {
|
|
1942
2057
|
description: "当控件没有值时在输入框中显示的文本",
|
|
@@ -1944,21 +2059,21 @@ class Mt extends xt {
|
|
|
1944
2059
|
type: "string"
|
|
1945
2060
|
}
|
|
1946
2061
|
};
|
|
1947
|
-
for (const
|
|
1948
|
-
|
|
2062
|
+
for (const d in r)
|
|
2063
|
+
f[d] = Object.assign(f[d] || {}, r[d]);
|
|
1949
2064
|
const o = this;
|
|
1950
2065
|
return {
|
|
1951
|
-
...
|
|
1952
|
-
properties: { ...
|
|
1953
|
-
setPropertyRelates(
|
|
1954
|
-
if (
|
|
1955
|
-
switch (
|
|
2066
|
+
...s,
|
|
2067
|
+
properties: { ...f },
|
|
2068
|
+
setPropertyRelates(d, p) {
|
|
2069
|
+
if (d) {
|
|
2070
|
+
switch (d.propertyID) {
|
|
1956
2071
|
case "readonly":
|
|
1957
2072
|
case "required":
|
|
1958
|
-
o.afterMutilEditorChanged(e,
|
|
2073
|
+
o.afterMutilEditorChanged(e, d);
|
|
1959
2074
|
break;
|
|
1960
2075
|
}
|
|
1961
|
-
|
|
2076
|
+
l && l.bind(o)(d, e, p);
|
|
1962
2077
|
}
|
|
1963
2078
|
}
|
|
1964
2079
|
};
|
|
@@ -1970,17 +2085,17 @@ class Mt extends xt {
|
|
|
1970
2085
|
* @param componentId 控件所在组件id
|
|
1971
2086
|
*/
|
|
1972
2087
|
updateUnifiedLayoutAfterControlChanged(e, n, r) {
|
|
1973
|
-
const
|
|
1974
|
-
let
|
|
1975
|
-
|
|
1976
|
-
const
|
|
2088
|
+
const l = e.split(" ");
|
|
2089
|
+
let s = l.find((o) => /^col-([1-9]|10|11|12)$/.test(o)), m = l.find((o) => /^col-md-([1-9]|10|11|12)$/.test(o)), a = l.find((o) => /^col-xl-([1-9]|10|11|12)$/.test(o)), u = l.find((o) => /^col-el-([1-9]|10|11|12)$/.test(o));
|
|
2090
|
+
s = s || "col-12", m = m || "col-md-" + s.replace("col-", ""), a = a || "col-xl-" + m.replace("col-md-", ""), u = u || "col-el-" + a.replace("col-xl-", "");
|
|
2091
|
+
const f = {
|
|
1977
2092
|
id: n,
|
|
1978
|
-
columnInSM: parseInt(
|
|
2093
|
+
columnInSM: parseInt(s.replace("col-", ""), 10),
|
|
1979
2094
|
columnInMD: parseInt(m.replace("col-md-", ""), 10),
|
|
1980
2095
|
columnInLG: parseInt(a.replace("col-xl-", ""), 10),
|
|
1981
|
-
columnInEL: parseInt(
|
|
2096
|
+
columnInEL: parseInt(u.replace("col-el-", ""), 10)
|
|
1982
2097
|
};
|
|
1983
|
-
this.updateUnifiedLayoutAfterResponseLayoutChanged(r,
|
|
2098
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(r, f);
|
|
1984
2099
|
}
|
|
1985
2100
|
/**
|
|
1986
2101
|
* 修改控件布局配置后更新Form统一布局配置
|
|
@@ -1991,17 +2106,17 @@ class Mt extends xt {
|
|
|
1991
2106
|
const { formNode: r } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
|
|
1992
2107
|
if (!r || !r.unifiedLayout)
|
|
1993
2108
|
return;
|
|
1994
|
-
const
|
|
1995
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,
|
|
1996
|
-
const
|
|
1997
|
-
Object.assign(
|
|
2109
|
+
const l = [];
|
|
2110
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r, l, 1), n) {
|
|
2111
|
+
const d = l.find((p) => p.id === n.id);
|
|
2112
|
+
Object.assign(d || {}, n);
|
|
1998
2113
|
}
|
|
1999
|
-
const
|
|
2114
|
+
const s = l.map((d) => d.columnInSM), m = l.map((d) => d.columnInMD), a = l.map((d) => d.columnInLG), u = l.map((d) => d.columnInEL), f = this.checkIsUniqueColumn(s) ? s[0] : null, o = this.checkIsUniqueColumn(m) ? m[0] : null, c = this.checkIsUniqueColumn(a) ? a[0] : null, g = this.checkIsUniqueColumn(u) ? u[0] : null;
|
|
2000
2115
|
Object.assign(r.unifiedLayout, {
|
|
2001
|
-
uniqueColClassInSM:
|
|
2116
|
+
uniqueColClassInSM: f,
|
|
2002
2117
|
uniqueColClassInMD: o,
|
|
2003
|
-
uniqueColClassInLG:
|
|
2004
|
-
uniqueColClassInEL:
|
|
2118
|
+
uniqueColClassInLG: c,
|
|
2119
|
+
uniqueColClassInEL: g
|
|
2005
2120
|
});
|
|
2006
2121
|
}
|
|
2007
2122
|
/**
|
|
@@ -2042,26 +2157,33 @@ class Mt extends xt {
|
|
|
2042
2157
|
* @param propertyData 下拉框控件属性值
|
|
2043
2158
|
*/
|
|
2044
2159
|
checkEnumDataReadonly(e) {
|
|
2045
|
-
return !e.binding || e.binding.type !== "Form" ? !1 : !!(this.designViewModelField && this.designViewModelField.type && this.designViewModelField.type.$type ===
|
|
2160
|
+
return !e.binding || e.binding.type !== "Form" ? !1 : !!(this.designViewModelField && this.designViewModelField.type && this.designViewModelField.type.$type === Ze.EnumType);
|
|
2046
2161
|
}
|
|
2047
2162
|
/**
|
|
2048
2163
|
* 将字段值变化前事件、变化后事件追加到交互面板
|
|
2049
2164
|
* 注意:因为绑定字段值变化后事件与下拉框的值变化事件(valueChanged)重名,所以这里将事件label都重命名下
|
|
2050
2165
|
*/
|
|
2051
2166
|
appendFieldValueChangeEvents(e, n) {
|
|
2052
|
-
e.binding && e.binding.type ===
|
|
2167
|
+
e.binding && e.binding.type === Y.Form && e.binding.field ? (n.find((r) => r.label === "fieldValueChanging"), n.find((r) => r.label === "fieldValueChanged"), this.designViewModelField && (e.fieldValueChanging = this.designViewModelField.valueChanging, e.fieldValueChanged = this.designViewModelField.valueChanged)) : n = n.filter((r) => r.label !== "fieldValueChanging" && r.label !== "fieldValueChanged");
|
|
2053
2168
|
}
|
|
2054
2169
|
getControlMethodType(e) {
|
|
2055
2170
|
if (!e.binding)
|
|
2056
2171
|
return e.type;
|
|
2057
2172
|
switch (e.binding.type) {
|
|
2058
|
-
case
|
|
2173
|
+
case Y.Form:
|
|
2059
2174
|
return e.binding.path || e.type;
|
|
2060
|
-
case
|
|
2175
|
+
case Y.Variable:
|
|
2061
2176
|
return e.binding.fullPath || e.type;
|
|
2062
2177
|
}
|
|
2063
2178
|
return e.type;
|
|
2064
2179
|
}
|
|
2180
|
+
updateLinkedLabel(e, n) {
|
|
2181
|
+
if (e.boundEventsList && e.boundEventsList.length > 0) {
|
|
2182
|
+
const r = e.boundEventsList.find((l) => l.boundEvents && l.boundEvents.label === "onClickLabel");
|
|
2183
|
+
n.linkLabel = !!r;
|
|
2184
|
+
} else
|
|
2185
|
+
n.linkLabel = !1;
|
|
2186
|
+
}
|
|
2065
2187
|
/**
|
|
2066
2188
|
* 组装输入类控件的交互面板:包含标签超链、绑定字段值变化前后事件等。
|
|
2067
2189
|
* @param propertyData 属性值
|
|
@@ -2069,8 +2191,8 @@ class Mt extends xt {
|
|
|
2069
2191
|
* @param showPosition 面板展示位置
|
|
2070
2192
|
* @param customEvent 输入控件特有的事件配置
|
|
2071
2193
|
*/
|
|
2072
|
-
getEventPropertyConfig(e, n = "card", r,
|
|
2073
|
-
const
|
|
2194
|
+
getEventPropertyConfig(e, n = "card", r, l) {
|
|
2195
|
+
const s = this;
|
|
2074
2196
|
let m = [...this.formGroupEvents];
|
|
2075
2197
|
if (["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group"].includes(e.editor.type) && m.push({
|
|
2076
2198
|
lable: "onClear",
|
|
@@ -2085,27 +2207,27 @@ class Mt extends xt {
|
|
|
2085
2207
|
hide: !0
|
|
2086
2208
|
};
|
|
2087
2209
|
this.appendFieldValueChangeEvents(e, m);
|
|
2088
|
-
const
|
|
2210
|
+
const u = s.eventsEditorUtils.formProperties(e, s.viewModelId, m);
|
|
2089
2211
|
return {
|
|
2090
2212
|
title: "事件",
|
|
2091
2213
|
hideTitle: !0,
|
|
2092
|
-
properties:
|
|
2214
|
+
properties: s.createBaseEventProperty(u),
|
|
2093
2215
|
tabId: "commands",
|
|
2094
2216
|
tabName: "交互",
|
|
2095
|
-
setPropertyRelates(
|
|
2096
|
-
const
|
|
2097
|
-
delete e[
|
|
2098
|
-
const p =
|
|
2099
|
-
p &&
|
|
2217
|
+
setPropertyRelates(c, g) {
|
|
2218
|
+
const d = c.propertyValue;
|
|
2219
|
+
delete e[s.viewModelId], d && (d.setPropertyRelates = this.setPropertyRelates, d.controlInfo = { type: s.getControlMethodType(e), name: e.title }, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, d.events, d), s.updateLinkedLabel(d, g)), l && l(c, g, d);
|
|
2220
|
+
const p = s.designViewModelUtils.getDgViewModel(s.viewModelId);
|
|
2221
|
+
p && s.designViewModelField && p.changeField(s.designViewModelField.id, { valueChanging: e.fieldValueChanging, valueChanged: e.fieldValueChanged });
|
|
2100
2222
|
}
|
|
2101
2223
|
};
|
|
2102
2224
|
}
|
|
2103
|
-
getExpressionConfig(e, n, r = ["compute", "dependency", "validate"],
|
|
2104
|
-
return new
|
|
2225
|
+
getExpressionConfig(e, n, r = ["compute", "dependency", "validate"], l) {
|
|
2226
|
+
return new Se(this.formSchemaUtils).getExpressionConfig(
|
|
2105
2227
|
e,
|
|
2106
2228
|
n,
|
|
2107
2229
|
r,
|
|
2108
|
-
|
|
2230
|
+
l
|
|
2109
2231
|
);
|
|
2110
2232
|
}
|
|
2111
2233
|
getBindingDataType() {
|
|
@@ -2115,14 +2237,14 @@ class Mt extends xt {
|
|
|
2115
2237
|
return this.getBindingDataType() === "number" ? this.numberEditorOptions : {};
|
|
2116
2238
|
}
|
|
2117
2239
|
updatePropertyValue(e, n, r) {
|
|
2118
|
-
var
|
|
2119
|
-
e.editor[n] !== r ? e.editor[n] = r : (
|
|
2240
|
+
var l;
|
|
2241
|
+
e.editor[n] !== r ? e.editor[n] = r : (l = this.getFormDesignerInstance()) == null || l.reloadPropertyPanel();
|
|
2120
2242
|
}
|
|
2121
2243
|
setBooleanValue(e, n, r) {
|
|
2122
|
-
let
|
|
2123
|
-
this.getBindingDataType() === "string" && (
|
|
2244
|
+
let l = r;
|
|
2245
|
+
this.getBindingDataType() === "string" && (l = (l || "").trim() || (n === "trueValue" ? "true" : "false"));
|
|
2124
2246
|
const m = n === "trueValue" ? "falseValue" : "trueValue";
|
|
2125
|
-
e.editor[m] ===
|
|
2247
|
+
e.editor[m] === l && (l = l + 1), this.updatePropertyValue(e, n, l);
|
|
2126
2248
|
}
|
|
2127
2249
|
getBooleanValueConverter() {
|
|
2128
2250
|
return {
|
|
@@ -2133,42 +2255,99 @@ class Mt extends xt {
|
|
|
2133
2255
|
};
|
|
2134
2256
|
}
|
|
2135
2257
|
}
|
|
2136
|
-
class
|
|
2137
|
-
getPropertyConfig(
|
|
2138
|
-
return this.propertyConfig.categories.basic = this.getBasicPropConfig(
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2258
|
+
class Lt extends Bt {
|
|
2259
|
+
getPropertyConfig(i, e) {
|
|
2260
|
+
return this.propertyConfig.categories.basic = this.getBasicPropConfig(i), this.propertyConfig.categories.appearance = this.getAppearanceConfig(i, {
|
|
2261
|
+
// showExtendSiderbar: {
|
|
2262
|
+
// description: "是否在侧边栏中展示收起的控件",
|
|
2263
|
+
// type: "boolean",
|
|
2264
|
+
// title: "启用侧边栏收折",
|
|
2265
|
+
// refreshPanelAfterChanged: true
|
|
2266
|
+
// },
|
|
2267
|
+
resetText: {
|
|
2268
|
+
description: "选择筛选条件后,按钮“清空筛选”的文本",
|
|
2269
|
+
type: "string",
|
|
2270
|
+
title: "清空筛选按钮的文本"
|
|
2271
|
+
},
|
|
2272
|
+
filterText: {
|
|
2273
|
+
description: "设置筛选按钮的文本",
|
|
2274
|
+
type: "string",
|
|
2275
|
+
title: "筛选按钮的文本"
|
|
2276
|
+
},
|
|
2277
|
+
filterType: {
|
|
2278
|
+
description: "筛选的类型有两种:轻量筛选和平铺筛选",
|
|
2279
|
+
type: "enum",
|
|
2280
|
+
title: "筛选类型",
|
|
2281
|
+
editor: {
|
|
2282
|
+
default: "light",
|
|
2283
|
+
data: [
|
|
2284
|
+
{ id: "light", name: "轻量" },
|
|
2285
|
+
{ id: "tile", name: "平铺" }
|
|
2286
|
+
]
|
|
2287
|
+
},
|
|
2288
|
+
refreshPanelAfterChanged: !0
|
|
2289
|
+
},
|
|
2290
|
+
tileShowType: {
|
|
2291
|
+
description: "多行展示:类似卡片输入控件的布局方式,筛选项多时会自动折行展示;在一行展示:筛选项多时会出现滚动条进行展示;单行展示:每个筛选项单独占一行展示。",
|
|
2292
|
+
type: "enum",
|
|
2293
|
+
title: "平铺筛选的展示方式",
|
|
2294
|
+
visible: i.filterType === "tile",
|
|
2295
|
+
editor: {
|
|
2296
|
+
default: "multiline",
|
|
2297
|
+
data: [
|
|
2298
|
+
{ id: "multiline", name: "多行展示" },
|
|
2299
|
+
{ id: "all-in-one", name: "在一行展示" },
|
|
2300
|
+
{ id: "aline", name: "单行展示" }
|
|
2301
|
+
]
|
|
2302
|
+
},
|
|
2303
|
+
refreshPanelAfterChanged: !0
|
|
2304
|
+
},
|
|
2305
|
+
allInOneAlign: {
|
|
2306
|
+
description: "在一行展示的方式下,可以左对齐或者右对齐",
|
|
2307
|
+
type: "enum",
|
|
2308
|
+
title: "对齐方式",
|
|
2309
|
+
visible: i.tileShowType === "all-in-one",
|
|
2310
|
+
editor: {
|
|
2311
|
+
default: "left",
|
|
2312
|
+
data: [
|
|
2313
|
+
{ id: "left", name: "左对齐" },
|
|
2314
|
+
{ id: "right", name: "右对齐" }
|
|
2315
|
+
]
|
|
2316
|
+
}
|
|
2317
|
+
},
|
|
2318
|
+
lineLabelWidth: {
|
|
2319
|
+
description: "行展示方式下,筛选条件的文字标签的宽度是否固定,固定宽度:标签宽度固定;自动宽度:标签宽度不固定跟随内容变化",
|
|
2320
|
+
type: "enum",
|
|
2321
|
+
title: "标签宽度",
|
|
2322
|
+
visible: i.tileShowType !== "all-in-one",
|
|
2323
|
+
editor: {
|
|
2324
|
+
default: "fixed",
|
|
2325
|
+
data: [
|
|
2326
|
+
{ id: "fixed", name: "固定宽度" },
|
|
2327
|
+
{ id: "auto", name: "自动宽度" }
|
|
2328
|
+
]
|
|
2155
2329
|
}
|
|
2156
2330
|
}
|
|
2157
|
-
};
|
|
2331
|
+
}), this.propertyConfig.categories.behavior = this.getBehaviorConfig(i), this.getFilterBarConfig(i), this.getEventPropConfig(i), this.propertyConfig;
|
|
2158
2332
|
}
|
|
2159
|
-
getFilterBarConfig(
|
|
2333
|
+
getFilterBarConfig(i) {
|
|
2160
2334
|
const e = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId), n = this;
|
|
2161
|
-
this.
|
|
2335
|
+
this.propertyConfig.categories.control = {
|
|
2162
2336
|
description: "Basic Infomation",
|
|
2163
2337
|
title: "编辑器",
|
|
2164
2338
|
properties: {
|
|
2339
|
+
liveSearch: {
|
|
2340
|
+
description: "即时搜索,条件变更触发查询事件;非即时搜索,通过点击筛选按钮触发查询事件。",
|
|
2341
|
+
type: "boolean",
|
|
2342
|
+
title: "即时搜索"
|
|
2343
|
+
},
|
|
2165
2344
|
fields: {
|
|
2166
2345
|
description: "筛选条字段设置",
|
|
2167
2346
|
title: "筛选条字段",
|
|
2168
2347
|
type: "",
|
|
2169
2348
|
editor: {
|
|
2170
2349
|
type: "query-solution-config",
|
|
2171
|
-
source: "filter-bar",
|
|
2350
|
+
source: i.filterType === "tile" ? "filter-tile" : "filter-bar",
|
|
2172
2351
|
title: "筛选条字段",
|
|
2173
2352
|
fieldsConfig: e,
|
|
2174
2353
|
formSchemaUtils: this.formSchemaUtils,
|
|
@@ -2179,29 +2358,19 @@ class Pt extends Mt {
|
|
|
2179
2358
|
schemaService: this.schemaService
|
|
2180
2359
|
}
|
|
2181
2360
|
},
|
|
2182
|
-
// visible: {
|
|
2183
|
-
// description: "运行时组件是否可见",
|
|
2184
|
-
// title: "是否可见",
|
|
2185
|
-
// editor: visibleEditor
|
|
2186
|
-
// },
|
|
2187
|
-
// disable: {
|
|
2188
|
-
// description: "是否禁用",
|
|
2189
|
-
// title: "是否禁用",
|
|
2190
|
-
// editor: disableEditor
|
|
2191
|
-
// },
|
|
2192
2361
|
defaultValues: {
|
|
2193
2362
|
description: "默认值绑定字段",
|
|
2194
2363
|
type: "object",
|
|
2195
2364
|
title: "默认值绑定字段",
|
|
2196
|
-
editor: this.getPropertyEditorParams(
|
|
2365
|
+
editor: this.getPropertyEditorParams(i, ["Variable"], "", {}, { newVariableType: "Object" })
|
|
2197
2366
|
}
|
|
2198
2367
|
},
|
|
2199
|
-
setPropertyRelates(r,
|
|
2368
|
+
setPropertyRelates(r, l) {
|
|
2200
2369
|
if (r)
|
|
2201
2370
|
switch (r.propertyID) {
|
|
2202
2371
|
case "visible":
|
|
2203
2372
|
case "disable":
|
|
2204
|
-
n.afterMutilEditorChanged(
|
|
2373
|
+
n.afterMutilEditorChanged(i, r);
|
|
2205
2374
|
break;
|
|
2206
2375
|
case "defaultValues":
|
|
2207
2376
|
n.addNewVariableToViewModel(r, n.viewModelId);
|
|
@@ -2210,32 +2379,32 @@ class Pt extends Mt {
|
|
|
2210
2379
|
}
|
|
2211
2380
|
};
|
|
2212
2381
|
}
|
|
2213
|
-
getEventPropConfig(
|
|
2382
|
+
getEventPropConfig(i) {
|
|
2214
2383
|
const e = [
|
|
2215
2384
|
{
|
|
2216
2385
|
label: "onQuery",
|
|
2217
2386
|
name: "查询事件"
|
|
2218
2387
|
}
|
|
2219
|
-
], n = this, r = n.eventsEditorUtils.formProperties(
|
|
2388
|
+
], n = this, r = n.eventsEditorUtils.formProperties(i, n.viewModelId, e), l = n.createBaseEventProperty(r);
|
|
2220
2389
|
this.propertyConfig.categories.eventsEditor = {
|
|
2221
2390
|
title: "事件",
|
|
2222
2391
|
hideTitle: !0,
|
|
2223
|
-
properties:
|
|
2392
|
+
properties: l,
|
|
2224
2393
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2225
2394
|
refreshPanelAfterChanged: !0,
|
|
2226
2395
|
tabId: "commands",
|
|
2227
2396
|
tabName: "交互",
|
|
2228
|
-
setPropertyRelates(
|
|
2229
|
-
const a =
|
|
2230
|
-
delete
|
|
2397
|
+
setPropertyRelates(s, m) {
|
|
2398
|
+
const a = s.propertyValue;
|
|
2399
|
+
delete i[n.viewModelId], a && (a.setPropertyRelates = this.setPropertyRelates, n.eventsEditorUtils.saveRelatedParameters(i, n.viewModelId, a.events, a)), i.remoteSort = !!i.columnSorted;
|
|
2231
2400
|
}
|
|
2232
2401
|
};
|
|
2233
2402
|
}
|
|
2234
2403
|
}
|
|
2235
|
-
function
|
|
2404
|
+
function Ot(t, i) {
|
|
2236
2405
|
function e(m, a) {
|
|
2237
|
-
const
|
|
2238
|
-
return new
|
|
2406
|
+
const u = t.schema;
|
|
2407
|
+
return new Lt(m, i).getPropertyConfig(u, a);
|
|
2239
2408
|
}
|
|
2240
2409
|
function n() {
|
|
2241
2410
|
return !1;
|
|
@@ -2243,20 +2412,20 @@ function kt(i, t) {
|
|
|
2243
2412
|
function r() {
|
|
2244
2413
|
return !1;
|
|
2245
2414
|
}
|
|
2246
|
-
function
|
|
2415
|
+
function l() {
|
|
2247
2416
|
return !1;
|
|
2248
2417
|
}
|
|
2249
|
-
function
|
|
2418
|
+
function s() {
|
|
2250
2419
|
var m;
|
|
2251
|
-
if (
|
|
2252
|
-
const { formSchemaUtils: a } =
|
|
2253
|
-
|
|
2420
|
+
if (t && i) {
|
|
2421
|
+
const { formSchemaUtils: a } = i, u = a.getControlBasicInfoMap(), { schema: f } = t, o = rt["filter-bar"].name;
|
|
2422
|
+
u.set(f.id, {
|
|
2254
2423
|
componentTitle: o,
|
|
2255
2424
|
parentPathName: o
|
|
2256
|
-
}), (m =
|
|
2257
|
-
|
|
2258
|
-
componentTitle:
|
|
2259
|
-
parentPathName: `${o} > ${
|
|
2425
|
+
}), (m = f.fields) != null && m.length && f.fields.map((c) => {
|
|
2426
|
+
u.set(c.id, {
|
|
2427
|
+
componentTitle: c.name,
|
|
2428
|
+
parentPathName: `${o} > ${c.name}`
|
|
2260
2429
|
});
|
|
2261
2430
|
});
|
|
2262
2431
|
}
|
|
@@ -2265,155 +2434,155 @@ function kt(i, t) {
|
|
|
2265
2434
|
getPropsConfig: e,
|
|
2266
2435
|
canAccepts: n,
|
|
2267
2436
|
checkCanDeleteComponent: r,
|
|
2268
|
-
checkCanMoveComponent:
|
|
2269
|
-
setComponentBasicInfoMap:
|
|
2437
|
+
checkCanMoveComponent: l,
|
|
2438
|
+
setComponentBasicInfoMap: s
|
|
2270
2439
|
};
|
|
2271
2440
|
}
|
|
2272
|
-
function
|
|
2441
|
+
function Te(t, i) {
|
|
2273
2442
|
let e;
|
|
2274
2443
|
function n(o) {
|
|
2275
|
-
const { properties:
|
|
2276
|
-
if (
|
|
2277
|
-
const
|
|
2278
|
-
h.id = `${
|
|
2444
|
+
const { properties: c, title: g, ignore: d } = o, p = d && Array.isArray(d), h = Object.keys(c).reduce((b, w) => ((!p || !d.find((O) => O === w)) && (b[w] = c[w].type === "object" && c[w].properties ? n(c[w]) : Z(c[w].default)), b), {});
|
|
2445
|
+
if (g && (!p || !d.find((b) => b === "id"))) {
|
|
2446
|
+
const b = g.toLowerCase().replace(/-/g, "_");
|
|
2447
|
+
h.id = `${b}_${Math.random().toString().slice(2, 6)}`;
|
|
2279
2448
|
}
|
|
2280
2449
|
return h;
|
|
2281
2450
|
}
|
|
2282
2451
|
function r(o) {
|
|
2283
|
-
const { properties:
|
|
2284
|
-
if (
|
|
2285
|
-
const p =
|
|
2286
|
-
if (
|
|
2287
|
-
const h =
|
|
2452
|
+
const { properties: c, title: g, required: d } = o;
|
|
2453
|
+
if (d && Array.isArray(d)) {
|
|
2454
|
+
const p = d.reduce((h, b) => (h[b] = c[b].type === "object" && c[b].properties ? n(c[b]) : Z(c[b].default), h), {});
|
|
2455
|
+
if (g && d.find((h) => h === "id")) {
|
|
2456
|
+
const h = g.toLowerCase().replace(/-/g, "_");
|
|
2288
2457
|
p.id = `${h}_${Math.random().toString().slice(2, 6)}`;
|
|
2289
2458
|
}
|
|
2290
2459
|
return p;
|
|
2291
2460
|
}
|
|
2292
2461
|
return {
|
|
2293
|
-
type:
|
|
2462
|
+
type: g
|
|
2294
2463
|
};
|
|
2295
2464
|
}
|
|
2296
|
-
function
|
|
2297
|
-
const
|
|
2298
|
-
if (
|
|
2299
|
-
let p = r(
|
|
2300
|
-
const h =
|
|
2301
|
-
return p = h ? h({ getSchemaByType:
|
|
2465
|
+
function l(o, c = {}, g) {
|
|
2466
|
+
const d = t[o];
|
|
2467
|
+
if (d) {
|
|
2468
|
+
let p = r(d);
|
|
2469
|
+
const h = i[o];
|
|
2470
|
+
return p = h ? h({ getSchemaByType: l }, p, c, g) : p, e != null && e.appendIdentifyForNewControl && e.appendIdentifyForNewControl(p), p;
|
|
2302
2471
|
}
|
|
2303
2472
|
return null;
|
|
2304
2473
|
}
|
|
2305
|
-
function
|
|
2306
|
-
const
|
|
2307
|
-
return Object.keys(
|
|
2474
|
+
function s(o, c) {
|
|
2475
|
+
const g = n(c);
|
|
2476
|
+
return Object.keys(g).reduce((d, p) => (Object.prototype.hasOwnProperty.call(o, p) && (d[p] && pe(d[p]) && pe(o[p] || !o[p]) ? Object.assign(d[p], o[p] || {}) : d[p] = o[p]), d), g), g;
|
|
2308
2477
|
}
|
|
2309
|
-
function m(o,
|
|
2310
|
-
return Object.keys(o).filter((
|
|
2311
|
-
if (
|
|
2312
|
-
const h =
|
|
2478
|
+
function m(o, c) {
|
|
2479
|
+
return Object.keys(o).filter((d) => o[d] != null).reduce((d, p) => {
|
|
2480
|
+
if (c.has(p)) {
|
|
2481
|
+
const h = c.get(p);
|
|
2313
2482
|
if (typeof h == "string")
|
|
2314
|
-
|
|
2483
|
+
d[h] = o[p];
|
|
2315
2484
|
else {
|
|
2316
|
-
const
|
|
2317
|
-
Object.assign(
|
|
2485
|
+
const b = h(p, o[p], o);
|
|
2486
|
+
Object.assign(d, b);
|
|
2318
2487
|
}
|
|
2319
2488
|
} else
|
|
2320
|
-
|
|
2321
|
-
return
|
|
2489
|
+
d[p] = o[p];
|
|
2490
|
+
return d;
|
|
2322
2491
|
}, {});
|
|
2323
2492
|
}
|
|
2324
|
-
function a(o,
|
|
2325
|
-
const
|
|
2326
|
-
return m(
|
|
2493
|
+
function a(o, c, g = /* @__PURE__ */ new Map()) {
|
|
2494
|
+
const d = s(o, c);
|
|
2495
|
+
return m(d, g);
|
|
2327
2496
|
}
|
|
2328
|
-
function
|
|
2329
|
-
var
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2332
|
-
const
|
|
2333
|
-
if (!
|
|
2497
|
+
function u(o) {
|
|
2498
|
+
var g;
|
|
2499
|
+
const c = o.type;
|
|
2500
|
+
if (c) {
|
|
2501
|
+
const d = t[c];
|
|
2502
|
+
if (!d)
|
|
2334
2503
|
return o;
|
|
2335
|
-
const p =
|
|
2504
|
+
const p = s(o, d), h = ((g = o.editor) == null ? void 0 : g.type) || "";
|
|
2336
2505
|
if (h) {
|
|
2337
|
-
const
|
|
2338
|
-
p.editor =
|
|
2506
|
+
const b = t[h], w = s(o.editor, b);
|
|
2507
|
+
p.editor = w;
|
|
2339
2508
|
}
|
|
2340
2509
|
return p;
|
|
2341
2510
|
}
|
|
2342
2511
|
return o;
|
|
2343
2512
|
}
|
|
2344
|
-
function
|
|
2513
|
+
function f(o) {
|
|
2345
2514
|
e = o;
|
|
2346
2515
|
}
|
|
2347
|
-
return { getSchemaByType:
|
|
2516
|
+
return { getSchemaByType: l, resolveSchemaWithDefaultValue: u, resolveSchemaToProps: a, mappingSchemaToProps: m, setDesignerContext: f };
|
|
2348
2517
|
}
|
|
2349
|
-
const
|
|
2350
|
-
function
|
|
2351
|
-
function
|
|
2518
|
+
const Ee = {}, Me = {}, { resolveSchemaWithDefaultValue: Nt, resolveSchemaToProps: At, mappingSchemaToProps: Rt } = Te(Ee, Me);
|
|
2519
|
+
function Ut(t = {}) {
|
|
2520
|
+
function i(u, f, o, c) {
|
|
2352
2521
|
if (typeof o == "number")
|
|
2353
|
-
return
|
|
2522
|
+
return c[u].length === o;
|
|
2354
2523
|
if (typeof o == "object") {
|
|
2355
|
-
const
|
|
2356
|
-
if (
|
|
2357
|
-
return Number(
|
|
2358
|
-
if (
|
|
2359
|
-
return Number(
|
|
2360
|
-
if (
|
|
2361
|
-
return Number(
|
|
2524
|
+
const g = Object.keys(o)[0], d = o[g];
|
|
2525
|
+
if (g === "not")
|
|
2526
|
+
return Number(c[u].length) !== Number(d);
|
|
2527
|
+
if (g === "moreThan")
|
|
2528
|
+
return Number(c[u].length) >= Number(d);
|
|
2529
|
+
if (g === "lessThan")
|
|
2530
|
+
return Number(c[u].length) <= Number(d);
|
|
2362
2531
|
}
|
|
2363
2532
|
return !1;
|
|
2364
2533
|
}
|
|
2365
|
-
function e(
|
|
2366
|
-
return
|
|
2534
|
+
function e(u, f, o, c) {
|
|
2535
|
+
return c[u] && c[u].propertyValue && String(c[u].propertyValue.value) === String(o);
|
|
2367
2536
|
}
|
|
2368
2537
|
const n = /* @__PURE__ */ new Map([
|
|
2369
|
-
["length",
|
|
2538
|
+
["length", i],
|
|
2370
2539
|
["getProperty", e]
|
|
2371
2540
|
]);
|
|
2372
|
-
Object.keys(
|
|
2373
|
-
function r(
|
|
2374
|
-
const o =
|
|
2375
|
-
return typeof
|
|
2376
|
-
if (
|
|
2377
|
-
return { target: o, operator: "length", param: null, value:
|
|
2378
|
-
const
|
|
2379
|
-
return { target: o, operator: "getProperty", param:
|
|
2541
|
+
Object.keys(t).reduce((u, f) => (u.set(f, t[f]), u), n);
|
|
2542
|
+
function r(u, f) {
|
|
2543
|
+
const o = u;
|
|
2544
|
+
return typeof f == "number" ? [{ target: o, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: o, operator: "getProperty", param: u, value: !!f }] : typeof f == "object" ? Object.keys(f).map((c) => {
|
|
2545
|
+
if (c === "length")
|
|
2546
|
+
return { target: o, operator: "length", param: null, value: f[c] };
|
|
2547
|
+
const g = c, d = f[c];
|
|
2548
|
+
return { target: o, operator: "getProperty", param: g, value: d };
|
|
2380
2549
|
}) : [];
|
|
2381
2550
|
}
|
|
2382
|
-
function
|
|
2383
|
-
return Object.keys(
|
|
2384
|
-
const
|
|
2385
|
-
return o.push(...
|
|
2551
|
+
function l(u) {
|
|
2552
|
+
return Object.keys(u).reduce((o, c) => {
|
|
2553
|
+
const g = r(c, u[c]);
|
|
2554
|
+
return o.push(...g), o;
|
|
2386
2555
|
}, []);
|
|
2387
2556
|
}
|
|
2388
|
-
function
|
|
2389
|
-
if (n.has(
|
|
2390
|
-
const o = n.get(
|
|
2391
|
-
return o && o(
|
|
2557
|
+
function s(u, f) {
|
|
2558
|
+
if (n.has(u.operator)) {
|
|
2559
|
+
const o = n.get(u.operator);
|
|
2560
|
+
return o && o(u.target, u.param, u.value, f) || !1;
|
|
2392
2561
|
}
|
|
2393
2562
|
return !1;
|
|
2394
2563
|
}
|
|
2395
|
-
function m(
|
|
2396
|
-
return
|
|
2564
|
+
function m(u, f) {
|
|
2565
|
+
return l(u).reduce((g, d) => g && s(d, f), !0);
|
|
2397
2566
|
}
|
|
2398
|
-
function a(
|
|
2399
|
-
const o = Object.keys(
|
|
2400
|
-
return
|
|
2567
|
+
function a(u, f) {
|
|
2568
|
+
const o = Object.keys(u), c = o.includes("allOf"), g = o.includes("anyOf"), d = c || g, b = (d ? u[d ? c ? "allOf" : "anyOf" : "allOf"] : [u]).map((O) => m(O, f));
|
|
2569
|
+
return c ? !b.includes(!1) : b.includes(!0);
|
|
2401
2570
|
}
|
|
2402
2571
|
return { parseValueSchema: a };
|
|
2403
2572
|
}
|
|
2404
|
-
const
|
|
2405
|
-
convertTo: (
|
|
2406
|
-
|
|
2573
|
+
const $t = {
|
|
2574
|
+
convertTo: (t, i, e, n) => {
|
|
2575
|
+
t.appearance || (t.appearance = {}), t.appearance[i] = e;
|
|
2407
2576
|
},
|
|
2408
|
-
convertFrom: (
|
|
2409
|
-
},
|
|
2410
|
-
convertFrom: (
|
|
2411
|
-
},
|
|
2412
|
-
convertTo: (
|
|
2413
|
-
|
|
2577
|
+
convertFrom: (t, i, e) => t.appearance ? t.appearance[i] : t[i]
|
|
2578
|
+
}, Wt = {
|
|
2579
|
+
convertFrom: (t, i, e) => t.buttons && t.buttons.length ? `共 ${t.buttons.length} 项` : "无"
|
|
2580
|
+
}, qt = {
|
|
2581
|
+
convertTo: (t, i, e, n) => {
|
|
2582
|
+
t.editor && (t.editor[i] = e);
|
|
2414
2583
|
},
|
|
2415
|
-
convertFrom: (
|
|
2416
|
-
},
|
|
2584
|
+
convertFrom: (t, i, e) => t.editor && Object.prototype.hasOwnProperty.call(t.editor, i) ? t.editor[i] : t[i]
|
|
2585
|
+
}, jt = {
|
|
2417
2586
|
button: { type: "button", name: "按钮" },
|
|
2418
2587
|
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
|
|
2419
2588
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
|
|
@@ -2459,10 +2628,12 @@ const Ot = {
|
|
|
2459
2628
|
drawer: { type: "drawer", name: "抽屉" },
|
|
2460
2629
|
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
|
|
2461
2630
|
"list-nav": { type: "list-nav", name: "列表导航" },
|
|
2631
|
+
nav: { type: "nav", name: "标签类导航" },
|
|
2462
2632
|
"list-view": { type: "list-view", name: "列表" },
|
|
2463
2633
|
"filter-bar": { type: "filter-bar", name: "筛选条" },
|
|
2464
2634
|
"language-textbox": { type: "language-textbox", name: "多语输入框" },
|
|
2465
2635
|
image: { type: "image", name: "图像" },
|
|
2636
|
+
avatar: { type: "avatar", name: "头像" },
|
|
2466
2637
|
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
|
|
2467
2638
|
"discussion-list": { type: "discussion-list", name: "评论列表" },
|
|
2468
2639
|
comment: { type: "comment", name: "评论区" },
|
|
@@ -2470,56 +2641,57 @@ const Ot = {
|
|
|
2470
2641
|
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
|
|
2471
2642
|
wizard: { type: "wizard", name: "向导", icon: "wizard" },
|
|
2472
2643
|
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
|
|
2473
|
-
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" }
|
|
2474
|
-
|
|
2475
|
-
|
|
2644
|
+
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
|
|
2645
|
+
step: { type: "step", name: "步骤条", icon: "step" }
|
|
2646
|
+
}, zt = {
|
|
2647
|
+
convertFrom: (t, i, e) => {
|
|
2476
2648
|
var r;
|
|
2477
|
-
const n =
|
|
2478
|
-
return ((r =
|
|
2649
|
+
const n = t.editor && t.editor[i] ? t.editor[i] : t[i];
|
|
2650
|
+
return ((r = jt[n]) == null ? void 0 : r.name) || n;
|
|
2479
2651
|
}
|
|
2480
|
-
},
|
|
2481
|
-
convertTo: (
|
|
2482
|
-
i
|
|
2652
|
+
}, Gt = {
|
|
2653
|
+
convertTo: (t, i, e, n) => {
|
|
2654
|
+
t[i] = t[i];
|
|
2483
2655
|
},
|
|
2484
|
-
convertFrom: (
|
|
2485
|
-
},
|
|
2486
|
-
convertTo: (
|
|
2487
|
-
(
|
|
2488
|
-
[
|
|
2656
|
+
convertFrom: (t, i, e) => t.editor ? e.getRealEditorType(t.editor.type) : ""
|
|
2657
|
+
}, Dt = {
|
|
2658
|
+
convertTo: (t, i, e, n) => {
|
|
2659
|
+
(t.type === "data-grid-column" || t.type === "tree-grid-column") && (t.formatter ? t.formatter[i] = e : t.formatter = {
|
|
2660
|
+
[i]: e
|
|
2489
2661
|
});
|
|
2490
2662
|
},
|
|
2491
|
-
convertFrom: (
|
|
2492
|
-
if (
|
|
2493
|
-
if (
|
|
2494
|
-
return
|
|
2495
|
-
if (
|
|
2496
|
-
return
|
|
2497
|
-
if (
|
|
2498
|
-
return
|
|
2499
|
-
if (
|
|
2500
|
-
return
|
|
2501
|
-
if (
|
|
2502
|
-
return
|
|
2503
|
-
if (
|
|
2504
|
-
return
|
|
2505
|
-
if (
|
|
2506
|
-
return
|
|
2507
|
-
if (
|
|
2508
|
-
return
|
|
2509
|
-
if (
|
|
2510
|
-
return
|
|
2511
|
-
if (
|
|
2512
|
-
return
|
|
2513
|
-
if (
|
|
2514
|
-
return
|
|
2663
|
+
convertFrom: (t, i, e) => {
|
|
2664
|
+
if (t.formatter) {
|
|
2665
|
+
if (i === "trueText")
|
|
2666
|
+
return t.formatter.trueText;
|
|
2667
|
+
if (i === "falseText")
|
|
2668
|
+
return t.formatter.falseText;
|
|
2669
|
+
if (i === "prefix")
|
|
2670
|
+
return t.formatter.prefix;
|
|
2671
|
+
if (i === "suffix")
|
|
2672
|
+
return t.formatter.suffix;
|
|
2673
|
+
if (i === "precision")
|
|
2674
|
+
return t.formatter.precision;
|
|
2675
|
+
if (i === "decimal")
|
|
2676
|
+
return t.formatter.decimal;
|
|
2677
|
+
if (i === "thousand")
|
|
2678
|
+
return t.formatter.thousand;
|
|
2679
|
+
if (i === "dateFormat")
|
|
2680
|
+
return t.formatter.dateFormat || "yyyy-MM-dd";
|
|
2681
|
+
if (i === "customFormat")
|
|
2682
|
+
return t.formatter.customFormat;
|
|
2683
|
+
if (i === "type")
|
|
2684
|
+
return t.formatter.type || "none";
|
|
2685
|
+
if (i === "customFormat")
|
|
2686
|
+
return t.formmater.customFormat;
|
|
2515
2687
|
}
|
|
2516
2688
|
return "none";
|
|
2517
2689
|
}
|
|
2518
|
-
},
|
|
2519
|
-
convertTo: (
|
|
2520
|
-
|
|
2521
|
-
[
|
|
2522
|
-
},
|
|
2690
|
+
}, Ht = {
|
|
2691
|
+
convertTo: (t, i, e, n) => {
|
|
2692
|
+
t.command ? t.command[i] = e : t.command = {
|
|
2693
|
+
[i]: e
|
|
2694
|
+
}, i === "enableType" && e === "default" && (t.command.enable = !0, t.command.commands = [
|
|
2523
2695
|
{
|
|
2524
2696
|
text: "编辑",
|
|
2525
2697
|
type: "primary",
|
|
@@ -2530,7 +2702,7 @@ const Ot = {
|
|
|
2530
2702
|
type: "danger",
|
|
2531
2703
|
command: "remove"
|
|
2532
2704
|
}
|
|
2533
|
-
]),
|
|
2705
|
+
]), i === "enableType" && e === "custom" && (t.command.enable = !0, t.command.commands = [
|
|
2534
2706
|
{
|
|
2535
2707
|
value: "add",
|
|
2536
2708
|
text: {
|
|
@@ -2558,187 +2730,198 @@ const Ot = {
|
|
|
2558
2730
|
},
|
|
2559
2731
|
type: "remove"
|
|
2560
2732
|
}
|
|
2561
|
-
]),
|
|
2733
|
+
]), i === "enableType" && e === "unable" && (t.command.enable = !1);
|
|
2562
2734
|
},
|
|
2563
|
-
convertFrom: (
|
|
2735
|
+
convertFrom: (t, i, e) => {
|
|
2564
2736
|
var n, r;
|
|
2565
|
-
if (
|
|
2566
|
-
if (
|
|
2567
|
-
const
|
|
2568
|
-
return
|
|
2737
|
+
if (t.command) {
|
|
2738
|
+
if (i === "enableType") {
|
|
2739
|
+
const l = (r = (n = t.command) == null ? void 0 : n.commands) == null ? void 0 : r.find((s) => s.command === "edit" && s.type === "primary");
|
|
2740
|
+
return t.command.enable ? l ? "default" : "custom" : "unable";
|
|
2569
2741
|
}
|
|
2570
|
-
if (
|
|
2571
|
-
return
|
|
2572
|
-
if (
|
|
2573
|
-
return
|
|
2574
|
-
if (
|
|
2575
|
-
return
|
|
2742
|
+
if (i === "commands")
|
|
2743
|
+
return t.command.enableType === "custom" ? t.command.commands : [];
|
|
2744
|
+
if (i === "formatter")
|
|
2745
|
+
return t.command.formatter;
|
|
2746
|
+
if (i === "count")
|
|
2747
|
+
return t.command.count;
|
|
2576
2748
|
}
|
|
2577
2749
|
return "";
|
|
2578
2750
|
}
|
|
2579
|
-
},
|
|
2580
|
-
convertTo: (
|
|
2581
|
-
|
|
2582
|
-
[
|
|
2583
|
-
},
|
|
2751
|
+
}, Qt = {
|
|
2752
|
+
convertTo: (t, i, e, n) => {
|
|
2753
|
+
t.column ? t.column[i] = e : t.column = {
|
|
2754
|
+
[i]: e
|
|
2755
|
+
}, i === "fitColumns" && e && (t.column.fitMode || (t.column.fitMode = "average"));
|
|
2584
2756
|
},
|
|
2585
|
-
convertFrom: (
|
|
2586
|
-
if (
|
|
2587
|
-
if (
|
|
2588
|
-
return
|
|
2589
|
-
if (
|
|
2590
|
-
return
|
|
2757
|
+
convertFrom: (t, i, e) => {
|
|
2758
|
+
if (t.column) {
|
|
2759
|
+
if (i === "fitColumns")
|
|
2760
|
+
return t.column.fitColumns;
|
|
2761
|
+
if (i === "fitMode")
|
|
2762
|
+
return t.column.fitMode;
|
|
2591
2763
|
}
|
|
2592
2764
|
return "";
|
|
2593
2765
|
}
|
|
2594
|
-
},
|
|
2595
|
-
convertTo: (
|
|
2596
|
-
|
|
2597
|
-
[
|
|
2598
|
-
},
|
|
2766
|
+
}, _t = {
|
|
2767
|
+
convertTo: (t, i, e, n) => {
|
|
2768
|
+
t.summary ? t.summary[i] = e : t.summary = {
|
|
2769
|
+
[i]: e
|
|
2770
|
+
}, i === "enable" && e && (t.summary ? t.summary.groupFields || (t.summary.groupFields = []) : t.summary = {
|
|
2599
2771
|
enable: e,
|
|
2600
2772
|
groupFields: []
|
|
2601
2773
|
});
|
|
2602
2774
|
},
|
|
2603
|
-
convertFrom: (
|
|
2775
|
+
convertFrom: (t, i, e) => {
|
|
2604
2776
|
var n;
|
|
2605
|
-
return
|
|
2777
|
+
return i === "customSummaryStyle" ? t.summary.customSummaryStyle : i === "position" ? ((n = t.summary) == null ? void 0 : n[i]) || "bottom" : t.summary && i === "enable" ? t.summary.enable : t.type === "data-grid-column" ? t.enableSummary === void 0 ? !1 : t.enableSummary : "";
|
|
2606
2778
|
}
|
|
2607
|
-
},
|
|
2608
|
-
convertTo: (
|
|
2609
|
-
|
|
2610
|
-
[
|
|
2611
|
-
},
|
|
2779
|
+
}, Xt = {
|
|
2780
|
+
convertTo: (t, i, e, n) => {
|
|
2781
|
+
t.group ? t.group[i] = e : t.group = {
|
|
2782
|
+
[i]: e
|
|
2783
|
+
}, i === "enable" && e && (t.group ? t.group.groupFields || (t.group.groupFields = []) : t.group = {
|
|
2612
2784
|
enable: e,
|
|
2613
2785
|
groupFields: [],
|
|
2614
2786
|
showSummary: !1
|
|
2615
2787
|
});
|
|
2616
2788
|
},
|
|
2617
|
-
convertFrom: (
|
|
2618
|
-
if (
|
|
2619
|
-
if (
|
|
2620
|
-
return
|
|
2621
|
-
if (
|
|
2622
|
-
return
|
|
2789
|
+
convertFrom: (t, i, e) => {
|
|
2790
|
+
if (t.group) {
|
|
2791
|
+
if (i === "enable")
|
|
2792
|
+
return t.group.enable;
|
|
2793
|
+
if (i === "showSummary")
|
|
2794
|
+
return t.group.showSummary;
|
|
2623
2795
|
}
|
|
2624
2796
|
}
|
|
2625
|
-
},
|
|
2626
|
-
convertFrom: (
|
|
2627
|
-
convertTo: (
|
|
2797
|
+
}, Zt = {
|
|
2798
|
+
convertFrom: (t, i) => t.binding ? t.binding.path : "",
|
|
2799
|
+
convertTo: (t, i, e) => {
|
|
2628
2800
|
if (e && e.length > 0) {
|
|
2629
2801
|
const n = e[0];
|
|
2630
|
-
|
|
2802
|
+
t.binding || (t.binding = {}), t.binding.type = "Form", t.binding.path = n.bindingField, t.binding.field = n.id, t.binding.fullPath = n.path, t.path = n.bindingPath;
|
|
2631
2803
|
}
|
|
2632
2804
|
}
|
|
2633
|
-
},
|
|
2634
|
-
convertTo: (
|
|
2635
|
-
|
|
2805
|
+
}, Jt = {
|
|
2806
|
+
convertTo: (t, i, e, n) => {
|
|
2807
|
+
t.pagination || (t.pagination = {}), i === "sizeLimits" ? t.pagination.sizeLimits = e.split(",") : t.pagination[i] = e;
|
|
2636
2808
|
},
|
|
2637
|
-
convertFrom: (
|
|
2638
|
-
},
|
|
2639
|
-
convertTo: (
|
|
2640
|
-
|
|
2809
|
+
convertFrom: (t, i, e) => t.pagination ? i === "sizeLimits" ? t.pagination.sizeLimits.join(",") : t.pagination[i] : t[i]
|
|
2810
|
+
}, Yt = {
|
|
2811
|
+
convertTo: (t, i, e, n) => {
|
|
2812
|
+
t.rowNumber || (t.rowNumber = {}), t.rowNumber[i] = e;
|
|
2641
2813
|
},
|
|
2642
|
-
convertFrom: (
|
|
2643
|
-
},
|
|
2644
|
-
convertTo: (
|
|
2645
|
-
|
|
2814
|
+
convertFrom: (t, i, e) => t.rowNumber ? t.rowNumber[i] : t[i]
|
|
2815
|
+
}, Kt = {
|
|
2816
|
+
convertTo: (t, i, e, n) => {
|
|
2817
|
+
t.selection || (t.selection = {}), t.selection[i] = e;
|
|
2646
2818
|
},
|
|
2647
|
-
convertFrom: (
|
|
2819
|
+
convertFrom: (t, i, e) => {
|
|
2648
2820
|
var n, r;
|
|
2649
|
-
return
|
|
2821
|
+
return i === "showCheckbox" ? (n = t.selection) != null && n.multiSelect ? !0 : (r = t.selection) == null ? void 0 : r.showCheckbox : t.selection ? t.selection[i] : t[i];
|
|
2650
2822
|
}
|
|
2651
|
-
},
|
|
2652
|
-
convertFrom: (
|
|
2653
|
-
},
|
|
2654
|
-
convertFrom: (
|
|
2655
|
-
convertTo: (
|
|
2656
|
-
i
|
|
2823
|
+
}, ei = {
|
|
2824
|
+
convertFrom: (t, i, e) => t[i] && t[i].length ? `共 ${t[i].length} 项` : ""
|
|
2825
|
+
}, ti = {
|
|
2826
|
+
convertFrom: (t, i) => t[i] || "",
|
|
2827
|
+
convertTo: (t, i, e) => {
|
|
2828
|
+
t[i] = e;
|
|
2657
2829
|
}
|
|
2658
|
-
},
|
|
2659
|
-
convertTo: (
|
|
2660
|
-
|
|
2830
|
+
}, ii = {
|
|
2831
|
+
convertTo: (t, i, e, n) => {
|
|
2832
|
+
t.size || (t.size = {}), t.size[i] = e;
|
|
2661
2833
|
},
|
|
2662
|
-
convertFrom: (
|
|
2663
|
-
},
|
|
2664
|
-
convertFrom: (
|
|
2834
|
+
convertFrom: (t, i, e) => t.size ? t.size[i] : t[i]
|
|
2835
|
+
}, ni = {
|
|
2836
|
+
convertFrom: (t, i, e) => {
|
|
2665
2837
|
var n, r;
|
|
2666
|
-
return (n =
|
|
2838
|
+
return (n = t.formatter) != null && n.data && i === "formatterEnumData" && !t.formatterEnumData ? (r = t.formatter) == null ? void 0 : r.data : t.formatterEnumData;
|
|
2667
2839
|
}
|
|
2668
|
-
},
|
|
2669
|
-
convertTo: (
|
|
2670
|
-
|
|
2840
|
+
}, ri = {
|
|
2841
|
+
convertTo: (t, i, e, n) => {
|
|
2842
|
+
t.sort || (t.sort = {}), t.sort[i] = e;
|
|
2671
2843
|
},
|
|
2672
|
-
convertFrom: (
|
|
2844
|
+
convertFrom: (t, i, e) => {
|
|
2673
2845
|
var n, r;
|
|
2674
|
-
if (
|
|
2675
|
-
return ((n =
|
|
2676
|
-
if (
|
|
2677
|
-
return !!((r =
|
|
2678
|
-
}
|
|
2679
|
-
},
|
|
2680
|
-
convertTo: (
|
|
2681
|
-
|
|
2846
|
+
if (i === "mode")
|
|
2847
|
+
return ((n = t.sort) == null ? void 0 : n.mode) || "client";
|
|
2848
|
+
if (i === "multiSort")
|
|
2849
|
+
return !!((r = t.sort) != null && r.multiSort);
|
|
2850
|
+
}
|
|
2851
|
+
}, oi = {
|
|
2852
|
+
convertTo: (t, i, e, n) => {
|
|
2853
|
+
t.filter || (t.filter = {}), t.filter[i] = e;
|
|
2682
2854
|
},
|
|
2683
|
-
convertFrom: (
|
|
2855
|
+
convertFrom: (t, i, e) => {
|
|
2684
2856
|
var n;
|
|
2685
|
-
if (
|
|
2686
|
-
return ((n =
|
|
2857
|
+
if (i === "mode")
|
|
2858
|
+
return ((n = t.filter) == null ? void 0 : n.mode) || "client";
|
|
2687
2859
|
}
|
|
2688
|
-
},
|
|
2689
|
-
convertTo: (
|
|
2690
|
-
|
|
2691
|
-
[
|
|
2860
|
+
}, li = {
|
|
2861
|
+
convertTo: (t, i, e, n) => {
|
|
2862
|
+
t.rowOption ? t.rowOption[i] = e : t.rowOption = {
|
|
2863
|
+
[i]: e
|
|
2692
2864
|
};
|
|
2693
2865
|
},
|
|
2694
|
-
convertFrom: (
|
|
2695
|
-
if (
|
|
2696
|
-
if (
|
|
2697
|
-
return
|
|
2698
|
-
if (
|
|
2699
|
-
return
|
|
2700
|
-
if (
|
|
2701
|
-
return
|
|
2866
|
+
convertFrom: (t, i, e) => {
|
|
2867
|
+
if (t.rowOption) {
|
|
2868
|
+
if (i === "customRowStyle")
|
|
2869
|
+
return t.rowOption.customRowStyle;
|
|
2870
|
+
if (i === "customCellStyle")
|
|
2871
|
+
return t.rowOption.customCellStyle;
|
|
2872
|
+
if (i === "height")
|
|
2873
|
+
return t.rowOption.height;
|
|
2702
2874
|
}
|
|
2703
2875
|
return "";
|
|
2704
2876
|
}
|
|
2705
|
-
},
|
|
2706
|
-
convertTo: (
|
|
2707
|
-
(
|
|
2877
|
+
}, si = {
|
|
2878
|
+
convertTo: (t, i, e, n) => {
|
|
2879
|
+
(t.type === "data-grid-column" || t.type === "tree-grid-column") && (t[i] = e, i === "columnTemplateType" && e === "hyperlink" && (t.onClickLinkCommand ? t.columnTemplate = `
|
|
2708
2880
|
<span class="f-pretend-link f-cursor-pointer"
|
|
2709
|
-
@click="(ctx)=>viewModel.current.${
|
|
2710
|
-
{{rowData.${
|
|
2711
|
-
</span>` :
|
|
2881
|
+
@click="(ctx)=>viewModel.current.${t.onClickLinkCommand || ""}({id: rowData.id,context: ctx})">
|
|
2882
|
+
{{rowData.${t.field}}}
|
|
2883
|
+
</span>` : t.columnTemplate = `
|
|
2712
2884
|
<span class="f-pretend-link f-cursor-pointer">
|
|
2713
|
-
{{rowData.${
|
|
2714
|
-
</span>`),
|
|
2885
|
+
{{rowData.${t.field}}}
|
|
2886
|
+
</span>`), i === "columnTemplateType" && e === "default" && (t.columnTemplate = ""), i === "columnTemplateType" && e === "custom" && (t.columnTemplate = ""));
|
|
2887
|
+
},
|
|
2888
|
+
convertFrom: (t, i, e) => i === "columnTemplate" ? t.columnTemplate : i === "columnTemplateType" ? t.columnTemplateType ? t.columnTemplateType || "default" : t.columnTemplate && !t.onClickLinkCommand ? "custom" : t.columnTemplate && t.onClickLinkCommand ? "hyperlink" : "default" : ""
|
|
2889
|
+
}, ai = {
|
|
2890
|
+
convertTo: (t, i, e, n) => {
|
|
2891
|
+
t.hierarchy || (t.hierarchy = {
|
|
2892
|
+
cascadeOption: {}
|
|
2893
|
+
}), t.hierarchy.cascadeOption || (t.hierarchy.cascadeOption = {}), t.hierarchy.cascadeOption[i] = e;
|
|
2715
2894
|
},
|
|
2716
|
-
convertFrom: (
|
|
2895
|
+
convertFrom: (t, i, e) => {
|
|
2896
|
+
var n, r;
|
|
2897
|
+
return !!((r = (n = t.hierarchy) == null ? void 0 : n.cascadeOption) != null && r[i]);
|
|
2898
|
+
}
|
|
2717
2899
|
};
|
|
2718
|
-
function
|
|
2900
|
+
function ke(t, i, e) {
|
|
2719
2901
|
const n = /* @__PURE__ */ new Map([
|
|
2720
|
-
["/converter/appearance.converter",
|
|
2721
|
-
["/converter/buttons.converter",
|
|
2722
|
-
["/converter/property-editor.converter",
|
|
2723
|
-
["/converter/items-count.converter",
|
|
2724
|
-
["/converter/type.converter",
|
|
2725
|
-
["/converter/change-editor.converter",
|
|
2726
|
-
["/converter/change-formatter.converter",
|
|
2727
|
-
["/converter/column-command.converter",
|
|
2728
|
-
["/converter/column-option.converter",
|
|
2729
|
-
["/converter/summary.converter",
|
|
2730
|
-
["/converter/group.converter",
|
|
2731
|
-
["/converter/form-group-label.converter",
|
|
2732
|
-
["/converter/field-selector.converter",
|
|
2733
|
-
["/converter/pagination.converter",
|
|
2734
|
-
["/converter/row-number.converter",
|
|
2735
|
-
["/converter/grid-selection.converter",
|
|
2736
|
-
["/converter/size.converter",
|
|
2737
|
-
["/converter/change-formatter-enum.converter",
|
|
2738
|
-
["/converter/grid-sort.converter",
|
|
2739
|
-
["/converter/grid-filter.converter",
|
|
2740
|
-
["/converter/row-option.converter",
|
|
2741
|
-
["/converter/change-formatter-type.converter",
|
|
2902
|
+
["/converter/appearance.converter", $t],
|
|
2903
|
+
["/converter/buttons.converter", Wt],
|
|
2904
|
+
["/converter/property-editor.converter", qt],
|
|
2905
|
+
["/converter/items-count.converter", ei],
|
|
2906
|
+
["/converter/type.converter", zt],
|
|
2907
|
+
["/converter/change-editor.converter", Gt],
|
|
2908
|
+
["/converter/change-formatter.converter", Dt],
|
|
2909
|
+
["/converter/column-command.converter", Ht],
|
|
2910
|
+
["/converter/column-option.converter", Qt],
|
|
2911
|
+
["/converter/summary.converter", _t],
|
|
2912
|
+
["/converter/group.converter", Xt],
|
|
2913
|
+
["/converter/form-group-label.converter", ti],
|
|
2914
|
+
["/converter/field-selector.converter", Zt],
|
|
2915
|
+
["/converter/pagination.converter", Jt],
|
|
2916
|
+
["/converter/row-number.converter", Yt],
|
|
2917
|
+
["/converter/grid-selection.converter", Kt],
|
|
2918
|
+
["/converter/size.converter", ii],
|
|
2919
|
+
["/converter/change-formatter-enum.converter", ni],
|
|
2920
|
+
["/converter/grid-sort.converter", ri],
|
|
2921
|
+
["/converter/grid-filter.converter", oi],
|
|
2922
|
+
["/converter/row-option.converter", li],
|
|
2923
|
+
["/converter/change-formatter-type.converter", si],
|
|
2924
|
+
["/converter/tree-auto-check.converter", ai]
|
|
2742
2925
|
]), r = /* @__PURE__ */ new Map([
|
|
2743
2926
|
["string", { type: "input-group", enableClear: !1 }],
|
|
2744
2927
|
["boolean", {
|
|
@@ -2763,185 +2946,224 @@ function Se(i, t, e) {
|
|
|
2763
2946
|
["array", { type: "button-edit" }],
|
|
2764
2947
|
["number", { type: "number-spinner", placeholder: "" }],
|
|
2765
2948
|
["events-editor", { type: "events-editor", hide: !0 }]
|
|
2766
|
-
]),
|
|
2767
|
-
function
|
|
2768
|
-
return () =>
|
|
2949
|
+
]), l = Ut();
|
|
2950
|
+
function s(d, p) {
|
|
2951
|
+
return () => l.parseValueSchema(d, p);
|
|
2769
2952
|
}
|
|
2770
|
-
function m(
|
|
2771
|
-
return
|
|
2953
|
+
function m(d, p, h) {
|
|
2954
|
+
return d.includes("visible") && p.visible !== void 0 ? typeof p.visible == "boolean" ? () => !!p.visible : p.visible === void 0 ? !0 : s(p.visible, h) : () => !0;
|
|
2772
2955
|
}
|
|
2773
|
-
function a(
|
|
2774
|
-
return
|
|
2956
|
+
function a(d, p, h) {
|
|
2957
|
+
return d.includes("readonly") && p.readonly !== void 0 ? typeof p.readonly == "boolean" ? () => !!p.readonly : s(p.readonly, h) : () => !1;
|
|
2775
2958
|
}
|
|
2776
|
-
function
|
|
2777
|
-
const h =
|
|
2959
|
+
function u(d, p) {
|
|
2960
|
+
const h = d.$converter || p;
|
|
2778
2961
|
return typeof h == "string" && h && n.has(h) ? n.get(h) || null : h || null;
|
|
2779
2962
|
}
|
|
2780
|
-
function
|
|
2781
|
-
return Object.keys(
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2784
|
-
const
|
|
2785
|
-
let
|
|
2786
|
-
const q =
|
|
2963
|
+
function f(d, p, h, b, w, O = "", L = "") {
|
|
2964
|
+
return Object.keys(d).map((V) => {
|
|
2965
|
+
const A = F(1), R = V, k = d[V], I = Object.keys(k), $ = k.title, N = k.type, U = r.get(N) || { type: "input-group", enableClear: !1 }, x = k.editor ? Object.assign({}, U, k.editor) : Object.assign({}, U), P = m(I, k, p), C = a(I, k, p);
|
|
2966
|
+
x.readonly = x.readonly === void 0 ? C() : x.readonly;
|
|
2967
|
+
const B = k.type === "cascade" ? f(k.properties, p, h, b, w, O, L) : [], S = !0;
|
|
2968
|
+
let M = u(k, L);
|
|
2969
|
+
const q = W({
|
|
2787
2970
|
get() {
|
|
2788
|
-
if (
|
|
2789
|
-
if (["class", "style"].find((
|
|
2790
|
-
return
|
|
2791
|
-
const
|
|
2792
|
-
return Object.prototype.hasOwnProperty.call(
|
|
2971
|
+
if (A.value) {
|
|
2972
|
+
if (["class", "style"].find(($e) => $e === R) && !M && (M = n.get("/converter/appearance.converter") || null), M && M.convertFrom)
|
|
2973
|
+
return M.convertFrom(h, V, w, O);
|
|
2974
|
+
const z = h[V];
|
|
2975
|
+
return Object.prototype.hasOwnProperty.call(k, "defaultValue") && (z === void 0 || typeof z == "string" && z === "") ? k.type === "boolean" ? k.defaultValue : k.defaultValue || "" : z;
|
|
2793
2976
|
}
|
|
2794
2977
|
return null;
|
|
2795
2978
|
},
|
|
2796
|
-
set(
|
|
2797
|
-
|
|
2979
|
+
set(z) {
|
|
2980
|
+
A.value += 1, M && M.convertTo ? (M.convertTo(b, V, z, w, O), M.convertTo(h, V, z, w, O)) : (b[V] = z, h[V] = z);
|
|
2798
2981
|
}
|
|
2799
|
-
}), { refreshPanelAfterChanged:
|
|
2800
|
-
return p[
|
|
2982
|
+
}), { refreshPanelAfterChanged: G, description: _, isExpand: Re, parentPropertyID: Ue } = k, se = { propertyID: R, propertyName: $, propertyType: N, propertyValue: q, editor: x, visible: P, readonly: C, cascadeConfig: B, hideCascadeTitle: S, refreshPanelAfterChanged: G, description: _, isExpand: Re, parentPropertyID: Ue };
|
|
2983
|
+
return p[R] = se, se;
|
|
2801
2984
|
});
|
|
2802
2985
|
}
|
|
2803
|
-
function o(
|
|
2804
|
-
const
|
|
2805
|
-
return
|
|
2806
|
-
const T =
|
|
2807
|
-
return { categoryId:
|
|
2986
|
+
function o(d, p, h = {}) {
|
|
2987
|
+
const b = {}, w = t[d];
|
|
2988
|
+
return w && w.categories ? Object.keys(w.categories).map((L) => {
|
|
2989
|
+
const T = w.categories[L], V = T == null ? void 0 : T.title, A = f(T.properties || {}, b, {}, h, p);
|
|
2990
|
+
return { categoryId: L, categoryName: V, properties: A };
|
|
2808
2991
|
}) : [];
|
|
2809
2992
|
}
|
|
2810
|
-
function d
|
|
2811
|
-
const
|
|
2812
|
-
if (
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2815
|
-
|
|
2993
|
+
function c(d, p, h, b, w = "") {
|
|
2994
|
+
const O = p.$ref.schema, L = p.$ref.converter, T = h[O], V = T.type, A = e(T), R = {}, k = t[V];
|
|
2995
|
+
if (k && k.categories) {
|
|
2996
|
+
const I = k.categories[d], $ = I == null ? void 0 : I.title;
|
|
2997
|
+
L && Object.keys(I.properties).forEach((x) => {
|
|
2998
|
+
I.properties[x].$converter = L;
|
|
2816
2999
|
});
|
|
2817
|
-
const
|
|
2818
|
-
return { categoryId:
|
|
3000
|
+
const N = (I == null ? void 0 : I.properties) || {}, U = f(N, R, A, T, b, w);
|
|
3001
|
+
return { categoryId: d, categoryName: $, properties: U };
|
|
2819
3002
|
}
|
|
2820
|
-
return { categoryId:
|
|
2821
|
-
}
|
|
2822
|
-
function
|
|
2823
|
-
const
|
|
2824
|
-
let
|
|
2825
|
-
if (!(
|
|
2826
|
-
const
|
|
2827
|
-
return Object.keys(
|
|
2828
|
-
const
|
|
2829
|
-
if (
|
|
2830
|
-
|
|
3003
|
+
return { categoryId: d, categoryName: "", properties: [] };
|
|
3004
|
+
}
|
|
3005
|
+
function g(d, p, h, b, w) {
|
|
3006
|
+
const O = d.type, L = e(d), T = {};
|
|
3007
|
+
let V = w || t[O];
|
|
3008
|
+
if (!(V && Object.keys(V).length > 0) && h && h.getPropConfig && (V = h.getPropConfig(b)), V && V.categories) {
|
|
3009
|
+
const R = [];
|
|
3010
|
+
return Object.keys(V.categories).map((k) => {
|
|
3011
|
+
const I = V.categories[k];
|
|
3012
|
+
if (I.$ref) {
|
|
3013
|
+
R.push(c(k, I, d, p, b));
|
|
2831
3014
|
return;
|
|
2832
3015
|
}
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2835
|
-
}),
|
|
3016
|
+
const $ = I == null ? void 0 : I.title, N = I == null ? void 0 : I.tabId, U = I == null ? void 0 : I.tabName, x = I == null ? void 0 : I.hide, P = I == null ? void 0 : I.hideTitle, C = f(I.properties || {}, T, L, d, p, b, I.$converter), { setPropertyRelates: B } = I, S = I == null ? void 0 : I.parentPropertyID;
|
|
3017
|
+
R.push({ categoryId: k, categoryName: $, tabId: N, tabName: U, hide: x, properties: C, hideTitle: P, setPropertyRelates: B, parentPropertyID: S });
|
|
3018
|
+
}), R;
|
|
2836
3019
|
}
|
|
2837
3020
|
return [];
|
|
2838
3021
|
}
|
|
2839
3022
|
return {
|
|
2840
|
-
getPropertyConfigBySchema:
|
|
3023
|
+
getPropertyConfigBySchema: g,
|
|
2841
3024
|
getPropertyConfigByType: o,
|
|
2842
3025
|
propertyConverterMap: n
|
|
2843
3026
|
};
|
|
2844
3027
|
}
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2847
|
-
const
|
|
2848
|
-
|
|
2849
|
-
function
|
|
2850
|
-
return
|
|
3028
|
+
const Pe = {}, Ve = {};
|
|
3029
|
+
ke(Pe, Ve, Nt);
|
|
3030
|
+
const Be = {}, Le = {}, { resolveSchemaWithDefaultValue: di } = Te(Be, Le), Oe = {}, Ne = {};
|
|
3031
|
+
ke(Oe, Ne, di);
|
|
3032
|
+
function ci(t, i, e = /* @__PURE__ */ new Map(), n = (s, m, a, u) => m, r = {}, l = (s) => s) {
|
|
3033
|
+
return Ee[i.title] = i, Me[i.title] = n, Pe[i.title] = r, Ve[i.title] = l, Be[i.title] = i, Le[i.title] = n, Oe[i.title] = r, Ne[i.title] = l, (s = {}, m = !0) => {
|
|
2851
3034
|
if (!m)
|
|
2852
|
-
return
|
|
2853
|
-
const a =
|
|
2854
|
-
return Object.assign(
|
|
3035
|
+
return Rt(s, e);
|
|
3036
|
+
const a = At(s, i, e), u = Object.keys(t).reduce((f, o) => (f[o] = t[o].default, f), {});
|
|
3037
|
+
return Object.assign(u, a);
|
|
2855
3038
|
};
|
|
2856
3039
|
}
|
|
2857
|
-
const
|
|
3040
|
+
const Ae = Object.assign({}, le, {
|
|
2858
3041
|
componentId: { type: String, default: "" }
|
|
2859
|
-
}),
|
|
3042
|
+
}), ui = ci(Ae, we, Ce, Fe), fi = /* @__PURE__ */ Q({
|
|
2860
3043
|
name: "FFilterBarDesign",
|
|
2861
|
-
props:
|
|
3044
|
+
props: Ae,
|
|
2862
3045
|
emits: ["Clear", "Remove", "Reset"],
|
|
2863
|
-
setup(
|
|
2864
|
-
const e =
|
|
3046
|
+
setup(t, i) {
|
|
3047
|
+
const e = F(!1), n = F(!1), r = F(!1), l = F(null), s = It(t), {
|
|
2865
3048
|
filterFields: m,
|
|
2866
3049
|
filterItems: a,
|
|
2867
|
-
loadFilterItems:
|
|
2868
|
-
} =
|
|
2869
|
-
cancelWidthObserver:
|
|
2870
|
-
setupWidthObserver:
|
|
3050
|
+
loadFilterItems: u
|
|
3051
|
+
} = s, f = F(0), o = F(), c = X("design-item-context"), g = X("designer-host-service"), d = Ot(c, g), p = Qe(o, c, d), h = Ie(l, r), {
|
|
3052
|
+
cancelWidthObserver: b,
|
|
3053
|
+
setupWidthObserver: w
|
|
2871
3054
|
} = h, {
|
|
2872
|
-
resolveEditorProps:
|
|
2873
|
-
} =
|
|
2874
|
-
|
|
2875
|
-
useFilterItemsComposition:
|
|
2876
|
-
resolveEditorProps:
|
|
3055
|
+
resolveEditorProps: O
|
|
3056
|
+
} = be();
|
|
3057
|
+
me("useFilterItemsComposition", {
|
|
3058
|
+
useFilterItemsComposition: s,
|
|
3059
|
+
resolveEditorProps: O
|
|
2877
3060
|
});
|
|
2878
|
-
const
|
|
2879
|
-
const
|
|
3061
|
+
const L = F(), T = W(() => {
|
|
3062
|
+
const N = {
|
|
2880
3063
|
display: m.value && m.value.length ? "" : "none"
|
|
2881
3064
|
};
|
|
2882
|
-
return
|
|
3065
|
+
return he(N, t == null ? void 0 : t.customStyle);
|
|
2883
3066
|
});
|
|
2884
|
-
|
|
2885
|
-
o.value.componentInstance = p,
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
3067
|
+
ee(() => {
|
|
3068
|
+
if (o.value.componentInstance = p, w(), t.filterType === "tile" && t.tileShowType === "all-in-one") {
|
|
3069
|
+
const N = L.value.querySelector(".condition-div");
|
|
3070
|
+
N.scrollWidth > N.clientWidth && (L.value.className = L.value.className + " all-in-one--item-fill");
|
|
3071
|
+
}
|
|
3072
|
+
}), ve(() => {
|
|
3073
|
+
b();
|
|
3074
|
+
}), i.expose(p.value), ge(() => t.fields, (N) => {
|
|
3075
|
+
u(N, []), f.value++;
|
|
2890
3076
|
}, {
|
|
2891
3077
|
immediate: !0
|
|
2892
3078
|
});
|
|
2893
|
-
const
|
|
3079
|
+
const V = W(() => n.value && e.value), A = W(() => ({
|
|
2894
3080
|
"f-filter-list": !0,
|
|
2895
|
-
"f-filter-list-extend":
|
|
3081
|
+
"f-filter-list-extend": V.value
|
|
2896
3082
|
}));
|
|
2897
|
-
function
|
|
2898
|
-
return
|
|
2899
|
-
class:
|
|
2900
|
-
key:
|
|
2901
|
-
}, [a.value.map((
|
|
2902
|
-
filterItem:
|
|
3083
|
+
function R() {
|
|
3084
|
+
return y("div", {
|
|
3085
|
+
class: A.value,
|
|
3086
|
+
key: t.id + "-main-" + f.value
|
|
3087
|
+
}, [a.value.map((N, U) => y(Tt, {
|
|
3088
|
+
filterItem: N
|
|
2903
3089
|
}, null))]);
|
|
2904
3090
|
}
|
|
2905
|
-
function
|
|
2906
|
-
return r.value &&
|
|
3091
|
+
function k() {
|
|
3092
|
+
return r.value && y("div", {
|
|
2907
3093
|
class: "f-filter-list-ellipsis"
|
|
2908
|
-
}, [
|
|
3094
|
+
}, [j("...")]);
|
|
3095
|
+
}
|
|
3096
|
+
const I = St(t, i, s);
|
|
3097
|
+
function $() {
|
|
3098
|
+
let N = "", U;
|
|
3099
|
+
t.tileShowType !== "all-in-one" && (N = t.lineLabelWidth === "auto" ? " filter-item-wrap" : "", U = t.tileShowType === "single" ? "col-12" + N : N ? "col-12 col-md-6 col-xl-3 col-el-2" + N : void 0);
|
|
3100
|
+
const x = t.tileShowType === "multiline";
|
|
3101
|
+
return y("div", {
|
|
3102
|
+
class: "f-list-filter d-flex" + t.customClass,
|
|
3103
|
+
style: T.value
|
|
3104
|
+
}, [t.tileShowType !== "all-in-one" && y("div", {
|
|
3105
|
+
class: "flex-fill"
|
|
3106
|
+
}, [y(fe, {
|
|
3107
|
+
fields: m.value,
|
|
3108
|
+
conditions: a.value,
|
|
3109
|
+
itemClass: U,
|
|
3110
|
+
autoResponse: x
|
|
3111
|
+
}, null), j(" ")]), t.tileShowType === "all-in-one" && y("div", {
|
|
3112
|
+
class: "filter-inputs-main-basis-wrapper filter-input--all-in-one" + t.customClass,
|
|
3113
|
+
ref: L,
|
|
3114
|
+
style: T.value
|
|
3115
|
+
}, [y(fe, {
|
|
3116
|
+
style: "flex-wrap:nowrap!important;overflow-x:auto;",
|
|
3117
|
+
fields: m.value,
|
|
3118
|
+
customClass: t.allInOneAlign === "right" ? "justify-content-end" : "",
|
|
3119
|
+
conditions: a.value,
|
|
3120
|
+
itemClass: "filter-input-list filter-item-wrap",
|
|
3121
|
+
autoResponse: !1
|
|
3122
|
+
}, null)]), !t.liveSearch && y("div", {
|
|
3123
|
+
class: "filter-search-btn filter-search-btn--filter"
|
|
3124
|
+
}, [y("button", {
|
|
3125
|
+
class: "btn btn-primary"
|
|
3126
|
+
}, [t.filterText])]), I()]);
|
|
2909
3127
|
}
|
|
2910
|
-
|
|
2911
|
-
return () => b("div", {
|
|
3128
|
+
return () => t.filterType === "light" ? y("div", {
|
|
2912
3129
|
ref: o,
|
|
2913
|
-
class: "f-filter-wrapper " +
|
|
2914
|
-
style:
|
|
2915
|
-
}, [
|
|
3130
|
+
class: "f-filter-wrapper " + t.customClass,
|
|
3131
|
+
style: T.value
|
|
3132
|
+
}, [y("div", {
|
|
2916
3133
|
class: "f-filter-wrapper-inner f-utils-fill"
|
|
2917
|
-
}, [
|
|
3134
|
+
}, [y("div", {
|
|
2918
3135
|
class: "f-filter-main f-utils-fill"
|
|
2919
|
-
}, [
|
|
3136
|
+
}, [y("div", {
|
|
2920
3137
|
class: "f-filter-list-wrapper flex-fill",
|
|
2921
|
-
ref:
|
|
2922
|
-
}, [
|
|
3138
|
+
ref: l
|
|
3139
|
+
}, [R()]), k(), I()]), !t.liveSearch && y("div", {
|
|
3140
|
+
class: "filter-search-btn filter-search-btn--filter",
|
|
3141
|
+
style: "margin:0 8px 0 0;"
|
|
3142
|
+
}, [y("button", {
|
|
3143
|
+
class: "btn btn-primary"
|
|
3144
|
+
}, [t.filterText])]), r.value && y("div", {
|
|
2923
3145
|
class: "f-filter-extend-btn"
|
|
2924
|
-
}, [
|
|
3146
|
+
}, [y("button", {
|
|
2925
3147
|
class: "btn btn-link"
|
|
2926
|
-
}, [
|
|
3148
|
+
}, [y("span", {
|
|
2927
3149
|
class: "extend-btn-text"
|
|
2928
|
-
}, [
|
|
3150
|
+
}, [j("展开")]), y("span", {
|
|
2929
3151
|
class: "extend-btn-arrow f-icon f-icon-arrow-chevron-down"
|
|
2930
|
-
}, null)])])])]);
|
|
3152
|
+
}, null)])])])]) : $();
|
|
2931
3153
|
}
|
|
2932
3154
|
});
|
|
2933
|
-
|
|
2934
|
-
|
|
3155
|
+
H.install = (t) => {
|
|
3156
|
+
t.component(H.name, H);
|
|
2935
3157
|
};
|
|
2936
|
-
|
|
2937
|
-
|
|
3158
|
+
H.register = (t, i, e, n) => {
|
|
3159
|
+
t["filter-bar"] = H, i["filter-bar"] = mt;
|
|
2938
3160
|
};
|
|
2939
|
-
|
|
2940
|
-
|
|
3161
|
+
H.registerDesigner = (t, i, e) => {
|
|
3162
|
+
t["filter-bar"] = fi, i["filter-bar"] = ui;
|
|
2941
3163
|
};
|
|
2942
3164
|
export {
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
3165
|
+
H as FFilterBar,
|
|
3166
|
+
H as default,
|
|
3167
|
+
le as filterBarProps,
|
|
3168
|
+
mt as propsResolver
|
|
2947
3169
|
};
|