@aplus-frontend/ui 0.0.39 → 0.0.40
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/index.mjs +149 -148
- package/es/src/ap-field/interface.d.ts +1 -1
- package/es/src/ap-field/text-area/index.vue.mjs +9 -10
- package/es/src/ap-form/style/ap-form-item.css +6 -6
- package/es/src/ap-table/ap-table.vue.d.ts +6 -0
- package/es/src/ap-table/ap-table.vue.mjs +90 -89
- package/es/src/ap-table/constants.d.ts +0 -6
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue.mjs +4 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +117 -0
- package/es/src/business/ap-export-group/interface.d.ts +37 -0
- package/es/src/business/ap-export-group/interface.mjs +4 -0
- package/es/src/business/index.d.ts +105 -0
- package/es/src/business/index.mjs +12 -9
- package/es/src/config-provider/config-provider.mjs +22 -17
- package/es/src/editable-table/form-item.vue.d.ts +4 -0
- package/es/src/editable-table/form-item.vue.mjs +83 -75
- package/es/src/editable-table/index.vue.d.ts +4 -0
- package/es/src/editable-table/index.vue.mjs +80 -72
- package/es/src/editable-table/interface.d.ts +8 -0
- package/es/src/editable-table/utils.d.ts +8 -0
- package/es/src/editable-table/utils.mjs +29 -18
- package/es/src/index.mjs +175 -174
- package/es/src/locale/lang/en.mjs +6 -0
- package/es/src/locale/lang/zh-cn.mjs +6 -0
- package/es/src/theme/ap-form/ap-form-item.css +6 -6
- package/es/src/theme/css-var/index.d.ts +7 -0
- package/es/src/theme/css-var/index.mjs +45 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/interface.d.ts +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/style/ap-form-item.css +6 -6
- package/lib/src/ap-table/ap-table.vue.d.ts +6 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +0 -6
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue.js +1 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -0
- package/lib/src/business/ap-export-group/interface.d.ts +37 -0
- package/lib/src/business/ap-export-group/interface.js +1 -0
- package/lib/src/business/index.d.ts +105 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +4 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +4 -0
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +8 -0
- package/lib/src/editable-table/utils.d.ts +8 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-form/ap-form-item.css +6 -6
- package/lib/src/theme/css-var/index.d.ts +7 -0
- package/lib/src/theme/css-var/index.js +1 -0
- package/package.json +6 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as
|
|
2
|
-
import { Typography as
|
|
1
|
+
import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as r, watch as de, openBlock as c, createElementBlock as g, normalizeClass as T, normalizeStyle as x, createSlots as K, withCtx as f, Fragment as ue, renderList as V, createBlock as ie, resolveDynamicComponent as pe, renderSlot as v, createCommentVNode as z, createElementVNode as D, toDisplayString as ce, normalizeProps as fe, guardReactiveProps as me } from "vue";
|
|
2
|
+
import { Typography as ye, Table as ge, Tooltip as be } from "ant-design-vue";
|
|
3
3
|
import { useToken as Se } from "ant-design-vue/es/theme/internal";
|
|
4
4
|
import { ApForm as he } from "../ap-form/index.mjs";
|
|
5
|
-
import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as
|
|
5
|
+
import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as Re } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
7
|
+
import { useTablePaging as Ce } from "./hooks/use-table-paging.mjs";
|
|
8
8
|
import { omit as j, isUndefined as u, isBoolean as Fe } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
10
|
import { QuestionCircleOutlined as Te } from "@ant-design/icons-vue";
|
|
@@ -12,10 +12,10 @@ import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps a
|
|
|
12
12
|
import Le from "./hooks/use-table-content-height.mjs";
|
|
13
13
|
import { getRawDisplayValue as Ee } from "../editable-table/utils.mjs";
|
|
14
14
|
import Oe from "./hooks/use-table-row-selection.mjs";
|
|
15
|
-
import { useLocale as
|
|
16
|
-
import { useNamespace as
|
|
17
|
-
import { useGlobalConfig as
|
|
18
|
-
const
|
|
15
|
+
import { useLocale as Ke } from "../config-provider/hooks/use-locale.mjs";
|
|
16
|
+
import { useNamespace as Ve } from "../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
import { useGlobalConfig as ze } from "../config-provider/hooks/use-global-config.mjs";
|
|
18
|
+
const De = {
|
|
19
19
|
key: 0
|
|
20
20
|
}, aa = /* @__PURE__ */ ne({
|
|
21
21
|
name: "ApTable",
|
|
@@ -137,13 +137,13 @@ const Ke = {
|
|
|
137
137
|
expose: A
|
|
138
138
|
}) {
|
|
139
139
|
const a = _;
|
|
140
|
-
let
|
|
141
|
-
const
|
|
140
|
+
let B = 0;
|
|
141
|
+
const P = se(), [, M] = Se(), {
|
|
142
142
|
t: q
|
|
143
|
-
} =
|
|
143
|
+
} = Ke(), {
|
|
144
144
|
e: b,
|
|
145
145
|
b: i
|
|
146
|
-
} =
|
|
146
|
+
} = Ve("ap-table"), H = ze("uiMode", "aplus"), {
|
|
147
147
|
height: $,
|
|
148
148
|
contentRef: G
|
|
149
149
|
} = Le(), S = s(() => {
|
|
@@ -152,70 +152,70 @@ const Ke = {
|
|
|
152
152
|
return e = e.map((o) => ({
|
|
153
153
|
...j(xe(o), ["ellipsis"]),
|
|
154
154
|
customRender({
|
|
155
|
-
value:
|
|
155
|
+
value: l,
|
|
156
156
|
...n
|
|
157
157
|
}) {
|
|
158
158
|
const C = ve(o), O = we[C], le = Be(o, {
|
|
159
|
-
value:
|
|
159
|
+
value: l,
|
|
160
160
|
...n
|
|
161
161
|
});
|
|
162
|
-
let
|
|
162
|
+
let F = oe(o, l, d(O, p(le, {
|
|
163
163
|
mode: "read"
|
|
164
164
|
}), null));
|
|
165
|
-
return o.customRender && (
|
|
166
|
-
value:
|
|
165
|
+
return o.customRender && (F = o.customRender({
|
|
166
|
+
value: l,
|
|
167
167
|
...n,
|
|
168
168
|
column: o,
|
|
169
|
-
originalNode:
|
|
170
|
-
})),
|
|
169
|
+
originalNode: F
|
|
170
|
+
})), F;
|
|
171
171
|
}
|
|
172
172
|
})), e;
|
|
173
|
-
}),
|
|
173
|
+
}), I = s(() => {
|
|
174
174
|
var e, t, o;
|
|
175
|
-
return
|
|
176
|
-
let C = W(
|
|
175
|
+
return B++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !N.includes(l.valueType))) == null ? void 0 : t.sort((l, n) => {
|
|
176
|
+
let C = W(l.order);
|
|
177
177
|
return W(n.order) - C;
|
|
178
|
-
})) == null ? void 0 : o.map((
|
|
179
|
-
const n = Pe(
|
|
178
|
+
})) == null ? void 0 : o.map((l) => {
|
|
179
|
+
const n = Pe(l, Ie(l.fieldProps, {}));
|
|
180
180
|
return {
|
|
181
|
-
...
|
|
181
|
+
...l,
|
|
182
182
|
fieldProps: {
|
|
183
|
-
label:
|
|
184
|
-
name:
|
|
183
|
+
label: l.title,
|
|
184
|
+
name: l.dataIndex,
|
|
185
185
|
...n || {},
|
|
186
186
|
// 格式化placeholder
|
|
187
|
-
placeholder: ke(q,
|
|
188
|
-
_signal:
|
|
187
|
+
placeholder: ke(q, l.valueType, n == null ? void 0 : n.placeholder),
|
|
188
|
+
_signal: B
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
})) || [];
|
|
192
|
-
}), Q = s(() =>
|
|
193
|
-
rowSelection:
|
|
192
|
+
}), Q = s(() => r(S).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => r(S).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), J = s(() => u(a.dataSource) ? y.value.records : a.dataSource), {
|
|
193
|
+
rowSelection: h,
|
|
194
194
|
selectedRows: k,
|
|
195
|
-
...
|
|
195
|
+
...w
|
|
196
196
|
} = Oe({
|
|
197
197
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
198
198
|
rowKey: a.rowKey,
|
|
199
199
|
dataSource: J
|
|
200
200
|
}), {
|
|
201
|
-
formRef:
|
|
201
|
+
formRef: R,
|
|
202
202
|
submit: L,
|
|
203
203
|
reset: E,
|
|
204
204
|
tableProps: m,
|
|
205
205
|
handleTableChange: X,
|
|
206
|
-
data:
|
|
207
|
-
} =
|
|
206
|
+
data: y
|
|
207
|
+
} = Ce({
|
|
208
208
|
async request(e) {
|
|
209
|
-
var o,
|
|
210
|
-
!
|
|
209
|
+
var o, l;
|
|
210
|
+
!h.value.preserveSelectedRowKeys && u(a.dataSource) && w.clearAll();
|
|
211
211
|
const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
|
|
212
|
-
return (
|
|
212
|
+
return (l = a.onLoad) == null || l.call(a, (t == null ? void 0 : t.data) || []), {
|
|
213
213
|
data: (t == null ? void 0 : t.data) || [],
|
|
214
214
|
total: (t == null ? void 0 : t.total) || 0
|
|
215
215
|
};
|
|
216
216
|
},
|
|
217
|
-
filterFields:
|
|
218
|
-
sortFields:
|
|
217
|
+
filterFields: r(U),
|
|
218
|
+
sortFields: r(Q),
|
|
219
219
|
defaultParams: a.params,
|
|
220
220
|
defaultData: a.defaultData,
|
|
221
221
|
manual: a.manual,
|
|
@@ -224,8 +224,8 @@ const Ke = {
|
|
|
224
224
|
formatParams: a.beforeSearchSubmit
|
|
225
225
|
}), Y = s(() => {
|
|
226
226
|
var e;
|
|
227
|
-
return a.scroll ? a.scroll : a.adaptive && (
|
|
228
|
-
y:
|
|
227
|
+
return a.scroll ? a.scroll : a.adaptive && (y.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
|
|
228
|
+
y: r($),
|
|
229
229
|
x: "100%"
|
|
230
230
|
} : {
|
|
231
231
|
x: !0
|
|
@@ -237,27 +237,27 @@ const Ke = {
|
|
|
237
237
|
if ((e = a.columns) != null && e.some((t) => t.ellipsis))
|
|
238
238
|
return "fixed";
|
|
239
239
|
}), ee = s(() => {
|
|
240
|
-
var
|
|
241
|
-
const e =
|
|
240
|
+
var l;
|
|
241
|
+
const e = r(m), t = u(a.dataSource) ? e : {
|
|
242
242
|
...e,
|
|
243
243
|
dataSource: a.dataSource,
|
|
244
244
|
onChange: a.onChange
|
|
245
|
-
}, o =
|
|
245
|
+
}, o = r(h);
|
|
246
246
|
return {
|
|
247
247
|
...a,
|
|
248
248
|
...t,
|
|
249
|
-
rowSelection: a.rowSelection === !0 || ((
|
|
249
|
+
rowSelection: a.rowSelection === !0 || ((l = a.rowSelection) == null ? void 0 : l.mode) === "internal" ? {
|
|
250
250
|
...o,
|
|
251
251
|
// tips 如果是前端分页,则默认会走缓存
|
|
252
252
|
preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
|
|
253
253
|
} : a.rowSelection,
|
|
254
|
-
loading: u(a.loading) ?
|
|
255
|
-
pagination: a.pagination === !1 ? !1 :
|
|
256
|
-
scroll:
|
|
254
|
+
loading: u(a.loading) ? r(m).loading : a.loading,
|
|
255
|
+
pagination: a.pagination === !1 ? !1 : r(m).pagination,
|
|
256
|
+
scroll: r(Y)
|
|
257
257
|
};
|
|
258
258
|
}), ae = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
259
259
|
function oe(e, t, o) {
|
|
260
|
-
return N.includes(e.valueType) ? o : e.copyable || e.ellipsis ? d(
|
|
260
|
+
return N.includes(e.valueType) ? o : e.copyable || e.ellipsis ? d(ye.Paragraph, {
|
|
261
261
|
copyable: e.copyable ? {
|
|
262
262
|
text: t,
|
|
263
263
|
tooltip: !1
|
|
@@ -271,86 +271,87 @@ const Ke = {
|
|
|
271
271
|
content: e.ellipsis ? Ee(e, t) : o
|
|
272
272
|
}, null) : o;
|
|
273
273
|
}
|
|
274
|
-
de(() =>
|
|
274
|
+
de(() => r(y).loading, (e) => {
|
|
275
275
|
var t;
|
|
276
276
|
(t = a.onLoadingChange) == null || t.call(a, e);
|
|
277
277
|
});
|
|
278
278
|
function te(e) {
|
|
279
|
-
var t, o,
|
|
280
|
-
(
|
|
279
|
+
var t, o, l;
|
|
280
|
+
(l = (o = (t = R.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || l.call(o, e);
|
|
281
281
|
}
|
|
282
282
|
function re() {
|
|
283
283
|
var e, t, o;
|
|
284
|
-
return (o = (t = (e =
|
|
284
|
+
return (o = (t = (e = R.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : o.call(t, !0);
|
|
285
285
|
}
|
|
286
286
|
return A({
|
|
287
287
|
submit: () => L(),
|
|
288
288
|
reset: () => E(),
|
|
289
289
|
setSearchFormValues: te,
|
|
290
290
|
getSearchFormValues: re,
|
|
291
|
-
dataSource: s(() =>
|
|
291
|
+
dataSource: s(() => r(y).records),
|
|
292
292
|
rowSelection: {
|
|
293
|
-
selectedRows: s(() =>
|
|
294
|
-
...
|
|
293
|
+
selectedRows: s(() => r(k)),
|
|
294
|
+
...w
|
|
295
295
|
}
|
|
296
|
-
}), (e, t) => (c(),
|
|
297
|
-
class:
|
|
298
|
-
}, [
|
|
296
|
+
}), (e, t) => (c(), g("div", {
|
|
297
|
+
class: T(ae.value)
|
|
298
|
+
}, [r(u)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (c(), g("div", {
|
|
299
299
|
key: 0,
|
|
300
|
-
class:
|
|
301
|
-
style:
|
|
302
|
-
}, [d(
|
|
300
|
+
class: T(e.card ? r(b)("search-wrapper") : null),
|
|
301
|
+
style: x(e.searchFormWrapperStyle)
|
|
302
|
+
}, [d(r(he).SearchForm, p(e.searchForm || {}, {
|
|
303
303
|
ref_key: "formRef",
|
|
304
|
-
ref:
|
|
304
|
+
ref: R,
|
|
305
305
|
"custom-reset": "",
|
|
306
|
-
onSubmit:
|
|
307
|
-
onReset:
|
|
308
|
-
"submit-loading":
|
|
309
|
-
}),
|
|
310
|
-
default: f(() => [(c(!0),
|
|
306
|
+
onSubmit: r(L),
|
|
307
|
+
onReset: r(E),
|
|
308
|
+
"submit-loading": r(m).loading
|
|
309
|
+
}), K({
|
|
310
|
+
default: f(() => [(c(!0), g(ue, null, V(I.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) : r(Re)[o.valueType || "text"]), p({
|
|
311
311
|
key: o.dataIndex,
|
|
312
312
|
ref_for: !0
|
|
313
313
|
}, o.fieldProps || {}, {
|
|
314
314
|
span: o.span
|
|
315
315
|
}), null, 16, ["span"]))), 128))]),
|
|
316
316
|
_: 2
|
|
317
|
-
}, [
|
|
317
|
+
}, [P.searchFormExtra ? {
|
|
318
318
|
name: "extra",
|
|
319
|
-
fn: f(() => [
|
|
319
|
+
fn: f(() => [v(e.$slots, "searchFormExtra")]),
|
|
320
320
|
key: "0"
|
|
321
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
321
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : z("", !0), D("div", {
|
|
322
322
|
ref_key: "contentRef",
|
|
323
323
|
ref: G,
|
|
324
|
-
class:
|
|
325
|
-
style:
|
|
326
|
-
}, [
|
|
327
|
-
selectedRows:
|
|
328
|
-
|
|
329
|
-
|
|
324
|
+
class: T([r(b)("table-wrapper"), e.card ? r(b)("table-wrapper-card") : null]),
|
|
325
|
+
style: x(e.tableWrapperStyle)
|
|
326
|
+
}, [v(e.$slots, "title", p({
|
|
327
|
+
selectedRows: r(k),
|
|
328
|
+
selectedRowKeys: r(h).selectedRowKeys
|
|
329
|
+
}, w)), d(r(ge), p({
|
|
330
|
+
class: r(H) === "admin" ? r(i)("table-admin") : r(i)("table")
|
|
330
331
|
}, ee.value, {
|
|
331
332
|
"table-layout": Z.value,
|
|
332
|
-
onChange:
|
|
333
|
+
onChange: r(X),
|
|
333
334
|
columns: S.value
|
|
334
|
-
}),
|
|
335
|
+
}), K({
|
|
335
336
|
headerCell: f(({
|
|
336
337
|
column: o,
|
|
337
|
-
title:
|
|
338
|
-
}) => [o.tooltip ? (c(),
|
|
338
|
+
title: l
|
|
339
|
+
}) => [o.tooltip ? (c(), g("span", De, [D("span", null, ce(l), 1), d(r(be), {
|
|
339
340
|
title: o.tooltip,
|
|
340
341
|
placement: "bottom"
|
|
341
342
|
}, {
|
|
342
|
-
default: f(() => [d(
|
|
343
|
-
style:
|
|
343
|
+
default: f(() => [d(r(Te), {
|
|
344
|
+
style: x({
|
|
344
345
|
paddingLeft: "4px",
|
|
345
|
-
color:
|
|
346
|
+
color: r(M).colorPrimary
|
|
346
347
|
})
|
|
347
348
|
}, null, 8, ["style"])]),
|
|
348
349
|
_: 2
|
|
349
|
-
}, 1032, ["title"])])) :
|
|
350
|
+
}, 1032, ["title"])])) : z("", !0)]),
|
|
350
351
|
_: 2
|
|
351
|
-
}, [
|
|
352
|
-
name:
|
|
353
|
-
fn: f((n) => [
|
|
352
|
+
}, [V(r(j)(P, ["title", "searchFormExtra"]), (o, l) => ({
|
|
353
|
+
name: l,
|
|
354
|
+
fn: f((n) => [v(e.$slots, l, fe(me(n || {})))])
|
|
354
355
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
355
356
|
}
|
|
356
357
|
});
|
|
@@ -16086,9 +16086,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16086
16086
|
rows: {
|
|
16087
16087
|
type: PropType<number>;
|
|
16088
16088
|
};
|
|
16089
|
-
autosize: {
|
|
16090
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16091
|
-
};
|
|
16092
16089
|
autoSize: {
|
|
16093
16090
|
type: PropType<boolean | AutoSizeType>;
|
|
16094
16091
|
};
|
|
@@ -16237,9 +16234,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16237
16234
|
rows: {
|
|
16238
16235
|
type: PropType<number>;
|
|
16239
16236
|
};
|
|
16240
|
-
autosize: {
|
|
16241
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16242
|
-
};
|
|
16243
16237
|
autoSize: {
|
|
16244
16238
|
type: PropType<boolean | AutoSizeType>;
|
|
16245
16239
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Props } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const _default: DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
|
|
5
|
+
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineComponent as G, computed as u, ref as N, openBlock as f, createBlock as y, unref as t, normalizeClass as D, withCtx as i, createVNode as x, createTextVNode as h, toDisplayString as w, normalizeStyle as B, createCommentVNode as K } from "vue";
|
|
2
|
+
import { formatFileNameAndDownloadFile as T } from "@aplus-frontend/utils";
|
|
3
|
+
import { DownOutlined as V } from "@ant-design/icons-vue";
|
|
4
|
+
import { Modal as z, Dropdown as O, Menu as I, MenuItem as C, Button as J } from "ant-design-vue";
|
|
5
|
+
import "../../config-provider/index.mjs";
|
|
6
|
+
import { ActionType as c } from "./interface.mjs";
|
|
7
|
+
import { usePermission as R } from "@aplus-frontend/hooks";
|
|
8
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as H } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as P } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const oe = /* @__PURE__ */ G({
|
|
12
|
+
__name: "ApExportGroup",
|
|
13
|
+
props: {
|
|
14
|
+
selectedRowKeys: {},
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
auth: {},
|
|
17
|
+
ifShow: { type: Function },
|
|
18
|
+
text: {},
|
|
19
|
+
request: { type: Function },
|
|
20
|
+
getRequestParams: { type: Function }
|
|
21
|
+
},
|
|
22
|
+
setup(E) {
|
|
23
|
+
const { hasPermission: L } = R(), e = E, { b: S } = j("ap-export-group"), { t: s } = H(), F = P("uiMode"), g = u(() => {
|
|
24
|
+
const o = {
|
|
25
|
+
aplus: "#0070FF",
|
|
26
|
+
admin: "#34b77c"
|
|
27
|
+
};
|
|
28
|
+
return b.value ? "" : o[F.value] || o.aplus;
|
|
29
|
+
}), b = u(() => !!(e != null && e.disabled)), A = {
|
|
30
|
+
textAlign: "center"
|
|
31
|
+
}, p = N(!1), v = u(() => (e == null ? void 0 : e.selectedRowKeys) || []), M = u(() => {
|
|
32
|
+
let o = e == null ? void 0 : e.ifShow;
|
|
33
|
+
return !(e != null && e.ifShow) && (e != null && e.auth) && (o = () => L(e.auth)), (o == null ? void 0 : o()) ?? !0;
|
|
34
|
+
});
|
|
35
|
+
async function k({ key: o }) {
|
|
36
|
+
var _;
|
|
37
|
+
const { getRequestParams: n, request: r } = e || {};
|
|
38
|
+
let l = {};
|
|
39
|
+
if (o === c.SELECT) {
|
|
40
|
+
const a = ((n == null ? void 0 : n()) || {}).exportFieldList;
|
|
41
|
+
l = {
|
|
42
|
+
ids: v.value,
|
|
43
|
+
exportFieldList: a
|
|
44
|
+
};
|
|
45
|
+
for (const d in l)
|
|
46
|
+
l[d] || delete l[d];
|
|
47
|
+
} else
|
|
48
|
+
o === c.ALL && (l = (n == null ? void 0 : n()) || {});
|
|
49
|
+
try {
|
|
50
|
+
p.value = !0;
|
|
51
|
+
const a = await (r == null ? void 0 : r(l));
|
|
52
|
+
a.headers && !((_ = a == null ? void 0 : a.headers) != null && _["content-disposition"]) ? a.data.text().then((d) => {
|
|
53
|
+
const m = JSON.parse(d || "{}");
|
|
54
|
+
m.code && m.code !== "200" && z.error({
|
|
55
|
+
title: s("ap.apExportGroup.exportError"),
|
|
56
|
+
content: m.message,
|
|
57
|
+
centered: !0
|
|
58
|
+
});
|
|
59
|
+
}) : T(a);
|
|
60
|
+
} finally {
|
|
61
|
+
p.value = !1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return (o, n) => M.value ? (f(), y(t(O), {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: D([t(S)()]),
|
|
67
|
+
overlayStyle: A,
|
|
68
|
+
disabled: b.value
|
|
69
|
+
}, {
|
|
70
|
+
overlay: i(() => [
|
|
71
|
+
x(t(I), { onClick: k }, {
|
|
72
|
+
default: i(() => {
|
|
73
|
+
var r;
|
|
74
|
+
return [
|
|
75
|
+
(f(), y(t(C), {
|
|
76
|
+
key: t(c).SELECT,
|
|
77
|
+
disabled: ((r = v.value) == null ? void 0 : r.length) === 0
|
|
78
|
+
}, {
|
|
79
|
+
default: i(() => [
|
|
80
|
+
h(w(t(s)("ap.apExportGroup.exportSelected")), 1)
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 8, ["disabled"])),
|
|
84
|
+
(f(), y(t(C), {
|
|
85
|
+
key: t(c).ALL
|
|
86
|
+
}, {
|
|
87
|
+
default: i(() => [
|
|
88
|
+
h(w(t(s)("ap.apExportGroup.exportAll")), 1)
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
}))
|
|
92
|
+
];
|
|
93
|
+
}),
|
|
94
|
+
_: 1
|
|
95
|
+
})
|
|
96
|
+
]),
|
|
97
|
+
default: i(() => [
|
|
98
|
+
x(t(J), {
|
|
99
|
+
style: B({
|
|
100
|
+
color: g.value
|
|
101
|
+
}),
|
|
102
|
+
loading: p.value
|
|
103
|
+
}, {
|
|
104
|
+
default: i(() => [
|
|
105
|
+
h(w((e == null ? void 0 : e.text) ?? t(s)("ap.apExportGroup.export")) + " ", 1),
|
|
106
|
+
x(t(V))
|
|
107
|
+
]),
|
|
108
|
+
_: 1
|
|
109
|
+
}, 8, ["style", "loading"])
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["class", "disabled"])) : K("", !0);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
oe as default
|
|
117
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MenuProps } from 'ant-design-vue';
|
|
2
|
+
|
|
3
|
+
export interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* 选中行的Key列表
|
|
6
|
+
*/
|
|
7
|
+
selectedRowKeys?: any[];
|
|
8
|
+
/**
|
|
9
|
+
* 是否禁用
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 权限
|
|
14
|
+
*/
|
|
15
|
+
auth?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否显示
|
|
18
|
+
*/
|
|
19
|
+
ifShow?: () => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 导出按钮文案
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 导出接口
|
|
26
|
+
*/
|
|
27
|
+
request?: (key: any) => Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* 导出接口参数
|
|
30
|
+
*/
|
|
31
|
+
getRequestParams?: () => Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
export declare enum ActionType {
|
|
34
|
+
ALL = "ALL",
|
|
35
|
+
SELECT = "SELECT"
|
|
36
|
+
}
|
|
37
|
+
export type AntMenuInfo = Parameters<Exclude<MenuProps['onClick'], undefined>>[0];
|
|
@@ -958,3 +958,108 @@ export declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: {
|
|
|
958
958
|
onClick?: (() => void) | undefined;
|
|
959
959
|
};
|
|
960
960
|
});
|
|
961
|
+
export declare const ApExportGroup: {
|
|
962
|
+
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
963
|
+
selectedRowKeys: {
|
|
964
|
+
type: PropType<any[]>;
|
|
965
|
+
};
|
|
966
|
+
disabled: {
|
|
967
|
+
type: PropType<boolean>;
|
|
968
|
+
};
|
|
969
|
+
auth: {
|
|
970
|
+
type: PropType<string>;
|
|
971
|
+
};
|
|
972
|
+
ifShow: {
|
|
973
|
+
type: PropType<() => boolean>;
|
|
974
|
+
};
|
|
975
|
+
text: {
|
|
976
|
+
type: PropType<string>;
|
|
977
|
+
};
|
|
978
|
+
request: {
|
|
979
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
980
|
+
};
|
|
981
|
+
getRequestParams: {
|
|
982
|
+
type: PropType<() => Record<string, any>>;
|
|
983
|
+
};
|
|
984
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
985
|
+
selectedRowKeys: {
|
|
986
|
+
type: PropType<any[]>;
|
|
987
|
+
};
|
|
988
|
+
disabled: {
|
|
989
|
+
type: PropType<boolean>;
|
|
990
|
+
};
|
|
991
|
+
auth: {
|
|
992
|
+
type: PropType<string>;
|
|
993
|
+
};
|
|
994
|
+
ifShow: {
|
|
995
|
+
type: PropType<() => boolean>;
|
|
996
|
+
};
|
|
997
|
+
text: {
|
|
998
|
+
type: PropType<string>;
|
|
999
|
+
};
|
|
1000
|
+
request: {
|
|
1001
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1002
|
+
};
|
|
1003
|
+
getRequestParams: {
|
|
1004
|
+
type: PropType<() => Record<string, any>>;
|
|
1005
|
+
};
|
|
1006
|
+
}>>, {}, true, {}, {}, {
|
|
1007
|
+
P: {};
|
|
1008
|
+
B: {};
|
|
1009
|
+
D: {};
|
|
1010
|
+
C: {};
|
|
1011
|
+
M: {};
|
|
1012
|
+
Defaults: {};
|
|
1013
|
+
}, Readonly< ExtractPropTypes<{
|
|
1014
|
+
selectedRowKeys: {
|
|
1015
|
+
type: PropType<any[]>;
|
|
1016
|
+
};
|
|
1017
|
+
disabled: {
|
|
1018
|
+
type: PropType<boolean>;
|
|
1019
|
+
};
|
|
1020
|
+
auth: {
|
|
1021
|
+
type: PropType<string>;
|
|
1022
|
+
};
|
|
1023
|
+
ifShow: {
|
|
1024
|
+
type: PropType<() => boolean>;
|
|
1025
|
+
};
|
|
1026
|
+
text: {
|
|
1027
|
+
type: PropType<string>;
|
|
1028
|
+
};
|
|
1029
|
+
request: {
|
|
1030
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1031
|
+
};
|
|
1032
|
+
getRequestParams: {
|
|
1033
|
+
type: PropType<() => Record<string, any>>;
|
|
1034
|
+
};
|
|
1035
|
+
}>>, {}, {}, {}, {}, {}>;
|
|
1036
|
+
__isFragment?: undefined;
|
|
1037
|
+
__isTeleport?: undefined;
|
|
1038
|
+
__isSuspense?: undefined;
|
|
1039
|
+
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
1040
|
+
selectedRowKeys: {
|
|
1041
|
+
type: PropType<any[]>;
|
|
1042
|
+
};
|
|
1043
|
+
disabled: {
|
|
1044
|
+
type: PropType<boolean>;
|
|
1045
|
+
};
|
|
1046
|
+
auth: {
|
|
1047
|
+
type: PropType<string>;
|
|
1048
|
+
};
|
|
1049
|
+
ifShow: {
|
|
1050
|
+
type: PropType<() => boolean>;
|
|
1051
|
+
};
|
|
1052
|
+
text: {
|
|
1053
|
+
type: PropType<string>;
|
|
1054
|
+
};
|
|
1055
|
+
request: {
|
|
1056
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1057
|
+
};
|
|
1058
|
+
getRequestParams: {
|
|
1059
|
+
type: PropType<() => Record<string, any>>;
|
|
1060
|
+
};
|
|
1061
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin & (new (...args: any[]) => {
|
|
1062
|
+
$props: {
|
|
1063
|
+
onClick?: (() => void) | undefined;
|
|
1064
|
+
};
|
|
1065
|
+
});
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { withInstall as
|
|
1
|
+
import { withInstall as o } from "@aplus-frontend/utils";
|
|
2
2
|
import "./title/ApTitle.vue.mjs";
|
|
3
3
|
import "./expandAlert/ApExpandAlert.vue.mjs";
|
|
4
4
|
import "./ap-label/ApLabel.vue.mjs";
|
|
5
5
|
import "./ap-status/ApStatus.vue.mjs";
|
|
6
6
|
import "./ap-status/ApStatusGroup.vue.mjs";
|
|
7
7
|
import "./ap-select-layout/select-layout.vue.mjs";
|
|
8
|
-
import
|
|
8
|
+
import "./ap-export-group/ApExportGroup.vue.mjs";
|
|
9
|
+
import t from "./title/ApTitle.vue2.mjs";
|
|
9
10
|
import m from "./expandAlert/ApExpandAlert.vue2.mjs";
|
|
10
11
|
import r from "./ap-label/ApLabel.vue2.mjs";
|
|
11
12
|
import p from "./ap-status/ApStatus.vue2.mjs";
|
|
12
13
|
import i from "./ap-status/ApStatusGroup.vue2.mjs";
|
|
13
14
|
import s from "./ap-select-layout/select-layout.vue2.mjs";
|
|
14
|
-
|
|
15
|
+
import n from "./ap-export-group/ApExportGroup.vue2.mjs";
|
|
16
|
+
const d = o(t), h = m, w = o(r), y = o(p), I = o(i), T = o(s), g = o(n);
|
|
15
17
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
y as
|
|
21
|
-
|
|
18
|
+
h as ApExpandAlert,
|
|
19
|
+
g as ApExportGroup,
|
|
20
|
+
w as ApLabel,
|
|
21
|
+
T as ApSelectLayout,
|
|
22
|
+
y as ApStatus,
|
|
23
|
+
I as ApStatusGroup,
|
|
24
|
+
d as ApTitle
|
|
22
25
|
};
|