@aplus-frontend/ui 6.13.2 → 6.13.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/es/src/ap-form/ap-form.vue2.mjs +123 -120
- package/es/src/ap-form/dependency/index.vue.mjs +26 -28
- package/es/src/ap-form/hooks/use-watch.mjs +28 -31
- package/es/src/ap-form/interface.d.ts +5 -0
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +22 -24
- package/es/src/ap-form/utils/get.d.ts +2 -0
- package/es/src/ap-form/utils/get.mjs +12 -7
- package/es/src/ap-grid/editable/form-item.vue.mjs +84 -87
- package/es/src/ap-grid/index.vue.mjs +137 -134
- package/es/src/ap-grid/interface.d.ts +6 -0
- package/es/src/ap-table/ap-table.vue.d.ts +1 -0
- package/es/src/ap-table/ap-table.vue2.mjs +189 -186
- package/es/src/ap-table/context.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +89 -89
- package/es/src/business/ap-table-modal/index.d.ts +1 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/ap-view/ap-view.vue2.mjs +68 -68
- package/es/src/business/ap-view/interface.d.ts +1 -1
- package/es/src/business/batch-input-group/form-item.vue.mjs +34 -28
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +9 -7
- package/es/src/editable-table/form-item.vue.mjs +78 -81
- package/es/src/locale/lang/en.mjs +1 -1
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/dependency/index.vue.js +1 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/interface.d.ts +5 -0
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
- package/lib/src/ap-form/utils/get.d.ts +2 -0
- package/lib/src/ap-form/utils/get.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +6 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +1 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/context.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +1 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useTableSortedAndFiltered as
|
|
1
|
+
import { ref as fe, reactive as Q, unref as m, nextTick as ge, onMounted as de, watch as pe, computed as y, createVNode as x } from "vue";
|
|
2
|
+
import { useTableSortedAndFiltered as me } from "./use-sorted-filtered.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { parseFieldValue as
|
|
5
|
-
import { isArray as
|
|
4
|
+
import { parseFieldValue as he, dataIndexToStr as Se, isEqualCustom as ze } from "../utils.mjs";
|
|
5
|
+
import { isArray as W, isEqualWith as Pe, isUndefined as Te } from "lodash-unified";
|
|
6
6
|
import { isDef as $ } from "../../utils/index.mjs";
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useNamespace as
|
|
7
|
+
import { useLocale as we } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as be } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
9
|
const h = 1, I = 20, G = {
|
|
10
10
|
defaultCurrent: h,
|
|
11
11
|
defaultPageSize: I,
|
|
@@ -18,11 +18,11 @@ function Fe(c) {
|
|
|
18
18
|
...c
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function xe(c) {
|
|
22
22
|
const f = {};
|
|
23
23
|
return c === !1 || (c === !0 || c == null ? (f.current = h, f.pageSize = I) : (f.current = c.defaultCurrent || h, f.pageSize = c.defaultPageSize || I)), f;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const Ve = ({
|
|
26
26
|
manual: c = !1,
|
|
27
27
|
request: f,
|
|
28
28
|
params: V = {},
|
|
@@ -30,38 +30,38 @@ const Ie = ({
|
|
|
30
30
|
formatParams: U,
|
|
31
31
|
paramsValueTypeMap: _,
|
|
32
32
|
resetFieldsIgnores: A,
|
|
33
|
-
filterFields:
|
|
34
|
-
sortFields:
|
|
35
|
-
namespace:
|
|
36
|
-
pagination:
|
|
37
|
-
onClickReset:
|
|
33
|
+
filterFields: Z,
|
|
34
|
+
sortFields: H,
|
|
35
|
+
namespace: X = "ap-table",
|
|
36
|
+
pagination: S,
|
|
37
|
+
onClickReset: C,
|
|
38
38
|
onAfterRequest: E
|
|
39
39
|
}) => {
|
|
40
40
|
let v = 0, s = {};
|
|
41
|
-
const
|
|
42
|
-
getColumnSFConfig:
|
|
43
|
-
setSF:
|
|
44
|
-
clearAll:
|
|
41
|
+
const Y = Fe(S), q = (e) => U ? U(e) : e, z = fe(), i = Q(xe(S)), {
|
|
42
|
+
getColumnSFConfig: R,
|
|
43
|
+
setSF: k,
|
|
44
|
+
clearAll: ee,
|
|
45
45
|
sortedInfo: N,
|
|
46
46
|
filteredInfo: B
|
|
47
|
-
} =
|
|
48
|
-
t:
|
|
49
|
-
} =
|
|
50
|
-
b:
|
|
51
|
-
} =
|
|
47
|
+
} = me(), {
|
|
48
|
+
t: P
|
|
49
|
+
} = we(), {
|
|
50
|
+
b: T
|
|
51
|
+
} = be(X), o = Q({
|
|
52
52
|
total: j.length,
|
|
53
53
|
records: j,
|
|
54
54
|
loading: !1
|
|
55
|
-
}),
|
|
55
|
+
}), w = () => {
|
|
56
56
|
var e, t;
|
|
57
|
-
return ((t = (e =
|
|
57
|
+
return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
|
|
58
58
|
}, J = async (e) => {
|
|
59
59
|
var r;
|
|
60
|
-
const t =
|
|
60
|
+
const t = q(e), n = Date.now();
|
|
61
61
|
v = n, o.loading = !0;
|
|
62
62
|
try {
|
|
63
63
|
const a = await f({
|
|
64
|
-
...
|
|
64
|
+
...m(V),
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
v === n && (o.total = a.total || ((r = a.data) == null ? void 0 : r.length) || 0, o.records = [...a.data || []], o.loading = !1);
|
|
@@ -75,73 +75,72 @@ const Ie = ({
|
|
|
75
75
|
return Object.entries(e).forEach(([n, r]) => {
|
|
76
76
|
if (t[n] = r, _ && r) {
|
|
77
77
|
const a = _[n];
|
|
78
|
-
a && (t[n] =
|
|
78
|
+
a && (t[n] = he(a, r));
|
|
79
79
|
}
|
|
80
80
|
}), t;
|
|
81
|
-
},
|
|
82
|
-
var r, a, l, g,
|
|
83
|
-
const t =
|
|
84
|
-
Object.entries(t).forEach(([
|
|
85
|
-
A && A.indexOf(
|
|
86
|
-
}), await ((a = (r =
|
|
81
|
+
}, te = async (e) => {
|
|
82
|
+
var r, a, l, g, d;
|
|
83
|
+
const t = w(), n = {};
|
|
84
|
+
Object.entries(t).forEach(([p, F]) => {
|
|
85
|
+
A && A.indexOf(p) > -1 && (n[p] = F);
|
|
86
|
+
}), await ((a = (r = z.value) == null ? void 0 : r.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, n), ge(() => {
|
|
87
87
|
e == null || e();
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, b = (e) => {
|
|
90
90
|
s = e;
|
|
91
91
|
const t = K(e);
|
|
92
92
|
J(t);
|
|
93
|
-
},
|
|
94
|
-
|
|
93
|
+
}, ne = (e) => {
|
|
94
|
+
b({
|
|
95
95
|
...s,
|
|
96
96
|
...e
|
|
97
97
|
});
|
|
98
98
|
}, D = () => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
M(!0);
|
|
100
|
+
}, M = (e = !1) => {
|
|
101
|
+
const t = w(), n = S !== !1;
|
|
102
|
+
n && e && (i.current = h), b({
|
|
103
|
+
...t,
|
|
102
104
|
filter: s.filter,
|
|
103
105
|
sort: s.sort,
|
|
104
|
-
current:
|
|
105
|
-
pageSize:
|
|
106
|
+
current: n ? e ? h : s.current || i.current : void 0,
|
|
107
|
+
pageSize: n ? s.pageSize || i.pageSize : void 0
|
|
106
108
|
});
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
+
}, re = () => {
|
|
110
|
+
ee(), s.sort = {}, s.filter = {}, C == null || C(), te(D);
|
|
109
111
|
}, O = () => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
}, re = (e) => {
|
|
115
|
-
if (z === !1)
|
|
112
|
+
b(s);
|
|
113
|
+
}, ae = (e) => {
|
|
114
|
+
if (S === !1)
|
|
116
115
|
O();
|
|
117
116
|
else {
|
|
118
117
|
const {
|
|
119
118
|
current: t,
|
|
120
119
|
pageSize: n
|
|
121
120
|
} = i, r = o.total - e, a = Math.ceil(r / n), l = t > a ? a : t;
|
|
122
|
-
|
|
121
|
+
ne({
|
|
123
122
|
current: l > 0 ? l : 1
|
|
124
123
|
});
|
|
125
124
|
}
|
|
126
125
|
}, L = (e, t, n) => {
|
|
127
|
-
var
|
|
128
|
-
const r =
|
|
129
|
-
i.current = e.current, i.pageSize = e.pageSize,
|
|
130
|
-
const a =
|
|
126
|
+
var p, F;
|
|
127
|
+
const r = w();
|
|
128
|
+
i.current = e.current, i.pageSize = e.pageSize, k(t, n);
|
|
129
|
+
const a = W(n) ? [...n] : [n], l = {};
|
|
131
130
|
for (const u of a)
|
|
132
|
-
(
|
|
131
|
+
(p = m(H)) != null && p.includes(u.columnKey || u.field) && u.order && (l[Se(u.columnKey || u.field)] = u.order);
|
|
133
132
|
const g = {};
|
|
134
133
|
for (const u of Object.keys(t))
|
|
135
|
-
(
|
|
136
|
-
const
|
|
134
|
+
(F = m(Z)) != null && F.includes(u) && t[u] && (g[u] = t[u]);
|
|
135
|
+
const d = {
|
|
137
136
|
...r,
|
|
138
137
|
filter: g,
|
|
139
138
|
sort: l,
|
|
140
139
|
current: e.current,
|
|
141
140
|
pageSize: e.pageSize
|
|
142
141
|
};
|
|
143
|
-
|
|
144
|
-
},
|
|
142
|
+
Pe(s, d, ze) || b(d);
|
|
143
|
+
}, oe = (e, t = B.value || {}, n = N.value || {}) => {
|
|
145
144
|
const r = (e == null ? void 0 : e.current) ?? i.current, a = (e == null ? void 0 : e.pageSize) ?? i.pageSize;
|
|
146
145
|
L(
|
|
147
146
|
{
|
|
@@ -157,8 +156,8 @@ const Ie = ({
|
|
|
157
156
|
}
|
|
158
157
|
);
|
|
159
158
|
};
|
|
160
|
-
|
|
161
|
-
const e =
|
|
159
|
+
de(() => {
|
|
160
|
+
const e = w(), {
|
|
162
161
|
current: t,
|
|
163
162
|
pageSize: n
|
|
164
163
|
} = i;
|
|
@@ -172,12 +171,12 @@ const Ie = ({
|
|
|
172
171
|
const r = K(s);
|
|
173
172
|
J(r);
|
|
174
173
|
}
|
|
175
|
-
}),
|
|
174
|
+
}), pe(() => m(V), () => {
|
|
176
175
|
D();
|
|
177
176
|
}, {
|
|
178
177
|
deep: !0
|
|
179
178
|
});
|
|
180
|
-
const
|
|
179
|
+
const se = y(() => {
|
|
181
180
|
if (o.total === 0)
|
|
182
181
|
return "-";
|
|
183
182
|
const {
|
|
@@ -186,17 +185,17 @@ const Ie = ({
|
|
|
186
185
|
} = i;
|
|
187
186
|
return `${e}/${Math.ceil(o.total / t)}`;
|
|
188
187
|
});
|
|
189
|
-
function
|
|
190
|
-
|
|
188
|
+
function ie(e) {
|
|
189
|
+
W(e) && (o.records = e, o.total = e.length);
|
|
191
190
|
}
|
|
192
|
-
const
|
|
191
|
+
const ce = y(() => {
|
|
193
192
|
const {
|
|
194
193
|
showLessItems: e,
|
|
195
194
|
showTotal: t,
|
|
196
195
|
showQuickJumper: n,
|
|
197
196
|
showSizeChanger: r,
|
|
198
197
|
pageSizeOptions: a
|
|
199
|
-
} =
|
|
198
|
+
} = Y;
|
|
200
199
|
return {
|
|
201
200
|
loading: o.loading,
|
|
202
201
|
pagination: {
|
|
@@ -207,50 +206,51 @@ const Ie = ({
|
|
|
207
206
|
showQuickJumper: $(n) ? n : !e,
|
|
208
207
|
showLessItems: e,
|
|
209
208
|
size: "default",
|
|
210
|
-
pageSizeOptions:
|
|
211
|
-
showTotal: t ? (l) =>
|
|
212
|
-
class:
|
|
213
|
-
}, [
|
|
214
|
-
class:
|
|
215
|
-
}, [l]), " ",
|
|
216
|
-
class:
|
|
217
|
-
}, [
|
|
218
|
-
class:
|
|
219
|
-
}, [
|
|
209
|
+
pageSizeOptions: Te(a) ? ["10", "20", "50", "100"] : a,
|
|
210
|
+
showTotal: t ? (l) => x("span", {
|
|
211
|
+
class: T("pagination-total-wrapper")
|
|
212
|
+
}, [P("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
|
|
213
|
+
class: T("pagination-count-text")
|
|
214
|
+
}, [l]), " ", P("ap.apTable.pagination.totalLeftSuffix"), x("span", {
|
|
215
|
+
class: T("pagination--total-right")
|
|
216
|
+
}, [P("ap.apTable.pagination.totalRightPrefix"), " ", x("span", {
|
|
217
|
+
class: T("pagination-count-text")
|
|
218
|
+
}, [m(se)]), " ", P("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
220
219
|
},
|
|
221
220
|
onChange: L,
|
|
222
221
|
dataSource: o.records
|
|
223
222
|
};
|
|
224
223
|
});
|
|
225
|
-
function
|
|
224
|
+
function ue(e, t = !0) {
|
|
226
225
|
Object.assign(i, e), s.current = e.current, s.pageSize = e.pageSize, t && O();
|
|
227
226
|
}
|
|
228
|
-
function
|
|
227
|
+
function le() {
|
|
229
228
|
return {
|
|
230
229
|
...i
|
|
231
230
|
};
|
|
232
231
|
}
|
|
233
232
|
return {
|
|
234
|
-
formRef:
|
|
233
|
+
formRef: z,
|
|
235
234
|
submit: D,
|
|
236
|
-
reset:
|
|
235
|
+
reset: re,
|
|
237
236
|
refresh: O,
|
|
238
|
-
refreshByDelete:
|
|
237
|
+
refreshByDelete: ae,
|
|
239
238
|
data: o,
|
|
240
239
|
handleTableChange: L,
|
|
241
|
-
handleTableChangeOptional:
|
|
242
|
-
tableProps:
|
|
240
|
+
handleTableChangeOptional: oe,
|
|
241
|
+
tableProps: ce,
|
|
243
242
|
dataSource: y(() => o.records),
|
|
244
|
-
setDataSource:
|
|
245
|
-
getColumnSFConfig:
|
|
243
|
+
setDataSource: ie,
|
|
244
|
+
getColumnSFConfig: R,
|
|
246
245
|
sortedInfo: N,
|
|
247
246
|
filteredInfo: B,
|
|
248
|
-
getPaging:
|
|
249
|
-
setPaging:
|
|
247
|
+
getPaging: le,
|
|
248
|
+
setPaging: ue,
|
|
249
|
+
submitWith: M
|
|
250
250
|
};
|
|
251
251
|
};
|
|
252
252
|
export {
|
|
253
253
|
h as DEFAULT_CURRENT,
|
|
254
254
|
I as DEFAULT_PAGE_SIZE,
|
|
255
|
-
|
|
255
|
+
Ve as useTablePaging
|
|
256
256
|
};
|
|
@@ -78,6 +78,7 @@ declare const ApTableModal: {
|
|
|
78
78
|
submit: () => void;
|
|
79
79
|
reset: () => void;
|
|
80
80
|
refresh: () => void;
|
|
81
|
+
submitWith: () => void;
|
|
81
82
|
setSearchFormValues: (fields: any) => void;
|
|
82
83
|
getSearchFormValues: (transform?: boolean) => Partial<any> | undefined;
|
|
83
84
|
setPaging: (nextPaging: Partial<{
|
|
@@ -67,6 +67,7 @@ declare const _default: DefineComponent<__VLS_Props, {
|
|
|
67
67
|
submit: () => void;
|
|
68
68
|
reset: () => void;
|
|
69
69
|
refresh: () => void;
|
|
70
|
+
submitWith: () => void;
|
|
70
71
|
setSearchFormValues: (fields: any) => void;
|
|
71
72
|
getSearchFormValues: (transform?: boolean) => Partial<any> | undefined;
|
|
72
73
|
setPaging: (nextPaging: Partial<{
|
|
@@ -7,12 +7,12 @@ import "./components/menu-list-content.vue.mjs";
|
|
|
7
7
|
import { useViewProvide as le } from "./hooks/use-view-provide.mjs";
|
|
8
8
|
import { useInjectApTable as se } from "../../ap-table/context.mjs";
|
|
9
9
|
import { SYSTEM_VIEW_KEY as V } from "./utils/enum.mjs";
|
|
10
|
-
import { isValid as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import { useLocale as
|
|
10
|
+
import { isValid as me } from "@aplus-frontend/utils";
|
|
11
|
+
import { useGlobalConfig as ne } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
14
|
import fe from "./components/main-button-content.vue2.mjs";
|
|
15
|
-
import
|
|
15
|
+
import ue from "./components/menu-list-content.vue2.mjs";
|
|
16
16
|
const Ie = /* @__PURE__ */ Z({
|
|
17
17
|
name: "ApView",
|
|
18
18
|
__name: "ap-view",
|
|
@@ -39,63 +39,63 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
39
39
|
setup(k, {
|
|
40
40
|
expose: A
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
42
|
+
const r = k, L = ne("viewCacheOption"), {
|
|
43
43
|
b: g
|
|
44
|
-
} =
|
|
44
|
+
} = oe("ap-view"), {
|
|
45
45
|
t: P
|
|
46
|
-
} =
|
|
46
|
+
} = re(), v = E(() => ({
|
|
47
47
|
viewKey: V,
|
|
48
48
|
viewName: P("ap.apView.systemView")
|
|
49
49
|
})), {
|
|
50
50
|
getSearchFormValues: T,
|
|
51
|
-
setSearchFormValues:
|
|
52
|
-
submit:
|
|
53
|
-
reset:
|
|
54
|
-
|
|
55
|
-
getSearchFormSorterItems:
|
|
56
|
-
setSearchFormSorterItems:
|
|
57
|
-
resetSearchFormSorterItems:
|
|
51
|
+
setSearchFormValues: W,
|
|
52
|
+
submit: j,
|
|
53
|
+
reset: G,
|
|
54
|
+
submitWith: $,
|
|
55
|
+
getSearchFormSorterItems: Y,
|
|
56
|
+
setSearchFormSorterItems: z,
|
|
57
|
+
resetSearchFormSorterItems: M
|
|
58
58
|
} = se(), q = K(!1), F = K(!1), d = K("");
|
|
59
59
|
let c = !1, _ = !1;
|
|
60
60
|
const H = {
|
|
61
61
|
dropdownType: "dropdown",
|
|
62
62
|
content: N(fe, {
|
|
63
|
-
maxViewNum:
|
|
63
|
+
maxViewNum: r.maxViewNum
|
|
64
64
|
}, null)
|
|
65
|
-
},
|
|
65
|
+
}, m = K([v.value]), J = E(() => m.value.map((t) => ({
|
|
66
66
|
id: t.viewKey,
|
|
67
|
-
content: N(
|
|
67
|
+
content: N(ue, {
|
|
68
68
|
view: t
|
|
69
69
|
}, null)
|
|
70
70
|
}))), e = {
|
|
71
71
|
getSearchFormValues: T,
|
|
72
|
-
setSearchFormValues:
|
|
73
|
-
submit:
|
|
74
|
-
reset:
|
|
75
|
-
|
|
76
|
-
getSearchFormSorterItems:
|
|
77
|
-
setSearchFormSorterItems:
|
|
78
|
-
resetSearchFormSorterItems:
|
|
79
|
-
...
|
|
72
|
+
setSearchFormValues: W,
|
|
73
|
+
submit: j,
|
|
74
|
+
reset: G,
|
|
75
|
+
submitWith: $,
|
|
76
|
+
getSearchFormSorterItems: Y,
|
|
77
|
+
setSearchFormSorterItems: z,
|
|
78
|
+
resetSearchFormSorterItems: M,
|
|
79
|
+
...r.saveDataSource
|
|
80
80
|
}, l = {
|
|
81
81
|
...L.value,
|
|
82
|
-
...
|
|
82
|
+
...r.viewCacheOption
|
|
83
83
|
}, h = () => {
|
|
84
|
-
if (
|
|
84
|
+
if (r.isDefaultSystemView)
|
|
85
85
|
return V;
|
|
86
|
-
if ((
|
|
86
|
+
if ((r.isFirstDefaultSystemView || _) && c)
|
|
87
87
|
return V;
|
|
88
|
-
const t =
|
|
88
|
+
const t = m.value.find((i) => i.isDefault);
|
|
89
89
|
return (t == null ? void 0 : t.viewKey) ?? V;
|
|
90
90
|
}, p = (t) => {
|
|
91
91
|
d.value = t;
|
|
92
|
-
const i =
|
|
92
|
+
const i = m.value.find((s) => s.viewKey === d.value);
|
|
93
93
|
i && setTimeout(() => {
|
|
94
|
-
var s,
|
|
95
|
-
i.viewKey === V ? c ?
|
|
96
|
-
...Object.fromEntries(Object.keys(((
|
|
94
|
+
var s, n, o, u, f, a, y, I, x, B;
|
|
95
|
+
i.viewKey === V ? c ? r.manual || (s = e == null ? void 0 : e.submitWith) == null || s.call(e) : ((n = e == null ? void 0 : e.resetSearchFormSorterItems) == null || n.call(e), r.manual || (o = e == null ? void 0 : e.reset) == null || o.call(e)) : ((a = e == null ? void 0 : e.setSearchFormValues) == null || a.call(e, {
|
|
96
|
+
...Object.fromEntries(Object.keys(((u = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : u.call(e)) ?? {}).map((X) => [X, void 0])) ?? {},
|
|
97
97
|
...((f = i.viewConfig) == null ? void 0 : f.searchForm) ?? {}
|
|
98
|
-
}), (I = e == null ? void 0 : e.setSearchFormSorterItems) == null || I.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), c ?
|
|
98
|
+
}), (I = e == null ? void 0 : e.setSearchFormSorterItems) == null || I.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), c ? r.manual || (x = e == null ? void 0 : e.submitWith) == null || x.call(e) : (B = e == null ? void 0 : e.submit) == null || B.call(e)), c = !1;
|
|
99
99
|
});
|
|
100
100
|
}, w = {
|
|
101
101
|
getViewList: async (t) => {
|
|
@@ -103,12 +103,12 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
103
103
|
try {
|
|
104
104
|
const {
|
|
105
105
|
tableKey: s
|
|
106
|
-
} = t,
|
|
106
|
+
} = t, n = await ((i = l == null ? void 0 : l.getViewList) == null ? void 0 : i.call(l, {
|
|
107
107
|
tableKey: s
|
|
108
108
|
}));
|
|
109
|
-
return
|
|
109
|
+
return m.value = [v.value, ...n ?? []], p(h()), m.value;
|
|
110
110
|
} catch {
|
|
111
|
-
return
|
|
111
|
+
return m.value = [v.value], p(V), m.value;
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
addView: async (t) => {
|
|
@@ -116,72 +116,72 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
116
116
|
const {
|
|
117
117
|
tableKey: i,
|
|
118
118
|
viewKey: s,
|
|
119
|
-
viewName:
|
|
120
|
-
isDefault:
|
|
121
|
-
viewConfig:
|
|
119
|
+
viewName: n,
|
|
120
|
+
isDefault: o,
|
|
121
|
+
viewConfig: u
|
|
122
122
|
} = t;
|
|
123
123
|
await ((f = l == null ? void 0 : l.addView) == null ? void 0 : f.call(l, {
|
|
124
124
|
tableKey: i,
|
|
125
125
|
viewKey: s,
|
|
126
|
-
viewName:
|
|
127
|
-
isDefault:
|
|
128
|
-
viewConfig:
|
|
129
|
-
})),
|
|
130
|
-
...
|
|
126
|
+
viewName: n,
|
|
127
|
+
isDefault: o,
|
|
128
|
+
viewConfig: u
|
|
129
|
+
})), o && (m.value = m.value.map((a) => ({
|
|
130
|
+
...a,
|
|
131
131
|
isDefault: !1
|
|
132
|
-
}))),
|
|
132
|
+
}))), m.value = [...m.value, {
|
|
133
133
|
viewKey: s,
|
|
134
|
-
viewName:
|
|
135
|
-
isDefault:
|
|
136
|
-
viewConfig:
|
|
134
|
+
viewName: n,
|
|
135
|
+
isDefault: o,
|
|
136
|
+
viewConfig: u
|
|
137
137
|
}], p(s);
|
|
138
138
|
},
|
|
139
139
|
changeView: async (t) => {
|
|
140
|
-
var
|
|
140
|
+
var a;
|
|
141
141
|
const {
|
|
142
142
|
tableKey: i,
|
|
143
143
|
viewKey: s,
|
|
144
|
-
viewName:
|
|
145
|
-
isDefault:
|
|
146
|
-
viewConfig:
|
|
144
|
+
viewName: n,
|
|
145
|
+
isDefault: o,
|
|
146
|
+
viewConfig: u
|
|
147
147
|
} = t;
|
|
148
|
-
await ((
|
|
148
|
+
await ((a = l == null ? void 0 : l.changeView) == null ? void 0 : a.call(l, {
|
|
149
149
|
tableKey: i,
|
|
150
150
|
viewKey: s,
|
|
151
|
-
viewName:
|
|
152
|
-
isDefault:
|
|
153
|
-
viewConfig:
|
|
154
|
-
})),
|
|
151
|
+
viewName: n,
|
|
152
|
+
isDefault: o,
|
|
153
|
+
viewConfig: u
|
|
154
|
+
})), o && (m.value = m.value.map((y) => ({
|
|
155
155
|
...y,
|
|
156
156
|
isDefault: !1
|
|
157
157
|
})));
|
|
158
|
-
const f =
|
|
159
|
-
f && (f.viewName =
|
|
158
|
+
const f = m.value.find((y) => y.viewKey === s);
|
|
159
|
+
f && (f.viewName = n, f.isDefault = o, f.viewConfig = u), p(s);
|
|
160
160
|
},
|
|
161
161
|
removeView: async (t) => {
|
|
162
|
-
var
|
|
162
|
+
var n;
|
|
163
163
|
const {
|
|
164
164
|
tableKey: i,
|
|
165
165
|
viewKey: s
|
|
166
166
|
} = t;
|
|
167
|
-
await ((
|
|
167
|
+
await ((n = l == null ? void 0 : l.removeView) == null ? void 0 : n.call(l, {
|
|
168
168
|
tableKey: i,
|
|
169
169
|
viewKey: s
|
|
170
|
-
})),
|
|
170
|
+
})), m.value = m.value.filter((o) => o.viewKey !== s), s === d.value && p(h());
|
|
171
171
|
}
|
|
172
172
|
}, Q = {
|
|
173
|
-
tableKey:
|
|
173
|
+
tableKey: r.tableKey,
|
|
174
174
|
currentViewKey: d,
|
|
175
175
|
changeCurrentViewKey: p,
|
|
176
176
|
popoverOpen: q,
|
|
177
177
|
menuOpen: F,
|
|
178
|
-
viewList:
|
|
178
|
+
viewList: m,
|
|
179
179
|
viewListCRUD: w,
|
|
180
180
|
saveDataSource: e
|
|
181
181
|
};
|
|
182
|
-
return le(Q), U(() =>
|
|
182
|
+
return le(Q), U(() => r.tableKey, (t) => {
|
|
183
183
|
var i;
|
|
184
|
-
|
|
184
|
+
me(t) && (c = !0, (i = w == null ? void 0 : w.getViewList) == null || i.call(w, {
|
|
185
185
|
tableKey: t
|
|
186
186
|
}));
|
|
187
187
|
}, {
|
|
@@ -4,8 +4,8 @@ export interface SaveDataSource {
|
|
|
4
4
|
getSearchFormValues?: (transform?: boolean) => (Partial<Recordable> & Recordable<any>) | undefined;
|
|
5
5
|
setSearchFormValues?: (values: Partial<Recordable>) => void;
|
|
6
6
|
submit?: () => void;
|
|
7
|
+
submitWith?: () => void;
|
|
7
8
|
reset?: () => void;
|
|
8
|
-
refresh?: () => void;
|
|
9
9
|
getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
|
|
10
10
|
setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
11
11
|
resetSearchFormSorterItems?: () => void;
|