@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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as te, ref as V, shallowRef as le, computed as r, onMounted as ne, watch as ae, unref as n, createElementBlock as I, createBlock as k, openBlock as p, toDisplayString as C, mergeProps as re, h as se, createSlots as ue, withCtx as c, createVNode as w, normalizeClass as f, createCommentVNode as _, createElementVNode as x, withModifiers as ie, renderList as ce, renderSlot as de, normalizeProps as pe, guardReactiveProps as fe, resolveDynamicComponent as me } from "vue";
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 l = s;
118
- v([]), a.value = !0, e.request(o).then((t) => {
119
- s === l && (v(t), a.value = !1);
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, l) => {
121
+ }, e.searchDelay), $ = (o, a) => {
122
122
  const t = e.fieldNames?.label || "label";
123
- return typeof l?.[t] == "string" && l[t].toLowerCase().indexOf(o.toLowerCase()) > -1;
124
- }, { options: m, updateOptions: v } = ke(e), S = le(), a = V(e?.loading || !1), K = L, j = r(() => {
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
- a.value = !0, s += 1;
132
- const l = s;
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 (l !== s)
136
+ if (a !== s)
137
137
  return;
138
138
  v(t);
139
139
  } finally {
140
- a.value = !1;
140
+ n.value = !1;
141
141
  }
142
142
  }
143
143
  function E(o) {
144
- e.onFocus?.(o), e.refetchOnFocus && s > 0 && !a.value && h(!0);
144
+ e.onFocus?.(o), e.refetchOnFocus && s > 0 && !n.value && h(!0);
145
145
  }
146
- ne(() => {
146
+ ae(() => {
147
147
  e.lazy || h();
148
- }), ae(
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 = n(i);
158
+ const o = l(i);
159
159
  if (!o)
160
160
  return e.emptyText;
161
- const l = e.fieldNames?.label || "label", t = e.fieldNames?.value || "value";
161
+ const a = e.fieldNames?.label || "label", t = e.fieldNames?.value || "value";
162
162
  return ge(o) ? o.map(
163
- (d) => n(m).find((oe) => oe[t] === d)?.[l]
164
- ).filter(Boolean).join("、") || e.emptyText : n(m).find(
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
- )?.[l] || e.emptyText;
166
+ )?.[a] || e.emptyText;
167
167
  }), G = r(() => {
168
- const o = !!e?.showSearch, l = e.searchMode;
168
+ const o = !!e?.showSearch, a = e.searchMode;
169
169
  let t = {};
170
- return o && (t = l === "request" ? {
170
+ return o && (t = a === "request" ? {
171
171
  defaultActiveFirstOption: !1,
172
172
  onSearch: U,
173
- notFoundContent: a.value ? void 0 : null,
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: n(H),
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
- S.value?.focus();
198
+ b.value?.focus();
199
199
  }
200
200
  function X() {
201
- S.value?.blur();
201
+ b.value?.blur();
202
202
  }
203
- function b(o, l) {
204
- const t = e.fieldNames?.[l] ?? l;
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 l = b(o, "value");
209
- y(e.multiple ? [l] : l);
208
+ const a = B(o, "value");
209
+ y(e.multiple ? [a] : a);
210
210
  }
211
211
  const A = r(() => {
212
- const o = n(i) || [], l = g.value;
213
- return l.length > 0 && l.every((t) => o.includes(t));
214
- }), Z = r(() => (n(i) || []).length > 0 && !A.value);
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 = n(i) || [], l = g.value;
218
- l.length && l.every((t) => o?.includes(t)) ? y([]) : y(g.value);
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, l) => o.mode === "read" ? (p(), I("span", Ne, C(W.value), 1)) : (p(), k(n(ve), re({
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: S,
227
+ ref: b,
228
228
  "allow-clear": ""
229
229
  }, G.value, {
230
230
  mode: j.value,
231
- value: n(i),
232
- options: n(m),
233
- loading: a.value,
231
+ value: l(i),
232
+ options: l(m),
233
+ loading: n.value,
234
234
  "menu-item-selected-icon": se("span"),
235
- "popup-class-name": `${n(u)("popup")} ${n(z)}`,
235
+ "popup-class-name": `${l(u)("popup")} ${l(z)}`,
236
236
  open: O.value,
237
- "onUpdate:value": n(y),
237
+ virtual: !1,
238
+ "onUpdate:value": l(y),
238
239
  onFocus: E,
239
- onDropdownVisibleChange: l[0] || (l[0] = (t) => O.value = t)
240
+ onDropdownVisibleChange: a[0] || (a[0] = (t) => O.value = t)
240
241
  }), ue({
241
242
  option: c((t) => [
242
- w(n(M), {
243
+ w(l(M), {
243
244
  justify: "space-between",
244
245
  align: "center",
245
- class: f(n(u)("popup-option-wrapper")),
246
+ class: p(l(u)("popup-option-wrapper")),
246
247
  gap: 8
247
248
  }, {
248
249
  default: c(() => [
249
- w(n(M), {
250
+ w(l(M), {
250
251
  gap: 8,
251
252
  align: "center"
252
253
  }, {
253
254
  default: c(() => [
254
- N.value ? (p(), k(n(P), {
255
+ N.value ? (f(), x(l(P), {
255
256
  key: 0,
256
- checked: n(i)?.includes(
257
- b(t, "value")
257
+ checked: l(i)?.includes(
258
+ B(t, "value")
258
259
  )
259
260
  }, null, 8, ["checked"])) : _("", !0),
260
- x("span", {
261
- class: f(n(u)("popup-option-label"))
262
- }, C(b(t, "label")), 3)
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 ? (p(), I("span", {
267
+ J.value ? (f(), I("span", {
267
268
  key: 0,
268
- class: f(n(u)("popup-option-action")),
269
+ class: p(l(u)("popup-option-action")),
269
270
  onClick: ie(() => Y(t), ["stop"])
270
- }, C(n(F)("ap.field.chooseOnly")), 11, Ae)) : _("", !0)
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, B) => ({
278
- name: B,
278
+ ce(o.$slots, (t, k) => ({
279
+ name: k,
279
280
  fn: c((d) => [
280
- de(o.$slots, B, pe(fe(d || {})))
281
+ pe(o.$slots, k, de(fe(d || {})))
281
282
  ])
282
283
  })),
283
- a.value ? {
284
+ n.value ? {
284
285
  name: "notFoundContent",
285
286
  fn: c(() => [
286
- w(n(he), { size: "small" })
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
- x("div", {
294
- tabindex: -1,
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
- w(n(P), {
299
- checked: A.value,
300
- indeterminate: Z.value
301
- }, null, 8, ["checked", "indeterminate"]),
302
- x("span", {
303
- class: f(n(u)("popup-all-option-label"))
304
- }, C(n(F)("ap.field.selectAll")), 3)
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
- (p(), k(me(t)))
311
+ (f(), x(me(t)))
307
312
  ]),
308
313
  key: "1"
309
314
  } : void 0
@@ -1,9 +1,14 @@
1
- import { singleRow as a } from "../../style/index.mjs";
1
+ import { singleRow as l } from "../../style/index.mjs";
2
2
  const n = (i) => {
3
- const { componentCls: o } = i, p = `${o}-select-popup`;
3
+ const { componentCls: a } = i, p = `${a}-select-popup`;
4
4
  return {
5
5
  [`${p}`]: {
6
- padding: i.space,
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
- ...a(i),
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: 0
52
+ marginBottom: i.space
47
53
  }
48
54
  }
49
55
  }
@@ -1,23 +1,23 @@
1
- import { defineComponent as ce, computed as x, ref as Q, watch as fe, createVNode as y, createElementBlock as X, openBlock as c, Fragment as Y, createBlock as v, createCommentVNode as P, unref as t, mergeProps as V, withCtx as f, createTextVNode as A, toDisplayString as M, normalizeClass as K } from "vue";
2
- import { DownOutlined as me } from "@ant-design/icons-vue";
3
- import { message as q, Space as ye, Tooltip as j, Dropdown as ge, Menu as xe, MenuItem as Z } from "@aplus-frontend/antdv";
4
- import { usePermission as ve } from "@aplus-frontend/hooks";
5
- import { IconApAdLineAnnotation as B } from "@aplus-frontend/icon";
6
- import { transformTableParamsNoTimezone as he, isObjectWithContent as T } from "@aplus-frontend/utils";
7
- import { merge as m } from "lodash-unified";
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 ke } from "../../ap-table/context.mjs";
9
+ import { useInjectApTable as be } from "../../ap-table/context.mjs";
10
10
  import "../../config-provider/index.mjs";
11
- import { ApBatchActionGroup as be } from "../ap-batch-action-group/index.mjs";
12
- import { convertExportField as Ee } from "./convertExportField.mjs";
13
- import { handleExportDownload as we } from "./handleExportDownload.mjs";
14
- import { ApExportGroupActionType as h } from "./interface.mjs";
15
- import De from "./style/index.mjs";
16
- import { useNamespace as Le } from "../../config-provider/hooks/use-namespace.mjs";
17
- import { useLocale as Re } from "../../config-provider/hooks/use-locale.mjs";
18
- import { useGlobalConfig as Se } from "../../config-provider/hooks/use-global-config.mjs";
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 We = /* @__PURE__ */ ce({
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
- } = ve(), n = ee, {
56
+ } = he(), s = ee, {
57
57
  columns: z,
58
58
  dataSource: U,
59
59
  getSearchFormValues: te,
60
60
  getLastParams: ae
61
- } = ke(), {
62
- b: k
63
- } = Le("ap-export-group"), b = De("ap-export-group"), {
61
+ } = be(), {
62
+ b: v
63
+ } = Re("ap-export-group"), h = Le("ap-export-group"), {
64
64
  t: i
65
- } = Re(), W = Se("apExportGroup"), H = x(() => W?.value?.exportField), J = x(() => W?.value?.dateValidate), E = x(() => J.value === !0 ? {
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), w = x(() => n?.dateValidate === !0 ? {
68
+ } : J.value), b = y(() => s?.dateValidate === !0 ? {
69
69
  maxDayRange: 90,
70
70
  smartIdentify: !0
71
- } : n?.dateValidate), S = Q(!1), I = Q(!1), G = x(() => !!n?.disabled || (U !== void 0 ? !U?.value?.length : !1) || S.value), s = (e) => e === void 0 ? !1 : typeof e == "object" ? m({}, e) : e === !0 ? {} : e;
72
- fe(() => G.value, () => {
73
- G.value && (I.value = !1);
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 oe = x(() => n?.successMessage === !0 ? i("ap.apExportGroup.exportSuccess") : n?.successMessage ? n.successMessage : ""), re = (e = n?.exportField) => {
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
- }, ne = {
96
+ }, re = {
86
97
  textAlign: "center"
87
- }, F = x(() => n?.selectedRowKeys || []), O = x(() => {
88
- let e = n?.ifShow;
89
- return !n?.ifShow && n?.auth && (e = () => $(n.auth)), e?.() ?? !0;
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 se() {
92
- F.value.length > 0 ? _({
93
- key: h.SELECT
94
- }) : _({
95
- key: h.ALL
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 = m({}, n, a || {}), {
103
- getRequestParams: p,
104
- request: L
105
- } = o || {}, r = ae?.()?.sort, l = r ? he({
106
- sort: r
107
- }) : {}, u = re(o?.exportField);
108
- let d = {};
109
- e === h.SELECT ? d = {
110
- [o?.idKey || "ids"]: F.value
111
- } : e === h.ALL && (d = p?.() || te?.(!0) || {});
112
- const g = o?.getInitialParams?.() || {};
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
- S.value = !0;
115
- let C = Object.assign({
116
- ...d,
117
- ...g,
125
+ R.value = !0;
126
+ let S = Object.assign({
127
+ ...p,
128
+ ...m,
118
129
  ...l
119
130
  }, u && z?.value ? {
120
- [u.key]: Ee(z.value, u?.convertField)
131
+ [u.key]: we(z.value, u?.convertField)
121
132
  } : {});
122
- C = o?.beforeRequest?.(C) || C;
123
- const R = m({}, s(E.value), s(w.value), s(a?.dateValidate));
124
- T(R) && e === h.ALL && de({
125
- params: C,
126
- dateValidate: R
127
- }), await we(async () => await L?.(C)), o?.successMessage && q.success(oe.value);
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
- S.value = !1;
140
+ R.value = !1;
130
141
  }
131
142
  }
132
- const D = x(() => n?.groupList?.filter((e) => {
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
- F.value.length > 0 ? _({
144
- key: h.SELECT,
154
+ T.value.length > 0 ? P({
155
+ key: x.SELECT,
145
156
  option: e
146
- }) : _({
147
- key: h.ALL,
157
+ }) : P({
158
+ key: x.ALL,
148
159
  option: e
149
160
  });
150
161
  }
151
- })) || []), le = () => {
152
- const e = m({}, s(E.value), s(w.value), D.value.reduce((a, o) => m(a, s(o.dateValidate)), {}));
153
- return y(ye, {
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: () => [y("span", null, [n?.buttonProps?.content ?? i("ap.apExportGroup.export")]), T(e) ? y(j, {
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: () => [y(B, {
162
- class: [k("icon"), b.value]
172
+ default: () => [f(j, {
173
+ class: [v("icon"), h.value]
163
174
  }, null)]
164
175
  }) : null]
165
176
  });
166
- }, ue = (e) => Object.keys(e).reduce((a, o) => typeof e?.[o] == "number" && e?.[o] > 1e4 ? {
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, {}), ie = (e) => {
170
- const a = Object.keys(e), o = [], p = /* @__PURE__ */ new Set(), L = [];
171
- for (let r = 0; r < a.length; r++)
172
- for (let l = r + 1; l < a.length; l++) {
173
- const u = a[r], d = a[l];
174
- let g = "";
175
- const C = Math.min(u.length, d.length);
176
- for (let R = 0; R < C && u[R] === d[R]; R++)
177
- g += u[R];
178
- g.length >= 3 && L.push({
179
- prefix: g,
180
- length: g.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: d,
183
- diff: Math.abs(e[u] - e[d])
193
+ key2: p,
194
+ diff: Math.abs(e[u] - e[p])
184
195
  });
185
196
  }
186
- L.sort((r, l) => l.length !== r.length ? l.length - r.length : r.diff - l.diff);
187
- for (const r of L)
188
- if (!p.has(r.key1) && !p.has(r.key2)) {
189
- const l = e[r.key1], u = e[r.key2];
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 ? r.key1 : r.key2,
192
- endKey: l < u ? r.key2 : r.key1
193
- }), p.add(r.key1), p.add(r.key2);
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
- }, pe = ({
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, de = ({
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, p = ue(e), L = [...a.smartIdentify ?? !0 ? ie(p) : [], ...a.dateKeyList?.filter((r) => p[r.startKey || ""] && p[r.endKey || ""]) ?? []];
205
- if (L.length === 0) {
206
- q.warn(a?.emptyTooltip ?? i("ap.apExportGroup.emptyTooltip", {
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 (L.some(({
221
+ } else if (D.some(({
211
222
  startKey: l,
212
223
  endKey: u
213
224
  }) => {
214
- const d = p[l || ""], g = p[u || ""];
215
- return d !== void 0 && g !== void 0 && !pe({
216
- startTime: d,
217
- endTime: g,
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
- q.warn(a?.maxDayRangeTooltip ?? i("ap.apExportGroup.maxDayRangeTooltip", {
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) => (c(), X(Y, null, [O.value && n.type === "button" ? (c(), v(t(N), V({
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(k)(), t(b)],
233
- disabled: G.value,
234
- loading: S.value,
243
+ class: [t(v)(), t(h)],
244
+ disabled: C.value,
245
+ loading: R.value,
235
246
  "min-width": "",
236
- onClick: se
247
+ onClick: le
237
248
  }), {
238
- default: f(() => [A(M(n?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(T)(t(m)({}, s(E.value), s(w.value))) ? (c(), v(t(j), {
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: t(m)({}, s(E.value), s(w.value)).maxDayRange ?? 90
252
+ maxDayRange: E(k.value, b.value).maxDayRange ?? 90
242
253
  })
243
254
  }, {
244
- default: f(() => [y(t(B), {
245
- class: K([t(k)("icon"), t(b)])
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"])) : P("", !0)]),
259
+ }, 8, ["title"])) : G("", !0)]),
249
260
  _: 1
250
- }, 16, ["class", "disabled", "loading"])) : P("", !0), O.value && n.type === "dropdown" ? (c(), v(t(ge), {
261
+ }, 16, ["class", "disabled", "loading"])) : G("", !0), I.value && s.type === "dropdown" ? (d(), g(t(xe), {
251
262
  key: 1,
252
- open: I.value,
253
- "onUpdate:open": a[0] || (a[0] = (o) => I.value = o),
254
- class: K([t(k)(), t(b)]),
255
- "overlay-style": ne,
256
- disabled: G.value
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: f(() => [y(t(xe), {
259
- onClick: _
269
+ overlay: c(() => [f(t(ve), {
270
+ onClick: P
260
271
  }, {
261
- default: f(() => [(c(), v(t(Z), {
262
- key: t(h).SELECT,
263
- disabled: F.value?.length === 0
272
+ default: c(() => [(d(), g(t(Z), {
273
+ key: t(x).SELECT,
274
+ disabled: T.value?.length === 0
264
275
  }, {
265
- default: f(() => [A(M(t(i)("ap.apExportGroup.exportSelected")), 1)]),
276
+ default: c(() => [_(A(t(i)("ap.apExportGroup.exportSelected")), 1)]),
266
277
  _: 1
267
- }, 8, ["disabled"])), (c(), v(t(Z), {
268
- key: t(h).ALL
278
+ }, 8, ["disabled"])), (d(), g(t(Z), {
279
+ key: t(x).ALL
269
280
  }, {
270
- default: f(() => [A(M(t(i)("ap.apExportGroup.exportAll")), 1)]),
281
+ default: c(() => [_(A(t(i)("ap.apExportGroup.exportAll")), 1)]),
271
282
  _: 1
272
283
  }))]),
273
284
  _: 1
274
285
  })]),
275
- default: f(() => [y(t(N), V({
286
+ default: c(() => [f(t(N), V({
276
287
  ...e.$attrs
277
288
  }, {
278
- loading: S.value
289
+ loading: R.value
279
290
  }), {
280
- default: f(() => [A(M(n?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(T)(t(m)({}, s(E.value), s(w.value))) ? (c(), v(t(j), {
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: t(m)({}, s(E.value), s(w.value)).maxDayRange ?? 90
294
+ maxDayRange: E(k.value, b.value).maxDayRange ?? 90
284
295
  })
285
296
  }, {
286
- default: f(() => [y(t(B), {
287
- class: K([t(k)("icon"), t(b)])
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"])) : P("", !0), y(t(me))]),
301
+ }, 8, ["title"])) : G("", !0), f(t(ye))]),
291
302
  _: 1
292
303
  }, 16, ["loading"])]),
293
304
  _: 1
294
- }, 8, ["open", "class", "disabled"])) : P("", !0), O.value && n.type === "group" ? (c(), X(Y, {
305
+ }, 8, ["open", "class", "disabled"])) : G("", !0), I.value && s.type === "group" ? (d(), X(Y, {
295
306
  key: 2
296
- }, [D.value.length === 1 ? (c(), v(t(N), V({
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(k)(), t(b)],
302
- disabled: G.value || D.value?.[0]?.disabled,
303
- loading: S.value,
312
+ class: [t(v)(), t(h)],
313
+ disabled: C.value || w.value?.[0]?.disabled,
314
+ loading: R.value,
304
315
  "min-width": "",
305
- onClick: D.value?.[0]?.onClick
316
+ onClick: w.value?.[0]?.onClick
306
317
  }), {
307
- default: f(() => [A(M(D.value?.[0]?.content ?? n?.text ?? t(i)("ap.apExportGroup.export")) + " ", 1), t(T)(t(m)({}, s(E.value), s(w.value), s(D.value?.[0]?.dateValidate))) ? (c(), v(t(j), {
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: t(m)({}, s(E.value), s(w.value), s(D.value?.[0]?.dateValidate)).maxDayRange ?? 90
321
+ maxDayRange: E(k.value, b.value, w.value?.[0]?.dateValidate).maxDayRange ?? 90
311
322
  })
312
323
  }, {
313
- default: f(() => [y(t(B), {
314
- class: K([t(k)("icon"), t(b)])
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"])) : P("", !0)]),
328
+ }, 8, ["title"])) : G("", !0)]),
318
329
  _: 1
319
- }, 16, ["class", "disabled", "loading", "onClick"])) : (c(), v(t(be), V({
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(k)(), t(b)],
325
- disabled: G.value,
326
- loading: S.value,
335
+ class: [t(v)(), t(h)],
336
+ disabled: C.value,
337
+ loading: R.value,
327
338
  "button-props": {
328
- ...n.buttonProps,
329
- content: le(),
330
- type: n?.buttonProps?.type ?? "default"
339
+ ...s.buttonProps,
340
+ content: ue(),
341
+ type: s?.buttonProps?.type ?? "default"
331
342
  },
332
- "menu-list": D.value
333
- }), null, 16, ["class", "disabled", "loading", "button-props", "menu-list"]))], 64)) : P("", !0)], 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
- We as default
348
+ He as default
338
349
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "7.13.5";
1
+ declare const _default: "7.13.7";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.13.5";
1
+ const e = "7.13.7";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),r=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:s}=W.useNamespace("field-select"),F=K.default("field"),w=e.ref(!1),{t:S}=G.useLocale(),V=r.debounce(o=>{if(!r.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(!r.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 r.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:V,notFoundContent:a.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:r.isNil(t?.filterOption)?q:t?.filterOption}),{...r.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:r.isNumber(t.addAll)?h.value.length>=t.addAll:!!t.addAll),T=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!B.isDef(t.maxCount)||t.maxCount>=1));function z(){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:z,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(s)("popup")} ${e.unref(F)}`,open:w.value,"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(s)("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(s)("popup-option-label"))},e.toDisplayString(C(l,"label")),3)]),_:2},1024),T.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(s)("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",{tabindex:-1,class:e.normalizeClass(e.unref(s)("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(s)("popup-all-option-label"))},e.toDisplayString(e.unref(S)("ap.field.selectAll")),3)],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
+ "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:e}=i,o=`${e}-select-popup`;return{[`${o}`]:{padding:i.space,[`${o}-all-option`]:{width:"100%",display:"inline-flex",cursor:"pointer",paddingInline:i.space,paddingBlock:i.spaceSM,[`${o}-all-option-label`]:{paddingInline:i.space}},[`${o}-option-wrapper`]:{height:"22px"},[`${o}-option-label`]:{...l.singleRow(i),color:"inherit"},[`${o}-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,"&:hover":{[`${o}-option-action`]:{display:"inline"}},"&:last-child":{marginBottom:0}}}}};exports.genSelectStyle=n;
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"),X=require("@ant-design/icons-vue"),p=require("@aplus-frontend/antdv"),Y=require("@aplus-frontend/hooks"),V=require("@aplus-frontend/icon"),D=require("@aplus-frontend/utils"),f=require("lodash-unified");require("../../ap-button/index.js");const Z=require("../../ap-table/context.js");require("../../config-provider/index.js");const ee=require("../ap-batch-action-group/index.js"),te=require("./convertExportField.js"),oe=require("./handleExportDownload.js"),y=require("./interface.js"),ae=require("./style/index.js"),ne=require("../../config-provider/hooks/use-namespace.js"),re=require("../../config-provider/hooks/use-locale.js"),ue=require("../../config-provider/hooks/use-global-config.js"),S=require("../../ap-button/ap-button.vue.js"),se=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}=Y.usePermission(),r=F,{columns:R,dataSource:_,getSearchFormValues:j,getLastParams:I}=Z.useInjectApTable(),{b:m}=ne.useNamespace("ap-export-group"),x=ae.default("ap-export-group"),{t:i}=re.useLocale(),N=ue.useGlobalConfig("apExportGroup"),P=e.computed(()=>N?.value?.exportField),M=e.computed(()=>N?.value?.dateValidate),v=e.computed(()=>M.value===!0?{maxDayRange:90,smartIdentify:!0}:M.value),h=e.computed(()=>r?.dateValidate===!0?{maxDayRange:90,smartIdentify:!0}:r?.dateValidate),E=e.ref(!1),B=e.ref(!1),w=e.computed(()=>!!r?.disabled||(_!==void 0?!_?.value?.length:!1)||E.value),u=t=>t===void 0?!1:typeof t=="object"?f.merge({},t):t===!0?{}:t;e.watch(()=>w.value,()=>{w.value&&(B.value=!1)},{immediate:!0});const K=e.computed(()=>r?.successMessage===!0?i("ap.apExportGroup.exportSuccess"):r?.successMessage?r.successMessage:""),O=(t=r?.exportField)=>{const o="exportFieldList",a=t??(P.value===""?!0:P.value)??!1;return a===!0?{key:o}:typeof a=="object"?{...a,key:a.key??o}:a},z={textAlign:"center"},L=e.computed(()=>r?.selectedRowKeys||[]),G=e.computed(()=>{let t=r?.ifShow;return!r?.ifShow&&r?.auth&&(t=()=>q(r.auth)),t?.()??!0});async function W(){L.value.length>0?T({key:y.ApExportGroupActionType.SELECT}):T({key:y.ApExportGroupActionType.ALL})}async function T({key:t,option:o}){const a=f.merge({},r,o||{}),{getRequestParams:c,request:b}=a||{},n=I?.()?.sort,s=n?D.transformTableParamsNoTimezone({sort:n}):{},l=O(a?.exportField);let d={};t===y.ApExportGroupActionType.SELECT?d={[a?.idKey||"ids"]:L.value}:t===y.ApExportGroupActionType.ALL&&(d=c?.()||j?.(!0)||{});const g=a?.getInitialParams?.()||{};try{E.value=!0;let A=Object.assign({...d,...g,...s},l&&R?.value?{[l.key]:te.convertExportField(R.value,l?.convertField)}:{});A=a?.beforeRequest?.(A)||A;const C=f.merge({},u(v.value),u(h.value),u(o?.dateValidate));D.isObjectWithContent(C)&&t===y.ApExportGroupActionType.ALL&&Q({params:A,dateValidate:C}),await oe.handleExportDownload(async()=>await b?.(A)),a?.successMessage&&p.message.success(K.value)}finally{E.value=!1}}const k=e.computed(()=>r?.groupList?.filter(t=>{let o=t?.ifShow;return!t?.ifShow&&t?.auth&&(o=()=>q(t.auth)),o?.()??!0})?.map((t,o)=>({key:o,content:t?.text,auth:t?.auth,ifShow:t?.ifShow,disabled:t?.disabled,dateValidate:t?.dateValidate,onClick:()=>{L.value.length>0?T({key:y.ApExportGroupActionType.SELECT,option:t}):T({key:y.ApExportGroupActionType.ALL,option:t})}}))||[]),$=()=>{const t=f.merge({},u(v.value),u(h.value),k.value.reduce((o,a)=>f.merge(o,u(a.dateValidate)),{}));return e.createVNode(p.Space,{size:4},{default:()=>[e.createVNode("span",null,[r?.buttonProps?.content??i("ap.apExportGroup.export")]),D.isObjectWithContent(t)?e.createVNode(p.Tooltip,{title:i("ap.apExportGroup.maxMessage",{maxDayRange:t.maxDayRange??90})},{default:()=>[e.createVNode(V.IconApAdLineAnnotation,{class:[m("icon"),x.value]},null)]}):null]})},U=t=>Object.keys(t).reduce((o,a)=>typeof t?.[a]=="number"&&t?.[a]>1e4?{...o,[a]:t?.[a]}:o,{}),H=t=>{const o=Object.keys(t),a=[],c=new Set,b=[];for(let n=0;n<o.length;n++)for(let s=n+1;s<o.length;s++){const l=o[n],d=o[s];let g="";const A=Math.min(l.length,d.length);for(let C=0;C<A&&l[C]===d[C];C++)g+=l[C];g.length>=3&&b.push({prefix:g,length:g.length,key1:l,key2:d,diff:Math.abs(t[l]-t[d])})}b.sort((n,s)=>s.length!==n.length?s.length-n.length:n.diff-s.diff);for(const n of b)if(!c.has(n.key1)&&!c.has(n.key2)){const s=t[n.key1],l=t[n.key2];a.push({startKey:s<l?n.key1:n.key2,endKey:s<l?n.key2:n.key1}),c.add(n.key1),c.add(n.key2)}return a},J=({startTime:t,endTime:o,maxDayRange:a})=>Math.abs(o-t)<=(a*24+1)*60*60*1e3,Q=({params:t,dateValidate:o})=>{const a=o.maxDayRange??90,c=U(t),b=[...o.smartIdentify??!0?H(c):[],...o.dateKeyList?.filter(n=>c[n.startKey||""]&&c[n.endKey||""])??[]];if(b.length===0){p.message.warn(o?.emptyTooltip??i("ap.apExportGroup.emptyTooltip",{maxDayRange:a}));return}else if(b.some(({startKey:s,endKey:l})=>{const d=c[s||""],g=c[l||""];return d!==void 0&&g!==void 0&&!J({startTime:d,endTime:g,maxDayRange:a})})){p.message.warn(o?.maxDayRangeTooltip??i("ap.apExportGroup.maxDayRangeTooltip",{maxDayRange:a}));return}};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[G.value&&r.type==="button"?(e.openBlock(),e.createBlock(e.unref(S.default),e.mergeProps({key:0},{...t.$attrs},{class:[e.unref(m)(),e.unref(x)],disabled:w.value,loading:E.value,"min-width":"",onClick:W}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(D.isObjectWithContent)(e.unref(f.merge)({},u(v.value),u(h.value)))?(e.openBlock(),e.createBlock(e.unref(p.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:e.unref(f.merge)({},u(v.value),u(h.value)).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(m)("icon"),e.unref(x)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},16,["class","disabled","loading"])):e.createCommentVNode("",!0),G.value&&r.type==="dropdown"?(e.openBlock(),e.createBlock(e.unref(p.Dropdown),{key:1,open:B.value,"onUpdate:open":o[0]||(o[0]=a=>B.value=a),class:e.normalizeClass([e.unref(m)(),e.unref(x)]),"overlay-style":z,disabled:w.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(p.Menu),{onClick:T},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(p.MenuItem),{key:e.unref(y.ApExportGroupActionType).SELECT,disabled:L.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(p.MenuItem),{key:e.unref(y.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:E.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(D.isObjectWithContent)(e.unref(f.merge)({},u(v.value),u(h.value)))?(e.openBlock(),e.createBlock(e.unref(p.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:e.unref(f.merge)({},u(v.value),u(h.value)).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(m)("icon"),e.unref(x)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(X.DownOutlined))]),_:1},16,["loading"])]),_:1},8,["open","class","disabled"])):e.createCommentVNode("",!0),G.value&&r.type==="group"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[k.value.length===1?(e.openBlock(),e.createBlock(e.unref(S.default),e.mergeProps({key:0},{...t.$attrs},{class:[e.unref(m)(),e.unref(x)],disabled:w.value||k.value?.[0]?.disabled,loading:E.value,"min-width":"",onClick:k.value?.[0]?.onClick}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.value?.[0]?.content??r?.text??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.unref(D.isObjectWithContent)(e.unref(f.merge)({},u(v.value),u(h.value),u(k.value?.[0]?.dateValidate)))?(e.openBlock(),e.createBlock(e.unref(p.Tooltip),{key:0,title:e.unref(i)("ap.apExportGroup.maxMessage",{maxDayRange:e.unref(f.merge)({},u(v.value),u(h.value),u(k.value?.[0]?.dateValidate)).maxDayRange??90})},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconApAdLineAnnotation),{class:e.normalizeClass([e.unref(m)("icon"),e.unref(x)])},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},16,["class","disabled","loading","onClick"])):(e.openBlock(),e.createBlock(e.unref(ee.ApBatchActionGroup),e.mergeProps({key:1},{...t.$attrs},{class:[e.unref(m)(),e.unref(x)],disabled:w.value,loading:E.value,"button-props":{...r.buttonProps,content:$(),type:r?.buttonProps?.type??"default"},"menu-list":k.value}),null,16,["class","disabled","loading","button-props","menu-list"]))],64)):e.createCommentVNode("",!0)],64))}});exports.default=se;
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;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.13.5";
1
+ declare const _default: "7.13.7";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.13.5";exports.default=e;
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.5",
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.4",
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.4",
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",