@aplus-frontend/ui 7.13.5 → 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/ap-field/select/index.vue.mjs +76 -71
- package/es/src/ap-field/style/select.mjs +11 -5
- 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/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/style/select.js +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 +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as te, ref as V, shallowRef as le, computed as r, onMounted as
|
|
1
|
+
import { defineComponent as te, ref as V, shallowRef as le, computed as r, onMounted as ae, watch as ne, unref as l, createElementBlock as I, createBlock as x, openBlock as f, toDisplayString as C, mergeProps as re, h as se, createSlots as ue, withCtx as c, createVNode as w, normalizeClass as p, createCommentVNode as _, createElementVNode as S, withModifiers as ie, renderList as ce, renderSlot as pe, normalizeProps as de, guardReactiveProps as fe, resolveDynamicComponent as me } from "vue";
|
|
2
2
|
import { Select as ve, Flex as M, Checkbox as P, Spin as he } from "@aplus-frontend/antdv";
|
|
3
3
|
import { debounce as ye, isFunction as D, isArray as ge, isNil as Ce, omit as we, isNumber as Se } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -114,38 +114,38 @@ const Ne = { key: 0 }, Ae = ["onClick"], Ke = /* @__PURE__ */ te({
|
|
|
114
114
|
if (!D(e.request))
|
|
115
115
|
return;
|
|
116
116
|
s += 1;
|
|
117
|
-
const
|
|
118
|
-
v([]),
|
|
119
|
-
s ===
|
|
117
|
+
const a = s;
|
|
118
|
+
v([]), n.value = !0, e.request(o).then((t) => {
|
|
119
|
+
s === a && (v(t), n.value = !1);
|
|
120
120
|
});
|
|
121
|
-
}, e.searchDelay), $ = (o,
|
|
121
|
+
}, e.searchDelay), $ = (o, a) => {
|
|
122
122
|
const t = e.fieldNames?.label || "label";
|
|
123
|
-
return typeof
|
|
124
|
-
}, { options: m, updateOptions: v } = ke(e),
|
|
123
|
+
return typeof a?.[t] == "string" && a[t].toLowerCase().indexOf(o.toLowerCase()) > -1;
|
|
124
|
+
}, { options: m, updateOptions: v } = ke(e), b = le(), n = V(e?.loading || !1), K = L, j = r(() => {
|
|
125
125
|
if (e.multiple)
|
|
126
126
|
return e.tokenSeparators ? "tags" : "multiple";
|
|
127
127
|
});
|
|
128
128
|
async function h(o = !0) {
|
|
129
129
|
if (!D(e.request))
|
|
130
130
|
return;
|
|
131
|
-
|
|
132
|
-
const
|
|
131
|
+
n.value = !0, s += 1;
|
|
132
|
+
const a = s;
|
|
133
133
|
try {
|
|
134
134
|
o && v([]);
|
|
135
135
|
const t = await e.request(void 0, e.params);
|
|
136
|
-
if (
|
|
136
|
+
if (a !== s)
|
|
137
137
|
return;
|
|
138
138
|
v(t);
|
|
139
139
|
} finally {
|
|
140
|
-
|
|
140
|
+
n.value = !1;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function E(o) {
|
|
144
|
-
e.onFocus?.(o), e.refetchOnFocus && s > 0 && !
|
|
144
|
+
e.onFocus?.(o), e.refetchOnFocus && s > 0 && !n.value && h(!0);
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
ae(() => {
|
|
147
147
|
e.lazy || h();
|
|
148
|
-
}),
|
|
148
|
+
}), ne(
|
|
149
149
|
() => e.params,
|
|
150
150
|
() => {
|
|
151
151
|
h();
|
|
@@ -155,22 +155,22 @@ const Ne = { key: 0 }, Ae = ["onClick"], Ke = /* @__PURE__ */ te({
|
|
|
155
155
|
}
|
|
156
156
|
);
|
|
157
157
|
const { value: i, updateValue: y } = Fe(e, K), H = be("Select", e), W = r(() => {
|
|
158
|
-
const o =
|
|
158
|
+
const o = l(i);
|
|
159
159
|
if (!o)
|
|
160
160
|
return e.emptyText;
|
|
161
|
-
const
|
|
161
|
+
const a = e.fieldNames?.label || "label", t = e.fieldNames?.value || "value";
|
|
162
162
|
return ge(o) ? o.map(
|
|
163
|
-
(d) =>
|
|
164
|
-
).filter(Boolean).join("、") || e.emptyText :
|
|
163
|
+
(d) => l(m).find((oe) => oe[t] === d)?.[a]
|
|
164
|
+
).filter(Boolean).join("、") || e.emptyText : l(m).find(
|
|
165
165
|
(d) => d[t] === o
|
|
166
|
-
)?.[
|
|
166
|
+
)?.[a] || e.emptyText;
|
|
167
167
|
}), G = r(() => {
|
|
168
|
-
const o = !!e?.showSearch,
|
|
168
|
+
const o = !!e?.showSearch, a = e.searchMode;
|
|
169
169
|
let t = {};
|
|
170
|
-
return o && (t =
|
|
170
|
+
return o && (t = a === "request" ? {
|
|
171
171
|
defaultActiveFirstOption: !1,
|
|
172
172
|
onSearch: U,
|
|
173
|
-
notFoundContent:
|
|
173
|
+
notFoundContent: n.value ? void 0 : null,
|
|
174
174
|
filterOption: !1,
|
|
175
175
|
suffixIcon: null
|
|
176
176
|
} : {
|
|
@@ -186,7 +186,7 @@ const Ne = { key: 0 }, Ae = ["onClick"], Ke = /* @__PURE__ */ te({
|
|
|
186
186
|
"onFocus",
|
|
187
187
|
"onBeforeSelect"
|
|
188
188
|
]),
|
|
189
|
-
placeholder:
|
|
189
|
+
placeholder: l(H),
|
|
190
190
|
...t
|
|
191
191
|
};
|
|
192
192
|
}), g = r(
|
|
@@ -195,115 +195,120 @@ const Ne = { key: 0 }, Ae = ["onClick"], Ke = /* @__PURE__ */ te({
|
|
|
195
195
|
() => e.multiple && e.allowOnlySelect && (!T(e.maxCount) || e.maxCount >= 1)
|
|
196
196
|
);
|
|
197
197
|
function Q() {
|
|
198
|
-
|
|
198
|
+
b.value?.focus();
|
|
199
199
|
}
|
|
200
200
|
function X() {
|
|
201
|
-
|
|
201
|
+
b.value?.blur();
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
const t = e.fieldNames?.[
|
|
203
|
+
function B(o, a) {
|
|
204
|
+
const t = e.fieldNames?.[a] ?? a;
|
|
205
205
|
return o[t];
|
|
206
206
|
}
|
|
207
207
|
function Y(o) {
|
|
208
|
-
const
|
|
209
|
-
y(e.multiple ? [
|
|
208
|
+
const a = B(o, "value");
|
|
209
|
+
y(e.multiple ? [a] : a);
|
|
210
210
|
}
|
|
211
211
|
const A = r(() => {
|
|
212
|
-
const o =
|
|
213
|
-
return
|
|
214
|
-
}), Z = r(() => (
|
|
212
|
+
const o = l(i) || [], a = g.value;
|
|
213
|
+
return a.length > 0 && a.every((t) => o.includes(t));
|
|
214
|
+
}), Z = r(() => (l(i) || []).length > 0 && !A.value);
|
|
215
215
|
function ee() {
|
|
216
216
|
console.log("123");
|
|
217
|
-
const o =
|
|
218
|
-
|
|
217
|
+
const o = l(i) || [], a = g.value;
|
|
218
|
+
a.length && a.every((t) => o?.includes(t)) ? y([]) : y(g.value);
|
|
219
219
|
}
|
|
220
220
|
return R({
|
|
221
221
|
focus: Q,
|
|
222
222
|
blur: X,
|
|
223
223
|
request: h
|
|
224
|
-
}), (o,
|
|
224
|
+
}), (o, a) => o.mode === "read" ? (f(), I("span", Ne, C(W.value), 1)) : (f(), x(l(ve), re({
|
|
225
225
|
key: 1,
|
|
226
226
|
ref_key: "selectRef",
|
|
227
|
-
ref:
|
|
227
|
+
ref: b,
|
|
228
228
|
"allow-clear": ""
|
|
229
229
|
}, G.value, {
|
|
230
230
|
mode: j.value,
|
|
231
|
-
value:
|
|
232
|
-
options:
|
|
233
|
-
loading:
|
|
231
|
+
value: l(i),
|
|
232
|
+
options: l(m),
|
|
233
|
+
loading: n.value,
|
|
234
234
|
"menu-item-selected-icon": se("span"),
|
|
235
|
-
"popup-class-name": `${
|
|
235
|
+
"popup-class-name": `${l(u)("popup")} ${l(z)}`,
|
|
236
236
|
open: O.value,
|
|
237
|
-
|
|
237
|
+
virtual: !1,
|
|
238
|
+
"onUpdate:value": l(y),
|
|
238
239
|
onFocus: E,
|
|
239
|
-
onDropdownVisibleChange:
|
|
240
|
+
onDropdownVisibleChange: a[0] || (a[0] = (t) => O.value = t)
|
|
240
241
|
}), ue({
|
|
241
242
|
option: c((t) => [
|
|
242
|
-
w(
|
|
243
|
+
w(l(M), {
|
|
243
244
|
justify: "space-between",
|
|
244
245
|
align: "center",
|
|
245
|
-
class:
|
|
246
|
+
class: p(l(u)("popup-option-wrapper")),
|
|
246
247
|
gap: 8
|
|
247
248
|
}, {
|
|
248
249
|
default: c(() => [
|
|
249
|
-
w(
|
|
250
|
+
w(l(M), {
|
|
250
251
|
gap: 8,
|
|
251
252
|
align: "center"
|
|
252
253
|
}, {
|
|
253
254
|
default: c(() => [
|
|
254
|
-
N.value ? (
|
|
255
|
+
N.value ? (f(), x(l(P), {
|
|
255
256
|
key: 0,
|
|
256
|
-
checked:
|
|
257
|
-
|
|
257
|
+
checked: l(i)?.includes(
|
|
258
|
+
B(t, "value")
|
|
258
259
|
)
|
|
259
260
|
}, null, 8, ["checked"])) : _("", !0),
|
|
260
|
-
|
|
261
|
-
class:
|
|
262
|
-
}, C(
|
|
261
|
+
S("span", {
|
|
262
|
+
class: p(l(u)("popup-option-label"))
|
|
263
|
+
}, C(B(t, "label")), 3)
|
|
263
264
|
]),
|
|
264
265
|
_: 2
|
|
265
266
|
}, 1024),
|
|
266
|
-
J.value ? (
|
|
267
|
+
J.value ? (f(), I("span", {
|
|
267
268
|
key: 0,
|
|
268
|
-
class:
|
|
269
|
+
class: p(l(u)("popup-option-action")),
|
|
269
270
|
onClick: ie(() => Y(t), ["stop"])
|
|
270
|
-
}, C(
|
|
271
|
+
}, C(l(F)("ap.field.chooseOnly")), 11, Ae)) : _("", !0)
|
|
271
272
|
]),
|
|
272
273
|
_: 2
|
|
273
274
|
}, 1032, ["class"])
|
|
274
275
|
]),
|
|
275
276
|
_: 2
|
|
276
277
|
}, [
|
|
277
|
-
ce(o.$slots, (t,
|
|
278
|
-
name:
|
|
278
|
+
ce(o.$slots, (t, k) => ({
|
|
279
|
+
name: k,
|
|
279
280
|
fn: c((d) => [
|
|
280
|
-
|
|
281
|
+
pe(o.$slots, k, de(fe(d || {})))
|
|
281
282
|
])
|
|
282
283
|
})),
|
|
283
|
-
|
|
284
|
+
n.value ? {
|
|
284
285
|
name: "notFoundContent",
|
|
285
286
|
fn: c(() => [
|
|
286
|
-
w(
|
|
287
|
+
w(l(he), { size: "small" })
|
|
287
288
|
]),
|
|
288
289
|
key: "0"
|
|
289
290
|
} : void 0,
|
|
290
291
|
N.value ? {
|
|
291
292
|
name: "dropdownRender",
|
|
292
293
|
fn: c(({ menuNode: t }) => [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
class: f(n(u)("popup-all-option")),
|
|
296
|
-
onClick: ee
|
|
294
|
+
S("div", {
|
|
295
|
+
class: p(l(u)("popup-all-option-wrapper"))
|
|
297
296
|
}, [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
297
|
+
S("div", {
|
|
298
|
+
tabindex: -1,
|
|
299
|
+
class: p(l(u)("popup-all-option")),
|
|
300
|
+
onClick: ee
|
|
301
|
+
}, [
|
|
302
|
+
w(l(P), {
|
|
303
|
+
checked: A.value,
|
|
304
|
+
indeterminate: Z.value
|
|
305
|
+
}, null, 8, ["checked", "indeterminate"]),
|
|
306
|
+
S("span", {
|
|
307
|
+
class: p(l(u)("popup-all-option-label"))
|
|
308
|
+
}, C(l(F)("ap.field.selectAll")), 3)
|
|
309
|
+
], 2)
|
|
305
310
|
], 2),
|
|
306
|
-
(
|
|
311
|
+
(f(), x(me(t)))
|
|
307
312
|
]),
|
|
308
313
|
key: "1"
|
|
309
314
|
} : void 0
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { singleRow as
|
|
1
|
+
import { singleRow as l } from "../../style/index.mjs";
|
|
2
2
|
const n = (i) => {
|
|
3
|
-
const { componentCls:
|
|
3
|
+
const { componentCls: a } = i, p = `${a}-select-popup`;
|
|
4
4
|
return {
|
|
5
5
|
[`${p}`]: {
|
|
6
|
-
padding:
|
|
6
|
+
// padding: token.space,
|
|
7
|
+
padding: 0,
|
|
8
|
+
[`${p}-all-option-wrapper`]: {
|
|
9
|
+
padding: i.space,
|
|
10
|
+
paddingBlockEnd: i.spaceXS
|
|
11
|
+
},
|
|
7
12
|
[`${p}-all-option`]: {
|
|
8
13
|
width: "100%",
|
|
9
14
|
display: "inline-flex",
|
|
@@ -18,7 +23,7 @@ const n = (i) => {
|
|
|
18
23
|
height: "22px"
|
|
19
24
|
},
|
|
20
25
|
[`${p}-option-label`]: {
|
|
21
|
-
...
|
|
26
|
+
...l(i),
|
|
22
27
|
color: "inherit"
|
|
23
28
|
},
|
|
24
29
|
[`${p}-option-action`]: {
|
|
@@ -37,13 +42,14 @@ const n = (i) => {
|
|
|
37
42
|
paddingBlock: i.spaceXS,
|
|
38
43
|
fontWeight: "normal !important",
|
|
39
44
|
marginBottom: i.spaceXS,
|
|
45
|
+
marginInline: i.space,
|
|
40
46
|
"&:hover": {
|
|
41
47
|
[`${p}-option-action`]: {
|
|
42
48
|
display: "inline"
|
|
43
49
|
}
|
|
44
50
|
},
|
|
45
51
|
"&:last-child": {
|
|
46
|
-
marginBottom:
|
|
52
|
+
marginBottom: i.space
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
}
|
|
@@ -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"),c=require("@aplus-frontend/antdv"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),s=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");require("../../hooks/index.js");const j=require("../hooks/use-default-placeholder.js"),K=require("../style/index.js"),H=require("./use-select-options.js"),W=require("../../config-provider/hooks/use-namespace.js"),G=require("../../config-provider/hooks/use-locale.js"),J=require("../../hooks/useControllableValue.js"),B=require("../../utils/is.js"),Q={key:0},X=["onClick"],Y=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},variant:{},maxCount:{},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean,default:void 0},prefix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},inputValue:{},searchValue:{},autoClearSearchValue:{type:Boolean,default:void 0},onDeselect:{},onActive:{},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},options:{},defaultActiveFirstOption:{type:Boolean,default:void 0},listItemHeight:{},onClickOption:{},menuItemSelectedIcon:{},labelInValue:{type:Boolean,default:void 0},showSearch:{type:Boolean,default:void 0},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},addAll:{type:[Boolean,Number],default:5},params:{},searchDelay:{default:300},allowOnlySelect:{type:Boolean,default:!0}},emits:["update:value"],setup(x,{expose:N,emit:O}){let u=0;const t=x,{b:r}=W.useNamespace("field-select"),V=K.default("field"),w=e.ref(!1),{t:S}=G.useLocale(),F=s.debounce(o=>{if(!s.isFunction(t.request))return;u+=1;const n=u;f([]),a.value=!0,t.request(o).then(l=>{u===n&&(f(l),a.value=!1)})},t.searchDelay),q=(o,n)=>{const l=t.fieldNames?.label||"label";return typeof n?.[l]=="string"&&n[l].toLowerCase().indexOf(o.toLowerCase())>-1},{options:p,updateOptions:f}=H.useSelectOptions(t),y=e.shallowRef(),a=e.ref(t?.loading||!1),A=O,_=e.computed(()=>{if(t.multiple)return t.tokenSeparators?"tags":"multiple"});async function m(o=!0){if(!s.isFunction(t.request))return;a.value=!0,u+=1;const n=u;try{o&&f([]);const l=await t.request(void 0,t.params);if(n!==u)return;f(l)}finally{a.value=!1}}function I(o){t.onFocus?.(o),t.refetchOnFocus&&u>0&&!a.value&&m(!0)}e.onMounted(()=>{t.lazy||m()}),e.watch(()=>t.params,()=>{m()},{deep:!0});const{value:i,updateValue:v}=J.useControllableValue(t,A),D=j.useDefaultPlaceholder("Select",t),M=e.computed(()=>{const o=e.unref(i);if(!o)return t.emptyText;const n=t.fieldNames?.label||"label",l=t.fieldNames?.value||"value";return s.isArray(o)?o.map(d=>e.unref(p).find($=>$[l]===d)?.[n]).filter(Boolean).join("、")||t.emptyText:e.unref(p).find(d=>d[l]===o)?.[n]||t.emptyText}),P=e.computed(()=>{const o=!!t?.showSearch,n=t.searchMode;let l={};return o&&(l=n==="request"?{defaultActiveFirstOption:!1,onSearch:F,notFoundContent:a.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:s.isNil(t?.filterOption)?q:t?.filterOption}),{...s.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect"]),placeholder:e.unref(D),...l}}),h=e.computed(()=>p.value.map(o=>o[t.fieldNames?.value||"value"])),b=e.computed(()=>!t.multiple||B.isDef(t.maxCount)?!1:s.isNumber(t.addAll)?h.value.length>=t.addAll:!!t.addAll),z=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!B.isDef(t.maxCount)||t.maxCount>=1));function T(){y.value?.focus()}function L(){y.value?.blur()}function C(o,n){const l=t.fieldNames?.[n]??n;return o[l]}function R(o){const n=C(o,"value");v(t.multiple?[n]:n)}const k=e.computed(()=>{const o=e.unref(i)||[],n=h.value;return n.length>0&&n.every(l=>o.includes(l))}),E=e.computed(()=>(e.unref(i)||[]).length>0&&!k.value);function U(){console.log("123");const o=e.unref(i)||[],n=h.value;n.length&&n.every(l=>o?.includes(l))?v([]):v(h.value)}return N({focus:T,blur:L,request:m}),(o,n)=>o.mode==="read"?(e.openBlock(),e.createElementBlock("span",Q,e.toDisplayString(M.value),1)):(e.openBlock(),e.createBlock(e.unref(c.Select),e.mergeProps({key:1,ref_key:"selectRef",ref:y,"allow-clear":""},P.value,{mode:_.value,value:e.unref(i),options:e.unref(p),loading:a.value,"menu-item-selected-icon":e.h("span"),"popup-class-name":`${e.unref(r)("popup")} ${e.unref(V)}`,open:w.value,virtual:!1,"onUpdate:value":e.unref(v),onFocus:I,onDropdownVisibleChange:n[0]||(n[0]=l=>w.value=l)}),e.createSlots({option:e.withCtx(l=>[e.createVNode(e.unref(c.Flex),{justify:"space-between",align:"center",class:e.normalizeClass(e.unref(r)("popup-option-wrapper")),gap:8},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Flex),{gap:8,align:"center"},{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(c.Checkbox),{key:0,checked:e.unref(i)?.includes(C(l,"value"))},null,8,["checked"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("popup-option-label"))},e.toDisplayString(C(l,"label")),3)]),_:2},1024),z.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("popup-option-action")),onClick:e.withModifiers(()=>R(l),["stop"])},e.toDisplayString(e.unref(S)("ap.field.chooseOnly")),11,X)):e.createCommentVNode("",!0)]),_:2},1032,["class"])]),_:2},[e.renderList(o.$slots,(l,g)=>({name:g,fn:e.withCtx(d=>[e.renderSlot(o.$slots,g,e.normalizeProps(e.guardReactiveProps(d||{})))])})),a.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(c.Spin),{size:"small"})]),key:"0"}:void 0,b.value?{name:"dropdownRender",fn:e.withCtx(({menuNode:l})=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("popup-all-option-wrapper"))},[e.createElementVNode("div",{tabindex:-1,class:e.normalizeClass(e.unref(r)("popup-all-option")),onClick:U},[e.createVNode(e.unref(c.Checkbox),{checked:k.value,indeterminate:E.value},null,8,["checked","indeterminate"]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("popup-all-option-label"))},e.toDisplayString(e.unref(S)("ap.field.selectAll")),3)],2)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l)))]),key:"1"}:void 0]),1040,["mode","value","options","loading","menu-item-selected-icon","popup-class-name","open","onUpdate:value"]))}});exports.default=Y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../style/index.js"),n=i=>{const{componentCls:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../style/index.js"),n=i=>{const{componentCls:a}=i,p=`${a}-select-popup`;return{[`${p}`]:{padding:0,[`${p}-all-option-wrapper`]:{padding:i.space,paddingBlockEnd:i.spaceXS},[`${p}-all-option`]:{width:"100%",display:"inline-flex",cursor:"pointer",paddingInline:i.space,paddingBlock:i.spaceSM,[`${p}-all-option-label`]:{paddingInline:i.space}},[`${p}-option-wrapper`]:{height:"22px"},[`${p}-option-label`]:{...l.singleRow(i),color:"inherit"},[`${p}-option-action`]:{display:"none",color:i.colorPrimary,paddingInline:i.spaceSM,paddingBlock:i.spaceXXS,"&:hover":{background:i.colorPrimary,color:"#fff",borderRadius:"2px"}},"div.ant-select-item":{paddingInline:i.space,paddingBlock:i.spaceXS,fontWeight:"normal !important",marginBottom:i.spaceXS,marginInline:i.space,"&:hover":{[`${p}-option-action`]:{display:"inline"}},"&:last-child":{marginBottom:i.space}}}}};exports.genSelectStyle=n;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.13.
|
|
3
|
+
"version": "7.13.7",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"@aplus-frontend/utils": "1.0.65"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@aplus-frontend/antdv": "^2.0.
|
|
47
|
+
"@aplus-frontend/antdv": "^2.0.5",
|
|
48
48
|
"@aplus-frontend/icon": "^2.0.6",
|
|
49
49
|
"@aplus-frontend/oss": "^2.0.1",
|
|
50
50
|
"vue": "^3.5.21",
|
|
51
51
|
"vxe-table": "^4.13.37"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@aplus-frontend/antdv": "^2.0.
|
|
54
|
+
"@aplus-frontend/antdv": "^2.0.5",
|
|
55
55
|
"@aplus-frontend/icon": "^2.0.6",
|
|
56
56
|
"@aplus-frontend/oss": "^2.0.1",
|
|
57
57
|
"@emotion/serialize": "^1.3.3",
|