@farris/ui-vue 1.6.5-beta.8 → 1.6.6
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 +335 -335
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +6 -6
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +139 -134
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +300 -300
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -6
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +295 -295
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +99 -99
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3407 -3338
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +833 -832
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +5 -5
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +173 -172
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +637 -637
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +737 -732
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +728 -706
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +670 -665
- package/components/filter-condition-editor/index.umd.cjs +2 -2
- package/components/flow-canvas/index.esm.js +205 -205
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +77 -76
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +4 -2
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +42 -40
- package/components/list-view/index.umd.cjs +2 -2
- package/components/lookup/index.esm.js +118 -118
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +482 -483
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +424 -424
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +276 -276
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +161 -161
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +322 -316
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +541 -534
- package/components/order/index.umd.cjs +2 -2
- package/components/page-header/index.esm.js +1 -1
- package/components/page-header/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +58 -56
- package/components/popover/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +216 -216
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +489 -467
- package/components/query-solution/index.umd.cjs +3 -3
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +282 -282
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +875 -873
- package/components/response-layout-editor/index.umd.cjs +1 -1
- 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 +504 -496
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/search-box/index.esm.js +76 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +212 -212
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +382 -377
- package/components/sort-condition-editor/index.umd.cjs +2 -2
- package/components/tabs/index.esm.js +584 -582
- package/components/tabs/index.umd.cjs +2 -2
- package/components/textarea/index.esm.js +362 -362
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +9799 -0
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/time-picker/package.json +8 -0
- package/components/time-picker/style.js +6 -0
- package/components/transfer/index.esm.js +81 -79
- package/components/transfer/index.umd.cjs +2 -2
- package/components/tree-grid/index.esm.js +100 -100
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2361 -2279
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/video/index.esm.js +220 -220
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +4856 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +254 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +381 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +15445 -0
- package/designer/data-grid/index.umd.cjs +23 -0
- package/designer/data-view/index.esm.js +854 -0
- package/designer/data-view/index.umd.cjs +38 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +525 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +22331 -0
- package/designer/farris-designer.all.umd.cjs +34 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +1099 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/list-view/index.css +1 -0
- package/designer/list-view/index.esm.js +4685 -0
- package/designer/list-view/index.umd.cjs +40 -0
- package/designer/radio-group/index.css +1 -0
- package/designer/radio-group/index.esm.js +6989 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/tree-grid/index.esm.js +1099 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +13299 -13177
- package/farris.all.umd.cjs +25 -25
- package/locales/data-grid/ui/en.json +4 -3
- package/locales/data-grid/ui/zh-CHS.json +2 -1
- package/locales/data-grid/ui/zh-CHT.json +2 -1
- package/locales/designer/en.json +9 -7
- package/locales/designer/zh-CHS.json +4 -2
- package/locales/designer/zh-CHT.json +4 -2
- package/locales/ui/en.json +9 -7
- package/locales/ui/zh-CHS.json +4 -2
- package/locales/ui/zh-CHT.json +4 -2
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
- package/types/data-view/composition/types.d.ts +10 -4
|
@@ -0,0 +1,4685 @@
|
|
|
1
|
+
var en = Object.defineProperty;
|
|
2
|
+
var tn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var pe = (e, t, n) => tn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { useGuid as nn, useNumberFormat as st, resolveField as se, useCommonUtils as lt, useDateFormat as on, setFieldValue as We, getCustomClass as Ke, getCustomStyle as et, excludeProperties as rn, withInstall as an } from "../../components/common/index.esm.js";
|
|
5
|
+
import sn, { listViewProps as ln, FListViewTable as cn } from "../../components/list-view/index.esm.js";
|
|
6
|
+
import { getSchemaByTypeForDesigner as un, createPropsResolver as dn, createCollectionBindingResolver as fn } from "../../components/dynamic-resolver/index.esm.js";
|
|
7
|
+
import { ref as O, createVNode as F, createTextVNode as ke, computed as W, defineComponent as Le, watch as Ne, Fragment as De, reactive as ct, createApp as vn, onUnmounted as mn, onMounted as Je, Transition as pn, mergeProps as gn, withModifiers as hn, withDirectives as _n, vModelText as yn, inject as Ye } from "vue";
|
|
8
|
+
import "../../components/popover/index.esm.js";
|
|
9
|
+
import { useI18n as je } from "vue-i18n";
|
|
10
|
+
import "../../components/modal/index.esm.js";
|
|
11
|
+
import { cloneDeep as Ae, isUndefined as tt, isPlainObject as nt } from "lodash-es";
|
|
12
|
+
import "../../components/transfer/index.esm.js";
|
|
13
|
+
import "../../components/tabs/index.esm.js";
|
|
14
|
+
import { FCheckbox as Qe } from "../../components/checkbox/index.esm.js";
|
|
15
|
+
import "../../components/filter-bar/index.esm.js";
|
|
16
|
+
import "../../components/pagination/index.esm.js";
|
|
17
|
+
import ot from "../../components/button/index.esm.js";
|
|
18
|
+
import "../../components/date-picker/index.esm.js";
|
|
19
|
+
import "../../components/number-spinner/index.esm.js";
|
|
20
|
+
import "../../components/search-box/index.esm.js";
|
|
21
|
+
import { LocaleService as bn } from "../../components/locale/index.esm.js";
|
|
22
|
+
import { useCondition as wn, CompareType as we, ValueType as xe, TextValue as qe, RadioGroupValue as Cn, NumberSpinnerValue as Sn, NumberRangeValue as Tn, MonthRangeValue as En, MonthPickerValue as kn, DateRangeValue as rt, DateTimePickerValue as Fn, DatePickerValue as Mn, ComboLookupValue as Nn, ComboListValue as Vn, CheckBoxValue as xn } from "../../components/condition/index.esm.js";
|
|
23
|
+
import { FDynamicFormInput as On } from "../../components/dynamic-form/index.esm.js";
|
|
24
|
+
import { DgControl as ze } from "../../components/designer-canvas/index.esm.js";
|
|
25
|
+
function In(e, t) {
|
|
26
|
+
function n(a) {
|
|
27
|
+
const r = [];
|
|
28
|
+
let c = a.nextNode();
|
|
29
|
+
for (; c; )
|
|
30
|
+
r.push(c), c = a.nextNode();
|
|
31
|
+
return r;
|
|
32
|
+
}
|
|
33
|
+
function o(a, r) {
|
|
34
|
+
const c = document.createTreeWalker(a, NodeFilter.SHOW_TEXT);
|
|
35
|
+
return n(c).map((s) => ({ textNode: s, text: (s.textContent || "").toLocaleLowerCase() })).map(({ textNode: s, text: l }) => {
|
|
36
|
+
const b = [];
|
|
37
|
+
let f = 0;
|
|
38
|
+
for (; f < l.length; ) {
|
|
39
|
+
const w = l.indexOf(r, f);
|
|
40
|
+
if (w === -1)
|
|
41
|
+
break;
|
|
42
|
+
b.push(w), f = w + r.length;
|
|
43
|
+
}
|
|
44
|
+
return b.map((w) => {
|
|
45
|
+
const C = new Range();
|
|
46
|
+
return C.setStart(s, w), C.setEnd(s, w + r.length), C;
|
|
47
|
+
});
|
|
48
|
+
}).flat();
|
|
49
|
+
}
|
|
50
|
+
function i(a) {
|
|
51
|
+
if (!CSS.highlights || (CSS.highlights.clear(), !a || !t))
|
|
52
|
+
return;
|
|
53
|
+
const r = o(t.value, a.toLocaleLowerCase()), c = new Highlight(...r);
|
|
54
|
+
CSS.highlights.set("search-result", c);
|
|
55
|
+
}
|
|
56
|
+
return { search: i };
|
|
57
|
+
}
|
|
58
|
+
const Oe = {
|
|
59
|
+
button: { type: "button", name: "按钮" },
|
|
60
|
+
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
|
|
61
|
+
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
|
|
62
|
+
"content-container": { type: "content-container", name: "容器" },
|
|
63
|
+
"input-group": { type: "input-group", name: "文本" },
|
|
64
|
+
textarea: { type: "textarea", name: "多行文本" },
|
|
65
|
+
lookup: { type: "lookup", name: "帮助" },
|
|
66
|
+
"number-spinner": { type: "number-spinner", name: "数值" },
|
|
67
|
+
"date-picker": { type: "date-picker", name: "日期" },
|
|
68
|
+
switch: { type: "switch", name: "开关" },
|
|
69
|
+
"radio-group": { type: "radio-group", name: "单选组" },
|
|
70
|
+
"check-box": { type: "check-box", name: "复选框" },
|
|
71
|
+
"check-group": { type: "check-group", name: "复选框组" },
|
|
72
|
+
"combo-list": { type: "combo-list", name: "下拉列表" },
|
|
73
|
+
"response-form": { type: "response-form", name: "卡片面板" },
|
|
74
|
+
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
|
|
75
|
+
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
|
|
76
|
+
"tree-grid": { type: "tree-grid", name: "树表格" },
|
|
77
|
+
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
|
|
78
|
+
"data-grid": { type: "data-grid", name: "表格" },
|
|
79
|
+
"data-grid-column": { type: "data-grid-column", name: "表格列" },
|
|
80
|
+
module: { type: "Module", name: "模块" },
|
|
81
|
+
component: { type: "component", name: "组件" },
|
|
82
|
+
tabs: { type: "tabs", name: "标签页" },
|
|
83
|
+
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
|
|
84
|
+
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
|
|
85
|
+
"html-template": { type: "html-template", name: "模板容器" },
|
|
86
|
+
"time-picker": { type: "time-picker", name: "时间选择" },
|
|
87
|
+
section: { type: "section", name: "分组面板" },
|
|
88
|
+
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
|
|
89
|
+
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
|
|
90
|
+
splitter: { type: "splitter", name: "分栏面板" },
|
|
91
|
+
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
|
|
92
|
+
"component-ref": { type: "component-ref", name: "组件引用节点" },
|
|
93
|
+
uploader: { type: "uploader", name: "附件上传" },
|
|
94
|
+
"page-header": { type: "page-header", name: "页头" },
|
|
95
|
+
"page-footer": { type: "page-footer", name: "页脚" },
|
|
96
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
|
|
97
|
+
fieldset: { type: "fieldset", name: "分组" },
|
|
98
|
+
"query-solution": { type: "query-solution", name: "筛选方案" },
|
|
99
|
+
drawer: { type: "drawer", name: "抽屉" },
|
|
100
|
+
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
|
|
101
|
+
"list-nav": { type: "list-nav", name: "列表导航" },
|
|
102
|
+
"list-view": { type: "list-view", name: "列表" },
|
|
103
|
+
"filter-bar": { type: "filter-bar", name: "筛选条" },
|
|
104
|
+
"language-textbox": { type: "language-textbox", name: "多语输入框" }
|
|
105
|
+
};
|
|
106
|
+
function ut(e, t, n) {
|
|
107
|
+
var Y;
|
|
108
|
+
const o = n && n.getStyles && n.getStyles() || "", i = n && n.getDesignerClass && n.getDesignerClass() || "", a = O();
|
|
109
|
+
let r;
|
|
110
|
+
function c() {
|
|
111
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
|
|
112
|
+
}
|
|
113
|
+
function m() {
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
function d() {
|
|
117
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
|
|
118
|
+
}
|
|
119
|
+
function u() {
|
|
120
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
|
|
121
|
+
}
|
|
122
|
+
function s(M) {
|
|
123
|
+
if (!M || !M.value)
|
|
124
|
+
return null;
|
|
125
|
+
if (M.value.schema && M.value.schema.type === "component")
|
|
126
|
+
return M.value;
|
|
127
|
+
const L = O(M == null ? void 0 : M.value.parent), D = s(L);
|
|
128
|
+
return D || null;
|
|
129
|
+
}
|
|
130
|
+
function l(M = t) {
|
|
131
|
+
var k;
|
|
132
|
+
if (n != null && n.getDraggableDesignItemElement)
|
|
133
|
+
return n.getDraggableDesignItemElement(M);
|
|
134
|
+
const { componentInstance: L, designerItemElementRef: D } = M;
|
|
135
|
+
if (!L || !L.value)
|
|
136
|
+
return null;
|
|
137
|
+
const { getCustomButtons: x } = L.value;
|
|
138
|
+
return L.value.canMove || x && ((k = x()) != null && k.length) ? D : l(M.parent);
|
|
139
|
+
}
|
|
140
|
+
function b(M) {
|
|
141
|
+
return !!n && n.canAccepts(M);
|
|
142
|
+
}
|
|
143
|
+
function f() {
|
|
144
|
+
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
145
|
+
}
|
|
146
|
+
function w() {
|
|
147
|
+
}
|
|
148
|
+
function C(M, L) {
|
|
149
|
+
var D;
|
|
150
|
+
!M || !L || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(M, L), (D = t == null ? void 0 : t.setupContext) == null || D.emit("dragEnd"));
|
|
151
|
+
}
|
|
152
|
+
function T(M, L) {
|
|
153
|
+
const { componentType: D } = M;
|
|
154
|
+
let x = un(D, M, L);
|
|
155
|
+
n && n.onResolveNewComponentSchema && (x = n.onResolveNewComponentSchema(M, x));
|
|
156
|
+
const k = D.toLowerCase().replace(/-/g, "_");
|
|
157
|
+
return x && !x.id && x.type === D && (x.id = `${k}_${Math.random().toString().slice(2, 6)}`), x;
|
|
158
|
+
}
|
|
159
|
+
function S(M) {
|
|
160
|
+
M && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(M);
|
|
161
|
+
}
|
|
162
|
+
function y(...M) {
|
|
163
|
+
if (n && n.getPropsConfig)
|
|
164
|
+
return n.getPropsConfig(...M);
|
|
165
|
+
}
|
|
166
|
+
function g(M) {
|
|
167
|
+
if (!M)
|
|
168
|
+
return;
|
|
169
|
+
const L = t == null ? void 0 : t.schema, { formSchemaUtils: D } = M;
|
|
170
|
+
if (L && D.getExpressions().length) {
|
|
171
|
+
const x = D.getExpressions().findIndex((k) => k.target === L.id);
|
|
172
|
+
x > -1 && D.getExpressions().splice(x, 1);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function v(M) {
|
|
176
|
+
if (!M || !(t != null && t.schema))
|
|
177
|
+
return;
|
|
178
|
+
const L = t.schema, { formSchemaUtils: D } = M;
|
|
179
|
+
D.removeCommunicationInComponent(L);
|
|
180
|
+
}
|
|
181
|
+
function p(M) {
|
|
182
|
+
n && n.onRemoveComponent && n.onRemoveComponent(), g(M), v(M), t != null && t.schema.contents && t.schema.contents.map((L) => {
|
|
183
|
+
let D = L.id;
|
|
184
|
+
L.type === "component-ref" && (D = L.component);
|
|
185
|
+
const x = e.value.querySelectorAll(`#${D}-design-item`);
|
|
186
|
+
x != null && x.length && Array.from(x).map((k) => {
|
|
187
|
+
var $;
|
|
188
|
+
($ = k == null ? void 0 : k.componentInstance) != null && $.value.onRemoveComponent && k.componentInstance.value.onRemoveComponent(M);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function _() {
|
|
193
|
+
if (n && n.getCustomButtons)
|
|
194
|
+
return n.getCustomButtons();
|
|
195
|
+
}
|
|
196
|
+
function E(M) {
|
|
197
|
+
var D, x;
|
|
198
|
+
if (!((D = t == null ? void 0 : t.schema) != null && D.id))
|
|
199
|
+
return;
|
|
200
|
+
if (!r && M && (r = M.formSchemaUtils), n != null && n.setComponentBasicInfoMap) {
|
|
201
|
+
n.setComponentBasicInfoMap();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
let L = "";
|
|
205
|
+
if (n != null && n.getComponentTitle)
|
|
206
|
+
L = n.getComponentTitle();
|
|
207
|
+
else {
|
|
208
|
+
const { text: k, title: $, label: A, mainTitle: Q, name: ne, type: I } = t.schema;
|
|
209
|
+
L = k || $ || A || Q || ne || ((x = Oe[I]) == null ? void 0 : x.name);
|
|
210
|
+
}
|
|
211
|
+
L && r.getControlBasicInfoMap().set(t.schema.id, {
|
|
212
|
+
componentTitle: L,
|
|
213
|
+
parentPathName: L
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function h(M) {
|
|
217
|
+
var k;
|
|
218
|
+
const { changeObject: L } = M, { propertyID: D, propertyValue: x } = L;
|
|
219
|
+
if (["text", "title", "label", "name", "mainTitle"].includes((k = M == null ? void 0 : M.changeObject) == null ? void 0 : k.propertyID) && D && x && (E(), r)) {
|
|
220
|
+
const $ = r.getControlBasicInfoMap(), A = $.keys().toArray().filter((Q) => {
|
|
221
|
+
var ne, I;
|
|
222
|
+
return ((ne = $.get(Q)) == null ? void 0 : ne.reliedComponentId) === ((I = t == null ? void 0 : t.schema) == null ? void 0 : I.id);
|
|
223
|
+
});
|
|
224
|
+
A != null && A.length && A.forEach((Q) => {
|
|
225
|
+
const ne = $.get(Q).parentPathName.split(" > ");
|
|
226
|
+
ne[0] = x, $.get(Q).parentPathName = ne.join(" > ");
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function B(M) {
|
|
231
|
+
if (h(M), n && n.onPropertyChanged)
|
|
232
|
+
return n.onPropertyChanged(M);
|
|
233
|
+
}
|
|
234
|
+
return a.value = {
|
|
235
|
+
canMove: c(),
|
|
236
|
+
canSelectParent: m(),
|
|
237
|
+
canDelete: d(),
|
|
238
|
+
canNested: !u(),
|
|
239
|
+
contents: t == null ? void 0 : t.schema.contents,
|
|
240
|
+
elementRef: e,
|
|
241
|
+
parent: (Y = t == null ? void 0 : t.parent) == null ? void 0 : Y.componentInstance,
|
|
242
|
+
schema: t == null ? void 0 : t.schema,
|
|
243
|
+
styles: o,
|
|
244
|
+
designerClass: i,
|
|
245
|
+
canAccepts: b,
|
|
246
|
+
getBelongedComponentInstance: s,
|
|
247
|
+
getDraggableDesignItemElement: l,
|
|
248
|
+
getDraggingDisplayText: f,
|
|
249
|
+
getPropConfig: y,
|
|
250
|
+
getDragScopeElement: w,
|
|
251
|
+
onAcceptMovedChildElement: C,
|
|
252
|
+
onChildElementMovedOut: S,
|
|
253
|
+
addNewChildComponentSchema: T,
|
|
254
|
+
triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || O(!1),
|
|
255
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || O(!1),
|
|
256
|
+
onRemoveComponent: p,
|
|
257
|
+
getCustomButtons: _,
|
|
258
|
+
onPropertyChanged: B,
|
|
259
|
+
setComponentBasicInfoMap: E,
|
|
260
|
+
updateContextSchema: t == null ? void 0 : t.updateContextSchema
|
|
261
|
+
}, a;
|
|
262
|
+
}
|
|
263
|
+
var _e = /* @__PURE__ */ ((e) => (e[e.readonly = 0] = "readonly", e[e.editable = 1] = "editable", e[e.editing = 2] = "editing", e))(_e || {}), Fe = /* @__PURE__ */ ((e) => (e[e.initial = 0] = "initial", e[e.editing = 1] = "editing", e))(Fe || {}), Ie = /* @__PURE__ */ ((e) => (e[e.data = 0] = "data", e[e.group = 1] = "group", e[e.summary = 2] = "summary", e))(Ie || {}), Ee = /* @__PURE__ */ ((e) => (e.DATE = "date", e.DATE_TIME = "datetime", e.NUMBER = "number", e.ENUM = "enum", e.IMAGE = "image", e.BOOLEAN = "boolean", e.BOOLEAN2 = "boolean2", e.TIMEAGO = "timeago", e.NONE = "none", e.CUSTOM = "custom", e.MULTI_LINGUAL = "multilingual", e))(Ee || {});
|
|
264
|
+
function Dn(e) {
|
|
265
|
+
const {
|
|
266
|
+
t
|
|
267
|
+
} = je();
|
|
268
|
+
function n(r, c) {
|
|
269
|
+
switch (r.command) {
|
|
270
|
+
case "edit":
|
|
271
|
+
case "remove":
|
|
272
|
+
return c.status === Fe.initial;
|
|
273
|
+
case "accept":
|
|
274
|
+
case "cancel":
|
|
275
|
+
return c.status === Fe.editing;
|
|
276
|
+
default:
|
|
277
|
+
return !r.hidden;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function o(r, c, m, d) {
|
|
281
|
+
var u, s, l, b, f;
|
|
282
|
+
switch ((u = r.onClick) == null || u.call(r, c, m.dataIndex, m), r.command) {
|
|
283
|
+
case "edit":
|
|
284
|
+
m.status, Fe.editing, (l = (s = e.commandOption) == null ? void 0 : s.onClickEditCommand) == null || l.call(s, d, m);
|
|
285
|
+
break;
|
|
286
|
+
case "accept":
|
|
287
|
+
case "cancel":
|
|
288
|
+
m.status, Fe.initial;
|
|
289
|
+
break;
|
|
290
|
+
case "remove":
|
|
291
|
+
(f = (b = e.commandOption) == null ? void 0 : b.onClickDeleteCommand) == null || f.call(b, d, m);
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function i(r) {
|
|
296
|
+
return r === "编辑" ? t("datagrid.commandColumn.edit") : r === "确定" ? t("datagrid.commandColumn.accept") : r === "取消" ? t("datagrid.commandColumn.cancel") : r === "删除" ? t("datagrid.commandColumn.remove") : r;
|
|
297
|
+
}
|
|
298
|
+
function a(r, c) {
|
|
299
|
+
const {
|
|
300
|
+
column: m
|
|
301
|
+
} = r;
|
|
302
|
+
return m.commands && m.commands.map((d, u) => u ? n(d, c) && F(ot, {
|
|
303
|
+
class: "ml-1",
|
|
304
|
+
type: d.type,
|
|
305
|
+
size: d.size || "small",
|
|
306
|
+
onClick: (s) => o(d, s, c, r),
|
|
307
|
+
style: {
|
|
308
|
+
"margin-bottom": "3px"
|
|
309
|
+
}
|
|
310
|
+
}, {
|
|
311
|
+
default: () => [ke(" "), i(d.text), ke(" ")]
|
|
312
|
+
}) : n(d, c) && F(ot, {
|
|
313
|
+
type: d.type,
|
|
314
|
+
size: d.size || "small",
|
|
315
|
+
onClick: (s) => o(d, s, c, r),
|
|
316
|
+
style: {
|
|
317
|
+
"margin-bottom": "3px"
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
default: () => [ke(" "), i(d.text), ke(" ")]
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
renderCommandColumn: a
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function dt(e, t) {
|
|
328
|
+
var S;
|
|
329
|
+
nn();
|
|
330
|
+
const { idField: n } = t, o = O(e.summary), i = O(e.group), a = O(((S = e.group) == null ? void 0 : S.groupFields) || []), r = W(() => {
|
|
331
|
+
var y;
|
|
332
|
+
return (y = e.group) == null ? void 0 : y.enable;
|
|
333
|
+
}), c = W(() => {
|
|
334
|
+
var y;
|
|
335
|
+
return (y = e.group) == null ? void 0 : y.showGroupPanel;
|
|
336
|
+
}), m = W(() => {
|
|
337
|
+
const y = o.value;
|
|
338
|
+
return (y == null ? void 0 : y.groupFields) || [];
|
|
339
|
+
}), d = W(() => {
|
|
340
|
+
const y = i.value;
|
|
341
|
+
return y && y.showSummary;
|
|
342
|
+
}), u = O(0), s = /* @__PURE__ */ new Map();
|
|
343
|
+
let l = [];
|
|
344
|
+
function b(y, g, v, p, _) {
|
|
345
|
+
const E = p[v];
|
|
346
|
+
E && (g.reduce((h, B, Y) => {
|
|
347
|
+
var D;
|
|
348
|
+
const M = B[E];
|
|
349
|
+
let L = h.get(M);
|
|
350
|
+
if (!L) {
|
|
351
|
+
const x = m.value.reduce((k, $) => (k.set($, 0), k), /* @__PURE__ */ new Map());
|
|
352
|
+
L = {
|
|
353
|
+
field: E,
|
|
354
|
+
title: ((D = _.get(E)) == null ? void 0 : D.title) || E,
|
|
355
|
+
value: M,
|
|
356
|
+
layer: v,
|
|
357
|
+
details: [],
|
|
358
|
+
groupSummaries: x
|
|
359
|
+
}, h.set(M, L);
|
|
360
|
+
}
|
|
361
|
+
return m.value && m.value.forEach((x) => {
|
|
362
|
+
if (L) {
|
|
363
|
+
const k = L.groupSummaries.get(x) || 0;
|
|
364
|
+
L.groupSummaries.set(x, k + B[x]);
|
|
365
|
+
}
|
|
366
|
+
}), m.value && m.value.forEach((x) => {
|
|
367
|
+
if (L) {
|
|
368
|
+
const k = L.groupSummaries.get(x) || 0;
|
|
369
|
+
L.groupSummaries.set(x, Number(k.toFixed(2)));
|
|
370
|
+
}
|
|
371
|
+
}), L.details.push(B), h;
|
|
372
|
+
}, y), v < p.length - 1 && y.forEach((h, B) => {
|
|
373
|
+
h.nestGroup = /* @__PURE__ */ new Map(), b(h.nestGroup, h.details, v + 1, p, _), h.details = [];
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
function f(y, g) {
|
|
377
|
+
return e.group && e.group.formatter ? e.group.formatter(y.value, { ...y, total: g }) : `${y.title}:${y.value} (${g})`;
|
|
378
|
+
}
|
|
379
|
+
function w(y, g) {
|
|
380
|
+
const v = [];
|
|
381
|
+
return y.forEach((p) => {
|
|
382
|
+
const _ = {
|
|
383
|
+
// 如果存在二级分组,分组行标识保持唯一
|
|
384
|
+
[n.value]: `group_of_${g ? g[n.value] + "_" : ""}${p.field}_${p.value}`,
|
|
385
|
+
__fv_data_grid_group_collapse__: !1,
|
|
386
|
+
__fv_data_grid_group_field__: p.field,
|
|
387
|
+
__fv_data_grid_group_layer__: p.layer,
|
|
388
|
+
__fv_data_grid_group_row__: !0,
|
|
389
|
+
__fv_data_grid_group_value__: p.value,
|
|
390
|
+
groupParents: []
|
|
391
|
+
};
|
|
392
|
+
g && (_.groupParents = [...g.groupParents, g]);
|
|
393
|
+
let E = 0;
|
|
394
|
+
if (v.push(_), p.nestGroup) {
|
|
395
|
+
const h = w(p.nestGroup, _);
|
|
396
|
+
v.push(...h), E += h.length;
|
|
397
|
+
}
|
|
398
|
+
if (p.details && p.details.length && (v.push(...p.details), E += p.details.length), d.value) {
|
|
399
|
+
const h = {
|
|
400
|
+
__fv_data_grid_group_field__: p.field,
|
|
401
|
+
__fv_data_grid_group_layer__: p.layer,
|
|
402
|
+
__fv_data_grid_group_summary__: !0
|
|
403
|
+
};
|
|
404
|
+
h[n.value] = `summary_of_${p.field}_${p.value}`, h[p.field] = Array.from(p.groupSummaries.entries()).reduce(
|
|
405
|
+
(B, [Y, M]) => `${B} ${Y} total:${M} `,
|
|
406
|
+
""
|
|
407
|
+
), v.push(h);
|
|
408
|
+
}
|
|
409
|
+
p.groupSummaries && p.groupSummaries.size && p.groupSummaries.forEach((h, B) => {
|
|
410
|
+
_[B] = h;
|
|
411
|
+
}), _[p.field] = f(p, E), _.value = p.value;
|
|
412
|
+
}), v.forEach((p, _) => {
|
|
413
|
+
p.__fv_data_index__ = _;
|
|
414
|
+
}), v;
|
|
415
|
+
}
|
|
416
|
+
function C(y, g, v) {
|
|
417
|
+
return !y || y.length === 0 || !g.length ? g : (y.join(","), s.clear(), l = [], g = g.filter((p) => !p.__fv_data_grid_group_row__), b(s, g, 0, y, v), l = w(s), l);
|
|
418
|
+
}
|
|
419
|
+
function T(y) {
|
|
420
|
+
return {
|
|
421
|
+
"f-icon": !0,
|
|
422
|
+
"f-icon-arrow-chevron-down": !0,
|
|
423
|
+
"fv-grid-group-row-icon-collapse": y.collapse
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
return { collpaseGroupIconClass: T, generateGroupData: C, groupFields: a, shouldGroupingData: r, showGroupPanel: c, groupRowSize: u };
|
|
427
|
+
}
|
|
428
|
+
function ft(e) {
|
|
429
|
+
const t = "parent", n = "layer", o = "hasChildren", i = (r, c = 1, m = [], d = null) => (r = r || [], r.reduce((u, s) => (s.id = s.id || s.data[e.idField], s[t] = d, s[n] = c, s[o] = s[o] === void 0 ? !1 : s[o], s.data && Object.keys(s.data).forEach((l) => {
|
|
430
|
+
Object.keys(s).includes(l) || (s[l] = s.data[l]);
|
|
431
|
+
}), m.push(s), s.children && s.children.length && (s[o] = !0, i(s.children, c + 1, m, s.id)), u), m), m);
|
|
432
|
+
return { flatTreeData: i, isNestedTree: (r) => r.some((c) => Array.isArray(c.children)) };
|
|
433
|
+
}
|
|
434
|
+
function Pn(e, t, n, o) {
|
|
435
|
+
const i = O(0), a = O(!!e.hierarchy), { idField: r } = o, { collapseField: c, hasChildrenField: m, parentIdField: d } = n, u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), { flatTreeData: b, isNestedTree: f } = ft(e);
|
|
436
|
+
function w(P, R) {
|
|
437
|
+
s.clear(), P.reduce((j, U) => {
|
|
438
|
+
const Z = U[d.value] !== void 0 ? U[d.value] : "";
|
|
439
|
+
if (Z && R.has(Z)) {
|
|
440
|
+
const ie = R.get(Z), te = isNaN(Number(ie.__fv_layer__)) ? 1 : Number(ie.__fv_layer__);
|
|
441
|
+
U.__fv_layer__ = te + 1, U.__fv_parent_index__ = ie.__fv_index__, ie.__fv_hasChildren__ = !0;
|
|
442
|
+
} else
|
|
443
|
+
U.__fv_layer__ = 1;
|
|
444
|
+
const ae = j.has(Z) ? j.get(Z) : [];
|
|
445
|
+
return ae.push(U), j.set(Z, ae), j;
|
|
446
|
+
}, s);
|
|
447
|
+
}
|
|
448
|
+
function C(P) {
|
|
449
|
+
l.clear(), P.reduce((R, j) => {
|
|
450
|
+
const U = j[r.value];
|
|
451
|
+
return R.set(U, j), R;
|
|
452
|
+
}, l);
|
|
453
|
+
}
|
|
454
|
+
function T(P) {
|
|
455
|
+
P.forEach((R) => {
|
|
456
|
+
const j = R[r.value];
|
|
457
|
+
R.__fv_children_index__.map((Z) => P[Z]).forEach((Z) => {
|
|
458
|
+
Z.__fv_parents__ = new Map([
|
|
459
|
+
...R.__fv_parents__.entries(),
|
|
460
|
+
[j, !0]
|
|
461
|
+
]);
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
function S(P) {
|
|
466
|
+
P.forEach((R) => {
|
|
467
|
+
const j = new Set(R.__fv_children_index__);
|
|
468
|
+
R.__fv_children_index__ = [...j].sort((U, Z) => U - Z);
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
function y(P) {
|
|
472
|
+
P.forEach((R) => {
|
|
473
|
+
const j = R.__fv_parents__;
|
|
474
|
+
Array.from(j.keys()).map((U) => l.get(U)).forEach((U) => {
|
|
475
|
+
U.__fv_children_index__.push(R.__fv_index__);
|
|
476
|
+
});
|
|
477
|
+
}), S(P);
|
|
478
|
+
}
|
|
479
|
+
function g(P) {
|
|
480
|
+
P.forEach((R) => {
|
|
481
|
+
R.__fv_child_with_lines__ = [], R.__fv_child_length__ = R.__fv_descendant_index__.length, R.__fv_descendant_index__.map((j) => P[j]).reduce((j, U) => (j.__fv_child_length__ += U.__fv_children_index__.length, j.__fv_child_with_lines__.push(...U.__fv_children_index__, U.__fv_index__), j), R);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
function v(P, R) {
|
|
485
|
+
return { id: P, index: R, parentId: "", parentIndex: -1, parents: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map(), descendant: /* @__PURE__ */ new Map(), collapsed: !1, visibleInHierarchy: !0 };
|
|
486
|
+
}
|
|
487
|
+
function p(P, R, j) {
|
|
488
|
+
Array.from(R.keys()).forEach((U) => {
|
|
489
|
+
R.get(U).reduce((ae, ie) => {
|
|
490
|
+
const te = ie[r.value], ue = P.get(ie[r.value]), be = P.get(U), fe = j.get(U);
|
|
491
|
+
return be && fe && (be.children.set(te, ue), be.children.set(te, ue), ue.parentId = U, ue.parentIndex = be.index, ue.parents.set(U, be)), ae;
|
|
492
|
+
}, P);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
function _(P) {
|
|
496
|
+
P.children.forEach((j) => {
|
|
497
|
+
j.parents = new Map([
|
|
498
|
+
...P.parents.entries(),
|
|
499
|
+
[P.id, P]
|
|
500
|
+
]), _(j);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
function E(P, R) {
|
|
504
|
+
P.filter((j) => j[d.value] === void 0 || j[d.value] === "").forEach((j) => {
|
|
505
|
+
const U = j[r.value], Z = R.get(U);
|
|
506
|
+
_(Z);
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
function h(P) {
|
|
510
|
+
Array.from(P.values()).forEach((R) => {
|
|
511
|
+
Array.from(R.parents.values()).forEach((j) => {
|
|
512
|
+
j.descendant.set(R.id, R);
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
function B(P) {
|
|
517
|
+
u.clear(), P.forEach((R, j) => {
|
|
518
|
+
const U = R[r.value];
|
|
519
|
+
u.set(U, v(U, j));
|
|
520
|
+
}), C(P), w(P, l), p(u, s, l), E(P, u), h(u);
|
|
521
|
+
}
|
|
522
|
+
function Y(P) {
|
|
523
|
+
const R = P[r.value], j = u.get(R);
|
|
524
|
+
return j && j.children.size > 0;
|
|
525
|
+
}
|
|
526
|
+
function M(P) {
|
|
527
|
+
return P[m.value] && !Y(P);
|
|
528
|
+
}
|
|
529
|
+
function L(P) {
|
|
530
|
+
const R = P[r.value], j = u.get(R);
|
|
531
|
+
return j && j.visibleInHierarchy;
|
|
532
|
+
}
|
|
533
|
+
function D() {
|
|
534
|
+
i.value = Date.now();
|
|
535
|
+
}
|
|
536
|
+
function x(P, R) {
|
|
537
|
+
R.forEach((j) => {
|
|
538
|
+
const U = u.get(j[r.value]), Z = u.get(P), ae = l.get(P);
|
|
539
|
+
Z && ae && (U.visibleInHierarchy = !ae[c.value] && Z.visibleInHierarchy);
|
|
540
|
+
}), D();
|
|
541
|
+
}
|
|
542
|
+
function k(P) {
|
|
543
|
+
if (s.has(P)) {
|
|
544
|
+
const j = s.get(P);
|
|
545
|
+
x(P, j), j.map((U) => U[r.value]).forEach((U) => k(U));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
function $(P) {
|
|
549
|
+
const R = P[r.value];
|
|
550
|
+
k(R);
|
|
551
|
+
}
|
|
552
|
+
function A(P, R, j = 0) {
|
|
553
|
+
P.forEach((U) => {
|
|
554
|
+
const Z = M(U), ae = U.__fv_layer__ <= j, ie = R === "ToCollapse" ? U.__fv_layer__ <= j : !(U.__fv_layer__ <= j), te = ae ? ie : U[c.value];
|
|
555
|
+
U[c.value] = Z || te;
|
|
556
|
+
});
|
|
557
|
+
for (const [U, Z] of s.entries())
|
|
558
|
+
x(U, Z);
|
|
559
|
+
return P;
|
|
560
|
+
}
|
|
561
|
+
function Q(P, R) {
|
|
562
|
+
A(P, "ToCollapse", R);
|
|
563
|
+
}
|
|
564
|
+
function ne(P, R) {
|
|
565
|
+
A(P, "ToExpand", R);
|
|
566
|
+
}
|
|
567
|
+
function I(P) {
|
|
568
|
+
P.forEach((R, j) => {
|
|
569
|
+
var ie;
|
|
570
|
+
const U = R[r.value], Z = s.has(U) ? (ie = s.get(U)) == null ? void 0 : ie.map((te) => te.__fv_index__) : [], ae = v(U, j);
|
|
571
|
+
R.__fv_graph_node__ = ae, R.__fv_children_index__ = Z, R.__fv_descendant_index__ = [...Z], R.__fv_parents__ = /* @__PURE__ */ new Map(), M(R) && (R[c.value] = !0);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
function z(P) {
|
|
575
|
+
var U, Z;
|
|
576
|
+
B(t.value), I(P), T(P), y(P), e.showLines && g(P);
|
|
577
|
+
const j = ((U = e.hierarchy) == null ? void 0 : U.collapseTo) !== void 0 ? Number((Z = e.hierarchy) == null ? void 0 : Z.collapseTo) : 0;
|
|
578
|
+
return A(P, "ToCollapse", j), P;
|
|
579
|
+
}
|
|
580
|
+
function J(P, R, j) {
|
|
581
|
+
const Z = j.value[P][r.value], ae = u.get(Z);
|
|
582
|
+
if (ae) {
|
|
583
|
+
const ie = u.get(ae.parentId);
|
|
584
|
+
let te = j.value.length - 1;
|
|
585
|
+
if (ie) {
|
|
586
|
+
const ue = Array.from(ie.children.keys()).indexOf(ae.id);
|
|
587
|
+
if (ue === ie.children.size - 1) {
|
|
588
|
+
const fe = Array.from(ie.descendant.values())[ie.descendant.size - 1];
|
|
589
|
+
te = j.value.findIndex((N) => N[r.value] === fe.id) + 1;
|
|
590
|
+
} else {
|
|
591
|
+
const fe = Array.from(ie.children.values())[ue + 1];
|
|
592
|
+
te = j.value.findIndex((N) => N[r.value] === fe.id);
|
|
593
|
+
}
|
|
594
|
+
R[m.value] = !1, R[d.value] = ie.id, j.value.splice(te, 0, R);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function K(P, R, j) {
|
|
599
|
+
const U = j.value[P], Z = U[r.value];
|
|
600
|
+
if (u.get(Z)) {
|
|
601
|
+
const te = j.value.findIndex((ue) => ue[r.value] === Z) + 1;
|
|
602
|
+
U[m.value] = !0, U[c.value] = !1, R[m.value] = !1, R[d.value] = Z, j.value.splice(te, 0, R);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function re(P, R, j) {
|
|
606
|
+
const Z = j.value[P][r.value];
|
|
607
|
+
if (u.get(Z)) {
|
|
608
|
+
const te = j.value.findIndex((be) => be[r.value] === Z) + 1;
|
|
609
|
+
let ue = R;
|
|
610
|
+
f(R) && (ue = b(R)), ue.forEach((be) => {
|
|
611
|
+
be[d.value] = Z;
|
|
612
|
+
}), j.value.splice(te, 0, ...ue);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
function ee(P, R) {
|
|
616
|
+
const j = P[r.value], U = u.get(j), Z = Array.from(U.descendant.keys());
|
|
617
|
+
Z.unshift(j);
|
|
618
|
+
const ae = u.get(U.parentId);
|
|
619
|
+
if (ae && (ae.children.delete(j), ae.children.size === 0)) {
|
|
620
|
+
const te = R.find((ue) => ue[r.value] === U.parentId);
|
|
621
|
+
te[m.value] = !1, te[c.value] = !1;
|
|
622
|
+
}
|
|
623
|
+
return R.filter((te) => Z.indexOf(te.id) === -1);
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
checkVisibleInHierarchy: i,
|
|
627
|
+
collapseTo: Q,
|
|
628
|
+
expandTo: ne,
|
|
629
|
+
generateHierarchyData: z,
|
|
630
|
+
hasRealChildren: Y,
|
|
631
|
+
insertSibling: J,
|
|
632
|
+
insertChild: K,
|
|
633
|
+
insertChildren: re,
|
|
634
|
+
isVisibleInTree: L,
|
|
635
|
+
shouldStratifyData: a,
|
|
636
|
+
toggleChildrenVisibiltyByCollapseStatus: $,
|
|
637
|
+
trimmedOriginalData: ee
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
const Bn = {
|
|
641
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
642
|
+
position: { type: String, default: "top-center" },
|
|
643
|
+
timeout: { type: Number, default: 3e3 },
|
|
644
|
+
theme: { type: String, default: "bootstrap" },
|
|
645
|
+
left: { type: Number },
|
|
646
|
+
right: { type: Number },
|
|
647
|
+
top: { type: Number },
|
|
648
|
+
bottom: { type: Number },
|
|
649
|
+
id: { type: String },
|
|
650
|
+
animate: { type: String, default: "fadeIn" },
|
|
651
|
+
options: { type: Object },
|
|
652
|
+
safeHtml: { type: Boolean, default: !0 }
|
|
653
|
+
}, Rn = {
|
|
654
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
655
|
+
animate: { type: String, default: "fadeIn" },
|
|
656
|
+
options: { type: Object }
|
|
657
|
+
}, Xe = /* @__PURE__ */ Le({
|
|
658
|
+
name: "Toast",
|
|
659
|
+
props: Rn,
|
|
660
|
+
emits: ["close", "click"],
|
|
661
|
+
setup: (e, t) => {
|
|
662
|
+
const {
|
|
663
|
+
locale: n,
|
|
664
|
+
t: o
|
|
665
|
+
} = je(), i = O(e.animate), a = "fadeOut", r = W(() => e.options), c = O(!1), m = W(() => r.value.title && r.value.message), d = W(() => !r.value.title && r.value.message), u = W(() => {
|
|
666
|
+
const g = {
|
|
667
|
+
animated: c.value,
|
|
668
|
+
toast: !0,
|
|
669
|
+
"toast--only-content": !m.value
|
|
670
|
+
};
|
|
671
|
+
return g[e.animate] = !1, g[a] = c.value, g["toasty-type-" + r.value.type] = !0, r.value.theme && (g[r.value.theme] = !0), g;
|
|
672
|
+
}), s = W(() => {
|
|
673
|
+
const p = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, _ = {
|
|
674
|
+
"f-icon": !0
|
|
675
|
+
};
|
|
676
|
+
return _[p] = !0, _;
|
|
677
|
+
}), l = W(() => r.value.title || r.value.message), b = W(() => e.showCloseButton), f = W(() => !!r.value.buttons || !!t.slots.default), w = W(() => n.value === "en" ? {
|
|
678
|
+
wordBreak: "keep-all",
|
|
679
|
+
overflowWrap: "break-word"
|
|
680
|
+
} : {});
|
|
681
|
+
function C(g) {
|
|
682
|
+
g.stopPropagation(), g.preventDefault(), c.value = !1, setTimeout(() => {
|
|
683
|
+
t.emit("close", r.value);
|
|
684
|
+
}, 200);
|
|
685
|
+
}
|
|
686
|
+
function T(g, v) {
|
|
687
|
+
}
|
|
688
|
+
function S(g) {
|
|
689
|
+
return `f-preten-link ${g.customClass ? g.customClass : ""}`;
|
|
690
|
+
}
|
|
691
|
+
Ne(i, () => {
|
|
692
|
+
i.value;
|
|
693
|
+
});
|
|
694
|
+
const y = () => {
|
|
695
|
+
var g;
|
|
696
|
+
return F(De, null, [F("div", {
|
|
697
|
+
class: "after-toast-msg text-right"
|
|
698
|
+
}, [!t.slots.default && ((g = r.value.buttons) == null ? void 0 : g.map((v) => F("span", {
|
|
699
|
+
class: S(v),
|
|
700
|
+
onClick: (p) => void 0
|
|
701
|
+
}, [v.text]))), t.slots.default && t.slots.default()])]);
|
|
702
|
+
};
|
|
703
|
+
return () => F("div", {
|
|
704
|
+
class: u.value,
|
|
705
|
+
style: "min-height:44px"
|
|
706
|
+
}, [b.value && F("button", {
|
|
707
|
+
title: o("messageBox.close"),
|
|
708
|
+
class: "toast-close f-btn-icon f-bare",
|
|
709
|
+
onClick: C
|
|
710
|
+
}, [F("span", {
|
|
711
|
+
class: "f-icon modal_close"
|
|
712
|
+
}, null)]), l.value && F("section", {
|
|
713
|
+
class: "modal-tips"
|
|
714
|
+
}, [!m.value && F("div", {
|
|
715
|
+
class: "float-left modal-tips-iconwrap"
|
|
716
|
+
}, [F("span", {
|
|
717
|
+
class: s.value
|
|
718
|
+
}, null)]), F("div", {
|
|
719
|
+
class: "modal-tips-content"
|
|
720
|
+
}, [m.value && F(De, null, [F("h5", {
|
|
721
|
+
class: "toast-title modal-tips-title",
|
|
722
|
+
innerHTML: r.value.title
|
|
723
|
+
}, null), F("p", {
|
|
724
|
+
class: "toast-msg",
|
|
725
|
+
innerHTML: r.value.message,
|
|
726
|
+
style: w.value
|
|
727
|
+
}, null), f.value && y()]), d.value && (r.value.buttons ? F("div", {
|
|
728
|
+
class: "toast-title-btns-wrapper d-flex"
|
|
729
|
+
}, [F("h5", {
|
|
730
|
+
class: "toast-title modal-tips-title only-toast-msg",
|
|
731
|
+
style: w.value,
|
|
732
|
+
innerHTML: r.value.message
|
|
733
|
+
}, null), F("div", {
|
|
734
|
+
class: "after-toast-title text-right ml-auto"
|
|
735
|
+
}, [y()])]) : F("h5", {
|
|
736
|
+
class: "toast-title modal-tips-title only-toast-msg",
|
|
737
|
+
style: w.value,
|
|
738
|
+
innerHTML: r.value.message
|
|
739
|
+
}, null))])])]);
|
|
740
|
+
}
|
|
741
|
+
}), Re = /* @__PURE__ */ Le({
|
|
742
|
+
name: "Notify",
|
|
743
|
+
props: Bn,
|
|
744
|
+
emits: ["close", "empty"],
|
|
745
|
+
setup(e, t) {
|
|
746
|
+
const n = W(() => ({
|
|
747
|
+
"farris-notify": !0
|
|
748
|
+
})), o = {
|
|
749
|
+
left: 12,
|
|
750
|
+
right: 12,
|
|
751
|
+
top: 20,
|
|
752
|
+
bottom: 12
|
|
753
|
+
}, i = O(), a = O(e.options), r = O(e.showCloseButton), c = W(() => e.position || "bottom-right"), m = W(() => e.timeout != null ? e.timeout : 3e3), d = W(() => {
|
|
754
|
+
const l = e.bottom ? e.bottom : o.bottom, b = e.top ? e.top : o.top, f = {
|
|
755
|
+
transition: "all 0.2s ease",
|
|
756
|
+
left: c.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "",
|
|
757
|
+
right: c.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "",
|
|
758
|
+
top: c.value.indexOf("top") > -1 ? `${b}px` : "",
|
|
759
|
+
bottom: c.value.indexOf("bottom") > -1 ? `${l}px` : ""
|
|
760
|
+
};
|
|
761
|
+
return c.value.indexOf("center") > -1 && (f.left = "50%", f.marginLeft = "calc(-24rem / 2)", c.value === "center-center" && (f.top = "50%", f.transform = "translate(-50%, -50%)")), f;
|
|
762
|
+
});
|
|
763
|
+
function u(l) {
|
|
764
|
+
t.emit("close");
|
|
765
|
+
}
|
|
766
|
+
m.value && setTimeout(() => {
|
|
767
|
+
u();
|
|
768
|
+
}, m.value), t.expose({
|
|
769
|
+
closeToast: u,
|
|
770
|
+
container: i,
|
|
771
|
+
notifyPosition: c
|
|
772
|
+
});
|
|
773
|
+
function s(l, b) {
|
|
774
|
+
u();
|
|
775
|
+
}
|
|
776
|
+
return () => F("div", {
|
|
777
|
+
class: n.value,
|
|
778
|
+
style: d.value,
|
|
779
|
+
ref: i
|
|
780
|
+
}, [F(Xe, {
|
|
781
|
+
options: a.value,
|
|
782
|
+
showCloseButton: r.value,
|
|
783
|
+
animate: e.animate,
|
|
784
|
+
onClose: (l) => s(l, a.value)
|
|
785
|
+
}, null)]);
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
class vt {
|
|
789
|
+
constructor() {
|
|
790
|
+
pe(this, "notifyRefs", []);
|
|
791
|
+
pe(this, "globalConfig", ct({}));
|
|
792
|
+
}
|
|
793
|
+
escapeAllHtml(t) {
|
|
794
|
+
if (typeof t != "string" || !t)
|
|
795
|
+
return "";
|
|
796
|
+
const n = document.createElement("div");
|
|
797
|
+
return n.textContent = t || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, " ").replace(/\\r/g, "");
|
|
798
|
+
}
|
|
799
|
+
createNotifyInstance(t) {
|
|
800
|
+
const n = this, i = Object.assign({
|
|
801
|
+
timeout: 3e3,
|
|
802
|
+
position: "bottom-right",
|
|
803
|
+
showCloseButton: !0,
|
|
804
|
+
safeHtml: !0
|
|
805
|
+
}, this.globalConfig, {
|
|
806
|
+
...t
|
|
807
|
+
}), a = document.createElement("div");
|
|
808
|
+
a.style.display = "contents";
|
|
809
|
+
const r = vn({
|
|
810
|
+
setup() {
|
|
811
|
+
var d;
|
|
812
|
+
const c = O();
|
|
813
|
+
function m() {
|
|
814
|
+
c.value.container.style.transform = "scale(0)", setTimeout(() => {
|
|
815
|
+
n.updateNotifyPositionForClose(i, c), r.unmount();
|
|
816
|
+
}, 220);
|
|
817
|
+
}
|
|
818
|
+
if (i.position.indexOf("top") > -1) {
|
|
819
|
+
const u = n.getNotifyInstances(i.position), s = u[u.length - 1];
|
|
820
|
+
if (s) {
|
|
821
|
+
const l = s.value.container.getBoundingClientRect();
|
|
822
|
+
i.top = l.bottom;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return i.safeHtml && ((d = i.options) != null && d.message) && (i.options.message = n.escapeAllHtml(i.options.message)), mn(() => {
|
|
826
|
+
document.body.removeChild(a);
|
|
827
|
+
}), Je(() => {
|
|
828
|
+
n.updateNotifyPositionForCreate(i, c);
|
|
829
|
+
}), () => F(pn, {
|
|
830
|
+
mode: "out-in",
|
|
831
|
+
name: "fade",
|
|
832
|
+
appear: !0
|
|
833
|
+
}, {
|
|
834
|
+
default: () => [F(Re, gn({
|
|
835
|
+
ref: c
|
|
836
|
+
}, i, {
|
|
837
|
+
onClose: m
|
|
838
|
+
}), null)]
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
return r.provide("NotifyService", this), document.body.appendChild(a), r.use(bn.i18n), r.mount(a), r;
|
|
843
|
+
}
|
|
844
|
+
getNotifyInstances(t) {
|
|
845
|
+
return this.notifyRefs.filter((n) => n.value.notifyPosition === t);
|
|
846
|
+
}
|
|
847
|
+
updateNotifyPositionForCreate(t, n) {
|
|
848
|
+
if (this.notifyRefs && this.notifyRefs.length) {
|
|
849
|
+
const o = window.innerHeight;
|
|
850
|
+
t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((i) => {
|
|
851
|
+
const a = i.value.container.getBoundingClientRect();
|
|
852
|
+
i.value.container.style.bottom = a.height + o - a.bottom + "px";
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
this.notifyRefs = [...this.notifyRefs, n];
|
|
856
|
+
}
|
|
857
|
+
updateNotifyPositionForClose(t, n) {
|
|
858
|
+
const o = this.notifyRefs.indexOf(n);
|
|
859
|
+
if (t.position.indexOf("top") > -1) {
|
|
860
|
+
const i = this.getNotifyInstances(t.position), a = i.indexOf(n);
|
|
861
|
+
i.slice(a + 1).forEach((r) => {
|
|
862
|
+
r.value.container.style.top = r.value.container.offsetTop - r.value.container.offsetHeight + "px";
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
o > -1 && this.notifyRefs.splice(o, 1);
|
|
866
|
+
}
|
|
867
|
+
show(t) {
|
|
868
|
+
return this.createNotifyInstance(t);
|
|
869
|
+
}
|
|
870
|
+
buildNotifyProps(t, n) {
|
|
871
|
+
let o = "", i = "", a, r, c;
|
|
872
|
+
typeof n == "string" ? o = n : n && (o = n.message || "", i = n.title || "", r = n.position || null, c = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null);
|
|
873
|
+
const d = {
|
|
874
|
+
options: {
|
|
875
|
+
type: t,
|
|
876
|
+
message: o,
|
|
877
|
+
title: i
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
return r != null && (d.position = r), c != null && (d.showCloseButton = c), a != null && (d.timeout = a), d;
|
|
881
|
+
}
|
|
882
|
+
info(t) {
|
|
883
|
+
const n = this.buildNotifyProps("info", t);
|
|
884
|
+
return this.show(n);
|
|
885
|
+
}
|
|
886
|
+
success(t) {
|
|
887
|
+
const n = this.buildNotifyProps("success", t);
|
|
888
|
+
return this.show(n);
|
|
889
|
+
}
|
|
890
|
+
warning(t) {
|
|
891
|
+
const n = this.buildNotifyProps("warning", t);
|
|
892
|
+
return this.show(n);
|
|
893
|
+
}
|
|
894
|
+
error(t) {
|
|
895
|
+
const n = this.buildNotifyProps("error", t);
|
|
896
|
+
return this.show(n);
|
|
897
|
+
}
|
|
898
|
+
close(t) {
|
|
899
|
+
t && t.unmount();
|
|
900
|
+
}
|
|
901
|
+
closeAll() {
|
|
902
|
+
this.notifyRefs.forEach((t) => {
|
|
903
|
+
t == null || t.value.closeToast();
|
|
904
|
+
}), this.notifyRefs.length = 0;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
const An = Symbol("NOTIFY_SERVICE_TOKEN");
|
|
908
|
+
Re.install = (e) => {
|
|
909
|
+
e.component(Re.name, Re), e.component(Xe.name, Xe);
|
|
910
|
+
const t = new vt();
|
|
911
|
+
e.provide(An, t), e.provide("FNotifyService", t);
|
|
912
|
+
};
|
|
913
|
+
function $n(e, t, n, o, i) {
|
|
914
|
+
const { toNumber: a } = st(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), s = O([]), l = O([]), b = dt(e, i), { generateGroupData: f, groupFields: w, shouldGroupingData: C } = b, T = O(e.data || []), S = Pn(e, T, o, i), {
|
|
915
|
+
collapseTo: y,
|
|
916
|
+
expandTo: g,
|
|
917
|
+
generateHierarchyData: v,
|
|
918
|
+
hasRealChildren: p,
|
|
919
|
+
insertSibling: _,
|
|
920
|
+
insertChild: E,
|
|
921
|
+
insertChildren: h,
|
|
922
|
+
isVisibleInTree: B,
|
|
923
|
+
shouldStratifyData: Y,
|
|
924
|
+
toggleChildrenVisibiltyByCollapseStatus: M,
|
|
925
|
+
trimmedOriginalData: L,
|
|
926
|
+
checkVisibleInHierarchy: D
|
|
927
|
+
} = S, { idField: x, reviseIdentifyField: k } = i, $ = O(e.newDataItem), A = O(e.data || []), Q = O(e.data), { flatTreeData: ne, isNestedTree: I } = ft(e);
|
|
928
|
+
if (e.hierarchy && I(e.data)) {
|
|
929
|
+
const V = ne(e.data);
|
|
930
|
+
T.value = V, A.value = V, Q.value = V;
|
|
931
|
+
}
|
|
932
|
+
const z = O(e.summary), J = W(() => {
|
|
933
|
+
const V = z.value;
|
|
934
|
+
return (V == null ? void 0 : V.groupFields) || [];
|
|
935
|
+
});
|
|
936
|
+
let K = /* @__PURE__ */ new Map();
|
|
937
|
+
const re = O(A.value.length), ee = O(e.pagination);
|
|
938
|
+
function P() {
|
|
939
|
+
return ee.value && ee.value.enable && ee.value.size > 0 ? ee.value.size : A.value.length;
|
|
940
|
+
}
|
|
941
|
+
const R = O(1), j = W(() => ee.value && ee.value.enable && ee.value.mode !== "server"), U = W(() => ee.value && ee.value.enable && ee.value.mode === "server"), Z = new vt();
|
|
942
|
+
function ae(V, H) {
|
|
943
|
+
const X = Math.ceil(V.length / H);
|
|
944
|
+
let oe = 0;
|
|
945
|
+
const me = [], Ce = [], Te = [];
|
|
946
|
+
for (; oe < X; ) {
|
|
947
|
+
const ye = V.slice(oe * H, (oe + 1) * H), le = f(w.value, ye, t);
|
|
948
|
+
Ce[oe] = le.filter((ce) => ce.__fv_data_grid_group_row__).length, me.push(...le), oe++;
|
|
949
|
+
}
|
|
950
|
+
return Ce.reduce((ye, le, ce) => (ye = ye + le, Te.push(ye), ye), 0), {
|
|
951
|
+
groupData: me,
|
|
952
|
+
groupRowSizeList: Ce,
|
|
953
|
+
accumulateGroupRowSize: Te
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function ie() {
|
|
957
|
+
var le;
|
|
958
|
+
A.value = T.value, j.value && (re.value = A.value.length), C.value && !j.value && (A.value = f(w.value, T.value, t)), K = J.value.reduce((ce, ve) => (ce.set(ve, 0), ce), K);
|
|
959
|
+
const V = 0, H = P(), X = (R.value - 1) * H;
|
|
960
|
+
let me = X > A.value.length - 1 || U.value ? V : X, Ce = U.value ? A.value.length : Math.min(me + H, A.value.length);
|
|
961
|
+
if (C.value && j.value) {
|
|
962
|
+
const { accumulateGroupRowSize: ce, groupData: ve, groupRowSizeList: de } = ae(T.value, H);
|
|
963
|
+
A.value = ve;
|
|
964
|
+
const Ve = de[R.value - 1];
|
|
965
|
+
me += R.value - 2 < 0 ? 0 : ce[R.value - 2], Ce = me + H + Ve;
|
|
966
|
+
}
|
|
967
|
+
let Te = 0;
|
|
968
|
+
const ye = [];
|
|
969
|
+
if (A.value.length) {
|
|
970
|
+
k(A.value);
|
|
971
|
+
const ce = x.value !== e.idField;
|
|
972
|
+
for (let ve = me; ve < Ce; ve++) {
|
|
973
|
+
const de = A.value[ve];
|
|
974
|
+
de.__fv_data_grid_group_row__ ? (Te = 0, de.__fv_data_index__ = "") : de.__fv_data_grid_group_summary__ ? de.__fv_data_index__ = "" : (Te++, de.__fv_data_index__ = Te + (R.value - 1) * H), de.__fv_index__ = ve, de.__fv_visible_index__ = ve, e.rowOption && e.rowOption.disabledField && (de.__fv_disabled__ = de[(le = e.rowOption) == null ? void 0 : le.disabledField]), ce && (de[x.value] = ve), J.value.forEach((Ve) => {
|
|
975
|
+
const Ue = K.get(Ve) || 0;
|
|
976
|
+
K.set(Ve, Ue + se(de, Ve));
|
|
977
|
+
}), ye.push(de);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return Y.value && v(ye), J.value.forEach((ce) => {
|
|
981
|
+
const ve = K.get(ce) || 0;
|
|
982
|
+
K.set(ce, a(ve.toFixed(2)));
|
|
983
|
+
}), Q.value = [...ye], ye;
|
|
984
|
+
}
|
|
985
|
+
const te = O(ie()), ue = W(() => (D.value, te.value.filter((V) => Y.value ? V.__fv_visible__ !== !1 && B(V) : V.__fv_visible__ !== !1)));
|
|
986
|
+
function be() {
|
|
987
|
+
ue.value.forEach((V, H) => (V.__fv_visible_index__ = H, V));
|
|
988
|
+
}
|
|
989
|
+
function fe(V, H, X = !1) {
|
|
990
|
+
var ye;
|
|
991
|
+
const oe = X ? ie() : [...Q.value];
|
|
992
|
+
let me = oe;
|
|
993
|
+
((ye = e.filter) == null ? void 0 : ye.mode) !== "server" && (me = oe.filter((le) => n.apply(le)));
|
|
994
|
+
const Ce = V && V.length ? me.filter((le) => V.reduce((ce, ve) => ce && ve.filter(le), !0)) : me, Te = H && H.length ? Ce.sort((le, ce) => {
|
|
995
|
+
const ve = [...H], de = ve.shift(), Ve = se(le, de.field) === void 0 || se(le, de.field) === null ? "" : se(le, de.field), Ue = se(ce, de.field) === void 0 || se(ce, de.field) === null ? "" : se(ce, de.field);
|
|
996
|
+
let Ge = de.compare(
|
|
997
|
+
Ve,
|
|
998
|
+
Ue
|
|
999
|
+
);
|
|
1000
|
+
for (; Ge === 0 && ve.length !== 0; ) {
|
|
1001
|
+
const Me = ve.shift();
|
|
1002
|
+
if (Me) {
|
|
1003
|
+
const Zt = se(le, Me.field) === void 0 || se(le, Me.field) === null ? "" : se(le, Me.field), Kt = se(ce, Me.field) === void 0 || se(ce, Me.field) === null ? "" : se(ce, Me.field);
|
|
1004
|
+
Ge = Me.compare(Zt, Kt);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return Ge;
|
|
1008
|
+
}) : Ce;
|
|
1009
|
+
return te.value = Te.map((le, ce) => {
|
|
1010
|
+
if (le.__fv_data_grid_group_row__) {
|
|
1011
|
+
const ve = `group_of_${le.__fv_data_grid_group_field__}_${le.__fv_data_grid_group_value__}`;
|
|
1012
|
+
le.__fv_data_grid_group_collapse__ = !!r.get(ve);
|
|
1013
|
+
}
|
|
1014
|
+
return le.__fv_index__ = ce, le.__fv_visible_index__ = ce, le;
|
|
1015
|
+
}), te.value;
|
|
1016
|
+
}
|
|
1017
|
+
function Be(V) {
|
|
1018
|
+
return u.clear(), l.value = V, l.value.reduce((H, X) => (H.set(X.field, X), H), u), fe([], l.value);
|
|
1019
|
+
}
|
|
1020
|
+
function N(V, H) {
|
|
1021
|
+
return u.set(V, H), l.value = Array.from(u.values()), fe([], l.value);
|
|
1022
|
+
}
|
|
1023
|
+
function G(V) {
|
|
1024
|
+
return u.delete(V), l.value = Array.from(u.values()), fe([], l.value);
|
|
1025
|
+
}
|
|
1026
|
+
function q(V, H) {
|
|
1027
|
+
return c.set(V, H), s.value = Array.from(c.values()), fe([], Array.from(u.values()));
|
|
1028
|
+
}
|
|
1029
|
+
function ge(V) {
|
|
1030
|
+
return c.delete(V), s.value = Array.from(c.values()), fe([], Array.from(u.values()), !0);
|
|
1031
|
+
}
|
|
1032
|
+
function he() {
|
|
1033
|
+
return c.clear(), s.value = [], fe([], Array.from(u.values()), !0);
|
|
1034
|
+
}
|
|
1035
|
+
function Pe(V, H, X) {
|
|
1036
|
+
const oe = `group_of_${V}_${H}`;
|
|
1037
|
+
r.set(oe, !0);
|
|
1038
|
+
const me = (Ce) => Ce[V] !== H;
|
|
1039
|
+
return m.set(`collapse_${V}_${H}`, {
|
|
1040
|
+
field: V,
|
|
1041
|
+
fieldName: V,
|
|
1042
|
+
fieldType: "string",
|
|
1043
|
+
filterValue: H,
|
|
1044
|
+
filter: me
|
|
1045
|
+
}), fe(Array.from(m.values()), Array.from(u.values()));
|
|
1046
|
+
}
|
|
1047
|
+
function xt(V) {
|
|
1048
|
+
y(te.value, V);
|
|
1049
|
+
}
|
|
1050
|
+
function Ot(V) {
|
|
1051
|
+
g(te.value, V);
|
|
1052
|
+
}
|
|
1053
|
+
function It(V, H, X) {
|
|
1054
|
+
const oe = `group_of_${V}_${H}`;
|
|
1055
|
+
return r.set(oe, !1), m.delete(`collapse_${V}_${H}`), fe(Array.from(m.values()), Array.from(u.values()), !0);
|
|
1056
|
+
}
|
|
1057
|
+
function Dt(V) {
|
|
1058
|
+
const H = V.raw[x.value], X = (oe) => !oe.__fv_parents__.has(H);
|
|
1059
|
+
d.set(`fold_${H}`, {
|
|
1060
|
+
field: "id",
|
|
1061
|
+
fieldName: "id",
|
|
1062
|
+
fieldType: "string",
|
|
1063
|
+
filterValue: String(H),
|
|
1064
|
+
filter: X
|
|
1065
|
+
}), fe(Array.from(d.values()), Array.from(u.values())), v(te.value);
|
|
1066
|
+
}
|
|
1067
|
+
function He(V) {
|
|
1068
|
+
const H = V[x.value];
|
|
1069
|
+
d.delete(`fold_${H}`);
|
|
1070
|
+
}
|
|
1071
|
+
function Pt(V) {
|
|
1072
|
+
He(V.raw), fe(Array.from(d.values()), Array.from(u.values()), !0), v(te.value);
|
|
1073
|
+
}
|
|
1074
|
+
function Se() {
|
|
1075
|
+
const V = ie();
|
|
1076
|
+
te.value = V, fe(Array.from(d.values()), Array.from(u.values())), e.hierarchy && v(te.value);
|
|
1077
|
+
}
|
|
1078
|
+
function Bt(V) {
|
|
1079
|
+
const X = e.hierarchy && I(V) ? ne(V) : V;
|
|
1080
|
+
T.value = X, Se();
|
|
1081
|
+
}
|
|
1082
|
+
function Rt(V, H, X) {
|
|
1083
|
+
return (V && V.length ? te.value.filter((me, Ce) => V.reduce((Te, ye) => Te && ye.filter(me), !0)) : te.value).slice(H, X);
|
|
1084
|
+
}
|
|
1085
|
+
function At(V) {
|
|
1086
|
+
const H = P(), X = Math.ceil(re.value / H);
|
|
1087
|
+
0 <= V && V <= X && (R.value = V, Se());
|
|
1088
|
+
}
|
|
1089
|
+
function $t(V) {
|
|
1090
|
+
T.value.push(Ae(V)), te.value = ie();
|
|
1091
|
+
}
|
|
1092
|
+
function Lt(V = 0) {
|
|
1093
|
+
if (!(V > -1))
|
|
1094
|
+
return !1;
|
|
1095
|
+
const X = $.value();
|
|
1096
|
+
e.hierarchy ? _(V, X, T) : T.value.splice(V, 0, X), Se();
|
|
1097
|
+
}
|
|
1098
|
+
function jt(V = 0) {
|
|
1099
|
+
if (!(V > -1 && e.hierarchy))
|
|
1100
|
+
return !1;
|
|
1101
|
+
const X = $.value(), oe = T.value[V];
|
|
1102
|
+
He(oe), E(V, X, T), Se();
|
|
1103
|
+
}
|
|
1104
|
+
function Ht(V, H = 0) {
|
|
1105
|
+
if (!(H > -1 && e.hierarchy))
|
|
1106
|
+
return !1;
|
|
1107
|
+
const oe = T.value[H];
|
|
1108
|
+
He(oe), h(H, V, T), Se();
|
|
1109
|
+
}
|
|
1110
|
+
function Ut(V) {
|
|
1111
|
+
const H = V ? V - 1 : 0;
|
|
1112
|
+
T.value.splice(H, 1), Se();
|
|
1113
|
+
}
|
|
1114
|
+
function Gt(V) {
|
|
1115
|
+
const H = T.value.findIndex((X) => X[x.value] === V);
|
|
1116
|
+
H !== -1 && (T.value.splice(H, 1), Se());
|
|
1117
|
+
}
|
|
1118
|
+
function qt(V) {
|
|
1119
|
+
const H = V > -1 ? T.value[V] : null;
|
|
1120
|
+
if (!(H && H.deletable !== !1))
|
|
1121
|
+
return !1;
|
|
1122
|
+
T.value = L(H, T.value), Se();
|
|
1123
|
+
}
|
|
1124
|
+
function zt() {
|
|
1125
|
+
const V = m.size > 0 ? Array.from(m.values()) : [];
|
|
1126
|
+
return fe(V, Array.from(u.values()));
|
|
1127
|
+
}
|
|
1128
|
+
function Ze(V) {
|
|
1129
|
+
ee.value.size = V;
|
|
1130
|
+
}
|
|
1131
|
+
function Wt(V) {
|
|
1132
|
+
ee.value && (Ze(V), Se());
|
|
1133
|
+
}
|
|
1134
|
+
function Yt(V, H) {
|
|
1135
|
+
const X = T.value[Number(V) - 1];
|
|
1136
|
+
X.editable !== !1 ? (X.name = H, Se()) : Z.show({
|
|
1137
|
+
showCloseButton: !1,
|
|
1138
|
+
timeout: 3e3,
|
|
1139
|
+
animate: "fadeIn",
|
|
1140
|
+
toasts: [{ type: "string", title: "提示", msg: "当前节点禁止编辑" }]
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
function Xt(V) {
|
|
1144
|
+
return V.map((X) => {
|
|
1145
|
+
const oe = Q.value.findIndex((me) => "" + me[x.value] == "" + X);
|
|
1146
|
+
return oe > -1 ? Q.value[oe] : null;
|
|
1147
|
+
}).filter((X) => X != null);
|
|
1148
|
+
}
|
|
1149
|
+
function Jt() {
|
|
1150
|
+
const V = e.summary.groupFields;
|
|
1151
|
+
K = V.reduce((H, X) => (H.set(X, 0), H), K);
|
|
1152
|
+
for (const H of A.value)
|
|
1153
|
+
V.forEach((X) => {
|
|
1154
|
+
const oe = K.get(X) || 0;
|
|
1155
|
+
K.set(X, oe + se(H, X));
|
|
1156
|
+
});
|
|
1157
|
+
V.forEach((H) => {
|
|
1158
|
+
const X = K.get(H) || 0;
|
|
1159
|
+
K.set(H, a(X.toFixed(2)));
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
function Qt(V) {
|
|
1163
|
+
const H = e.summary.groupFields;
|
|
1164
|
+
K = H.reduce((X, oe) => (X.set(oe, 0), X), K);
|
|
1165
|
+
for (const X of V)
|
|
1166
|
+
H.forEach((oe) => {
|
|
1167
|
+
const me = K.get(oe) || 0;
|
|
1168
|
+
K.set(oe, me + se(X.raw, oe));
|
|
1169
|
+
});
|
|
1170
|
+
H.forEach((X) => {
|
|
1171
|
+
const oe = K.get(X) || 0;
|
|
1172
|
+
K.set(X, a(oe.toFixed(2)));
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
return {
|
|
1176
|
+
addFilter: q,
|
|
1177
|
+
addNewDataItem: $t,
|
|
1178
|
+
addSorter: N,
|
|
1179
|
+
updatePageSize: Ze,
|
|
1180
|
+
changePageSizeTo: Wt,
|
|
1181
|
+
collapse: Pe,
|
|
1182
|
+
collapseTo: xt,
|
|
1183
|
+
dataView: te,
|
|
1184
|
+
editDataItem: Yt,
|
|
1185
|
+
expand: It,
|
|
1186
|
+
expandTo: Ot,
|
|
1187
|
+
filters: s,
|
|
1188
|
+
fold: Dt,
|
|
1189
|
+
getRange: Rt,
|
|
1190
|
+
getSelectionItems: Xt,
|
|
1191
|
+
hasRealChildren: p,
|
|
1192
|
+
insertNewChildDataItem: jt,
|
|
1193
|
+
insertNewChildDataItems: Ht,
|
|
1194
|
+
insertNewDataItem: Lt,
|
|
1195
|
+
isVisibleInTree: B,
|
|
1196
|
+
load: Bt,
|
|
1197
|
+
navigatePageTo: At,
|
|
1198
|
+
pageIndex: R,
|
|
1199
|
+
rawView: Q,
|
|
1200
|
+
refresh: zt,
|
|
1201
|
+
removeAllFilter: he,
|
|
1202
|
+
removeDataItem: Ut,
|
|
1203
|
+
removeDataItemById: Gt,
|
|
1204
|
+
removeFilter: ge,
|
|
1205
|
+
removeHierarchyDataItem: qt,
|
|
1206
|
+
removeSorter: G,
|
|
1207
|
+
reOrderVisibleIndex: be,
|
|
1208
|
+
setSorters: Be,
|
|
1209
|
+
sorters: l,
|
|
1210
|
+
summaries: K,
|
|
1211
|
+
updateSummary: Jt,
|
|
1212
|
+
toggleChildrenVisibiltyByCollapseStatus: M,
|
|
1213
|
+
totalItems: re,
|
|
1214
|
+
unFold: Pt,
|
|
1215
|
+
updateDataView: Se,
|
|
1216
|
+
visibleDataItems: ue,
|
|
1217
|
+
shouldGroupingData: C,
|
|
1218
|
+
pagination: ee,
|
|
1219
|
+
updateVisibleDataSummary: Qt
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
const Ln = [
|
|
1223
|
+
"equal",
|
|
1224
|
+
"notEqual",
|
|
1225
|
+
"greaterThan",
|
|
1226
|
+
"greaterThanOrEqual",
|
|
1227
|
+
"lessThan",
|
|
1228
|
+
"lessThanOrEqual",
|
|
1229
|
+
"contain",
|
|
1230
|
+
"startWidth",
|
|
1231
|
+
"endWidth",
|
|
1232
|
+
"in",
|
|
1233
|
+
"notIn"
|
|
1234
|
+
], jn = {
|
|
1235
|
+
equal: (e, t, n) => e && e[t] === n,
|
|
1236
|
+
notEqual: (e, t, n) => e && e[t] !== n,
|
|
1237
|
+
contain: (e, t, n) => e ? (e[t] || "").indexOf(n) > -1 : !1,
|
|
1238
|
+
startWidth: (e, t, n) => e ? (e[t] || "").startsWith(n) : !1,
|
|
1239
|
+
endWidth: (e, t, n) => e ? (e[t] || "").endsWith(n) : !1
|
|
1240
|
+
}, Hn = {
|
|
1241
|
+
equal: (e, t, n) => e && e[t] === n,
|
|
1242
|
+
in: (e, t, n) => {
|
|
1243
|
+
if (e) {
|
|
1244
|
+
const o = e[t];
|
|
1245
|
+
return n.indexOf(o) > -1;
|
|
1246
|
+
}
|
|
1247
|
+
return !1;
|
|
1248
|
+
},
|
|
1249
|
+
notEqual: (e, t, n) => e && e[t] !== n
|
|
1250
|
+
}, Un = {
|
|
1251
|
+
equal: (e, t, n) => {
|
|
1252
|
+
if (e) {
|
|
1253
|
+
const o = new Date(n).getTime();
|
|
1254
|
+
return new Date(e[t]).getTime() === o;
|
|
1255
|
+
}
|
|
1256
|
+
return !1;
|
|
1257
|
+
},
|
|
1258
|
+
notEqual: (e, t, n) => {
|
|
1259
|
+
if (e) {
|
|
1260
|
+
const o = new Date(n).getTime();
|
|
1261
|
+
return new Date(e[t]).getTime() !== o;
|
|
1262
|
+
}
|
|
1263
|
+
return !1;
|
|
1264
|
+
},
|
|
1265
|
+
greaterThan: (e, t, n) => {
|
|
1266
|
+
if (e) {
|
|
1267
|
+
const o = new Date(new Date(n).toLocaleDateString()).valueOf();
|
|
1268
|
+
return new Date(new Date(e[t]).toLocaleDateString()).valueOf() > o;
|
|
1269
|
+
}
|
|
1270
|
+
return !1;
|
|
1271
|
+
},
|
|
1272
|
+
greaterThanOrEqual: (e, t, n) => {
|
|
1273
|
+
if (e) {
|
|
1274
|
+
const o = new Date(new Date(n).toLocaleDateString()).valueOf();
|
|
1275
|
+
return new Date(new Date(e[t]).toLocaleDateString()).valueOf() >= o;
|
|
1276
|
+
}
|
|
1277
|
+
return !1;
|
|
1278
|
+
},
|
|
1279
|
+
lessThan: (e, t, n) => {
|
|
1280
|
+
if (e) {
|
|
1281
|
+
const o = new Date(new Date(n).toLocaleDateString()).valueOf();
|
|
1282
|
+
return new Date(new Date(e[t]).toLocaleDateString()).valueOf() < o;
|
|
1283
|
+
}
|
|
1284
|
+
return !1;
|
|
1285
|
+
},
|
|
1286
|
+
lessThanOrEqual: (e, t, n) => {
|
|
1287
|
+
if (e) {
|
|
1288
|
+
const o = new Date(new Date(n).toLocaleDateString()).valueOf();
|
|
1289
|
+
return new Date(new Date(e[t]).toLocaleDateString()).valueOf() <= o;
|
|
1290
|
+
}
|
|
1291
|
+
return !1;
|
|
1292
|
+
}
|
|
1293
|
+
}, Gn = {
|
|
1294
|
+
equal: (e, t, n) => e ? String(n).split(",").includes(String(e[t])) : !1,
|
|
1295
|
+
in: (e, t, n) => {
|
|
1296
|
+
if (e) {
|
|
1297
|
+
const o = e[t];
|
|
1298
|
+
return n.indexOf(o) > -1;
|
|
1299
|
+
}
|
|
1300
|
+
return !1;
|
|
1301
|
+
},
|
|
1302
|
+
notEqual: (e, t, n) => e ? String(n).split(",").findIndex((i) => i === String(e[t])) === -1 : !1
|
|
1303
|
+
}, qn = {
|
|
1304
|
+
equal: (e, t, n) => {
|
|
1305
|
+
if (e) {
|
|
1306
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1307
|
+
return isNaN(o) ? isNaN(i) : o === i;
|
|
1308
|
+
}
|
|
1309
|
+
return !1;
|
|
1310
|
+
},
|
|
1311
|
+
notEqual: (e, t, n) => {
|
|
1312
|
+
if (e) {
|
|
1313
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1314
|
+
return isNaN(o) ? !0 : o !== i;
|
|
1315
|
+
}
|
|
1316
|
+
return !1;
|
|
1317
|
+
},
|
|
1318
|
+
greaterThan: (e, t, n) => {
|
|
1319
|
+
if (e) {
|
|
1320
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1321
|
+
return isNaN(o) ? isNaN(i) : i > o;
|
|
1322
|
+
}
|
|
1323
|
+
return !1;
|
|
1324
|
+
},
|
|
1325
|
+
greaterThanOrEqual: (e, t, n) => {
|
|
1326
|
+
if (e) {
|
|
1327
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1328
|
+
return isNaN(o) ? isNaN(i) : i >= o;
|
|
1329
|
+
}
|
|
1330
|
+
return !1;
|
|
1331
|
+
},
|
|
1332
|
+
lessThan: (e, t, n) => {
|
|
1333
|
+
if (e) {
|
|
1334
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1335
|
+
return isNaN(o) ? isNaN(i) : i < o;
|
|
1336
|
+
}
|
|
1337
|
+
return !1;
|
|
1338
|
+
},
|
|
1339
|
+
lessThanOrEqual: (e, t, n) => {
|
|
1340
|
+
if (e) {
|
|
1341
|
+
const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
|
|
1342
|
+
return isNaN(o) ? isNaN(i) : i <= o;
|
|
1343
|
+
}
|
|
1344
|
+
return !1;
|
|
1345
|
+
}
|
|
1346
|
+
}, zn = /* @__PURE__ */ new Map([
|
|
1347
|
+
["boolean", Hn],
|
|
1348
|
+
["datetime", Un],
|
|
1349
|
+
["enum", Gn],
|
|
1350
|
+
["number", qn],
|
|
1351
|
+
["text", jn]
|
|
1352
|
+
]);
|
|
1353
|
+
function Wn(e, t) {
|
|
1354
|
+
const n = O([]), o = /* @__PURE__ */ new Map(), { loadConditionGroup: i } = wn();
|
|
1355
|
+
function a(g, v) {
|
|
1356
|
+
switch (g) {
|
|
1357
|
+
case "check-box":
|
|
1358
|
+
return new xn({ value: v });
|
|
1359
|
+
case "combo-list":
|
|
1360
|
+
return new Vn({ value: v });
|
|
1361
|
+
case "combo-lookup":
|
|
1362
|
+
return new Nn({ value: v });
|
|
1363
|
+
case "input-group":
|
|
1364
|
+
return new qe({ value: v });
|
|
1365
|
+
case "date-picker":
|
|
1366
|
+
return new Mn({ value: v });
|
|
1367
|
+
case "date-range":
|
|
1368
|
+
return new rt({ value: v });
|
|
1369
|
+
case "datetime-picker":
|
|
1370
|
+
return new Fn({ value: v });
|
|
1371
|
+
case "datetime-range":
|
|
1372
|
+
return new rt({ value: v });
|
|
1373
|
+
case "lookup":
|
|
1374
|
+
return new qe({ value: v });
|
|
1375
|
+
case "month-picker":
|
|
1376
|
+
return new kn({ value: v });
|
|
1377
|
+
case "month-range":
|
|
1378
|
+
return new En({ value: v });
|
|
1379
|
+
case "number-range":
|
|
1380
|
+
return new Tn({ value: v });
|
|
1381
|
+
case "number-spinner":
|
|
1382
|
+
return new Sn({ value: v });
|
|
1383
|
+
case "radio-group":
|
|
1384
|
+
return new Cn({ value: v });
|
|
1385
|
+
default:
|
|
1386
|
+
return new qe({ value: v });
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
const r = /* @__PURE__ */ new Map([
|
|
1390
|
+
["boolean", "check-box"],
|
|
1391
|
+
["date", "date-picker"],
|
|
1392
|
+
["datetime", "datetime-picker"],
|
|
1393
|
+
["number", "number-spinner"],
|
|
1394
|
+
["string", "text"],
|
|
1395
|
+
["text", "text"],
|
|
1396
|
+
["enum", "combo-list"],
|
|
1397
|
+
["reference", "lookup"]
|
|
1398
|
+
]), c = /* @__PURE__ */ new Map([
|
|
1399
|
+
// ['boolean', CompareType.In],
|
|
1400
|
+
["boolean", we.Equal],
|
|
1401
|
+
["date", we.Equal],
|
|
1402
|
+
["datetime", we.Equal],
|
|
1403
|
+
["number", we.Equal],
|
|
1404
|
+
["string", we.Equal],
|
|
1405
|
+
["text", we.Equal],
|
|
1406
|
+
["enum", we.In],
|
|
1407
|
+
["reference", we.Equal]
|
|
1408
|
+
]);
|
|
1409
|
+
function m() {
|
|
1410
|
+
n.value.forEach((v, p) => {
|
|
1411
|
+
p === n.value.length - 1 ? v.relation = 0 : v.relation = 1;
|
|
1412
|
+
});
|
|
1413
|
+
const g = [];
|
|
1414
|
+
return n.value.forEach((v) => {
|
|
1415
|
+
const { valueType: p } = v.value, _ = v.value.value;
|
|
1416
|
+
if (p === "boolean") {
|
|
1417
|
+
const E = [];
|
|
1418
|
+
_.length === 1 && E.push({
|
|
1419
|
+
filterField: v.fieldCode,
|
|
1420
|
+
compare: v.compareType || v.compareType === 0 ? v.compareType : we.Like,
|
|
1421
|
+
value: v.value.value[0],
|
|
1422
|
+
relation: n.value.length > 1 ? v.relation || v.relation === 0 ? v.relation : 1 : 0,
|
|
1423
|
+
expresstype: xe.Value,
|
|
1424
|
+
lbracket: v.lBracket || null,
|
|
1425
|
+
rbracket: v.rBracket || null
|
|
1426
|
+
}), _.length > 1 && E.push({
|
|
1427
|
+
filterField: v.fieldCode,
|
|
1428
|
+
compare: v.compareType || v.compareType === 0 ? v.compareType : we.Like,
|
|
1429
|
+
value: v.value.value[0],
|
|
1430
|
+
relation: 2,
|
|
1431
|
+
expresstype: xe.Value,
|
|
1432
|
+
lbracket: v.lBracket ? v.lBracket + "(" : "(",
|
|
1433
|
+
rbracket: v.rBracket || null
|
|
1434
|
+
}, {
|
|
1435
|
+
filterField: v.fieldCode,
|
|
1436
|
+
compare: v.compareType || v.compareType === 0 ? v.compareType : we.Like,
|
|
1437
|
+
value: v.value.value[1],
|
|
1438
|
+
relation: n.value.length > 1 ? v.relation || v.relation === 0 ? v.relation : 1 : 0,
|
|
1439
|
+
expresstype: xe.Value,
|
|
1440
|
+
lbracket: v.lBracket || null,
|
|
1441
|
+
rbracket: v.rBracket ? v.rBracket + ")" : ")"
|
|
1442
|
+
}), g.push(...E);
|
|
1443
|
+
} else
|
|
1444
|
+
g.push({
|
|
1445
|
+
filterField: v.fieldCode,
|
|
1446
|
+
compare: v.compareType || v.compareType === 0 ? v.compareType : we.Like,
|
|
1447
|
+
value: v.value.value,
|
|
1448
|
+
relation: n.value.length > 1 ? v.relation || v.relation === 0 ? v.relation : 1 : 0,
|
|
1449
|
+
expresstype: xe.Value,
|
|
1450
|
+
lbracket: v.lBracket || null,
|
|
1451
|
+
rbracket: v.rBracket || null
|
|
1452
|
+
});
|
|
1453
|
+
}), g;
|
|
1454
|
+
}
|
|
1455
|
+
function d(g) {
|
|
1456
|
+
var p;
|
|
1457
|
+
const v = g.dataType || "string";
|
|
1458
|
+
return ((p = g.editor) == null ? void 0 : p.type) || r.get(v) || "text";
|
|
1459
|
+
}
|
|
1460
|
+
function u(g) {
|
|
1461
|
+
var D, x, k, $, A;
|
|
1462
|
+
const v = `field_filter_${g.field}`, p = Date.now(), _ = g.field, E = ((D = g.column) == null ? void 0 : D.title) || "", h = ((x = g.column) == null ? void 0 : x.dataType) || "string", B = c.get(h) || we.Equal, Y = (($ = (k = g.column) == null ? void 0 : k.editor) == null ? void 0 : $.type) || r.get(h) || "text", M = a(Y, (A = g.column) == null ? void 0 : A.filter), L = Y === "lookup" || Y === "combo-lookup" ? xe.SmartHelp : Y === "combo-list" ? xe.Enum : xe.Value;
|
|
1463
|
+
o.set(v, { id: v, fieldCode: _, fieldName: E, compareType: B, valueType: L, value: M, conditionId: p, relation: 1 }), n.value = Array.from(o.values());
|
|
1464
|
+
}
|
|
1465
|
+
function s(g) {
|
|
1466
|
+
const v = `field_filter_${g.field}`;
|
|
1467
|
+
o.delete(v), n.value = Array.from(o.values());
|
|
1468
|
+
}
|
|
1469
|
+
function l(g) {
|
|
1470
|
+
o.delete(g), n.value = Array.from(o.values());
|
|
1471
|
+
}
|
|
1472
|
+
function b() {
|
|
1473
|
+
o.clear(), n.value = [];
|
|
1474
|
+
}
|
|
1475
|
+
function f(g) {
|
|
1476
|
+
const { valueType: v } = g.value, p = g.compareType || "0", _ = Ln[Number(p)];
|
|
1477
|
+
return zn.get(v)[_];
|
|
1478
|
+
}
|
|
1479
|
+
function w(g) {
|
|
1480
|
+
const v = g.relation === 2 ? 0 : 1, p = g.items.map((E) => {
|
|
1481
|
+
const h = f(E);
|
|
1482
|
+
return (Y) => h(Y, E.fieldCode, E.value.getValue());
|
|
1483
|
+
}), _ = g.children && g.children.length ? g.children.map((E) => w(E)) : [];
|
|
1484
|
+
return { relation: v, filterFunctions: p, children: _ };
|
|
1485
|
+
}
|
|
1486
|
+
function C() {
|
|
1487
|
+
const g = i(n.value);
|
|
1488
|
+
return w(g);
|
|
1489
|
+
}
|
|
1490
|
+
function T(g, v) {
|
|
1491
|
+
const p = v.filterFunctions.map((E) => E(g)), _ = v.children.map((E) => T(g, E));
|
|
1492
|
+
return v.relation === 1 ? p.every((E) => E) && _.every((E) => E) : p.includes(!0) || _.includes(!0);
|
|
1493
|
+
}
|
|
1494
|
+
function S(g) {
|
|
1495
|
+
const v = C();
|
|
1496
|
+
return T(g, v);
|
|
1497
|
+
}
|
|
1498
|
+
function y(g) {
|
|
1499
|
+
t.emit("filterChanged", g);
|
|
1500
|
+
}
|
|
1501
|
+
return {
|
|
1502
|
+
addColumnFilter: u,
|
|
1503
|
+
apply: S,
|
|
1504
|
+
clearCondition: b,
|
|
1505
|
+
conditions: n,
|
|
1506
|
+
getFilterEditorType: d,
|
|
1507
|
+
removeColumnFilter: s,
|
|
1508
|
+
removeCondition: l,
|
|
1509
|
+
filterFromServer: y,
|
|
1510
|
+
createFilterConditions: m
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
function Yn(e) {
|
|
1514
|
+
O(e.selection.showCheckbox || !1);
|
|
1515
|
+
const t = W(() => {
|
|
1516
|
+
var r;
|
|
1517
|
+
return ((r = e.hierarchy) == null ? void 0 : r.collapseField) || "__fv_collapse__";
|
|
1518
|
+
}), n = W(() => {
|
|
1519
|
+
var r;
|
|
1520
|
+
return ((r = e.hierarchy) == null ? void 0 : r.hasChildrenField) || "__fv_hasChildren__";
|
|
1521
|
+
}), o = W(() => {
|
|
1522
|
+
var r;
|
|
1523
|
+
return ((r = e.hierarchy) == null ? void 0 : r.parentIdField) || "parent";
|
|
1524
|
+
}), i = W(() => e.hierarchy && e.selection.showCheckbox), a = W(() => (e.treeNodeIconsData.fold || e.iconField) && e.showTreeNodeIcons);
|
|
1525
|
+
return { collapseField: t, hasChildrenField: n, parentIdField: o, shouldShowCheckBox: i, shouldShowIcon: a };
|
|
1526
|
+
}
|
|
1527
|
+
function Xn(e, t, n, o, i, a, r, c) {
|
|
1528
|
+
const m = O(o.value - 1 + i), d = O(0), { renderDataRow: u } = a, s = r ? r.renderGroupRow : u, l = c ? c.renderSummaryRow : u;
|
|
1529
|
+
function b(C) {
|
|
1530
|
+
let T = u;
|
|
1531
|
+
return C.__fv_data_grid_group_row__ && (T = s), C.__fv_data_grid_group_summary__ && (T = l), T;
|
|
1532
|
+
}
|
|
1533
|
+
function f(C, T, S, y) {
|
|
1534
|
+
const { dataView: g, visibleDataItems: v } = n, p = [], _ = e.virtualized ? v.value : g.value;
|
|
1535
|
+
if (_.length > 0) {
|
|
1536
|
+
const E = y ? Date.now().toString() : "";
|
|
1537
|
+
let h = C, B = 0;
|
|
1538
|
+
const Y = T - C + 1;
|
|
1539
|
+
for (; p.length < Y && h < _.length; ) {
|
|
1540
|
+
const M = _[h], L = _[h - 1] || S, D = p[B - 1], x = L ? (L.__fv_data_position__ || 0) + (L.__fv_data_height__ || 0) : 0, $ = b(M)(M, L, D, h, x, t.value);
|
|
1541
|
+
$.refreshKey = E, $.visible && (p.push($), B++), h++;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
return d.value = p.length > 0 ? p[0].raw.__fv_visible_index__ : 0, m.value = p.length > 0 ? p[p.length - 1].raw.__fv_visible_index__ : 0, p;
|
|
1545
|
+
}
|
|
1546
|
+
function w(C, T, S) {
|
|
1547
|
+
const y = T.groupField || "", { groupValue: g, raw: v } = T;
|
|
1548
|
+
n[C](y, g, v.groupParents || []);
|
|
1549
|
+
const { dataView: p } = n, _ = S[0].index, E = Math.min(_ + o.value + i + 1, p.value.length - 1);
|
|
1550
|
+
return f(_, E);
|
|
1551
|
+
}
|
|
1552
|
+
return { getVisualData: f, maxVisibleRowIndex: m, minVisibleRowIndex: d, toggleGroupRow: w };
|
|
1553
|
+
}
|
|
1554
|
+
function Jn(e) {
|
|
1555
|
+
var a;
|
|
1556
|
+
const { isUndefined: t } = lt(), n = ((a = e.rowOption) == null ? void 0 : a.height) || 28;
|
|
1557
|
+
function o(r, c) {
|
|
1558
|
+
const m = r.pre;
|
|
1559
|
+
if (m) {
|
|
1560
|
+
let d = m.__fv_data_position__, u = m.__fv_data_height__;
|
|
1561
|
+
(t(d) || // when virtual loading, position of tree node should recalculate after collapse tree node.
|
|
1562
|
+
e.virtualized && e.hierarchy && m.__fv_visible_index__ * n !== d) && (d = m.__fv_visible_index__ * n), t(u) && (u = n);
|
|
1563
|
+
const s = r.visible ? d + u : m.__fv_data_position__;
|
|
1564
|
+
r.top = s, c.__fv_data_position__ = s;
|
|
1565
|
+
} else
|
|
1566
|
+
r.top = 0, c.__fv_data_position__ = 0;
|
|
1567
|
+
}
|
|
1568
|
+
function i(r, c, m) {
|
|
1569
|
+
if (r && !c.ref) {
|
|
1570
|
+
c.ref = r;
|
|
1571
|
+
const d = c.parent;
|
|
1572
|
+
c.cellHeight !== r.offsetHeight && (c.cellHeight = r.offsetHeight), c.cellHeight && c.cellHeight > (d.height || 0) && (d.height = c.cellHeight, m.__fv_data_height__ = d.height), o(d, m);
|
|
1573
|
+
}
|
|
1574
|
+
!r && c.ref && (c.ref = r);
|
|
1575
|
+
}
|
|
1576
|
+
return { updateRowPosition: o, updateVisualInfomation: i };
|
|
1577
|
+
}
|
|
1578
|
+
function Qn() {
|
|
1579
|
+
function e(t, n) {
|
|
1580
|
+
var r, c;
|
|
1581
|
+
if (!n.data || !n.data.length)
|
|
1582
|
+
return "";
|
|
1583
|
+
const o = Object.prototype.hasOwnProperty.call(n, "valueField") && n.valueField || "value", i = Object.prototype.hasOwnProperty.call(n, "textField") && n.textField || "name";
|
|
1584
|
+
if (t != null && t.includes(",")) {
|
|
1585
|
+
const m = t.split(",");
|
|
1586
|
+
if (!n.data.filter((l) => m.includes(l[o])).length)
|
|
1587
|
+
return "";
|
|
1588
|
+
const u = (r = n.data) == null ? void 0 : r.reduce((l, b) => (l[b[o]] = b, l), {});
|
|
1589
|
+
return m.map((l) => {
|
|
1590
|
+
var b;
|
|
1591
|
+
return (b = u[l]) == null ? void 0 : b[i];
|
|
1592
|
+
}).join(",") || t;
|
|
1593
|
+
}
|
|
1594
|
+
const a = (c = n.data) == null ? void 0 : c.find((m) => m[o] === t);
|
|
1595
|
+
return (a == null ? void 0 : a[i]) || t || "";
|
|
1596
|
+
}
|
|
1597
|
+
return {
|
|
1598
|
+
renderEnumColumn: e
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
function Zn() {
|
|
1602
|
+
function e(t, n) {
|
|
1603
|
+
return t ? n == null ? void 0 : n.trueText : n == null ? void 0 : n.falseText;
|
|
1604
|
+
}
|
|
1605
|
+
return {
|
|
1606
|
+
renderText: e
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1609
|
+
function Kn() {
|
|
1610
|
+
const {
|
|
1611
|
+
formatTo: e
|
|
1612
|
+
} = on();
|
|
1613
|
+
function t(o, i) {
|
|
1614
|
+
if (o) {
|
|
1615
|
+
let a = "yyyy-MM-dd";
|
|
1616
|
+
if (typeof i == "string" ? a = i : typeof i == "object" && (a = i.format || "yyyy-MM-dd"), a = a.replace("YYYY", "yyyy").replace("-DD", "-dd"), typeof i == "object" && i.dateRange) {
|
|
1617
|
+
const r = i.dateRangeDatesDelimiter || "~";
|
|
1618
|
+
let [c, m] = o.split(r);
|
|
1619
|
+
return c = e(c, a), m = e(m, a), c + r + m;
|
|
1620
|
+
}
|
|
1621
|
+
return e(o, a);
|
|
1622
|
+
}
|
|
1623
|
+
return o;
|
|
1624
|
+
}
|
|
1625
|
+
function n(o, i) {
|
|
1626
|
+
const a = i.dateFormat || "yyyy-MM-dd";
|
|
1627
|
+
return e(o, a);
|
|
1628
|
+
}
|
|
1629
|
+
return {
|
|
1630
|
+
renderDateColumn: n,
|
|
1631
|
+
renderDateTimeColumn: t
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
function eo() {
|
|
1635
|
+
const {
|
|
1636
|
+
formatTo: e
|
|
1637
|
+
} = st();
|
|
1638
|
+
function t(n, o) {
|
|
1639
|
+
const i = {
|
|
1640
|
+
precision: o.precision,
|
|
1641
|
+
prefix: o.prefix || "",
|
|
1642
|
+
suffix: o.suffix || "",
|
|
1643
|
+
decimalSeparator: o.decimal || ".",
|
|
1644
|
+
groupSeparator: o.thousand || ""
|
|
1645
|
+
};
|
|
1646
|
+
return e(n, i) || n;
|
|
1647
|
+
}
|
|
1648
|
+
return {
|
|
1649
|
+
renderNumberColumn: t
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
function to() {
|
|
1653
|
+
function e(t, n) {
|
|
1654
|
+
if (t) {
|
|
1655
|
+
const o = {};
|
|
1656
|
+
return n != null && n.width && (o.width = `${n.width}px`), n != null && n.height && (o.height = `${n.height}px`), F("img", {
|
|
1657
|
+
src: t,
|
|
1658
|
+
style: o
|
|
1659
|
+
}, null);
|
|
1660
|
+
}
|
|
1661
|
+
return t;
|
|
1662
|
+
}
|
|
1663
|
+
return {
|
|
1664
|
+
renderImageColumn: e
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
function no() {
|
|
1668
|
+
const {
|
|
1669
|
+
locale: e
|
|
1670
|
+
} = je();
|
|
1671
|
+
function t(n, o) {
|
|
1672
|
+
return (n == null ? void 0 : n[e.value || "zh-CHS"]) || "";
|
|
1673
|
+
}
|
|
1674
|
+
return {
|
|
1675
|
+
renderMultilingualColumn: t
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
function oo() {
|
|
1679
|
+
const {
|
|
1680
|
+
renderText: e
|
|
1681
|
+
} = Zn(), {
|
|
1682
|
+
renderEnumColumn: t
|
|
1683
|
+
} = Qn(), {
|
|
1684
|
+
renderNumberColumn: n
|
|
1685
|
+
} = eo(), {
|
|
1686
|
+
renderDateColumn: o,
|
|
1687
|
+
renderDateTimeColumn: i
|
|
1688
|
+
} = Kn(), {
|
|
1689
|
+
renderImageColumn: a
|
|
1690
|
+
} = to(), {
|
|
1691
|
+
renderMultilingualColumn: r
|
|
1692
|
+
} = no();
|
|
1693
|
+
function c(u) {
|
|
1694
|
+
return typeof u == "boolean" ? u.toString() : u;
|
|
1695
|
+
}
|
|
1696
|
+
function m(u, s, l) {
|
|
1697
|
+
return s.customFormat ? (
|
|
1698
|
+
// new Function(`return ${options.customFormat}`)() :
|
|
1699
|
+
s.customFormat(u, l.raw)
|
|
1700
|
+
) : c(u);
|
|
1701
|
+
}
|
|
1702
|
+
function d(u, s, l) {
|
|
1703
|
+
const {
|
|
1704
|
+
column: b
|
|
1705
|
+
} = u, f = se(s.raw, b.field), w = l.options || l;
|
|
1706
|
+
return l.type === Ee.NONE ? c(f) : l.type === Ee.CUSTOM ? m(f, l, s) : l.type === Ee.ENUM ? t(f, w) : l.type === Ee.NUMBER ? n(f, w) : l.type === Ee.BOOLEAN ? e(f, w) : l.type === Ee.DATE ? o(f, w) : l.type === Ee.DATE_TIME ? i(f, l) : l.type === Ee.IMAGE ? a(f, w) : l.type === Ee.MULTI_LINGUAL ? r(f, w) : c(f);
|
|
1707
|
+
}
|
|
1708
|
+
return {
|
|
1709
|
+
renderFormatColumn: d
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
function ro(e, t, n) {
|
|
1713
|
+
var T;
|
|
1714
|
+
const { isUndefined: o } = lt(), i = O(e.mergeCell);
|
|
1715
|
+
(T = O(e.rowOption).value) != null && T.wrapContent;
|
|
1716
|
+
const { updateVisualInfomation: r } = n, { renderCommandColumn: c } = Dn(e), { renderFormatColumn: m } = oo();
|
|
1717
|
+
function d(S, y, g, v, p, _ = 1) {
|
|
1718
|
+
const E = {
|
|
1719
|
+
colSpan: _,
|
|
1720
|
+
rowSpan: 1,
|
|
1721
|
+
index: g,
|
|
1722
|
+
field: S,
|
|
1723
|
+
data: se(v, S),
|
|
1724
|
+
editingData: se(v, S),
|
|
1725
|
+
parent: p,
|
|
1726
|
+
mode: y,
|
|
1727
|
+
align: "left",
|
|
1728
|
+
valign: "start",
|
|
1729
|
+
showEllipsis: !0,
|
|
1730
|
+
getEditor: (h) => h.data,
|
|
1731
|
+
setRef: (h) => r(h, E, v),
|
|
1732
|
+
update: () => {
|
|
1733
|
+
},
|
|
1734
|
+
accept: () => {
|
|
1735
|
+
},
|
|
1736
|
+
cancel: () => {
|
|
1737
|
+
},
|
|
1738
|
+
updateData: () => {
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
return E;
|
|
1742
|
+
}
|
|
1743
|
+
function u(S, y, g) {
|
|
1744
|
+
return S.getEditor = (v) => t.getEditor(v, y, v.parent), S.setRef = (v) => r(v, S, g), S.update = (v) => {
|
|
1745
|
+
v !== void 0 && (S.editingData = v);
|
|
1746
|
+
}, S.accept = () => {
|
|
1747
|
+
We(S.editingData, g, y.field), S.data = se(g, y.field);
|
|
1748
|
+
}, S.cancel = () => {
|
|
1749
|
+
S.editingData = S.data;
|
|
1750
|
+
}, S.updateData = (v) => {
|
|
1751
|
+
We(se(v, y.field), g, y.field), S.data = se(g, y.field), S.editingData = se(g, y.field);
|
|
1752
|
+
}, S;
|
|
1753
|
+
}
|
|
1754
|
+
function s(S, y) {
|
|
1755
|
+
y.dataType === "commands" ? S.formatter = (g, v) => y.formatter ? y.formatter(S, v) : c(S, v) : y.formatter && (S.formatter = (g, v) => typeof y.formatter == "function" ? y.formatter(g, v) : m(S, v, y.formatter));
|
|
1756
|
+
}
|
|
1757
|
+
function l(S, y, g) {
|
|
1758
|
+
const v = y && y.data[g];
|
|
1759
|
+
if (v && v.data === S.data) {
|
|
1760
|
+
const _ = v && v.spannedBy || v;
|
|
1761
|
+
_.rowSpan++, _.spanned = _.spanned || [], _.spanned.push(S), S.colSpan = 0, S.rowSpan = 0, S.spannedBy = _;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
function b(S, y, g) {
|
|
1765
|
+
i.value && l(S, y, g.field);
|
|
1766
|
+
}
|
|
1767
|
+
function f(S, y) {
|
|
1768
|
+
y.showEllipsis !== void 0 && (S.showEllipsis = y.showEllipsis), S.showTips = o(y.showTips) ? !0 : y.showTips, S.column = y, S.align = y.align || "left", S.valign = y.valign || "middle", S.mode = e.editable ? _e.editable : _e.readonly;
|
|
1769
|
+
}
|
|
1770
|
+
function w(S, y, g, v) {
|
|
1771
|
+
f(S, y), u(S, y, v), s(S, y), b(S, g, y);
|
|
1772
|
+
}
|
|
1773
|
+
function C(S, y, g, v, p) {
|
|
1774
|
+
const _ = e.editable ? _e.editable : _e.readonly, E = d(S.field, _, y, g, v);
|
|
1775
|
+
return w(E, S, p, g), E;
|
|
1776
|
+
}
|
|
1777
|
+
return { createCellByColumn: C, createCellByField: d, updateCellByColumn: w };
|
|
1778
|
+
}
|
|
1779
|
+
function io(e, t, n, o, i, a, r) {
|
|
1780
|
+
var y, g;
|
|
1781
|
+
const c = O(e.rowOption), m = ((y = c.value) == null ? void 0 : y.height) || 28, d = ((g = c.value) == null ? void 0 : g.wrapContent) || !1, { idField: u } = i, { collapseField: s } = o, { updateRowPosition: l } = a, { createCellByColumn: b } = r, f = (v, p, _, E) => {
|
|
1782
|
+
We(se(v, E), p, E), _.data[E].data = se(p, E), _.data[E].editingData = se(p, E);
|
|
1783
|
+
};
|
|
1784
|
+
function w(v, p, _, E, h, B) {
|
|
1785
|
+
var J, K, re;
|
|
1786
|
+
const {
|
|
1787
|
+
__fv_data_grid_group_field__: Y,
|
|
1788
|
+
__fv_data_grid_group_value__: M,
|
|
1789
|
+
__fv_data_index__: L
|
|
1790
|
+
} = _, D = _.__fv_data_grid_group_layer__ || (_.__fv_parents__ ? (J = _.__fv_parents__) == null ? void 0 : J.size : 0) || 0, x = typeof _.parent == "number" ? Number(_.parent) : -1, k = _.__fv_data_grid_group_collapse__ || _[s.value], $ = _.__fv_visible__ === void 0 ? !0 : _.__fv_visible__, A = _.__fv_checked__, Q = _.__fv_indeterminate__, ne = _.__fv_disabled__ || _[((K = e.rowOption) == null ? void 0 : K.disabledField) || "disabled"], I = e.hierarchy && t.isVisibleInTree(_), z = {
|
|
1791
|
+
collapse: k,
|
|
1792
|
+
data: {},
|
|
1793
|
+
dataIndex: L,
|
|
1794
|
+
groupField: Y,
|
|
1795
|
+
groupValue: M,
|
|
1796
|
+
layer: D,
|
|
1797
|
+
index: p,
|
|
1798
|
+
parentIndex: x,
|
|
1799
|
+
pre: E,
|
|
1800
|
+
top: B,
|
|
1801
|
+
type: v,
|
|
1802
|
+
raw: _,
|
|
1803
|
+
checked: A,
|
|
1804
|
+
disabled: ne,
|
|
1805
|
+
indeterminate: Q,
|
|
1806
|
+
setRef: (ee) => {
|
|
1807
|
+
z.ref = ee;
|
|
1808
|
+
},
|
|
1809
|
+
visible: $ && I || $ && !e.hierarchy,
|
|
1810
|
+
status: Fe.initial,
|
|
1811
|
+
updateCell: (ee, P) => {
|
|
1812
|
+
f(ee, _, z, P), t.updateSummary();
|
|
1813
|
+
},
|
|
1814
|
+
updateCells: (ee, P) => {
|
|
1815
|
+
P.forEach((R) => {
|
|
1816
|
+
f(ee, _, z, R);
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
return E || (_.__fv_data_position__ = 0), d || (z.height = m, _.__fv_data_height__ = z.height, l(z, _)), (re = c.value) != null && re.customRowStatus && (c.value.customRowStatus(z), _.__fv_disabled__ = z.disabled), z;
|
|
1821
|
+
}
|
|
1822
|
+
function C(v, p, _, E, h, B) {
|
|
1823
|
+
const Y = w(Ie.data, h, p, _, E, B);
|
|
1824
|
+
return v.forEach((M, L) => {
|
|
1825
|
+
Y.data[M.field] = b(M, L, p, Y, E);
|
|
1826
|
+
}), Y;
|
|
1827
|
+
}
|
|
1828
|
+
function T(v, p, _, E, h) {
|
|
1829
|
+
return Object.assign(v, { index: p, dataIndex: _, top: E, pre: h });
|
|
1830
|
+
}
|
|
1831
|
+
function S(v, p, _, E, h, B) {
|
|
1832
|
+
const Y = v.__fv_data_index__, M = v[u.value], L = n.getEditingSnapshot(M);
|
|
1833
|
+
return L === null ? C(
|
|
1834
|
+
B,
|
|
1835
|
+
v,
|
|
1836
|
+
p,
|
|
1837
|
+
_,
|
|
1838
|
+
E,
|
|
1839
|
+
h
|
|
1840
|
+
) : T(L, E, Y, h, p);
|
|
1841
|
+
}
|
|
1842
|
+
return { createEmptyRow: w, createNewRowFromDataItem: C, renderDataRow: S };
|
|
1843
|
+
}
|
|
1844
|
+
function ao(e, t, n, o) {
|
|
1845
|
+
const i = O(e.summary), { idField: a } = t, { createCellByField: r } = n, { createEmptyRow: c } = o, m = W(() => {
|
|
1846
|
+
const l = i.value;
|
|
1847
|
+
return (l == null ? void 0 : l.groupFields) || [];
|
|
1848
|
+
}), d = W(() => {
|
|
1849
|
+
const l = i.value;
|
|
1850
|
+
return l && l.enable && l.groupFields && l.groupFields.length > 0;
|
|
1851
|
+
});
|
|
1852
|
+
function u(l, b, f, w) {
|
|
1853
|
+
if (d.value) {
|
|
1854
|
+
const C = l.data[b];
|
|
1855
|
+
let T = C.colSpan;
|
|
1856
|
+
const S = m.value.reduce((y, g) => (y.set(g, !0), y), /* @__PURE__ */ new Map());
|
|
1857
|
+
w.reduce((y, g, v) => {
|
|
1858
|
+
if (S.has(g.field)) {
|
|
1859
|
+
const p = r(g.field, _e.readonly, v, f, l);
|
|
1860
|
+
l.data[g.field] = p, T - 1 > v && (T = v);
|
|
1861
|
+
}
|
|
1862
|
+
return y;
|
|
1863
|
+
}, l), C.colSpan = T;
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
function s(l, b, f, w, C, T, S) {
|
|
1867
|
+
const y = l.__fv_data_grid_group_field__, g = c(Ie.group, w, l, b, f, C);
|
|
1868
|
+
return g.data[a.value] = r(a.value, _e.readonly, -1, l, g, 0), g.data[y] = r(y, _e.readonly, 1, l, g, T.length), u(g, y, l, T), g;
|
|
1869
|
+
}
|
|
1870
|
+
return { renderGroupRow: s };
|
|
1871
|
+
}
|
|
1872
|
+
function so(e, t, n, o) {
|
|
1873
|
+
const { idField: i } = t, { createCellByField: a } = n, { createEmptyRow: r } = o;
|
|
1874
|
+
function c(m, d, u, s, l, b, f) {
|
|
1875
|
+
const w = m.__fv_data_grid_group_field__, C = r(Ie.summary, s, m, d, u, l);
|
|
1876
|
+
return C.data[i.value] = a(i.value, _e.readonly, -1, m, C), C.data[w] = a(w, _e.readonly, 1, m, C, b.length), C;
|
|
1877
|
+
}
|
|
1878
|
+
return { renderSummaryRow: c };
|
|
1879
|
+
}
|
|
1880
|
+
function lo(e, t, n, o, i) {
|
|
1881
|
+
var ne;
|
|
1882
|
+
const {
|
|
1883
|
+
idField: a
|
|
1884
|
+
} = n, r = O(e.editable), c = O(e.editOption), m = O(((ne = e.rowOption) == null ? void 0 : ne.wrapContent) || !1), {
|
|
1885
|
+
onClickRow: d,
|
|
1886
|
+
onClickRowExcludeDblclick: u
|
|
1887
|
+
} = o, s = /* @__PURE__ */ new Map([["boolean", "check-box"], ["datetime", "date-picker"], ["enum", "combo-list"], ["number", "number-spinner"], ["string", "input-group"], ["text", "text"], ["commands", "commands-editor"]]);
|
|
1888
|
+
let l, b, f, w, C;
|
|
1889
|
+
function T(I) {
|
|
1890
|
+
return b && b.raw[a.value] === I ? b : null;
|
|
1891
|
+
}
|
|
1892
|
+
const S = ct({});
|
|
1893
|
+
function y(I, z, J = {}) {
|
|
1894
|
+
I.mode = _e.editing, l = I, b = z, f = se(z == null ? void 0 : z.raw, I.field), w = J;
|
|
1895
|
+
for (const K in S)
|
|
1896
|
+
delete S[K];
|
|
1897
|
+
}
|
|
1898
|
+
function g(I) {
|
|
1899
|
+
I.accept(), I.mode = _e.editable, l = null;
|
|
1900
|
+
const z = {};
|
|
1901
|
+
b && (Object.keys(b).forEach((J) => {
|
|
1902
|
+
z[J] = b == null ? void 0 : b[J];
|
|
1903
|
+
}), b = null), t.emit("endEditCell", {
|
|
1904
|
+
cell: I,
|
|
1905
|
+
row: z,
|
|
1906
|
+
newValue: se(z == null ? void 0 : z.raw, I.field),
|
|
1907
|
+
oldValue: f,
|
|
1908
|
+
column: w,
|
|
1909
|
+
editor: S
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
function v(I) {
|
|
1913
|
+
const z = Promise.resolve(!0);
|
|
1914
|
+
return I ? z.then(() => tt(e.beforeEndEditCell) ? !0 : typeof e.beforeEndEditCell == "function" ? e.beforeEndEditCell({
|
|
1915
|
+
cell: I,
|
|
1916
|
+
row: b,
|
|
1917
|
+
newValue: I.editingData,
|
|
1918
|
+
oldValue: f
|
|
1919
|
+
}) : () => !0).then((J) => (J && (g(I), b && (b = null)), J)) : z;
|
|
1920
|
+
}
|
|
1921
|
+
function p(I) {
|
|
1922
|
+
if (C && C !== I.target) {
|
|
1923
|
+
C = null;
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
if (document.body.classList.contains("lookup-modal-open"))
|
|
1927
|
+
return;
|
|
1928
|
+
const J = I.target;
|
|
1929
|
+
if (!(J != null && J.closest(".popover"))) {
|
|
1930
|
+
if (I instanceof MouseEvent || I.key !== "Enter") {
|
|
1931
|
+
const K = J.closest(".fv-grid-cell");
|
|
1932
|
+
if (l && l.ref && l.ref === K)
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
v(l).then((K) => {
|
|
1936
|
+
K && document.body.removeEventListener("click", p, !0);
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
function _(I, z, J) {
|
|
1941
|
+
return Promise.resolve().then(() => {
|
|
1942
|
+
var re;
|
|
1943
|
+
const K = (re = J.editor) == null ? void 0 : re.readonly;
|
|
1944
|
+
return !tt(e.beforeEditCell) && typeof e.beforeEditCell == "function" ? e.beforeEditCell({
|
|
1945
|
+
row: I,
|
|
1946
|
+
cell: z,
|
|
1947
|
+
rawData: I.raw,
|
|
1948
|
+
column: J
|
|
1949
|
+
}) : !K;
|
|
1950
|
+
}).then((K) => {
|
|
1951
|
+
K && (y(z, I, J), document.body.removeEventListener("click", p, !0), document.body.addEventListener("click", p, !0));
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
function E(I, z, J, K = {}) {
|
|
1955
|
+
I.stopPropagation(), u(I, J), r.value && c.value.editMode === "cell" && z.mode === _e.editable && v(l).then(() => {
|
|
1956
|
+
l || _(J, z, K);
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
function h(I, z, J, K = {}) {
|
|
1960
|
+
I.stopPropagation(), d(I, J), r.value && c.value.editMode === "cell" && z.mode === _e.editable && v(l).then(() => {
|
|
1961
|
+
l || _(J, z, K);
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
function B(I) {
|
|
1965
|
+
I.stopPropagation(), C = I.target;
|
|
1966
|
+
}
|
|
1967
|
+
function Y(I) {
|
|
1968
|
+
I.stopPropagation(), C && (C = null);
|
|
1969
|
+
}
|
|
1970
|
+
function M(I) {
|
|
1971
|
+
Object.values(I.data).filter((z) => z.mode === _e.editable && z.field !== "__commands__").forEach((z) => {
|
|
1972
|
+
z.mode = _e.editing;
|
|
1973
|
+
}), I.status = Fe.editing, b = I;
|
|
1974
|
+
}
|
|
1975
|
+
function L(I, z) {
|
|
1976
|
+
Object.values(I.data).filter((J) => J.mode === _e.editing).forEach((J) => {
|
|
1977
|
+
z ? J.accept() : J.cancel(), J.mode = _e.editable;
|
|
1978
|
+
}), I.status = Fe.initial, b === I && (b = null);
|
|
1979
|
+
}
|
|
1980
|
+
function D(I) {
|
|
1981
|
+
r.value && c.value.editMode === "row" && b !== I && (b && L(b, !1), M(I));
|
|
1982
|
+
}
|
|
1983
|
+
function x(I) {
|
|
1984
|
+
L(I, !0), I.status = Fe.initial;
|
|
1985
|
+
}
|
|
1986
|
+
function k(I) {
|
|
1987
|
+
L(I, !1), I.status = Fe.initial;
|
|
1988
|
+
}
|
|
1989
|
+
function $(I, z, J) {
|
|
1990
|
+
const K = z.dataType, re = z.editor || {
|
|
1991
|
+
type: s.get(K) || "input-group"
|
|
1992
|
+
};
|
|
1993
|
+
return !m.value && re.type === "text" && (re.type = "input-group"), re ? (re.type === "input-group" && (re.textAlign = z.align !== "center" && z.align !== "right" ? "left" : z.align, re.updateOn = "change"), re.type === "number-spinner" && (re.updateOn = "change"), re.type === "textarea" && (re.lineBreak = "alt enter"), re.context = {
|
|
1994
|
+
rowData: J.raw,
|
|
1995
|
+
column: z,
|
|
1996
|
+
cell: I,
|
|
1997
|
+
editor: S
|
|
1998
|
+
}, re.readonly = !1, F(On, {
|
|
1999
|
+
focusOnCreated: e.focusOnEditingCell,
|
|
2000
|
+
selectOnCreated: e.selectOnEditingCell,
|
|
2001
|
+
editor: re,
|
|
2002
|
+
modelValue: I.editingData,
|
|
2003
|
+
"onUpdate:modelValue": (ee) => I.editingData = ee,
|
|
2004
|
+
id: z.id,
|
|
2005
|
+
onMousedown: (ee) => B(ee),
|
|
2006
|
+
onMouseup: (ee) => Y(ee)
|
|
2007
|
+
}, null)) : I.data;
|
|
2008
|
+
}
|
|
2009
|
+
function A() {
|
|
2010
|
+
v(l);
|
|
2011
|
+
}
|
|
2012
|
+
Ne(() => e.editable, () => {
|
|
2013
|
+
r.value = e.editable;
|
|
2014
|
+
}), Ne(() => {
|
|
2015
|
+
var I;
|
|
2016
|
+
return (I = e.editOption) == null ? void 0 : I.editMode;
|
|
2017
|
+
}, (I) => {
|
|
2018
|
+
c.value.editMode = I;
|
|
2019
|
+
});
|
|
2020
|
+
function Q() {
|
|
2021
|
+
l = null, b = null, w = null, C = null, document.body.removeEventListener("click", p, !0);
|
|
2022
|
+
}
|
|
2023
|
+
return {
|
|
2024
|
+
clear: Q,
|
|
2025
|
+
onClickOutOfCell: p,
|
|
2026
|
+
onClickCell: h,
|
|
2027
|
+
onClickCellByKeyboard: E,
|
|
2028
|
+
onEditingRow: D,
|
|
2029
|
+
acceptEditingRow: x,
|
|
2030
|
+
cancelEditingRow: k,
|
|
2031
|
+
getEditingSnapshot: T,
|
|
2032
|
+
getEditor: $,
|
|
2033
|
+
endEditCell: A,
|
|
2034
|
+
onMousedownCell: B,
|
|
2035
|
+
onMouseupCell: Y
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
function co(e) {
|
|
2039
|
+
const t = O(e.idField);
|
|
2040
|
+
function n(o) {
|
|
2041
|
+
if (o && o.length) {
|
|
2042
|
+
const i = o[0];
|
|
2043
|
+
Object.keys(i).includes(t.value) || (t.value = "__fv_indetify__");
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
return { idField: t, reviseIdentifyField: n };
|
|
2047
|
+
}
|
|
2048
|
+
function uo(e, t, n, o) {
|
|
2049
|
+
const { idField: i } = o, {
|
|
2050
|
+
currentSelectedDataId: a,
|
|
2051
|
+
multiSelectOnClickRow: r,
|
|
2052
|
+
multiSelectOnClickRowWithShift: c,
|
|
2053
|
+
selectItem: m,
|
|
2054
|
+
selectedValues: d,
|
|
2055
|
+
toggleSelectItem: u,
|
|
2056
|
+
updateSelectAllStatus: s,
|
|
2057
|
+
enableSelectRow: l,
|
|
2058
|
+
multiSelectMode: b,
|
|
2059
|
+
isSingleSelect: f,
|
|
2060
|
+
getSelectedItems: w
|
|
2061
|
+
} = n, C = O(0), T = O(-1);
|
|
2062
|
+
function S(k) {
|
|
2063
|
+
a.value = k;
|
|
2064
|
+
}
|
|
2065
|
+
function y(k) {
|
|
2066
|
+
return k.raw[i.value] === a.value;
|
|
2067
|
+
}
|
|
2068
|
+
function g(k, $) {
|
|
2069
|
+
var ne;
|
|
2070
|
+
const A = $ ?? k.dataIndex, Q = {
|
|
2071
|
+
"fv-grid-row": k.type === Ie.data,
|
|
2072
|
+
"fv-grid-group-row": k.type === Ie.group,
|
|
2073
|
+
"fv-grid-summary-row": k.type === Ie.summary,
|
|
2074
|
+
"fv-grid-row-hover": A === T.value,
|
|
2075
|
+
"fv-grid-row-selected": y(k),
|
|
2076
|
+
"fv-grid-row-odd": A % 2 > 0,
|
|
2077
|
+
"fv-grid-row-even": A % 2 === 0,
|
|
2078
|
+
"fv-grid-disabled": k.disabled
|
|
2079
|
+
};
|
|
2080
|
+
if ((ne = e.rowOption) != null && ne.customRowStyle) {
|
|
2081
|
+
const I = e.rowOption.customRowStyle(k.raw) || {};
|
|
2082
|
+
return Object.assign({}, Q, I.class || {});
|
|
2083
|
+
}
|
|
2084
|
+
return Q;
|
|
2085
|
+
}
|
|
2086
|
+
function v(k, $) {
|
|
2087
|
+
var Q;
|
|
2088
|
+
const A = {
|
|
2089
|
+
"fv-grid-cell": !0
|
|
2090
|
+
};
|
|
2091
|
+
if ((Q = e.rowOption) != null && Q.customCellStyle) {
|
|
2092
|
+
const ne = e.rowOption.customCellStyle(k, $) || {};
|
|
2093
|
+
return Object.assign({}, A, ne.class || {});
|
|
2094
|
+
}
|
|
2095
|
+
return A;
|
|
2096
|
+
}
|
|
2097
|
+
function p(k, $) {
|
|
2098
|
+
var Q;
|
|
2099
|
+
const A = {
|
|
2100
|
+
"fv-grid-hierarchy-cell": !0
|
|
2101
|
+
};
|
|
2102
|
+
if ((Q = e.rowOption) != null && Q.customCellStyle) {
|
|
2103
|
+
const ne = e.rowOption.customCellStyle(k, $) || {};
|
|
2104
|
+
return Object.assign({}, A, ne.class || {});
|
|
2105
|
+
}
|
|
2106
|
+
return A;
|
|
2107
|
+
}
|
|
2108
|
+
function _(k) {
|
|
2109
|
+
const $ = a.value, A = k.raw[i.value];
|
|
2110
|
+
S(A), $ !== A && t.emit("selectionChange", [k.raw], { id: A, data: k.raw });
|
|
2111
|
+
}
|
|
2112
|
+
function E(k, $) {
|
|
2113
|
+
var ne, I;
|
|
2114
|
+
if (c.value && !($ != null && $.shiftKey) || f.value) {
|
|
2115
|
+
(ne = e.selection) != null && ne.keepSelectingOnClick ? m(k) : u(k, (I = e.selection) == null ? void 0 : I.keepSelectingOnClick), s();
|
|
2116
|
+
return;
|
|
2117
|
+
}
|
|
2118
|
+
if (c.value && ($ == null ? void 0 : $.shiftKey) || r.value) {
|
|
2119
|
+
u(k), s();
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
function h(k, $) {
|
|
2124
|
+
$.disabled || (t.emit("clickRow", $.index, $.raw), _($), E($, k));
|
|
2125
|
+
}
|
|
2126
|
+
function B(k) {
|
|
2127
|
+
C.value += 1, setTimeout(() => {
|
|
2128
|
+
C.value === 1 && t.emit("clickRow", k.index, k.raw), C.value = 0;
|
|
2129
|
+
}, 250), C.value > 1 && (t.emit("doubleClickRow", k.index, k.raw), C.value = 0);
|
|
2130
|
+
}
|
|
2131
|
+
function Y(k, $) {
|
|
2132
|
+
$.disabled || (B($), _($), E($, k));
|
|
2133
|
+
}
|
|
2134
|
+
function M(k) {
|
|
2135
|
+
k.disabled || B(k);
|
|
2136
|
+
}
|
|
2137
|
+
function L(k, $) {
|
|
2138
|
+
}
|
|
2139
|
+
function D(k, $) {
|
|
2140
|
+
}
|
|
2141
|
+
function x(k, $) {
|
|
2142
|
+
var ne;
|
|
2143
|
+
const A = $ ?? k.dataIndex, Q = {
|
|
2144
|
+
"fv-grid-sidebar-row": !0,
|
|
2145
|
+
"fv-grid-sidebar-row-hover": A === T.value,
|
|
2146
|
+
"fv-grid-sidebar-row-selected": y(k),
|
|
2147
|
+
"fv-grid-sidebar-row-odd": A % 2 > 0,
|
|
2148
|
+
"fv-grid-sidebar-row-even": A % 2 === 0,
|
|
2149
|
+
"d-flex": !0,
|
|
2150
|
+
"align-items-center": !0
|
|
2151
|
+
};
|
|
2152
|
+
if ((ne = e.rowOption) != null && ne.customRowStyle) {
|
|
2153
|
+
const I = e.rowOption.customRowStyle(k.raw) || {};
|
|
2154
|
+
return Object.assign({}, Q, I.class || {});
|
|
2155
|
+
}
|
|
2156
|
+
return Q;
|
|
2157
|
+
}
|
|
2158
|
+
return {
|
|
2159
|
+
activeRowById: S,
|
|
2160
|
+
clickRowItem: M,
|
|
2161
|
+
selectRow: E,
|
|
2162
|
+
changeRow: _,
|
|
2163
|
+
gridCellClass: v,
|
|
2164
|
+
gridHierarchyCellClass: p,
|
|
2165
|
+
gridRowClass: g,
|
|
2166
|
+
onClickRow: Y,
|
|
2167
|
+
onClickRowExcludeDblclick: h,
|
|
2168
|
+
onMouseoverRow: L,
|
|
2169
|
+
sidebarRowClass: x,
|
|
2170
|
+
onMouseoutRow: D
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
function fo(e, t, n, o, i) {
|
|
2174
|
+
const { idField: a } = n, { dataView: r, getSelectionItems: c } = t, m = O(""), d = W(() => e.selection.enableSelectRow), u = O(e.selection.multiSelect ?? !1), s = O(e.selection.multiSelectMode || "DependOnCheck"), l = O(e.selection.showCheckbox), b = O(e.selection.showSelectAll), f = O(e.selectionValues || []), w = W(() => e.selection.showSelection), C = W(() => {
|
|
2175
|
+
var N;
|
|
2176
|
+
return ((N = e.selection) == null ? void 0 : N.keepSelectingOnPaging) === void 0 ? !0 : e.selection.keepSelectingOnPaging;
|
|
2177
|
+
}), T = O(!!f.value.length && o.value.length === f.value.length), S = O(!!f.value.length && o.value.length !== f.value.length);
|
|
2178
|
+
Ne(() => e.selection.showSelectAll, (N, G) => {
|
|
2179
|
+
N !== G && (b.value = N);
|
|
2180
|
+
});
|
|
2181
|
+
function y() {
|
|
2182
|
+
if (!C.value) {
|
|
2183
|
+
const N = r.value.map((G) => G[a.value]);
|
|
2184
|
+
f.value = f.value.filter((G) => N.includes(G));
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
function g() {
|
|
2188
|
+
const N = r.value.every((q) => f.value.includes(q[a.value])), G = r.value.every((q) => !f.value.includes(q[a.value]));
|
|
2189
|
+
N && (T.value = !0, S.value = !1), G && (T.value = !1, S.value = !1), !N && !G && (T.value = !1, S.value = !0);
|
|
2190
|
+
}
|
|
2191
|
+
function v() {
|
|
2192
|
+
return c(f.value);
|
|
2193
|
+
}
|
|
2194
|
+
function p() {
|
|
2195
|
+
const N = o.value.reduce((q, ge) => (q.set(ge.raw[a.value], ge), q), /* @__PURE__ */ new Map());
|
|
2196
|
+
return f.value.map((q) => N.get(q)).filter((q) => !!q);
|
|
2197
|
+
}
|
|
2198
|
+
function _(N) {
|
|
2199
|
+
var q;
|
|
2200
|
+
const G = N.raw.__fv_children_index__;
|
|
2201
|
+
if (G && G.length) {
|
|
2202
|
+
const ge = G.map((he) => r.value[he]);
|
|
2203
|
+
(q = f.value) != null && q.length && ge.some((Pe) => !f.value.includes(Pe[a.value])) && (N.indeterminate = !0, N.raw.__fv_indeterminate__ = !0);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
const E = W(() => d.value && u.value), h = W(
|
|
2207
|
+
() => d.value && !u.value && !l.value
|
|
2208
|
+
), B = W(() => !!e.hierarchy), Y = W(() => {
|
|
2209
|
+
const N = l.value && s.value === "DependOnCheck";
|
|
2210
|
+
return E.value && N;
|
|
2211
|
+
}), M = W(() => E.value && !l.value), L = W(() => E.value && l.value && s.value === "OnCheckAndClick");
|
|
2212
|
+
W(() => L.value);
|
|
2213
|
+
function D() {
|
|
2214
|
+
const N = c(f.value);
|
|
2215
|
+
i.emit("selectionUpdate", N, f.value);
|
|
2216
|
+
}
|
|
2217
|
+
function x(N) {
|
|
2218
|
+
i.emit("unSelectItem", N);
|
|
2219
|
+
}
|
|
2220
|
+
function k(N) {
|
|
2221
|
+
i.emit("selectItem", N);
|
|
2222
|
+
}
|
|
2223
|
+
function $() {
|
|
2224
|
+
const N = o.value.filter((q) => q.indeterminate).map((q) => q.raw[a.value]);
|
|
2225
|
+
o.value.forEach((q) => {
|
|
2226
|
+
q.checked = !1, q.indeterminate = !1, q.raw.__fv_checked__ = !1, q.raw.__fv_indeterminate__ = !1;
|
|
2227
|
+
}), p().forEach((q) => {
|
|
2228
|
+
q.checked = !0, q.raw.__fv_checked__ = !0;
|
|
2229
|
+
}), N.forEach((q) => {
|
|
2230
|
+
const ge = o.value.find((he) => he.raw[a.value] === q);
|
|
2231
|
+
_(ge);
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
Ne(() => o.value, () => {
|
|
2235
|
+
$();
|
|
2236
|
+
}), Ne(() => e.selectionValues, (N) => {
|
|
2237
|
+
f.value = N, $();
|
|
2238
|
+
}, { immediate: !0 }), Ne(() => e.selection, (N) => {
|
|
2239
|
+
u.value = !!N.multiSelect, s.value = N.multiSelectMode || "DependOnCheck", l.value = !!N.showCheckbox;
|
|
2240
|
+
});
|
|
2241
|
+
const A = W(() => !u.value);
|
|
2242
|
+
function Q(N) {
|
|
2243
|
+
return N.raw[a.value];
|
|
2244
|
+
}
|
|
2245
|
+
function ne(N) {
|
|
2246
|
+
return f.value.findIndex((q) => q === Q(N));
|
|
2247
|
+
}
|
|
2248
|
+
function I() {
|
|
2249
|
+
p().forEach((q) => {
|
|
2250
|
+
q.checked = !1;
|
|
2251
|
+
}), c(f.value).forEach((q) => {
|
|
2252
|
+
q.__fv_checked__ = !1;
|
|
2253
|
+
}), f.value = [], m.value = "", g();
|
|
2254
|
+
}
|
|
2255
|
+
function z(N) {
|
|
2256
|
+
const G = N;
|
|
2257
|
+
G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
|
|
2258
|
+
const q = new Set(f.value);
|
|
2259
|
+
q.add(G[a.value]), f.value = Array.from(q.values()), y();
|
|
2260
|
+
}
|
|
2261
|
+
function J(N) {
|
|
2262
|
+
const G = N;
|
|
2263
|
+
G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, f.value = f.value.filter((q) => q !== G[a.value]), y();
|
|
2264
|
+
}
|
|
2265
|
+
function K(N) {
|
|
2266
|
+
const G = N.raw;
|
|
2267
|
+
G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
|
|
2268
|
+
const q = new Set(f.value);
|
|
2269
|
+
q.add(G[a.value]), f.value = Array.from(q.values()), y(), N.checked = !0, N.indeterminate = !1, D(), k(N);
|
|
2270
|
+
}
|
|
2271
|
+
function re(N) {
|
|
2272
|
+
const G = N.raw;
|
|
2273
|
+
G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, f.value = f.value.filter((q) => q !== G[a.value]), y(), N.checked = !1, N.indeterminate = !1, D(), x(N);
|
|
2274
|
+
}
|
|
2275
|
+
function ee(N) {
|
|
2276
|
+
K(N), m.value = N.raw[a.value];
|
|
2277
|
+
}
|
|
2278
|
+
function P(N) {
|
|
2279
|
+
re(N), m.value = "";
|
|
2280
|
+
}
|
|
2281
|
+
function R(N) {
|
|
2282
|
+
N.__fv_checked__ = !1, N.__fv_indeterminate__ = !0, f.value = f.value.filter((G) => G !== N[a.value]), y();
|
|
2283
|
+
}
|
|
2284
|
+
function j(N) {
|
|
2285
|
+
const G = N.raw;
|
|
2286
|
+
G.__fv_checked__ = !1, G.__fv_indeterminate__ = !0, f.value = f.value.filter((q) => q !== G[a.value]), y(), N.checked = !1, N.indeterminate = !0;
|
|
2287
|
+
}
|
|
2288
|
+
function U(N) {
|
|
2289
|
+
A.value && I(), N.checked ? re(N) : K(N);
|
|
2290
|
+
}
|
|
2291
|
+
function Z(N, G = !0) {
|
|
2292
|
+
const q = N.checked;
|
|
2293
|
+
A.value && I(), G ? N.checked ? P(N) : ee(N) : q ? P(N) : ee(N);
|
|
2294
|
+
}
|
|
2295
|
+
function ae(N) {
|
|
2296
|
+
N.raw[a.value] !== m.value && (I(), ee(N));
|
|
2297
|
+
}
|
|
2298
|
+
function ie(N) {
|
|
2299
|
+
const G = o.value.find((q) => q.raw[a.value] === N);
|
|
2300
|
+
if (G)
|
|
2301
|
+
ae(G);
|
|
2302
|
+
else {
|
|
2303
|
+
const q = r.value.find((ge) => ge[a.value] === N);
|
|
2304
|
+
q && z(q);
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
function te(N) {
|
|
2308
|
+
const G = o.value.filter((he) => N.includes(he.raw[a.value])), q = G.map((he) => he.raw[a.value]), ge = r.value.filter((he) => {
|
|
2309
|
+
const Pe = he[a.value];
|
|
2310
|
+
return !q.includes(Pe) && N.includes(Pe);
|
|
2311
|
+
});
|
|
2312
|
+
(G.length || ge.length) && h.value && (m.value = N[0]), G.forEach((he) => {
|
|
2313
|
+
ee(he);
|
|
2314
|
+
}), ge.forEach((he) => {
|
|
2315
|
+
z(he);
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
function ue(N) {
|
|
2319
|
+
for (const G of N) {
|
|
2320
|
+
if (!f.value.includes(G))
|
|
2321
|
+
continue;
|
|
2322
|
+
const q = o.value.find((ge) => ge.raw[a.value] === G);
|
|
2323
|
+
if (q)
|
|
2324
|
+
P(q);
|
|
2325
|
+
else {
|
|
2326
|
+
const ge = r.value.find((he) => he[a.value] === G);
|
|
2327
|
+
ge && J(ge);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
f.value = f.value.filter(
|
|
2331
|
+
(G) => !N.includes(G)
|
|
2332
|
+
), y();
|
|
2333
|
+
}
|
|
2334
|
+
function be() {
|
|
2335
|
+
o.value.forEach((N) => {
|
|
2336
|
+
const G = N.raw;
|
|
2337
|
+
G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
|
|
2338
|
+
const q = new Set(f.value);
|
|
2339
|
+
q.add(G[a.value]), f.value = Array.from(q.values()), y(), N.checked = !0, N.indeterminate = !1;
|
|
2340
|
+
}), D();
|
|
2341
|
+
}
|
|
2342
|
+
function fe() {
|
|
2343
|
+
o.value.forEach((N) => {
|
|
2344
|
+
const G = N.raw;
|
|
2345
|
+
G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, f.value = f.value.filter((q) => q !== G[a.value]), y(), N.checked = !1, N.indeterminate = !1;
|
|
2346
|
+
}), D();
|
|
2347
|
+
}
|
|
2348
|
+
function Be() {
|
|
2349
|
+
return o.value.find((N) => N.raw[a.value] === m.value);
|
|
2350
|
+
}
|
|
2351
|
+
return {
|
|
2352
|
+
clearSelection: I,
|
|
2353
|
+
currentSelectedDataId: m,
|
|
2354
|
+
enableMultiSelect: u,
|
|
2355
|
+
enableSelectRow: d,
|
|
2356
|
+
findIndexInSelectedItems: ne,
|
|
2357
|
+
getSelectedItems: v,
|
|
2358
|
+
getSelectionRow: Be,
|
|
2359
|
+
indeterminate: j,
|
|
2360
|
+
indeterminateDataItem: R,
|
|
2361
|
+
isSelectingHirarchyItem: B,
|
|
2362
|
+
multiSelectMode: s,
|
|
2363
|
+
multiSelectOnClickRow: L,
|
|
2364
|
+
multiSelectOnClickRowWithShift: M,
|
|
2365
|
+
multiSelectOnlyOnCheck: Y,
|
|
2366
|
+
select: ee,
|
|
2367
|
+
selectAll: be,
|
|
2368
|
+
selectedValues: f,
|
|
2369
|
+
selectDataItem: z,
|
|
2370
|
+
selectItem: ae,
|
|
2371
|
+
selectItemById: ie,
|
|
2372
|
+
selectItemByIds: te,
|
|
2373
|
+
showCheckBox: l,
|
|
2374
|
+
showSelectAll: b,
|
|
2375
|
+
toggleSelectItem: Z,
|
|
2376
|
+
toggleSelectItemWithoutRow: U,
|
|
2377
|
+
unSelect: P,
|
|
2378
|
+
unSelectAll: fe,
|
|
2379
|
+
unSelectDataItem: J,
|
|
2380
|
+
unSelectItemByIds: ue,
|
|
2381
|
+
updateSelectAllStatus: g,
|
|
2382
|
+
selectAllStatus: T,
|
|
2383
|
+
indeterminateStatus: S,
|
|
2384
|
+
isSingleSelect: h,
|
|
2385
|
+
showSelection: w,
|
|
2386
|
+
keepSelectingOnPaging: C,
|
|
2387
|
+
emitSelectionChanged: D
|
|
2388
|
+
};
|
|
2389
|
+
}
|
|
2390
|
+
function it(e, t, n, o, i, a, r, c, m, d) {
|
|
2391
|
+
const u = O(e.size), s = O(e.textField), l = O(e.titleField), b = O(e.disableField), f = W(() => {
|
|
2392
|
+
var h, B;
|
|
2393
|
+
return ((h = e.selection) == null ? void 0 : h.multiSelect) && ((B = e.selection) == null ? void 0 : B.showCheckbox);
|
|
2394
|
+
}), {
|
|
2395
|
+
onMouseenterItem: w,
|
|
2396
|
+
onMouseoverItem: C,
|
|
2397
|
+
onMouseoutItem: T
|
|
2398
|
+
} = a, {
|
|
2399
|
+
getKey: S,
|
|
2400
|
+
listViewItemClass: y,
|
|
2401
|
+
listViewItemStyle: g,
|
|
2402
|
+
onCheckItem: v,
|
|
2403
|
+
onClickItem: p
|
|
2404
|
+
} = r, _ = W(() => {
|
|
2405
|
+
const h = {
|
|
2406
|
+
"text-overflow": "ellipsis",
|
|
2407
|
+
overflow: "hidden",
|
|
2408
|
+
"white-space": "nowrap"
|
|
2409
|
+
};
|
|
2410
|
+
return e.itemClass ? h : {
|
|
2411
|
+
margin: u.value === "small" ? "0.25rem 0" : "8px 0",
|
|
2412
|
+
...h
|
|
2413
|
+
};
|
|
2414
|
+
});
|
|
2415
|
+
function E(h, B, Y) {
|
|
2416
|
+
return h.checked = c.findIndexInSelectedItems(h) > -1, F("li", {
|
|
2417
|
+
class: y(h, B),
|
|
2418
|
+
id: S(h, B),
|
|
2419
|
+
key: S(h, B),
|
|
2420
|
+
style: g(h, B),
|
|
2421
|
+
onClick: (M) => p(h, B, M),
|
|
2422
|
+
onMouseenter: (M) => w(M, h, B),
|
|
2423
|
+
onMouseover: (M) => C(M, h, B),
|
|
2424
|
+
onMouseout: (M) => T(M, h, B)
|
|
2425
|
+
}, [f.value && F("div", {
|
|
2426
|
+
class: "f-list-select",
|
|
2427
|
+
onClick: (M) => M.stopPropagation()
|
|
2428
|
+
}, [F(Qe, {
|
|
2429
|
+
id: "list-" + S(h, B),
|
|
2430
|
+
customClass: "listview-checkbox float-left",
|
|
2431
|
+
disabled: h[b.value],
|
|
2432
|
+
checked: h.checked,
|
|
2433
|
+
"onUpdate:checked": (M) => h.checked = M,
|
|
2434
|
+
onChange: (M) => {
|
|
2435
|
+
v(h, B, !M.checked);
|
|
2436
|
+
}
|
|
2437
|
+
}, null)]), F("div", {
|
|
2438
|
+
class: "f-list-content"
|
|
2439
|
+
}, [F("div", {
|
|
2440
|
+
class: e.itemContentClass,
|
|
2441
|
+
style: _.value,
|
|
2442
|
+
title: h.raw[l.value] || h.raw[s.value]
|
|
2443
|
+
}, [h.raw[s.value]])])]);
|
|
2444
|
+
}
|
|
2445
|
+
return {
|
|
2446
|
+
renderItem: E
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
function vo(e, t, n, o, i, a, r, c, m, d) {
|
|
2450
|
+
const u = O(e.multiSelect), s = O(e.disableField), l = O(e.textField), {
|
|
2451
|
+
onMouseenterItem: b,
|
|
2452
|
+
onMouseoverItem: f,
|
|
2453
|
+
onMouseoutItem: w
|
|
2454
|
+
} = a, {
|
|
2455
|
+
getKey: C,
|
|
2456
|
+
listViewItemClass: T,
|
|
2457
|
+
listViewItemStyle: S,
|
|
2458
|
+
onCheckItem: y,
|
|
2459
|
+
onClickItem: g
|
|
2460
|
+
} = r;
|
|
2461
|
+
function v(_, E, h) {
|
|
2462
|
+
return e.contentTemplate ? F(De, null, [e.contentTemplate({
|
|
2463
|
+
item: _.raw,
|
|
2464
|
+
index: E,
|
|
2465
|
+
selectedItem: h
|
|
2466
|
+
})]) : t.slots.content ? F(De, null, [t.slots.content && t.slots.content({
|
|
2467
|
+
item: _.raw,
|
|
2468
|
+
index: E,
|
|
2469
|
+
selectedItem: h
|
|
2470
|
+
})]) : F("div", {
|
|
2471
|
+
style: "margin: 10px 0;"
|
|
2472
|
+
}, [_.raw[l.value || "name"]]);
|
|
2473
|
+
}
|
|
2474
|
+
function p(_, E, h) {
|
|
2475
|
+
return F("li", {
|
|
2476
|
+
class: T(_, E),
|
|
2477
|
+
id: C(_, E),
|
|
2478
|
+
key: C(_, E),
|
|
2479
|
+
style: S(_, E),
|
|
2480
|
+
onClick: (B) => g(_, E, B),
|
|
2481
|
+
onMouseenter: (B) => b(B, _, E),
|
|
2482
|
+
onMouseover: (B) => f(B, _, E),
|
|
2483
|
+
onMouseout: (B) => w(B, _, E)
|
|
2484
|
+
}, [u.value && F("div", {
|
|
2485
|
+
class: "f-list-select",
|
|
2486
|
+
onClick: (B) => B.stopPropagation()
|
|
2487
|
+
}, [F(Qe, {
|
|
2488
|
+
id: "list-" + C(_, E),
|
|
2489
|
+
customClass: "listview-checkbox",
|
|
2490
|
+
disabled: _[s.value] || !_.checked,
|
|
2491
|
+
checked: _.checked,
|
|
2492
|
+
"onUpdate:checked": (B) => _.checked = B,
|
|
2493
|
+
onChange: (B) => y(_, E, !B.checked)
|
|
2494
|
+
}, null)]), F("div", {
|
|
2495
|
+
class: "f-list-content"
|
|
2496
|
+
}, [v(_, E, h)])]);
|
|
2497
|
+
}
|
|
2498
|
+
return {
|
|
2499
|
+
renderItem: p
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
function mo(e, t, n, o, i, a, r, c, m, d) {
|
|
2503
|
+
const u = O(e.multiSelect), s = O(e.disableField), l = O(e.textField), {
|
|
2504
|
+
onMouseenterItem: b,
|
|
2505
|
+
onMouseoverItem: f,
|
|
2506
|
+
onMouseoutItem: w
|
|
2507
|
+
} = a, {
|
|
2508
|
+
getKey: C,
|
|
2509
|
+
listViewItemClass: T,
|
|
2510
|
+
onCheckItem: S,
|
|
2511
|
+
onClickItem: y
|
|
2512
|
+
} = r, {
|
|
2513
|
+
dragstart: g,
|
|
2514
|
+
dragenter: v,
|
|
2515
|
+
dragover: p,
|
|
2516
|
+
dragend: _
|
|
2517
|
+
} = o, {
|
|
2518
|
+
removeItem: E
|
|
2519
|
+
} = m, h = W(() => ({
|
|
2520
|
+
margin: u.value ? "10px 0" : "10px 0px 10px 14px"
|
|
2521
|
+
}));
|
|
2522
|
+
function B(x, k = "") {
|
|
2523
|
+
const $ = x.target;
|
|
2524
|
+
$.title = $.scrollWidth > $.clientWidth ? k : "";
|
|
2525
|
+
}
|
|
2526
|
+
function Y(x) {
|
|
2527
|
+
return F("div", {
|
|
2528
|
+
style: h.value,
|
|
2529
|
+
onMouseenter: (k) => B(k, x.raw[l.value || "name"])
|
|
2530
|
+
}, [x.raw[l.value || "name"]]);
|
|
2531
|
+
}
|
|
2532
|
+
function M() {
|
|
2533
|
+
return t.slots.itemContent ? t.slots.itemContent : Y;
|
|
2534
|
+
}
|
|
2535
|
+
const L = M();
|
|
2536
|
+
function D(x, k, $) {
|
|
2537
|
+
return F("li", {
|
|
2538
|
+
class: T(x, k),
|
|
2539
|
+
id: C(x, k),
|
|
2540
|
+
key: C(x, k),
|
|
2541
|
+
onClick: (A) => y(x, k, A),
|
|
2542
|
+
onMouseenter: (A) => b(A, x, k),
|
|
2543
|
+
onMouseover: (A) => f(A, x, k),
|
|
2544
|
+
onMouseout: (A) => w(A, x, k),
|
|
2545
|
+
draggable: "true",
|
|
2546
|
+
onDragstart: (A) => g(A, x, k),
|
|
2547
|
+
onDragenter: (A) => v(A, k),
|
|
2548
|
+
onDragend: (A) => _(A, x),
|
|
2549
|
+
onDragover: (A) => p(A)
|
|
2550
|
+
}, [u.value && F("div", {
|
|
2551
|
+
class: "f-list-select",
|
|
2552
|
+
onClick: (A) => A.stopPropagation()
|
|
2553
|
+
}, [F(Qe, {
|
|
2554
|
+
id: "list-" + C(x, k),
|
|
2555
|
+
customClass: "listview-checkbox",
|
|
2556
|
+
disabled: x[s.value] || !x.checked,
|
|
2557
|
+
checked: x.checked,
|
|
2558
|
+
"onUpdate:checked": (A) => x.checked = A,
|
|
2559
|
+
onChange: (A) => S(x, k, !A.checked)
|
|
2560
|
+
}, null)]), F("div", {
|
|
2561
|
+
class: "f-list-content"
|
|
2562
|
+
}, [L(x)]), F("div", {
|
|
2563
|
+
class: "f-list-remove",
|
|
2564
|
+
onClick: (A) => {
|
|
2565
|
+
A.stopPropagation(), E(k);
|
|
2566
|
+
}
|
|
2567
|
+
}, [F("div", {
|
|
2568
|
+
class: "f-list-remove-icon"
|
|
2569
|
+
}, [F("i", {
|
|
2570
|
+
class: "f-icon f-icon-remove_face"
|
|
2571
|
+
}, null)])]), F("div", {
|
|
2572
|
+
class: "f-list-handle"
|
|
2573
|
+
}, [F("div", null, [F("i", {
|
|
2574
|
+
class: "f-icon f-icon-drag-vertical"
|
|
2575
|
+
}, null)])])]);
|
|
2576
|
+
}
|
|
2577
|
+
return {
|
|
2578
|
+
renderItem: D
|
|
2579
|
+
};
|
|
2580
|
+
}
|
|
2581
|
+
function po(e, t, n, o, i, a, r, c, m, d) {
|
|
2582
|
+
var C;
|
|
2583
|
+
const u = O(((C = e.group) == null ? void 0 : C.groupFields) || []), {
|
|
2584
|
+
collpaseGroupIconClass: s
|
|
2585
|
+
} = i, {
|
|
2586
|
+
toggleGroupRow: l
|
|
2587
|
+
} = d;
|
|
2588
|
+
function b(T, S) {
|
|
2589
|
+
S.collapse = !S.collapse, n.value = l(S.collapse ? "collapse" : "expand", S, n.value);
|
|
2590
|
+
}
|
|
2591
|
+
function f(T, S, y) {
|
|
2592
|
+
return t.slots.group ? F(De, null, [t.slots.content && t.slots.group({
|
|
2593
|
+
item: T.raw,
|
|
2594
|
+
index: S,
|
|
2595
|
+
selectedItem: y
|
|
2596
|
+
})]) : F("div", {
|
|
2597
|
+
class: "f-navlookup-recentHeader",
|
|
2598
|
+
onClick: (g) => b(g, T)
|
|
2599
|
+
}, [F("div", {
|
|
2600
|
+
class: "fv-grid-group-row-icon"
|
|
2601
|
+
}, [F("span", {
|
|
2602
|
+
class: s(T)
|
|
2603
|
+
}, null)]), F("div", {
|
|
2604
|
+
class: "f-navlookup-recommandLabel"
|
|
2605
|
+
}, [T.raw[u.value[T.layer]]])]);
|
|
2606
|
+
}
|
|
2607
|
+
function w(T, S, y) {
|
|
2608
|
+
return T.layer > -1 && f(T, S, y);
|
|
2609
|
+
}
|
|
2610
|
+
return {
|
|
2611
|
+
renderItem: w
|
|
2612
|
+
};
|
|
2613
|
+
}
|
|
2614
|
+
function go(e, t, n, o) {
|
|
2615
|
+
const { dataView: i } = n, { updateSelectedItems: a } = o;
|
|
2616
|
+
function r(c) {
|
|
2617
|
+
if (c > -1 && c < i.value.length) {
|
|
2618
|
+
if (e != null && e.checkBeforeRemoveItem && !e.checkBeforeRemoveItem(i.value[c]))
|
|
2619
|
+
return;
|
|
2620
|
+
const m = i.value.splice(c, 1);
|
|
2621
|
+
a(), t.emit("removeItem", m[0]);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
return { removeItem: r };
|
|
2625
|
+
}
|
|
2626
|
+
function ho(e, t, n, o, i, a, r, c, m, d) {
|
|
2627
|
+
const {
|
|
2628
|
+
t: u
|
|
2629
|
+
} = je(), s = O(e.view), l = O(e.view === "CardView"), b = O({}), f = O(u("listView.emptyMessage")), w = go(e, t, o, m), C = W(() => ({
|
|
2630
|
+
"f-list-view-group": !0,
|
|
2631
|
+
"f-list-view-group-multiselect": e.multiSelect,
|
|
2632
|
+
"d-flex": l.value,
|
|
2633
|
+
"flex-wrap": l.value
|
|
2634
|
+
})), T = W(() => !!n.value && n.value.length > 0), S = W(() => n.value.length === 0);
|
|
2635
|
+
W(() => S.value && !t.slots.empty);
|
|
2636
|
+
function y() {
|
|
2637
|
+
return s.value === "SingleView" ? it : s.value === "DraggableView" ? mo : (s.value === "ContentView" || s.value === "CardView") && (e.contentTemplate || t.slots.content) ? vo : it;
|
|
2638
|
+
}
|
|
2639
|
+
const g = y(), {
|
|
2640
|
+
renderItem: v
|
|
2641
|
+
} = g(e, t, n, d, i, a, m, r, w, c), {
|
|
2642
|
+
renderItem: p
|
|
2643
|
+
} = po(e, t, n, d, i, a, m, r, w, c), _ = [v, p];
|
|
2644
|
+
function E() {
|
|
2645
|
+
return n.value.filter((Y) => Y.visible !== !1).map((Y, M) => _[Y.type](Y, M, b));
|
|
2646
|
+
}
|
|
2647
|
+
function h() {
|
|
2648
|
+
return F("div", {
|
|
2649
|
+
class: "f-list-view-emptydata",
|
|
2650
|
+
style: "margin: 0 auto;"
|
|
2651
|
+
}, [F("p", {
|
|
2652
|
+
class: "f-empty-title"
|
|
2653
|
+
}, [e.emptyTemplate ? e.emptyTemplate() : t.slots.empty ? t.slots.empty() : f.value])]);
|
|
2654
|
+
}
|
|
2655
|
+
function B() {
|
|
2656
|
+
return F("ul", {
|
|
2657
|
+
class: C.value,
|
|
2658
|
+
style: "list-style: none;"
|
|
2659
|
+
}, [T.value && E(), S.value && h()]);
|
|
2660
|
+
}
|
|
2661
|
+
return {
|
|
2662
|
+
renderListArea: B
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2665
|
+
function _o(e, t, n) {
|
|
2666
|
+
function o() {
|
|
2667
|
+
return t.slots.header && F("div", {
|
|
2668
|
+
class: "f-list-view-header"
|
|
2669
|
+
}, [t.slots.header()]);
|
|
2670
|
+
}
|
|
2671
|
+
return {
|
|
2672
|
+
renderHeader: o
|
|
2673
|
+
};
|
|
2674
|
+
}
|
|
2675
|
+
function at(e, t, n) {
|
|
2676
|
+
const o = O(e.headerClass), i = O(e.placeholder), a = O(""), r = W(() => !a.value), c = W(() => !!a.value);
|
|
2677
|
+
function m(l) {
|
|
2678
|
+
a.value = "";
|
|
2679
|
+
}
|
|
2680
|
+
Ne(a, (l) => {
|
|
2681
|
+
e.enableHighlightSearch && n.search(l), t.emit("afterSearch", l);
|
|
2682
|
+
});
|
|
2683
|
+
const d = W(() => {
|
|
2684
|
+
const l = {
|
|
2685
|
+
"form-group": !0,
|
|
2686
|
+
"farris-form-group": !0
|
|
2687
|
+
};
|
|
2688
|
+
return o.value && o.value.split(" ").reduce((f, w) => (f[w] = !0, f), l), l;
|
|
2689
|
+
});
|
|
2690
|
+
function u(l) {
|
|
2691
|
+
}
|
|
2692
|
+
function s() {
|
|
2693
|
+
return F("div", {
|
|
2694
|
+
class: "f-list-view-header",
|
|
2695
|
+
onClick: hn(() => u, ["prevent", "stop"])
|
|
2696
|
+
}, [F("div", {
|
|
2697
|
+
class: d.value
|
|
2698
|
+
}, [F("div", {
|
|
2699
|
+
class: "farris-input-wrap"
|
|
2700
|
+
}, [F("div", {
|
|
2701
|
+
class: "f-cmp-inputgroup"
|
|
2702
|
+
}, [F("div", {
|
|
2703
|
+
class: "input-group f-state-editable"
|
|
2704
|
+
}, [_n(F("input", {
|
|
2705
|
+
class: "form-control f-utils-fill text-left",
|
|
2706
|
+
"onUpdate:modelValue": (l) => a.value = l,
|
|
2707
|
+
name: "input-group-value",
|
|
2708
|
+
type: "text",
|
|
2709
|
+
placeholder: i.value,
|
|
2710
|
+
autocomplete: "off"
|
|
2711
|
+
}, null), [[yn, a.value]]), F("div", {
|
|
2712
|
+
class: "input-group-append"
|
|
2713
|
+
}, [c.value && F("span", {
|
|
2714
|
+
class: "input-group-text input-group-clear",
|
|
2715
|
+
onClick: (l) => m()
|
|
2716
|
+
}, [F("i", {
|
|
2717
|
+
class: "f-icon f-icon-close-circle"
|
|
2718
|
+
}, null)]), r.value && F("span", {
|
|
2719
|
+
class: "input-group-text"
|
|
2720
|
+
}, [F("span", {
|
|
2721
|
+
class: "f-icon f-icon-search"
|
|
2722
|
+
}, null)])])])])])])]);
|
|
2723
|
+
}
|
|
2724
|
+
return {
|
|
2725
|
+
renderHeader: s
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
function yo() {
|
|
2729
|
+
const e = O(""), t = O(-1), n = O(""), o = O(-1), i = O(!1);
|
|
2730
|
+
function a(s, l, b) {
|
|
2731
|
+
o.value = b;
|
|
2732
|
+
}
|
|
2733
|
+
function r(s, l, b) {
|
|
2734
|
+
i.value || (o.value = b);
|
|
2735
|
+
}
|
|
2736
|
+
function c(s, l, b) {
|
|
2737
|
+
o.value = -1;
|
|
2738
|
+
}
|
|
2739
|
+
function m() {
|
|
2740
|
+
i.value = !0;
|
|
2741
|
+
}
|
|
2742
|
+
function d() {
|
|
2743
|
+
i.value = !1;
|
|
2744
|
+
}
|
|
2745
|
+
function u() {
|
|
2746
|
+
t.value = -1, e.value = "";
|
|
2747
|
+
}
|
|
2748
|
+
return {
|
|
2749
|
+
activeIndex: t,
|
|
2750
|
+
focusedItemId: n,
|
|
2751
|
+
hoverIndex: o,
|
|
2752
|
+
clearActiveItem: u,
|
|
2753
|
+
onMouseenterItem: a,
|
|
2754
|
+
onMouseoverItem: r,
|
|
2755
|
+
onMouseoutItem: c,
|
|
2756
|
+
resumeHover: d,
|
|
2757
|
+
suspendHover: m
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
function bo(e, t, n, o) {
|
|
2761
|
+
const i = O(e.idField), { dataView: a } = n, r = O(-1), c = O(!1), { activeIndex: m, focusedItemId: d, hoverIndex: u, resumeHover: s, suspendHover: l } = o;
|
|
2762
|
+
let b, f = 0, w = 0;
|
|
2763
|
+
function C(p, _) {
|
|
2764
|
+
const E = p - f, h = _ - w;
|
|
2765
|
+
b.style.left = parseInt(b.style.left) + E + "px", b.style.top = parseInt(b.style.top) + h + "px", f = p, w = _;
|
|
2766
|
+
}
|
|
2767
|
+
function T(p) {
|
|
2768
|
+
const { left: _, top: E } = p.getBoundingClientRect(), h = p.cloneNode(!0);
|
|
2769
|
+
return h.style.cssText = `
|
|
2770
|
+
position:absolute;
|
|
2771
|
+
left:${_}px;
|
|
2772
|
+
top:${document.documentElement.scrollTop ? E + document.documentElement.scrollTop : E}px;
|
|
2773
|
+
z-index: 999999;
|
|
2774
|
+
border: 1px solid #e2e3e5;
|
|
2775
|
+
pointer-events: none;
|
|
2776
|
+
background-color: #edf5ff;
|
|
2777
|
+
border-radius: 10px;
|
|
2778
|
+
margin: 4px 2px;
|
|
2779
|
+
display: flex;
|
|
2780
|
+
align-items: center;
|
|
2781
|
+
float: none;
|
|
2782
|
+
text-align: initial;
|
|
2783
|
+
width:${getComputedStyle(p).width};
|
|
2784
|
+
height:${getComputedStyle(p).height};
|
|
2785
|
+
`, h.children[0].style.cssText = "overflow: hidden;flex: 1 1 auto;width: 100%;", h.children[0].children[0].style.cssText = `
|
|
2786
|
+
margin: 10px 0px 10px 14px;
|
|
2787
|
+
overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
|
|
2788
|
+
`, h.children[1].style.cssText = "width: 30px;color: #f4625f;padding: 0 14px 0 0", h.children[2].style.cssText = "padding: 0 14px 0 0;", document.body.appendChild(h), h;
|
|
2789
|
+
}
|
|
2790
|
+
function S(p, _, E) {
|
|
2791
|
+
if (p.stopPropagation(), l(), _) {
|
|
2792
|
+
if (b = T(p.target), p.dataTransfer) {
|
|
2793
|
+
const h = new Image();
|
|
2794
|
+
h.src = "", p.dataTransfer.setDragImage(h, 0, 0);
|
|
2795
|
+
}
|
|
2796
|
+
f = p.pageX, w = p.pageY, setTimeout(() => {
|
|
2797
|
+
r.value = E, c.value = !0, _.moving = !0;
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
function y(p, _) {
|
|
2802
|
+
if (p.preventDefault(), r.value !== _) {
|
|
2803
|
+
const E = a.value[r.value], h = a.value;
|
|
2804
|
+
h.splice(r.value, 1), h.splice(_, 0, E), r.value = _, C(p.pageX, p.pageY);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
function g(p) {
|
|
2808
|
+
p.preventDefault(), p.dataTransfer && (p.dataTransfer.dropEffect = "move"), C(p.pageX, p.pageY);
|
|
2809
|
+
}
|
|
2810
|
+
function v(p, _) {
|
|
2811
|
+
_ && (_.moving = !1, b && (document.body.removeChild(b), b = null)), a.value.forEach((E, h) => {
|
|
2812
|
+
E.__fv_index__ = h;
|
|
2813
|
+
}), c.value = !1, s(), u.value = _.raw.__fv_index__, m.value = _.raw.__fv_index__, d.value = _.raw[i.value], t.emit("change", a.value), t.emit("activeChange", [_.raw]);
|
|
2814
|
+
}
|
|
2815
|
+
return {
|
|
2816
|
+
dragstart: S,
|
|
2817
|
+
dragenter: y,
|
|
2818
|
+
dragover: g,
|
|
2819
|
+
dragend: v,
|
|
2820
|
+
isDragging: c
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2823
|
+
function wo(e, t, n, o, i, a) {
|
|
2824
|
+
const r = O(e.idField), c = O(e.disableField), m = O(e.draggable);
|
|
2825
|
+
O(e.itemClass);
|
|
2826
|
+
const d = O(e.selection.multiSelect ?? !1), u = O(e.selection.multiSelectMode), { isDragging: s } = o, { activeIndex: l, focusedItemId: b, hoverIndex: f } = i, { clearSelection: w, getSelectedItems: C, toggleSelectItem: T, currentSelectedDataId: S } = a, y = O(C()), g = (D) => y.value.length === 0 ? !1 : y.value.some((x) => {
|
|
2827
|
+
let k = "";
|
|
2828
|
+
return x.data ? k = x.data[r.value] : k = x[r.value], k === D;
|
|
2829
|
+
});
|
|
2830
|
+
function v() {
|
|
2831
|
+
y.value = C();
|
|
2832
|
+
}
|
|
2833
|
+
function p(D, x) {
|
|
2834
|
+
return D.raw[r.value] != null ? D.raw[r.value] : "";
|
|
2835
|
+
}
|
|
2836
|
+
function _(D, x) {
|
|
2837
|
+
const k = {
|
|
2838
|
+
"f-list-view-group-item": !0,
|
|
2839
|
+
"f-list-view-draggable-item": m.value,
|
|
2840
|
+
"f-un-click": !D.checked,
|
|
2841
|
+
"f-un-select": !!D.raw[c.value],
|
|
2842
|
+
"f-listview-active": (
|
|
2843
|
+
// 多选
|
|
2844
|
+
d.value && g(p(D)) || // 单选
|
|
2845
|
+
!d.value && D.raw[r.value] === S.value
|
|
2846
|
+
),
|
|
2847
|
+
"f-listview-hover": !s.value && x === f.value,
|
|
2848
|
+
moving: !!D.moving
|
|
2849
|
+
};
|
|
2850
|
+
if (typeof e.itemClass == "string")
|
|
2851
|
+
return Ke(k, e.itemClass);
|
|
2852
|
+
if (typeof e.itemClass == "function") {
|
|
2853
|
+
const $ = e.itemClass(D);
|
|
2854
|
+
return Ke(k, $);
|
|
2855
|
+
}
|
|
2856
|
+
return k;
|
|
2857
|
+
}
|
|
2858
|
+
function E(D, x) {
|
|
2859
|
+
const k = (
|
|
2860
|
+
// 多选
|
|
2861
|
+
d.value && g(p(D)) || // 单选
|
|
2862
|
+
!d.value && D.raw[r.value] === S.value
|
|
2863
|
+
), $ = {};
|
|
2864
|
+
if (k && ($.backgroundColor = "#dae9ff"), typeof e.itemStyle == "string")
|
|
2865
|
+
return et($, e.itemStyle);
|
|
2866
|
+
if (typeof e.itemStyle == "function") {
|
|
2867
|
+
const A = e.itemStyle(D);
|
|
2868
|
+
return et($, A);
|
|
2869
|
+
}
|
|
2870
|
+
return $;
|
|
2871
|
+
}
|
|
2872
|
+
const h = W(() => !d.value);
|
|
2873
|
+
function B(D, x, k) {
|
|
2874
|
+
D.checked = k, !D.raw[c.value] && (h.value && (b.value = D.raw[r.value]), T(D));
|
|
2875
|
+
}
|
|
2876
|
+
const Y = W(() => d.value && u.value === "OnCheckClearByClick"), M = W(() => !d.value || d.value && (u.value === "OnCheckAndClick" || u.value === "OnClick"));
|
|
2877
|
+
function L(D, x, k) {
|
|
2878
|
+
if (D.raw[c.value]) {
|
|
2879
|
+
k == null || k.preventDefault(), k == null || k.stopPropagation();
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2882
|
+
b.value = D.raw[r.value], l.value = x, Y.value && w(), M.value && (T(D), v()), t.emit("clickItem", { data: y.value, index: x, dataItem: D.raw }), t.emit("activeChange", y.value);
|
|
2883
|
+
}
|
|
2884
|
+
return {
|
|
2885
|
+
getKey: p,
|
|
2886
|
+
selectedItems: y,
|
|
2887
|
+
listViewItemClass: _,
|
|
2888
|
+
listViewItemStyle: E,
|
|
2889
|
+
updateSelectedItems: v,
|
|
2890
|
+
onCheckItem: B,
|
|
2891
|
+
onClickItem: L
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
function mt(e, t) {
|
|
2895
|
+
let n;
|
|
2896
|
+
function o(s) {
|
|
2897
|
+
const { properties: l, title: b, ignore: f } = s, w = f && Array.isArray(f), C = Object.keys(l).reduce((T, S) => ((!w || !f.find((y) => y === S)) && (T[S] = l[S].type === "object" && l[S].properties ? o(l[S]) : Ae(l[S].default)), T), {});
|
|
2898
|
+
if (b && (!w || !f.find((T) => T === "id"))) {
|
|
2899
|
+
const T = b.toLowerCase().replace(/-/g, "_");
|
|
2900
|
+
C.id = `${T}_${Math.random().toString().slice(2, 6)}`;
|
|
2901
|
+
}
|
|
2902
|
+
return C;
|
|
2903
|
+
}
|
|
2904
|
+
function i(s) {
|
|
2905
|
+
const { properties: l, title: b, required: f } = s;
|
|
2906
|
+
if (f && Array.isArray(f)) {
|
|
2907
|
+
const w = f.reduce((C, T) => (C[T] = l[T].type === "object" && l[T].properties ? o(l[T]) : Ae(l[T].default), C), {});
|
|
2908
|
+
if (b && f.find((C) => C === "id")) {
|
|
2909
|
+
const C = b.toLowerCase().replace(/-/g, "_");
|
|
2910
|
+
w.id = `${C}_${Math.random().toString().slice(2, 6)}`;
|
|
2911
|
+
}
|
|
2912
|
+
return w;
|
|
2913
|
+
}
|
|
2914
|
+
return {
|
|
2915
|
+
type: b
|
|
2916
|
+
};
|
|
2917
|
+
}
|
|
2918
|
+
function a(s, l = {}, b) {
|
|
2919
|
+
const f = e[s];
|
|
2920
|
+
if (f) {
|
|
2921
|
+
let w = i(f);
|
|
2922
|
+
const C = t[s];
|
|
2923
|
+
return w = C ? C({ getSchemaByType: a }, w, l, b) : w, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(w), w;
|
|
2924
|
+
}
|
|
2925
|
+
return null;
|
|
2926
|
+
}
|
|
2927
|
+
function r(s, l) {
|
|
2928
|
+
const b = o(l);
|
|
2929
|
+
return Object.keys(b).reduce((f, w) => (Object.prototype.hasOwnProperty.call(s, w) && (f[w] && nt(f[w]) && nt(s[w] || !s[w]) ? Object.assign(f[w], s[w] || {}) : f[w] = s[w]), f), b), b;
|
|
2930
|
+
}
|
|
2931
|
+
function c(s, l) {
|
|
2932
|
+
return Object.keys(s).filter((f) => s[f] != null).reduce((f, w) => {
|
|
2933
|
+
if (l.has(w)) {
|
|
2934
|
+
const C = l.get(w);
|
|
2935
|
+
if (typeof C == "string")
|
|
2936
|
+
f[C] = s[w];
|
|
2937
|
+
else {
|
|
2938
|
+
const T = C(w, s[w], s);
|
|
2939
|
+
Object.assign(f, T);
|
|
2940
|
+
}
|
|
2941
|
+
} else
|
|
2942
|
+
f[w] = s[w];
|
|
2943
|
+
return f;
|
|
2944
|
+
}, {});
|
|
2945
|
+
}
|
|
2946
|
+
function m(s, l, b = /* @__PURE__ */ new Map()) {
|
|
2947
|
+
const f = r(s, l);
|
|
2948
|
+
return c(f, b);
|
|
2949
|
+
}
|
|
2950
|
+
function d(s) {
|
|
2951
|
+
var b;
|
|
2952
|
+
const l = s.type;
|
|
2953
|
+
if (l) {
|
|
2954
|
+
const f = e[l];
|
|
2955
|
+
if (!f)
|
|
2956
|
+
return s;
|
|
2957
|
+
const w = r(s, f), C = ((b = s.editor) == null ? void 0 : b.type) || "";
|
|
2958
|
+
if (C) {
|
|
2959
|
+
const T = e[C], S = r(s.editor, T);
|
|
2960
|
+
w.editor = S;
|
|
2961
|
+
}
|
|
2962
|
+
return w;
|
|
2963
|
+
}
|
|
2964
|
+
return s;
|
|
2965
|
+
}
|
|
2966
|
+
function u(s) {
|
|
2967
|
+
n = s;
|
|
2968
|
+
}
|
|
2969
|
+
return { getSchemaByType: a, resolveSchemaWithDefaultValue: d, resolveSchemaToProps: m, mappingSchemaToProps: c, setDesignerContext: u };
|
|
2970
|
+
}
|
|
2971
|
+
const pt = {}, gt = {}, { getSchemaByType: Qr, resolveSchemaWithDefaultValue: Co, resolveSchemaToProps: So, mappingSchemaToProps: To, setDesignerContext: Zr } = mt(pt, gt);
|
|
2972
|
+
function Eo(e = {}) {
|
|
2973
|
+
function t(d, u, s, l) {
|
|
2974
|
+
if (typeof s == "number")
|
|
2975
|
+
return l[d].length === s;
|
|
2976
|
+
if (typeof s == "object") {
|
|
2977
|
+
const b = Object.keys(s)[0], f = s[b];
|
|
2978
|
+
if (b === "not")
|
|
2979
|
+
return Number(l[d].length) !== Number(f);
|
|
2980
|
+
if (b === "moreThan")
|
|
2981
|
+
return Number(l[d].length) >= Number(f);
|
|
2982
|
+
if (b === "lessThan")
|
|
2983
|
+
return Number(l[d].length) <= Number(f);
|
|
2984
|
+
}
|
|
2985
|
+
return !1;
|
|
2986
|
+
}
|
|
2987
|
+
function n(d, u, s, l) {
|
|
2988
|
+
return l[d] && l[d].propertyValue && String(l[d].propertyValue.value) === String(s);
|
|
2989
|
+
}
|
|
2990
|
+
const o = /* @__PURE__ */ new Map([
|
|
2991
|
+
["length", t],
|
|
2992
|
+
["getProperty", n]
|
|
2993
|
+
]);
|
|
2994
|
+
Object.keys(e).reduce((d, u) => (d.set(u, e[u]), d), o);
|
|
2995
|
+
function i(d, u) {
|
|
2996
|
+
const s = d;
|
|
2997
|
+
return typeof u == "number" ? [{ target: s, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: s, operator: "getProperty", param: d, value: !!u }] : typeof u == "object" ? Object.keys(u).map((l) => {
|
|
2998
|
+
if (l === "length")
|
|
2999
|
+
return { target: s, operator: "length", param: null, value: u[l] };
|
|
3000
|
+
const b = l, f = u[l];
|
|
3001
|
+
return { target: s, operator: "getProperty", param: b, value: f };
|
|
3002
|
+
}) : [];
|
|
3003
|
+
}
|
|
3004
|
+
function a(d) {
|
|
3005
|
+
return Object.keys(d).reduce((s, l) => {
|
|
3006
|
+
const b = i(l, d[l]);
|
|
3007
|
+
return s.push(...b), s;
|
|
3008
|
+
}, []);
|
|
3009
|
+
}
|
|
3010
|
+
function r(d, u) {
|
|
3011
|
+
if (o.has(d.operator)) {
|
|
3012
|
+
const s = o.get(d.operator);
|
|
3013
|
+
return s && s(d.target, d.param, d.value, u) || !1;
|
|
3014
|
+
}
|
|
3015
|
+
return !1;
|
|
3016
|
+
}
|
|
3017
|
+
function c(d, u) {
|
|
3018
|
+
return a(d).reduce((b, f) => b && r(f, u), !0);
|
|
3019
|
+
}
|
|
3020
|
+
function m(d, u) {
|
|
3021
|
+
const s = Object.keys(d), l = s.includes("allOf"), b = s.includes("anyOf"), f = l || b, T = (f ? d[f ? l ? "allOf" : "anyOf" : "allOf"] : [d]).map((y) => c(y, u));
|
|
3022
|
+
return l ? !T.includes(!1) : T.includes(!0);
|
|
3023
|
+
}
|
|
3024
|
+
return { parseValueSchema: m };
|
|
3025
|
+
}
|
|
3026
|
+
const ko = {
|
|
3027
|
+
convertTo: (e, t, n, o) => {
|
|
3028
|
+
e.appearance || (e.appearance = {}), e.appearance[t] = n;
|
|
3029
|
+
},
|
|
3030
|
+
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
|
|
3031
|
+
}, Fo = {
|
|
3032
|
+
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
3033
|
+
}, Mo = {
|
|
3034
|
+
convertTo: (e, t, n, o) => {
|
|
3035
|
+
e.editor && (e.editor[t] = n);
|
|
3036
|
+
},
|
|
3037
|
+
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
|
|
3038
|
+
}, No = {
|
|
3039
|
+
convertFrom: (e, t, n) => {
|
|
3040
|
+
var i;
|
|
3041
|
+
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
|
|
3042
|
+
return ((i = Oe[o]) == null ? void 0 : i.name) || o;
|
|
3043
|
+
}
|
|
3044
|
+
}, Vo = {
|
|
3045
|
+
convertTo: (e, t, n, o) => {
|
|
3046
|
+
e[t] = e[t];
|
|
3047
|
+
},
|
|
3048
|
+
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
|
|
3049
|
+
}, xo = {
|
|
3050
|
+
convertTo: (e, t, n, o) => {
|
|
3051
|
+
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
|
|
3052
|
+
[t]: n
|
|
3053
|
+
});
|
|
3054
|
+
},
|
|
3055
|
+
convertFrom: (e, t, n) => {
|
|
3056
|
+
if (e.formatter) {
|
|
3057
|
+
if (t === "trueText")
|
|
3058
|
+
return e.formatter.trueText;
|
|
3059
|
+
if (t === "falseText")
|
|
3060
|
+
return e.formatter.falseText;
|
|
3061
|
+
if (t === "prefix")
|
|
3062
|
+
return e.formatter.prefix;
|
|
3063
|
+
if (t === "suffix")
|
|
3064
|
+
return e.formatter.suffix;
|
|
3065
|
+
if (t === "precision")
|
|
3066
|
+
return e.formatter.precision;
|
|
3067
|
+
if (t === "decimal")
|
|
3068
|
+
return e.formatter.decimal;
|
|
3069
|
+
if (t === "thousand")
|
|
3070
|
+
return e.formatter.thousand;
|
|
3071
|
+
if (t === "dateFormat")
|
|
3072
|
+
return e.formatter.dateFormat || "yyyy-MM-dd";
|
|
3073
|
+
if (t === "customFormat")
|
|
3074
|
+
return e.formatter.customFormat;
|
|
3075
|
+
if (t === "type")
|
|
3076
|
+
return e.formatter.type || "none";
|
|
3077
|
+
}
|
|
3078
|
+
return "none";
|
|
3079
|
+
}
|
|
3080
|
+
}, Oo = {
|
|
3081
|
+
convertTo: (e, t, n, o) => {
|
|
3082
|
+
e.command ? e.command[t] = n : e.command = {
|
|
3083
|
+
[t]: n
|
|
3084
|
+
}, t === "enable" && n && (e.command.commands || (e.command.commands = [
|
|
3085
|
+
{
|
|
3086
|
+
text: "编辑",
|
|
3087
|
+
type: "primary",
|
|
3088
|
+
command: "edit"
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
text: "删除",
|
|
3092
|
+
type: "danger",
|
|
3093
|
+
command: "remove"
|
|
3094
|
+
}
|
|
3095
|
+
]));
|
|
3096
|
+
},
|
|
3097
|
+
convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
|
|
3098
|
+
}, Io = {
|
|
3099
|
+
convertTo: (e, t, n, o) => {
|
|
3100
|
+
e.column ? e.column[t] = n : e.column = {
|
|
3101
|
+
[t]: n
|
|
3102
|
+
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
|
|
3103
|
+
},
|
|
3104
|
+
convertFrom: (e, t, n) => {
|
|
3105
|
+
if (e.column) {
|
|
3106
|
+
if (t === "fitColumns")
|
|
3107
|
+
return e.column.fitColumns;
|
|
3108
|
+
if (t === "fitMode")
|
|
3109
|
+
return e.column.fitMode;
|
|
3110
|
+
}
|
|
3111
|
+
return "";
|
|
3112
|
+
}
|
|
3113
|
+
}, Do = {
|
|
3114
|
+
convertTo: (e, t, n, o) => {
|
|
3115
|
+
e.summary ? e.summary[t] = n : e.summary = {
|
|
3116
|
+
[t]: n
|
|
3117
|
+
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
|
|
3118
|
+
enable: n,
|
|
3119
|
+
groupFields: []
|
|
3120
|
+
});
|
|
3121
|
+
},
|
|
3122
|
+
convertFrom: (e, t, n) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
|
|
3123
|
+
}, Po = {
|
|
3124
|
+
convertTo: (e, t, n, o) => {
|
|
3125
|
+
e.group ? e.group[t] = n : e.group = {
|
|
3126
|
+
[t]: n
|
|
3127
|
+
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
|
|
3128
|
+
enable: n,
|
|
3129
|
+
groupFields: [],
|
|
3130
|
+
showSummary: !1
|
|
3131
|
+
});
|
|
3132
|
+
},
|
|
3133
|
+
convertFrom: (e, t, n) => {
|
|
3134
|
+
if (e.group) {
|
|
3135
|
+
if (t === "enable")
|
|
3136
|
+
return e.group.enable;
|
|
3137
|
+
if (t === "showSummary")
|
|
3138
|
+
return e.group.showSummary;
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
}, Bo = {
|
|
3142
|
+
convertFrom: (e, t) => e.binding ? e.binding.path : "",
|
|
3143
|
+
convertTo: (e, t, n) => {
|
|
3144
|
+
if (n && n.length > 0) {
|
|
3145
|
+
const o = n[0];
|
|
3146
|
+
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
}, Ro = {
|
|
3150
|
+
convertTo: (e, t, n, o) => {
|
|
3151
|
+
e.pagination || (e.pagination = {}), e.pagination[t] = n;
|
|
3152
|
+
},
|
|
3153
|
+
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
|
|
3154
|
+
}, Ao = {
|
|
3155
|
+
convertTo: (e, t, n, o) => {
|
|
3156
|
+
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
|
|
3157
|
+
},
|
|
3158
|
+
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
|
|
3159
|
+
}, $o = {
|
|
3160
|
+
convertTo: (e, t, n, o) => {
|
|
3161
|
+
e.selection || (e.selection = {}), e.selection[t] = n;
|
|
3162
|
+
},
|
|
3163
|
+
convertFrom: (e, t, n) => {
|
|
3164
|
+
var o, i;
|
|
3165
|
+
return t === "showCheckbox" ? (o = e.selection) != null && o.multiSelect ? !0 : (i = e.selection) == null ? void 0 : i.showCheckbox : e.selection ? e.selection[t] : e[t];
|
|
3166
|
+
}
|
|
3167
|
+
}, Lo = {
|
|
3168
|
+
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
|
|
3169
|
+
}, jo = {
|
|
3170
|
+
convertFrom: (e, t) => e[t] || "",
|
|
3171
|
+
convertTo: (e, t, n) => {
|
|
3172
|
+
e[t] = n;
|
|
3173
|
+
}
|
|
3174
|
+
}, Ho = {
|
|
3175
|
+
convertTo: (e, t, n, o) => {
|
|
3176
|
+
e.size || (e.size = {}), e.size[t] = n;
|
|
3177
|
+
},
|
|
3178
|
+
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
|
|
3179
|
+
}, Uo = {
|
|
3180
|
+
convertFrom: (e, t, n) => {
|
|
3181
|
+
var o, i;
|
|
3182
|
+
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (i = e.formatter) == null ? void 0 : i.data : e.formatterEnumData;
|
|
3183
|
+
}
|
|
3184
|
+
}, Go = {
|
|
3185
|
+
convertTo: (e, t, n, o) => {
|
|
3186
|
+
e.sort || (e.sort = {}), e.sort[t] = n;
|
|
3187
|
+
},
|
|
3188
|
+
convertFrom: (e, t, n) => {
|
|
3189
|
+
var o, i;
|
|
3190
|
+
if (t === "mode")
|
|
3191
|
+
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
|
|
3192
|
+
if (t === "multiSort")
|
|
3193
|
+
return !!((i = e.sort) != null && i.multiSort);
|
|
3194
|
+
}
|
|
3195
|
+
}, qo = {
|
|
3196
|
+
convertTo: (e, t, n, o) => {
|
|
3197
|
+
e.filter || (e.filter = {}), e.filter[t] = n;
|
|
3198
|
+
},
|
|
3199
|
+
convertFrom: (e, t, n) => {
|
|
3200
|
+
var o;
|
|
3201
|
+
if (t === "mode")
|
|
3202
|
+
return ((o = e.filter) == null ? void 0 : o.mode) || "client";
|
|
3203
|
+
}
|
|
3204
|
+
}, zo = {
|
|
3205
|
+
convertTo: (e, t, n, o) => {
|
|
3206
|
+
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
|
|
3207
|
+
[t]: n
|
|
3208
|
+
};
|
|
3209
|
+
},
|
|
3210
|
+
convertFrom: (e, t, n) => {
|
|
3211
|
+
if (e.rowOption) {
|
|
3212
|
+
if (t === "customRowStyle")
|
|
3213
|
+
return e.rowOption.customRowStyle;
|
|
3214
|
+
if (t === "customCellStyle")
|
|
3215
|
+
return e.rowOption.customCellStyle;
|
|
3216
|
+
}
|
|
3217
|
+
return "";
|
|
3218
|
+
}
|
|
3219
|
+
};
|
|
3220
|
+
function ht(e, t, n) {
|
|
3221
|
+
const o = /* @__PURE__ */ new Map([
|
|
3222
|
+
["/converter/appearance.converter", ko],
|
|
3223
|
+
["/converter/buttons.converter", Fo],
|
|
3224
|
+
["/converter/property-editor.converter", Mo],
|
|
3225
|
+
["/converter/items-count.converter", Lo],
|
|
3226
|
+
["/converter/type.converter", No],
|
|
3227
|
+
["/converter/change-editor.converter", Vo],
|
|
3228
|
+
["/converter/change-formatter.converter", xo],
|
|
3229
|
+
["/converter/column-command.converter", Oo],
|
|
3230
|
+
["/converter/column-option.converter", Io],
|
|
3231
|
+
["/converter/summary.converter", Do],
|
|
3232
|
+
["/converter/group.converter", Po],
|
|
3233
|
+
["/converter/form-group-label.converter", jo],
|
|
3234
|
+
["/converter/field-selector.converter", Bo],
|
|
3235
|
+
["/converter/pagination.converter", Ro],
|
|
3236
|
+
["/converter/row-number.converter", Ao],
|
|
3237
|
+
["/converter/grid-selection.converter", $o],
|
|
3238
|
+
["/converter/size.converter", Ho],
|
|
3239
|
+
["/converter/change-formatter-enum.converter", Uo],
|
|
3240
|
+
["/converter/grid-sort.converter", Go],
|
|
3241
|
+
["/converter/grid-filter.converter", qo],
|
|
3242
|
+
["/converter/row-option.converter", zo]
|
|
3243
|
+
]), i = /* @__PURE__ */ new Map([
|
|
3244
|
+
["string", { type: "input-group", enableClear: !1 }],
|
|
3245
|
+
["boolean", {
|
|
3246
|
+
type: "combo-list",
|
|
3247
|
+
textField: "name",
|
|
3248
|
+
valueField: "value",
|
|
3249
|
+
idField: "value",
|
|
3250
|
+
enableClear: !1,
|
|
3251
|
+
editable: !1,
|
|
3252
|
+
data: [
|
|
3253
|
+
{
|
|
3254
|
+
value: !0,
|
|
3255
|
+
name: "是"
|
|
3256
|
+
},
|
|
3257
|
+
{
|
|
3258
|
+
value: !1,
|
|
3259
|
+
name: "否"
|
|
3260
|
+
}
|
|
3261
|
+
]
|
|
3262
|
+
}],
|
|
3263
|
+
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
|
|
3264
|
+
["array", { type: "button-edit" }],
|
|
3265
|
+
["number", { type: "number-spinner", placeholder: "" }],
|
|
3266
|
+
["events-editor", { type: "events-editor", hide: !0 }]
|
|
3267
|
+
]), a = Eo();
|
|
3268
|
+
function r(f, w) {
|
|
3269
|
+
return () => a.parseValueSchema(f, w);
|
|
3270
|
+
}
|
|
3271
|
+
function c(f, w, C) {
|
|
3272
|
+
return f.includes("visible") && w.visible !== void 0 ? typeof w.visible == "boolean" ? () => !!w.visible : w.visible === void 0 ? !0 : r(w.visible, C) : () => !0;
|
|
3273
|
+
}
|
|
3274
|
+
function m(f, w, C) {
|
|
3275
|
+
return f.includes("readonly") && w.readonly !== void 0 ? typeof w.readonly == "boolean" ? () => !!w.readonly : r(w.readonly, C) : () => !1;
|
|
3276
|
+
}
|
|
3277
|
+
function d(f, w) {
|
|
3278
|
+
const C = f.$converter || w;
|
|
3279
|
+
return typeof C == "string" && C && o.has(C) ? o.get(C) || null : C || null;
|
|
3280
|
+
}
|
|
3281
|
+
function u(f, w, C, T, S, y = "", g = "") {
|
|
3282
|
+
return Object.keys(f).map((p) => {
|
|
3283
|
+
const _ = O(1), E = p, h = f[p], B = Object.keys(h), Y = h.title, M = h.type, L = i.get(M) || { type: "input-group", enableClear: !1 }, D = h.editor ? Object.assign({}, L, h.editor) : Object.assign({}, L), x = c(B, h, w), k = m(B, h, w);
|
|
3284
|
+
D.readonly = D.readonly === void 0 ? k() : D.readonly;
|
|
3285
|
+
const $ = h.type === "cascade" ? u(h.properties, w, C, T, S, y, g) : [], A = !0;
|
|
3286
|
+
let Q = d(h, g);
|
|
3287
|
+
const ne = W({
|
|
3288
|
+
get() {
|
|
3289
|
+
if (_.value) {
|
|
3290
|
+
if (["class", "style"].find((P) => P === E) && !Q && (Q = o.get("/converter/appearance.converter") || null), Q && Q.convertFrom)
|
|
3291
|
+
return Q.convertFrom(C, p, S, y);
|
|
3292
|
+
const ee = C[p];
|
|
3293
|
+
return Object.prototype.hasOwnProperty.call(h, "defaultValue") && (ee === void 0 || typeof ee == "string" && ee === "") ? h.type === "boolean" ? h.defaultValue : h.defaultValue || "" : ee;
|
|
3294
|
+
}
|
|
3295
|
+
return null;
|
|
3296
|
+
},
|
|
3297
|
+
set(ee) {
|
|
3298
|
+
_.value += 1, Q && Q.convertTo ? (Q.convertTo(T, p, ee, S, y), Q.convertTo(C, p, ee, S, y)) : (T[p] = ee, C[p] = ee);
|
|
3299
|
+
}
|
|
3300
|
+
}), { refreshPanelAfterChanged: I, description: z, isExpand: J, parentPropertyID: K } = h, re = { propertyID: E, propertyName: Y, propertyType: M, propertyValue: ne, editor: D, visible: x, readonly: k, cascadeConfig: $, hideCascadeTitle: A, refreshPanelAfterChanged: I, description: z, isExpand: J, parentPropertyID: K };
|
|
3301
|
+
return w[E] = re, re;
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
function s(f, w, C = {}) {
|
|
3305
|
+
const T = {}, S = e[f];
|
|
3306
|
+
return S && S.categories ? Object.keys(S.categories).map((g) => {
|
|
3307
|
+
const v = S.categories[g], p = v == null ? void 0 : v.title, _ = u(v.properties || {}, T, {}, C, w);
|
|
3308
|
+
return { categoryId: g, categoryName: p, properties: _ };
|
|
3309
|
+
}) : [];
|
|
3310
|
+
}
|
|
3311
|
+
function l(f, w, C, T, S = "") {
|
|
3312
|
+
const y = w.$ref.schema, g = w.$ref.converter, v = C[y], p = v.type, _ = n(v), E = {}, h = e[p];
|
|
3313
|
+
if (h && h.categories) {
|
|
3314
|
+
const B = h.categories[f], Y = B == null ? void 0 : B.title;
|
|
3315
|
+
g && Object.keys(B.properties).forEach((D) => {
|
|
3316
|
+
B.properties[D].$converter = g;
|
|
3317
|
+
});
|
|
3318
|
+
const M = (B == null ? void 0 : B.properties) || {}, L = u(M, E, _, v, T, S);
|
|
3319
|
+
return { categoryId: f, categoryName: Y, properties: L };
|
|
3320
|
+
}
|
|
3321
|
+
return { categoryId: f, categoryName: "", properties: [] };
|
|
3322
|
+
}
|
|
3323
|
+
function b(f, w, C, T, S) {
|
|
3324
|
+
const y = f.type, g = n(f), v = {};
|
|
3325
|
+
let p = S || e[y];
|
|
3326
|
+
if (p && Object.keys(p).length === 0 && C && C.getPropConfig && (p = C.getPropConfig(T)), p && p.categories) {
|
|
3327
|
+
const _ = [];
|
|
3328
|
+
return Object.keys(p.categories).map((E) => {
|
|
3329
|
+
const h = p.categories[E];
|
|
3330
|
+
if (h.$ref) {
|
|
3331
|
+
_.push(l(E, h, f, w, T));
|
|
3332
|
+
return;
|
|
3333
|
+
}
|
|
3334
|
+
const B = h == null ? void 0 : h.title, Y = h == null ? void 0 : h.tabId, M = h == null ? void 0 : h.tabName, L = h == null ? void 0 : h.hide, D = h == null ? void 0 : h.hideTitle, x = u(h.properties || {}, v, g, f, w, T, h.$converter), { setPropertyRelates: k } = h, $ = h == null ? void 0 : h.parentPropertyID;
|
|
3335
|
+
_.push({ categoryId: E, categoryName: B, tabId: Y, tabName: M, hide: L, properties: x, hideTitle: D, setPropertyRelates: k, parentPropertyID: $ });
|
|
3336
|
+
}), _;
|
|
3337
|
+
}
|
|
3338
|
+
return [];
|
|
3339
|
+
}
|
|
3340
|
+
return {
|
|
3341
|
+
getPropertyConfigBySchema: b,
|
|
3342
|
+
getPropertyConfigByType: s,
|
|
3343
|
+
propertyConverterMap: o
|
|
3344
|
+
};
|
|
3345
|
+
}
|
|
3346
|
+
const _t = {}, yt = {};
|
|
3347
|
+
ht(_t, yt, Co);
|
|
3348
|
+
const bt = {}, wt = {}, { getSchemaByType: Kr, resolveSchemaWithDefaultValue: Wo, resolveSchemaToProps: ei, mappingSchemaToProps: ti, setDesignerContext: ni } = mt(bt, wt), Ct = {}, St = {};
|
|
3349
|
+
ht(Ct, St, Wo);
|
|
3350
|
+
function Yo(e, t, n = /* @__PURE__ */ new Map(), o = (r, c, m, d) => c, i = {}, a = (r) => r) {
|
|
3351
|
+
return pt[t.title] = t, gt[t.title] = o, _t[t.title] = i, yt[t.title] = a, bt[t.title] = t, wt[t.title] = o, Ct[t.title] = i, St[t.title] = a, (r = {}, c = !0) => {
|
|
3352
|
+
if (!c)
|
|
3353
|
+
return To(r, n);
|
|
3354
|
+
const m = So(r, t, n), d = Object.keys(e).reduce((u, s) => (u[s] = e[s].default, u), {});
|
|
3355
|
+
return Object.assign(d, m);
|
|
3356
|
+
};
|
|
3357
|
+
}
|
|
3358
|
+
function Xo(e, t) {
|
|
3359
|
+
return { customClass: t.class, customStyle: t.style };
|
|
3360
|
+
}
|
|
3361
|
+
const Tt = /* @__PURE__ */ new Map([
|
|
3362
|
+
["appearance", Xo]
|
|
3363
|
+
]), Jo = "root-viewmodel";
|
|
3364
|
+
function Qo(e, t) {
|
|
3365
|
+
const {
|
|
3366
|
+
formSchemaUtils: n,
|
|
3367
|
+
designViewModelUtils: o
|
|
3368
|
+
} = t;
|
|
3369
|
+
function i(u) {
|
|
3370
|
+
return {
|
|
3371
|
+
id: `${u.componentId}-component-viewmodel`,
|
|
3372
|
+
code: `${u.componentId}-component-viewmodel`,
|
|
3373
|
+
name: u.componentName,
|
|
3374
|
+
bindTo: u.bindTo,
|
|
3375
|
+
parent: Jo,
|
|
3376
|
+
fields: [],
|
|
3377
|
+
commands: [],
|
|
3378
|
+
states: [],
|
|
3379
|
+
enableValidation: !0
|
|
3380
|
+
};
|
|
3381
|
+
}
|
|
3382
|
+
function a(u) {
|
|
3383
|
+
const s = e.getSchemaByType("component-ref");
|
|
3384
|
+
return Object.assign(s, {
|
|
3385
|
+
id: `${u.componentId}-component-ref`,
|
|
3386
|
+
component: `${u.componentId}-component`
|
|
3387
|
+
}), s;
|
|
3388
|
+
}
|
|
3389
|
+
function r(u, s, l) {
|
|
3390
|
+
var C, T, S, y;
|
|
3391
|
+
const b = (T = (C = s == null ? void 0 : s.parentComponentInstance) == null ? void 0 : C.schema) == null ? void 0 : T.type, f = (y = (S = n.getFormSchema()) == null ? void 0 : S.module) == null ? void 0 : y.templateId;
|
|
3392
|
+
if (["double-list-template", "tree-list-template", "list-template"].includes(f))
|
|
3393
|
+
return u;
|
|
3394
|
+
const w = [ze["content-container"].type, ze["response-layout-item"].type, ze["splitter-pane"].type];
|
|
3395
|
+
if (b && w.includes(b)) {
|
|
3396
|
+
const g = e.getSchemaByType(
|
|
3397
|
+
"section",
|
|
3398
|
+
{
|
|
3399
|
+
parentComponentInstance: s.parentComponentInstance,
|
|
3400
|
+
mainTitle: s.componentName
|
|
3401
|
+
},
|
|
3402
|
+
t
|
|
3403
|
+
);
|
|
3404
|
+
if (g && g.contents && g.contents.length) {
|
|
3405
|
+
const v = g.contents[0];
|
|
3406
|
+
return v.contents = [u], g;
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
return u;
|
|
3410
|
+
}
|
|
3411
|
+
function c(u) {
|
|
3412
|
+
const s = e.getSchemaByType("list-view");
|
|
3413
|
+
return Object.assign(s, {
|
|
3414
|
+
id: u.componentId + "-listView",
|
|
3415
|
+
appearance: {
|
|
3416
|
+
class: "f-grid-is-sub"
|
|
3417
|
+
},
|
|
3418
|
+
type: "list-view",
|
|
3419
|
+
dataSource: u.dataSource || "",
|
|
3420
|
+
pagination: {
|
|
3421
|
+
enable: !1
|
|
3422
|
+
}
|
|
3423
|
+
}), [s];
|
|
3424
|
+
}
|
|
3425
|
+
function m(u) {
|
|
3426
|
+
const s = e.getSchemaByType("component"), l = c(u);
|
|
3427
|
+
return Object.assign(s, {
|
|
3428
|
+
id: `${u.componentId}-component`,
|
|
3429
|
+
viewModel: `${u.componentId}-component-viewmodel`,
|
|
3430
|
+
componentType: u.componentType,
|
|
3431
|
+
contents: l
|
|
3432
|
+
}), s;
|
|
3433
|
+
}
|
|
3434
|
+
function d(u) {
|
|
3435
|
+
const s = a(u), l = m(u), b = i(u), f = n.getFormSchema();
|
|
3436
|
+
return f.module.viewmodels.push(b), f.module.components.push(l), o.assembleDesignViewModel(), r(s, u);
|
|
3437
|
+
}
|
|
3438
|
+
return { createComponent: d };
|
|
3439
|
+
}
|
|
3440
|
+
function Et(e, t, n, o) {
|
|
3441
|
+
var a, r, c, m, d, u;
|
|
3442
|
+
const i = n.parentComponentInstance;
|
|
3443
|
+
if (i && o) {
|
|
3444
|
+
const s = Math.random().toString(36).slice(2, 6), l = {
|
|
3445
|
+
componentId: `list-view-${s}`,
|
|
3446
|
+
componentName: ((a = n.bindingSourceContext) == null ? void 0 : a.entityTitle) || ((c = (r = n.bindingSourceContext) == null ? void 0 : r.bindingEntity) == null ? void 0 : c.name) || `列表-${s}`,
|
|
3447
|
+
componentType: "list-view",
|
|
3448
|
+
parentContainerId: i.schema.id,
|
|
3449
|
+
parentComponentInstance: i,
|
|
3450
|
+
// editable: true,
|
|
3451
|
+
bindTo: ((m = n.bindingSourceContext) == null ? void 0 : m.bindTo) || "",
|
|
3452
|
+
dataSource: (u = (d = n.bindingSourceContext) == null ? void 0 : d.bindingEntity) == null ? void 0 : u.label
|
|
3453
|
+
// selectedFields: context.bindingSourceContext?.bindingEntityFields
|
|
3454
|
+
}, { createComponent: b } = Qo(e, o);
|
|
3455
|
+
return b(l);
|
|
3456
|
+
} else
|
|
3457
|
+
return t;
|
|
3458
|
+
}
|
|
3459
|
+
const Zo = "https://json-schema.org/draft/2020-12/schema", Ko = "https://farris-design.gitee.io/list-view.schema.json", er = "list-view", tr = "A Farris Component", nr = "object", or = {
|
|
3460
|
+
id: {
|
|
3461
|
+
description: "The unique identifier for list-view",
|
|
3462
|
+
type: "string"
|
|
3463
|
+
},
|
|
3464
|
+
type: {
|
|
3465
|
+
description: "The type string of list-view",
|
|
3466
|
+
type: "string",
|
|
3467
|
+
default: "list-view"
|
|
3468
|
+
},
|
|
3469
|
+
dataSource: {
|
|
3470
|
+
description: "",
|
|
3471
|
+
type: "string",
|
|
3472
|
+
default: ""
|
|
3473
|
+
},
|
|
3474
|
+
appearance: {
|
|
3475
|
+
description: "",
|
|
3476
|
+
type: "object",
|
|
3477
|
+
properties: {
|
|
3478
|
+
class: {
|
|
3479
|
+
type: "string"
|
|
3480
|
+
},
|
|
3481
|
+
style: {
|
|
3482
|
+
type: "string"
|
|
3483
|
+
}
|
|
3484
|
+
},
|
|
3485
|
+
default: {}
|
|
3486
|
+
},
|
|
3487
|
+
binding: {
|
|
3488
|
+
description: "",
|
|
3489
|
+
type: "object",
|
|
3490
|
+
default: {}
|
|
3491
|
+
},
|
|
3492
|
+
disable: {
|
|
3493
|
+
type: "string",
|
|
3494
|
+
default: !1
|
|
3495
|
+
},
|
|
3496
|
+
editable: {
|
|
3497
|
+
description: "",
|
|
3498
|
+
type: "boolean",
|
|
3499
|
+
default: !0
|
|
3500
|
+
},
|
|
3501
|
+
placeholder: {
|
|
3502
|
+
description: "",
|
|
3503
|
+
type: "string",
|
|
3504
|
+
default: ""
|
|
3505
|
+
},
|
|
3506
|
+
readonly: {
|
|
3507
|
+
description: "",
|
|
3508
|
+
type: "boolean",
|
|
3509
|
+
default: !1
|
|
3510
|
+
},
|
|
3511
|
+
require: {
|
|
3512
|
+
description: "",
|
|
3513
|
+
type: "boolean",
|
|
3514
|
+
default: !1
|
|
3515
|
+
},
|
|
3516
|
+
tabindex: {
|
|
3517
|
+
description: "",
|
|
3518
|
+
type: "number",
|
|
3519
|
+
default: -1
|
|
3520
|
+
},
|
|
3521
|
+
visible: {
|
|
3522
|
+
description: "",
|
|
3523
|
+
type: "boolean",
|
|
3524
|
+
default: !0
|
|
3525
|
+
},
|
|
3526
|
+
itemClass: {
|
|
3527
|
+
description: "",
|
|
3528
|
+
type: "string",
|
|
3529
|
+
default: ""
|
|
3530
|
+
},
|
|
3531
|
+
itemStyle: {
|
|
3532
|
+
description: "",
|
|
3533
|
+
type: "string",
|
|
3534
|
+
default: ""
|
|
3535
|
+
},
|
|
3536
|
+
contentTemplate: {
|
|
3537
|
+
description: "",
|
|
3538
|
+
type: "string",
|
|
3539
|
+
default: ""
|
|
3540
|
+
},
|
|
3541
|
+
footerTemplate: {
|
|
3542
|
+
description: "",
|
|
3543
|
+
type: "string",
|
|
3544
|
+
default: ""
|
|
3545
|
+
},
|
|
3546
|
+
emptyTemplate: {
|
|
3547
|
+
description: "",
|
|
3548
|
+
type: "string",
|
|
3549
|
+
default: ""
|
|
3550
|
+
}
|
|
3551
|
+
}, rr = [
|
|
3552
|
+
"id",
|
|
3553
|
+
"type"
|
|
3554
|
+
], ir = {
|
|
3555
|
+
onClickItem: "行点击事件"
|
|
3556
|
+
}, ar = {
|
|
3557
|
+
$schema: Zo,
|
|
3558
|
+
$id: Ko,
|
|
3559
|
+
title: er,
|
|
3560
|
+
description: tr,
|
|
3561
|
+
type: nr,
|
|
3562
|
+
properties: or,
|
|
3563
|
+
required: rr,
|
|
3564
|
+
events: ir
|
|
3565
|
+
}, kt = rn(ln, "headerTemplate"), Ft = dn(kt, ar, Tt, Et), sr = O(0);
|
|
3566
|
+
function lr() {
|
|
3567
|
+
sr.value++;
|
|
3568
|
+
}
|
|
3569
|
+
const cr = O(0);
|
|
3570
|
+
function ur(e) {
|
|
3571
|
+
const { formSchemaUtils: t, formStateMachineUtils: n } = e;
|
|
3572
|
+
function o(m, d = "") {
|
|
3573
|
+
return {
|
|
3574
|
+
path: d + m.code,
|
|
3575
|
+
field: m.id,
|
|
3576
|
+
fullPath: m.code
|
|
3577
|
+
};
|
|
3578
|
+
}
|
|
3579
|
+
function i(m, d = "") {
|
|
3580
|
+
return t.getViewModelById(m).states.map((s) => o(s, d));
|
|
3581
|
+
}
|
|
3582
|
+
function a(m) {
|
|
3583
|
+
const d = t.getRootViewModelId(), u = i(m);
|
|
3584
|
+
if (m === d)
|
|
3585
|
+
return u;
|
|
3586
|
+
const s = i(d, "root-component.");
|
|
3587
|
+
return [...u, ...s];
|
|
3588
|
+
}
|
|
3589
|
+
function r(m) {
|
|
3590
|
+
return m.binding && m.binding.path || m.id || "";
|
|
3591
|
+
}
|
|
3592
|
+
function c() {
|
|
3593
|
+
return n && n.getRenderStates() || [];
|
|
3594
|
+
}
|
|
3595
|
+
return { getVariables: a, getControlName: r, getStateMachines: c };
|
|
3596
|
+
}
|
|
3597
|
+
class dr {
|
|
3598
|
+
constructor(t) {
|
|
3599
|
+
pe(this, "sessionVariables", [
|
|
3600
|
+
{
|
|
3601
|
+
key: "CurrentSysOrgName",
|
|
3602
|
+
name: "当前组织Name",
|
|
3603
|
+
description: "当前组织Name"
|
|
3604
|
+
},
|
|
3605
|
+
// {
|
|
3606
|
+
// key: "CurrentSysOrgCode",
|
|
3607
|
+
// name: "当前组织Code",
|
|
3608
|
+
// description: "当前组织Code"
|
|
3609
|
+
// },
|
|
3610
|
+
{
|
|
3611
|
+
key: "CurrentSysOrgId",
|
|
3612
|
+
name: "当前组织Id",
|
|
3613
|
+
description: "当前组织Id"
|
|
3614
|
+
},
|
|
3615
|
+
{
|
|
3616
|
+
key: "CurrentUserName",
|
|
3617
|
+
name: "当前用户Name",
|
|
3618
|
+
description: "当前用户Name"
|
|
3619
|
+
},
|
|
3620
|
+
{
|
|
3621
|
+
key: "CurrentUserCode",
|
|
3622
|
+
name: "当前用户Code",
|
|
3623
|
+
description: "当前用户Code"
|
|
3624
|
+
},
|
|
3625
|
+
{
|
|
3626
|
+
key: "CurrentUserId",
|
|
3627
|
+
name: "当前用户Id",
|
|
3628
|
+
description: "当前用户Id"
|
|
3629
|
+
},
|
|
3630
|
+
{
|
|
3631
|
+
key: "CurrentLanguage",
|
|
3632
|
+
name: "当前语言编号",
|
|
3633
|
+
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
|
|
3634
|
+
}
|
|
3635
|
+
]);
|
|
3636
|
+
pe(this, "expressionNames", {
|
|
3637
|
+
compute: "计算表达式",
|
|
3638
|
+
dependency: "依赖表达式",
|
|
3639
|
+
validate: "验证表达式",
|
|
3640
|
+
dataPicking: "帮助前表达式",
|
|
3641
|
+
visible: "可见表达式",
|
|
3642
|
+
readonly: "只读表达式",
|
|
3643
|
+
required: "必填表达式"
|
|
3644
|
+
});
|
|
3645
|
+
pe(this, "getExpressionConverter", (t, n) => ({
|
|
3646
|
+
convertFrom: (o, i, a, r) => {
|
|
3647
|
+
const c = a.getExpressionRuleValue(t, n || i);
|
|
3648
|
+
return c && c.value || "";
|
|
3649
|
+
},
|
|
3650
|
+
convertTo: (o, i, a, r, c) => {
|
|
3651
|
+
var m;
|
|
3652
|
+
if (i === "dataPicking" && (a != null && a.target)) {
|
|
3653
|
+
const d = `${a.target}_dataPicking`;
|
|
3654
|
+
((m = a.rules) == null ? void 0 : m.some(
|
|
3655
|
+
(s) => s.id === d && s.value
|
|
3656
|
+
)) ? o.dictPickingExpressionId = d : delete o.dictPickingExpressionId;
|
|
3657
|
+
}
|
|
3658
|
+
r.updateExpression(a);
|
|
3659
|
+
}
|
|
3660
|
+
}));
|
|
3661
|
+
this.formSchemaService = t;
|
|
3662
|
+
}
|
|
3663
|
+
getExpressionRule(t, n) {
|
|
3664
|
+
const o = this.formSchemaService.getExpressions();
|
|
3665
|
+
if (!o)
|
|
3666
|
+
return "";
|
|
3667
|
+
const i = o.find((r) => r.target === t);
|
|
3668
|
+
if (!i)
|
|
3669
|
+
return "";
|
|
3670
|
+
const a = i.rules.find((r) => r.type === n);
|
|
3671
|
+
return a || "";
|
|
3672
|
+
}
|
|
3673
|
+
// 获取上下文表单变量
|
|
3674
|
+
getContextFormVariables() {
|
|
3675
|
+
const { module: t } = this.formSchemaService.getFormSchema();
|
|
3676
|
+
if (!t.viewmodels || t.viewmodels.length === 0)
|
|
3677
|
+
return [];
|
|
3678
|
+
const n = this.formSchemaService.getRootViewModelId(), o = this.formSchemaService.getViewModelById(n);
|
|
3679
|
+
if (!o || !o.states || o.states.length === 0)
|
|
3680
|
+
return [];
|
|
3681
|
+
const i = [];
|
|
3682
|
+
return o.states.forEach((a) => {
|
|
3683
|
+
i.push({
|
|
3684
|
+
key: a.code,
|
|
3685
|
+
name: a.name,
|
|
3686
|
+
description: a.name,
|
|
3687
|
+
category: a.category
|
|
3688
|
+
});
|
|
3689
|
+
}), i;
|
|
3690
|
+
}
|
|
3691
|
+
createTreeNode(t, n, o = "label") {
|
|
3692
|
+
return {
|
|
3693
|
+
id: t.id,
|
|
3694
|
+
name: t.name,
|
|
3695
|
+
bindingPath: t[o],
|
|
3696
|
+
parents: n,
|
|
3697
|
+
type: "field"
|
|
3698
|
+
};
|
|
3699
|
+
}
|
|
3700
|
+
buildEntityFieldsTreeData(t = null, n) {
|
|
3701
|
+
const o = [];
|
|
3702
|
+
return t == null || t.forEach((i) => {
|
|
3703
|
+
var c;
|
|
3704
|
+
const a = this.createTreeNode(i, n);
|
|
3705
|
+
let r = [];
|
|
3706
|
+
(c = i.type) != null && c.fields && (r = this.buildEntityFieldsTreeData(i.type.fields, [...n, i.label])), o.push({
|
|
3707
|
+
data: a,
|
|
3708
|
+
children: r,
|
|
3709
|
+
expanded: !0
|
|
3710
|
+
});
|
|
3711
|
+
}), o;
|
|
3712
|
+
}
|
|
3713
|
+
buildChildEntityTreeData(t = null, n) {
|
|
3714
|
+
const o = [];
|
|
3715
|
+
return t == null || t.forEach((i) => {
|
|
3716
|
+
var m, d;
|
|
3717
|
+
const a = this.createTreeNode(i, n);
|
|
3718
|
+
a.type = "entity";
|
|
3719
|
+
const r = this.buildEntityFieldsTreeData((m = i.type) == null ? void 0 : m.fields, [...n, i.label]), c = this.buildChildEntityTreeData((d = i.type) == null ? void 0 : d.entities, [...n, i.label]);
|
|
3720
|
+
c != null && c.length && (r == null || r.push(...c)), o.push({
|
|
3721
|
+
data: a,
|
|
3722
|
+
children: r || [],
|
|
3723
|
+
// 空值回退
|
|
3724
|
+
expanded: !0
|
|
3725
|
+
});
|
|
3726
|
+
}), o;
|
|
3727
|
+
}
|
|
3728
|
+
getEntitiesTreeData() {
|
|
3729
|
+
const t = this.formSchemaService.getSchemaEntities();
|
|
3730
|
+
if (!(t != null && t.length))
|
|
3731
|
+
return [];
|
|
3732
|
+
const n = t[0];
|
|
3733
|
+
if (!(n != null && n.type))
|
|
3734
|
+
return [];
|
|
3735
|
+
const o = this.buildEntityFieldsTreeData(n.type.fields, [n.code]), i = this.buildChildEntityTreeData(n.type.entities, [n.code]);
|
|
3736
|
+
return i != null && i.length && (o == null || o.push(...i)), {
|
|
3737
|
+
entityCode: n.code,
|
|
3738
|
+
fields: [{
|
|
3739
|
+
data: this.createTreeNode(n, [], "code"),
|
|
3740
|
+
children: o || []
|
|
3741
|
+
}]
|
|
3742
|
+
};
|
|
3743
|
+
}
|
|
3744
|
+
getEntitiesAndVariables() {
|
|
3745
|
+
return {
|
|
3746
|
+
entities: this.getEntitiesTreeData(),
|
|
3747
|
+
variables: {
|
|
3748
|
+
session: {
|
|
3749
|
+
name: "系统变量",
|
|
3750
|
+
items: this.sessionVariables,
|
|
3751
|
+
visible: !1
|
|
3752
|
+
},
|
|
3753
|
+
forms: {
|
|
3754
|
+
name: "表单变量",
|
|
3755
|
+
items: this.getContextFormVariables(),
|
|
3756
|
+
visible: !0
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
};
|
|
3760
|
+
}
|
|
3761
|
+
onBeforeOpenExpression(t, n, o) {
|
|
3762
|
+
const i = o === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, n), r = this.getEntitiesAndVariables(), c = {
|
|
3763
|
+
message: ["validate", "required", "dataPicking"].includes(n) && a ? a.message : "",
|
|
3764
|
+
...r
|
|
3765
|
+
};
|
|
3766
|
+
return a.messageType != null && (c.messageType = a.messageType), c;
|
|
3767
|
+
}
|
|
3768
|
+
buildRule(t, n, o, i) {
|
|
3769
|
+
const { expression: a, message: r, messageType: c } = n, m = {
|
|
3770
|
+
id: `${t}_${o}`,
|
|
3771
|
+
type: o,
|
|
3772
|
+
value: a
|
|
3773
|
+
};
|
|
3774
|
+
return (o === "validate" || o === "dataPicking" || o === "required") && (m.message = r), o === "dataPicking" && (m.messageType = c), o === "validate" && i && (m.elementId = i), m;
|
|
3775
|
+
}
|
|
3776
|
+
getExpressionData() {
|
|
3777
|
+
const { expressions: t } = this.formSchemaService.getFormSchema().module;
|
|
3778
|
+
return t || [];
|
|
3779
|
+
}
|
|
3780
|
+
updateExpression(t, n, o, i) {
|
|
3781
|
+
const a = n === "Field" ? t.binding.field : t.id, r = this.buildRule(a, o, i, t.type === "form-group" ? t.id : "");
|
|
3782
|
+
let m = this.getExpressionData().find((u) => u.targetType === n && u.target === a);
|
|
3783
|
+
const d = (u) => u.value.trim() === "";
|
|
3784
|
+
if (m) {
|
|
3785
|
+
const u = m.rules.find((s) => s.id === r.id);
|
|
3786
|
+
if (u)
|
|
3787
|
+
d(r) ? m.rules = m.rules.filter((s) => s.id !== r.id) : (Object.assign(u, r), i === "validate" && t.type === "form-group" && (u.elementId = t.id));
|
|
3788
|
+
else {
|
|
3789
|
+
if (d(r))
|
|
3790
|
+
return null;
|
|
3791
|
+
m.rules = m.rules || [], m.rules.push(r);
|
|
3792
|
+
}
|
|
3793
|
+
} else {
|
|
3794
|
+
if (d(r))
|
|
3795
|
+
return null;
|
|
3796
|
+
m = {
|
|
3797
|
+
target: `${a}`,
|
|
3798
|
+
rules: [r],
|
|
3799
|
+
targetType: n
|
|
3800
|
+
};
|
|
3801
|
+
}
|
|
3802
|
+
return m;
|
|
3803
|
+
}
|
|
3804
|
+
getExpressionEditorOptions(t, n, o, i) {
|
|
3805
|
+
return o.reduce((a, r) => {
|
|
3806
|
+
var m, d;
|
|
3807
|
+
const c = n === "Field" ? (m = t == null ? void 0 : t.binding) == null ? void 0 : m.field : t.id;
|
|
3808
|
+
return a[r] = {
|
|
3809
|
+
hide: n === "Field" ? !!((d = t == null ? void 0 : t.binding) != null && d.field) : !1,
|
|
3810
|
+
description: "",
|
|
3811
|
+
title: this.expressionNames[r],
|
|
3812
|
+
type: "string",
|
|
3813
|
+
$converter: this.getExpressionConverter(c),
|
|
3814
|
+
refreshPanelAfterChanged: !0,
|
|
3815
|
+
editor: {
|
|
3816
|
+
type: "expression-editor",
|
|
3817
|
+
singleExpand: !1,
|
|
3818
|
+
dialogTitle: `${this.expressionNames[r]}编辑器`,
|
|
3819
|
+
showMessage: r === "validate" || r === "dataPicking" || r === "required",
|
|
3820
|
+
showMessageType: r === "dataPicking",
|
|
3821
|
+
beforeOpen: () => this.onBeforeOpenExpression(t, r, n),
|
|
3822
|
+
onSubmitModal: (u) => {
|
|
3823
|
+
const s = this.updateExpression(t, n, u, r);
|
|
3824
|
+
if (i) {
|
|
3825
|
+
const l = this.buildRule(c, u, r);
|
|
3826
|
+
i(l);
|
|
3827
|
+
}
|
|
3828
|
+
return s;
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
}, a;
|
|
3832
|
+
}, {});
|
|
3833
|
+
}
|
|
3834
|
+
getExpressionInfo(t, n, o) {
|
|
3835
|
+
const i = n === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, o), r = {
|
|
3836
|
+
value: a && a.value,
|
|
3837
|
+
targetId: i,
|
|
3838
|
+
targetType: n,
|
|
3839
|
+
expressionType: o
|
|
3840
|
+
};
|
|
3841
|
+
return a && a.message && (r.message = a.message), r;
|
|
3842
|
+
}
|
|
3843
|
+
getExpressionConfig(t, n, o = ["compute", "dependency", "validate"], i) {
|
|
3844
|
+
return {
|
|
3845
|
+
description: "表达式",
|
|
3846
|
+
title: "表达式",
|
|
3847
|
+
hide: !t.binding,
|
|
3848
|
+
properties: {
|
|
3849
|
+
...this.getExpressionEditorOptions(t, n, o, i)
|
|
3850
|
+
}
|
|
3851
|
+
};
|
|
3852
|
+
}
|
|
3853
|
+
getExpressionOptions(t, n, o) {
|
|
3854
|
+
const i = this.getExpressionInfo(t, n, o);
|
|
3855
|
+
return {
|
|
3856
|
+
dialogTitle: `${this.expressionNames[o]}编辑器`,
|
|
3857
|
+
singleExpand: !1,
|
|
3858
|
+
showMessage: o === "required",
|
|
3859
|
+
beforeOpen: () => this.onBeforeOpenExpression(t, o, n),
|
|
3860
|
+
expressionInfo: i
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
}
|
|
3864
|
+
class fr {
|
|
3865
|
+
constructor(t, n) {
|
|
3866
|
+
pe(this, "componentId");
|
|
3867
|
+
pe(this, "viewModelId");
|
|
3868
|
+
pe(this, "eventsEditorUtils");
|
|
3869
|
+
pe(this, "formSchemaUtils");
|
|
3870
|
+
pe(this, "formMetadataConverter");
|
|
3871
|
+
pe(this, "designViewModelUtils");
|
|
3872
|
+
pe(this, "designViewModelField");
|
|
3873
|
+
pe(this, "controlCreatorUtils");
|
|
3874
|
+
pe(this, "designerHostService");
|
|
3875
|
+
pe(this, "designerContext");
|
|
3876
|
+
pe(this, "schemaService", null);
|
|
3877
|
+
pe(this, "metadataService", null);
|
|
3878
|
+
pe(this, "propertyConfig", {
|
|
3879
|
+
type: "object",
|
|
3880
|
+
categories: {}
|
|
3881
|
+
});
|
|
3882
|
+
var o;
|
|
3883
|
+
this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService, this.designerContext = n.designerContext;
|
|
3884
|
+
}
|
|
3885
|
+
getFormDesignerInstance() {
|
|
3886
|
+
var t, n;
|
|
3887
|
+
return (n = (t = this.designerContext) == null ? void 0 : t.instances) == null ? void 0 : n.formDesigner.value;
|
|
3888
|
+
}
|
|
3889
|
+
getTableInfo() {
|
|
3890
|
+
var t;
|
|
3891
|
+
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
|
|
3892
|
+
}
|
|
3893
|
+
setDesignViewModelField(t) {
|
|
3894
|
+
var o;
|
|
3895
|
+
const n = t.binding && t.binding.type === "Form" && t.binding.field;
|
|
3896
|
+
if (n) {
|
|
3897
|
+
if (!this.designViewModelField) {
|
|
3898
|
+
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
3899
|
+
this.designViewModelField = i.fields.find((a) => a.id === n);
|
|
3900
|
+
}
|
|
3901
|
+
t.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn;
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
getBasicPropConfig(t) {
|
|
3905
|
+
return {
|
|
3906
|
+
description: "Basic Information",
|
|
3907
|
+
title: "基本信息",
|
|
3908
|
+
properties: {
|
|
3909
|
+
id: {
|
|
3910
|
+
description: "组件标识",
|
|
3911
|
+
title: "标识",
|
|
3912
|
+
type: "string",
|
|
3913
|
+
readonly: !0
|
|
3914
|
+
},
|
|
3915
|
+
type: {
|
|
3916
|
+
description: "组件类型",
|
|
3917
|
+
title: "控件类型",
|
|
3918
|
+
type: "select",
|
|
3919
|
+
editor: {
|
|
3920
|
+
type: "combo-list",
|
|
3921
|
+
textField: "name",
|
|
3922
|
+
valueField: "value",
|
|
3923
|
+
idField: "value",
|
|
3924
|
+
editable: !1,
|
|
3925
|
+
data: [{ value: t.type, name: Oe[t.type] && Oe[t.type].name }]
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3931
|
+
getAppearanceConfig(t = null, n = {}, o) {
|
|
3932
|
+
const i = {
|
|
3933
|
+
title: "外观",
|
|
3934
|
+
description: "Appearance"
|
|
3935
|
+
}, a = {
|
|
3936
|
+
class: {
|
|
3937
|
+
title: "class样式",
|
|
3938
|
+
type: "string",
|
|
3939
|
+
description: "组件的CSS样式",
|
|
3940
|
+
$converter: "/converter/appearance.converter",
|
|
3941
|
+
parentPropertyID: "appearance"
|
|
3942
|
+
},
|
|
3943
|
+
style: {
|
|
3944
|
+
title: "style样式",
|
|
3945
|
+
type: "string",
|
|
3946
|
+
description: "组件的样式",
|
|
3947
|
+
$converter: "/converter/appearance.converter",
|
|
3948
|
+
parentPropertyID: "appearance"
|
|
3949
|
+
}
|
|
3950
|
+
};
|
|
3951
|
+
for (const r in n)
|
|
3952
|
+
a[r] = Object.assign(a[r] || {}, n[r]);
|
|
3953
|
+
return {
|
|
3954
|
+
...i,
|
|
3955
|
+
properties: { ...a },
|
|
3956
|
+
setPropertyRelates(r, c) {
|
|
3957
|
+
if (r) {
|
|
3958
|
+
switch (r && r.propertyID) {
|
|
3959
|
+
case "class":
|
|
3960
|
+
case "style": {
|
|
3961
|
+
cr.value++;
|
|
3962
|
+
break;
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
o && o(r, t, c);
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
};
|
|
3969
|
+
}
|
|
3970
|
+
/**
|
|
3971
|
+
*
|
|
3972
|
+
* @param propertyData
|
|
3973
|
+
* @param propertyTypes
|
|
3974
|
+
* @param propertyName
|
|
3975
|
+
* @param constInfos
|
|
3976
|
+
* @param variableInfos
|
|
3977
|
+
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
3978
|
+
* @returns
|
|
3979
|
+
*/
|
|
3980
|
+
getPropertyEditorParams(t, n = [], o = "visible", i = {}, a = {}, r = "") {
|
|
3981
|
+
const { getVariables: c, getControlName: m, getStateMachines: d } = ur(this.designerHostService), u = this.getRealTargetType(t), s = n && n.length > 0 ? n : ["Const", "Variable", "StateMachine", "Expression"], l = {
|
|
3982
|
+
type: "property-editor",
|
|
3983
|
+
propertyTypes: s
|
|
3984
|
+
};
|
|
3985
|
+
return s.map((b) => {
|
|
3986
|
+
switch (b) {
|
|
3987
|
+
case "Const":
|
|
3988
|
+
Object.assign(l, {
|
|
3989
|
+
constType: "enum",
|
|
3990
|
+
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
|
|
3991
|
+
}, i);
|
|
3992
|
+
break;
|
|
3993
|
+
case "Expression":
|
|
3994
|
+
l.expressionConfig = this.getExpressionOptions(t, u, r || o);
|
|
3995
|
+
break;
|
|
3996
|
+
case "StateMachine":
|
|
3997
|
+
l.stateMachines = d();
|
|
3998
|
+
break;
|
|
3999
|
+
case "Variable":
|
|
4000
|
+
Object.assign(l, {
|
|
4001
|
+
controlName: m(t),
|
|
4002
|
+
newVariablePrefix: "is",
|
|
4003
|
+
newVariableType: "Boolean",
|
|
4004
|
+
variables: c(this.viewModelId),
|
|
4005
|
+
onBeforeOpenVariables: (f) => {
|
|
4006
|
+
f.value = c(this.viewModelId);
|
|
4007
|
+
}
|
|
4008
|
+
}, a);
|
|
4009
|
+
break;
|
|
4010
|
+
}
|
|
4011
|
+
}), l;
|
|
4012
|
+
}
|
|
4013
|
+
getVisibleProperty(t, n = "") {
|
|
4014
|
+
var a;
|
|
4015
|
+
let o = ["Const", "Variable", "StateMachine", "Expression"];
|
|
4016
|
+
return n === "gridFieldEditor" ? o = ["Const", "Expression"] : n === "form-group" && !((a = t.binding) != null && a.field) && (o = ["Const", "Variable", "StateMachine"]), {
|
|
4017
|
+
visible: {
|
|
4018
|
+
title: "是否可见",
|
|
4019
|
+
type: "boolean",
|
|
4020
|
+
description: "运行时组件是否可见",
|
|
4021
|
+
editor: this.getPropertyEditorParams(t, o, "visible")
|
|
4022
|
+
}
|
|
4023
|
+
};
|
|
4024
|
+
}
|
|
4025
|
+
/**
|
|
4026
|
+
* 获取行为
|
|
4027
|
+
* @param propertyData
|
|
4028
|
+
* @param viewModelId
|
|
4029
|
+
* @returns
|
|
4030
|
+
*/
|
|
4031
|
+
getBehaviorConfig(t, n = "", o = {}, i) {
|
|
4032
|
+
const a = {
|
|
4033
|
+
title: "行为",
|
|
4034
|
+
description: ""
|
|
4035
|
+
}, r = this.getVisibleProperty(t, n);
|
|
4036
|
+
for (const m in o)
|
|
4037
|
+
r[m] = Object.assign(r[m] || {}, o[m]);
|
|
4038
|
+
const c = this;
|
|
4039
|
+
return {
|
|
4040
|
+
...a,
|
|
4041
|
+
properties: { ...r },
|
|
4042
|
+
setPropertyRelates(m, d) {
|
|
4043
|
+
if (m) {
|
|
4044
|
+
switch (m.propertyID) {
|
|
4045
|
+
case "disabled":
|
|
4046
|
+
case "readonly":
|
|
4047
|
+
case "visible":
|
|
4048
|
+
c.afterMutilEditorChanged(t, m);
|
|
4049
|
+
break;
|
|
4050
|
+
}
|
|
4051
|
+
i && i(m, d);
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
4054
|
+
};
|
|
4055
|
+
}
|
|
4056
|
+
/**
|
|
4057
|
+
* 当多值编辑器变更时
|
|
4058
|
+
* @param propertyData
|
|
4059
|
+
* @param changeObject
|
|
4060
|
+
*/
|
|
4061
|
+
afterMutilEditorChanged(t, n) {
|
|
4062
|
+
this.addNewVariableToViewModel(n, this.viewModelId), this.updateExpressionValue(n), this.clearExpression(n, t);
|
|
4063
|
+
}
|
|
4064
|
+
/**
|
|
4065
|
+
*
|
|
4066
|
+
* @param propertyId
|
|
4067
|
+
* @param componentInstance
|
|
4068
|
+
* @returns
|
|
4069
|
+
*/
|
|
4070
|
+
updateElementByParentContainer(t, n) {
|
|
4071
|
+
const o = n && n.parent && n.parent.schema;
|
|
4072
|
+
if (!o)
|
|
4073
|
+
return;
|
|
4074
|
+
const i = o.contents.findIndex((r) => r.id === t), a = Ae(o.contents[i]);
|
|
4075
|
+
o.contents.splice(i, 1), o.contents.splice(i, 0, a), lr();
|
|
4076
|
+
}
|
|
4077
|
+
/**
|
|
4078
|
+
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
4079
|
+
* @param changeObject
|
|
4080
|
+
* @param viewModelId
|
|
4081
|
+
* @returns
|
|
4082
|
+
*/
|
|
4083
|
+
addNewVariableToViewModel(t, n) {
|
|
4084
|
+
const o = t.propertyValue;
|
|
4085
|
+
if (!(o && typeof o == "object") || !(o.type === "Variable" && o.isNewVariable))
|
|
4086
|
+
return;
|
|
4087
|
+
const r = {
|
|
4088
|
+
id: o.field,
|
|
4089
|
+
category: "locale",
|
|
4090
|
+
code: o.fullPath,
|
|
4091
|
+
name: o.fullPath,
|
|
4092
|
+
type: o.newVariableType || "String"
|
|
4093
|
+
};
|
|
4094
|
+
delete o.newVariableType, delete o.isNewVariable, this.formSchemaUtils.getVariableByCode(r.code) || this.formSchemaUtils.getViewModelById(n).states.push(r);
|
|
4095
|
+
}
|
|
4096
|
+
/**
|
|
4097
|
+
* 更新表达式到expressions节点
|
|
4098
|
+
* @param changeObject
|
|
4099
|
+
*/
|
|
4100
|
+
updateExpressionValue(t) {
|
|
4101
|
+
const n = t.propertyValue;
|
|
4102
|
+
if (!((n && n.type) === "Expression" && n.expressionInfo))
|
|
4103
|
+
return;
|
|
4104
|
+
const { expressionId: a, expressionInfo: r } = n, { targetId: c, targetType: m, expressionType: d, value: u, message: s } = r, l = this.formSchemaUtils.getModule();
|
|
4105
|
+
l.expressions = l.expressions || [];
|
|
4106
|
+
const { expressions: b } = l;
|
|
4107
|
+
let f = b.find((C) => C.target === c);
|
|
4108
|
+
f || (f = { target: c, rules: [], targetType: m }, b.push(f));
|
|
4109
|
+
const w = f.rules.find((C) => C.type === d);
|
|
4110
|
+
if (w)
|
|
4111
|
+
w.value = u, w.message = s;
|
|
4112
|
+
else {
|
|
4113
|
+
const C = { id: a, type: d, value: u, message: s };
|
|
4114
|
+
f.rules.push(C);
|
|
4115
|
+
}
|
|
4116
|
+
delete n.expressionInfo;
|
|
4117
|
+
}
|
|
4118
|
+
/**
|
|
4119
|
+
* 属性类型切换为非表达式后,清除原表达式
|
|
4120
|
+
* @param changeObject
|
|
4121
|
+
* @param propertyData
|
|
4122
|
+
* @returns
|
|
4123
|
+
*/
|
|
4124
|
+
clearExpression(t, n) {
|
|
4125
|
+
const o = t.propertyValue;
|
|
4126
|
+
if (o && o.type === "Expression")
|
|
4127
|
+
return;
|
|
4128
|
+
const a = t.propertyID, r = this.formSchemaUtils.getExpressions(), c = n.binding ? n.binding.field : n.id, m = r.find((d) => d.target === c);
|
|
4129
|
+
!m || !m.rules || (m.rules = m.rules.filter((d) => d.type !== a));
|
|
4130
|
+
}
|
|
4131
|
+
getExpressionOptions(t, n, o) {
|
|
4132
|
+
return new dr(this.formSchemaUtils).getExpressionOptions(t, n, o);
|
|
4133
|
+
}
|
|
4134
|
+
getRealTargetType(t) {
|
|
4135
|
+
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(t.type) > -1 ? "Button" : t.binding && t.binding.field ? "Field" : "Container";
|
|
4136
|
+
}
|
|
4137
|
+
createBaseEventProperty(t) {
|
|
4138
|
+
const n = {};
|
|
4139
|
+
return n[this.viewModelId] = {
|
|
4140
|
+
type: "events-editor",
|
|
4141
|
+
editor: {
|
|
4142
|
+
initialData: t,
|
|
4143
|
+
viewSourceHandle: (o) => {
|
|
4144
|
+
var i;
|
|
4145
|
+
((i = o.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(o);
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
}, n;
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
class vr extends fr {
|
|
4152
|
+
constructor(t, n) {
|
|
4153
|
+
super(t, n);
|
|
4154
|
+
}
|
|
4155
|
+
getPropertyConfig(t) {
|
|
4156
|
+
return this.getBasicPropConfig(t), this.getAppearanceProperties(t), this.getEventPropConfig(t), this.propertyConfig;
|
|
4157
|
+
}
|
|
4158
|
+
getBasicPropConfig(t) {
|
|
4159
|
+
var r, c, m;
|
|
4160
|
+
const n = (m = (c = (r = this.formSchemaUtils.getFormSchema()) == null ? void 0 : r.module) == null ? void 0 : c.entity[0]) == null ? void 0 : m.entities[0], o = this.assembleSchemaEntityToTree(n, 0), i = this, a = super.getBasicPropConfig(t);
|
|
4161
|
+
this.propertyConfig.categories.basic = {
|
|
4162
|
+
description: "Basic Information",
|
|
4163
|
+
title: "基本信息",
|
|
4164
|
+
properties: {
|
|
4165
|
+
...a.properties,
|
|
4166
|
+
dataSource: {
|
|
4167
|
+
description: "绑定数据源",
|
|
4168
|
+
title: "绑定数据源",
|
|
4169
|
+
editor: {
|
|
4170
|
+
type: "combo-tree",
|
|
4171
|
+
textField: "name",
|
|
4172
|
+
valueField: "label",
|
|
4173
|
+
data: o,
|
|
4174
|
+
editable: !1
|
|
4175
|
+
},
|
|
4176
|
+
readonly: !0
|
|
4177
|
+
}
|
|
4178
|
+
},
|
|
4179
|
+
setPropertyRelates(d, u) {
|
|
4180
|
+
switch (d && d.propertyID) {
|
|
4181
|
+
case "dataSource": {
|
|
4182
|
+
const s = i.formSchemaUtils.getViewModelById(i.viewModelId);
|
|
4183
|
+
if (s) {
|
|
4184
|
+
const l = o.find((b) => b.label === d.propertyValue);
|
|
4185
|
+
s.bindTo = l.bindTo;
|
|
4186
|
+
}
|
|
4187
|
+
i.designViewModelUtils.assembleDesignViewModel();
|
|
4188
|
+
break;
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
};
|
|
4193
|
+
}
|
|
4194
|
+
/**
|
|
4195
|
+
* 将schema实体表组装成树
|
|
4196
|
+
*/
|
|
4197
|
+
assembleSchemaEntityToTree(t, n, o, i = "", a = []) {
|
|
4198
|
+
const r = i ? `${i}/${t.label}` : "/";
|
|
4199
|
+
return a.push({
|
|
4200
|
+
id: t.id,
|
|
4201
|
+
name: t.name,
|
|
4202
|
+
label: t.label,
|
|
4203
|
+
layer: n,
|
|
4204
|
+
parent: o && o.id,
|
|
4205
|
+
bindTo: r.replace("//", "/")
|
|
4206
|
+
}), t.type.entities && t.type.entities.length && t.type.entities.map((c) => this.assembleSchemaEntityToTree(c, n + 1, t, r, a)), a;
|
|
4207
|
+
}
|
|
4208
|
+
getAppearanceProperties(t) {
|
|
4209
|
+
this.propertyConfig.categories.appearance = {
|
|
4210
|
+
title: "外观",
|
|
4211
|
+
properties: {
|
|
4212
|
+
class: {
|
|
4213
|
+
title: "列表class样式",
|
|
4214
|
+
type: "string",
|
|
4215
|
+
description: "组件的CSS样式"
|
|
4216
|
+
},
|
|
4217
|
+
itemClass: {
|
|
4218
|
+
title: "行样式class",
|
|
4219
|
+
type: "string",
|
|
4220
|
+
description: "行样式class",
|
|
4221
|
+
editor: {
|
|
4222
|
+
type: "code-editor",
|
|
4223
|
+
language: "javascript",
|
|
4224
|
+
leftTemplate: () => F(De, null, [F("h5", null, [ke("示例代码")]), F("pre", null, [`
|
|
4225
|
+
(dataItem) => {
|
|
4226
|
+
if(dataItem.code === '0001') {
|
|
4227
|
+
return 'bg-danger text-center';
|
|
4228
|
+
}
|
|
4229
|
+
return '';
|
|
4230
|
+
}
|
|
4231
|
+
|
|
4232
|
+
注:dataItem 行数据
|
|
4233
|
+
函数返回值是一个字符串,
|
|
4234
|
+
是由空格分隔的class组成 `])])
|
|
4235
|
+
}
|
|
4236
|
+
},
|
|
4237
|
+
itemStyle: {
|
|
4238
|
+
title: "行样式style",
|
|
4239
|
+
type: "string",
|
|
4240
|
+
description: "行样式style",
|
|
4241
|
+
editor: {
|
|
4242
|
+
type: "code-editor",
|
|
4243
|
+
language: "javascript",
|
|
4244
|
+
leftTemplate: () => F(De, null, [F("h5", null, [ke("示例代码")]), F("pre", null, [`
|
|
4245
|
+
(dataItem) => {
|
|
4246
|
+
if(dataItem.code === '0001') {
|
|
4247
|
+
return 'textAlign:center;color:green';
|
|
4248
|
+
}
|
|
4249
|
+
return '';
|
|
4250
|
+
}
|
|
4251
|
+
|
|
4252
|
+
注:dataItem 行数据
|
|
4253
|
+
函数返回值是一个字符串,
|
|
4254
|
+
由分号分隔的css样式组成 `])])
|
|
4255
|
+
}
|
|
4256
|
+
},
|
|
4257
|
+
contentTemplate: {
|
|
4258
|
+
description: "内容模板",
|
|
4259
|
+
title: "内容模板",
|
|
4260
|
+
type: "string",
|
|
4261
|
+
refreshPanelAfterChanged: !0,
|
|
4262
|
+
editor: {
|
|
4263
|
+
type: "code-editor",
|
|
4264
|
+
language: "html"
|
|
4265
|
+
}
|
|
4266
|
+
},
|
|
4267
|
+
footerTemplate: {
|
|
4268
|
+
description: "底部模板",
|
|
4269
|
+
title: "底部模板",
|
|
4270
|
+
type: "string",
|
|
4271
|
+
refreshPanelAfterChanged: !0,
|
|
4272
|
+
editor: {
|
|
4273
|
+
type: "code-editor",
|
|
4274
|
+
language: "html"
|
|
4275
|
+
}
|
|
4276
|
+
},
|
|
4277
|
+
emptyTemplate: {
|
|
4278
|
+
description: "空数据模板",
|
|
4279
|
+
title: "空数据模板",
|
|
4280
|
+
type: "string",
|
|
4281
|
+
refreshPanelAfterChanged: !0,
|
|
4282
|
+
editor: {
|
|
4283
|
+
type: "code-editor",
|
|
4284
|
+
language: "html"
|
|
4285
|
+
}
|
|
4286
|
+
}
|
|
4287
|
+
},
|
|
4288
|
+
setPropertyRelates(n, o) {
|
|
4289
|
+
switch (n && n.propertyID) {
|
|
4290
|
+
case "useBlankWhenDataIsEmpty":
|
|
4291
|
+
t.emptyDataHeight = t.useBlankWhenDataIsEmpty ? 36 : 240;
|
|
4292
|
+
break;
|
|
4293
|
+
case "columns":
|
|
4294
|
+
t.columns = n.propertyValue || [];
|
|
4295
|
+
break;
|
|
4296
|
+
}
|
|
4297
|
+
}
|
|
4298
|
+
};
|
|
4299
|
+
}
|
|
4300
|
+
getEventPropConfig(t) {
|
|
4301
|
+
var r;
|
|
4302
|
+
const n = [{
|
|
4303
|
+
label: "onClickItem",
|
|
4304
|
+
name: "行点击事件"
|
|
4305
|
+
}];
|
|
4306
|
+
(r = t.pagination) == null || r.enable;
|
|
4307
|
+
const o = this, i = o.eventsEditorUtils.formProperties(t, o.viewModelId, n), a = o.createBaseEventProperty(i);
|
|
4308
|
+
this.propertyConfig.categories.eventsEditor = {
|
|
4309
|
+
title: "事件",
|
|
4310
|
+
hideTitle: !0,
|
|
4311
|
+
properties: a,
|
|
4312
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
4313
|
+
refreshPanelAfterChanged: !0,
|
|
4314
|
+
tabId: "commands",
|
|
4315
|
+
tabName: "交互",
|
|
4316
|
+
setPropertyRelates(c, m) {
|
|
4317
|
+
const d = c.propertyValue;
|
|
4318
|
+
delete t[o.viewModelId], d && (d.setPropertyRelates = this.setPropertyRelates, o.eventsEditorUtils.saveRelatedParameters(t, o.viewModelId, d.events, d)), t.remoteSort = !!t.columnSorted, t.command && (t.command.onClickEditCommand = t.onClickEditCommand, t.command.onClickDeleteCommand = t.onClickDeleteCommand);
|
|
4319
|
+
}
|
|
4320
|
+
};
|
|
4321
|
+
}
|
|
4322
|
+
isSubGrid() {
|
|
4323
|
+
const t = this.formSchemaUtils.getViewModelById(this.viewModelId);
|
|
4324
|
+
return t && t.bindTo ? t.bindTo.trim() !== "/" : !1;
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
function mr(e, t) {
|
|
4328
|
+
const n = e.schema, o = O(!0), i = O(!0);
|
|
4329
|
+
function a(s) {
|
|
4330
|
+
return !1;
|
|
4331
|
+
}
|
|
4332
|
+
function r() {
|
|
4333
|
+
return !1;
|
|
4334
|
+
}
|
|
4335
|
+
function c() {
|
|
4336
|
+
return !1;
|
|
4337
|
+
}
|
|
4338
|
+
function m() {
|
|
4339
|
+
return !0;
|
|
4340
|
+
}
|
|
4341
|
+
function d(s) {
|
|
4342
|
+
return new vr(s, t).getPropertyConfig(n);
|
|
4343
|
+
}
|
|
4344
|
+
function u() {
|
|
4345
|
+
var s, l, b, f;
|
|
4346
|
+
if (e && t) {
|
|
4347
|
+
const w = (s = e == null ? void 0 : e.componentInstance) == null ? void 0 : s.value.belongedComponentId;
|
|
4348
|
+
let C = "", T = "";
|
|
4349
|
+
const { formSchemaUtils: S } = t;
|
|
4350
|
+
if (w) {
|
|
4351
|
+
const g = S.getRootViewModelId(), v = S.getComponentByViewModelId(g), p = S.selectNode(v, (_) => _.contents && _.contents.find((E) => E.component === w));
|
|
4352
|
+
(p == null ? void 0 : p.type) === ((l = Oe["tab-page"]) == null ? void 0 : l.type) && ((b = p == null ? void 0 : p.contents) != null && b.length) && (C = p.title || ""), (p == null ? void 0 : p.type) === ((f = Oe.section) == null ? void 0 : f.type) && (p == null ? void 0 : p.showHeader) !== !1 && (C = p.mainTitle || ""), C = C ? `${C} > ` : "", T = C ? p.id : "";
|
|
4353
|
+
}
|
|
4354
|
+
const y = Oe["list-view"].name;
|
|
4355
|
+
t == null || t.formSchemaUtils.getControlBasicInfoMap().set(e.schema.id, {
|
|
4356
|
+
componentTitle: y,
|
|
4357
|
+
parentPathName: `${C}${y}`,
|
|
4358
|
+
reliedComponentId: T
|
|
4359
|
+
});
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
return {
|
|
4363
|
+
canAccepts: a,
|
|
4364
|
+
checkCanDeleteComponent: r,
|
|
4365
|
+
checkCanMoveComponent: c,
|
|
4366
|
+
hideNestedPaddingInDesginerView: m,
|
|
4367
|
+
triggerBelongedComponentToMoveWhenMoved: o,
|
|
4368
|
+
triggerBelongedComponentToDeleteWhenDeleted: i,
|
|
4369
|
+
getPropsConfig: d,
|
|
4370
|
+
setComponentBasicInfoMap: u
|
|
4371
|
+
};
|
|
4372
|
+
}
|
|
4373
|
+
const pr = "https://json-schema.org/draft/2020-12/schema", gr = "https://farris-design.gitee.io/list-view-table.schema.json", hr = "list-view-table", _r = "A Farris Component", yr = "object", br = {
|
|
4374
|
+
id: {
|
|
4375
|
+
description: "The unique identifier for list-view-table",
|
|
4376
|
+
type: "string"
|
|
4377
|
+
},
|
|
4378
|
+
type: {
|
|
4379
|
+
description: "The type string of list-view-table",
|
|
4380
|
+
type: "string",
|
|
4381
|
+
default: "list-view-table"
|
|
4382
|
+
},
|
|
4383
|
+
appearance: {
|
|
4384
|
+
description: "",
|
|
4385
|
+
type: "object",
|
|
4386
|
+
properties: {
|
|
4387
|
+
class: {
|
|
4388
|
+
type: "string"
|
|
4389
|
+
},
|
|
4390
|
+
style: {
|
|
4391
|
+
type: "string"
|
|
4392
|
+
}
|
|
4393
|
+
},
|
|
4394
|
+
default: {}
|
|
4395
|
+
},
|
|
4396
|
+
binding: {
|
|
4397
|
+
description: "",
|
|
4398
|
+
type: "object",
|
|
4399
|
+
default: {}
|
|
4400
|
+
},
|
|
4401
|
+
disable: {
|
|
4402
|
+
type: "string",
|
|
4403
|
+
default: !1
|
|
4404
|
+
},
|
|
4405
|
+
editable: {
|
|
4406
|
+
description: "",
|
|
4407
|
+
type: "boolean",
|
|
4408
|
+
default: !0
|
|
4409
|
+
},
|
|
4410
|
+
placeholder: {
|
|
4411
|
+
description: "",
|
|
4412
|
+
type: "string",
|
|
4413
|
+
default: ""
|
|
4414
|
+
},
|
|
4415
|
+
readonly: {
|
|
4416
|
+
description: "",
|
|
4417
|
+
type: "boolean",
|
|
4418
|
+
default: !1
|
|
4419
|
+
},
|
|
4420
|
+
require: {
|
|
4421
|
+
description: "",
|
|
4422
|
+
type: "boolean",
|
|
4423
|
+
default: !1
|
|
4424
|
+
},
|
|
4425
|
+
tabindex: {
|
|
4426
|
+
description: "",
|
|
4427
|
+
type: "number",
|
|
4428
|
+
default: -1
|
|
4429
|
+
},
|
|
4430
|
+
visible: {
|
|
4431
|
+
description: "",
|
|
4432
|
+
type: "boolean",
|
|
4433
|
+
default: !0
|
|
4434
|
+
}
|
|
4435
|
+
}, wr = [
|
|
4436
|
+
"id",
|
|
4437
|
+
"type"
|
|
4438
|
+
], Cr = {
|
|
4439
|
+
$schema: pr,
|
|
4440
|
+
$id: gr,
|
|
4441
|
+
title: hr,
|
|
4442
|
+
description: _r,
|
|
4443
|
+
type: yr,
|
|
4444
|
+
properties: br,
|
|
4445
|
+
required: wr
|
|
4446
|
+
}, Sr = "list-view-table", Tr = "A Farris Component", Er = "object", kr = {
|
|
4447
|
+
basic: {
|
|
4448
|
+
description: "Basic Infomation",
|
|
4449
|
+
title: "基本信息",
|
|
4450
|
+
properties: {
|
|
4451
|
+
id: {
|
|
4452
|
+
description: "组件标识",
|
|
4453
|
+
title: "标识",
|
|
4454
|
+
type: "string",
|
|
4455
|
+
readonly: !0
|
|
4456
|
+
},
|
|
4457
|
+
type: {
|
|
4458
|
+
description: "组件类型",
|
|
4459
|
+
title: "控件类型",
|
|
4460
|
+
type: "select",
|
|
4461
|
+
editor: {
|
|
4462
|
+
type: "waiting for modification",
|
|
4463
|
+
enum: []
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
}, Fr = {
|
|
4469
|
+
title: Sr,
|
|
4470
|
+
description: Tr,
|
|
4471
|
+
type: Er,
|
|
4472
|
+
categories: kr
|
|
4473
|
+
}, Mt = {
|
|
4474
|
+
data: { type: Array, default: [] }
|
|
4475
|
+
}, Nt = Yo(Mt, Cr, Tt, Et, Fr), Vt = /* @__PURE__ */ Le({
|
|
4476
|
+
name: "FListViewTableDesign",
|
|
4477
|
+
props: Mt,
|
|
4478
|
+
emits: ["outputValue", "currentEvent", "selectionChanged"],
|
|
4479
|
+
setup(e, t) {
|
|
4480
|
+
const n = [{
|
|
4481
|
+
name: "任芳",
|
|
4482
|
+
code: "1.山东大学",
|
|
4483
|
+
date: "2024-02-19",
|
|
4484
|
+
desc: "山东济南",
|
|
4485
|
+
amount: 63.85,
|
|
4486
|
+
avatar: "./assets/avatar1.png"
|
|
4487
|
+
}, {
|
|
4488
|
+
name: "戴秀兰",
|
|
4489
|
+
code: "2.山东建筑大学",
|
|
4490
|
+
date: "2024-03-17",
|
|
4491
|
+
desc: "山东济南",
|
|
4492
|
+
amount: 60.13,
|
|
4493
|
+
avatar: "./assets/avatar2.png"
|
|
4494
|
+
}, {
|
|
4495
|
+
name: "尹磊",
|
|
4496
|
+
code: "3.山东财经大学",
|
|
4497
|
+
date: "2024-04-09",
|
|
4498
|
+
desc: "山东济南",
|
|
4499
|
+
amount: 36.54,
|
|
4500
|
+
avatar: "./assets/avatar3.png"
|
|
4501
|
+
}, {
|
|
4502
|
+
name: "赵明",
|
|
4503
|
+
code: "4.北京大学",
|
|
4504
|
+
date: "2024-03-27",
|
|
4505
|
+
desc: "北京市",
|
|
4506
|
+
amount: 52.76,
|
|
4507
|
+
avatar: "./assets/avatar4.png"
|
|
4508
|
+
}, {
|
|
4509
|
+
name: "吕洋",
|
|
4510
|
+
code: "5.南京大学",
|
|
4511
|
+
date: "2024-11-17",
|
|
4512
|
+
desc: "江苏南京",
|
|
4513
|
+
amount: 84.13,
|
|
4514
|
+
avatar: "./assets/avatar5.png"
|
|
4515
|
+
}, {
|
|
4516
|
+
name: "吕娥",
|
|
4517
|
+
code: "6.清华大学",
|
|
4518
|
+
date: "2024-03-17",
|
|
4519
|
+
desc: "北京市",
|
|
4520
|
+
amount: 52.76,
|
|
4521
|
+
avatar: "./assets/avatar6.png"
|
|
4522
|
+
}, {
|
|
4523
|
+
name: "赵强",
|
|
4524
|
+
code: "7.浙江大学",
|
|
4525
|
+
date: "2024-08-01",
|
|
4526
|
+
desc: "浙江杭州",
|
|
4527
|
+
amount: 84.13,
|
|
4528
|
+
avatar: "./assets/avatar7.png"
|
|
4529
|
+
}];
|
|
4530
|
+
W(() => e.data.length > 0 ? e.data : n);
|
|
4531
|
+
const o = O(), i = Ye("design-item-context"), a = ut(o, i);
|
|
4532
|
+
return Je(() => {
|
|
4533
|
+
o.value.componentInstance = a;
|
|
4534
|
+
}), t.expose(a.value), () => F("div", {
|
|
4535
|
+
ref: o
|
|
4536
|
+
}, [F("div", {
|
|
4537
|
+
class: "ide-list-view h-100"
|
|
4538
|
+
}, [F("div", {
|
|
4539
|
+
class: "f-list-view"
|
|
4540
|
+
}, [F("div", {
|
|
4541
|
+
class: "f-list-view-content"
|
|
4542
|
+
}, [F("ul", {
|
|
4543
|
+
class: "f-list-view-group"
|
|
4544
|
+
}, [F("li", {
|
|
4545
|
+
class: "ide-list-view-group-item"
|
|
4546
|
+
}, [F("div", {
|
|
4547
|
+
class: "ide-list-content"
|
|
4548
|
+
}, [F("div", {
|
|
4549
|
+
class: "f-template-common-row d-flex"
|
|
4550
|
+
}, [F("div", {
|
|
4551
|
+
class: "item-action-primary"
|
|
4552
|
+
}, [F("img", {
|
|
4553
|
+
class: "ap-img",
|
|
4554
|
+
src: "./assets/avatar1.png",
|
|
4555
|
+
title: "img1"
|
|
4556
|
+
}, null)]), F("div", {
|
|
4557
|
+
class: "listview-item-content d-flex k-align-items-center"
|
|
4558
|
+
}, [F("div", {
|
|
4559
|
+
class: "listview-item-main"
|
|
4560
|
+
}, [F("h4", {
|
|
4561
|
+
class: "listview-item-title"
|
|
4562
|
+
}, null), F("h5", {
|
|
4563
|
+
class: "listview-item-subtitle"
|
|
4564
|
+
}, null)]), F("div", {
|
|
4565
|
+
class: "listview-item-btns"
|
|
4566
|
+
}, [F("button", {
|
|
4567
|
+
class: "btn btn-link"
|
|
4568
|
+
}, [ke(" "), "编辑"]), F("button", {
|
|
4569
|
+
class: "btn btn-link"
|
|
4570
|
+
}, [ke(" "), "删除"])])])])])]), F("li", {
|
|
4571
|
+
class: "ide-list-view-group-item"
|
|
4572
|
+
}, [F("div", {
|
|
4573
|
+
class: "ide-list-content"
|
|
4574
|
+
}, [F("div", {
|
|
4575
|
+
class: "f-template-common-row d-flex"
|
|
4576
|
+
}, [F("div", {
|
|
4577
|
+
class: "item-action-primary"
|
|
4578
|
+
}, [F("img", {
|
|
4579
|
+
class: "ap-img",
|
|
4580
|
+
src: "./assets/avatar2.png",
|
|
4581
|
+
title: "img2"
|
|
4582
|
+
}, null)]), F("div", {
|
|
4583
|
+
class: "listview-item-content d-flex k-align-items-center"
|
|
4584
|
+
}, [F("div", {
|
|
4585
|
+
class: "listview-item-main"
|
|
4586
|
+
}, [F("h4", {
|
|
4587
|
+
class: "listview-item-title"
|
|
4588
|
+
}, null), F("h5", {
|
|
4589
|
+
class: "listview-item-subtitle"
|
|
4590
|
+
}, null)]), F("div", {
|
|
4591
|
+
class: "listview-item-btns"
|
|
4592
|
+
}, [F("button", {
|
|
4593
|
+
class: "btn btn-link"
|
|
4594
|
+
}, [ke(" "), "编辑"]), F("button", {
|
|
4595
|
+
class: "btn btn-link"
|
|
4596
|
+
}, ["删除"])])])])])]), F("li", {
|
|
4597
|
+
class: "ide-list-view-group-item"
|
|
4598
|
+
}, [F("div", {
|
|
4599
|
+
class: "ide-list-content"
|
|
4600
|
+
}, [F("div", {
|
|
4601
|
+
class: "f-template-common-row d-flex"
|
|
4602
|
+
}, [F("div", {
|
|
4603
|
+
class: "item-action-primary"
|
|
4604
|
+
}, [F("img", {
|
|
4605
|
+
class: "ap-img",
|
|
4606
|
+
src: "./assets/avatar3.png",
|
|
4607
|
+
title: "img3"
|
|
4608
|
+
}, null)]), F("div", {
|
|
4609
|
+
class: "listview-item-content d-flex k-align-items-center"
|
|
4610
|
+
}, [F("div", {
|
|
4611
|
+
class: "listview-item-main"
|
|
4612
|
+
}, [F("h4", {
|
|
4613
|
+
class: "listview-item-title"
|
|
4614
|
+
}, null), F("h5", {
|
|
4615
|
+
class: "listview-item-subtitle"
|
|
4616
|
+
}, null)]), F("div", {
|
|
4617
|
+
class: "listview-item-btns"
|
|
4618
|
+
}, [F("button", {
|
|
4619
|
+
class: "btn btn-link"
|
|
4620
|
+
}, [ke(" "), "编辑"]), F("button", {
|
|
4621
|
+
class: "btn btn-link"
|
|
4622
|
+
}, ["删除"])])])])])])])])])])]);
|
|
4623
|
+
}
|
|
4624
|
+
}), $e = /* @__PURE__ */ Le({
|
|
4625
|
+
name: "FListViewDesign",
|
|
4626
|
+
props: kt,
|
|
4627
|
+
emits: ["checkValuesChange", "clickItem", "selectionChange", "removeItem", "change"],
|
|
4628
|
+
setup(e, t) {
|
|
4629
|
+
const n = O(), o = O(!0), i = O(!1), a = O([]), r = 0, c = O(e.columns), m = Wn(e, t), d = co(e), u = Yn(e), s = dt(e, d), l = $n(e, /* @__PURE__ */ new Map(), m, u, d), b = fo(e, l, d, a, t), f = In(e, n), w = O(), C = Ye("designer-host-service"), T = Ye("design-item-context"), S = mr(T, C), y = ut(w, T, S), g = W(() => l.dataView.value.length), v = uo(e, t, b, d), p = lo(e, t, d, v), _ = Jn(e), E = ro(e, {}, _), h = io(e, l, p, u, d, _, E), B = ao(e, d, E, h), Y = so(e, d, E, h), M = Xn(e, c, l, g, r, h, B, Y), {
|
|
4630
|
+
getVisualData: L
|
|
4631
|
+
} = M;
|
|
4632
|
+
a.value = L(0, g.value + r - 1), Je(() => {
|
|
4633
|
+
w.value.componentInstance = y;
|
|
4634
|
+
}), t.expose(y.value);
|
|
4635
|
+
const D = W(() => {
|
|
4636
|
+
const J = {
|
|
4637
|
+
"f-list-view": !0,
|
|
4638
|
+
"f-list-view-multiple": e.multiSelect,
|
|
4639
|
+
"w-100": !0,
|
|
4640
|
+
"h-100": !0
|
|
4641
|
+
};
|
|
4642
|
+
return e.size !== "default" && (J[`${e.size}-item`] = !0), J;
|
|
4643
|
+
}), x = W(() => !!t.slots.footer || o.value);
|
|
4644
|
+
function k() {
|
|
4645
|
+
return e.header === "SearchBar" ? at : e.header === "ContentHeader" ? _o : at;
|
|
4646
|
+
}
|
|
4647
|
+
const $ = k(), {
|
|
4648
|
+
renderHeader: A
|
|
4649
|
+
} = $(e, t, f), Q = yo(), ne = bo(e, t, l, Q), I = wo(e, t, a, ne, Q, b);
|
|
4650
|
+
ho(e, t, a, l, s, Q, b, M, I, ne);
|
|
4651
|
+
function z(J) {
|
|
4652
|
+
e.multiSelect && (J.preventDefault(), J.stopPropagation());
|
|
4653
|
+
}
|
|
4654
|
+
return () => F("div", {
|
|
4655
|
+
ref: w,
|
|
4656
|
+
class: D.value,
|
|
4657
|
+
onClick: z
|
|
4658
|
+
}, [A(), F("div", {
|
|
4659
|
+
ref: n,
|
|
4660
|
+
class: "f-list-view-content",
|
|
4661
|
+
onMouseover: () => {
|
|
4662
|
+
i.value = !0;
|
|
4663
|
+
},
|
|
4664
|
+
onMouseleave: () => {
|
|
4665
|
+
i.value = !1;
|
|
4666
|
+
}
|
|
4667
|
+
}, [F(Vt, null, null)]), x.value && F("div", {
|
|
4668
|
+
class: "f-list-view-footer"
|
|
4669
|
+
}, [t.slots.footer && t.slots.footer()])]);
|
|
4670
|
+
}
|
|
4671
|
+
}), Mr = fn();
|
|
4672
|
+
$e.register = (e, t, n, o) => {
|
|
4673
|
+
e["list-view"] = sn, t["list-view"] = Ft, e["list-view-table"] = cn, t["list-view-table"] = Nt, o["list-view"] = { bindingResolver: Mr };
|
|
4674
|
+
};
|
|
4675
|
+
$e.registerDesigner = (e, t, n) => {
|
|
4676
|
+
e["list-view"] = $e, t["list-view"] = Ft, e["list-view-table"] = Vt, t["list-view-table"] = Nt;
|
|
4677
|
+
};
|
|
4678
|
+
const oi = an($e);
|
|
4679
|
+
export {
|
|
4680
|
+
$e as FListViewDesign,
|
|
4681
|
+
Mr as bindingResolver,
|
|
4682
|
+
oi as default,
|
|
4683
|
+
kt as listViewDesignProps,
|
|
4684
|
+
Ft as propsResolver
|
|
4685
|
+
};
|