@aplus-frontend/ui 0.2.26 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-form/search-form/index.vue.mjs +77 -77
- package/es/src/ap-form/search-form/utils.d.ts +1 -0
- package/es/src/ap-form/search-form/utils.mjs +18 -11
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +12 -15
- package/es/src/ap-upload/components/Picture.vue2.mjs +10 -13
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +15 -18
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +15 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +57 -56
- package/es/src/business/ap-export-group/index.d.ts +57 -35
- package/es/src/business/ap-export-group/interface.d.ts +1 -0
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +5 -5
- package/es/src/locale/lang/en.mjs +2 -1
- package/es/src/locale/lang/zh-cn.mjs +2 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/utils.d.ts +1 -0
- package/lib/src/ap-form/search-form/utils.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +15 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/index.d.ts +57 -35
- package/lib/src/business/ap-export-group/interface.d.ts +1 -0
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/package.json +4 -4
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as
|
|
1
|
+
import { isVNode as le, defineComponent as re, useSlots as se, ref as ie, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ue, createVNode as a, Fragment as _, openBlock as m, createBlock as y, mergeProps as ce, withCtx as S, resolveDynamicComponent as A, createElementBlock as pe, renderList as de } from "vue";
|
|
2
|
+
import { Col as F, Flex as M, Space as fe, Button as E, Row as me } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import { genRealChildren as D } from "../item-group/helper.mjs";
|
|
7
|
-
import { DoubleRightOutlined as
|
|
7
|
+
import { DoubleRightOutlined as he } from "@ant-design/icons-vue";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { isArray as
|
|
9
|
+
import { isArray as xe, isBoolean as ye, omit as Ce } from "lodash-unified";
|
|
10
10
|
import { isDef as $ } from "../../utils/index.mjs";
|
|
11
|
-
import { diffFormItem as
|
|
12
|
-
import { useControllableValue as
|
|
13
|
-
import { useNamespace as
|
|
11
|
+
import { execFunc as L, diffFormItem as ge } from "./utils.mjs";
|
|
12
|
+
import { useControllableValue as _e } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
14
|
import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
|
|
15
|
-
import { useLocale as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
function
|
|
19
|
-
return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !
|
|
15
|
+
import { useLocale as Re } from "../../config-provider/hooks/use-locale.mjs";
|
|
16
|
+
import U from "../item/index.vue.mjs";
|
|
17
|
+
import Se from "../ap-form.vue2.mjs";
|
|
18
|
+
function Ae(h) {
|
|
19
|
+
return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !le(h);
|
|
20
20
|
}
|
|
21
|
-
const i = 24,
|
|
21
|
+
const i = 24, qe = /* @__PURE__ */ re({
|
|
22
22
|
name: "ApFormSearchForm",
|
|
23
23
|
__name: "index",
|
|
24
24
|
props: {
|
|
@@ -104,55 +104,55 @@ const i = 24, We = /* @__PURE__ */ le({
|
|
|
104
104
|
},
|
|
105
105
|
emits: ["update:collapse"],
|
|
106
106
|
setup(h, {
|
|
107
|
-
expose:
|
|
108
|
-
emit:
|
|
107
|
+
expose: W,
|
|
108
|
+
emit: q
|
|
109
109
|
}) {
|
|
110
110
|
var N;
|
|
111
|
-
const s =
|
|
111
|
+
const s = se(), n = h, z = q, {
|
|
112
112
|
value: u,
|
|
113
|
-
updateValue:
|
|
114
|
-
} =
|
|
113
|
+
updateValue: H
|
|
114
|
+
} = _e(n, z, {
|
|
115
115
|
valuePropName: "collapse",
|
|
116
116
|
defaultValuePropName: "defaultCollapse"
|
|
117
117
|
}), {
|
|
118
|
-
b:
|
|
119
|
-
} =
|
|
118
|
+
b: G
|
|
119
|
+
} = Fe("ap-form-search-form"), J = Be("uiMode"), {
|
|
120
120
|
t: b
|
|
121
|
-
} =
|
|
122
|
-
function J() {
|
|
123
|
-
z(!o(u));
|
|
124
|
-
}
|
|
121
|
+
} = Re(), C = ie();
|
|
125
122
|
function K() {
|
|
126
|
-
|
|
127
|
-
(t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then(a.onSubmit);
|
|
123
|
+
H(!o(u));
|
|
128
124
|
}
|
|
129
125
|
function Q() {
|
|
130
|
-
var e, t
|
|
131
|
-
|
|
126
|
+
var e, t;
|
|
127
|
+
(t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then((l) => L(n.onSubmit, l));
|
|
128
|
+
}
|
|
129
|
+
function X() {
|
|
130
|
+
var e, t;
|
|
131
|
+
n.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), L(n.onReset);
|
|
132
132
|
}
|
|
133
133
|
let v = [];
|
|
134
|
-
const
|
|
134
|
+
const B = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / n.countPerRow));
|
|
135
135
|
j(() => s.default(), (e) => {
|
|
136
|
-
v =
|
|
136
|
+
v = B.value, B.value = ge(v, D(e));
|
|
137
137
|
}), j(() => {
|
|
138
138
|
var e;
|
|
139
139
|
return (e = s.extra) == null ? void 0 : e.call(s);
|
|
140
140
|
}, (e) => {
|
|
141
141
|
p.value = e;
|
|
142
142
|
});
|
|
143
|
-
const
|
|
144
|
-
const e =
|
|
143
|
+
const Y = (e) => $(e) ? (xe(e) ? e : [e]).join("") : Date.now(), R = g(() => {
|
|
144
|
+
const e = B.value, t = [], l = [], r = o(w);
|
|
145
145
|
let d = 0;
|
|
146
146
|
e.forEach((c) => {
|
|
147
147
|
const f = c.props;
|
|
148
|
-
(
|
|
148
|
+
(ye(f.hidden) ? !!f.hidden : $(f.hidden)) ? t.push(c) : (d += f.span || r, l.push(c));
|
|
149
149
|
});
|
|
150
|
-
const k = i - (d + r) % i,
|
|
150
|
+
const k = i - (d + r) % i, ee = d % i < r, te = k < r ? i : k, I = i - r * (o(p) && !n.extraInAction ? 2 : 1), oe = !n.forceExpand && d > I;
|
|
151
151
|
let P = 0, T = 0;
|
|
152
|
-
const
|
|
152
|
+
const ae = l.map((c, f) => {
|
|
153
153
|
const x = c.props, O = x.span || r;
|
|
154
|
-
if (P += O, !
|
|
155
|
-
t.push(
|
|
154
|
+
if (P += O, !n.forceExpand && o(u) && P > I) {
|
|
155
|
+
t.push(ue(c, {
|
|
156
156
|
class: "ant-form-item-hidden",
|
|
157
157
|
hidden: !0
|
|
158
158
|
}));
|
|
@@ -161,82 +161,82 @@ const i = 24, We = /* @__PURE__ */ le({
|
|
|
161
161
|
return T += O, {
|
|
162
162
|
node: c,
|
|
163
163
|
span: x.span || r,
|
|
164
|
-
key: `ApFormSearchFormItem-${f}-${
|
|
164
|
+
key: `ApFormSearchFormItem-${f}-${Y(x.name)}-${x._signal}`
|
|
165
165
|
};
|
|
166
|
-
}).filter(Boolean),
|
|
166
|
+
}).filter(Boolean), ne = i - T - r;
|
|
167
167
|
return {
|
|
168
|
-
hideNode:
|
|
169
|
-
nodes:
|
|
170
|
-
defaultExtraSpan:
|
|
171
|
-
actualExtraSpan:
|
|
172
|
-
showCollapse:
|
|
173
|
-
lastRowOnlyIncludeActionAndExtra:
|
|
168
|
+
hideNode: a(_, null, [t]),
|
|
169
|
+
nodes: ae,
|
|
170
|
+
defaultExtraSpan: te,
|
|
171
|
+
actualExtraSpan: ne,
|
|
172
|
+
showCollapse: oe,
|
|
173
|
+
lastRowOnlyIncludeActionAndExtra: ee
|
|
174
174
|
};
|
|
175
|
-
}),
|
|
175
|
+
}), Z = g(() => {
|
|
176
176
|
let e;
|
|
177
|
-
const t = o(R), l =
|
|
177
|
+
const t = o(R), l = a(F, {
|
|
178
178
|
span: o(w),
|
|
179
179
|
key: "actionWrapper"
|
|
180
180
|
}, {
|
|
181
|
-
default: () => [
|
|
182
|
-
default: () => [
|
|
183
|
-
justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) &&
|
|
181
|
+
default: () => [a(U, null, {
|
|
182
|
+
default: () => [a(M, {
|
|
183
|
+
justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) && n.extraInAction) ? "flex-end" : "space-between"
|
|
184
184
|
}, {
|
|
185
|
-
default: () => [
|
|
186
|
-
default: () => [
|
|
185
|
+
default: () => [a(fe, null, {
|
|
186
|
+
default: () => [a(E, {
|
|
187
187
|
type: "primary",
|
|
188
|
-
onClick:
|
|
189
|
-
loading:
|
|
188
|
+
onClick: Q,
|
|
189
|
+
loading: n.submitLoading,
|
|
190
190
|
htmlType: "submit"
|
|
191
191
|
}, {
|
|
192
|
-
default: () => [
|
|
193
|
-
}),
|
|
194
|
-
onClick:
|
|
192
|
+
default: () => [n.searchText || b("ap.apForm.search.search")]
|
|
193
|
+
}), a(E, {
|
|
194
|
+
onClick: X
|
|
195
195
|
}, {
|
|
196
|
-
default: () => [
|
|
197
|
-
}), t.showCollapse ?
|
|
198
|
-
onClick:
|
|
199
|
-
icon:
|
|
200
|
-
style:
|
|
196
|
+
default: () => [n.resetText || b("ap.apForm.search.reset")]
|
|
197
|
+
}), t.showCollapse ? a(E, {
|
|
198
|
+
onClick: K,
|
|
199
|
+
icon: a(he, {
|
|
200
|
+
style: J.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
|
|
201
201
|
rotate: o(u) ? 90 : -90
|
|
202
202
|
}, null)
|
|
203
203
|
}, null) : null]
|
|
204
|
-
}),
|
|
204
|
+
}), n.extraInAction ? o(p) : null]
|
|
205
205
|
})]
|
|
206
206
|
})]
|
|
207
|
-
}), r = !
|
|
207
|
+
}), r = !n.extraInAction && o(p) ? a(F, {
|
|
208
208
|
span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
|
|
209
209
|
key: "extraNode"
|
|
210
210
|
}, {
|
|
211
|
-
default: () => [
|
|
212
|
-
default: () => [
|
|
211
|
+
default: () => [a(U, null, {
|
|
212
|
+
default: () => [a(M, {
|
|
213
213
|
justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
|
|
214
|
-
},
|
|
214
|
+
}, Ae(e = o(p)) ? e : {
|
|
215
215
|
default: () => [e]
|
|
216
216
|
})]
|
|
217
217
|
})]
|
|
218
|
-
}) : null, d =
|
|
218
|
+
}) : null, d = a(F, {
|
|
219
219
|
span: t.defaultExtraSpan
|
|
220
220
|
}, null);
|
|
221
|
-
return !o(u) && t.lastRowOnlyIncludeActionAndExtra ?
|
|
221
|
+
return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? a(_, null, [r || d, l]) : a(_, null, [l, r]);
|
|
222
222
|
});
|
|
223
|
-
return
|
|
223
|
+
return W({
|
|
224
224
|
apForm: g(() => o(C))
|
|
225
|
-
}), (e, t) => (m(), y(
|
|
226
|
-
class: o(
|
|
225
|
+
}), (e, t) => (m(), y(Se, ce({
|
|
226
|
+
class: o(G)(),
|
|
227
227
|
ref_key: "apForm",
|
|
228
228
|
ref: C
|
|
229
|
-
}, o(
|
|
230
|
-
default: S(() => [(m(), y(A(R.value.hideNode))),
|
|
229
|
+
}, o(Ce)(n, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
230
|
+
default: S(() => [(m(), y(A(R.value.hideNode))), a(o(me), {
|
|
231
231
|
gutter: 16
|
|
232
232
|
}, {
|
|
233
|
-
default: S(() => [(m(!0),
|
|
233
|
+
default: S(() => [(m(!0), pe(_, null, de(R.value.nodes, (l) => (m(), y(o(F), {
|
|
234
234
|
key: l.key,
|
|
235
235
|
span: l.span
|
|
236
236
|
}, {
|
|
237
237
|
default: S(() => [(m(), y(A(l.node)))]),
|
|
238
238
|
_: 2
|
|
239
|
-
}, 1032, ["span"]))), 128)), (m(), y(A(
|
|
239
|
+
}, 1032, ["span"]))), 128)), (m(), y(A(Z.value)))]),
|
|
240
240
|
_: 1
|
|
241
241
|
})]),
|
|
242
242
|
_: 1
|
|
@@ -244,5 +244,5 @@ const i = 24, We = /* @__PURE__ */ le({
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
export {
|
|
247
|
-
|
|
247
|
+
qe as default
|
|
248
248
|
};
|
|
@@ -2,3 +2,4 @@ import { VNode, RendererNode, RendererElement } from 'vue';
|
|
|
2
2
|
export declare function diffFormItem(prevNodes: VNode[], current: VNode[]): VNode< RendererNode, RendererElement, {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
}>[];
|
|
5
|
+
export declare function execFunc(func: any, ...params: any): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { cloneVNode as
|
|
2
|
-
import { isArray as
|
|
1
|
+
import { cloneVNode as l } from "vue";
|
|
2
|
+
import { isArray as a, isFunction as p } from "lodash-unified";
|
|
3
3
|
function M(n, r) {
|
|
4
|
-
const t =
|
|
4
|
+
const t = u(n), e = u(r);
|
|
5
5
|
return r.map((o) => {
|
|
6
|
-
const i =
|
|
6
|
+
const i = m(o.props.name), c = e.get(i), s = t.get(i);
|
|
7
7
|
if (!t.get(i) || (c == null ? void 0 : c.index) !== (s == null ? void 0 : s.index))
|
|
8
8
|
return o;
|
|
9
|
-
const
|
|
10
|
-
return JSON.stringify(
|
|
9
|
+
const g = f(s.item), y = f(c.item);
|
|
10
|
+
return JSON.stringify(g) !== JSON.stringify(y) ? o : l(o, { _signal: s.item._signal });
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return n ? (
|
|
13
|
+
function m(n) {
|
|
14
|
+
return n ? (a(n) ? n : [n]).map((t) => "" + t).join("") : "";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function u(n) {
|
|
17
17
|
const r = /* @__PURE__ */ new Map();
|
|
18
18
|
return n.forEach((t, e) => {
|
|
19
|
-
const o = t.props, i =
|
|
19
|
+
const o = t.props, i = m(o.name);
|
|
20
20
|
r.set(i, { item: o, index: e });
|
|
21
21
|
}), r;
|
|
22
22
|
}
|
|
@@ -29,6 +29,13 @@ function f(n) {
|
|
|
29
29
|
}
|
|
30
30
|
return r;
|
|
31
31
|
}
|
|
32
|
+
function N(n, ...r) {
|
|
33
|
+
if (a(n))
|
|
34
|
+
for (const t of n)
|
|
35
|
+
p(t) && t(...r);
|
|
36
|
+
else p(n) && n(...r);
|
|
37
|
+
}
|
|
32
38
|
export {
|
|
33
|
-
M as diffFormItem
|
|
39
|
+
M as diffFormItem,
|
|
40
|
+
N as execFunc
|
|
34
41
|
};
|
|
@@ -68,21 +68,18 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
68
68
|
})
|
|
69
69
|
);
|
|
70
70
|
}), v(e), !1;
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
D || r("ap.apUpload.fileFormatNotSupported")
|
|
84
|
-
), v(e), !1;
|
|
85
|
-
}
|
|
71
|
+
if (e.size > E * 1024 * 1024)
|
|
72
|
+
return m.warning(
|
|
73
|
+
O || r("ap.apUpload.maxUploadFileSize", {
|
|
74
|
+
maxSize: E
|
|
75
|
+
})
|
|
76
|
+
), v(e), !1;
|
|
77
|
+
if (!le(e, h))
|
|
78
|
+
return m.warning(
|
|
79
|
+
D || r("ap.apUpload.fileFormatNotSupported")
|
|
80
|
+
), v(e), !1;
|
|
81
|
+
if (typeof _ == "function" && await _(e) === !1)
|
|
82
|
+
return v(e), !1;
|
|
86
83
|
i && i === 1 && (p = [], a.value = void 0), p.push(e);
|
|
87
84
|
}
|
|
88
85
|
async function j(e) {
|
|
@@ -83,19 +83,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
83
83
|
q || u("ap.apUpload.maxUploadPicture", { maxCount: l })
|
|
84
84
|
);
|
|
85
85
|
}), !1;
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
V || u("ap.apUpload.pictureFormatNotSupported")
|
|
97
|
-
), !1;
|
|
98
|
-
}
|
|
86
|
+
if (e.size > w * 1024 * 1024)
|
|
87
|
+
return m.warning(
|
|
88
|
+
L || u("ap.apUpload.maxUploadFileSize", { maxSize: w })
|
|
89
|
+
), !1;
|
|
90
|
+
if (!/image\/\w+/.test(e.type) || !le(e, _))
|
|
91
|
+
return m.warning(
|
|
92
|
+
V || u("ap.apUpload.pictureFormatNotSupported")
|
|
93
|
+
), !1;
|
|
94
|
+
if (typeof E == "function" && await E(e) === !1)
|
|
95
|
+
return !1;
|
|
99
96
|
const a = new FileReader();
|
|
100
97
|
a.readAsDataURL(e), a.onload = function() {
|
|
101
98
|
const t = {
|
|
@@ -93,25 +93,22 @@ const ye = ["accept"], we = {
|
|
|
93
93
|
}
|
|
94
94
|
async function T(e) {
|
|
95
95
|
if (e != null && e.length) {
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
maxSize: D
|
|
104
|
-
})
|
|
105
|
-
);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (!fe(e[0], w)) {
|
|
109
|
-
u.warning(
|
|
110
|
-
Q || r("ap.apUpload.fileFormatNotSupported")
|
|
111
|
-
);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
96
|
+
if (e[0].size > D * 1024 * 1024) {
|
|
97
|
+
u.warning(
|
|
98
|
+
K || r("ap.apUpload.maxUploadFileSize", {
|
|
99
|
+
maxSize: D
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
return;
|
|
114
103
|
}
|
|
104
|
+
if (!fe(e[0], w)) {
|
|
105
|
+
u.warning(
|
|
106
|
+
Q || r("ap.apUpload.fileFormatNotSupported")
|
|
107
|
+
);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (typeof B == "function" && await B(e[0]) === !1)
|
|
111
|
+
return;
|
|
115
112
|
if (o.value = e[0], l.value = 2, f.value = 0, p.value++, typeof R == "function") {
|
|
116
113
|
R({
|
|
117
114
|
onProgress: (t) => {
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { ApExportGroupProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
-
declare const _default: DefineComponent<__VLS_TypePropsToOption<ApExportGroupProps>, {
|
|
3
|
+
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApExportGroupProps>, {
|
|
4
|
+
successMessage: boolean;
|
|
5
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApExportGroupProps>, {
|
|
6
|
+
successMessage: boolean;
|
|
7
|
+
}>>>, {
|
|
8
|
+
successMessage: boolean | string;
|
|
9
|
+
}, {}>;
|
|
4
10
|
export default _default;
|
|
11
|
+
type __VLS_WithDefaults<P, D> = {
|
|
12
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
13
|
+
default: D[K];
|
|
14
|
+
}> : P[K];
|
|
15
|
+
};
|
|
5
16
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
6
17
|
type __VLS_TypePropsToOption<T> = {
|
|
7
18
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -11,3 +22,6 @@ type __VLS_TypePropsToOption<T> = {
|
|
|
11
22
|
required: true;
|
|
12
23
|
};
|
|
13
24
|
};
|
|
25
|
+
type __VLS_PrettifyLocal<T> = {
|
|
26
|
+
[K in keyof T]: T[K];
|
|
27
|
+
} & {};
|
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { Dropdown as
|
|
1
|
+
import { defineComponent as B, computed as l, ref as D, openBlock as m, createBlock as f, unref as a, normalizeClass as K, withCtx as s, createVNode as y, createTextVNode as g, toDisplayString as x, mergeProps as R, createCommentVNode as N } from "vue";
|
|
2
|
+
import { DownOutlined as T } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as I, Dropdown as V, Menu as q, MenuItem as M, Button as F } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { ApExportGroupActionType as
|
|
6
|
-
import { usePermission as
|
|
7
|
-
import { handleExportDownload as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
const
|
|
5
|
+
import { ApExportGroupActionType as i } from "./interface.mjs";
|
|
6
|
+
import { usePermission as z } from "@aplus-frontend/hooks";
|
|
7
|
+
import { handleExportDownload as O } from "./handleExportDownload.mjs";
|
|
8
|
+
import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as j } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as H } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const oe = /* @__PURE__ */ B({
|
|
12
12
|
__name: "ApExportGroup",
|
|
13
13
|
props: {
|
|
14
14
|
selectedRowKeys: {},
|
|
15
15
|
disabled: { type: Boolean },
|
|
16
16
|
auth: {},
|
|
17
|
-
ifShow: {
|
|
17
|
+
ifShow: {},
|
|
18
18
|
text: {},
|
|
19
19
|
idKey: {},
|
|
20
|
-
request: {
|
|
21
|
-
getRequestParams: {
|
|
22
|
-
getInitialParams: {
|
|
23
|
-
beforeRequest: {
|
|
20
|
+
request: {},
|
|
21
|
+
getRequestParams: {},
|
|
22
|
+
getInitialParams: {},
|
|
23
|
+
beforeRequest: {},
|
|
24
|
+
successMessage: { type: [Boolean, String], default: !1 }
|
|
24
25
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const { hasPermission:
|
|
26
|
+
setup(E) {
|
|
27
|
+
const { hasPermission: C } = z(), e = E, { b: S } = $("ap-export-group"), { t: n } = j(), _ = H("uiMode"), L = l(() => {
|
|
27
28
|
const t = {
|
|
28
29
|
aplus: "#0070FF",
|
|
29
30
|
admin: "#34b77c"
|
|
30
31
|
};
|
|
31
|
-
return b.value ? "" : t[
|
|
32
|
-
}), b =
|
|
32
|
+
return b.value ? "" : t[_.value] || t.aplus;
|
|
33
|
+
}), b = l(() => !!(e != null && e.disabled)), A = l(() => (e == null ? void 0 : e.successMessage) === !0 ? n("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), G = {
|
|
33
34
|
textAlign: "center"
|
|
34
|
-
},
|
|
35
|
+
}, c = D(!1), w = l(() => (e == null ? void 0 : e.selectedRowKeys) || []), P = l(() => {
|
|
35
36
|
let t = e == null ? void 0 : e.ifShow;
|
|
36
|
-
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () =>
|
|
37
|
+
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => C(e.auth)), (t == null ? void 0 : t()) ?? !0;
|
|
37
38
|
});
|
|
38
|
-
async function
|
|
39
|
-
var
|
|
40
|
-
const { getRequestParams:
|
|
39
|
+
async function k({ key: t }) {
|
|
40
|
+
var v, h;
|
|
41
|
+
const { getRequestParams: u, request: o } = e || {};
|
|
41
42
|
let d = {};
|
|
42
|
-
t ===
|
|
43
|
+
t === i.SELECT ? d = {
|
|
43
44
|
[(e == null ? void 0 : e.idKey) || "ids"]: w.value
|
|
44
|
-
} : t ===
|
|
45
|
-
const
|
|
45
|
+
} : t === i.ALL && (d = (u == null ? void 0 : u()) || {});
|
|
46
|
+
const p = ((v = e == null ? void 0 : e.getInitialParams) == null ? void 0 : v.call(e)) || {};
|
|
46
47
|
try {
|
|
47
|
-
|
|
48
|
+
c.value = !0;
|
|
48
49
|
let r = {
|
|
49
50
|
...d,
|
|
50
|
-
...
|
|
51
|
+
...p
|
|
51
52
|
};
|
|
52
|
-
r = ((
|
|
53
|
+
r = ((h = e == null ? void 0 : e.beforeRequest) == null ? void 0 : h.call(e, r)) || r, await O(async () => await (o == null ? void 0 : o(r))), e != null && e.successMessage && I.success(A.value);
|
|
53
54
|
} finally {
|
|
54
|
-
|
|
55
|
+
c.value = !1;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
return (t,
|
|
58
|
+
return (t, u) => P.value ? (m(), f(a(V), {
|
|
58
59
|
key: 0,
|
|
59
|
-
class:
|
|
60
|
-
overlayStyle:
|
|
60
|
+
class: K([a(S)()]),
|
|
61
|
+
overlayStyle: G,
|
|
61
62
|
disabled: b.value
|
|
62
63
|
}, {
|
|
63
|
-
overlay:
|
|
64
|
-
y(
|
|
65
|
-
default:
|
|
66
|
-
var
|
|
64
|
+
overlay: s(() => [
|
|
65
|
+
y(a(q), { onClick: k }, {
|
|
66
|
+
default: s(() => {
|
|
67
|
+
var o;
|
|
67
68
|
return [
|
|
68
|
-
(m(), f(
|
|
69
|
-
key:
|
|
70
|
-
disabled: ((
|
|
69
|
+
(m(), f(a(M), {
|
|
70
|
+
key: a(i).SELECT,
|
|
71
|
+
disabled: ((o = w.value) == null ? void 0 : o.length) === 0
|
|
71
72
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
73
|
+
default: s(() => [
|
|
74
|
+
g(x(a(n)("ap.apExportGroup.exportSelected")), 1)
|
|
74
75
|
]),
|
|
75
76
|
_: 1
|
|
76
77
|
}, 8, ["disabled"])),
|
|
77
|
-
(m(), f(
|
|
78
|
-
key:
|
|
78
|
+
(m(), f(a(M), {
|
|
79
|
+
key: a(i).ALL
|
|
79
80
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
|
|
81
|
+
default: s(() => [
|
|
82
|
+
g(x(a(n)("ap.apExportGroup.exportAll")), 1)
|
|
82
83
|
]),
|
|
83
84
|
_: 1
|
|
84
85
|
}))
|
|
@@ -87,26 +88,26 @@ const te = /* @__PURE__ */ G({
|
|
|
87
88
|
_: 1
|
|
88
89
|
})
|
|
89
90
|
]),
|
|
90
|
-
default:
|
|
91
|
-
y(
|
|
91
|
+
default: s(() => [
|
|
92
|
+
y(a(F), R({
|
|
92
93
|
...t.$attrs
|
|
93
94
|
}, {
|
|
94
95
|
style: {
|
|
95
|
-
color:
|
|
96
|
+
color: L.value
|
|
96
97
|
},
|
|
97
|
-
loading:
|
|
98
|
+
loading: c.value
|
|
98
99
|
}), {
|
|
99
|
-
default:
|
|
100
|
-
|
|
101
|
-
y(
|
|
100
|
+
default: s(() => [
|
|
101
|
+
g(x((e == null ? void 0 : e.text) ?? a(n)("ap.apExportGroup.export")) + " ", 1),
|
|
102
|
+
y(a(T))
|
|
102
103
|
]),
|
|
103
104
|
_: 1
|
|
104
105
|
}, 16, ["style", "loading"])
|
|
105
106
|
]),
|
|
106
107
|
_: 1
|
|
107
|
-
}, 8, ["class", "disabled"])) :
|
|
108
|
+
}, 8, ["class", "disabled"])) : N("", !0);
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
oe as default
|
|
112
113
|
};
|