@aplus-frontend/ui 7.15.7 → 7.16.0
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/ag-grid/components/header-cell/index.vue2.mjs +56 -41
- package/es/src/ag-grid/context.d.ts +8 -0
- package/es/src/ag-grid/context.mjs +18 -7
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
- package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
- package/es/src/ag-grid/index.vue.mjs +270 -255
- package/es/src/ag-grid/interface.d.ts +20 -1
- package/es/src/ag-grid/style/custom-header.mjs +22 -13
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
- package/es/src/ap-table/style/setting.mjs +30 -27
- package/es/src/business/ag-grid-modal/interface.d.ts +3 -1
- package/es/src/business/ag-grid-modal/utils.d.ts +3 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +32 -31
- package/es/src/business/ap-view/ap-view.vue2.mjs +17 -17
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +20 -20
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +38 -38
- package/es/src/business/ap-view/hooks/use-view-provide.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +1 -0
- package/es/src/locale/lang/zh-cn.mjs +1 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/context.d.ts +8 -0
- package/lib/src/ag-grid/context.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +20 -1
- package/lib/src/ag-grid/style/custom-header.js +1 -1
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +3 -1
- package/lib/src/business/ag-grid-modal/utils.d.ts +3 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
- package/lib/src/business/ap-view/hooks/use-view-provide.d.ts +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 +6 -6
- package/es/test/setup.d.ts +0 -1
- package/lib/test/setup.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as ye, computed as d, ref as Q, watch as ge, createVNode as m, createElementBlock as X, openBlock as c, Fragment as Y, createBlock as g, createCommentVNode as G, unref as t, mergeProps as V, withCtx as f, createTextVNode as _, toDisplayString as P, normalizeClass as K } from "vue";
|
|
2
2
|
import { DownOutlined as xe } from "@ant-design/icons-vue";
|
|
3
|
-
import { message as q,
|
|
3
|
+
import { message as q, Flex as ve, Tooltip as j, Dropdown as he, Menu as ke, MenuItem as Z } from "@aplus-frontend/antdv";
|
|
4
4
|
import { IconApAdLineAnnotation as B } from "@aplus-frontend/icon";
|
|
5
5
|
import { transformTableParamsNoTimezone as be, isObjectWithContent as A } from "@aplus-frontend/utils";
|
|
6
6
|
import { merge as N } from "lodash-unified";
|
|
@@ -51,7 +51,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
51
51
|
handleExported: {}
|
|
52
52
|
},
|
|
53
53
|
setup(ee) {
|
|
54
|
-
const
|
|
54
|
+
const l = ee, {
|
|
55
55
|
columns: z,
|
|
56
56
|
dataSource: U,
|
|
57
57
|
getSearchFormValues: te,
|
|
@@ -64,19 +64,19 @@ const Je = /* @__PURE__ */ ye({
|
|
|
64
64
|
maxDayRange: 90,
|
|
65
65
|
smartIdentify: !0,
|
|
66
66
|
enableMessage: !0
|
|
67
|
-
} : J.value), b = d(() =>
|
|
67
|
+
} : J.value), b = d(() => l?.dateValidate === !0 ? {
|
|
68
68
|
maxDayRange: 90,
|
|
69
69
|
smartIdentify: !0,
|
|
70
70
|
enableMessage: !0
|
|
71
|
-
} :
|
|
71
|
+
} : l?.dateValidate), S = Q(!1), I = Q(!1), C = d(() => !!l?.disabled || (U !== void 0 ? !U?.value?.length : !1) || S.value), ne = (e) => e === void 0 ? !1 : typeof e == "object" ? N({}, e) : e === !0 ? {} : e, E = (...e) => {
|
|
72
72
|
let a = !1;
|
|
73
73
|
for (const o of e)
|
|
74
74
|
if (o !== void 0)
|
|
75
75
|
if (o === !1)
|
|
76
76
|
a = !1;
|
|
77
77
|
else {
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const s = ne(o);
|
|
79
|
+
s !== !1 && (a = a === !1 ? s : N({}, a, s));
|
|
80
80
|
}
|
|
81
81
|
return a;
|
|
82
82
|
};
|
|
@@ -85,7 +85,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
85
85
|
}, {
|
|
86
86
|
immediate: !0
|
|
87
87
|
});
|
|
88
|
-
const
|
|
88
|
+
const le = d(() => l?.successMessage === !0 ? i("ap.apExportGroup.exportSuccess") : l?.successMessage ? l.successMessage : ""), se = (e = l?.exportField) => {
|
|
89
89
|
const a = "exportFieldList", o = e ?? (H.value === "" ? !0 : H.value) ?? !1;
|
|
90
90
|
return o === !0 ? {
|
|
91
91
|
key: a
|
|
@@ -95,9 +95,9 @@ const Je = /* @__PURE__ */ ye({
|
|
|
95
95
|
} : o;
|
|
96
96
|
}, re = {
|
|
97
97
|
textAlign: "center"
|
|
98
|
-
}, F = d(() =>
|
|
99
|
-
let e =
|
|
100
|
-
return !
|
|
98
|
+
}, F = d(() => l?.selectedRowKeys || []), O = d(() => {
|
|
99
|
+
let e = l?.ifShow;
|
|
100
|
+
return !l?.ifShow && l?.auth && (e = () => W.value?.(l.auth)), e?.() ?? !0;
|
|
101
101
|
});
|
|
102
102
|
async function ue() {
|
|
103
103
|
F.value.length > 0 ? M({
|
|
@@ -110,16 +110,16 @@ const Je = /* @__PURE__ */ ye({
|
|
|
110
110
|
key: e,
|
|
111
111
|
option: a
|
|
112
112
|
}) {
|
|
113
|
-
const o = N({},
|
|
114
|
-
getRequestParams:
|
|
113
|
+
const o = N({}, l, a || {}), {
|
|
114
|
+
getRequestParams: s,
|
|
115
115
|
request: D
|
|
116
116
|
} = o || {}, n = ae?.()?.sort, r = n ? be({
|
|
117
117
|
sort: n
|
|
118
|
-
}) : {}, u =
|
|
118
|
+
}) : {}, u = se(o?.exportField);
|
|
119
119
|
let p = {};
|
|
120
120
|
e === x.SELECT ? p = {
|
|
121
121
|
[o?.idKey || "ids"]: F.value
|
|
122
|
-
} : e === x.ALL && (p =
|
|
122
|
+
} : e === x.ALL && (p = s?.() || te?.(!0) || {});
|
|
123
123
|
const y = o?.getInitialParams?.() || {};
|
|
124
124
|
try {
|
|
125
125
|
S.value = !0;
|
|
@@ -137,12 +137,12 @@ const Je = /* @__PURE__ */ ye({
|
|
|
137
137
|
dateValidate: R
|
|
138
138
|
});
|
|
139
139
|
const me = await Le(async () => await D?.(L));
|
|
140
|
-
o?.successMessage && q.success(
|
|
140
|
+
o?.successMessage && q.success(le.value), (o?.handleExported || oe.value)?.(me, L);
|
|
141
141
|
} finally {
|
|
142
142
|
S.value = !1;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const w = d(() =>
|
|
145
|
+
const w = d(() => l?.groupList?.filter((e) => {
|
|
146
146
|
let a = e?.ifShow;
|
|
147
147
|
return !e?.ifShow && e?.auth && (a = () => W.value?.(e.auth)), a?.() ?? !0;
|
|
148
148
|
})?.map((e, a) => ({
|
|
@@ -164,9 +164,10 @@ const Je = /* @__PURE__ */ ye({
|
|
|
164
164
|
})) || []), ie = () => {
|
|
165
165
|
const e = E(k.value, b.value, ...w.value.map((a) => a.dateValidate));
|
|
166
166
|
return m(ve, {
|
|
167
|
-
|
|
167
|
+
align: "center",
|
|
168
|
+
gap: 4
|
|
168
169
|
}, {
|
|
169
|
-
default: () => [m("span", null, [
|
|
170
|
+
default: () => [m("span", null, [l?.buttonProps?.content ?? i("ap.apExportGroup.export")]), e !== !1 && A(e) ? m(j, {
|
|
170
171
|
title: i("ap.apExportGroup.maxMessage", {
|
|
171
172
|
maxDayRange: e.maxDayRange ?? 90
|
|
172
173
|
})
|
|
@@ -180,7 +181,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
180
181
|
...a,
|
|
181
182
|
[o]: e?.[o]
|
|
182
183
|
} : a, {}), de = (e) => {
|
|
183
|
-
const a = Object.keys(e), o = [],
|
|
184
|
+
const a = Object.keys(e), o = [], s = /* @__PURE__ */ new Set(), D = [];
|
|
184
185
|
for (let n = 0; n < a.length; n++)
|
|
185
186
|
for (let r = n + 1; r < a.length; r++) {
|
|
186
187
|
const u = a[n], p = a[r];
|
|
@@ -198,12 +199,12 @@ const Je = /* @__PURE__ */ ye({
|
|
|
198
199
|
}
|
|
199
200
|
D.sort((n, r) => r.length !== n.length ? r.length - n.length : n.diff - r.diff);
|
|
200
201
|
for (const n of D)
|
|
201
|
-
if (!
|
|
202
|
+
if (!s.has(n.key1) && !s.has(n.key2)) {
|
|
202
203
|
const r = e[n.key1], u = e[n.key2];
|
|
203
204
|
o.push({
|
|
204
205
|
startKey: r < u ? n.key1 : n.key2,
|
|
205
206
|
endKey: r < u ? n.key2 : n.key1
|
|
206
|
-
}),
|
|
207
|
+
}), s.add(n.key1), s.add(n.key2);
|
|
207
208
|
}
|
|
208
209
|
return o;
|
|
209
210
|
}, ce = ({
|
|
@@ -216,7 +217,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
216
217
|
}) => {
|
|
217
218
|
if (a.enableMessage === !1)
|
|
218
219
|
return;
|
|
219
|
-
const o = a.maxDayRange ?? 90,
|
|
220
|
+
const o = a.maxDayRange ?? 90, s = pe(e), D = [...a.smartIdentify ?? !0 ? de(s) : [], ...a.dateKeyList?.filter((n) => s[n.startKey || ""] && s[n.endKey || ""]) ?? []];
|
|
220
221
|
if (D.length === 0) {
|
|
221
222
|
q.warn(a?.emptyTooltip ?? i("ap.apExportGroup.emptyTooltip", {
|
|
222
223
|
maxDayRange: o
|
|
@@ -226,7 +227,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
226
227
|
startKey: r,
|
|
227
228
|
endKey: u
|
|
228
229
|
}) => {
|
|
229
|
-
const p =
|
|
230
|
+
const p = s[r || ""], y = s[u || ""];
|
|
230
231
|
return p !== void 0 && y !== void 0 && !ce({
|
|
231
232
|
startTime: p,
|
|
232
233
|
endTime: y,
|
|
@@ -239,7 +240,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
242
|
};
|
|
242
|
-
return (e, a) => (c(), X(Y, null, [O.value &&
|
|
243
|
+
return (e, a) => (c(), X(Y, null, [O.value && l.type === "button" ? (c(), g(t($), V({
|
|
243
244
|
key: 0
|
|
244
245
|
}, {
|
|
245
246
|
...e.$attrs
|
|
@@ -250,7 +251,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
250
251
|
"min-width": "",
|
|
251
252
|
onClick: ue
|
|
252
253
|
}), {
|
|
253
|
-
default: f(() => [_(P(
|
|
254
|
+
default: f(() => [_(P(l?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(A)(E(k.value, b.value)) ? (c(), g(t(j), {
|
|
254
255
|
key: 0,
|
|
255
256
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
256
257
|
maxDayRange: E(k.value, b.value).maxDayRange ?? 90
|
|
@@ -262,7 +263,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
262
263
|
_: 1
|
|
263
264
|
}, 8, ["title"])) : G("", !0)]),
|
|
264
265
|
_: 1
|
|
265
|
-
}, 16, ["class", "disabled", "loading"])) : G("", !0), O.value &&
|
|
266
|
+
}, 16, ["class", "disabled", "loading"])) : G("", !0), O.value && l.type === "dropdown" ? (c(), g(t(he), {
|
|
266
267
|
key: 1,
|
|
267
268
|
open: I.value,
|
|
268
269
|
"onUpdate:open": a[0] || (a[0] = (o) => I.value = o),
|
|
@@ -292,7 +293,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
292
293
|
}, {
|
|
293
294
|
loading: S.value
|
|
294
295
|
}), {
|
|
295
|
-
default: f(() => [_(P(
|
|
296
|
+
default: f(() => [_(P(l?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(A)(E(k.value, b.value)) ? (c(), g(t(j), {
|
|
296
297
|
key: 0,
|
|
297
298
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
298
299
|
maxDayRange: E(k.value, b.value).maxDayRange ?? 90
|
|
@@ -306,7 +307,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
306
307
|
_: 1
|
|
307
308
|
}, 16, ["loading"])]),
|
|
308
309
|
_: 1
|
|
309
|
-
}, 8, ["open", "class", "disabled"])) : G("", !0), O.value &&
|
|
310
|
+
}, 8, ["open", "class", "disabled"])) : G("", !0), O.value && l.type === "group" ? (c(), X(Y, {
|
|
310
311
|
key: 2
|
|
311
312
|
}, [w.value.length === 1 ? (c(), g(t($), V({
|
|
312
313
|
key: 0
|
|
@@ -319,7 +320,7 @@ const Je = /* @__PURE__ */ ye({
|
|
|
319
320
|
"min-width": "",
|
|
320
321
|
onClick: w.value?.[0]?.onClick
|
|
321
322
|
}), {
|
|
322
|
-
default: f(() => [_(P(w.value?.[0]?.content ??
|
|
323
|
+
default: f(() => [_(P(w.value?.[0]?.content ?? l?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(A)(E(k.value, b.value, w.value?.[0]?.dateValidate)) ? (c(), g(t(j), {
|
|
323
324
|
key: 0,
|
|
324
325
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
325
326
|
maxDayRange: E(k.value, b.value, w.value?.[0]?.dateValidate).maxDayRange ?? 90
|
|
@@ -340,9 +341,9 @@ const Je = /* @__PURE__ */ ye({
|
|
|
340
341
|
disabled: C.value,
|
|
341
342
|
loading: S.value,
|
|
342
343
|
"button-props": {
|
|
343
|
-
...
|
|
344
|
+
...l.buttonProps,
|
|
344
345
|
content: ie(),
|
|
345
|
-
type:
|
|
346
|
+
type: l?.buttonProps?.type ?? "default"
|
|
346
347
|
},
|
|
347
348
|
"menu-list": w.value
|
|
348
349
|
}), null, 16, ["class", "disabled", "loading", "button-props", "menu-list"]))], 64)) : G("", !0)], 64));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, computed as
|
|
1
|
+
import { defineComponent as U, computed as K, ref as y, createVNode as b, watch as Y, createBlock as z, openBlock as M, unref as u, mergeProps as R, withCtx as q, createElementVNode as H, normalizeClass as J } from "vue";
|
|
2
2
|
import { isValid as Q } from "@aplus-frontend/utils";
|
|
3
3
|
import { useInjectApTable as X } from "../../ap-table/context.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -46,7 +46,7 @@ const De = /* @__PURE__ */ U({
|
|
|
46
46
|
b: d
|
|
47
47
|
} = se("ap-view"), {
|
|
48
48
|
t: O
|
|
49
|
-
} = oe(),
|
|
49
|
+
} = oe(), g = ae("ap-view"), V = K(() => ({
|
|
50
50
|
viewKey: c,
|
|
51
51
|
viewName: O("ap.apView.systemView")
|
|
52
52
|
})), {
|
|
@@ -59,15 +59,15 @@ const De = /* @__PURE__ */ U({
|
|
|
59
59
|
setSearchFormSorterItems: A,
|
|
60
60
|
resetSearchFormSorterItems: T
|
|
61
61
|
} = X(), W = y(!1), S = y(!1), p = y("");
|
|
62
|
-
let f = !1,
|
|
62
|
+
let f = !1, D = !1;
|
|
63
63
|
const j = {
|
|
64
64
|
dropdownType: "dropdown",
|
|
65
|
-
content:
|
|
65
|
+
content: b(re, {
|
|
66
66
|
maxViewNum: s.maxViewNum
|
|
67
67
|
}, null)
|
|
68
|
-
}, i = y([V.value]), G =
|
|
68
|
+
}, i = y([V.value]), G = K(() => i.value.map((t) => ({
|
|
69
69
|
id: t.viewKey,
|
|
70
|
-
content:
|
|
70
|
+
content: b(ne, {
|
|
71
71
|
view: t
|
|
72
72
|
}, null)
|
|
73
73
|
}))), r = {
|
|
@@ -83,7 +83,7 @@ const De = /* @__PURE__ */ U({
|
|
|
83
83
|
}, v = {
|
|
84
84
|
..._.value,
|
|
85
85
|
...s.viewCacheOption
|
|
86
|
-
},
|
|
86
|
+
}, C = () => s.isDefaultSystemView ? c : (s.isFirstDefaultSystemView || D) && f ? c : i.value.find((a) => a.isDefault)?.viewKey ?? c, m = (t) => {
|
|
87
87
|
p.value = t;
|
|
88
88
|
const a = i.value.find((e) => e.viewKey === p.value);
|
|
89
89
|
a && setTimeout(() => {
|
|
@@ -95,7 +95,7 @@ const De = /* @__PURE__ */ U({
|
|
|
95
95
|
})) ?? []].reduce((e, o) => (a.viewConfig?.searchForm?.[o.name] && (e[o.name] = a.viewConfig?.searchForm?.[o.name]), e), {}) ?? {}
|
|
96
96
|
}), r?.setSearchFormSorterItems?.(a.viewConfig?.sorterItems ?? []), f ? s.manual || r?.submitWith?.() : r?.submit?.()), f = !1;
|
|
97
97
|
});
|
|
98
|
-
},
|
|
98
|
+
}, F = {
|
|
99
99
|
getViewList: async (t) => {
|
|
100
100
|
try {
|
|
101
101
|
const {
|
|
@@ -103,7 +103,7 @@ const De = /* @__PURE__ */ U({
|
|
|
103
103
|
} = t, e = await v?.getViewList?.({
|
|
104
104
|
tableKey: a
|
|
105
105
|
});
|
|
106
|
-
return i.value = [V.value, ...e ?? []], m(
|
|
106
|
+
return i.value = [V.value, ...e ?? []], m(C()), i.value;
|
|
107
107
|
} catch {
|
|
108
108
|
return i.value = [V.value], m(c), i.value;
|
|
109
109
|
}
|
|
@@ -161,43 +161,43 @@ const De = /* @__PURE__ */ U({
|
|
|
161
161
|
await v?.removeView?.({
|
|
162
162
|
tableKey: a,
|
|
163
163
|
viewKey: e
|
|
164
|
-
}), i.value = i.value.filter((o) => o.viewKey !== e), e === p.value && m(
|
|
164
|
+
}), i.value = i.value.filter((o) => o.viewKey !== e), e === p.value && m(C());
|
|
165
165
|
}
|
|
166
166
|
}, $ = {
|
|
167
|
-
tableKey: s.tableKey,
|
|
167
|
+
tableKey: K(() => s.tableKey),
|
|
168
168
|
currentViewKey: p,
|
|
169
169
|
changeCurrentViewKey: m,
|
|
170
170
|
popoverOpen: W,
|
|
171
171
|
menuOpen: S,
|
|
172
172
|
viewList: i,
|
|
173
|
-
viewListCRUD:
|
|
173
|
+
viewListCRUD: F,
|
|
174
174
|
saveDataSource: r
|
|
175
175
|
};
|
|
176
176
|
return ee($), Y(() => s.tableKey, (t) => {
|
|
177
|
-
Q(t) && (f = !0,
|
|
177
|
+
Q(t) && (f = !0, F?.getViewList?.({
|
|
178
178
|
tableKey: t
|
|
179
179
|
}));
|
|
180
180
|
}, {
|
|
181
181
|
immediate: !0
|
|
182
182
|
}), N({
|
|
183
183
|
setFirstDefaultSystemView: (t) => {
|
|
184
|
-
|
|
184
|
+
D = t;
|
|
185
185
|
}
|
|
186
186
|
}), (t, a) => (M(), z(u(Z), R({
|
|
187
187
|
...t.$attrs
|
|
188
188
|
}, {
|
|
189
189
|
open: S.value,
|
|
190
190
|
"onUpdate:open": a[0] || (a[0] = (e) => S.value = e),
|
|
191
|
-
class: [u(d)(), u(
|
|
191
|
+
class: [u(d)(), u(g)],
|
|
192
192
|
"button-props": j,
|
|
193
193
|
"menu-list": G.value,
|
|
194
|
-
"overlay-class-name": [u(d)("overlay"), u(
|
|
194
|
+
"overlay-class-name": [u(d)("overlay"), u(g)],
|
|
195
195
|
trigger: "click",
|
|
196
196
|
placement: "bottom"
|
|
197
197
|
}), {
|
|
198
198
|
icon: q(() => [H("div", {
|
|
199
199
|
class: J([u(d)("icon")])
|
|
200
|
-
}, [
|
|
200
|
+
}, [b(te)], 2)]),
|
|
201
201
|
_: 1
|
|
202
202
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
203
203
|
}
|
|
@@ -243,7 +243,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
243
243
|
};
|
|
244
244
|
lg: {
|
|
245
245
|
type: PropType<string | number | ColSize>;
|
|
246
|
-
default: string | number |
|
|
246
|
+
default: string | number | ColSize;
|
|
247
247
|
};
|
|
248
248
|
xl: {
|
|
249
249
|
type: PropType<string | number | ColSize>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as T, ref as z, computed as $, watch as
|
|
2
|
-
import { Popover as R, Tooltip as U, Space as
|
|
1
|
+
import { defineComponent as T, ref as z, computed as $, watch as K, createBlock as L, openBlock as Y, unref as e, withCtx as t, createElementVNode as u, normalizeClass as r, createVNode as a, createSlots as E, toDisplayString as s, createTextVNode as d } from "vue";
|
|
2
|
+
import { Popover as R, Tooltip as U, Space as _, Checkbox as j } from "@aplus-frontend/antdv";
|
|
3
3
|
import q from "dayjs";
|
|
4
4
|
import { cloneDeep as g } from "lodash-unified";
|
|
5
5
|
import "../../../ap-button/index.mjs";
|
|
@@ -20,21 +20,21 @@ const ce = /* @__PURE__ */ T({
|
|
|
20
20
|
maxViewNum: {}
|
|
21
21
|
},
|
|
22
22
|
setup(N) {
|
|
23
|
-
const f = N, { t: o } = G(), { b: i } = H("ap-view"), m = A("ap-view"), V = z(), { tableKey:
|
|
23
|
+
const f = N, { t: o } = G(), { b: i } = H("ap-view"), m = A("ap-view"), V = z(), { tableKey: b, popoverOpen: p, viewList: c, saveDataSource: h, viewListCRUD: F } = M(), y = $({
|
|
24
24
|
get: () => p.value && c.value.length < f.maxViewNum + 1,
|
|
25
|
-
set: (
|
|
26
|
-
c.value.length < f.maxViewNum + 1 && (p.value =
|
|
25
|
+
set: (n) => {
|
|
26
|
+
c.value.length < f.maxViewNum + 1 && (p.value = n);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
K(p, (n) => {
|
|
30
|
+
n && (V.value?.resetFields(), setTimeout(() => {
|
|
31
31
|
V.value?.setFieldsValue({
|
|
32
|
-
isDefault: !c.value.some((
|
|
32
|
+
isDefault: !c.value.some((l) => l.isDefault)
|
|
33
33
|
});
|
|
34
34
|
}));
|
|
35
35
|
});
|
|
36
|
-
const D = async (
|
|
37
|
-
const { viewName:
|
|
36
|
+
const D = async (n) => {
|
|
37
|
+
const { viewName: l, isDefault: v } = n, S = P(), k = g(
|
|
38
38
|
h?.getSearchFormValues?.(
|
|
39
39
|
!!h?.searchFormTransform
|
|
40
40
|
)
|
|
@@ -42,17 +42,17 @@ const ce = /* @__PURE__ */ T({
|
|
|
42
42
|
searchForm: k,
|
|
43
43
|
sorterItems: C
|
|
44
44
|
};
|
|
45
|
-
await
|
|
46
|
-
tableKey:
|
|
45
|
+
await F.addView?.({
|
|
46
|
+
tableKey: b.value,
|
|
47
47
|
viewKey: S,
|
|
48
|
-
viewName:
|
|
48
|
+
viewName: l,
|
|
49
49
|
isDefault: v,
|
|
50
50
|
viewConfig: I
|
|
51
51
|
}), p.value = !1;
|
|
52
52
|
};
|
|
53
|
-
return (
|
|
54
|
-
open:
|
|
55
|
-
"onUpdate:open":
|
|
53
|
+
return (n, l) => (Y(), L(e(R), {
|
|
54
|
+
open: y.value,
|
|
55
|
+
"onUpdate:open": l[1] || (l[1] = (v) => y.value = v),
|
|
56
56
|
placement: "bottom",
|
|
57
57
|
trigger: "click",
|
|
58
58
|
arrow: !1,
|
|
@@ -113,11 +113,11 @@ const ce = /* @__PURE__ */ T({
|
|
|
113
113
|
class: r([e(i)("main-content-popover-btn"), e(m)])
|
|
114
114
|
}, {
|
|
115
115
|
default: t(() => [
|
|
116
|
-
a(e(
|
|
116
|
+
a(e(_), { size: 8 }, {
|
|
117
117
|
default: t(() => [
|
|
118
118
|
a(e(x), {
|
|
119
119
|
size: "small",
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: l[0] || (l[0] = (v) => p.value = !1)
|
|
121
121
|
}, {
|
|
122
122
|
default: t(() => [
|
|
123
123
|
d(s(e(o)("ap.apView.cancel")), 1)
|
|
@@ -153,9 +153,9 @@ const ce = /* @__PURE__ */ T({
|
|
|
153
153
|
hashId: e(m)
|
|
154
154
|
})
|
|
155
155
|
}, [
|
|
156
|
-
a(e(U), { placement: "bottom" },
|
|
156
|
+
a(e(U), { placement: "bottom" }, E({
|
|
157
157
|
default: t(() => [
|
|
158
|
-
a(e(
|
|
158
|
+
a(e(_), { size: 4 }, {
|
|
159
159
|
default: t(() => [
|
|
160
160
|
a(O, {
|
|
161
161
|
class: r([e(i)("icon"), e(m)])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, ref as V, watch as $, createElementBlock as m, openBlock as c, normalizeClass as C, unref as e, createElementVNode as a, createCommentVNode as f, toDisplayString as r, createVNode as n, withModifiers as d, withCtx as v } from "vue";
|
|
2
2
|
import { Space as x, Popconfirm as B } from "@aplus-frontend/antdv";
|
|
3
3
|
import { ApField as F } from "../../../ap-field/index.mjs";
|
|
4
4
|
import "../../../ap-form/ap-form.vue.mjs";
|
|
@@ -8,75 +8,75 @@ import "../../ap-tag/index.mjs";
|
|
|
8
8
|
import { useViewInject as M } from "../hooks/use-view-provide.mjs";
|
|
9
9
|
import P from "../icons/line-delete.vue.mjs";
|
|
10
10
|
import Y from "../style/index.mjs";
|
|
11
|
-
import { SYSTEM_VIEW_KEY as
|
|
11
|
+
import { SYSTEM_VIEW_KEY as K } from "../utils/enum.mjs";
|
|
12
12
|
import { useNamespace as j } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import { useLocale as A } from "../../../config-provider/hooks/use-locale.mjs";
|
|
14
14
|
import O from "../../ap-tag/ap-tag.vue.mjs";
|
|
15
|
-
import
|
|
15
|
+
import N from "../../../ap-form/ap-form.vue2.mjs";
|
|
16
16
|
const U = { class: "menu-list-content-name" }, W = ["title"], q = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "menu-list-content-default"
|
|
19
|
-
}, G = { class: "menu-list-content-action-delete" }, H = { class: "menu-list-content-edit" }, ve = /* @__PURE__ */
|
|
19
|
+
}, G = { class: "menu-list-content-action-delete" }, H = { class: "menu-list-content-edit" }, ve = /* @__PURE__ */ T({
|
|
20
20
|
__name: "menu-list-content",
|
|
21
21
|
props: {
|
|
22
22
|
view: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const { b:
|
|
24
|
+
setup(h) {
|
|
25
|
+
const { b: l } = j("ap-view"), y = Y("ap-view"), { token: D } = L(), { t: o } = A(), t = h, {
|
|
26
26
|
currentViewKey: S,
|
|
27
|
-
changeCurrentViewKey:
|
|
27
|
+
changeCurrentViewKey: b,
|
|
28
28
|
viewListCRUD: p,
|
|
29
29
|
tableKey: w,
|
|
30
|
-
menuOpen:
|
|
31
|
-
} = M(),
|
|
32
|
-
|
|
33
|
-
},
|
|
30
|
+
menuOpen: k
|
|
31
|
+
} = M(), s = V(!1), _ = V(), g = () => {
|
|
32
|
+
b(t.view.viewKey), k.value = !1;
|
|
33
|
+
}, E = () => {
|
|
34
34
|
p?.changeView?.({
|
|
35
35
|
...t.view,
|
|
36
|
-
tableKey: w,
|
|
36
|
+
tableKey: w.value,
|
|
37
37
|
isDefault: !0
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, z = () => {
|
|
40
40
|
p?.removeView?.({
|
|
41
|
-
tableKey: w,
|
|
41
|
+
tableKey: w.value,
|
|
42
42
|
viewKey: t.view.viewKey
|
|
43
43
|
});
|
|
44
|
-
},
|
|
45
|
-
const u = await
|
|
44
|
+
}, I = async () => {
|
|
45
|
+
const u = await _.value?.validate?.();
|
|
46
46
|
p?.changeView?.({
|
|
47
47
|
...t.view,
|
|
48
|
-
tableKey: w,
|
|
48
|
+
tableKey: w.value,
|
|
49
49
|
viewName: u?.viewName || t.view.viewName
|
|
50
|
-
}),
|
|
50
|
+
}), s.value = !1;
|
|
51
51
|
};
|
|
52
|
-
return
|
|
53
|
-
() =>
|
|
52
|
+
return $(
|
|
53
|
+
() => k.value,
|
|
54
54
|
(u) => {
|
|
55
|
-
u && (
|
|
55
|
+
u && (s.value = !1);
|
|
56
56
|
}
|
|
57
|
-
), (u, i) =>
|
|
57
|
+
), (u, i) => s.value === !1 ? (c(), m("div", {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: C({
|
|
60
|
-
[e(
|
|
61
|
-
[e(
|
|
62
|
-
[e(
|
|
63
|
-
[e(
|
|
60
|
+
[e(l)()]: !0,
|
|
61
|
+
[e(l)("menu-list-content")]: !0,
|
|
62
|
+
[e(l)("menu-list-content-active")]: t.view?.viewKey === e(S),
|
|
63
|
+
[e(y)]: !0
|
|
64
64
|
}),
|
|
65
|
-
onClick:
|
|
65
|
+
onClick: g
|
|
66
66
|
}, [
|
|
67
67
|
a("div", U, [
|
|
68
68
|
a("span", {
|
|
69
69
|
title: t.view?.viewName
|
|
70
70
|
}, r(t.view?.viewName), 9, W)
|
|
71
71
|
]),
|
|
72
|
-
t.view?.viewKey !== e(
|
|
72
|
+
t.view?.viewKey !== e(K) && t.view?.isDefault ? (c(), m("div", q, [
|
|
73
73
|
n(e(O), {
|
|
74
74
|
text: e(o)("ap.apView.default"),
|
|
75
75
|
size: "small",
|
|
76
76
|
color: e(D).colorPrimary
|
|
77
77
|
}, null, 8, ["text", "color"])
|
|
78
78
|
])) : f("", !0),
|
|
79
|
-
t.view?.viewKey !== e(
|
|
79
|
+
t.view?.viewKey !== e(K) ? (c(), m("div", {
|
|
80
80
|
key: 1,
|
|
81
81
|
class: "menu-list-content-action",
|
|
82
82
|
onClick: i[1] || (i[1] = d(() => {
|
|
@@ -86,18 +86,18 @@ const U = { class: "menu-list-content-name" }, W = ["title"], q = {
|
|
|
86
86
|
default: v(() => [
|
|
87
87
|
a("div", {
|
|
88
88
|
class: "menu-list-content-action-text",
|
|
89
|
-
onClick: i[0] || (i[0] = d((
|
|
89
|
+
onClick: i[0] || (i[0] = d((R) => s.value = !0, ["stop"]))
|
|
90
90
|
}, r(e(o)("ap.apView.rename")), 1),
|
|
91
91
|
t.view?.isDefault ? f("", !0) : (c(), m("div", {
|
|
92
92
|
key: 0,
|
|
93
93
|
class: "menu-list-content-action-text",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: E
|
|
95
95
|
}, r(e(o)("ap.apView.setDefault")), 1)),
|
|
96
96
|
a("div", G, [
|
|
97
97
|
n(e(B), {
|
|
98
98
|
title: e(o)("ap.apView.deleteTip"),
|
|
99
99
|
"ok-text": e(o)("ap.apView.ok"),
|
|
100
|
-
onConfirm:
|
|
100
|
+
onConfirm: z
|
|
101
101
|
}, {
|
|
102
102
|
default: v(() => [
|
|
103
103
|
n(P)
|
|
@@ -111,13 +111,13 @@ const U = { class: "menu-list-content-name" }, W = ["title"], q = {
|
|
|
111
111
|
])) : f("", !0)
|
|
112
112
|
], 2)) : (c(), m("div", {
|
|
113
113
|
key: 1,
|
|
114
|
-
class: C([e(
|
|
114
|
+
class: C([e(l)("menu-list-content"), e(l)("menu-list-content-edit"), e(y)]),
|
|
115
115
|
onClick: i[3] || (i[3] = d(() => {
|
|
116
116
|
}, ["stop"]))
|
|
117
117
|
}, [
|
|
118
|
-
n(
|
|
118
|
+
n(N, {
|
|
119
119
|
ref_key: "formRef",
|
|
120
|
-
ref:
|
|
120
|
+
ref: _,
|
|
121
121
|
"initial-values": {
|
|
122
122
|
viewName: t.view?.viewName
|
|
123
123
|
}
|
|
@@ -126,7 +126,7 @@ const U = { class: "menu-list-content-name" }, W = ["title"], q = {
|
|
|
126
126
|
a("div", H, [
|
|
127
127
|
n(e(x), { size: 8 }, {
|
|
128
128
|
default: v(() => [
|
|
129
|
-
n(
|
|
129
|
+
n(N.FormItem, { name: "viewName" }, {
|
|
130
130
|
default: v(() => [
|
|
131
131
|
n(e(F).Text, { maxlength: 20 })
|
|
132
132
|
]),
|
|
@@ -134,11 +134,11 @@ const U = { class: "menu-list-content-name" }, W = ["title"], q = {
|
|
|
134
134
|
}),
|
|
135
135
|
a("div", {
|
|
136
136
|
class: "menu-list-content-action-text",
|
|
137
|
-
onClick:
|
|
137
|
+
onClick: I
|
|
138
138
|
}, r(e(o)("ap.apView.save")), 1),
|
|
139
139
|
a("div", {
|
|
140
140
|
class: "menu-list-content-action-text",
|
|
141
|
-
onClick: i[2] || (i[2] = (
|
|
141
|
+
onClick: i[2] || (i[2] = (R) => s.value = !1)
|
|
142
142
|
}, r(e(o)("ap.apView.cancel")), 1)
|
|
143
143
|
]),
|
|
144
144
|
_: 1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { SaveDataSource, ViewCacheOption, ViewListModel } from '../interface';
|
|
3
3
|
type DataModel = {
|
|
4
|
-
tableKey: string
|
|
4
|
+
tableKey: Ref<string>;
|
|
5
5
|
currentViewKey: Ref<string>;
|
|
6
6
|
changeCurrentViewKey: (key: string) => void;
|
|
7
7
|
popoverOpen: Ref<boolean>;
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.
|
|
1
|
+
declare const _default: "7.16.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@ant-design/icons-vue"),y=require("@aplus-frontend/antdv/es/theme/internal"),d=require("../../context.js"),w=require("../../../ap-table/utils.js");require("../../../config-provider/index.js");require("../../../render/index.js");const z=require("../../style/custom-header.js"),f=require("../../../config-provider/hooks/use-namespace.js"),O=require("../../../render/render.js"),V=e.defineComponent({__name:"index",props:{params:{}},setup(C){const t=C,{b:g,e:n}=f.useNamespace("ag-custom-header"),{be:k,bem:v}=f.useNamespace("ag-grid"),S=z.default("ag-custom-header"),[,b]=y.useToken(),{sorter:u,setSorter:h}=d.useInjectSorter(),{expandable:x}=d.useInjectExpandable(),a=e.computed(()=>t.params.column.sorter),I=e.computed(()=>t.params.columnGroup?.getLeafColumns?.()?.some(r=>r.getColDef().columnGroupShow)),s=e.computed(()=>{const r=t.params.columnGroup?.getGroupId?.();return r?x.value[r]??!1:!1});function q(r){return r?r==="asc"?"desc":null:"asc"}const c=e.computed(()=>t.params?.column?.getColId?.());function B(){if(!a.value)return;const l=t.params.column.getColId(),E=t.params.column.getSort(),m=q(E),p=t.params.api,T=p.getColumnState().map(i=>({...i,sort:i.colId===l?m:null}));p.applyColumnState({state:T}),h({[l]:m})}function N(){t.params.setExpanded(!s.value)}return(r,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(g)(),{sortable:a.value},`align-${r.params.column.align||"left"}`,e.unref(S)]),onClick:B},[e.createVNode(e.unref(O.default),{renderer:()=>e.unref(w.getTableTitle)(r.params.column,[e.unref(k)("table-header","title"),r.params.column.tooltip?"":e.unref(v)("table-header","title","single")],r.params.headerCell,e.unref(b).colorTextTertiary)},null,8,["renderer"]),a.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("sort-wrapper"))},[e.createVNode(e.unref(o.CaretUpOutlined),{class:e.normalizeClass({[e.unref(n)("sorter-up")]:!0,active:e.unref(u)[c.value]==="asc"})},null,8,["class"]),e.createVNode(e.unref(o.CaretDownOutlined),{class:e.normalizeClass({[e.unref(n)("sorter-down")]:!0,active:e.unref(u)[c.value]==="desc"})},null,8,["class"])],2)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(n)("expand-wrapper")),onClick:e.withModifiers(N,["stop"])},[s.value?(e.openBlock(),e.createBlock(e.unref(o.CaretLeftOutlined),{key:0})):(e.openBlock(),e.createBlock(e.unref(o.CaretRightOutlined),{key:1}))],2)):e.createCommentVNode("",!0)],2))}});exports.default=V;
|