@aplus-frontend/ui 0.0.39 → 0.1.0
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-action/item/index.vue2.mjs +19 -20
- package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
- package/es/src/ap-action/style/item.css +10 -25
- package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
- package/es/src/ap-field/checkbox/style.css +7 -0
- package/es/src/ap-field/interface.d.ts +3 -1
- package/es/src/ap-field/radio/index.vue.d.ts +3 -0
- package/es/src/ap-field/radio/index.vue.mjs +44 -29
- package/es/src/ap-field/radio/style.css +4 -0
- 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 +124 -124
- package/es/src/ap-table/constants.d.ts +15 -6
- package/es/src/ap-table/style/ap-table.css +1 -21
- 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/ap-status/ApStatusGroup.vue2.mjs +10 -9
- package/es/src/business/index.d.ts +105 -0
- package/es/src/business/index.mjs +12 -9
- package/es/src/check-card/index.vue2.mjs +44 -48
- package/es/src/check-card/style/index.css +10 -42
- package/es/src/config-provider/config-provider.mjs +22 -17
- package/es/src/design-token/index.mjs +4 -2
- package/es/src/editable-table/form-item.vue.d.ts +4 -0
- package/es/src/editable-table/form-item.vue.mjs +75 -68
- package/es/src/editable-table/index.vue.d.ts +4 -0
- package/es/src/editable-table/index.vue.mjs +79 -72
- package/es/src/editable-table/interface.d.ts +8 -0
- package/es/src/editable-table/style/index.css +1 -21
- 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 +7 -1
- package/es/src/locale/lang/zh-cn.mjs +28 -22
- package/es/src/theme/ap-action/item.css +10 -25
- package/es/src/theme/ap-field/checkbox.css +7 -0
- package/es/src/theme/ap-field/radio.css +4 -0
- package/es/src/theme/ap-form/ap-form-item.css +6 -6
- package/es/src/theme/ap-table/ap-table.css +1 -21
- package/es/src/theme/check-card/index.css +10 -42
- package/es/src/theme/css-var/index.d.ts +7 -0
- package/es/src/theme/css-var/index.mjs +109 -0
- package/es/src/theme/editable-table/index.css +1 -21
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/style/item.css +10 -25
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/style.css +7 -0
- package/lib/src/ap-field/interface.d.ts +3 -1
- package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/style.css +4 -0
- 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 +15 -6
- package/lib/src/ap-table/style/ap-table.css +1 -21
- 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/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/index.d.ts +105 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/check-card/style/index.css +10 -42
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/design-token/index.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/style/index.css +1 -21
- 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-action/item.css +10 -25
- package/lib/src/theme/ap-field/checkbox.css +7 -0
- package/lib/src/theme/ap-field/radio.css +4 -0
- package/lib/src/theme/ap-form/ap-form-item.css +6 -6
- package/lib/src/theme/ap-table/ap-table.css +1 -21
- package/lib/src/theme/check-card/index.css +10 -42
- package/lib/src/theme/css-var/index.d.ts +7 -0
- package/lib/src/theme/css-var/index.js +1 -0
- package/lib/src/theme/editable-table/index.css +1 -21
- package/package.json +6 -5
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
1
|
+
import { defineComponent as le, useSlots as ne, computed as s, createVNode as d, mergeProps as i, unref as l, watch as se, openBlock as p, createElementBlock as g, normalizeClass as T, normalizeStyle as x, createSlots as K, withCtx as c, Fragment as de, renderList as V, createBlock as ue, resolveDynamicComponent as ie, renderSlot as v, createCommentVNode as z, createElementVNode as D, toDisplayString as pe, normalizeProps as ce, guardReactiveProps as fe } from "vue";
|
|
2
|
+
import { Typography as me, Table as ye, Tooltip as ge } from "ant-design-vue";
|
|
3
3
|
import { useToken as Se } from "ant-design-vue/es/theme/internal";
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { apTableRenderItemMap as
|
|
4
|
+
import { ApForm as be } from "../ap-form/index.mjs";
|
|
5
|
+
import { apTableRenderItemMap as he, noRenderAsFormItemValueList as N, apTableFormItemMap as we } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as Re } from "./hooks/use-table-paging.mjs";
|
|
8
|
-
import { omit as j, isUndefined as u, isBoolean as
|
|
8
|
+
import { omit as j, isUndefined as u, isBoolean as Ce } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
|
-
import { QuestionCircleOutlined as
|
|
11
|
-
import { apColumnToColumn as
|
|
12
|
-
import
|
|
13
|
-
import { getRawDisplayValue as
|
|
14
|
-
import
|
|
15
|
-
import { useLocale as
|
|
16
|
-
import { useNamespace as
|
|
17
|
-
|
|
18
|
-
const Ke = {
|
|
10
|
+
import { QuestionCircleOutlined as Fe } from "@ant-design/icons-vue";
|
|
11
|
+
import { apColumnToColumn as Te, getTableRenderType as xe, getTableRenderProps as ve, getColumnOrder as W, updateFormProps as Be, getFieldProps as Pe, getPlaceholder as Ie } from "./utils.mjs";
|
|
12
|
+
import ke from "./hooks/use-table-content-height.mjs";
|
|
13
|
+
import { getRawDisplayValue as Le } from "../editable-table/utils.mjs";
|
|
14
|
+
import Ee from "./hooks/use-table-row-selection.mjs";
|
|
15
|
+
import { useLocale as Oe } from "../config-provider/hooks/use-locale.mjs";
|
|
16
|
+
import { useNamespace as Ke } from "../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
const Ve = {
|
|
19
18
|
key: 0
|
|
20
|
-
},
|
|
19
|
+
}, Ye = /* @__PURE__ */ le({
|
|
21
20
|
name: "ApTable",
|
|
22
21
|
__name: "ap-table",
|
|
23
22
|
props: {
|
|
@@ -137,46 +136,46 @@ const Ke = {
|
|
|
137
136
|
expose: A
|
|
138
137
|
}) {
|
|
139
138
|
const a = _;
|
|
140
|
-
let
|
|
141
|
-
const
|
|
142
|
-
t:
|
|
143
|
-
} =
|
|
144
|
-
e:
|
|
145
|
-
b:
|
|
146
|
-
} =
|
|
139
|
+
let B = 0;
|
|
140
|
+
const P = ne(), [, q] = Se(), {
|
|
141
|
+
t: H
|
|
142
|
+
} = Oe(), {
|
|
143
|
+
e: S,
|
|
144
|
+
b: f
|
|
145
|
+
} = Ke("ap-table"), {
|
|
147
146
|
height: $,
|
|
148
|
-
contentRef:
|
|
149
|
-
} =
|
|
150
|
-
var
|
|
151
|
-
let e = ((
|
|
152
|
-
return e = e.map((
|
|
153
|
-
...j(
|
|
147
|
+
contentRef: M
|
|
148
|
+
} = ke(), b = s(() => {
|
|
149
|
+
var o;
|
|
150
|
+
let e = ((o = a.columns) == null ? void 0 : o.filter((t) => !t.hideInTable)) || [];
|
|
151
|
+
return e = e.map((t) => ({
|
|
152
|
+
...j(Te(t), ["ellipsis"]),
|
|
154
153
|
customRender({
|
|
155
154
|
value: r,
|
|
156
155
|
...n
|
|
157
156
|
}) {
|
|
158
|
-
const C =
|
|
157
|
+
const C = xe(t), O = he[C], re = ve(t, {
|
|
159
158
|
value: r,
|
|
160
159
|
...n
|
|
161
160
|
});
|
|
162
|
-
let
|
|
161
|
+
let F = ae(t, r, d(O, i(re, {
|
|
163
162
|
mode: "read"
|
|
164
163
|
}), null));
|
|
165
|
-
return
|
|
164
|
+
return t.customRender && (F = t.customRender({
|
|
166
165
|
value: r,
|
|
167
166
|
...n,
|
|
168
|
-
column:
|
|
169
|
-
originalNode:
|
|
170
|
-
})),
|
|
167
|
+
column: t,
|
|
168
|
+
originalNode: F
|
|
169
|
+
})), F;
|
|
171
170
|
}
|
|
172
171
|
})), e;
|
|
173
|
-
}),
|
|
174
|
-
var e,
|
|
175
|
-
return
|
|
172
|
+
}), I = s(() => {
|
|
173
|
+
var e, o, t;
|
|
174
|
+
return B++, ((t = (o = (e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !N.includes(r.valueType))) == null ? void 0 : o.sort((r, n) => {
|
|
176
175
|
let C = W(r.order);
|
|
177
176
|
return W(n.order) - C;
|
|
178
|
-
})) == null ? void 0 :
|
|
179
|
-
const n =
|
|
177
|
+
})) == null ? void 0 : t.map((r) => {
|
|
178
|
+
const n = Be(r, Pe(r.fieldProps, {}));
|
|
180
179
|
return {
|
|
181
180
|
...r,
|
|
182
181
|
fieldProps: {
|
|
@@ -184,34 +183,34 @@ const Ke = {
|
|
|
184
183
|
name: r.dataIndex,
|
|
185
184
|
...n || {},
|
|
186
185
|
// 格式化placeholder
|
|
187
|
-
placeholder:
|
|
188
|
-
_signal:
|
|
186
|
+
placeholder: Ie(H, r.valueType, n == null ? void 0 : n.placeholder),
|
|
187
|
+
_signal: B
|
|
189
188
|
}
|
|
190
189
|
};
|
|
191
190
|
})) || [];
|
|
192
|
-
}), Q = s(() => l(
|
|
193
|
-
rowSelection:
|
|
191
|
+
}), Q = s(() => l(b).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => l(b).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), G = s(() => u(a.dataSource) ? y.value.records : a.dataSource), {
|
|
192
|
+
rowSelection: h,
|
|
194
193
|
selectedRows: k,
|
|
195
|
-
...
|
|
196
|
-
} =
|
|
194
|
+
...w
|
|
195
|
+
} = Ee({
|
|
197
196
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
198
197
|
rowKey: a.rowKey,
|
|
199
|
-
dataSource:
|
|
198
|
+
dataSource: G
|
|
200
199
|
}), {
|
|
201
|
-
formRef:
|
|
200
|
+
formRef: R,
|
|
202
201
|
submit: L,
|
|
203
202
|
reset: E,
|
|
204
203
|
tableProps: m,
|
|
205
|
-
handleTableChange:
|
|
206
|
-
data:
|
|
204
|
+
handleTableChange: J,
|
|
205
|
+
data: y
|
|
207
206
|
} = Re({
|
|
208
207
|
async request(e) {
|
|
209
|
-
var
|
|
210
|
-
!
|
|
211
|
-
const
|
|
212
|
-
return (r = a.onLoad) == null || r.call(a, (
|
|
213
|
-
data: (
|
|
214
|
-
total: (
|
|
208
|
+
var t, r;
|
|
209
|
+
!h.value.preserveSelectedRowKeys && u(a.dataSource) && w.clearAll();
|
|
210
|
+
const o = await ((t = a.request) == null ? void 0 : t.call(a, e));
|
|
211
|
+
return (r = a.onLoad) == null || r.call(a, (o == null ? void 0 : o.data) || []), {
|
|
212
|
+
data: (o == null ? void 0 : o.data) || [],
|
|
213
|
+
total: (o == null ? void 0 : o.total) || 0
|
|
215
214
|
};
|
|
216
215
|
},
|
|
217
216
|
filterFields: l(U),
|
|
@@ -222,138 +221,139 @@ const Ke = {
|
|
|
222
221
|
defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
|
|
223
222
|
defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
|
|
224
223
|
formatParams: a.beforeSearchSubmit
|
|
225
|
-
}),
|
|
224
|
+
}), X = s(() => {
|
|
226
225
|
var e;
|
|
227
|
-
return a.scroll ? a.scroll : a.adaptive && (
|
|
226
|
+
return a.scroll ? a.scroll : a.adaptive && (y.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
|
|
228
227
|
y: l($),
|
|
229
228
|
x: "100%"
|
|
230
229
|
} : {
|
|
231
230
|
x: !0
|
|
232
231
|
};
|
|
233
|
-
}),
|
|
232
|
+
}), Y = s(() => {
|
|
234
233
|
var e;
|
|
235
234
|
if (a.tableLayout)
|
|
236
235
|
return a.tableLayout;
|
|
237
|
-
if ((e = a.columns) != null && e.some((
|
|
236
|
+
if ((e = a.columns) != null && e.some((o) => o.ellipsis))
|
|
238
237
|
return "fixed";
|
|
239
|
-
}),
|
|
238
|
+
}), Z = s(() => {
|
|
240
239
|
var r;
|
|
241
|
-
const e = l(m),
|
|
240
|
+
const e = l(m), o = u(a.dataSource) ? e : {
|
|
242
241
|
...e,
|
|
243
242
|
dataSource: a.dataSource,
|
|
244
243
|
onChange: a.onChange
|
|
245
|
-
},
|
|
244
|
+
}, t = l(h);
|
|
246
245
|
return {
|
|
247
246
|
...a,
|
|
248
|
-
...
|
|
247
|
+
...o,
|
|
249
248
|
rowSelection: a.rowSelection === !0 || ((r = a.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
|
|
250
|
-
...
|
|
249
|
+
...t,
|
|
251
250
|
// tips 如果是前端分页,则默认会走缓存
|
|
252
|
-
preserveSelectedRowKeys: u(a.dataSource) ?
|
|
251
|
+
preserveSelectedRowKeys: u(a.dataSource) ? t.preserveSelectedRowKeys : !0
|
|
253
252
|
} : a.rowSelection,
|
|
254
253
|
loading: u(a.loading) ? l(m).loading : a.loading,
|
|
255
254
|
pagination: a.pagination === !1 ? !1 : l(m).pagination,
|
|
256
|
-
scroll: l(
|
|
255
|
+
scroll: l(X)
|
|
257
256
|
};
|
|
258
|
-
}),
|
|
259
|
-
function
|
|
260
|
-
return N.includes(e.valueType) ?
|
|
257
|
+
}), ee = s(() => [f(), a.card ? null : f("wrapper"), a.adaptive ? f("adaptive") : null].filter(Boolean));
|
|
258
|
+
function ae(e, o, t) {
|
|
259
|
+
return N.includes(e.valueType) ? t : e.copyable || e.ellipsis ? d(me.Paragraph, {
|
|
261
260
|
copyable: e.copyable ? {
|
|
262
|
-
text:
|
|
261
|
+
text: o,
|
|
263
262
|
tooltip: !1
|
|
264
263
|
} : !1,
|
|
265
|
-
ellipsis: e.ellipsis ?
|
|
266
|
-
tooltip:
|
|
264
|
+
ellipsis: e.ellipsis ? Ce(e.ellipsis) ? {
|
|
265
|
+
tooltip: o
|
|
267
266
|
} : {
|
|
268
267
|
...e.ellipsis,
|
|
269
|
-
tooltip:
|
|
268
|
+
tooltip: o
|
|
270
269
|
} : !1,
|
|
271
|
-
content: e.ellipsis ?
|
|
272
|
-
}, null) :
|
|
270
|
+
content: e.ellipsis ? Le(e, o) : t
|
|
271
|
+
}, null) : t;
|
|
273
272
|
}
|
|
274
|
-
|
|
275
|
-
var
|
|
276
|
-
(
|
|
273
|
+
se(() => l(y).loading, (e) => {
|
|
274
|
+
var o;
|
|
275
|
+
(o = a.onLoadingChange) == null || o.call(a, e);
|
|
277
276
|
});
|
|
278
277
|
function te(e) {
|
|
279
|
-
var
|
|
280
|
-
(r = (
|
|
278
|
+
var o, t, r;
|
|
279
|
+
(r = (t = (o = R.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
281
280
|
}
|
|
282
|
-
function
|
|
283
|
-
var e,
|
|
284
|
-
return (
|
|
281
|
+
function oe() {
|
|
282
|
+
var e, o, t;
|
|
283
|
+
return (t = (o = (e = R.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
|
|
285
284
|
}
|
|
286
285
|
return A({
|
|
287
286
|
submit: () => L(),
|
|
288
287
|
reset: () => E(),
|
|
289
288
|
setSearchFormValues: te,
|
|
290
|
-
getSearchFormValues:
|
|
291
|
-
dataSource: s(() => l(
|
|
289
|
+
getSearchFormValues: oe,
|
|
290
|
+
dataSource: s(() => l(y).records),
|
|
292
291
|
rowSelection: {
|
|
293
292
|
selectedRows: s(() => l(k)),
|
|
294
|
-
...
|
|
293
|
+
...w
|
|
295
294
|
}
|
|
296
|
-
}), (e,
|
|
297
|
-
class:
|
|
298
|
-
}, [l(u)(e.dataSource) && e.searchForm !== !1 &&
|
|
295
|
+
}), (e, o) => (p(), g("div", {
|
|
296
|
+
class: T(ee.value)
|
|
297
|
+
}, [l(u)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (p(), g("div", {
|
|
299
298
|
key: 0,
|
|
300
|
-
class:
|
|
301
|
-
style:
|
|
302
|
-
}, [d(l(
|
|
299
|
+
class: T(e.card ? l(S)("search-wrapper") : null),
|
|
300
|
+
style: x(e.searchFormWrapperStyle)
|
|
301
|
+
}, [d(l(be).SearchForm, i(e.searchForm || {}, {
|
|
303
302
|
ref_key: "formRef",
|
|
304
|
-
ref:
|
|
303
|
+
ref: R,
|
|
305
304
|
"custom-reset": "",
|
|
306
305
|
onSubmit: l(L),
|
|
307
306
|
onReset: l(E),
|
|
308
307
|
"submit-loading": l(m).loading
|
|
309
|
-
}),
|
|
310
|
-
default:
|
|
311
|
-
key:
|
|
308
|
+
}), K({
|
|
309
|
+
default: c(() => [(p(!0), g(de, null, V(I.value, (t) => (p(), ue(ie(t.customRenderFormItem ? t.customRenderFormItem(t) : l(we)[t.valueType || "text"]), i({
|
|
310
|
+
key: t.dataIndex,
|
|
312
311
|
ref_for: !0
|
|
313
|
-
},
|
|
314
|
-
span:
|
|
312
|
+
}, t.fieldProps || {}, {
|
|
313
|
+
span: t.span
|
|
315
314
|
}), null, 16, ["span"]))), 128))]),
|
|
316
315
|
_: 2
|
|
317
|
-
}, [
|
|
316
|
+
}, [P.searchFormExtra ? {
|
|
318
317
|
name: "extra",
|
|
319
|
-
fn:
|
|
318
|
+
fn: c(() => [v(e.$slots, "searchFormExtra")]),
|
|
320
319
|
key: "0"
|
|
321
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
320
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : z("", !0), D("div", {
|
|
322
321
|
ref_key: "contentRef",
|
|
323
|
-
ref:
|
|
324
|
-
class:
|
|
325
|
-
style:
|
|
326
|
-
}, [
|
|
327
|
-
selectedRows: l(k)
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
322
|
+
ref: M,
|
|
323
|
+
class: T([l(S)("table-wrapper"), e.card ? l(S)("table-wrapper-card") : null]),
|
|
324
|
+
style: x(e.tableWrapperStyle)
|
|
325
|
+
}, [v(e.$slots, "title", i({
|
|
326
|
+
selectedRows: l(k),
|
|
327
|
+
selectedRowKeys: l(h).selectedRowKeys
|
|
328
|
+
}, w)), d(l(ye), i({
|
|
329
|
+
class: l(f)("table")
|
|
330
|
+
}, Z.value, {
|
|
331
|
+
"table-layout": Y.value,
|
|
332
|
+
onChange: l(J),
|
|
333
|
+
columns: b.value
|
|
334
|
+
}), K({
|
|
335
|
+
headerCell: c(({
|
|
336
|
+
column: t,
|
|
337
337
|
title: r
|
|
338
|
-
}) => [
|
|
339
|
-
title:
|
|
338
|
+
}) => [t.tooltip ? (p(), g("span", Ve, [D("span", null, pe(r), 1), d(l(ge), {
|
|
339
|
+
title: t.tooltip,
|
|
340
340
|
placement: "bottom"
|
|
341
341
|
}, {
|
|
342
|
-
default:
|
|
343
|
-
style:
|
|
342
|
+
default: c(() => [d(l(Fe), {
|
|
343
|
+
style: x({
|
|
344
344
|
paddingLeft: "4px",
|
|
345
|
-
color: l(
|
|
345
|
+
color: l(q).colorPrimary
|
|
346
346
|
})
|
|
347
347
|
}, null, 8, ["style"])]),
|
|
348
348
|
_: 2
|
|
349
|
-
}, 1032, ["title"])])) :
|
|
349
|
+
}, 1032, ["title"])])) : z("", !0)]),
|
|
350
350
|
_: 2
|
|
351
|
-
}, [
|
|
351
|
+
}, [V(l(j)(P, ["title", "searchFormExtra"]), (t, r) => ({
|
|
352
352
|
name: r,
|
|
353
|
-
fn:
|
|
353
|
+
fn: c((n) => [v(e.$slots, r, ce(fe(n || {})))])
|
|
354
354
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
357
|
export {
|
|
358
|
-
|
|
358
|
+
Ye as default
|
|
359
359
|
};
|
|
@@ -11802,6 +11802,10 @@ export declare const apTableRenderItemMap: {
|
|
|
11802
11802
|
options: {
|
|
11803
11803
|
type: PropType<(string | number | RadioGroupChildOption)[]>;
|
|
11804
11804
|
};
|
|
11805
|
+
vertical: {
|
|
11806
|
+
type: PropType<boolean>;
|
|
11807
|
+
default: boolean;
|
|
11808
|
+
};
|
|
11805
11809
|
'onUpdate:value': {
|
|
11806
11810
|
type: PropType<(val: any) => void>;
|
|
11807
11811
|
};
|
|
@@ -11858,6 +11862,10 @@ export declare const apTableRenderItemMap: {
|
|
|
11858
11862
|
options: {
|
|
11859
11863
|
type: PropType<(string | number | RadioGroupChildOption)[]>;
|
|
11860
11864
|
};
|
|
11865
|
+
vertical: {
|
|
11866
|
+
type: PropType<boolean>;
|
|
11867
|
+
default: boolean;
|
|
11868
|
+
};
|
|
11861
11869
|
'onUpdate:value': {
|
|
11862
11870
|
type: PropType<(val: any) => void>;
|
|
11863
11871
|
};
|
|
@@ -11878,6 +11886,7 @@ export declare const apTableRenderItemMap: {
|
|
|
11878
11886
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
11879
11887
|
}, {
|
|
11880
11888
|
mode: FieldMode;
|
|
11889
|
+
vertical: boolean;
|
|
11881
11890
|
emptyText: string;
|
|
11882
11891
|
}, {}>;
|
|
11883
11892
|
select: {
|
|
@@ -16086,9 +16095,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16086
16095
|
rows: {
|
|
16087
16096
|
type: PropType<number>;
|
|
16088
16097
|
};
|
|
16089
|
-
autosize: {
|
|
16090
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16091
|
-
};
|
|
16092
16098
|
autoSize: {
|
|
16093
16099
|
type: PropType<boolean | AutoSizeType>;
|
|
16094
16100
|
};
|
|
@@ -16237,9 +16243,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16237
16243
|
rows: {
|
|
16238
16244
|
type: PropType<number>;
|
|
16239
16245
|
};
|
|
16240
|
-
autosize: {
|
|
16241
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16242
|
-
};
|
|
16243
16246
|
autoSize: {
|
|
16244
16247
|
type: PropType<boolean | AutoSizeType>;
|
|
16245
16248
|
};
|
|
@@ -16290,6 +16293,9 @@ export declare const apTableRenderItemMap: {
|
|
|
16290
16293
|
type: PropType<(string | number | CheckboxOptionType)[]>;
|
|
16291
16294
|
default: () => never[];
|
|
16292
16295
|
};
|
|
16296
|
+
vertical: {
|
|
16297
|
+
type: PropType<boolean>;
|
|
16298
|
+
};
|
|
16293
16299
|
defaultValue: {
|
|
16294
16300
|
type: PropType< CheckboxValueType[]>;
|
|
16295
16301
|
};
|
|
@@ -16338,6 +16344,9 @@ export declare const apTableRenderItemMap: {
|
|
|
16338
16344
|
type: PropType<(string | number | CheckboxOptionType)[]>;
|
|
16339
16345
|
default: () => never[];
|
|
16340
16346
|
};
|
|
16347
|
+
vertical: {
|
|
16348
|
+
type: PropType<boolean>;
|
|
16349
|
+
};
|
|
16341
16350
|
defaultValue: {
|
|
16342
16351
|
type: PropType< CheckboxValueType[]>;
|
|
16343
16352
|
};
|
|
@@ -48,31 +48,11 @@
|
|
|
48
48
|
flex: 1;
|
|
49
49
|
}
|
|
50
50
|
.aplus-ap-table-table tr > th.ant-table-cell {
|
|
51
|
-
background-color:
|
|
52
|
-
border-bottom-color: #E9EDF3;
|
|
51
|
+
background-color: var(--ap-table-header-bg);
|
|
53
52
|
}
|
|
54
53
|
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
55
54
|
display: none;
|
|
56
55
|
}
|
|
57
|
-
.aplus-ap-table-table tr > td.ant-table-cell {
|
|
58
|
-
border-top-color: #E9EDF3;
|
|
59
|
-
}
|
|
60
|
-
.aplus-ap-table-table-admin .ant-pagination {
|
|
61
|
-
margin-bottom: 0 !important;
|
|
62
|
-
}
|
|
63
|
-
.aplus-ap-table-table-admin .ant-pagination .ant-pagination-total-text {
|
|
64
|
-
flex: 1;
|
|
65
|
-
}
|
|
66
|
-
.aplus-ap-table-table-admin tr > th.ant-table-cell {
|
|
67
|
-
background-color: #FAFAFA;
|
|
68
|
-
border-bottom-color: #E9E9E9;
|
|
69
|
-
}
|
|
70
|
-
.aplus-ap-table-table-admin tr > th.ant-table-cell::before {
|
|
71
|
-
display: none;
|
|
72
|
-
}
|
|
73
|
-
.aplus-ap-table-table-admin tr > td.ant-table-cell {
|
|
74
|
-
border-top-color: #E9E9E9;
|
|
75
|
-
}
|
|
76
56
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
77
57
|
padding: 12px 16px;
|
|
78
58
|
}
|
|
@@ -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];
|