@hzab/list-render 1.12.3-alpha.3 → 1.12.4
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/CHANGELOG.md +0 -6
- package/README.md +612 -0
- package/docs/effect.md +2 -0
- package/docs/form-linkage.md +293 -0
- package/docs/remote-data.md +124 -0
- package/docs/table.md +86 -0
- package/package.json +73 -77
- package/src/FilterTag/index.tsx +5 -4
- package/src/FormModal/index.tsx +1 -1
- package/src/components/Formily/FormilyEditTable.tsx +3 -3
- package/src/components/Formily/FormilyField.tsx +4 -5
- package/src/components/PrefixNode/index.tsx +4 -4
- package/src/components/Tags/index.tsx +4 -4
- package/LICENSE +0 -21
- package/dist/FilterTag/index.d.ts +0 -3
- package/dist/FormModal/index.d.ts +0 -19
- package/dist/common/cloneSchema.d.ts +0 -7
- package/dist/common/constant.d.ts +0 -2
- package/dist/common/handleQuerySchema.d.ts +0 -165
- package/dist/components/Formily/FormilyEditTable.d.ts +0 -94
- package/dist/components/Formily/FormilyField.d.ts +0 -10
- package/dist/components/PrefixNode/index.d.ts +0 -21
- package/dist/components/Tags/index.d.ts +0 -16
- package/dist/index.cjs +0 -1
- package/dist/index.css +0 -2
- package/dist/index.js +0 -1660
- package/src/vite-env.d.ts +0 -1
package/dist/index.js
DELETED
|
@@ -1,1660 +0,0 @@
|
|
|
1
|
-
import { forwardRef as e, memo as t, useCallback as n, useEffect as r, useImperativeHandle as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
-
import { Button as c, Card as l, Checkbox as u, Drawer as d, Empty as f, Form as p, Modal as m, Pagination as h, Popconfirm as g, Popover as _, Rate as v, Slider as y, Spin as b, Table as x, Tag as S, Tooltip as C, message as w } from "antd";
|
|
3
|
-
import T, { cloneDeep as E, isFunction as D } from "lodash";
|
|
4
|
-
import O, { getCancelTokenSource as k, isCancel as ee } from "@hzab/data-model/src/axios";
|
|
5
|
-
import A from "dayjs";
|
|
6
|
-
import te, { antdComponents as j, customComponents as ne } from "@hzab/form-render";
|
|
7
|
-
import { cloneSchema as M } from "@hzab/utils/src/formily/cloneSchema";
|
|
8
|
-
import { getScopeKeyVal as N, handleSchemaStrVal as P, isRunStr as F, isScopeKey as I } from "@hzab/form-render/src/common/schema-handler";
|
|
9
|
-
import { autorun as L, observable as R } from "@formily/reactive";
|
|
10
|
-
import { Schema as z } from "@formily/json-schema";
|
|
11
|
-
import B from "dayjs/plugin/advancedFormat";
|
|
12
|
-
import V from "dayjs/plugin/weekOfYear";
|
|
13
|
-
import { FormConsumer as H, FormProvider as re, createSchemaField as U, observer as ie, useField as ae, useFieldSchema as W } from "@formily/react";
|
|
14
|
-
import { Fragment as oe, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
15
|
-
import { c as q } from "react/compiler-runtime";
|
|
16
|
-
import { CheckOutlined as J, CloseOutlined as se, EditOutlined as Y, FilterOutlined as X, MenuOutlined as ce, QuestionCircleOutlined as Z, SettingOutlined as le } from "@ant-design/icons";
|
|
17
|
-
import { SortableContainer as ue, SortableElement as de, SortableHandle as fe } from "react-sortable-hoc";
|
|
18
|
-
import { arrayMoveImmutable as pe } from "array-move";
|
|
19
|
-
import { createForm as me, onFieldValueChange as he, onFormValuesChange as ge } from "@formily/core";
|
|
20
|
-
import _e from "@hzab/formily-result-utils/src/components/EnumRender";
|
|
21
|
-
import { SHOW_MODE_TYPES as ve } from "@hzab/formily-result-utils/src/common/constant";
|
|
22
|
-
import ye from "@hzab/edit-table";
|
|
23
|
-
import { Form as Q } from "c-formily-antd";
|
|
24
|
-
import be from "@hzab/schema-descriptions";
|
|
25
|
-
import { getVal as $ } from "@hzab/utils/src/formily/field";
|
|
26
|
-
export * from "@hzab/data-model";
|
|
27
|
-
//#region src/common/constant.ts
|
|
28
|
-
var xe = "defaultSearchParams", Se = [
|
|
29
|
-
"Input",
|
|
30
|
-
"Select",
|
|
31
|
-
"DatePicker.RangePicker",
|
|
32
|
-
"DatePicker"
|
|
33
|
-
];
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/common/formily-utils.jsx
|
|
36
|
-
function Ce(e) {
|
|
37
|
-
return function(...t) {
|
|
38
|
-
let n = ie(function() {
|
|
39
|
-
return e(...t);
|
|
40
|
-
});
|
|
41
|
-
return /* @__PURE__ */ G(n, {});
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
var we = function(e = "", t = {}) {
|
|
45
|
-
if (typeof e != "string" || !e.startsWith("{{")) return e;
|
|
46
|
-
let n = e.replace(/^\{\{/, "").replace(/\}\}$/, "");
|
|
47
|
-
return t?.scope?.[n] || Ee(n, t);
|
|
48
|
-
};
|
|
49
|
-
function Te(e = "", t) {
|
|
50
|
-
return typeof e != "string" || !e.startsWith("{{") ? e : Ee(e.replace(/^\{\{/, "").replace(/\}\}$/, ""), t);
|
|
51
|
-
}
|
|
52
|
-
function Ee(e = "", t = {}) {
|
|
53
|
-
let n = {
|
|
54
|
-
$observable: R,
|
|
55
|
-
$memo: L.memo,
|
|
56
|
-
$effect: L.effect,
|
|
57
|
-
scope: {},
|
|
58
|
-
...t
|
|
59
|
-
}, r = Function("opt", `const { ${Object.keys(n).join(", ")} } = opt || {}; const {${Object.keys(n.scope || {}).join(", ")}} = scope || {}; return ${e}; `);
|
|
60
|
-
return function(e) {
|
|
61
|
-
return r.call(this, {
|
|
62
|
-
$observable: R,
|
|
63
|
-
$memo: L.memo,
|
|
64
|
-
$effect: L.effect,
|
|
65
|
-
...e
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
A.extend(B), A.extend(V);
|
|
70
|
-
var De = {
|
|
71
|
-
time: "YYYY-MM-DD HH:mm:ss",
|
|
72
|
-
date: "YYYY-MM-DD",
|
|
73
|
-
week: "YYYY年 w周",
|
|
74
|
-
quarter: "YYYY年 Q季度",
|
|
75
|
-
month: "YYYY-MM",
|
|
76
|
-
year: "YYYY"
|
|
77
|
-
};
|
|
78
|
-
function Oe(e = {}, t = {}, n = {}) {
|
|
79
|
-
let {} = n, r = T.get(t, e.name), {} = e || {}, i = e["x-component"], a = e["x-component-props"] || {};
|
|
80
|
-
if (r && (i === "DatePicker" || i === "DatePicker.RangePicker")) {
|
|
81
|
-
let { picker: e, showTime: t } = a || {}, i = t === !0 ? "time" : e || "date", o = n.dateFormatEnum || De, s = a?.format || o[i];
|
|
82
|
-
return Array.isArray(r) ? r.map((e) => ke(e, s)).join(" ~ ") : ke(r, s);
|
|
83
|
-
}
|
|
84
|
-
if (r && (i === "TimePicker" || i === "TimePicker.RangePicker")) {
|
|
85
|
-
let e = a?.format || "HH:mm:ss";
|
|
86
|
-
return Array.isArray(r) ? r.map((t) => A(t).format(e)).join(" ~ ") : A(r).format(e);
|
|
87
|
-
}
|
|
88
|
-
if (i === "Switch") return r === void 0 || r === !1 || r === e.inactiveValue ? e.inactiveText || "否" : r === !0 || r === e.activeValue ? e.activeText || "是" : r;
|
|
89
|
-
if (typeof e.relation == "object") {
|
|
90
|
-
let { key: n, name: r, label: i } = e.relation;
|
|
91
|
-
return t[n]?.[r];
|
|
92
|
-
}
|
|
93
|
-
let o = e?.dataSource || e.enum;
|
|
94
|
-
if ((i === "Select" || i === "Radio.Group" || i === "Checkbox.Group") && Array.isArray(o)) {
|
|
95
|
-
if (!Array.isArray(r)) return Pe(r, e, n)?.label || r;
|
|
96
|
-
if (Array.isArray(r)) {
|
|
97
|
-
let t = [];
|
|
98
|
-
r.forEach((i) => {
|
|
99
|
-
t.push(Pe(r, e, n)?.label || i);
|
|
100
|
-
}), r = t;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return Array.isArray(r) ? r.join("、") : r;
|
|
104
|
-
}
|
|
105
|
-
function ke(e, t) {
|
|
106
|
-
return A(e).format(t);
|
|
107
|
-
}
|
|
108
|
-
var Ae = (e) => {
|
|
109
|
-
e?.forEach((e) => {
|
|
110
|
-
e?.type == "object" && !e?.["x-component"] && (e.children = z.getOrderProperties(e)?.map((e) => e?.schema), e.children?.length > 0 && Ae(e.children));
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
function je(e, t = [], n = {}, r = !1) {
|
|
114
|
-
let i = M(e?.schema || e), a = z.getOrderProperties(i), { boxList: o = [] } = n || {}, s = ["FormGrid", "FormGrid.GridColumn"];
|
|
115
|
-
return Array.isArray(o) ? s = [...s, ...o] : o === !1 && (s = []), i?.properties && a.forEach((e) => {
|
|
116
|
-
let r = { ...e.schema };
|
|
117
|
-
r.name ||= e.key;
|
|
118
|
-
let i = r["x-component"];
|
|
119
|
-
typeof r.title == "string" && r.title.startsWith("{{") && (r.title = we(r.title, { scope: n.schemaScope }), typeof r.title == "function" && (r.title = r.title({
|
|
120
|
-
...n,
|
|
121
|
-
scope: n.schemaScope,
|
|
122
|
-
scenario: "listRender",
|
|
123
|
-
$self: r,
|
|
124
|
-
$effect: L.effect,
|
|
125
|
-
$observable: R,
|
|
126
|
-
$memo: L.memo,
|
|
127
|
-
$props: { formilyRef: n.formilyRef }
|
|
128
|
-
}))), s.includes(i) ? je(r, t, n) : t.push(r), r?.type == "object" && !r?.["x-component"] && (r.children = z.getOrderProperties(r)?.map((e) => e?.schema), r.children?.length > 0 && Ae(r.children));
|
|
129
|
-
}), r && t.sort((e, t) => e["x-index"] - t["x-index"]), t;
|
|
130
|
-
}
|
|
131
|
-
function Me(e, t = {}) {
|
|
132
|
-
let n = e?.schema || e;
|
|
133
|
-
return n?.properties && Object.keys(n?.properties).forEach((e) => {
|
|
134
|
-
let r = n?.properties[e];
|
|
135
|
-
r["x-component"] === "FormGrid" || r["x-component"] === "FormGrid.GridColumn" ? Me(r, t) : t[e] = r;
|
|
136
|
-
}), t;
|
|
137
|
-
}
|
|
138
|
-
function Ne(e) {
|
|
139
|
-
let t = new FormData();
|
|
140
|
-
return Object.keys(e)?.forEach((n) => {
|
|
141
|
-
t.set(n, e[n]);
|
|
142
|
-
}), t;
|
|
143
|
-
}
|
|
144
|
-
var Pe = function(e, t, n) {
|
|
145
|
-
return t ? Fe(e, Array.isArray(t.enum) ? t.enum : Array.isArray(t.options) ? t.options : t.dataSource || [], {
|
|
146
|
-
fieldNames: t.fieldNames || t["x-component-props"]?.fieldNames,
|
|
147
|
-
...n
|
|
148
|
-
}) : {};
|
|
149
|
-
}, Fe = function(e, t, n) {
|
|
150
|
-
let { fieldNames: r } = n || {}, { value: i = "value", label: a = "label", children: o = "children" } = r || {};
|
|
151
|
-
for (let r = 0; r < t.length; r++) {
|
|
152
|
-
let s = t[r];
|
|
153
|
-
if (s?.[i] === e) return {
|
|
154
|
-
...s,
|
|
155
|
-
value: s?.[i],
|
|
156
|
-
label: s?.[a],
|
|
157
|
-
children: s?.[o]
|
|
158
|
-
};
|
|
159
|
-
let c = s?.[o];
|
|
160
|
-
if (Array.isArray(c) && c.length > 0) {
|
|
161
|
-
let t = Fe(e, c, n);
|
|
162
|
-
return {
|
|
163
|
-
...t,
|
|
164
|
-
value: t?.[i],
|
|
165
|
-
label: t?.[a],
|
|
166
|
-
children: t?.[o]
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
function Ie(e, t = {}) {
|
|
172
|
-
let n = M(e), r = n?.schema || n, { boxList: i = [] } = t, a = i === !1 ? [] : [
|
|
173
|
-
"Card",
|
|
174
|
-
"FormGrid",
|
|
175
|
-
"ArrayCards",
|
|
176
|
-
"Collapse",
|
|
177
|
-
"Tabs",
|
|
178
|
-
"FormGrid.GridColumn",
|
|
179
|
-
...Array.isArray(i) ? i : []
|
|
180
|
-
], o = (e) => {
|
|
181
|
-
!e || typeof e != "object" || Object.keys(e).forEach((t) => {
|
|
182
|
-
let n = e[t];
|
|
183
|
-
n["x-component"] && a.includes(n["x-component"]) ? n.properties && o(n.properties) : n.items?.properties ? o(n.items.properties) : n.inTable === !1 ? delete e[t] : n["x-display"] && delete n["x-display"];
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
return r.properties && o(r.properties), n.form && (delete n.form.labelCol, delete n.form.wrapperCol), n;
|
|
187
|
-
}
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/common/handleQuerySchema.ts
|
|
190
|
-
var Le = (e) => {
|
|
191
|
-
let { schema: t, search: n, filters: r, onSearch: i, replaceComList: a, schemaScope: o } = e || {}, s = {}, c = 0;
|
|
192
|
-
n && (s.search = Re({
|
|
193
|
-
search: n,
|
|
194
|
-
onSearch: i,
|
|
195
|
-
index: c
|
|
196
|
-
}), c += 1);
|
|
197
|
-
let l = Me(M(t));
|
|
198
|
-
return r?.forEach((t) => {
|
|
199
|
-
let n = l[t];
|
|
200
|
-
if (n) {
|
|
201
|
-
let r = n["x-component"], i = a?.find((e) => e.name === t || !e.name && e.component === r), l = {
|
|
202
|
-
...n,
|
|
203
|
-
...i,
|
|
204
|
-
required: !1,
|
|
205
|
-
"x-index": c,
|
|
206
|
-
"x-display": "visible"
|
|
207
|
-
}, u = l["x-component-props"];
|
|
208
|
-
u ? Ke(u) && (l["x-component-props"] = Ye(u, o) || {}) : l["x-component-props"] = {}, typeof l["x-component-props"].allowClear != "boolean" && (l["x-component-props"].allowClear = !0), Be(l, e), ze(l, e), Ve(l, e), Ue(l, e), s[t] = l, c += 1;
|
|
209
|
-
} else t === "$timerange" && (s[t] = He({
|
|
210
|
-
index: c,
|
|
211
|
-
key: t
|
|
212
|
-
}), c += 1);
|
|
213
|
-
}), {
|
|
214
|
-
form: { layout: "inline" },
|
|
215
|
-
schema: {
|
|
216
|
-
type: "object",
|
|
217
|
-
properties: s,
|
|
218
|
-
"x-designable-id": "querySchema"
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
}, Re = (e) => {
|
|
222
|
-
let { search: t, onSearch: n, index: r } = e || {};
|
|
223
|
-
return Ge({
|
|
224
|
-
type: "string",
|
|
225
|
-
title: "",
|
|
226
|
-
"x-decorator": "FormItem",
|
|
227
|
-
"x-component": "Input",
|
|
228
|
-
"x-validator": [],
|
|
229
|
-
"x-component-props": {
|
|
230
|
-
allowClear: !0,
|
|
231
|
-
placeholder: t,
|
|
232
|
-
onPressEnter: n
|
|
233
|
-
},
|
|
234
|
-
"x-decorator-props": {},
|
|
235
|
-
"x-designable-id": "searchInput",
|
|
236
|
-
"x-index": r,
|
|
237
|
-
name: "search",
|
|
238
|
-
description: ""
|
|
239
|
-
}, e);
|
|
240
|
-
}, ze = (e, t) => {
|
|
241
|
-
let { selectList: n = [], isSelectSearch: r = !0 } = t || {}, i = [
|
|
242
|
-
"Select",
|
|
243
|
-
"Radio.Group",
|
|
244
|
-
"Checkbox.Group",
|
|
245
|
-
...n
|
|
246
|
-
], a = e["x-component"];
|
|
247
|
-
return i.includes(a) && (e["x-component"] = "Select", e["x-component-props"].showSearch = r), e;
|
|
248
|
-
}, Be = (e, t) => {
|
|
249
|
-
let { inputList: n = [] } = t || {}, r = ["NumberPicker", ...n], i = e["x-component"];
|
|
250
|
-
return r.includes(i) && (e["x-component"] = "Input"), e;
|
|
251
|
-
}, Ve = (e, t) => {
|
|
252
|
-
let { isRmDefault: n, isRmValidator: r } = t || {};
|
|
253
|
-
return n && (e.default = void 0, e["x-component-props"].defaultValue = void 0), r && (e["x-validator"] = []), e;
|
|
254
|
-
}, He = ({ key: e, index: t }) => ({
|
|
255
|
-
type: "string[]",
|
|
256
|
-
title: "时间范围",
|
|
257
|
-
"x-decorator": "FormItem",
|
|
258
|
-
"x-component": "DatePicker.RangePicker",
|
|
259
|
-
"x-validator": [],
|
|
260
|
-
"x-component-props": {
|
|
261
|
-
picker: "date",
|
|
262
|
-
showTime: !0,
|
|
263
|
-
allowClear: !0
|
|
264
|
-
},
|
|
265
|
-
"x-decorator-props": {},
|
|
266
|
-
name: e,
|
|
267
|
-
"x-designable-id": e,
|
|
268
|
-
"x-index": t
|
|
269
|
-
}), Ue = (e, t) => {
|
|
270
|
-
let { isEnterSubmit: n = !0, isChangeSubmit: r = !0, onSearch: i, customSubmitList: a } = t || {}, o = e["x-component"], s = e["x-component-props"], c = [
|
|
271
|
-
"Select",
|
|
272
|
-
"Cascader",
|
|
273
|
-
"TreeSelect",
|
|
274
|
-
"DatePicker",
|
|
275
|
-
"DatePicker.RangePicker",
|
|
276
|
-
"TimePicker",
|
|
277
|
-
"TimePicker.RangePicker"
|
|
278
|
-
];
|
|
279
|
-
if (n && o === "Input") {
|
|
280
|
-
let n = Je(s?.onPressEnter, t);
|
|
281
|
-
e["x-component-props"].onPressEnter = function(e, ...t) {
|
|
282
|
-
e?.preventDefault && e?.preventDefault();
|
|
283
|
-
let r = n && n(e, ...t);
|
|
284
|
-
return i && i(), r;
|
|
285
|
-
}, Ge(e, t);
|
|
286
|
-
} else r && c.includes(o) && (e["x-component-props"].onChange = We(s?.onChange, i, t));
|
|
287
|
-
let l = a?.find((e) => e.component === o);
|
|
288
|
-
l && (e["x-component-props"][l.event] = We(s[l.event], i, t));
|
|
289
|
-
}, We = (e, t, n) => async function(...r) {
|
|
290
|
-
let { schemaScope: i } = n, a = Je(e, i), o = null;
|
|
291
|
-
return F(e) && (a = P(e, i)), I(e, i) && (a = N(e, i)), a && (o = await a(...r)), t && t(...r), o;
|
|
292
|
-
}, Ge = (e, t) => {
|
|
293
|
-
let { onSearch: n, schemaScope: r } = t || {}, i = Je(e["x-component-props"]?.onChange, r);
|
|
294
|
-
return e["x-component-props"].onChange = function(e, ...t) {
|
|
295
|
-
let r = i && i(e, ...t);
|
|
296
|
-
return e.type === "click" && e.target?.value === "" && n(), r;
|
|
297
|
-
}, e;
|
|
298
|
-
}, Ke = (e) => {
|
|
299
|
-
if (typeof e != "string") return !1;
|
|
300
|
-
let t = e.trim();
|
|
301
|
-
return t.startsWith("{{") && t.endsWith("}}");
|
|
302
|
-
}, qe = (e) => Ke(e) ? e.trim().replace(/^\{\{/, "").replace(/\}\}$/, "") : "", Je = (e, t = {}) => {
|
|
303
|
-
let n = Ye(e, t);
|
|
304
|
-
return !T.isNil(n) && n !== "" ? n : e;
|
|
305
|
-
}, Ye = (e, t = {}) => {
|
|
306
|
-
if (Ke(e)) return t && t[qe(e)];
|
|
307
|
-
};
|
|
308
|
-
function Xe(e) {
|
|
309
|
-
return T.pickBy(e, (e) => !(e == null || T.isString(e) && e.trim() === "" || T.isArray(e) && e.length === 0));
|
|
310
|
-
}
|
|
311
|
-
function Ze(e, t = xe) {
|
|
312
|
-
try {
|
|
313
|
-
if (typeof window > "u") return;
|
|
314
|
-
let [n, r = ""] = window.location.href.split("#"), [i, a = ""] = r.split("?"), o = new URLSearchParams(a), s = T.cloneDeep(Xe(e)), c = encodeURIComponent(JSON.stringify(s));
|
|
315
|
-
o.set(t, c);
|
|
316
|
-
let l = `${i}?${o.toString()}`;
|
|
317
|
-
window.history.replaceState({}, "", `${n}#${l}`);
|
|
318
|
-
} catch (e) {
|
|
319
|
-
console.error("[setURLObjectQueryParam] 设置失败:", e);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function Qe(e, t, n) {
|
|
323
|
-
if (!(typeof window > "u")) try {
|
|
324
|
-
let [r, i = ""] = window.location.href.split("#"), [a, o = ""] = i.split("?"), s = new URLSearchParams(o), c = s.get(e);
|
|
325
|
-
if (c == null) return;
|
|
326
|
-
let l;
|
|
327
|
-
try {
|
|
328
|
-
l = JSON.parse(decodeURIComponent(c));
|
|
329
|
-
} catch {
|
|
330
|
-
console.error("[removeURLObjectQueryParam] 序列化URL参数错误");
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
if (n && e) s.delete(e);
|
|
334
|
-
else if (l && typeof l == "object" && !Array.isArray(l)) {
|
|
335
|
-
let n = l;
|
|
336
|
-
(t || n[t] === "" || n[t] === void 0 || n[t] === null) && delete n[t], Object.keys(n).length === 0 ? s.delete(e) : s.set(e, encodeURIComponent(JSON.stringify(n)));
|
|
337
|
-
} else return;
|
|
338
|
-
let u = a, d = s.toString();
|
|
339
|
-
d && (u += `?${d}`);
|
|
340
|
-
let f = `${r}${u ? `#${u}` : ""}`;
|
|
341
|
-
window.history.replaceState({}, "", f);
|
|
342
|
-
} catch (e) {
|
|
343
|
-
console.error("[removeURLObjectQueryParam] 删除失败:", e);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
function $e(e = xe) {
|
|
347
|
-
if (typeof window > "u") return {};
|
|
348
|
-
let [, t = ""] = window.location.href.split("#"), [, n = ""] = t.split("?"), r = new URLSearchParams(n).get(e);
|
|
349
|
-
if (!r) return null;
|
|
350
|
-
try {
|
|
351
|
-
return JSON.parse(decodeURIComponent(r));
|
|
352
|
-
} catch (e) {
|
|
353
|
-
return console.error("[getURLObjectQueryParam] 解析失败:", e), {};
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
var et = (e) => e?.schema?.properties ?? {}, tt = (e, t) => typeof e == "string" && t.includes(e), nt = (e, t) => {
|
|
357
|
-
let n = new Set(t);
|
|
358
|
-
return Object.entries(e).filter(([e]) => n.has(e));
|
|
359
|
-
}, rt = (e, t, n) => e?.["x-component-props"]?.[t] === n, it = (e, t, n) => {
|
|
360
|
-
let r = e ?? {}, i = Object.prototype.hasOwnProperty.call(r, t), a = Object.prototype.hasOwnProperty.call(r, n);
|
|
361
|
-
if (!(!i && !a)) return [r[t], r[n]];
|
|
362
|
-
};
|
|
363
|
-
function at(e, t, n, r = {}) {
|
|
364
|
-
let { splitFlag: i = "isSplitTimes", splitFlagExpectedValue: a = !0, defaultStartKey: o = "startTime", defaultEndKey: s = "endTime", antdDateComponents: c = ["DatePicker", "DatePicker.RangePicker"], removeMatchedKeys: l = !0 } = r, u = nt(et(t), e), d = T.cloneDeep(n), f = /* @__PURE__ */ new Set();
|
|
365
|
-
for (let [e, t] of u) {
|
|
366
|
-
if (!tt(t?.["x-component"], c) || !rt(t, i, a)) continue;
|
|
367
|
-
let n = t?.["x-component-props"] ?? {}, r = n?.startKey || o, u = n?.endKey || s, p = it(d, r, u);
|
|
368
|
-
p && (d[e] = p, l && (Object.prototype.hasOwnProperty.call(d, r) && f.add(r), Object.prototype.hasOwnProperty.call(d, u) && f.add(u)));
|
|
369
|
-
}
|
|
370
|
-
if (l) for (let e of f) delete d[e];
|
|
371
|
-
return d;
|
|
372
|
-
}
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region src/query-render/index.jsx
|
|
375
|
-
function ot(e, t) {
|
|
376
|
-
let [n, a] = s({}), l = o();
|
|
377
|
-
i(t, () => ({ formRef: l })), r(() => {
|
|
378
|
-
a(Le({
|
|
379
|
-
...e?.config,
|
|
380
|
-
schemaScope: {
|
|
381
|
-
...e.schemaScope,
|
|
382
|
-
scenario: "query"
|
|
383
|
-
},
|
|
384
|
-
schema: M(e.schema),
|
|
385
|
-
search: e.search,
|
|
386
|
-
filters: T.cloneDeep(e.filters),
|
|
387
|
-
onSearch: u
|
|
388
|
-
}));
|
|
389
|
-
}, [
|
|
390
|
-
e.search,
|
|
391
|
-
e.filters,
|
|
392
|
-
e.schema,
|
|
393
|
-
e.schema?.schema
|
|
394
|
-
]);
|
|
395
|
-
async function u() {
|
|
396
|
-
let t = T.cloneDeep(l?.current?.formRender?.values);
|
|
397
|
-
if (e.filters?.includes("$timerange") && (t.$timerange?.[0] instanceof A ? (t.beginTime = t.$timerange?.[0]?.format("YYYY-MM-DD HH:mm:ss"), t.endTime = t.$timerange?.[1]?.format("YYYY-MM-DD HH:mm:ss")) : (t.beginTime = t.$timerange?.[0], t.endTime = t.$timerange?.[1]), delete t.$timerange), e.config?.queryMap && (t = e.config?.queryMap(t)), !(e.config?.beforeQuerySearch && typeof e.config?.beforeQuerySearch == "function" && !await Promise.resolve(e.config?.beforeQuerySearch?.(t)))) return e.onSearch && e.onSearch(t);
|
|
398
|
-
}
|
|
399
|
-
function d() {
|
|
400
|
-
l.current?.formRender?.reset(), e.onSearch && e.onSearch(T.cloneDeep(l?.current?.formRender?.values), !0);
|
|
401
|
-
}
|
|
402
|
-
return /* @__PURE__ */ G("div", {
|
|
403
|
-
className: "query-render",
|
|
404
|
-
children: Object.keys(n?.schema?.properties || {}).length > 0 ? /* @__PURE__ */ G(oe, { children: /* @__PURE__ */ G(te, {
|
|
405
|
-
ref: l,
|
|
406
|
-
layout: "inline",
|
|
407
|
-
schema: n,
|
|
408
|
-
schemaScope: {
|
|
409
|
-
scenario: "query",
|
|
410
|
-
...e.schemaScope || {}
|
|
411
|
-
},
|
|
412
|
-
initialValues: e.queryFormInitialValues,
|
|
413
|
-
onFieldValueChange: e.onFieldValueChange,
|
|
414
|
-
Slots: () => /* @__PURE__ */ K("div", {
|
|
415
|
-
className: "query-operation",
|
|
416
|
-
children: [/* @__PURE__ */ G(c, {
|
|
417
|
-
className: "query-btn",
|
|
418
|
-
type: "primary",
|
|
419
|
-
onClick: u,
|
|
420
|
-
children: "搜索"
|
|
421
|
-
}), e.config?.hasReset && /* @__PURE__ */ G(c, {
|
|
422
|
-
className: "query-btn",
|
|
423
|
-
onClick: d,
|
|
424
|
-
children: "重置"
|
|
425
|
-
})]
|
|
426
|
-
}),
|
|
427
|
-
components: e.components
|
|
428
|
-
}) }) : null
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
var st = e(ot);
|
|
432
|
-
//#endregion
|
|
433
|
-
//#region src/pagination-render/index.jsx
|
|
434
|
-
function ct(e) {
|
|
435
|
-
let t = q(25), { config: n } = e, i;
|
|
436
|
-
t[0] === n ? i = t[1] : (i = n || {}, t[0] = n, t[1] = i);
|
|
437
|
-
let { isAllSelect: a } = i, o = a !== void 0 && a, [c, l] = s(e.query?.pageSize || e.pageSizeOptions[0]), [u, d] = s(e.query?.pageNum || 1), f;
|
|
438
|
-
t[2] !== u || t[3] !== c || t[4] !== e ? (f = () => {
|
|
439
|
-
let { query: t } = e;
|
|
440
|
-
t && (t.pageSize && t.pageSize !== c && l(t.pageSize), t.pageNum && t.pageNum !== u && d(t.pageNum));
|
|
441
|
-
}, t[2] = u, t[3] = c, t[4] = e, t[5] = f) : f = t[5];
|
|
442
|
-
let p = e.query?.pageNum, m = e.query?.pageSize, g;
|
|
443
|
-
t[6] !== p || t[7] !== m ? (g = [p, m], t[6] = p, t[7] = m, t[8] = g) : g = t[8], r(f, g);
|
|
444
|
-
let _;
|
|
445
|
-
t[9] !== c || t[10] !== e ? (_ = function(t, n) {
|
|
446
|
-
let r = n, i = t;
|
|
447
|
-
c !== n && (i = 1), l(r), d(i), e.onChange && e.onChange(i, r);
|
|
448
|
-
}, t[9] = c, t[10] = e, t[11] = _) : _ = t[11];
|
|
449
|
-
let v = _, y;
|
|
450
|
-
t[12] === e.config ? y = t[13] : (y = e.config || {}, t[12] = e.config, t[13] = y);
|
|
451
|
-
let b = `pagination-render ${o ? "pagination-infinity" : null} ${c == Infinity ? "pagination-infinity-checked" : ""}`, x;
|
|
452
|
-
t[14] !== o || t[15] !== e.pageSizeOptions ? (x = o ? [...e.pageSizeOptions, Infinity] : e.pageSizeOptions, t[14] = o, t[15] = e.pageSizeOptions, t[16] = x) : x = t[16];
|
|
453
|
-
let S;
|
|
454
|
-
return t[17] !== v || t[18] !== u || t[19] !== c || t[20] !== e.total || t[21] !== y || t[22] !== b || t[23] !== x ? (S = /* @__PURE__ */ G("div", {
|
|
455
|
-
className: "pagination-render-wrap",
|
|
456
|
-
children: /* @__PURE__ */ G(h, {
|
|
457
|
-
...y,
|
|
458
|
-
className: b,
|
|
459
|
-
current: u,
|
|
460
|
-
pageSize: c,
|
|
461
|
-
onChange: v,
|
|
462
|
-
pageSizeOptions: x,
|
|
463
|
-
total: e.total,
|
|
464
|
-
showTotal: lt,
|
|
465
|
-
showSizeChanger: !0
|
|
466
|
-
})
|
|
467
|
-
}), t[17] = v, t[18] = u, t[19] = c, t[20] = e.total, t[21] = y, t[22] = b, t[23] = x, t[24] = S) : S = t[24], S;
|
|
468
|
-
}
|
|
469
|
-
function lt(e) {
|
|
470
|
-
return `总条数 ${e} 条`;
|
|
471
|
-
}
|
|
472
|
-
//#endregion
|
|
473
|
-
//#region src/common/handleReactions.js
|
|
474
|
-
function ut(e, t = {}) {
|
|
475
|
-
if (!Array.isArray(e)) return console.warn("Error handleReactions: fieldList not array"), e;
|
|
476
|
-
let n = [];
|
|
477
|
-
return M(e).forEach((e) => {
|
|
478
|
-
dt(e, t), n.push(e);
|
|
479
|
-
}), n;
|
|
480
|
-
}
|
|
481
|
-
function dt(e, t = {}) {
|
|
482
|
-
let { scope: n, formilyRef: r = {}, scenario: i } = t || {}, a = e?.field || e, { state: o, run: s } = a["x-reactions"]?.fulfill || {}, c = {
|
|
483
|
-
scope: n,
|
|
484
|
-
$self: a,
|
|
485
|
-
$effect: L.effect,
|
|
486
|
-
$observable: R,
|
|
487
|
-
$memo: L.memo,
|
|
488
|
-
$props: { formilyRef: r }
|
|
489
|
-
};
|
|
490
|
-
if (a.inTable) {
|
|
491
|
-
let e = Te(a.inTable, c);
|
|
492
|
-
e && (a.inTable = e(c));
|
|
493
|
-
}
|
|
494
|
-
return a.visible, a;
|
|
495
|
-
}
|
|
496
|
-
//#endregion
|
|
497
|
-
//#region src/components/Formily/FormilyField.tsx
|
|
498
|
-
var ft = t(function(e) {
|
|
499
|
-
let { schema: t, formilyRef: r, schemaScope: i, components: o, reactionOpts: s } = e, { fields: c, fieldSchemas: l } = r.current || {}, u = a(() => {
|
|
500
|
-
let e = M(t);
|
|
501
|
-
return e?.properties && Object.keys(e?.properties)?.forEach((t) => {
|
|
502
|
-
e?.properties?.[t]?.inTable === !1 && delete e?.properties?.[t];
|
|
503
|
-
}), e;
|
|
504
|
-
}, [t]), d = n(U({
|
|
505
|
-
components: {
|
|
506
|
-
...j,
|
|
507
|
-
...ne,
|
|
508
|
-
...o,
|
|
509
|
-
FormItem(e) {
|
|
510
|
-
let t = ae(), n = W(), { name: r } = n;
|
|
511
|
-
c[r] = t, l[r] = n, dt(n, {
|
|
512
|
-
...s,
|
|
513
|
-
scope: i
|
|
514
|
-
});
|
|
515
|
-
let a = j?.FormItem;
|
|
516
|
-
return a && /* @__PURE__ */ G(a, { ...e });
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
scope: {
|
|
520
|
-
...i,
|
|
521
|
-
scenario: "tableReactionsForm"
|
|
522
|
-
}
|
|
523
|
-
}), []), f = a(() => me({
|
|
524
|
-
initialValues: {},
|
|
525
|
-
readOnly: !0,
|
|
526
|
-
disabled: !0
|
|
527
|
-
}), []);
|
|
528
|
-
return /* @__PURE__ */ G(Q, {
|
|
529
|
-
className: "hidden-table-form-render",
|
|
530
|
-
style: {
|
|
531
|
-
display: "none",
|
|
532
|
-
width: 0,
|
|
533
|
-
height: 0,
|
|
534
|
-
overflow: "hidden"
|
|
535
|
-
},
|
|
536
|
-
form: f,
|
|
537
|
-
children: /* @__PURE__ */ G(d, { schema: u })
|
|
538
|
-
});
|
|
539
|
-
}), pt = ({ SchemaField: e, getField: t, editing: n, dataIndex: r, title: i, inputType: a, record: s, index: c, onEdit: l, onSave: u, onCancel: d, editable: f, topProps: p, children: m, ...h }) => {
|
|
540
|
-
let g = t && t(), _ = g?.["x-pattern"], v = g?.["x-display"], { editMode: y = "modal", canEditCallback: b } = p || {}, { hasEdit: x } = p?.tableConf || {}, S = o();
|
|
541
|
-
return y === "modal" || !((x && typeof x == "function" ? x(s, c) : x !== !1) && f && _ !== "disabled" && _ !== "readOnly" && v !== "none" && (!b || b(s, g, r))) ? /* @__PURE__ */ G("td", {
|
|
542
|
-
...h,
|
|
543
|
-
children: m
|
|
544
|
-
}) : n ? /* @__PURE__ */ G("td", {
|
|
545
|
-
...h,
|
|
546
|
-
children: /* @__PURE__ */ K("div", {
|
|
547
|
-
className: "editable-table-cell table-cell-editing",
|
|
548
|
-
children: [/* @__PURE__ */ G(e, { schema: {
|
|
549
|
-
type: "object",
|
|
550
|
-
properties: { [g?.name]: {
|
|
551
|
-
...g,
|
|
552
|
-
title: "",
|
|
553
|
-
"x-component-props": {
|
|
554
|
-
...g["x-component-props"],
|
|
555
|
-
ref: (e) => {
|
|
556
|
-
g["x-component-props"] && typeof g["x-component-props"].ref == "function" && g["x-component-props"].ref(e), e && (S.current = e);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
} }
|
|
560
|
-
} }), y === "line" ? null : /* @__PURE__ */ K("div", {
|
|
561
|
-
className: "cell-editing-actions",
|
|
562
|
-
children: [/* @__PURE__ */ G(J, {
|
|
563
|
-
className: "table-cell-confirm-icon",
|
|
564
|
-
onClick: () => u(g)
|
|
565
|
-
}), /* @__PURE__ */ G(se, {
|
|
566
|
-
className: "table-cell-cancel-icon",
|
|
567
|
-
onClick: d
|
|
568
|
-
})]
|
|
569
|
-
})]
|
|
570
|
-
})
|
|
571
|
-
}) : y === "line-cell" || y === "cell" ? /* @__PURE__ */ G("td", {
|
|
572
|
-
...h,
|
|
573
|
-
children: /* @__PURE__ */ K("div", {
|
|
574
|
-
className: "editable-table-cell",
|
|
575
|
-
onDoubleClick: (e) => {
|
|
576
|
-
e?.preventDefault(), e?.stopPropagation(), l(s, r, {
|
|
577
|
-
field: g,
|
|
578
|
-
fieldRef: S
|
|
579
|
-
});
|
|
580
|
-
},
|
|
581
|
-
children: [m, /* @__PURE__ */ G(Y, {
|
|
582
|
-
className: "table-cell-edit-icon",
|
|
583
|
-
onClick: (e) => {
|
|
584
|
-
e?.preventDefault(), e?.stopPropagation(), l(s, r, {
|
|
585
|
-
field: g,
|
|
586
|
-
fieldRef: S
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
})]
|
|
590
|
-
})
|
|
591
|
-
}) : /* @__PURE__ */ G("td", {
|
|
592
|
-
...h,
|
|
593
|
-
children: m
|
|
594
|
-
});
|
|
595
|
-
}, mt = (e) => {
|
|
596
|
-
let { topProps: t, idKey: i, columns: a, onEditSubmit: u, formRender: d } = e, { editMode: f = "modal" } = t || {}, p = o();
|
|
597
|
-
e.schemaScope && !p.current ? p.current = e.schemaScope : p.current ||= { _$tempData: {} }, p.current?._$tempData || (p.current._$tempData = {});
|
|
598
|
-
let m = n(U({
|
|
599
|
-
components: {
|
|
600
|
-
Card: l,
|
|
601
|
-
Slider: y,
|
|
602
|
-
Rate: v,
|
|
603
|
-
...j,
|
|
604
|
-
...ne,
|
|
605
|
-
...e.components
|
|
606
|
-
},
|
|
607
|
-
scope: p.current
|
|
608
|
-
}), []), [h, g] = s(""), [_, b] = s(""), x = (e) => e[i] === h, S = (e) => e === _, C = o(null);
|
|
609
|
-
r(() => {
|
|
610
|
-
if (h || _) try {
|
|
611
|
-
C.current?.current?.focus?.();
|
|
612
|
-
} catch {}
|
|
613
|
-
}, [h, _]);
|
|
614
|
-
let w = async (e, t, n = { fieldRef: null }) => {
|
|
615
|
-
let { fieldRef: r } = n || {};
|
|
616
|
-
C.current = r, d.values = {}, d?.setValues(e), g(e[i]), b(t);
|
|
617
|
-
}, T = async (t, ...n) => {
|
|
618
|
-
let r = await (e.onEdit && e.onEdit(t));
|
|
619
|
-
w.call(void 0, r, ...n);
|
|
620
|
-
}, D = () => {
|
|
621
|
-
g(""), b(""), C.current = null;
|
|
622
|
-
}, O = async (e) => {
|
|
623
|
-
try {
|
|
624
|
-
await d?.validate(), u && await u(d.values, { field: e }), g(""), b("");
|
|
625
|
-
} catch (e) {
|
|
626
|
-
console.error("Validate Failed:", e);
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
return {
|
|
630
|
-
onEditAFetch: T,
|
|
631
|
-
onEdit: w,
|
|
632
|
-
SchemaField: m,
|
|
633
|
-
mergedColumns: E(a)?.map((t) => {
|
|
634
|
-
let n = t.key === "_$actions";
|
|
635
|
-
if (!t.editable && !n) return t;
|
|
636
|
-
let r = {
|
|
637
|
-
...t,
|
|
638
|
-
onCell: (r, ...i) => ({
|
|
639
|
-
...t.onCell ? t.onCell(r, ...i) : {},
|
|
640
|
-
record: r,
|
|
641
|
-
SchemaField: m,
|
|
642
|
-
getField: t.getField,
|
|
643
|
-
dataIndex: t.dataIndex,
|
|
644
|
-
title: t.title,
|
|
645
|
-
editable: t.editable,
|
|
646
|
-
editing: n ? !1 : f === "cell" ? x(r) && S(t.dataIndex) : x(r),
|
|
647
|
-
topProps: e.topProps,
|
|
648
|
-
onEdit: T,
|
|
649
|
-
onSave: O,
|
|
650
|
-
onCancel: D
|
|
651
|
-
})
|
|
652
|
-
};
|
|
653
|
-
return n && (r.render = (e, n) => f === "line" && e[i] === h ? /* @__PURE__ */ K("div", {
|
|
654
|
-
className: "edit-table-actions",
|
|
655
|
-
children: [/* @__PURE__ */ G(c, {
|
|
656
|
-
type: "link",
|
|
657
|
-
onClick: O,
|
|
658
|
-
children: "保存"
|
|
659
|
-
}), /* @__PURE__ */ G(c, {
|
|
660
|
-
type: "text",
|
|
661
|
-
onClick: D,
|
|
662
|
-
children: "取消"
|
|
663
|
-
})]
|
|
664
|
-
}) : t.render(e, n)), r;
|
|
665
|
-
})
|
|
666
|
-
};
|
|
667
|
-
}, ht = "table-render", gt = e(function(e, t) {
|
|
668
|
-
let { topProps: n, config: l = {}, query: d = {}, i18n: f, setList: m, cellEditTableProps: h } = e, { tableDel: v = "删除", tableEdit: y = "编辑", tableDelTip: b = "确认删除该项?", tableDetail: S = "详情" } = f || {}, { dragColConf: w = {}, isDargTable: E, dargEndBack: O, orderColType: k, orderColWidth: ee, tableEmptyValue: A, isShowTableFilter: te = !1, isTableSortXIdex: j = !1, isCellEditTable: ne = !1 } = l || {}, { editMode: M = "modal" } = n || {}, N = M !== "modal", P = o();
|
|
669
|
-
i(t, () => ({
|
|
670
|
-
onEditByTable: J,
|
|
671
|
-
cellEditTableRef: P,
|
|
672
|
-
columns: F
|
|
673
|
-
}));
|
|
674
|
-
let [F, I] = s([]), [L, R] = s([]), z = fe(() => /* @__PURE__ */ G(ce, { style: {
|
|
675
|
-
cursor: "grab",
|
|
676
|
-
color: "#999"
|
|
677
|
-
} })), B = de((e) => /* @__PURE__ */ G("tr", { ...e })), V = ue((e) => /* @__PURE__ */ G("tbody", { ...e })), U = ({ oldIndex: t, newIndex: n }) => {
|
|
678
|
-
if (t !== n) {
|
|
679
|
-
let r = pe(e.list.slice(), t, n).filter((e) => !!e);
|
|
680
|
-
m([...r]), O && O(r, d);
|
|
681
|
-
}
|
|
682
|
-
}, ie = (e) => /* @__PURE__ */ G(V, {
|
|
683
|
-
useDragHandle: !0,
|
|
684
|
-
disableAutoscroll: !0,
|
|
685
|
-
helperClass: "row-dragging",
|
|
686
|
-
onSortEnd: U,
|
|
687
|
-
...e
|
|
688
|
-
}), ae = ({ className: t, style: n, ...r }) => {
|
|
689
|
-
let i = e.list.findIndex((t) => t[e.idKey || "id"] === r["data-row-key"]);
|
|
690
|
-
return /* @__PURE__ */ G(B, {
|
|
691
|
-
index: i,
|
|
692
|
-
...r
|
|
693
|
-
});
|
|
694
|
-
}, W = o({
|
|
695
|
-
fields: {},
|
|
696
|
-
fieldSchemas: {}
|
|
697
|
-
}), q = a(() => me({
|
|
698
|
-
initialValues: e.initialValues,
|
|
699
|
-
readOnly: e.readOnly,
|
|
700
|
-
disabled: e.disabled,
|
|
701
|
-
...e.formOptions || {},
|
|
702
|
-
effects(...t) {
|
|
703
|
-
e.onFormValuesChange && ge(e.onFormValuesChange), e.onFieldValueChange && he("*", e.onFieldValueChange), e.formOptions?.effects && e.formOptions?.effects(...t);
|
|
704
|
-
}
|
|
705
|
-
}), []), { onEdit: J, mergedColumns: se } = mt({
|
|
706
|
-
idKey: e.idKey,
|
|
707
|
-
columns: F,
|
|
708
|
-
onEdit: e.onEdit,
|
|
709
|
-
onEditSubmit: e.onEditSubmit,
|
|
710
|
-
formRender: q,
|
|
711
|
-
components: e.components,
|
|
712
|
-
schemaScope: e.schemaScope,
|
|
713
|
-
topProps: e.topProps
|
|
714
|
-
}), Y = (t) => {
|
|
715
|
-
let n = W.current?.fields, { Slots: r = {} } = e;
|
|
716
|
-
return t?.map((t, i) => {
|
|
717
|
-
if (t.inTable === !1) return;
|
|
718
|
-
let { name: a, title: o } = t, s = t["x-component"], c = {};
|
|
719
|
-
e.config?.colConf && e.config?.colConf[t?.name] && (c = e.config?.colConf[t?.name]);
|
|
720
|
-
let l;
|
|
721
|
-
l = r && r[t?.name] ? function(e, i, a) {
|
|
722
|
-
let o = r[t?.name], s = {
|
|
723
|
-
text: e,
|
|
724
|
-
record: i,
|
|
725
|
-
index: a,
|
|
726
|
-
field: {
|
|
727
|
-
...t,
|
|
728
|
-
...n?.[t?.name]
|
|
729
|
-
},
|
|
730
|
-
fieldSchema: n?.[t?.name]
|
|
731
|
-
};
|
|
732
|
-
return /* @__PURE__ */ G(o, { ...s });
|
|
733
|
-
} : function(e, r, i, ...a) {
|
|
734
|
-
let { width: o, ellipsis: l, emptyValue: u, showTags: d, showPrefixNode: f, showMode: p, enumRenderProps: m } = c || {}, h = n[t?.name]?.componentProps?.emptyValue, g = u ?? h ?? A ?? "", _ = Oe({
|
|
735
|
-
...t,
|
|
736
|
-
...n[t?.name]
|
|
737
|
-
}, r, { fieldSchema: n?.[t?.name] });
|
|
738
|
-
(_ === "" || _ == null) && (_ = g);
|
|
739
|
-
let v = /* @__PURE__ */ G("span", {
|
|
740
|
-
className: "inline-block-max-w",
|
|
741
|
-
style: { width: o },
|
|
742
|
-
title: l?.showTitle ? _ : "",
|
|
743
|
-
children: _
|
|
744
|
-
});
|
|
745
|
-
if (l === !0 || l && l?.showTitle != 1) return /* @__PURE__ */ G(C, {
|
|
746
|
-
className: "table-cell-ellipsis",
|
|
747
|
-
...l,
|
|
748
|
-
title: _,
|
|
749
|
-
children: v
|
|
750
|
-
});
|
|
751
|
-
if (p || d || f || f !== !1 && s === "Switch") {
|
|
752
|
-
let e = p;
|
|
753
|
-
return d ? e = ve.tags : f && (e = ve.prefixNode), /* @__PURE__ */ G(_e, {
|
|
754
|
-
showMode: e,
|
|
755
|
-
value: T.get(r, t?.name),
|
|
756
|
-
field: {
|
|
757
|
-
...t,
|
|
758
|
-
...n?.[t?.name]
|
|
759
|
-
},
|
|
760
|
-
...m
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
return v;
|
|
764
|
-
};
|
|
765
|
-
let u = D(o) ? o() : o;
|
|
766
|
-
c?.title && (u = D(c?.title) ? c?.title() : c?.title);
|
|
767
|
-
let d = t["x-decorator-props"] || {};
|
|
768
|
-
d.tooltip && (u = /* @__PURE__ */ K("span", {
|
|
769
|
-
className: "col-title-tooltip-wrap inline-block-max-w",
|
|
770
|
-
children: [u, /* @__PURE__ */ G(C, {
|
|
771
|
-
className: "col-title-tooltip",
|
|
772
|
-
title: d.tooltip,
|
|
773
|
-
children: /* @__PURE__ */ G(Z, { className: "col-title-tooltip-icon" })
|
|
774
|
-
})]
|
|
775
|
-
}));
|
|
776
|
-
let f = n?.[t?.name]?.dataSource?.map((e) => ({
|
|
777
|
-
...e,
|
|
778
|
-
label: e?.[t?.["x-component-props"]?.fieldNames?.label] || e?.label,
|
|
779
|
-
value: e?.[t?.["x-component-props"]?.fieldNames?.value] || e?.value
|
|
780
|
-
}));
|
|
781
|
-
return {
|
|
782
|
-
getField: () => t,
|
|
783
|
-
editable: !0,
|
|
784
|
-
...c,
|
|
785
|
-
onCell: (e, r, i) => c?.onCell?.({
|
|
786
|
-
...e,
|
|
787
|
-
_field: {
|
|
788
|
-
...t,
|
|
789
|
-
...n?.[t?.name] || {}
|
|
790
|
-
}
|
|
791
|
-
}, r, i) || {},
|
|
792
|
-
title: () => u,
|
|
793
|
-
key: t?.name,
|
|
794
|
-
dataIndex: t?.name,
|
|
795
|
-
type: t["x-validator"] == "number" ? "Number" : s,
|
|
796
|
-
validatorList: t["x-validator"] || [],
|
|
797
|
-
nonEditable: M != "cell",
|
|
798
|
-
values: t?.enum || f || [],
|
|
799
|
-
cellProps: t.cellProps,
|
|
800
|
-
children: Y(t?.children),
|
|
801
|
-
render: Ce(l),
|
|
802
|
-
required: t?.required
|
|
803
|
-
};
|
|
804
|
-
})?.filter((e) => e);
|
|
805
|
-
};
|
|
806
|
-
r(() => {
|
|
807
|
-
if (!(e.schema && e.schema.properties)) return;
|
|
808
|
-
let t = je(e.schema, [], {
|
|
809
|
-
...e.getFieldListOpt,
|
|
810
|
-
formilyRef: W
|
|
811
|
-
}, j), n = [];
|
|
812
|
-
k === "page" ? n.push({
|
|
813
|
-
title: "序号",
|
|
814
|
-
width: ee,
|
|
815
|
-
render: (e, t, n) => `${n + 1}`
|
|
816
|
-
}) : k == "all" && n.push({
|
|
817
|
-
title: "序号",
|
|
818
|
-
width: ee,
|
|
819
|
-
render: (e, t, n) => {
|
|
820
|
-
let { pageSize: r = 10, pageNum: i = 1 } = d || {};
|
|
821
|
-
return `${(i - 1) * r + (n + 1)}`;
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
let { Slots: r = {} } = e, i = ut(t, {
|
|
825
|
-
scope: e.schemaScope,
|
|
826
|
-
formilyRef: W
|
|
827
|
-
});
|
|
828
|
-
if (n = n.concat(Y(i)), e.hasAction !== !1) {
|
|
829
|
-
let { hasEdit: t, hasDel: i, hasDelTips: a, hasDetail: o = !1 } = e.config || {}, s = e.config?.colConf?._$actions || {};
|
|
830
|
-
n.push({
|
|
831
|
-
...s,
|
|
832
|
-
title: "操作",
|
|
833
|
-
key: "_$actions",
|
|
834
|
-
type: "_$actions",
|
|
835
|
-
nonEditable: !0,
|
|
836
|
-
render: Ce(function(n, l, u) {
|
|
837
|
-
let { onEdit: d, onDel: f, onSearch: p, getList: m } = e, h = {
|
|
838
|
-
text: n,
|
|
839
|
-
record: l,
|
|
840
|
-
index: u,
|
|
841
|
-
onEdit: d,
|
|
842
|
-
onDel: f,
|
|
843
|
-
onSearch: p,
|
|
844
|
-
getList: m
|
|
845
|
-
};
|
|
846
|
-
if (r?.tableActionsSlot) return /* @__PURE__ */ G(r.tableActionsSlot, { ...h });
|
|
847
|
-
let { editMode: _ = "modal" } = e.topProps || {}, x = _ !== "cell" && _ !== "line-cell" && (t && typeof t == "function" ? t(l, u) : t !== !1), C = o && typeof o == "function" ? o(l, u) : o !== !1, w = i && typeof i == "function" ? i(l, u) : i !== !1, T = a && typeof a == "function" ? a(l, u) : a || b;
|
|
848
|
-
return /* @__PURE__ */ K("div", {
|
|
849
|
-
style: {
|
|
850
|
-
width: s?.width,
|
|
851
|
-
maxWidth: "100%"
|
|
852
|
-
},
|
|
853
|
-
className: "table-render-action",
|
|
854
|
-
children: [
|
|
855
|
-
r?.actionPrefixSlot && /* @__PURE__ */ G(r.actionPrefixSlot, { ...h }),
|
|
856
|
-
C ? /* @__PURE__ */ G(c, {
|
|
857
|
-
type: "link",
|
|
858
|
-
onClick: () => {
|
|
859
|
-
e.onDetail && e.onDetail(l, u);
|
|
860
|
-
},
|
|
861
|
-
children: S
|
|
862
|
-
}) : null,
|
|
863
|
-
x ? /* @__PURE__ */ G(c, {
|
|
864
|
-
type: "link",
|
|
865
|
-
onClick: () => {
|
|
866
|
-
e.onEdit && e.onEdit(l, u);
|
|
867
|
-
},
|
|
868
|
-
children: y
|
|
869
|
-
}) : null,
|
|
870
|
-
r?.actionCenterSlot && /* @__PURE__ */ G(r.actionCenterSlot, { ...h }),
|
|
871
|
-
w ? /* @__PURE__ */ G(g, {
|
|
872
|
-
placement: "topRight",
|
|
873
|
-
title: T,
|
|
874
|
-
onConfirm: () => {
|
|
875
|
-
e.onDel && e.onDel(l, u);
|
|
876
|
-
},
|
|
877
|
-
children: /* @__PURE__ */ G(c, {
|
|
878
|
-
type: "link",
|
|
879
|
-
danger: !0,
|
|
880
|
-
children: v
|
|
881
|
-
})
|
|
882
|
-
}) : null,
|
|
883
|
-
r?.actionSuffixSlot && /* @__PURE__ */ G(r.actionSuffixSlot, { ...h })
|
|
884
|
-
]
|
|
885
|
-
});
|
|
886
|
-
})
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
E && n.unshift({
|
|
890
|
-
title: "",
|
|
891
|
-
dataIndex: "sort",
|
|
892
|
-
width: 60,
|
|
893
|
-
fixed: "left",
|
|
894
|
-
render: () => /* @__PURE__ */ G(z, {}),
|
|
895
|
-
...w
|
|
896
|
-
}), I(n), R(n);
|
|
897
|
-
}, [e.schema, e.config]);
|
|
898
|
-
let Q = { scenario: ht }, be = (e, t) => {
|
|
899
|
-
if (e.target.checked) {
|
|
900
|
-
let e = [...F, t], n = new Map(L.map((e, t) => [e.key, t]));
|
|
901
|
-
I(e.sort((e, t) => n.get(e.key) - n.get(t.key)));
|
|
902
|
-
} else I(F.filter((e) => e.key !== t.key));
|
|
903
|
-
}, $ = {
|
|
904
|
-
className: "table-render",
|
|
905
|
-
rowKey: e?.idKey || "id",
|
|
906
|
-
rowSelection: l?.rowSelection,
|
|
907
|
-
columns: F,
|
|
908
|
-
dataSource: e.list,
|
|
909
|
-
pagination: !1,
|
|
910
|
-
scroll: l.scroll,
|
|
911
|
-
expandable: l.expandable,
|
|
912
|
-
loading: e.loading,
|
|
913
|
-
onRow: l?.onRow,
|
|
914
|
-
topProps: e.topProps,
|
|
915
|
-
...e.tableProps
|
|
916
|
-
};
|
|
917
|
-
return E && ($.components = { body: {
|
|
918
|
-
wrapper: ie,
|
|
919
|
-
row: ae
|
|
920
|
-
} }), N && ($.columns = se, $.components = { body: {
|
|
921
|
-
...$?.components?.body,
|
|
922
|
-
cell: pt
|
|
923
|
-
} }), /* @__PURE__ */ K("div", {
|
|
924
|
-
className: "table-render-wrap",
|
|
925
|
-
children: [
|
|
926
|
-
te ? /* @__PURE__ */ K("div", {
|
|
927
|
-
className: "table-render-wrap-header",
|
|
928
|
-
children: [/* @__PURE__ */ K("div", {
|
|
929
|
-
className: "table-filter",
|
|
930
|
-
onClick: () => {
|
|
931
|
-
e.setShowSearch && e.setShowSearch();
|
|
932
|
-
},
|
|
933
|
-
children: [/* @__PURE__ */ G(X, { className: "table-filter-icon" }), "显示过滤项"]
|
|
934
|
-
}), /* @__PURE__ */ G(_, {
|
|
935
|
-
placement: "bottomRight",
|
|
936
|
-
content: /* @__PURE__ */ G("div", {
|
|
937
|
-
className: "table-popover-content",
|
|
938
|
-
children: L.map((e) => e.key === "_$actions" ? null : /* @__PURE__ */ G(u, {
|
|
939
|
-
checked: F.findIndex((t) => t.key === e.key) !== -1,
|
|
940
|
-
onChange: (t) => be(t, e),
|
|
941
|
-
children: e.title
|
|
942
|
-
}, e.key))
|
|
943
|
-
}),
|
|
944
|
-
trigger: "click",
|
|
945
|
-
children: /* @__PURE__ */ K("div", {
|
|
946
|
-
className: "table-filter",
|
|
947
|
-
children: [/* @__PURE__ */ G(le, { className: "table-filter-icon" }), "显示列"]
|
|
948
|
-
})
|
|
949
|
-
})]
|
|
950
|
-
}) : null,
|
|
951
|
-
ne ? /* @__PURE__ */ G(ye, {
|
|
952
|
-
ref: P,
|
|
953
|
-
...$,
|
|
954
|
-
...h,
|
|
955
|
-
...e,
|
|
956
|
-
onEditSubmit: e?.onEditSubmit,
|
|
957
|
-
Slots: e?.Slots,
|
|
958
|
-
rowSelection: l?.rowSelection,
|
|
959
|
-
query: d
|
|
960
|
-
}) : /* @__PURE__ */ G(oe, { children: N ? /* @__PURE__ */ G(re, {
|
|
961
|
-
form: q,
|
|
962
|
-
children: /* @__PURE__ */ G(p, {
|
|
963
|
-
layout: "vertical",
|
|
964
|
-
children: /* @__PURE__ */ G(H, { children: () => /* @__PURE__ */ G(x, { ...$ }) })
|
|
965
|
-
})
|
|
966
|
-
}) : /* @__PURE__ */ G(x, { ...$ }) }),
|
|
967
|
-
/* @__PURE__ */ G(ft, {
|
|
968
|
-
schema: e.schema,
|
|
969
|
-
formilyRef: W,
|
|
970
|
-
components: e.components,
|
|
971
|
-
topProps: n,
|
|
972
|
-
schemaScope: {
|
|
973
|
-
...Q,
|
|
974
|
-
...e.schemaScope
|
|
975
|
-
},
|
|
976
|
-
reactionOpts: Q
|
|
977
|
-
})
|
|
978
|
-
]
|
|
979
|
-
});
|
|
980
|
-
});
|
|
981
|
-
//#endregion
|
|
982
|
-
//#region src/card-render/index.jsx
|
|
983
|
-
function _t(e) {
|
|
984
|
-
let t = q(16), n;
|
|
985
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {}, t[0] = n) : n = t[0];
|
|
986
|
-
let [i, a] = s(n), { config: o, cardProps: l, query: u, i18n: d, onEdit: p, onDel: m, onSearch: h, getList: _, Slots: v, loading: y } = e, x = o === void 0 ? {} : o, S;
|
|
987
|
-
t[1] === l ? S = t[2] : (S = l === void 0 ? {} : l, t[1] = l, t[2] = S);
|
|
988
|
-
let C = S, w;
|
|
989
|
-
t[3] === v ? w = t[4] : (w = v === void 0 ? {} : v, t[3] = v, t[4] = w);
|
|
990
|
-
let T = w, E;
|
|
991
|
-
t[5] === d ? E = t[6] : (E = d || {}, t[5] = d, t[6] = E);
|
|
992
|
-
let { tableDel: D, tableEdit: O, tableDelTip: k, tableDetail: ee } = E, A = D === void 0 ? "删除" : D, te = O === void 0 ? "编辑" : O, j = k === void 0 ? "确认删除该项?" : k, ne = ee === void 0 ? "详情" : ee, { columns: M, CardItemRender: N, hasEdit: P, hasDel: F, hasDelTips: I, hasDetail: L } = x || {}, R = M === void 0 ? 3 : M, z = L !== void 0 && L, B = {
|
|
993
|
-
onEdit: p,
|
|
994
|
-
onDel: m,
|
|
995
|
-
onSearch: h,
|
|
996
|
-
getList: _
|
|
997
|
-
}, V;
|
|
998
|
-
t[7] === e.schema ? V = t[8] : (V = () => {
|
|
999
|
-
let t = Ie(e?.schema);
|
|
1000
|
-
a(t);
|
|
1001
|
-
}, t[7] = e.schema, t[8] = V);
|
|
1002
|
-
let H = e?.schema, re = e?.schema?.schema, U;
|
|
1003
|
-
t[9] !== H || t[10] !== re ? (U = [H, re], t[9] = H, t[10] = re, t[11] = U) : U = t[11], r(V, U);
|
|
1004
|
-
let ie = (t, n) => {
|
|
1005
|
-
let r = e.config?.colConf?._$actions || {}, i = {
|
|
1006
|
-
record: t,
|
|
1007
|
-
index: n,
|
|
1008
|
-
...B
|
|
1009
|
-
};
|
|
1010
|
-
if (T?.tableActionsSlot) return /* @__PURE__ */ G(T.tableActionsSlot, { ...i });
|
|
1011
|
-
let a = P && typeof P == "function" ? P(t, n) : P !== !1, o = z && typeof z == "function" ? z(t, n) : z !== !1, s = F && typeof F == "function" ? F(t, n) : F !== !1, l = I && typeof I == "function" ? I(t, n) : I || j;
|
|
1012
|
-
return /* @__PURE__ */ K("div", {
|
|
1013
|
-
style: {
|
|
1014
|
-
width: r?.width,
|
|
1015
|
-
maxWidth: "100%"
|
|
1016
|
-
},
|
|
1017
|
-
children: [
|
|
1018
|
-
T?.actionPrefixSlot && /* @__PURE__ */ G(T.actionPrefixSlot, { ...i }),
|
|
1019
|
-
o ? /* @__PURE__ */ G(c, {
|
|
1020
|
-
type: "link",
|
|
1021
|
-
onClick: () => {
|
|
1022
|
-
e.onDetail && e.onDetail(t, n);
|
|
1023
|
-
},
|
|
1024
|
-
children: ne
|
|
1025
|
-
}) : null,
|
|
1026
|
-
a ? /* @__PURE__ */ G(c, {
|
|
1027
|
-
type: "link",
|
|
1028
|
-
onClick: () => {
|
|
1029
|
-
e.onEdit && e.onEdit(t, n);
|
|
1030
|
-
},
|
|
1031
|
-
children: te
|
|
1032
|
-
}) : null,
|
|
1033
|
-
T?.actionCenterSlot && /* @__PURE__ */ G(T.actionCenterSlot, { ...i }),
|
|
1034
|
-
s ? /* @__PURE__ */ G(g, {
|
|
1035
|
-
placement: "topRight",
|
|
1036
|
-
title: l,
|
|
1037
|
-
onConfirm: () => {
|
|
1038
|
-
e.onDel && e.onDel(t, n);
|
|
1039
|
-
},
|
|
1040
|
-
children: /* @__PURE__ */ G(c, {
|
|
1041
|
-
type: "link",
|
|
1042
|
-
danger: !0,
|
|
1043
|
-
children: A
|
|
1044
|
-
})
|
|
1045
|
-
}) : null,
|
|
1046
|
-
T?.actionSuffixSlot && /* @__PURE__ */ G(T.actionSuffixSlot, { ...i })
|
|
1047
|
-
]
|
|
1048
|
-
});
|
|
1049
|
-
}, ae = (t) => {
|
|
1050
|
-
let { item: n, index: r } = t;
|
|
1051
|
-
return N ? /* @__PURE__ */ G(N, {
|
|
1052
|
-
item: n,
|
|
1053
|
-
index: r,
|
|
1054
|
-
functionProps: B
|
|
1055
|
-
}) : /* @__PURE__ */ G(be, {
|
|
1056
|
-
config: e.config,
|
|
1057
|
-
schema: i,
|
|
1058
|
-
bordered: !1,
|
|
1059
|
-
data: n,
|
|
1060
|
-
schemaScope: {
|
|
1061
|
-
scenario: "table-render",
|
|
1062
|
-
...e.schemaScope
|
|
1063
|
-
},
|
|
1064
|
-
components: e.components,
|
|
1065
|
-
...C
|
|
1066
|
-
});
|
|
1067
|
-
}, W = b, oe = e.list?.length > 0 ? /* @__PURE__ */ G("div", {
|
|
1068
|
-
className: "card-render-wrap",
|
|
1069
|
-
style: { gridTemplateColumns: `repeat(${R}, 1fr` },
|
|
1070
|
-
children: e.list?.map((t, n) => /* @__PURE__ */ K("div", {
|
|
1071
|
-
className: "item-render-card",
|
|
1072
|
-
children: [e.hasAction === !1 ? null : /* @__PURE__ */ G("div", {
|
|
1073
|
-
className: "item-render-card-title",
|
|
1074
|
-
children: ie(t, n)
|
|
1075
|
-
}), /* @__PURE__ */ G("div", {
|
|
1076
|
-
className: "item-render-card-content",
|
|
1077
|
-
children: /* @__PURE__ */ G(ae, {
|
|
1078
|
-
item: t,
|
|
1079
|
-
index: n
|
|
1080
|
-
})
|
|
1081
|
-
})]
|
|
1082
|
-
}, t.id))
|
|
1083
|
-
}) : /* @__PURE__ */ G(f, { image: f.PRESENTED_IMAGE_SIMPLE }), J;
|
|
1084
|
-
return t[12] !== W || t[13] !== y || t[14] !== oe ? (J = /* @__PURE__ */ G(W, {
|
|
1085
|
-
spinning: y,
|
|
1086
|
-
children: oe
|
|
1087
|
-
}), t[12] = W, t[13] = y, t[14] = oe, t[15] = J) : J = t[15], J;
|
|
1088
|
-
}
|
|
1089
|
-
//#endregion
|
|
1090
|
-
//#region src/FormModal/index.tsx
|
|
1091
|
-
var vt = null;
|
|
1092
|
-
function yt(e, t) {
|
|
1093
|
-
let { modalMode: n, Slots: r = {}, modalConf: l = {}, modalProps: u = {} } = e, [f, p] = s(!1), [h, g] = s("新增"), [_, v] = s(!1), y = o(), b = o("create"), x = a(() => e.Slots?.FormSlot, [e.Slots?.FormSlot]);
|
|
1094
|
-
function S(t = e.formInitialValues, n, r = "create") {
|
|
1095
|
-
b.current = r || "create", v(!0), y.current?.formRender?.setValues ? (y.current?.formRender?.setValues(t), vt = null) : vt = t, g(n || "新增");
|
|
1096
|
-
}
|
|
1097
|
-
function C() {
|
|
1098
|
-
e.onClose && e.onClose(), v(!1), y.current?.formRender?.reset();
|
|
1099
|
-
}
|
|
1100
|
-
if (i(t, () => ({
|
|
1101
|
-
show: S,
|
|
1102
|
-
close: C,
|
|
1103
|
-
cancel: C,
|
|
1104
|
-
onOk: E,
|
|
1105
|
-
formRef: y
|
|
1106
|
-
})), !_) return null;
|
|
1107
|
-
function E() {
|
|
1108
|
-
D().then(async () => {
|
|
1109
|
-
let t = T.cloneDeep(await y.current?.formRender?.values);
|
|
1110
|
-
if (!(l.beforeSubmit && await l.beforeSubmit(t, {
|
|
1111
|
-
cancel: C,
|
|
1112
|
-
formRef: y,
|
|
1113
|
-
scenario: b.current
|
|
1114
|
-
}) === !1)) {
|
|
1115
|
-
try {
|
|
1116
|
-
p(!0), await (e.onSubmit && e.onSubmit(t)), C();
|
|
1117
|
-
} catch (e) {
|
|
1118
|
-
console.error(e);
|
|
1119
|
-
}
|
|
1120
|
-
p(!1);
|
|
1121
|
-
}
|
|
1122
|
-
});
|
|
1123
|
-
}
|
|
1124
|
-
function D(e = !1) {
|
|
1125
|
-
return new Promise((t, n) => {
|
|
1126
|
-
y.current?.formRender?.validate().then((e) => {
|
|
1127
|
-
t(e);
|
|
1128
|
-
}).catch((t) => {
|
|
1129
|
-
n(t), console.error("Error validate: ", t), !e && w.error("输入有误!");
|
|
1130
|
-
});
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
let O, k = {
|
|
1134
|
-
cancel: C,
|
|
1135
|
-
onOk: E,
|
|
1136
|
-
close: C,
|
|
1137
|
-
formRef: y,
|
|
1138
|
-
validate: D,
|
|
1139
|
-
scenario: b.current
|
|
1140
|
-
};
|
|
1141
|
-
l?.footer ? O = typeof l?.footer == "function" ? l.footer({
|
|
1142
|
-
...k,
|
|
1143
|
-
options: k
|
|
1144
|
-
}) : l?.footer : (O = [], r.modalFooterPre && O.push(/* @__PURE__ */ G(r.modalFooterPre, { options: k }, "pre")), O.push(/* @__PURE__ */ G(c, {
|
|
1145
|
-
onClick: C,
|
|
1146
|
-
children: l.cancelText || "取 消"
|
|
1147
|
-
}, "cancel")), r.modalFooterCenter && O.push(/* @__PURE__ */ G(r.modalFooterCenter, { options: k }, "center")), O.push(/* @__PURE__ */ G(c, {
|
|
1148
|
-
type: "primary",
|
|
1149
|
-
onClick: E,
|
|
1150
|
-
loading: f,
|
|
1151
|
-
children: l.okText || "确 定"
|
|
1152
|
-
}, "confirm")), r.modalFooterSuffix && O.push(/* @__PURE__ */ G(r.modalFooterSuffix, { options: k }, "suffix")));
|
|
1153
|
-
function ee() {
|
|
1154
|
-
e.modalFormMount && e.modalFormMount(), vt &&= (y.current?.formRender?.setValues(vt), null);
|
|
1155
|
-
}
|
|
1156
|
-
let A = n === "drawer" ? d : m, j = {
|
|
1157
|
-
className: "form-modal",
|
|
1158
|
-
wrapClassName: "form-modal",
|
|
1159
|
-
title: h,
|
|
1160
|
-
visible: _,
|
|
1161
|
-
open: _,
|
|
1162
|
-
onClose: C,
|
|
1163
|
-
onCancel: C,
|
|
1164
|
-
onOk: E,
|
|
1165
|
-
footer: O,
|
|
1166
|
-
maskClosable: u.maskClosable || !1,
|
|
1167
|
-
width: l?.width ?? 720,
|
|
1168
|
-
destroyOnClose: !0,
|
|
1169
|
-
...u
|
|
1170
|
-
};
|
|
1171
|
-
return /* @__PURE__ */ K(A, {
|
|
1172
|
-
...j,
|
|
1173
|
-
children: [x ? /* @__PURE__ */ G(x, {
|
|
1174
|
-
...e,
|
|
1175
|
-
formRef: y,
|
|
1176
|
-
scenario: b.current,
|
|
1177
|
-
schema: e.schema
|
|
1178
|
-
}) : /* @__PURE__ */ G(te, {
|
|
1179
|
-
...e.formProps,
|
|
1180
|
-
ref: y,
|
|
1181
|
-
schema: e.schema,
|
|
1182
|
-
schemaScope: {
|
|
1183
|
-
scenario: b.current,
|
|
1184
|
-
...e.schemaScope || {}
|
|
1185
|
-
},
|
|
1186
|
-
components: e.components
|
|
1187
|
-
}), /* @__PURE__ */ G(bt, { didMount: ee })]
|
|
1188
|
-
});
|
|
1189
|
-
}
|
|
1190
|
-
function bt(e) {
|
|
1191
|
-
let t = q(3), n;
|
|
1192
|
-
t[0] === e ? n = t[1] : (n = () => {
|
|
1193
|
-
e.didMount();
|
|
1194
|
-
}, t[0] = e, t[1] = n);
|
|
1195
|
-
let i;
|
|
1196
|
-
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (i = [], t[2] = i) : i = t[2], r(n, i), null;
|
|
1197
|
-
}
|
|
1198
|
-
var xt = e(yt), St = null;
|
|
1199
|
-
function Ct(e, t) {
|
|
1200
|
-
let { modalMode: n, Slots: r = {}, modalConf: a = {}, modalProps: l = {} } = e, [u, f] = s(!1), [p, h] = s({}), [g, _] = s("详情"), v = o();
|
|
1201
|
-
function y(t = e.formInitialValues, n) {
|
|
1202
|
-
f(!0), h(t), _(n || "详情");
|
|
1203
|
-
}
|
|
1204
|
-
function b() {
|
|
1205
|
-
e.onClose && e.onClose(), f(!1), v.current?.formRender?.reset();
|
|
1206
|
-
}
|
|
1207
|
-
if (i(t, () => ({
|
|
1208
|
-
show: y,
|
|
1209
|
-
close: b,
|
|
1210
|
-
cancel: b,
|
|
1211
|
-
formRef: v
|
|
1212
|
-
})), !u) return null;
|
|
1213
|
-
let x, S = {
|
|
1214
|
-
close: b,
|
|
1215
|
-
formRef: v,
|
|
1216
|
-
scenario: "detail"
|
|
1217
|
-
};
|
|
1218
|
-
a?.footer ? x = typeof a?.footer == "function" ? a.footer({
|
|
1219
|
-
...S,
|
|
1220
|
-
options: S
|
|
1221
|
-
}) : a?.footer : (x = [], r.modalFooterPre && x.push(/* @__PURE__ */ G(r.modalFooterPre, { options: S }, "pre")), x.push(/* @__PURE__ */ G(c, {
|
|
1222
|
-
onClick: b,
|
|
1223
|
-
children: a.okText || "关 闭"
|
|
1224
|
-
}, "confirm")), r.modalFooterSuffix && x.push(/* @__PURE__ */ G(r.modalFooterSuffix, { options: S }, "suffix")));
|
|
1225
|
-
function C() {
|
|
1226
|
-
e.modalFormMount && e.modalFormMount(), St &&= (h(St), null);
|
|
1227
|
-
}
|
|
1228
|
-
let w = n === "drawer" ? d : m, T = {
|
|
1229
|
-
className: "detail-modal",
|
|
1230
|
-
wrapClassName: "detail-modal",
|
|
1231
|
-
title: g,
|
|
1232
|
-
visible: u,
|
|
1233
|
-
open: u,
|
|
1234
|
-
onClose: b,
|
|
1235
|
-
onCancel: b,
|
|
1236
|
-
footer: x,
|
|
1237
|
-
maskClosable: l.maskClosable || !1,
|
|
1238
|
-
width: a?.width ?? 720,
|
|
1239
|
-
destroyOnClose: !0,
|
|
1240
|
-
...l
|
|
1241
|
-
};
|
|
1242
|
-
return /* @__PURE__ */ K(w, {
|
|
1243
|
-
...T,
|
|
1244
|
-
children: [/* @__PURE__ */ G(be, {
|
|
1245
|
-
...e.detailProps,
|
|
1246
|
-
components: e.components,
|
|
1247
|
-
schema: e.schema,
|
|
1248
|
-
schemaScope: {
|
|
1249
|
-
scenario: "detail",
|
|
1250
|
-
...e.schemaScope || {}
|
|
1251
|
-
},
|
|
1252
|
-
data: p
|
|
1253
|
-
}), /* @__PURE__ */ G(wt, { didMount: C })]
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
function wt(e) {
|
|
1257
|
-
let t = q(3), n;
|
|
1258
|
-
t[0] === e ? n = t[1] : (n = () => {
|
|
1259
|
-
e.didMount();
|
|
1260
|
-
}, t[0] = e, t[1] = n);
|
|
1261
|
-
let i;
|
|
1262
|
-
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (i = [], t[2] = i) : i = t[2], r(n, i), null;
|
|
1263
|
-
}
|
|
1264
|
-
var Tt = e(Ct);
|
|
1265
|
-
//#endregion
|
|
1266
|
-
//#region src/FilterTag/index.tsx
|
|
1267
|
-
function Et(e) {
|
|
1268
|
-
return e != null;
|
|
1269
|
-
}
|
|
1270
|
-
var Dt = (e) => {
|
|
1271
|
-
let { searchQuery: t, schema: n, queryRef: i, onSearch: a } = e, [o, c] = s([]);
|
|
1272
|
-
r(() => {
|
|
1273
|
-
if (i) {
|
|
1274
|
-
let e = [], r = i.current?.formRef?.current?.formRender?.fields;
|
|
1275
|
-
for (let i in n?.schema?.properties) {
|
|
1276
|
-
let a = n?.schema?.properties[i];
|
|
1277
|
-
if (Et(t[i])) {
|
|
1278
|
-
let n = $({
|
|
1279
|
-
...a,
|
|
1280
|
-
...r[a?.name]
|
|
1281
|
-
}, t, { fieldSchema: r?.[a?.name] });
|
|
1282
|
-
e.push({
|
|
1283
|
-
label: a?.title,
|
|
1284
|
-
value: n,
|
|
1285
|
-
filed: i,
|
|
1286
|
-
filedValue: t[i]
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
c(e);
|
|
1291
|
-
}
|
|
1292
|
-
}, [
|
|
1293
|
-
t,
|
|
1294
|
-
n,
|
|
1295
|
-
i
|
|
1296
|
-
]);
|
|
1297
|
-
let l = (e, t) => {
|
|
1298
|
-
e.preventDefault(), i.current?.formRef?.current?.formRender.setValues({ [t?.filed]: null }), a && a(i.current?.formRef?.current?.formRender?.values), c((e) => e?.filter((e) => e?.filed != t?.filed));
|
|
1299
|
-
};
|
|
1300
|
-
return /* @__PURE__ */ G("div", {
|
|
1301
|
-
className: "has-filter",
|
|
1302
|
-
children: o?.map((e) => /* @__PURE__ */ K(S, {
|
|
1303
|
-
className: "has-filter-tag",
|
|
1304
|
-
closable: !0,
|
|
1305
|
-
onClose: (t) => {
|
|
1306
|
-
l(t, e);
|
|
1307
|
-
},
|
|
1308
|
-
children: [
|
|
1309
|
-
e?.label,
|
|
1310
|
-
":",
|
|
1311
|
-
e?.value
|
|
1312
|
-
]
|
|
1313
|
-
}))
|
|
1314
|
-
});
|
|
1315
|
-
}, Ot = {
|
|
1316
|
-
default: [
|
|
1317
|
-
10,
|
|
1318
|
-
20,
|
|
1319
|
-
50,
|
|
1320
|
-
100
|
|
1321
|
-
],
|
|
1322
|
-
card: [
|
|
1323
|
-
9,
|
|
1324
|
-
18,
|
|
1325
|
-
54,
|
|
1326
|
-
99
|
|
1327
|
-
]
|
|
1328
|
-
}, kt = e(function(e, t) {
|
|
1329
|
-
let { layout: n = "default", idKey: a = "id", i18n: l, queryFormIsExtendModelQuery: u = !1, queryFormInitialValues: d = {}, dialogConf: f = {}, modalConf: p = {}, isPatchUpdate: m = !1, modalMode: h = "dialog", useFormData: g, appendUrlQuery: _ = !1, appendUrlQueryKey: v = xe, hasFilterTag: y = !1 } = e, { isAllSelect: b = !1, isAllSelectKey: x = "isAllSelect" } = e.paginationConf || {}, S = e.paginationConf?.pageSizeOptions || Ot[e.layout] || [
|
|
1330
|
-
10,
|
|
1331
|
-
20,
|
|
1332
|
-
50,
|
|
1333
|
-
100
|
|
1334
|
-
], { createText: C = e.createText } = l || {}, [D, A] = s(0), [te, j] = s([]), [ne, M] = s(""), [N, P] = s(!1), F = o(), I = o(), L = o(), R = o({ ...d || {} }), z = o({
|
|
1335
|
-
pageNum: 1,
|
|
1336
|
-
pageSize: S[0]
|
|
1337
|
-
}), B = g ?? f.useFormData ?? p?.useFormData, V = o(), [H, re] = s(!0), U = o({}), [ie, ae] = s({});
|
|
1338
|
-
i(t, () => ({
|
|
1339
|
-
getList: X,
|
|
1340
|
-
onSearch: Z,
|
|
1341
|
-
onQueryFormSubmit: le,
|
|
1342
|
-
forceUpdate: de,
|
|
1343
|
-
formModalRef: F,
|
|
1344
|
-
formDialogRef: F,
|
|
1345
|
-
queryRef: L,
|
|
1346
|
-
onCreate: fe,
|
|
1347
|
-
onEdit: ge,
|
|
1348
|
-
onDel: ye,
|
|
1349
|
-
tableRef: U
|
|
1350
|
-
}));
|
|
1351
|
-
let { schema: W = {}, config: oe = {}, model: q = {}, msgConf: J = {}, filters: se } = e;
|
|
1352
|
-
r(() => {
|
|
1353
|
-
let t = _ ? $e(v) : {};
|
|
1354
|
-
q && (q.query ? (q.query.pageNum = 1, z.current = {
|
|
1355
|
-
pageNum: t?.pageNum || q?.query?.pageNum || z.current?.pageNum,
|
|
1356
|
-
pageSize: t?.pageSize || q?.query?.pageSize || z.current?.pageSize
|
|
1357
|
-
}) : q.query = {}), Promise.resolve().then(() => {
|
|
1358
|
-
if (L.current && L.current?.formRef?.current?.formRender && _) {
|
|
1359
|
-
let e = at(se, W, t);
|
|
1360
|
-
L.current.formRef.current.formRender?.setValues(e), R.current = T.cloneDeep(L.current.formRef.current.formRender?.values);
|
|
1361
|
-
}
|
|
1362
|
-
!e.closeAutoRequest && X({});
|
|
1363
|
-
});
|
|
1364
|
-
}, []), r(() => {
|
|
1365
|
-
Array.isArray(e.list) && X();
|
|
1366
|
-
}, [e.list]);
|
|
1367
|
-
let Y = (e) => {
|
|
1368
|
-
w.error({
|
|
1369
|
-
className: "list-render-err-message",
|
|
1370
|
-
...J,
|
|
1371
|
-
content: e || "未知错误"
|
|
1372
|
-
});
|
|
1373
|
-
};
|
|
1374
|
-
function X(t = {}) {
|
|
1375
|
-
return Promise.resolve().then(() => {
|
|
1376
|
-
if (!q?.getList && Array.isArray(e.list)) {
|
|
1377
|
-
P(!0);
|
|
1378
|
-
let { list: t } = e, { pageNum: n = 1, pageSize: r = S[0] } = z.current || {};
|
|
1379
|
-
j(e?.hasPagination === !1 ? t : t.slice(r * (n - 1), n * r)), A(t.length), e.onGetListEnd && e.onGetListEnd({
|
|
1380
|
-
list: t,
|
|
1381
|
-
pagination: {
|
|
1382
|
-
pageNum: n,
|
|
1383
|
-
pageSize: r
|
|
1384
|
-
}
|
|
1385
|
-
}), P(!1);
|
|
1386
|
-
return;
|
|
1387
|
-
}
|
|
1388
|
-
if (!q?.getList) return;
|
|
1389
|
-
P(!0);
|
|
1390
|
-
let n = {
|
|
1391
|
-
...R.current,
|
|
1392
|
-
...t,
|
|
1393
|
-
...z.current
|
|
1394
|
-
};
|
|
1395
|
-
n.$timerange !== void 0 && delete n.$timerange, V.current?.cancel({
|
|
1396
|
-
code: 601,
|
|
1397
|
-
message: "取消上一次请求"
|
|
1398
|
-
}), V.current = k();
|
|
1399
|
-
let r = E(n);
|
|
1400
|
-
return b && r.pageSize === Infinity && (r[x] = !0, r.pageSize = void 0), q?.getList(r, {}, { cancelToken: V.current?.token }).then((t) => {
|
|
1401
|
-
V.current = null, j(t.list), A(t.pagination?.total), e.onGetListEnd && e.onGetListEnd(t), P(!1);
|
|
1402
|
-
}).catch((e) => {
|
|
1403
|
-
let t = ee || O.isCancel;
|
|
1404
|
-
return typeof t == "function" && t(e) ? (console.info("请求已取消:", "", e.message), Promise.reject(e)) : (Y(e?._message), P(!1), Promise.reject(e));
|
|
1405
|
-
});
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
function ce(e, t) {
|
|
1409
|
-
q && !q.query && (q.query = {}), z.current = {
|
|
1410
|
-
pageNum: e,
|
|
1411
|
-
pageSize: t
|
|
1412
|
-
}, _ && Ze({
|
|
1413
|
-
...$e(v),
|
|
1414
|
-
...z.current
|
|
1415
|
-
}, v), X();
|
|
1416
|
-
}
|
|
1417
|
-
function Z(e, t = {}) {
|
|
1418
|
-
let { isSaveQuery: n = !0, isMergeQuery: r = !0 } = t || {};
|
|
1419
|
-
return q && !q.query && (q.query = {}), z.current = {
|
|
1420
|
-
...z.current,
|
|
1421
|
-
pageNum: 1
|
|
1422
|
-
}, q && q.query && !q.query.pageSize && (q.query.pageSize = S[0]), n && (R.current = {
|
|
1423
|
-
...r ? R.current : {},
|
|
1424
|
-
...e
|
|
1425
|
-
}), X(e);
|
|
1426
|
-
}
|
|
1427
|
-
function le(e, t) {
|
|
1428
|
-
return ae(e), _ && (t ? Qe(v, "", !0) : Ze(e, v)), R.current = e, Z(e);
|
|
1429
|
-
}
|
|
1430
|
-
function ue(e, t) {
|
|
1431
|
-
if (_) try {
|
|
1432
|
-
let { componentType: t, value: n, path: r } = e;
|
|
1433
|
-
if (Se.includes(t) && (n === "" || n?.length === 0 || n === void 0)) {
|
|
1434
|
-
let e = r.entire;
|
|
1435
|
-
e && Qe(v, e);
|
|
1436
|
-
}
|
|
1437
|
-
} catch (e) {
|
|
1438
|
-
console.error("url参数清除失败", e);
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
function de() {
|
|
1442
|
-
j((e) => T.cloneDeep(e));
|
|
1443
|
-
}
|
|
1444
|
-
function fe() {
|
|
1445
|
-
M("create");
|
|
1446
|
-
let t = e.formInitialValues?.[p?.title?.createKey] || p?.title?.createText || "新增";
|
|
1447
|
-
F.current.show(e.formInitialValues, t);
|
|
1448
|
-
}
|
|
1449
|
-
async function pe(t) {
|
|
1450
|
-
let n = t;
|
|
1451
|
-
return typeof q?.createMap == "function" && (n = await q.createMap(t)), B && (n = Ne(n)), q?.create(n).then((t) => {
|
|
1452
|
-
X(), w.success(t._message || "新增成功"), e.onCreateSuc && e.onCreateSuc(t);
|
|
1453
|
-
}).catch((e) => (console.error("err", e), Y(e._message), Promise.reject(e)));
|
|
1454
|
-
}
|
|
1455
|
-
function me(t, n) {
|
|
1456
|
-
if (e.fetchOnEdit !== !1) {
|
|
1457
|
-
let n = {};
|
|
1458
|
-
e.fetchById === !1 ? n[a] = t[a] : n.id = t[a], q.get(n).then((e) => {
|
|
1459
|
-
he(e, t[a]);
|
|
1460
|
-
}).catch((e) => (console.error("err", e), Y(e._message), Promise.reject(e)));
|
|
1461
|
-
} else he(t, t[a]);
|
|
1462
|
-
}
|
|
1463
|
-
function he(e, t) {
|
|
1464
|
-
let n = e[p?.title?.detailKey] || p?.title?.detailText || "详情";
|
|
1465
|
-
I.current.show(e, n);
|
|
1466
|
-
}
|
|
1467
|
-
function ge(t, n) {
|
|
1468
|
-
if (M("edit"), e.fetchOnEdit !== !1) {
|
|
1469
|
-
let n = {};
|
|
1470
|
-
return e.fetchById === !1 ? n[a] = t[a] : n.id = t[a], q.get(n).then((e) => (_e(e, t[a]), e)).catch((e) => (console.error("err", e), Y(e._message), Promise.reject(e)));
|
|
1471
|
-
}
|
|
1472
|
-
return _e(t, t[a]), Promise.resolve(t);
|
|
1473
|
-
}
|
|
1474
|
-
function _e(t, n) {
|
|
1475
|
-
let { editMode: r = "modal" } = e;
|
|
1476
|
-
if (r == "line") return U.current.onEditByTable(t, n);
|
|
1477
|
-
if (r === "modal") {
|
|
1478
|
-
let e = t[p?.title?.editKey] || p?.title?.editText || "编辑";
|
|
1479
|
-
F.current.show(t, e, "edit");
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
async function ve(t, n) {
|
|
1483
|
-
let r = t;
|
|
1484
|
-
return m ? typeof q?.patchMap == "function" && (r = await q.patchMap(t, n)) : typeof q?.updateMap == "function" && (r = await q.updateMap(t, n)), e.onEditReqVerify && await e.onEditReqVerify(r), B && (r = Ne(r)), (m ? q?.patch : q?.update).bind(q)(r, { id: t[a] }).then((t) => {
|
|
1485
|
-
X(), w.success(t?._message || "编辑成功"), e.onEditSuc && e.onEditSuc(t);
|
|
1486
|
-
}).catch((e) => (console.error("err", e), Y(e._message), Promise.reject(e)));
|
|
1487
|
-
}
|
|
1488
|
-
function ye(t, n) {
|
|
1489
|
-
return q?.delete({ id: t[a] }).then((t) => {
|
|
1490
|
-
w.success(t._message || "删除成功"), e.onDelSuc && e.onDelSuc(t), X();
|
|
1491
|
-
}).catch((e) => (Y(e._message), Promise.reject(e)));
|
|
1492
|
-
}
|
|
1493
|
-
let { Slots: Q = {} } = e, be = {
|
|
1494
|
-
...e.dialogConf,
|
|
1495
|
-
...p
|
|
1496
|
-
}, $ = {
|
|
1497
|
-
...e.dialogFormProps,
|
|
1498
|
-
...e.modalFormProps
|
|
1499
|
-
}, Ce = e.onFormDialogClose ?? e.onFormModalClose, we = {
|
|
1500
|
-
...e.dialogProps,
|
|
1501
|
-
...e.modalProps
|
|
1502
|
-
}, Te = e.dialogFormMount ?? e.modalFormMount, Ee = () => {
|
|
1503
|
-
re(!H);
|
|
1504
|
-
};
|
|
1505
|
-
return /* @__PURE__ */ K("div", {
|
|
1506
|
-
className: `list-render ${e.className}`,
|
|
1507
|
-
children: [
|
|
1508
|
-
/* @__PURE__ */ K("div", {
|
|
1509
|
-
className: `list-header ${e.verticalHeader ? "vertical-header" : ""}`,
|
|
1510
|
-
children: [e.hasQuery !== !1 && H ? /* @__PURE__ */ G(st, {
|
|
1511
|
-
ref: L,
|
|
1512
|
-
schema: W,
|
|
1513
|
-
search: e.search,
|
|
1514
|
-
filters: e.filters,
|
|
1515
|
-
config: e.queryConf,
|
|
1516
|
-
queryFormInitialValues: {
|
|
1517
|
-
...d,
|
|
1518
|
-
...u ? q.query : {}
|
|
1519
|
-
},
|
|
1520
|
-
onSearch: le,
|
|
1521
|
-
onReset: le,
|
|
1522
|
-
schemaScope: e.schemaScope,
|
|
1523
|
-
components: e.components,
|
|
1524
|
-
onFieldValueChange: ue,
|
|
1525
|
-
i18n: l
|
|
1526
|
-
}) : /* @__PURE__ */ G("div", { className: "query-render" }), /* @__PURE__ */ K("div", {
|
|
1527
|
-
className: "header-actions-render",
|
|
1528
|
-
children: [
|
|
1529
|
-
Q.headerActionPrefix && /* @__PURE__ */ G(Q.headerActionPrefix, {
|
|
1530
|
-
onCreate: fe,
|
|
1531
|
-
onSearch: Z,
|
|
1532
|
-
getList: X,
|
|
1533
|
-
i18n: l
|
|
1534
|
-
}),
|
|
1535
|
-
e.hasCreate === !1 ? null : /* @__PURE__ */ G(c, {
|
|
1536
|
-
onClick: fe,
|
|
1537
|
-
type: "primary",
|
|
1538
|
-
children: C || "新增"
|
|
1539
|
-
}),
|
|
1540
|
-
Q.headerActionSuffix && /* @__PURE__ */ G(Q.headerActionSuffix, {
|
|
1541
|
-
onCreate: fe,
|
|
1542
|
-
onSearch: Z,
|
|
1543
|
-
getList: X,
|
|
1544
|
-
i18n: l
|
|
1545
|
-
})
|
|
1546
|
-
]
|
|
1547
|
-
})]
|
|
1548
|
-
}),
|
|
1549
|
-
y && /* @__PURE__ */ G(Dt, {
|
|
1550
|
-
searchQuery: ie,
|
|
1551
|
-
schema: W,
|
|
1552
|
-
queryRef: L,
|
|
1553
|
-
onSearch: Z
|
|
1554
|
-
}),
|
|
1555
|
-
Q.HeaderOthersSuffix && /* @__PURE__ */ G(Q.HeaderOthersSuffix, {
|
|
1556
|
-
onSearch: Z,
|
|
1557
|
-
getList: X
|
|
1558
|
-
}),
|
|
1559
|
-
n === "card" ? /* @__PURE__ */ G(_t, {
|
|
1560
|
-
idKey: a,
|
|
1561
|
-
schema: W,
|
|
1562
|
-
list: te,
|
|
1563
|
-
config: e.cardConf,
|
|
1564
|
-
cardProps: e.cardProps,
|
|
1565
|
-
hasAction: e.hasAction,
|
|
1566
|
-
query: q?.query,
|
|
1567
|
-
Slots: e.Slots,
|
|
1568
|
-
onEdit: ge,
|
|
1569
|
-
onDel: ye,
|
|
1570
|
-
onDetail: me,
|
|
1571
|
-
onSearch: Z,
|
|
1572
|
-
getList: X,
|
|
1573
|
-
loading: N,
|
|
1574
|
-
components: e.components,
|
|
1575
|
-
schemaScope: e.schemaScope,
|
|
1576
|
-
i18n: l
|
|
1577
|
-
}) : null,
|
|
1578
|
-
n === "default" ? /* @__PURE__ */ G(gt, {
|
|
1579
|
-
idKey: a,
|
|
1580
|
-
ref: U,
|
|
1581
|
-
schema: W?.schema,
|
|
1582
|
-
list: te,
|
|
1583
|
-
config: e.tableConf,
|
|
1584
|
-
hasAction: e.hasAction,
|
|
1585
|
-
query: {
|
|
1586
|
-
...q?.query,
|
|
1587
|
-
...z.current
|
|
1588
|
-
},
|
|
1589
|
-
Slots: e.Slots,
|
|
1590
|
-
onEdit: ge,
|
|
1591
|
-
onDel: ye,
|
|
1592
|
-
setList: j,
|
|
1593
|
-
onDetail: me,
|
|
1594
|
-
onSearch: Z,
|
|
1595
|
-
getList: X,
|
|
1596
|
-
setShowSearch: Ee,
|
|
1597
|
-
loading: N,
|
|
1598
|
-
tableProps: e.tableProps,
|
|
1599
|
-
getFieldListOpt: {
|
|
1600
|
-
...e.getFieldListOpt,
|
|
1601
|
-
schemaScope: e.schemaScope
|
|
1602
|
-
},
|
|
1603
|
-
components: e.components,
|
|
1604
|
-
schemaScope: e.schemaScope,
|
|
1605
|
-
i18n: l,
|
|
1606
|
-
onEditSubmit: ve,
|
|
1607
|
-
topProps: e,
|
|
1608
|
-
cellEditTableProps: e?.cellEditTableProps
|
|
1609
|
-
}) : null,
|
|
1610
|
-
e.hasPagination === !1 ? null : /* @__PURE__ */ G(ct, {
|
|
1611
|
-
layout: n,
|
|
1612
|
-
onChange: ce,
|
|
1613
|
-
total: D,
|
|
1614
|
-
query: {
|
|
1615
|
-
...q?.query,
|
|
1616
|
-
...z.current
|
|
1617
|
-
},
|
|
1618
|
-
config: e.paginationConf,
|
|
1619
|
-
pageSizeOptions: S,
|
|
1620
|
-
i18n: l
|
|
1621
|
-
}),
|
|
1622
|
-
/* @__PURE__ */ G(xt, {
|
|
1623
|
-
ref: F,
|
|
1624
|
-
schema: W,
|
|
1625
|
-
formInitialValues: e.formInitialValues,
|
|
1626
|
-
components: e.components,
|
|
1627
|
-
schemaScope: e.schemaScope,
|
|
1628
|
-
formProps: $,
|
|
1629
|
-
modalMode: h,
|
|
1630
|
-
modalConf: be,
|
|
1631
|
-
onClose: Ce,
|
|
1632
|
-
onSubmit: ne === "edit" ? ve : pe,
|
|
1633
|
-
Slots: e.Slots,
|
|
1634
|
-
modalProps: we,
|
|
1635
|
-
modalFormMount: Te,
|
|
1636
|
-
i18n: l
|
|
1637
|
-
}),
|
|
1638
|
-
/* @__PURE__ */ G(Tt, {
|
|
1639
|
-
ref: I,
|
|
1640
|
-
schema: W,
|
|
1641
|
-
formInitialValues: e.formInitialValues,
|
|
1642
|
-
components: e.detailComponents,
|
|
1643
|
-
schemaScope: e.schemaScope,
|
|
1644
|
-
detailProps: e.dialogDetailProps || e.modalDetailProps,
|
|
1645
|
-
modalMode: h,
|
|
1646
|
-
modalConf: be,
|
|
1647
|
-
onClose: Ce,
|
|
1648
|
-
Slots: e.Slots,
|
|
1649
|
-
modalProps: we,
|
|
1650
|
-
modalFormMount: Te
|
|
1651
|
-
})
|
|
1652
|
-
]
|
|
1653
|
-
});
|
|
1654
|
-
});
|
|
1655
|
-
kt.defaultProps = { model: { query: {} } };
|
|
1656
|
-
//#endregion
|
|
1657
|
-
//#region src/index.js
|
|
1658
|
-
var At = kt;
|
|
1659
|
-
//#endregion
|
|
1660
|
-
export { At as default };
|