@aplus-frontend/ui 6.13.4 → 6.15.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/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
- package/es/src/ap-grid/hooks/use-row-selection.mjs +71 -56
- package/es/src/ap-grid/index.vue.mjs +7 -10
- package/es/src/ap-grid/utils/table.mjs +8 -8
- package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
- package/es/src/ap-list/interface.d.ts +3 -5
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
- package/es/src/business/ap-export-group/convertExportField.d.ts +3 -1
- package/es/src/business/ap-export-group/index.d.ts +3 -3
- package/es/src/business/ap-export-group/interface.d.ts +14 -2
- package/es/src/business/ap-table-modal/interface.d.ts +3 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
- package/es/src/design-token/index.mjs +1 -1
- package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
- package/lib/src/ap-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
- package/lib/src/ap-list/interface.d.ts +3 -5
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/convertExportField.d.ts +3 -1
- package/lib/src/business/ap-export-group/index.d.ts +3 -3
- package/lib/src/business/ap-export-group/interface.d.ts +14 -2
- package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/antdv-override.css +0 -24
- package/theme/antdv-override.less +0 -33
- package/theme/ap-grid/index.css +11 -4
- package/theme/ap-grid/index.less +11 -2
- package/theme/ap-table-modal/index.css +3 -2
- package/theme/ap-table-modal/index.less +3 -2
- package/theme/css-var.css +2 -0
- package/theme/css-var.less +4 -0
- package/theme/index.css +16 -30
- package/theme/reset.css +18 -0
- package/theme/reset.less +26 -2
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { message as
|
|
1
|
+
import { defineComponent as z, ref as T, computed as c, watch as U, createElementBlock as H, openBlock as f, Fragment as J, createBlock as v, createCommentVNode as S, unref as o, mergeProps as A, withCtx as s, createTextVNode as k, toDisplayString as h, normalizeClass as Q, createVNode as F } from "vue";
|
|
2
|
+
import { DownOutlined as W } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as X, Dropdown as Y, Menu as Z, MenuItem as K } 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 { useInjectApTable as
|
|
9
|
-
import { convertExportField as
|
|
5
|
+
import { ApExportGroupActionType as u } from "./interface.mjs";
|
|
6
|
+
import { usePermission as _ } from "@aplus-frontend/hooks";
|
|
7
|
+
import { handleExportDownload as ee } from "./handleExportDownload.mjs";
|
|
8
|
+
import { useInjectApTable as te } from "../../ap-table/context.mjs";
|
|
9
|
+
import { convertExportField as ae } from "./convertExportField.mjs";
|
|
10
10
|
import "../../ap-button/index.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
11
|
+
import { ApBatchActionGroup as le } from "../ap-batch-action-group/index.mjs";
|
|
12
|
+
import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
import D from "../../ap-button/ap-button.vue.mjs";
|
|
16
|
+
const we = /* @__PURE__ */ z({
|
|
16
17
|
__name: "ApExportGroup",
|
|
17
18
|
props: {
|
|
18
19
|
type: { default: "button" },
|
|
19
20
|
selectedRowKeys: {},
|
|
21
|
+
groupList: {},
|
|
22
|
+
buttonProps: {},
|
|
20
23
|
disabled: { type: Boolean },
|
|
21
24
|
auth: {},
|
|
22
25
|
ifShow: {},
|
|
@@ -29,131 +32,165 @@ const ge = /* @__PURE__ */ O({
|
|
|
29
32
|
successMessage: { type: [Boolean, String], default: !1 },
|
|
30
33
|
exportField: { type: [Boolean, Object], default: void 0 }
|
|
31
34
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const { hasPermission:
|
|
35
|
+
setup(R) {
|
|
36
|
+
const { hasPermission: j } = _(), e = R, { columns: m, dataSource: b } = te(), { b: I } = oe("ap-export-group"), { t: n } = re(), P = ue("exportField"), i = T(!1), w = T(!1), p = c(
|
|
34
37
|
() => {
|
|
35
|
-
var
|
|
36
|
-
return !!(e != null && e.disabled) || (
|
|
38
|
+
var l;
|
|
39
|
+
return !!(e != null && e.disabled) || (b !== void 0 ? !((l = b == null ? void 0 : b.value) != null && l.length) : !1) || i.value;
|
|
37
40
|
}
|
|
38
41
|
);
|
|
39
|
-
|
|
40
|
-
() =>
|
|
42
|
+
U(
|
|
43
|
+
() => p.value,
|
|
41
44
|
() => {
|
|
42
|
-
|
|
45
|
+
p.value && (w.value = !1);
|
|
43
46
|
},
|
|
44
47
|
{
|
|
45
48
|
immediate: !0
|
|
46
49
|
}
|
|
47
50
|
);
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
key:
|
|
52
|
-
} : typeof
|
|
53
|
-
...
|
|
54
|
-
key:
|
|
55
|
-
} :
|
|
56
|
-
}),
|
|
51
|
+
const N = c(() => (e == null ? void 0 : e.successMessage) === !0 ? n("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), E = c(() => {
|
|
52
|
+
const l = "exportFieldList", t = (e == null ? void 0 : e.exportField) ?? (P.value === "" ? !0 : P.value) ?? !1;
|
|
53
|
+
return t === !0 ? {
|
|
54
|
+
key: l
|
|
55
|
+
} : typeof t == "object" ? {
|
|
56
|
+
...t,
|
|
57
|
+
key: t.key ?? l
|
|
58
|
+
} : t;
|
|
59
|
+
}), $ = {
|
|
57
60
|
textAlign: "center"
|
|
58
|
-
},
|
|
59
|
-
let
|
|
60
|
-
return !(e != null && e.ifShow) && (e != null && e.auth) && (
|
|
61
|
+
}, g = c(() => (e == null ? void 0 : e.selectedRowKeys) || []), L = c(() => {
|
|
62
|
+
let l = e == null ? void 0 : e.ifShow;
|
|
63
|
+
return !(e != null && e.ifShow) && (e != null && e.auth) && (l = () => j(e.auth)), (l == null ? void 0 : l()) ?? !0;
|
|
61
64
|
});
|
|
62
|
-
async function
|
|
63
|
-
|
|
65
|
+
async function O() {
|
|
66
|
+
g.value.length > 0 ? y({ key: u.SELECT }) : y({ key: u.ALL });
|
|
64
67
|
}
|
|
65
|
-
async function
|
|
66
|
-
var
|
|
67
|
-
const { getRequestParams:
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
[(
|
|
71
|
-
} :
|
|
72
|
-
const
|
|
68
|
+
async function y({ key: l, option: t }) {
|
|
69
|
+
var G, B, M;
|
|
70
|
+
const a = t || e, { getRequestParams: d, request: r } = a || {};
|
|
71
|
+
let C = {};
|
|
72
|
+
l === u.SELECT ? C = {
|
|
73
|
+
[(a == null ? void 0 : a.idKey) || "ids"]: g.value
|
|
74
|
+
} : l === u.ALL && (C = (d == null ? void 0 : d()) || {});
|
|
75
|
+
const q = ((G = a == null ? void 0 : a.getInitialParams) == null ? void 0 : G.call(a)) || {};
|
|
73
76
|
try {
|
|
74
|
-
|
|
75
|
-
let
|
|
77
|
+
i.value = !0;
|
|
78
|
+
let x = Object.assign(
|
|
76
79
|
{
|
|
77
|
-
...
|
|
78
|
-
...
|
|
80
|
+
...C,
|
|
81
|
+
...q
|
|
79
82
|
},
|
|
80
|
-
|
|
81
|
-
[
|
|
82
|
-
|
|
83
|
-
(
|
|
83
|
+
E.value && (m != null && m.value) ? {
|
|
84
|
+
[E.value.key]: ae(
|
|
85
|
+
m.value,
|
|
86
|
+
(B = E.value) == null ? void 0 : B.convertField
|
|
84
87
|
)
|
|
85
88
|
} : {}
|
|
86
89
|
);
|
|
87
|
-
|
|
90
|
+
x = ((M = a == null ? void 0 : a.beforeRequest) == null ? void 0 : M.call(a, x)) || x, await ee(async () => await (r == null ? void 0 : r(x))), a != null && a.successMessage && X.success(N.value);
|
|
88
91
|
} finally {
|
|
89
|
-
|
|
92
|
+
i.value = !1;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
95
|
+
const V = c(() => {
|
|
96
|
+
var l;
|
|
97
|
+
return ((l = e == null ? void 0 : e.groupList) == null ? void 0 : l.map((t, a) => ({
|
|
98
|
+
key: a,
|
|
99
|
+
content: t == null ? void 0 : t.text,
|
|
100
|
+
auth: t == null ? void 0 : t.auth,
|
|
101
|
+
ifShow: t == null ? void 0 : t.ifShow,
|
|
102
|
+
disabled: t == null ? void 0 : t.disabled,
|
|
103
|
+
onClick: () => {
|
|
104
|
+
g.value.length > 0 ? y({
|
|
105
|
+
key: u.SELECT,
|
|
106
|
+
option: t
|
|
107
|
+
}) : y({
|
|
108
|
+
key: u.ALL,
|
|
109
|
+
option: t
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}))) || [];
|
|
113
|
+
});
|
|
114
|
+
return (l, t) => {
|
|
115
|
+
var a, d;
|
|
116
|
+
return f(), H(J, null, [
|
|
117
|
+
L.value && e.type === "button" ? (f(), v(o(D), A({ key: 0 }, {
|
|
118
|
+
...l.$attrs
|
|
119
|
+
}, {
|
|
120
|
+
disabled: p.value,
|
|
121
|
+
loading: i.value,
|
|
122
|
+
"min-width": "",
|
|
123
|
+
onClick: O
|
|
124
|
+
}), {
|
|
125
|
+
default: s(() => [
|
|
126
|
+
k(h((e == null ? void 0 : e.text) ?? o(n)("ap.apExportGroup.export")), 1)
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 16, ["disabled", "loading"])) : S("", !0),
|
|
130
|
+
L.value && e.type === "dropdown" ? (f(), v(o(Y), {
|
|
131
|
+
key: 1,
|
|
132
|
+
open: w.value,
|
|
133
|
+
"onUpdate:open": t[0] || (t[0] = (r) => w.value = r),
|
|
134
|
+
class: Q([o(I)()]),
|
|
135
|
+
"overlay-style": $,
|
|
136
|
+
disabled: p.value
|
|
137
|
+
}, {
|
|
138
|
+
overlay: s(() => [
|
|
139
|
+
F(o(Z), { onClick: y }, {
|
|
140
|
+
default: s(() => {
|
|
141
|
+
var r;
|
|
142
|
+
return [
|
|
143
|
+
(f(), v(o(K), {
|
|
144
|
+
key: o(u).SELECT,
|
|
145
|
+
disabled: ((r = g.value) == null ? void 0 : r.length) === 0
|
|
146
|
+
}, {
|
|
147
|
+
default: s(() => [
|
|
148
|
+
k(h(o(n)("ap.apExportGroup.exportSelected")), 1)
|
|
149
|
+
]),
|
|
150
|
+
_: 1
|
|
151
|
+
}, 8, ["disabled"])),
|
|
152
|
+
(f(), v(o(K), {
|
|
153
|
+
key: o(u).ALL
|
|
154
|
+
}, {
|
|
155
|
+
default: s(() => [
|
|
156
|
+
k(h(o(n)("ap.apExportGroup.exportAll")), 1)
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
}))
|
|
160
|
+
];
|
|
161
|
+
}),
|
|
162
|
+
_: 1
|
|
163
|
+
})
|
|
164
|
+
]),
|
|
165
|
+
default: s(() => [
|
|
166
|
+
F(o(D), A({
|
|
167
|
+
...l.$attrs
|
|
168
|
+
}, { loading: i.value }), {
|
|
169
|
+
default: s(() => [
|
|
170
|
+
k(h((e == null ? void 0 : e.text) ?? o(n)("ap.apExportGroup.export")) + " ", 1),
|
|
171
|
+
F(o(W))
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 16, ["loading"])
|
|
175
|
+
]),
|
|
176
|
+
_: 1
|
|
177
|
+
}, 8, ["open", "class", "disabled"])) : S("", !0),
|
|
178
|
+
L.value && e.type === "group" ? (f(), v(o(le), A({ key: 2 }, {
|
|
179
|
+
...l.$attrs
|
|
180
|
+
}, {
|
|
181
|
+
disabled: p.value,
|
|
182
|
+
loading: i.value,
|
|
183
|
+
"button-props": {
|
|
184
|
+
...e.buttonProps,
|
|
185
|
+
content: ((a = e == null ? void 0 : e.buttonProps) == null ? void 0 : a.content) ?? o(n)("ap.apExportGroup.export"),
|
|
186
|
+
type: ((d = e == null ? void 0 : e.buttonProps) == null ? void 0 : d.type) ?? "default"
|
|
187
|
+
},
|
|
188
|
+
"menu-list": V.value
|
|
189
|
+
}), null, 16, ["disabled", "loading", "button-props", "menu-list"])) : S("", !0)
|
|
190
|
+
], 64);
|
|
191
|
+
};
|
|
155
192
|
}
|
|
156
193
|
});
|
|
157
194
|
export {
|
|
158
|
-
|
|
195
|
+
we as default
|
|
159
196
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ApColumnType } from '../../ap-table/interface';
|
|
2
|
+
import { ApGridColumnType } from './../../ap-grid/interface';
|
|
1
3
|
import { ColumnType } from '@aplus-frontend/antdv/es/table';
|
|
2
|
-
export declare const convertExportField: (columns: ColumnType[], convertField?: {
|
|
4
|
+
export declare const convertExportField: (columns: ColumnType[] | ApGridColumnType[] | ApColumnType[], convertField?: {
|
|
3
5
|
[key: string]: string[];
|
|
4
6
|
}) => any[];
|
|
@@ -5,7 +5,7 @@ import { ApExportGroupProps } from './interface';
|
|
|
5
5
|
export * from './interface';
|
|
6
6
|
declare const ApExportGroup: {
|
|
7
7
|
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
8
|
-
type: "button" | "dropdown";
|
|
8
|
+
type: "button" | "dropdown" | "group";
|
|
9
9
|
exportField: boolean | {
|
|
10
10
|
key?: string;
|
|
11
11
|
convertField?: {
|
|
@@ -21,7 +21,7 @@ declare const ApExportGroup: {
|
|
|
21
21
|
M: {};
|
|
22
22
|
Defaults: {};
|
|
23
23
|
}, Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
24
|
-
type: "button" | "dropdown";
|
|
24
|
+
type: "button" | "dropdown" | "group";
|
|
25
25
|
exportField: boolean | {
|
|
26
26
|
key?: string;
|
|
27
27
|
convertField?: {
|
|
@@ -34,7 +34,7 @@ declare const ApExportGroup: {
|
|
|
34
34
|
__isTeleport?: never;
|
|
35
35
|
__isSuspense?: never;
|
|
36
36
|
} & ComponentOptionsBase<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
37
|
-
type: "button" | "dropdown";
|
|
37
|
+
type: "button" | "dropdown" | "group";
|
|
38
38
|
exportField: boolean | {
|
|
39
39
|
key?: string;
|
|
40
40
|
convertField?: {
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { ApBatchActionGroupButtonProps } from '../ap-batch-action-group';
|
|
2
|
+
export type ApExportGroupProps = {
|
|
2
3
|
/**
|
|
3
4
|
* 类型
|
|
4
5
|
*/
|
|
5
|
-
type?: 'button' | 'dropdown';
|
|
6
|
+
type?: 'button' | 'dropdown' | 'group';
|
|
6
7
|
/**
|
|
7
8
|
* 选中行的Key列表
|
|
8
9
|
*/
|
|
9
10
|
selectedRowKeys?: any[];
|
|
11
|
+
/**
|
|
12
|
+
* 类型为group时配置,适用于多导出
|
|
13
|
+
*/
|
|
14
|
+
groupList?: ApExportGroupListItem[];
|
|
15
|
+
/**
|
|
16
|
+
* 类型为group时配置,和批量操作按钮组buttonProps一致
|
|
17
|
+
*/
|
|
18
|
+
buttonProps?: ApBatchActionGroupButtonProps;
|
|
19
|
+
} & ApExportGroupListItem;
|
|
20
|
+
export interface ApExportGroupListItem {
|
|
10
21
|
/**
|
|
11
22
|
* 是否禁用
|
|
12
23
|
*/
|
|
@@ -57,5 +68,6 @@ export declare enum ApExportGroupActionType {
|
|
|
57
68
|
}
|
|
58
69
|
export type ApExportGroupAntMenuInfo = {
|
|
59
70
|
key: string | number;
|
|
71
|
+
option?: ApExportGroupListItem;
|
|
60
72
|
};
|
|
61
73
|
export type ApExportGroupMixedParams<ParamsType> = Partial<ParamsType>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VNode, VNodeChild } from 'vue';
|
|
1
|
+
import { StyleValue, VNode, VNodeChild } from 'vue';
|
|
2
2
|
import { ApTableProps } from '../../ap-table';
|
|
3
3
|
import { ModalProps, TableProps } from '@aplus-frontend/antdv';
|
|
4
4
|
/** table-modal的props类型 */
|
|
@@ -75,6 +75,8 @@ export interface TableLayoutConfig {
|
|
|
75
75
|
leftTitle?: string | VNodeChild;
|
|
76
76
|
/** 右侧标题 */
|
|
77
77
|
rightTitle?: (selectedCount: number) => string | VNodeChild;
|
|
78
|
+
/** 右侧内容样式 */
|
|
79
|
+
rightContentStyle?: StyleValue;
|
|
78
80
|
/** 已经选择item渲染, renderSelectedItem有值才为复杂布局 */
|
|
79
81
|
renderSelectedItem?: (record: any, actions: {
|
|
80
82
|
deleteItem: (record: any) => void;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as
|
|
1
|
+
import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as n, createCommentVNode as b, createElementVNode as m, createVNode as p, withCtx as i, createBlock as s, resolveDynamicComponent as c, h as S, normalizeStyle as B, createTextVNode as $, toDisplayString as M, renderList as A } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
|
-
import { ApTitle as
|
|
4
|
-
import { Button as V, Empty as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
const
|
|
3
|
+
import { ApTitle as T } from "../../ap-title/index.mjs";
|
|
4
|
+
import { Button as V, Empty as k } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useLocale as D } from "../../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
import { useNamespace as j } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const q = /* @__PURE__ */ v({
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
|
|
11
11
|
rightTitle: {},
|
|
12
|
+
rightContentStyle: { type: [Boolean, null, String, Object, Array] },
|
|
12
13
|
renderSelectedItem: {},
|
|
13
14
|
selectedList: { default: () => [] }
|
|
14
15
|
},
|
|
15
16
|
emits: ["clear", "deleteItem"],
|
|
16
|
-
setup(
|
|
17
|
-
const { t: d } =
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
}, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } =
|
|
17
|
+
setup(I, { emit: C }) {
|
|
18
|
+
const { t: d } = D(), u = I, y = C, E = () => {
|
|
19
|
+
y("clear");
|
|
20
|
+
}, L = (e) => {
|
|
21
|
+
y("deleteItem", e);
|
|
22
|
+
}, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = j("ap-table-modal");
|
|
22
23
|
return (e, w) => (l(), o("div", {
|
|
23
24
|
class: a([
|
|
24
25
|
e.renderSelectedItem ? t(r)("table-layout") : "",
|
|
25
26
|
{ "complex-layout": !!e.renderSelectedItem }
|
|
26
27
|
])
|
|
27
28
|
}, [
|
|
28
|
-
e.renderSelectedItem ? (l(), o(
|
|
29
|
+
e.renderSelectedItem ? (l(), o(n, { key: 0 }, [
|
|
29
30
|
e.leftTitle ? (l(), o("div", {
|
|
30
31
|
key: 0,
|
|
31
32
|
class: a(t(r)("table-layout-left"))
|
|
32
33
|
}, [
|
|
33
|
-
p(t(
|
|
34
|
-
prefix:
|
|
35
|
-
(l(), s(c(
|
|
34
|
+
p(t(T), { style: { "margin-bottom": "16px" } }, {
|
|
35
|
+
prefix: i(() => [
|
|
36
|
+
(l(), s(c(S(n, [e.leftTitle]))))
|
|
36
37
|
]),
|
|
37
38
|
_: 1
|
|
38
39
|
}),
|
|
@@ -43,22 +44,23 @@ const O = /* @__PURE__ */ v({
|
|
|
43
44
|
], 2)
|
|
44
45
|
], 2)) : b("", !0),
|
|
45
46
|
m("div", {
|
|
46
|
-
class: a(t(r)("table-layout-right"))
|
|
47
|
+
class: a(t(r)("table-layout-right")),
|
|
48
|
+
style: B(e.rightContentStyle)
|
|
47
49
|
}, [
|
|
48
|
-
p(t(
|
|
50
|
+
p(t(T), {
|
|
49
51
|
title: `${t(d)("ap.apTableModal.selected")} (${e.selectedList.length})`
|
|
50
52
|
}, {
|
|
51
|
-
prefix:
|
|
52
|
-
(l(), s(c(
|
|
53
|
+
prefix: i(() => [
|
|
54
|
+
(l(), s(c(S(n, [N(e.selectedList.length)]))))
|
|
53
55
|
]),
|
|
54
|
-
suffix:
|
|
56
|
+
suffix: i(() => [
|
|
55
57
|
p(t(V), {
|
|
56
58
|
type: "link",
|
|
57
59
|
style: { padding: "0px", height: "22px", "border-width": "0px" },
|
|
58
|
-
onClick:
|
|
60
|
+
onClick: E
|
|
59
61
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
$(
|
|
62
|
+
default: i(() => [
|
|
63
|
+
$(M(t(d)("ap.apTableModal.clear")), 1)
|
|
62
64
|
]),
|
|
63
65
|
_: 1
|
|
64
66
|
})
|
|
@@ -68,21 +70,21 @@ const O = /* @__PURE__ */ v({
|
|
|
68
70
|
m("div", {
|
|
69
71
|
class: a(t(r)("table-layout-right-content"))
|
|
70
72
|
}, [
|
|
71
|
-
(l(!0), o(
|
|
73
|
+
(l(!0), o(n, null, A(e.selectedList, (f) => {
|
|
72
74
|
var g;
|
|
73
|
-
return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e,
|
|
75
|
+
return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e, f, { deleteItem: L })), { key: f });
|
|
74
76
|
}), 128)),
|
|
75
|
-
e.selectedList.length === 0 ? (l(), s(t(
|
|
77
|
+
e.selectedList.length === 0 ? (l(), s(t(k), {
|
|
76
78
|
key: 0,
|
|
77
|
-
image: t(
|
|
79
|
+
image: t(k).PRESENTED_IMAGE_SIMPLE,
|
|
78
80
|
style: { "margin-top": "100px" }
|
|
79
81
|
}, null, 8, ["image"])) : b("", !0)
|
|
80
82
|
], 2)
|
|
81
|
-
],
|
|
83
|
+
], 6)
|
|
82
84
|
], 64)) : h(e.$slots, "default", { key: 1 })
|
|
83
85
|
], 2));
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
q as default
|
|
88
90
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useSlots as
|
|
1
|
+
import { useSlots as C, computed as N, unref as m } from "vue";
|
|
2
2
|
import { omit as y, isFunction as k, isArray as f } from "lodash-unified";
|
|
3
3
|
import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
|
|
4
4
|
import { updateFormProps as v, getFieldProps as E, getTableRenderProps as G } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
6
|
import { useToken as S } from "@aplus-frontend/antdv/es/theme/internal";
|
|
7
7
|
import { useNamespace as U } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
-
const M = (
|
|
8
|
+
const M = (t, b) => {
|
|
9
9
|
const {
|
|
10
10
|
em: x,
|
|
11
11
|
be: g
|
|
12
|
-
} = U("editable-table"), F =
|
|
13
|
-
return
|
|
14
|
-
const d =
|
|
12
|
+
} = U("editable-table"), F = C(), [, h] = S();
|
|
13
|
+
return N(() => {
|
|
14
|
+
const d = t.columns;
|
|
15
15
|
if (!d)
|
|
16
16
|
return [];
|
|
17
17
|
function c(I) {
|
|
18
18
|
return I.map((e) => ({
|
|
19
19
|
...y(e, ["ellipsis"]),
|
|
20
20
|
children: c(e.children || []),
|
|
21
|
-
title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).
|
|
21
|
+
title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).colorTextTertiary),
|
|
22
22
|
customRender({
|
|
23
|
-
value:
|
|
23
|
+
value: l,
|
|
24
24
|
...n
|
|
25
25
|
}) {
|
|
26
26
|
const o = k(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
|
|
@@ -28,35 +28,35 @@ const M = (a, b) => {
|
|
|
28
28
|
return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
|
|
29
29
|
let r;
|
|
30
30
|
if (o) {
|
|
31
|
-
const
|
|
32
|
-
value:
|
|
31
|
+
const a = v(e, E(e.fieldProps, {
|
|
32
|
+
value: l,
|
|
33
33
|
...n
|
|
34
34
|
})), i = {};
|
|
35
|
-
|
|
35
|
+
t.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (T) => {
|
|
36
36
|
var s;
|
|
37
|
-
return (s =
|
|
37
|
+
return (s = t.onFieldChange) == null ? void 0 : s.call(t, n.index, e.dataIndex, T);
|
|
38
38
|
});
|
|
39
39
|
const R = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
|
|
40
40
|
r = {
|
|
41
|
-
name: [...f(
|
|
42
|
-
...
|
|
41
|
+
name: [...f(t.name) ? t.name : [t.name], n.index, ...R],
|
|
42
|
+
...a || {},
|
|
43
43
|
field: {
|
|
44
44
|
style: "width: 100%",
|
|
45
|
-
...(
|
|
45
|
+
...(a == null ? void 0 : a.field) || {},
|
|
46
46
|
...i,
|
|
47
|
-
class: A("is-editable",
|
|
47
|
+
class: A("is-editable", a.class)
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
} else
|
|
51
51
|
r = {
|
|
52
52
|
field: G(e, {
|
|
53
|
-
value:
|
|
53
|
+
value: l,
|
|
54
54
|
...n
|
|
55
55
|
})
|
|
56
56
|
};
|
|
57
|
-
const u = q(e, o, r,
|
|
57
|
+
const u = q(e, o, r, l, n.record, m(b));
|
|
58
58
|
return e.customRender ? e.customRender({
|
|
59
|
-
value:
|
|
59
|
+
value: l,
|
|
60
60
|
...n,
|
|
61
61
|
editable: o,
|
|
62
62
|
originalNode: u
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.15.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED