@aplus-frontend/ui 7.13.6 → 7.13.7
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/business/ap-export-group/ApExportGroup.vue2.mjs +168 -157
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { message as
|
|
4
|
-
import { usePermission as
|
|
5
|
-
import { IconApAdLineAnnotation as
|
|
6
|
-
import { transformTableParamsNoTimezone as
|
|
7
|
-
import { merge as
|
|
1
|
+
import { defineComponent as fe, computed as y, ref as Q, watch as me, createVNode as f, createElementBlock as X, openBlock as d, Fragment as Y, createBlock as g, createCommentVNode as G, unref as t, mergeProps as V, withCtx as c, createTextVNode as _, toDisplayString as A, normalizeClass as F } from "vue";
|
|
2
|
+
import { DownOutlined as ye } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as O, Space as ge, Tooltip as K, Dropdown as xe, Menu as ve, MenuItem as Z } from "@aplus-frontend/antdv";
|
|
4
|
+
import { usePermission as he } from "@aplus-frontend/hooks";
|
|
5
|
+
import { IconApAdLineAnnotation as j } from "@aplus-frontend/icon";
|
|
6
|
+
import { transformTableParamsNoTimezone as ke, isObjectWithContent as M } from "@aplus-frontend/utils";
|
|
7
|
+
import { merge as q } from "lodash-unified";
|
|
8
8
|
import "../../ap-button/index.mjs";
|
|
9
|
-
import { useInjectApTable as
|
|
9
|
+
import { useInjectApTable as be } from "../../ap-table/context.mjs";
|
|
10
10
|
import "../../config-provider/index.mjs";
|
|
11
|
-
import { ApBatchActionGroup as
|
|
12
|
-
import { convertExportField as
|
|
13
|
-
import { handleExportDownload as
|
|
14
|
-
import { ApExportGroupActionType as
|
|
15
|
-
import
|
|
16
|
-
import { useNamespace as
|
|
17
|
-
import { useLocale as
|
|
18
|
-
import { useGlobalConfig as
|
|
11
|
+
import { ApBatchActionGroup as Ee } from "../ap-batch-action-group/index.mjs";
|
|
12
|
+
import { convertExportField as we } from "./convertExportField.mjs";
|
|
13
|
+
import { handleExportDownload as De } from "./handleExportDownload.mjs";
|
|
14
|
+
import { ApExportGroupActionType as x } from "./interface.mjs";
|
|
15
|
+
import Le from "./style/index.mjs";
|
|
16
|
+
import { useNamespace as Re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
import { useLocale as Se } from "../../config-provider/hooks/use-locale.mjs";
|
|
18
|
+
import { useGlobalConfig as Ce } from "../../config-provider/hooks/use-global-config.mjs";
|
|
19
19
|
import N from "../../ap-button/ap-button.vue.mjs";
|
|
20
|
-
const
|
|
20
|
+
const He = /* @__PURE__ */ fe({
|
|
21
21
|
__name: "ApExportGroup",
|
|
22
22
|
props: {
|
|
23
23
|
type: {
|
|
@@ -53,28 +53,39 @@ const We = /* @__PURE__ */ ce({
|
|
|
53
53
|
setup(ee) {
|
|
54
54
|
const {
|
|
55
55
|
hasPermission: $
|
|
56
|
-
} =
|
|
56
|
+
} = he(), s = ee, {
|
|
57
57
|
columns: z,
|
|
58
58
|
dataSource: U,
|
|
59
59
|
getSearchFormValues: te,
|
|
60
60
|
getLastParams: ae
|
|
61
|
-
} =
|
|
62
|
-
b:
|
|
63
|
-
} =
|
|
61
|
+
} = be(), {
|
|
62
|
+
b: v
|
|
63
|
+
} = Re("ap-export-group"), h = Le("ap-export-group"), {
|
|
64
64
|
t: i
|
|
65
|
-
} =
|
|
65
|
+
} = Se(), W = Ce("apExportGroup"), H = y(() => W?.value?.exportField), J = y(() => W?.value?.dateValidate), k = y(() => J.value === !0 ? {
|
|
66
66
|
maxDayRange: 90,
|
|
67
67
|
smartIdentify: !0
|
|
68
|
-
} : J.value),
|
|
68
|
+
} : J.value), b = y(() => s?.dateValidate === !0 ? {
|
|
69
69
|
maxDayRange: 90,
|
|
70
70
|
smartIdentify: !0
|
|
71
|
-
} :
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
} : s?.dateValidate), R = Q(!1), B = Q(!1), C = y(() => !!s?.disabled || (U !== void 0 ? !U?.value?.length : !1) || R.value), oe = (e) => e === void 0 ? !1 : typeof e == "object" ? q({}, e) : e === !0 ? {} : e, E = (...e) => {
|
|
72
|
+
let a = !1;
|
|
73
|
+
for (const o of e)
|
|
74
|
+
if (o !== void 0)
|
|
75
|
+
if (o === !1)
|
|
76
|
+
a = !1;
|
|
77
|
+
else {
|
|
78
|
+
const r = oe(o);
|
|
79
|
+
r !== !1 && (a = a === !1 ? r : q({}, a, r));
|
|
80
|
+
}
|
|
81
|
+
return a;
|
|
82
|
+
};
|
|
83
|
+
me(() => C.value, () => {
|
|
84
|
+
C.value && (B.value = !1);
|
|
74
85
|
}, {
|
|
75
86
|
immediate: !0
|
|
76
87
|
});
|
|
77
|
-
const
|
|
88
|
+
const ne = y(() => s?.successMessage === !0 ? i("ap.apExportGroup.exportSuccess") : s?.successMessage ? s.successMessage : ""), se = (e = s?.exportField) => {
|
|
78
89
|
const a = "exportFieldList", o = e ?? (H.value === "" ? !0 : H.value) ?? !1;
|
|
79
90
|
return o === !0 ? {
|
|
80
91
|
key: a
|
|
@@ -82,54 +93,54 @@ const We = /* @__PURE__ */ ce({
|
|
|
82
93
|
...o,
|
|
83
94
|
key: o.key ?? a
|
|
84
95
|
} : o;
|
|
85
|
-
},
|
|
96
|
+
}, re = {
|
|
86
97
|
textAlign: "center"
|
|
87
|
-
},
|
|
88
|
-
let e =
|
|
89
|
-
return !
|
|
98
|
+
}, T = y(() => s?.selectedRowKeys || []), I = y(() => {
|
|
99
|
+
let e = s?.ifShow;
|
|
100
|
+
return !s?.ifShow && s?.auth && (e = () => $(s.auth)), e?.() ?? !0;
|
|
90
101
|
});
|
|
91
|
-
async function
|
|
92
|
-
|
|
93
|
-
key:
|
|
94
|
-
}) :
|
|
95
|
-
key:
|
|
102
|
+
async function le() {
|
|
103
|
+
T.value.length > 0 ? P({
|
|
104
|
+
key: x.SELECT
|
|
105
|
+
}) : P({
|
|
106
|
+
key: x.ALL
|
|
96
107
|
});
|
|
97
108
|
}
|
|
98
|
-
async function
|
|
109
|
+
async function P({
|
|
99
110
|
key: e,
|
|
100
111
|
option: a
|
|
101
112
|
}) {
|
|
102
|
-
const o =
|
|
103
|
-
getRequestParams:
|
|
104
|
-
request:
|
|
105
|
-
} = o || {},
|
|
106
|
-
sort:
|
|
107
|
-
}) : {}, u =
|
|
108
|
-
let
|
|
109
|
-
e ===
|
|
110
|
-
[o?.idKey || "ids"]:
|
|
111
|
-
} : e ===
|
|
112
|
-
const
|
|
113
|
+
const o = q({}, s, a || {}), {
|
|
114
|
+
getRequestParams: r,
|
|
115
|
+
request: D
|
|
116
|
+
} = o || {}, n = ae?.()?.sort, l = n ? ke({
|
|
117
|
+
sort: n
|
|
118
|
+
}) : {}, u = se(o?.exportField);
|
|
119
|
+
let p = {};
|
|
120
|
+
e === x.SELECT ? p = {
|
|
121
|
+
[o?.idKey || "ids"]: T.value
|
|
122
|
+
} : e === x.ALL && (p = r?.() || te?.(!0) || {});
|
|
123
|
+
const m = o?.getInitialParams?.() || {};
|
|
113
124
|
try {
|
|
114
|
-
|
|
115
|
-
let
|
|
116
|
-
...
|
|
117
|
-
...
|
|
125
|
+
R.value = !0;
|
|
126
|
+
let S = Object.assign({
|
|
127
|
+
...p,
|
|
128
|
+
...m,
|
|
118
129
|
...l
|
|
119
130
|
}, u && z?.value ? {
|
|
120
|
-
[u.key]:
|
|
131
|
+
[u.key]: we(z.value, u?.convertField)
|
|
121
132
|
} : {});
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
params:
|
|
126
|
-
dateValidate:
|
|
127
|
-
}), await
|
|
133
|
+
S = o?.beforeRequest?.(S) || S;
|
|
134
|
+
const L = E(k.value, b.value, a?.dateValidate);
|
|
135
|
+
M(L) && e === x.ALL && ce({
|
|
136
|
+
params: S,
|
|
137
|
+
dateValidate: L
|
|
138
|
+
}), await De(async () => await D?.(S)), o?.successMessage && O.success(ne.value);
|
|
128
139
|
} finally {
|
|
129
|
-
|
|
140
|
+
R.value = !1;
|
|
130
141
|
}
|
|
131
142
|
}
|
|
132
|
-
const
|
|
143
|
+
const w = y(() => s?.groupList?.filter((e) => {
|
|
133
144
|
let a = e?.ifShow;
|
|
134
145
|
return !e?.ifShow && e?.auth && (a = () => $(e.auth)), a?.() ?? !0;
|
|
135
146
|
})?.map((e, a) => ({
|
|
@@ -140,199 +151,199 @@ const We = /* @__PURE__ */ ce({
|
|
|
140
151
|
disabled: e?.disabled,
|
|
141
152
|
dateValidate: e?.dateValidate,
|
|
142
153
|
onClick: () => {
|
|
143
|
-
|
|
144
|
-
key:
|
|
154
|
+
T.value.length > 0 ? P({
|
|
155
|
+
key: x.SELECT,
|
|
145
156
|
option: e
|
|
146
|
-
}) :
|
|
147
|
-
key:
|
|
157
|
+
}) : P({
|
|
158
|
+
key: x.ALL,
|
|
148
159
|
option: e
|
|
149
160
|
});
|
|
150
161
|
}
|
|
151
|
-
})) || []),
|
|
152
|
-
const e =
|
|
153
|
-
return
|
|
162
|
+
})) || []), ue = () => {
|
|
163
|
+
const e = E(k.value, b.value, ...w.value.map((a) => a.dateValidate));
|
|
164
|
+
return f(ge, {
|
|
154
165
|
size: 4
|
|
155
166
|
}, {
|
|
156
|
-
default: () => [
|
|
167
|
+
default: () => [f("span", null, [s?.buttonProps?.content ?? i("ap.apExportGroup.export")]), e !== !1 && M(e) ? f(K, {
|
|
157
168
|
title: i("ap.apExportGroup.maxMessage", {
|
|
158
169
|
maxDayRange: e.maxDayRange ?? 90
|
|
159
170
|
})
|
|
160
171
|
}, {
|
|
161
|
-
default: () => [
|
|
162
|
-
class: [
|
|
172
|
+
default: () => [f(j, {
|
|
173
|
+
class: [v("icon"), h.value]
|
|
163
174
|
}, null)]
|
|
164
175
|
}) : null]
|
|
165
176
|
});
|
|
166
|
-
},
|
|
177
|
+
}, ie = (e) => Object.keys(e).reduce((a, o) => typeof e?.[o] == "number" && e?.[o] > 1e4 ? {
|
|
167
178
|
...a,
|
|
168
179
|
[o]: e?.[o]
|
|
169
|
-
} : a, {}),
|
|
170
|
-
const a = Object.keys(e), o = [],
|
|
171
|
-
for (let
|
|
172
|
-
for (let l =
|
|
173
|
-
const u = a[
|
|
174
|
-
let
|
|
175
|
-
const
|
|
176
|
-
for (let
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
prefix:
|
|
180
|
-
length:
|
|
180
|
+
} : a, {}), pe = (e) => {
|
|
181
|
+
const a = Object.keys(e), o = [], r = /* @__PURE__ */ new Set(), D = [];
|
|
182
|
+
for (let n = 0; n < a.length; n++)
|
|
183
|
+
for (let l = n + 1; l < a.length; l++) {
|
|
184
|
+
const u = a[n], p = a[l];
|
|
185
|
+
let m = "";
|
|
186
|
+
const S = Math.min(u.length, p.length);
|
|
187
|
+
for (let L = 0; L < S && u[L] === p[L]; L++)
|
|
188
|
+
m += u[L];
|
|
189
|
+
m.length >= 3 && D.push({
|
|
190
|
+
prefix: m,
|
|
191
|
+
length: m.length,
|
|
181
192
|
key1: u,
|
|
182
|
-
key2:
|
|
183
|
-
diff: Math.abs(e[u] - e[
|
|
193
|
+
key2: p,
|
|
194
|
+
diff: Math.abs(e[u] - e[p])
|
|
184
195
|
});
|
|
185
196
|
}
|
|
186
|
-
|
|
187
|
-
for (const
|
|
188
|
-
if (!
|
|
189
|
-
const l = e[
|
|
197
|
+
D.sort((n, l) => l.length !== n.length ? l.length - n.length : n.diff - l.diff);
|
|
198
|
+
for (const n of D)
|
|
199
|
+
if (!r.has(n.key1) && !r.has(n.key2)) {
|
|
200
|
+
const l = e[n.key1], u = e[n.key2];
|
|
190
201
|
o.push({
|
|
191
|
-
startKey: l < u ?
|
|
192
|
-
endKey: l < u ?
|
|
193
|
-
}),
|
|
202
|
+
startKey: l < u ? n.key1 : n.key2,
|
|
203
|
+
endKey: l < u ? n.key2 : n.key1
|
|
204
|
+
}), r.add(n.key1), r.add(n.key2);
|
|
194
205
|
}
|
|
195
206
|
return o;
|
|
196
|
-
},
|
|
207
|
+
}, de = ({
|
|
197
208
|
startTime: e,
|
|
198
209
|
endTime: a,
|
|
199
210
|
maxDayRange: o
|
|
200
|
-
}) => Math.abs(a - e) <= (o * 24 + 1) * 60 * 60 * 1e3,
|
|
211
|
+
}) => Math.abs(a - e) <= (o * 24 + 1) * 60 * 60 * 1e3, ce = ({
|
|
201
212
|
params: e,
|
|
202
213
|
dateValidate: a
|
|
203
214
|
}) => {
|
|
204
|
-
const o = a.maxDayRange ?? 90,
|
|
205
|
-
if (
|
|
206
|
-
|
|
215
|
+
const o = a.maxDayRange ?? 90, r = ie(e), D = [...a.smartIdentify ?? !0 ? pe(r) : [], ...a.dateKeyList?.filter((n) => r[n.startKey || ""] && r[n.endKey || ""]) ?? []];
|
|
216
|
+
if (D.length === 0) {
|
|
217
|
+
O.warn(a?.emptyTooltip ?? i("ap.apExportGroup.emptyTooltip", {
|
|
207
218
|
maxDayRange: o
|
|
208
219
|
}));
|
|
209
220
|
return;
|
|
210
|
-
} else if (
|
|
221
|
+
} else if (D.some(({
|
|
211
222
|
startKey: l,
|
|
212
223
|
endKey: u
|
|
213
224
|
}) => {
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
startTime:
|
|
217
|
-
endTime:
|
|
225
|
+
const p = r[l || ""], m = r[u || ""];
|
|
226
|
+
return p !== void 0 && m !== void 0 && !de({
|
|
227
|
+
startTime: p,
|
|
228
|
+
endTime: m,
|
|
218
229
|
maxDayRange: o
|
|
219
230
|
});
|
|
220
231
|
})) {
|
|
221
|
-
|
|
232
|
+
O.warn(a?.maxDayRangeTooltip ?? i("ap.apExportGroup.maxDayRangeTooltip", {
|
|
222
233
|
maxDayRange: o
|
|
223
234
|
}));
|
|
224
235
|
return;
|
|
225
236
|
}
|
|
226
237
|
};
|
|
227
|
-
return (e, a) => (
|
|
238
|
+
return (e, a) => (d(), X(Y, null, [I.value && s.type === "button" ? (d(), g(t(N), V({
|
|
228
239
|
key: 0
|
|
229
240
|
}, {
|
|
230
241
|
...e.$attrs
|
|
231
242
|
}, {
|
|
232
|
-
class: [t(
|
|
233
|
-
disabled:
|
|
234
|
-
loading:
|
|
243
|
+
class: [t(v)(), t(h)],
|
|
244
|
+
disabled: C.value,
|
|
245
|
+
loading: R.value,
|
|
235
246
|
"min-width": "",
|
|
236
|
-
onClick:
|
|
247
|
+
onClick: le
|
|
237
248
|
}), {
|
|
238
|
-
default:
|
|
249
|
+
default: c(() => [_(A(s?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(M)(E(k.value, b.value)) ? (d(), g(t(K), {
|
|
239
250
|
key: 0,
|
|
240
251
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
241
|
-
maxDayRange:
|
|
252
|
+
maxDayRange: E(k.value, b.value).maxDayRange ?? 90
|
|
242
253
|
})
|
|
243
254
|
}, {
|
|
244
|
-
default:
|
|
245
|
-
class:
|
|
255
|
+
default: c(() => [f(t(j), {
|
|
256
|
+
class: F([t(v)("icon"), t(h)])
|
|
246
257
|
}, null, 8, ["class"])]),
|
|
247
258
|
_: 1
|
|
248
|
-
}, 8, ["title"])) :
|
|
259
|
+
}, 8, ["title"])) : G("", !0)]),
|
|
249
260
|
_: 1
|
|
250
|
-
}, 16, ["class", "disabled", "loading"])) :
|
|
261
|
+
}, 16, ["class", "disabled", "loading"])) : G("", !0), I.value && s.type === "dropdown" ? (d(), g(t(xe), {
|
|
251
262
|
key: 1,
|
|
252
|
-
open:
|
|
253
|
-
"onUpdate:open": a[0] || (a[0] = (o) =>
|
|
254
|
-
class:
|
|
255
|
-
"overlay-style":
|
|
256
|
-
disabled:
|
|
263
|
+
open: B.value,
|
|
264
|
+
"onUpdate:open": a[0] || (a[0] = (o) => B.value = o),
|
|
265
|
+
class: F([t(v)(), t(h)]),
|
|
266
|
+
"overlay-style": re,
|
|
267
|
+
disabled: C.value
|
|
257
268
|
}, {
|
|
258
|
-
overlay:
|
|
259
|
-
onClick:
|
|
269
|
+
overlay: c(() => [f(t(ve), {
|
|
270
|
+
onClick: P
|
|
260
271
|
}, {
|
|
261
|
-
default:
|
|
262
|
-
key: t(
|
|
263
|
-
disabled:
|
|
272
|
+
default: c(() => [(d(), g(t(Z), {
|
|
273
|
+
key: t(x).SELECT,
|
|
274
|
+
disabled: T.value?.length === 0
|
|
264
275
|
}, {
|
|
265
|
-
default:
|
|
276
|
+
default: c(() => [_(A(t(i)("ap.apExportGroup.exportSelected")), 1)]),
|
|
266
277
|
_: 1
|
|
267
|
-
}, 8, ["disabled"])), (
|
|
268
|
-
key: t(
|
|
278
|
+
}, 8, ["disabled"])), (d(), g(t(Z), {
|
|
279
|
+
key: t(x).ALL
|
|
269
280
|
}, {
|
|
270
|
-
default:
|
|
281
|
+
default: c(() => [_(A(t(i)("ap.apExportGroup.exportAll")), 1)]),
|
|
271
282
|
_: 1
|
|
272
283
|
}))]),
|
|
273
284
|
_: 1
|
|
274
285
|
})]),
|
|
275
|
-
default:
|
|
286
|
+
default: c(() => [f(t(N), V({
|
|
276
287
|
...e.$attrs
|
|
277
288
|
}, {
|
|
278
|
-
loading:
|
|
289
|
+
loading: R.value
|
|
279
290
|
}), {
|
|
280
|
-
default:
|
|
291
|
+
default: c(() => [_(A(s?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(M)(E(k.value, b.value)) ? (d(), g(t(K), {
|
|
281
292
|
key: 0,
|
|
282
293
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
283
|
-
maxDayRange:
|
|
294
|
+
maxDayRange: E(k.value, b.value).maxDayRange ?? 90
|
|
284
295
|
})
|
|
285
296
|
}, {
|
|
286
|
-
default:
|
|
287
|
-
class:
|
|
297
|
+
default: c(() => [f(t(j), {
|
|
298
|
+
class: F([t(v)("icon"), t(h)])
|
|
288
299
|
}, null, 8, ["class"])]),
|
|
289
300
|
_: 1
|
|
290
|
-
}, 8, ["title"])) :
|
|
301
|
+
}, 8, ["title"])) : G("", !0), f(t(ye))]),
|
|
291
302
|
_: 1
|
|
292
303
|
}, 16, ["loading"])]),
|
|
293
304
|
_: 1
|
|
294
|
-
}, 8, ["open", "class", "disabled"])) :
|
|
305
|
+
}, 8, ["open", "class", "disabled"])) : G("", !0), I.value && s.type === "group" ? (d(), X(Y, {
|
|
295
306
|
key: 2
|
|
296
|
-
}, [
|
|
307
|
+
}, [w.value.length === 1 ? (d(), g(t(N), V({
|
|
297
308
|
key: 0
|
|
298
309
|
}, {
|
|
299
310
|
...e.$attrs
|
|
300
311
|
}, {
|
|
301
|
-
class: [t(
|
|
302
|
-
disabled:
|
|
303
|
-
loading:
|
|
312
|
+
class: [t(v)(), t(h)],
|
|
313
|
+
disabled: C.value || w.value?.[0]?.disabled,
|
|
314
|
+
loading: R.value,
|
|
304
315
|
"min-width": "",
|
|
305
|
-
onClick:
|
|
316
|
+
onClick: w.value?.[0]?.onClick
|
|
306
317
|
}), {
|
|
307
|
-
default:
|
|
318
|
+
default: c(() => [_(A(w.value?.[0]?.content ?? s?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(M)(E(k.value, b.value, w.value?.[0]?.dateValidate)) ? (d(), g(t(K), {
|
|
308
319
|
key: 0,
|
|
309
320
|
title: t(i)("ap.apExportGroup.maxMessage", {
|
|
310
|
-
maxDayRange:
|
|
321
|
+
maxDayRange: E(k.value, b.value, w.value?.[0]?.dateValidate).maxDayRange ?? 90
|
|
311
322
|
})
|
|
312
323
|
}, {
|
|
313
|
-
default:
|
|
314
|
-
class:
|
|
324
|
+
default: c(() => [f(t(j), {
|
|
325
|
+
class: F([t(v)("icon"), t(h)])
|
|
315
326
|
}, null, 8, ["class"])]),
|
|
316
327
|
_: 1
|
|
317
|
-
}, 8, ["title"])) :
|
|
328
|
+
}, 8, ["title"])) : G("", !0)]),
|
|
318
329
|
_: 1
|
|
319
|
-
}, 16, ["class", "disabled", "loading", "onClick"])) : (
|
|
330
|
+
}, 16, ["class", "disabled", "loading", "onClick"])) : (d(), g(t(Ee), V({
|
|
320
331
|
key: 1
|
|
321
332
|
}, {
|
|
322
333
|
...e.$attrs
|
|
323
334
|
}, {
|
|
324
|
-
class: [t(
|
|
325
|
-
disabled:
|
|
326
|
-
loading:
|
|
335
|
+
class: [t(v)(), t(h)],
|
|
336
|
+
disabled: C.value,
|
|
337
|
+
loading: R.value,
|
|
327
338
|
"button-props": {
|
|
328
|
-
...
|
|
329
|
-
content:
|
|
330
|
-
type:
|
|
339
|
+
...s.buttonProps,
|
|
340
|
+
content: ue(),
|
|
341
|
+
type: s?.buttonProps?.type ?? "default"
|
|
331
342
|
},
|
|
332
|
-
"menu-list":
|
|
333
|
-
}), null, 16, ["class", "disabled", "loading", "button-props", "menu-list"]))], 64)) :
|
|
343
|
+
"menu-list": w.value
|
|
344
|
+
}), null, 16, ["class", "disabled", "loading", "button-props", "menu-list"]))], 64)) : G("", !0)], 64));
|
|
334
345
|
}
|
|
335
346
|
});
|
|
336
347
|
export {
|
|
337
|
-
|
|
348
|
+
He as default
|
|
338
349
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.13.
|
|
1
|
+
declare const _default: "7.13.7";
|
|
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"),Y=require("@ant-design/icons-vue"),c=require("@aplus-frontend/antdv"),Z=require("@aplus-frontend/hooks"),T=require("@aplus-frontend/icon"),w=require("@aplus-frontend/utils"),G=require("lodash-unified");require("../../ap-button/index.js");const ee=require("../../ap-table/context.js");require("../../config-provider/index.js");const te=require("../ap-batch-action-group/index.js"),ae=require("./convertExportField.js"),oe=require("./handleExportDownload.js"),f=require("./interface.js"),ne=require("./style/index.js"),re=require("../../config-provider/hooks/use-namespace.js"),se=require("../../config-provider/hooks/use-locale.js"),le=require("../../config-provider/hooks/use-global-config.js"),S=require("../../ap-button/ap-button.vue.js"),ue=e.defineComponent({__name:"ApExportGroup",props:{type:{default:"button"},selectedRowKeys:{},groupList:{},buttonProps:{},disabled:{type:Boolean},auth:{},ifShow:{},text:{},idKey:{},request:{},getRequestParams:{},getInitialParams:{},beforeRequest:{},successMessage:{type:[Boolean,String],default:!1},exportField:{type:[Boolean,Object],default:void 0},dateValidate:{type:[Object,Boolean],default:void 0}},setup(F){const{hasPermission:q}=Z.usePermission(),r=F,{columns:R,dataSource:_,getSearchFormValues:j,getLastParams:I}=ee.useInjectApTable(),{b:y}=re.useNamespace("ap-export-group"),g=ne.default("ap-export-group"),{t:i}=se.useLocale(),N=le.useGlobalConfig("apExportGroup"),P=e.computed(()=>N?.value?.exportField),M=e.computed(()=>N?.value?.dateValidate),m=e.computed(()=>M.value===!0?{maxDayRange:90,smartIdentify:!0}:M.value),x=e.computed(()=>r?.dateValidate===!0?{maxDayRange:90,smartIdentify:!0}:r?.dateValidate),C=e.ref(!1),L=e.ref(!1),A=e.computed(()=>!!r?.disabled||(_!==void 0?!_?.value?.length:!1)||C.value),K=t=>t===void 0?!1:typeof t=="object"?G.merge({},t):t===!0?{}:t,v=(...t)=>{let a=!1;for(const o of t)if(o!==void 0)if(o===!1)a=!1;else{const s=K(o);s!==!1&&(a=a===!1?s:G.merge({},a,s))}return a};e.watch(()=>A.value,()=>{A.value&&(L.value=!1)},{immediate:!0});const O=e.computed(()=>r?.successMessage===!0?i("ap.apExportGroup.exportSuccess"):r?.successMessage?r.successMessage:""),z=(t=r?.exportField)=>{const a="exportFieldList",o=t??(P.value===""?!0:P.value)??!1;return o===!0?{key:a}:typeof o=="object"?{...o,key:o.key??a}:o},W={textAlign:"center"},V=e.computed(()=>r?.selectedRowKeys||[]),B=e.computed(()=>{let t=r?.ifShow;return!r?.ifShow&&r?.auth&&(t=()=>q(r.auth)),t?.()??!0});async function $(){V.value.length>0?D({key:f.ApExportGroupActionType.SELECT}):D({key:f.ApExportGroupActionType.ALL})}async function D({key:t,option:a}){const o=G.merge({},r,a||{}),{getRequestParams:s,request:k}=o||{},n=I?.()?.sort,l=n?w.transformTableParamsNoTimezone({sort:n}):{},u=z(o?.exportField);let p={};t===f.ApExportGroupActionType.SELECT?p={[o?.idKey||"ids"]:V.value}:t===f.ApExportGroupActionType.ALL&&(p=s?.()||j?.(!0)||{});const d=o?.getInitialParams?.()||{};try{C.value=!0;let E=Object.assign({...p,...d,...l},u&&R?.value?{[u.key]:ae.convertExportField(R.value,u?.convertField)}:{});E=o?.beforeRequest?.(E)||E;const b=v(m.value,x.value,a?.dateValidate);w.isObjectWithContent(b)&&t===f.ApExportGroupActionType.ALL&&X({params:E,dateValidate:b}),await oe.handleExportDownload(async()=>await k?.(E)),o?.successMessage&&c.message.success(O.value)}finally{C.value=!1}}const h=e.computed(()=>r?.groupList?.filter(t=>{let a=t?.ifShow;return!t?.ifShow&&t?.auth&&(a=()=>q(t.auth)),a?.()??!0})?.map((t,a)=>({key:a,content:t?.text,auth:t?.auth,ifShow:t?.ifShow,disabled:t?.disabled,dateValidate:t?.dateValidate,onClick:()=>{V.value.length>0?D({key:f.ApExportGroupActionType.SELECT,option:t}):D({key:f.ApExportGroupActionType.ALL,option:t})}}))||[]),U=()=>{const t=v(m.value,x.value,...h.value.map(a=>a.dateValidate));return e.createVNode(c.Space,{size:4},{default:()=>[e.createVNode("span",null,[r?.buttonProps?.content??i("ap.apExportGroup.export")]),t!==!1&&w.isObjectWithContent(t)?e.createVNode(c.Tooltip,{title:i("ap.apExportGroup.maxMessage",{maxDayRange:t.maxDayRange??90})},{default:()=>[e.createVNode(T.IconApAdLineAnnotation,{class:[y("icon"),g.value]},null)]}):null]})},H=t=>Object.keys(t).reduce((a,o)=>typeof t?.[o]=="number"&&t?.[o]>1e4?{...a,[o]:t?.[o]}:a,{}),J=t=>{const a=Object.keys(t),o=[],s=new Set,k=[];for(let n=0;n<a.length;n++)for(let l=n+1;l<a.length;l++){const u=a[n],p=a[l];let d="";const E=Math.min(u.length,p.length);for(let b=0;b<E&&u[b]===p[b];b++)d+=u[b];d.length>=3&&k.push({prefix:d,length:d.length,key1:u,key2:p,diff:Math.abs(t[u]-t[p])})}k.sort((n,l)=>l.length!==n.length?l.length-n.length:n.diff-l.diff);for(const n of k)if(!s.has(n.key1)&&!s.has(n.key2)){const l=t[n.key1],u=t[n.key2];o.push({startKey:l<u?n.key1:n.key2,endKey:l<u?n.key2:n.key1}),s.add(n.key1),s.add(n.key2)}return o},Q=({startTime:t,endTime:a,maxDayRange:o})=>Math.abs(a-t)<=(o*24+1)*60*60*1e3,X=({params:t,dateValidate:a})=>{const o=a.maxDayRange??90,s=H(t),k=[...a.smartIdentify??!0?J(s):[],...a.dateKeyList?.filter(n=>s[n.startKey||""]&&s[n.endKey||""])??[]];if(k.length===0){c.message.warn(a?.emptyTooltip??i("ap.apExportGroup.emptyTooltip",{maxDayRange:o}));return}else if(k.some(({startKey:l,endKey:u})=>{const p=s[l||""],d=s[u||""];return p!==void 0&&d!==void 0&&!Q({startTime:p,endTime:d,maxDayRange:o})})){c.message.warn(a?.maxDayRangeTooltip??i("ap.apExportGroup.maxDayRangeTooltip",{maxDayRange:o}));return}};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[B.value&&r.type==="button"?(e.openBlock(),e.createBlock(e.unref(S.default),e.mergeProps({key:0},{...t.$attrs},{class:[e.unref(y)(),e.unref(g)],disabled:A.value,loading:C.value,"min-width":"",onClick:$}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(w.isObjectWithContent)(v(m.value,x.value))?(e.openBlock(),e.createBlock(e.unref(c.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:v(m.value,x.value).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(T.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(y)("icon"),e.unref(g)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},16,["class","disabled","loading"])):e.createCommentVNode("",!0),B.value&&r.type==="dropdown"?(e.openBlock(),e.createBlock(e.unref(c.Dropdown),{key:1,open:L.value,"onUpdate:open":a[0]||(a[0]=o=>L.value=o),class:e.normalizeClass([e.unref(y)(),e.unref(g)]),"overlay-style":W,disabled:A.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(c.Menu),{onClick:D},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(c.MenuItem),{key:e.unref(f.ApExportGroupActionType).SELECT,disabled:V.value?.length===0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("ap.apExportGroup.exportSelected")),1)]),_:1},8,["disabled"])),(e.openBlock(),e.createBlock(e.unref(c.MenuItem),{key:e.unref(f.ApExportGroupActionType).ALL},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("ap.apExportGroup.exportAll")),1)]),_:1}))]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(S.default),e.mergeProps({...t.$attrs},{loading:C.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(w.isObjectWithContent)(v(m.value,x.value))?(e.openBlock(),e.createBlock(e.unref(c.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:v(m.value,x.value).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(T.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(y)("icon"),e.unref(g)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Y.DownOutlined))]),_:1},16,["loading"])]),_:1},8,["open","class","disabled"])):e.createCommentVNode("",!0),B.value&&r.type==="group"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[h.value.length===1?(e.openBlock(),e.createBlock(e.unref(S.default),e.mergeProps({key:0},{...t.$attrs},{class:[e.unref(y)(),e.unref(g)],disabled:A.value||h.value?.[0]?.disabled,loading:C.value,"min-width":"",onClick:h.value?.[0]?.onClick}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value?.[0]?.content??r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(w.isObjectWithContent)(v(m.value,x.value,h.value?.[0]?.dateValidate))?(e.openBlock(),e.createBlock(e.unref(c.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:v(m.value,x.value,h.value?.[0]?.dateValidate).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(T.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(y)("icon"),e.unref(g)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},16,["class","disabled","loading","onClick"])):(e.openBlock(),e.createBlock(e.unref(te.ApBatchActionGroup),e.mergeProps({key:1},{...t.$attrs},{class:[e.unref(y)(),e.unref(g)],disabled:A.value,loading:C.value,"button-props":{...r.buttonProps,content:U(),type:r?.buttonProps?.type??"default"},"menu-list":h.value}),null,16,["class","disabled","loading","button-props","menu-list"]))],64)):e.createCommentVNode("",!0)],64))}});exports.default=ue;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.13.
|
|
1
|
+
declare const _default: "7.13.7";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.13.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.13.7";exports.default=e;
|