@aplus-frontend/ui 0.1.37 → 0.1.38
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/business/ap-select-layout/interface.d.ts +1 -0
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +66 -62
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +41 -24
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +12 -11
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +11 -10
- package/es/src/business/ap-table-modal/index.d.ts +21 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +31 -30
- package/es/src/business/index.d.ts +1 -0
- package/lib/src/business/ap-select-layout/interface.d.ts +1 -0
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +21 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
1
|
+
import { defineComponent as M, ref as r, computed as O, onMounted as U, openBlock as p, createElementBlock as f, normalizeClass as o, unref as e, createVNode as d, Transition as W, withCtx as u, withDirectives as E, createElementVNode as s, toDisplayString as $, createTextVNode as x, Fragment as z, renderList as R, renderSlot as A, vShow as N, createCommentVNode as j } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { IconApLeftarrow as G, IconApMenu as H } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -12,127 +12,131 @@ const X = ["onClick"], de = /* @__PURE__ */ M({
|
|
|
12
12
|
props: {
|
|
13
13
|
title: {},
|
|
14
14
|
request: {},
|
|
15
|
+
onSearch: {},
|
|
15
16
|
defaultFold: { type: Boolean, default: !1 }
|
|
16
17
|
},
|
|
17
18
|
emits: ["onSelect", "afterEnter", "afterLeave"],
|
|
18
19
|
setup(_, { emit: w }) {
|
|
19
|
-
const { b: m, be:
|
|
20
|
-
|
|
20
|
+
const { b: m, be: h, bem: i } = P("ap-select-layout"), a = _, y = w, C = r(), v = r(a.defaultFold), g = r(!a.defaultFold), S = r(), T = r(), b = r(), k = r(""), L = () => {
|
|
21
|
+
v.value = !v.value, S.value = !1, T.value = !1;
|
|
21
22
|
}, F = (t) => {
|
|
22
|
-
b.value = t,
|
|
23
|
+
b.value = t, y("onSelect", t);
|
|
23
24
|
}, B = K((t) => {
|
|
24
|
-
var
|
|
25
|
-
k.value = (
|
|
25
|
+
var n;
|
|
26
|
+
k.value = (n = t.target) == null ? void 0 : n.value;
|
|
26
27
|
}, 500), q = O(() => {
|
|
27
28
|
var t;
|
|
28
|
-
return (t =
|
|
29
|
+
return (t = C.value) == null ? void 0 : t.filter((n) => {
|
|
30
|
+
var c, l;
|
|
31
|
+
return a != null && a.onSearch ? (c = a.onSearch) == null ? void 0 : c.call(a, n, k.value) : (l = n == null ? void 0 : n.name) == null ? void 0 : l.includes(k.value);
|
|
32
|
+
});
|
|
29
33
|
}), D = (t) => {
|
|
30
|
-
|
|
34
|
+
g.value = !0, y("afterEnter", t);
|
|
31
35
|
}, I = (t) => {
|
|
32
|
-
|
|
36
|
+
g.value = !1, y("afterLeave", t);
|
|
33
37
|
};
|
|
34
38
|
return U(() => {
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
39
|
+
a.request().then((t) => {
|
|
40
|
+
var n;
|
|
41
|
+
C.value = t, F((n = C.value) == null ? void 0 : n[0]);
|
|
38
42
|
});
|
|
39
|
-
}), (t,
|
|
40
|
-
var
|
|
41
|
-
return p(),
|
|
42
|
-
class:
|
|
43
|
+
}), (t, n) => {
|
|
44
|
+
var c;
|
|
45
|
+
return p(), f("div", {
|
|
46
|
+
class: o(e(m)())
|
|
43
47
|
}, [
|
|
44
|
-
|
|
48
|
+
d(W, {
|
|
45
49
|
mode: "out-in",
|
|
46
50
|
onAfterEnter: D,
|
|
47
51
|
onAfterLeave: I
|
|
48
52
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
|
|
51
|
-
class:
|
|
53
|
+
default: u(() => [
|
|
54
|
+
E(s("div", {
|
|
55
|
+
class: o(e(m)("side"))
|
|
52
56
|
}, [
|
|
53
|
-
|
|
54
|
-
class:
|
|
57
|
+
s("div", {
|
|
58
|
+
class: o(e(h)("side", "header"))
|
|
55
59
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class:
|
|
60
|
+
s("h3", null, $(a.title), 1),
|
|
61
|
+
s("div", {
|
|
62
|
+
class: o(e(i)("side", "header", "imgWrap"))
|
|
59
63
|
}, [
|
|
60
|
-
|
|
61
|
-
open:
|
|
62
|
-
"onUpdate:open":
|
|
64
|
+
d(e(V), {
|
|
65
|
+
open: S.value,
|
|
66
|
+
"onUpdate:open": n[0] || (n[0] = (l) => S.value = l)
|
|
63
67
|
}, {
|
|
64
|
-
title:
|
|
68
|
+
title: u(() => [
|
|
65
69
|
x("收起")
|
|
66
70
|
]),
|
|
67
|
-
default:
|
|
68
|
-
|
|
71
|
+
default: u(() => [
|
|
72
|
+
d(e(G), { onClick: L })
|
|
69
73
|
]),
|
|
70
74
|
_: 1
|
|
71
75
|
}, 8, ["open"])
|
|
72
76
|
], 2)
|
|
73
77
|
], 2),
|
|
74
|
-
|
|
75
|
-
class:
|
|
78
|
+
s("div", {
|
|
79
|
+
class: o(e(h)("side", "body"))
|
|
76
80
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
81
|
+
s("div", {
|
|
82
|
+
class: o(e(i)("side", "body", "search"))
|
|
79
83
|
}, [
|
|
80
|
-
|
|
84
|
+
d(e(Q), {
|
|
81
85
|
placeholder: "请输入",
|
|
82
86
|
onChange: e(B)
|
|
83
87
|
}, null, 8, ["onChange"])
|
|
84
88
|
], 2),
|
|
85
|
-
|
|
86
|
-
class:
|
|
89
|
+
s("div", {
|
|
90
|
+
class: o(e(i)("side", "body", "scroll"))
|
|
87
91
|
}, [
|
|
88
|
-
(p(!0),
|
|
89
|
-
key:
|
|
90
|
-
class:
|
|
91
|
-
onClick: (Y) => F(
|
|
92
|
+
(p(!0), f(z, null, R(q.value, (l) => E((p(), f("div", {
|
|
93
|
+
key: l.value,
|
|
94
|
+
class: o(`${e(i)("side", "body", "scroll-item")} ${b.value === l ? "active" : ""}`),
|
|
95
|
+
onClick: (Y) => F(l)
|
|
92
96
|
}, [
|
|
93
|
-
A(t.$slots, "itemRender", { item:
|
|
94
|
-
|
|
95
|
-
ellipsis: { tooltip:
|
|
96
|
-
content: `${
|
|
97
|
+
A(t.$slots, "itemRender", { item: l }, () => [
|
|
98
|
+
d(e(J), {
|
|
99
|
+
ellipsis: { tooltip: l.name },
|
|
100
|
+
content: `${l.name}`
|
|
97
101
|
}, null, 8, ["ellipsis", "content"])
|
|
98
102
|
])
|
|
99
103
|
], 10, X)), [
|
|
100
|
-
[N,
|
|
104
|
+
[N, g.value]
|
|
101
105
|
])), 128))
|
|
102
106
|
], 2)
|
|
103
107
|
], 2)
|
|
104
108
|
], 2), [
|
|
105
|
-
[N, !
|
|
109
|
+
[N, !v.value]
|
|
106
110
|
])
|
|
107
111
|
]),
|
|
108
112
|
_: 3
|
|
109
113
|
}),
|
|
110
|
-
|
|
111
|
-
class:
|
|
114
|
+
s("div", {
|
|
115
|
+
class: o(e(m)("content"))
|
|
112
116
|
}, [
|
|
113
|
-
|
|
114
|
-
class:
|
|
117
|
+
s("div", {
|
|
118
|
+
class: o(e(h)("content", "header"))
|
|
115
119
|
}, [
|
|
116
|
-
|
|
120
|
+
v.value ? (p(), f("div", {
|
|
117
121
|
key: 0,
|
|
118
|
-
class:
|
|
122
|
+
class: o(e(i)("content", "header", "imgWrap"))
|
|
119
123
|
}, [
|
|
120
|
-
|
|
124
|
+
d(e(V), {
|
|
121
125
|
open: T.value,
|
|
122
|
-
"onUpdate:open":
|
|
126
|
+
"onUpdate:open": n[1] || (n[1] = (l) => T.value = l)
|
|
123
127
|
}, {
|
|
124
|
-
title:
|
|
128
|
+
title: u(() => [
|
|
125
129
|
x("展开")
|
|
126
130
|
]),
|
|
127
|
-
default:
|
|
128
|
-
|
|
131
|
+
default: u(() => [
|
|
132
|
+
d(e(H), { onClick: L })
|
|
129
133
|
]),
|
|
130
134
|
_: 1
|
|
131
135
|
}, 8, ["open"])
|
|
132
136
|
], 2)) : j("", !0),
|
|
133
|
-
|
|
134
|
-
class:
|
|
135
|
-
}, $((
|
|
137
|
+
s("div", {
|
|
138
|
+
class: o(e(i)("content", "header", "title"))
|
|
139
|
+
}, $((c = b.value) == null ? void 0 : c.name), 3)
|
|
136
140
|
], 2),
|
|
137
141
|
A(t.$slots, "default")
|
|
138
142
|
], 2)
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
3
5
|
readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
|
|
4
6
|
readonly closeModal: () => void;
|
|
5
7
|
readonly destroy: () => void;
|
|
8
|
+
readonly reloadApTableData: () => void;
|
|
9
|
+
readonly resetApTableData: () => void;
|
|
10
|
+
readonly getApTableInstance: () => {
|
|
11
|
+
submit: () => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
15
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
16
|
+
dataSource: any;
|
|
17
|
+
rowSelection?: {
|
|
18
|
+
select: (item: any) => void;
|
|
19
|
+
selectAll: () => void;
|
|
20
|
+
unSelectAll: () => void;
|
|
21
|
+
selectedRows: any[];
|
|
22
|
+
unSelect: (item: any) => void;
|
|
23
|
+
isSelected: (item: any) => boolean;
|
|
24
|
+
clearAll: () => void;
|
|
25
|
+
toggleSelect: (item: any) => void;
|
|
26
|
+
} | undefined;
|
|
27
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
28
|
+
} | null | undefined;
|
|
6
29
|
readonly isDestroyed: true;
|
|
7
30
|
};
|
|
@@ -1,40 +1,57 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as T, defineComponent as g, h as r, render as u, onUnmounted as C } from "vue";
|
|
2
2
|
import "../table-modal.vue.mjs";
|
|
3
3
|
import "../../../index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { ConfigProvider as
|
|
6
|
-
import
|
|
7
|
-
function E(
|
|
8
|
-
let
|
|
9
|
-
const
|
|
10
|
-
const e =
|
|
4
|
+
import { omit as y } from "lodash-unified";
|
|
5
|
+
import { ConfigProvider as A, globalConfigCached as h } from "../../../config-provider/config-provider.mjs";
|
|
6
|
+
import I from "../table-modal.vue2.mjs";
|
|
7
|
+
function E(l) {
|
|
8
|
+
let n = !0;
|
|
9
|
+
const s = document.body, t = T(), { destroyOnUnmounted: i = !0 } = l, a = document.createElement("div"), m = () => {
|
|
10
|
+
const e = g({
|
|
11
11
|
setup() {
|
|
12
12
|
return () => r(
|
|
13
|
-
|
|
14
|
-
{ ...
|
|
15
|
-
r(
|
|
16
|
-
...
|
|
13
|
+
A,
|
|
14
|
+
{ ...h.value },
|
|
15
|
+
r(I, {
|
|
16
|
+
...y(l, "destroyOnUnmounted"),
|
|
17
17
|
ref: t
|
|
18
18
|
})
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
},
|
|
22
|
+
s.appendChild(a), u(r(e), a), n = !1;
|
|
23
|
+
}, c = () => {
|
|
24
24
|
var e;
|
|
25
|
-
(e = t.value) == null || e.close(),
|
|
26
|
-
|
|
25
|
+
(e = t.value) == null || e.close(), n || setTimeout(() => {
|
|
26
|
+
u(null, a), s.removeChild(a), n = !0;
|
|
27
27
|
}, 400);
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
return t.value ||
|
|
31
|
-
},
|
|
28
|
+
}, f = async (e = [], o = {}) => {
|
|
29
|
+
var d;
|
|
30
|
+
return t.value || m(), (d = t.value) == null ? void 0 : d.open(e, o);
|
|
31
|
+
}, p = () => {
|
|
32
32
|
var e;
|
|
33
|
-
|
|
33
|
+
n || (e = t.value) == null || e.close();
|
|
34
|
+
}, v = () => {
|
|
35
|
+
var e, o;
|
|
36
|
+
(o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.submit();
|
|
37
|
+
}, b = () => {
|
|
38
|
+
var e, o;
|
|
39
|
+
(o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.reset();
|
|
40
|
+
};
|
|
41
|
+
return C(() => {
|
|
42
|
+
i && c();
|
|
43
|
+
}), {
|
|
44
|
+
openModal: f,
|
|
45
|
+
closeModal: p,
|
|
46
|
+
destroy: c,
|
|
47
|
+
reloadApTableData: v,
|
|
48
|
+
resetApTableData: b,
|
|
49
|
+
getApTableInstance: () => {
|
|
50
|
+
var e;
|
|
51
|
+
return (e = t.value) == null ? void 0 : e.getApTableInstance();
|
|
52
|
+
},
|
|
53
|
+
isDestroyed: n
|
|
34
54
|
};
|
|
35
|
-
return y(() => {
|
|
36
|
-
s && l();
|
|
37
|
-
}), { openModal: c, closeModal: f, destroy: l, isDestroyed: o };
|
|
38
55
|
}
|
|
39
56
|
export {
|
|
40
57
|
E as useCreateTableModal
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { ApTableModalProps, OpenOptions } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
/** 函数式调用弹框表格 */
|
|
3
5
|
export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
|
|
6
|
+
reloadApTableData: () => void;
|
|
7
|
+
resetApTableData: () => void;
|
|
8
|
+
getApTableInstance: () => {
|
|
9
|
+
submit: () => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
refresh: () => void;
|
|
12
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
13
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
14
|
+
dataSource: any;
|
|
15
|
+
rowSelection?: {
|
|
16
|
+
select: (item: any) => void;
|
|
17
|
+
selectAll: () => void;
|
|
18
|
+
unSelectAll: () => void;
|
|
19
|
+
selectedRows: any[];
|
|
20
|
+
unSelect: (item: any) => void;
|
|
21
|
+
isSelected: (item: any) => boolean;
|
|
22
|
+
clearAll: () => void;
|
|
23
|
+
toggleSelect: (item: any) => void;
|
|
24
|
+
} | undefined;
|
|
25
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
26
|
+
} | null | undefined;
|
|
27
|
+
isDestroyed: true;
|
|
4
28
|
open: (options?: OpenOptions) => Promise<void>;
|
|
5
29
|
destroy: () => void;
|
|
6
30
|
close: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { onUnmounted as
|
|
2
|
-
import { merge as
|
|
3
|
-
import { useCreateTableModal as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { onUnmounted as p } from "vue";
|
|
2
|
+
import { merge as f } from "lodash-unified";
|
|
3
|
+
import { useCreateTableModal as u } from "./use-create-table-modal.mjs";
|
|
4
|
+
function T(t) {
|
|
5
|
+
const l = f(t, {
|
|
6
6
|
...{
|
|
7
7
|
footer: null
|
|
8
8
|
},
|
|
@@ -11,19 +11,20 @@ function P(l) {
|
|
|
11
11
|
},
|
|
12
12
|
destroyOnUnmounted: !1,
|
|
13
13
|
isRenderModalTitleSuffix: !1
|
|
14
|
-
}), { destroy: o, openModal: r, closeModal: s } =
|
|
15
|
-
r([],
|
|
14
|
+
}), { destroy: o, openModal: r, closeModal: s, ...a } = u(l), n = async (d) => {
|
|
15
|
+
r([], d);
|
|
16
16
|
}, e = () => {
|
|
17
17
|
s();
|
|
18
18
|
};
|
|
19
|
-
return
|
|
19
|
+
return p(() => {
|
|
20
20
|
e(), o();
|
|
21
21
|
}), {
|
|
22
|
-
open:
|
|
22
|
+
open: n,
|
|
23
23
|
destroy: o,
|
|
24
|
-
close: e
|
|
24
|
+
close: e,
|
|
25
|
+
...a
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
T as useTableModal
|
|
29
30
|
};
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { OpenOptions, UseTableSelectModalProps, OpenReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
export declare function useTableSelectModal<TableRowType = Record<string, any>>(props: UseTableSelectModalProps<TableRowType>): {
|
|
5
|
+
reloadApTableData: () => void;
|
|
6
|
+
resetApTableData: () => void;
|
|
7
|
+
getApTableInstance: () => {
|
|
8
|
+
submit: () => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
refresh: () => void;
|
|
11
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
12
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
13
|
+
dataSource: any;
|
|
14
|
+
rowSelection?: {
|
|
15
|
+
select: (item: any) => void;
|
|
16
|
+
selectAll: () => void;
|
|
17
|
+
unSelectAll: () => void;
|
|
18
|
+
selectedRows: any[];
|
|
19
|
+
unSelect: (item: any) => void;
|
|
20
|
+
isSelected: (item: any) => boolean;
|
|
21
|
+
clearAll: () => void;
|
|
22
|
+
toggleSelect: (item: any) => void;
|
|
23
|
+
} | undefined;
|
|
24
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
25
|
+
} | null | undefined;
|
|
26
|
+
isDestroyed: true;
|
|
3
27
|
open: (selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<TableRowType>>;
|
|
4
28
|
destroy: () => void;
|
|
5
29
|
close: () => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { onUnmounted as m } from "vue";
|
|
2
|
-
import { useCreateTableModal as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { finishCallback: o, getRowKey: r, ...a } = e, { destroy: t, openModal: c, closeModal: d } =
|
|
2
|
+
import { useCreateTableModal as w } from "./use-create-table-modal.mjs";
|
|
3
|
+
const f = (e) => e.id;
|
|
4
|
+
function K(e) {
|
|
5
|
+
const { finishCallback: o, getRowKey: r, ...a } = e, { destroy: t, openModal: c, closeModal: d, ...l } = w({
|
|
6
6
|
...a,
|
|
7
7
|
destroyOnUnmounted: !1,
|
|
8
|
-
getRowKey: r ||
|
|
9
|
-
}),
|
|
10
|
-
const s = await c(
|
|
8
|
+
getRowKey: r || f
|
|
9
|
+
}), u = async (p = [], y = {}) => {
|
|
10
|
+
const s = await c(p, y) || {
|
|
11
11
|
keys: [],
|
|
12
12
|
rows: []
|
|
13
13
|
};
|
|
@@ -18,11 +18,12 @@ function i(e) {
|
|
|
18
18
|
return m(() => {
|
|
19
19
|
n(), t();
|
|
20
20
|
}), {
|
|
21
|
-
open:
|
|
21
|
+
open: u,
|
|
22
22
|
destroy: t,
|
|
23
|
-
close: n
|
|
23
|
+
close: n,
|
|
24
|
+
...l
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
K as useTableSelectModal
|
|
28
29
|
};
|
|
@@ -8,6 +8,8 @@ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
|
8
8
|
import { MouseEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
9
9
|
import { VueNode } from 'ant-design-vue/es/_util/type';
|
|
10
10
|
import { OpenOptions, OpenReturnType } from './interface';
|
|
11
|
+
import { Recordable } from '../../type';
|
|
12
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
11
13
|
/**
|
|
12
14
|
*
|
|
13
15
|
*/
|
|
@@ -263,6 +265,25 @@ declare const ApTableModal: DefineComponent<{
|
|
|
263
265
|
}, {
|
|
264
266
|
open: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T>>;
|
|
265
267
|
close: () => void;
|
|
268
|
+
getApTableInstance: () => {
|
|
269
|
+
submit: () => void;
|
|
270
|
+
reset: () => void;
|
|
271
|
+
refresh: () => void;
|
|
272
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
273
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
274
|
+
dataSource: any;
|
|
275
|
+
rowSelection?: {
|
|
276
|
+
select: (item: any) => void;
|
|
277
|
+
selectAll: () => void;
|
|
278
|
+
unSelectAll: () => void;
|
|
279
|
+
selectedRows: any[];
|
|
280
|
+
unSelect: (item: any) => void;
|
|
281
|
+
isSelected: (item: any) => boolean;
|
|
282
|
+
clearAll: () => void;
|
|
283
|
+
toggleSelect: (item: any) => void;
|
|
284
|
+
} | undefined;
|
|
285
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
286
|
+
} | null;
|
|
266
287
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
267
288
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => void;
|
|
268
289
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { OpenOptions, OpenReturnType, ApTableModalProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { Recordable } from '../../type';
|
|
4
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
3
5
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApTableModalProps<any>>, {
|
|
4
6
|
confirmLoading: undefined;
|
|
5
7
|
closable: undefined;
|
|
@@ -20,6 +22,25 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOpti
|
|
|
20
22
|
}>, {
|
|
21
23
|
open: <T>(selected?: any[], options?: OpenOptions) => Promise<OpenReturnType<T>>;
|
|
22
24
|
close: () => void;
|
|
25
|
+
getApTableInstance: () => {
|
|
26
|
+
submit: () => void;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
refresh: () => void;
|
|
29
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
30
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
31
|
+
dataSource: any;
|
|
32
|
+
rowSelection?: {
|
|
33
|
+
select: (item: any) => void;
|
|
34
|
+
selectAll: () => void;
|
|
35
|
+
unSelectAll: () => void;
|
|
36
|
+
selectedRows: any[];
|
|
37
|
+
unSelect: (item: any) => void;
|
|
38
|
+
isSelected: (item: any) => boolean;
|
|
39
|
+
clearAll: () => void;
|
|
40
|
+
toggleSelect: (item: any) => void;
|
|
41
|
+
} | undefined;
|
|
42
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
43
|
+
} | null;
|
|
23
44
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
24
45
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => void;
|
|
25
46
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApTableModalProps<any>>, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
1
|
+
import { defineComponent as I, ref as i, unref as r, computed as N, h as O, openBlock as A, createBlock as D, mergeProps as g, withCtx as E, createVNode as L } from "vue";
|
|
2
|
+
import { message as U, Modal as q } from "ant-design-vue";
|
|
3
3
|
import "../../index.mjs";
|
|
4
|
-
import { cloneDeep as F, omit as
|
|
4
|
+
import { cloneDeep as F, omit as x } from "lodash-unified";
|
|
5
5
|
import { transformTableParams as G } from "@aplus-frontend/utils";
|
|
6
6
|
import "./modal-title.vue.mjs";
|
|
7
7
|
import { AsyncOpenResultError as f } from "./interface.mjs";
|
|
@@ -9,7 +9,7 @@ import { useGlobalConfig as $ } from "../../config-provider/hooks/use-global-con
|
|
|
9
9
|
import { useLocale as z } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
10
|
import V from "./modal-title.vue2.mjs";
|
|
11
11
|
import W from "../../ap-table/ap-table.vue.mjs";
|
|
12
|
-
const le = /* @__PURE__ */
|
|
12
|
+
const le = /* @__PURE__ */ I({
|
|
13
13
|
__name: "table-modal",
|
|
14
14
|
props: {
|
|
15
15
|
columns: {},
|
|
@@ -56,17 +56,17 @@ const le = /* @__PURE__ */ N({
|
|
|
56
56
|
mousePosition: {}
|
|
57
57
|
},
|
|
58
58
|
emits: ["finish"],
|
|
59
|
-
setup(
|
|
60
|
-
const e =
|
|
59
|
+
setup(b, { expose: C, emit: w }) {
|
|
60
|
+
const e = b, T = w, s = i(!1), m = i({}), d = i(null), n = i([]), p = i();
|
|
61
61
|
let u = null, a = null;
|
|
62
62
|
const k = $("uiMode", "admin"), { t: B } = z(), S = async (t = [], o = {}) => {
|
|
63
|
-
var
|
|
64
|
-
switch (
|
|
63
|
+
var l, c, v;
|
|
64
|
+
switch (n.value = [...t], s.value = !0, m.value = o == null ? void 0 : o.extraParams, p.value = o.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), o.refreshMode || "reset") {
|
|
65
65
|
case "reset":
|
|
66
|
-
(
|
|
66
|
+
(c = d.value) == null || c.reset();
|
|
67
67
|
break;
|
|
68
68
|
case "submit":
|
|
69
|
-
(v =
|
|
69
|
+
(v = d.value) == null || v.submit();
|
|
70
70
|
break;
|
|
71
71
|
case "none":
|
|
72
72
|
break;
|
|
@@ -81,63 +81,64 @@ const le = /* @__PURE__ */ N({
|
|
|
81
81
|
...t,
|
|
82
82
|
...m.value
|
|
83
83
|
});
|
|
84
|
-
const o = e.api, { records:
|
|
84
|
+
const o = e.api, { records: l, total: c } = await o(t);
|
|
85
85
|
return {
|
|
86
|
-
data:
|
|
87
|
-
total:
|
|
86
|
+
data: l,
|
|
87
|
+
total: c
|
|
88
88
|
};
|
|
89
89
|
}, M = () => {
|
|
90
|
-
if (
|
|
90
|
+
if (n.value.length > e.maxCount) {
|
|
91
91
|
a == null || a(f.ExceedMaxCount);
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
if (e.getRowKey) {
|
|
95
|
-
const t = F(r(
|
|
95
|
+
const t = F(r(n)), o = t.map(e.getRowKey);
|
|
96
96
|
T("finish", o, t), u == null || u({ keys: o, rows: t });
|
|
97
97
|
} else {
|
|
98
98
|
a == null || a(f.NotFineGetRowKey);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
s.value = !1;
|
|
102
|
-
}, P =
|
|
102
|
+
}, P = N(() => {
|
|
103
103
|
if (e.getRowKey)
|
|
104
104
|
return {
|
|
105
105
|
fixed: !0,
|
|
106
|
-
selectedRowKeys:
|
|
106
|
+
selectedRowKeys: n.value.map(e.getRowKey),
|
|
107
107
|
columnWidth: 50,
|
|
108
108
|
preserveSelectedRowKeys: !0,
|
|
109
109
|
onChange: (t, o) => {
|
|
110
110
|
if (o.length > e.maxCount) {
|
|
111
|
-
|
|
111
|
+
U.warning(
|
|
112
112
|
B("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
|
|
113
113
|
);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
n.value = o;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
}), R = () => e.isRenderModalTitleSuffix ?
|
|
119
|
+
}), R = () => e.isRenderModalTitleSuffix ? O(
|
|
120
120
|
V,
|
|
121
121
|
{
|
|
122
122
|
title: e.title,
|
|
123
|
-
count:
|
|
123
|
+
count: n.value.length || 0,
|
|
124
124
|
maxCount: e.maxCount
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
default: e.renderModalTitleSuffix ?? void 0
|
|
128
128
|
}
|
|
129
129
|
) : e.title;
|
|
130
|
-
return
|
|
130
|
+
return C({
|
|
131
131
|
open: S,
|
|
132
|
-
close: y
|
|
133
|
-
|
|
132
|
+
close: y,
|
|
133
|
+
getApTableInstance: () => d.value
|
|
134
|
+
}), (t, o) => (A(), D(r(q), g(
|
|
134
135
|
{
|
|
135
136
|
onOk: M,
|
|
136
137
|
onCancel: y,
|
|
137
138
|
open: s.value,
|
|
138
|
-
"onUpdate:open": o[0] || (o[0] = (
|
|
139
|
+
"onUpdate:open": o[0] || (o[0] = (l) => s.value = l)
|
|
139
140
|
},
|
|
140
|
-
r(
|
|
141
|
+
r(x)(e, [
|
|
141
142
|
"api",
|
|
142
143
|
"getRowKey",
|
|
143
144
|
"centered",
|
|
@@ -153,8 +154,8 @@ const le = /* @__PURE__ */ N({
|
|
|
153
154
|
centered: e.centered ?? !0
|
|
154
155
|
}
|
|
155
156
|
), {
|
|
156
|
-
default:
|
|
157
|
-
|
|
157
|
+
default: E(() => [
|
|
158
|
+
L(r(W), g({
|
|
158
159
|
scroll: { y: "100%" },
|
|
159
160
|
style: { padding: "0px" },
|
|
160
161
|
columns: t.columns,
|
|
@@ -162,9 +163,9 @@ const le = /* @__PURE__ */ N({
|
|
|
162
163
|
"row-key": t.getRowKey,
|
|
163
164
|
"row-selection": P.value,
|
|
164
165
|
bordered: r(k) === "admin"
|
|
165
|
-
}, r(
|
|
166
|
+
}, r(x)(e.apTableProps, "dataSource"), {
|
|
166
167
|
ref_key: "apTableRef",
|
|
167
|
-
ref:
|
|
168
|
+
ref: d,
|
|
168
169
|
"data-source": p.value
|
|
169
170
|
}), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
|
|
170
171
|
]),
|
|
@@ -797,6 +797,7 @@ export declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonN
|
|
|
797
797
|
onOnSelect?: ((value: T) => any) | undefined;
|
|
798
798
|
title: string;
|
|
799
799
|
request: () => Promise<T[]>;
|
|
800
|
+
onSearch?: ((item: T, val: string) => boolean) | undefined;
|
|
800
801
|
defaultFold?: boolean | undefined;
|
|
801
802
|
} & PublicProps;
|
|
802
803
|
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../ap-field/index.js");const E=require("@aplus-frontend/icon");require("../../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../ap-field/index.js");const E=require("@aplus-frontend/icon");require("../../config-provider/index.js");const C=require("ant-design-vue"),q=require("lodash-unified");require("./index.css");const b=require("../../config-provider/hooks/use-namespace.js"),w=require("../../ap-field/text/index.js"),x=["onClick"],B=e.defineComponent({__name:"select-layout",props:{title:{},request:{},onSearch:{},defaultFold:{type:Boolean,default:!1}},emits:["onSelect","afterEnter","afterLeave"],setup(k,{emit:y}){const{b:c,be:u,bem:o}=b.useNamespace("ap-select-layout"),a=k,i=y,d=e.ref(),s=e.ref(a.defaultFold),f=e.ref(!a.defaultFold),v=e.ref(),m=e.ref(),p=e.ref(),h=e.ref(""),N=()=>{s.value=!s.value,v.value=!1,m.value=!1},V=t=>{p.value=t,i("onSelect",t)},S=q.debounce(t=>{var n;h.value=(n=t.target)==null?void 0:n.value},500),g=e.computed(()=>{var t;return(t=d.value)==null?void 0:t.filter(n=>{var r,l;return a!=null&&a.onSearch?(r=a.onSearch)==null?void 0:r.call(a,n,h.value):(l=n==null?void 0:n.name)==null?void 0:l.includes(h.value)})}),z=t=>{f.value=!0,i("afterEnter",t)},T=t=>{f.value=!1,i("afterLeave",t)};return e.onMounted(()=>{a.request().then(t=>{var n;d.value=t,V((n=d.value)==null?void 0:n[0])})}),(t,n)=>{var r;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(c)())},[e.createVNode(e.Transition,{mode:"out-in",onAfterEnter:z,onAfterLeave:T},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("side"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("side","header"))},[e.createElementVNode("h3",null,e.toDisplayString(a.title),1),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("side","header","imgWrap"))},[e.createVNode(e.unref(C.Tooltip),{open:v.value,"onUpdate:open":n[0]||(n[0]=l=>v.value=l)},{title:e.withCtx(()=>[e.createTextVNode("收起")]),default:e.withCtx(()=>[e.createVNode(e.unref(E.IconApLeftarrow),{onClick:N})]),_:1},8,["open"])],2)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("side","body"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("side","body","search"))},[e.createVNode(e.unref(w.ApFieldText),{placeholder:"请输入",onChange:e.unref(S)},null,8,["onChange"])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("side","body","scroll"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:l.value,class:e.normalizeClass(`${e.unref(o)("side","body","scroll-item")} ${p.value===l?"active":""}`),onClick:L=>V(l)},[e.renderSlot(t.$slots,"itemRender",{item:l},()=>[e.createVNode(e.unref(C.TypographyText),{ellipsis:{tooltip:l.name},content:`${l.name}`},null,8,["ellipsis","content"])])],10,x)),[[e.vShow,f.value]])),128))],2)],2)],2),[[e.vShow,!s.value]])]),_:3}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("content"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("content","header"))},[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o)("content","header","imgWrap"))},[e.createVNode(e.unref(C.Tooltip),{open:m.value,"onUpdate:open":n[1]||(n[1]=l=>m.value=l)},{title:e.withCtx(()=>[e.createTextVNode("展开")]),default:e.withCtx(()=>[e.createVNode(e.unref(E.IconApMenu),{onClick:N})]),_:1},8,["open"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("content","header","title"))},e.toDisplayString((r=p.value)==null?void 0:r.name),3)],2),e.renderSlot(t.$slots,"default")],2)],2)}}});exports.default=B;
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
3
5
|
readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
|
|
4
6
|
readonly closeModal: () => void;
|
|
5
7
|
readonly destroy: () => void;
|
|
8
|
+
readonly reloadApTableData: () => void;
|
|
9
|
+
readonly resetApTableData: () => void;
|
|
10
|
+
readonly getApTableInstance: () => {
|
|
11
|
+
submit: () => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
15
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
16
|
+
dataSource: any;
|
|
17
|
+
rowSelection?: {
|
|
18
|
+
select: (item: any) => void;
|
|
19
|
+
selectAll: () => void;
|
|
20
|
+
unSelectAll: () => void;
|
|
21
|
+
selectedRows: any[];
|
|
22
|
+
unSelect: (item: any) => void;
|
|
23
|
+
isSelected: (item: any) => boolean;
|
|
24
|
+
clearAll: () => void;
|
|
25
|
+
toggleSelect: (item: any) => void;
|
|
26
|
+
} | undefined;
|
|
27
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
28
|
+
} | null | undefined;
|
|
6
29
|
readonly isDestroyed: true;
|
|
7
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue");require("../table-modal.vue.js");require("../../../index.js");const g=require("lodash-unified"),c=require("../../../config-provider/config-provider.js"),T=require("../table-modal.vue2.js");function y(l){let r=!0;const u=document.body,t=n.ref(),{destroyOnUnmounted:i=!0}=l,a=document.createElement("div"),v=()=>{const e=n.defineComponent({setup(){return()=>n.h(c.ConfigProvider,{...c.globalConfigCached.value},n.h(T.default,{...g.omit(l,"destroyOnUnmounted"),ref:t}))}});u.appendChild(a),n.render(n.h(e),a),r=!1},s=()=>{var e;(e=t.value)==null||e.close(),r||setTimeout(()=>{n.render(null,a),u.removeChild(a),r=!0},400)},f=async(e=[],o={})=>{var d;return t.value||v(),(d=t.value)==null?void 0:d.open(e,o)},b=()=>{var e;r||(e=t.value)==null||e.close()},m=()=>{var e,o;(o=(e=t.value)==null?void 0:e.getApTableInstance())==null||o.submit()},p=()=>{var e,o;(o=(e=t.value)==null?void 0:e.getApTableInstance())==null||o.reset()};return n.onUnmounted(()=>{i&&s()}),{openModal:f,closeModal:b,destroy:s,reloadApTableData:m,resetApTableData:p,getApTableInstance:()=>{var e;return(e=t.value)==null?void 0:e.getApTableInstance()},isDestroyed:r}}exports.useCreateTableModal=y;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { ApTableModalProps, OpenOptions } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
/** 函数式调用弹框表格 */
|
|
3
5
|
export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
|
|
6
|
+
reloadApTableData: () => void;
|
|
7
|
+
resetApTableData: () => void;
|
|
8
|
+
getApTableInstance: () => {
|
|
9
|
+
submit: () => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
refresh: () => void;
|
|
12
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
13
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
14
|
+
dataSource: any;
|
|
15
|
+
rowSelection?: {
|
|
16
|
+
select: (item: any) => void;
|
|
17
|
+
selectAll: () => void;
|
|
18
|
+
unSelectAll: () => void;
|
|
19
|
+
selectedRows: any[];
|
|
20
|
+
unSelect: (item: any) => void;
|
|
21
|
+
isSelected: (item: any) => boolean;
|
|
22
|
+
clearAll: () => void;
|
|
23
|
+
toggleSelect: (item: any) => void;
|
|
24
|
+
} | undefined;
|
|
25
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
26
|
+
} | null | undefined;
|
|
27
|
+
isDestroyed: true;
|
|
4
28
|
open: (options?: OpenOptions) => Promise<void>;
|
|
5
29
|
destroy: () => void;
|
|
6
30
|
close: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),f=require("lodash-unified"),p=require("./use-create-table-modal.js");function M(t){const l={rowSelection:void 0},s={footer:null},n=f.merge(t,{...s,apTableProps:l,destroyOnUnmounted:!1,isRenderModalTitleSuffix:!1}),{destroy:e,openModal:r,closeModal:a,...d}=p.useCreateTableModal(n),u=async c=>{r([],c)},o=()=>{a()};return i.onUnmounted(()=>{o(),e()}),{open:u,destroy:e,close:o,...d}}exports.useTableModal=M;
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { OpenOptions, UseTableSelectModalProps, OpenReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
export declare function useTableSelectModal<TableRowType = Record<string, any>>(props: UseTableSelectModalProps<TableRowType>): {
|
|
5
|
+
reloadApTableData: () => void;
|
|
6
|
+
resetApTableData: () => void;
|
|
7
|
+
getApTableInstance: () => {
|
|
8
|
+
submit: () => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
refresh: () => void;
|
|
11
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
12
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
13
|
+
dataSource: any;
|
|
14
|
+
rowSelection?: {
|
|
15
|
+
select: (item: any) => void;
|
|
16
|
+
selectAll: () => void;
|
|
17
|
+
unSelectAll: () => void;
|
|
18
|
+
selectedRows: any[];
|
|
19
|
+
unSelect: (item: any) => void;
|
|
20
|
+
isSelected: (item: any) => boolean;
|
|
21
|
+
clearAll: () => void;
|
|
22
|
+
toggleSelect: (item: any) => void;
|
|
23
|
+
} | undefined;
|
|
24
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
25
|
+
} | null | undefined;
|
|
26
|
+
isDestroyed: true;
|
|
3
27
|
open: (selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<TableRowType>>;
|
|
4
28
|
destroy: () => void;
|
|
5
29
|
close: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("vue"),b=require("./use-create-table-modal.js"),p=e=>e.id;function w(e){const{finishCallback:o,getRowKey:r,...a}=e,{destroy:t,openModal:l,closeModal:c,...u}=b.useCreateTableModal({...a,destroyOnUnmounted:!1,getRowKey:r||p}),d=async(y=[],i={})=>{const n=await l(y,i)||{keys:[],rows:[]};return o==null||o(n),n},s=()=>{c()};return M.onUnmounted(()=>{s(),t()}),{open:d,destroy:t,close:s,...u}}exports.useTableSelectModal=w;
|
|
@@ -8,6 +8,8 @@ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
|
8
8
|
import { MouseEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
9
9
|
import { VueNode } from 'ant-design-vue/es/_util/type';
|
|
10
10
|
import { OpenOptions, OpenReturnType } from './interface';
|
|
11
|
+
import { Recordable } from '../../type';
|
|
12
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
11
13
|
/**
|
|
12
14
|
*
|
|
13
15
|
*/
|
|
@@ -263,6 +265,25 @@ declare const ApTableModal: DefineComponent<{
|
|
|
263
265
|
}, {
|
|
264
266
|
open: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T>>;
|
|
265
267
|
close: () => void;
|
|
268
|
+
getApTableInstance: () => {
|
|
269
|
+
submit: () => void;
|
|
270
|
+
reset: () => void;
|
|
271
|
+
refresh: () => void;
|
|
272
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
273
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
274
|
+
dataSource: any;
|
|
275
|
+
rowSelection?: {
|
|
276
|
+
select: (item: any) => void;
|
|
277
|
+
selectAll: () => void;
|
|
278
|
+
unSelectAll: () => void;
|
|
279
|
+
selectedRows: any[];
|
|
280
|
+
unSelect: (item: any) => void;
|
|
281
|
+
isSelected: (item: any) => boolean;
|
|
282
|
+
clearAll: () => void;
|
|
283
|
+
toggleSelect: (item: any) => void;
|
|
284
|
+
} | undefined;
|
|
285
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
286
|
+
} | null;
|
|
266
287
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
267
288
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => void;
|
|
268
289
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { OpenOptions, OpenReturnType, ApTableModalProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { Recordable } from '../../type';
|
|
4
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
3
5
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApTableModalProps<any>>, {
|
|
4
6
|
confirmLoading: undefined;
|
|
5
7
|
closable: undefined;
|
|
@@ -20,6 +22,25 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOpti
|
|
|
20
22
|
}>, {
|
|
21
23
|
open: <T>(selected?: any[], options?: OpenOptions) => Promise<OpenReturnType<T>>;
|
|
22
24
|
close: () => void;
|
|
25
|
+
getApTableInstance: () => {
|
|
26
|
+
submit: () => void;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
refresh: () => void;
|
|
29
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
30
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
31
|
+
dataSource: any;
|
|
32
|
+
rowSelection?: {
|
|
33
|
+
select: (item: any) => void;
|
|
34
|
+
selectAll: () => void;
|
|
35
|
+
unSelectAll: () => void;
|
|
36
|
+
selectedRows: any[];
|
|
37
|
+
unSelect: (item: any) => void;
|
|
38
|
+
isSelected: (item: any) => boolean;
|
|
39
|
+
clearAll: () => void;
|
|
40
|
+
toggleSelect: (item: any) => void;
|
|
41
|
+
} | undefined;
|
|
42
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
43
|
+
} | null;
|
|
23
44
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
24
45
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => void;
|
|
25
46
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApTableModalProps<any>>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("ant-design-vue");require("../../index.js");const c=require("lodash-unified"),q=require("@aplus-frontend/utils");require("./modal-title.vue.js");const f=require("./interface.js"),K=require("../../config-provider/hooks/use-global-config.js"),O=require("../../config-provider/hooks/use-locale.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("ant-design-vue");require("../../index.js");const c=require("lodash-unified"),q=require("@aplus-frontend/utils");require("./modal-title.vue.js");const f=require("./interface.js"),K=require("../../config-provider/hooks/use-global-config.js"),O=require("../../config-provider/hooks/use-locale.js"),A=require("./modal-title.vue2.js"),E=require("../../ap-table/ap-table.vue.js"),I=e.defineComponent({__name:"table-modal",props:{columns:{},getRowKey:{},api:{type:Function,default:async()=>({records:[],total:0})},apTableProps:{},maxCount:{default:1/0},isRenderModalTitleSuffix:{type:Boolean,default:!0},renderModalTitleSuffix:{},prefixCls:{},confirmLoading:{type:Boolean,default:void 0},title:{},closable:{type:Boolean,default:void 0},closeIcon:{},onCancel:{},"onUpdate:visible":{},"onUpdate:open":{},onChange:{},afterClose:{},centered:{type:Boolean,default:void 0},width:{},footer:{},okText:{},okType:{},cancelText:{},icon:{},maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:{},cancelButtonProps:{},destroyOnClose:{type:Boolean,default:void 0},wrapClassName:{},maskTransitionName:{},transitionName:{},getContainer:{type:[String,Boolean,Function],default:void 0},zIndex:{},bodyStyle:{},maskStyle:{},mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:{},focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:{},mousePosition:{}},emits:["finish"],setup(b,{expose:x,emit:C}){const t=b,T=C,u=e.ref(!1),p=e.ref({}),i=e.ref(null),r=e.ref([]),m=e.ref();let s=null,n=null;const w=K.useGlobalConfig("uiMode","admin"),{t:_}=O.useLocale(),k=async(a=[],o={})=>{var l,d,y;switch(r.value=[...a],u.value=!0,p.value=o==null?void 0:o.extraParams,m.value=o.apTableDataSources||((l=t.apTableProps)==null?void 0:l.dataSource),o.refreshMode||"reset"){case"reset":(d=i.value)==null||d.reset();break;case"submit":(y=i.value)==null||y.submit();break;case"none":break}return new Promise((h,R)=>{s=h,n=R})},v=()=>{u.value=!1,s=null,n==null||n(f.AsyncOpenResultError.ModalCancel),n=null},S=async a=>{a=q.transformTableParams({...a,...p.value});const o=t.api,{records:l,total:d}=await o(a);return{data:l,total:d}},B=()=>{if(r.value.length>t.maxCount){n==null||n(f.AsyncOpenResultError.ExceedMaxCount);return}if(t.getRowKey){const a=c.cloneDeep(e.unref(r)),o=a.map(t.getRowKey);T("finish",o,a),s==null||s({keys:o,rows:a})}else{n==null||n(f.AsyncOpenResultError.NotFineGetRowKey);return}u.value=!1},M=e.computed(()=>{if(t.getRowKey)return{fixed:!0,selectedRowKeys:r.value.map(t.getRowKey),columnWidth:50,preserveSelectedRowKeys:!0,onChange:(a,o)=>{if(o.length>t.maxCount){g.message.warning(_("ap.apTableModal.messageMaxCount",{maxCount:t.maxCount}));return}r.value=o}}}),P=()=>t.isRenderModalTitleSuffix?e.h(A.default,{title:t.title,count:r.value.length||0,maxCount:t.maxCount},{default:t.renderModalTitleSuffix??void 0}):t.title;return x({open:k,close:v,getApTableInstance:()=>i.value}),(a,o)=>(e.openBlock(),e.createBlock(e.unref(g.Modal),e.mergeProps({onOk:B,onCancel:v,open:u.value,"onUpdate:open":o[0]||(o[0]=l=>u.value=l)},e.unref(c.omit)(t,["api","getRowKey","centered","apTableProps","onOk","maxCount","title","renderModalTitleSuffix","isRenderModalTitleSuffix"]),{title:P(),centered:t.centered??!0}),{default:e.withCtx(()=>[e.createVNode(e.unref(E.default),e.mergeProps({scroll:{y:"100%"},style:{padding:"0px"},columns:a.columns,request:S,"row-key":a.getRowKey,"row-selection":M.value,bordered:e.unref(w)==="admin"},e.unref(c.omit)(t.apTableProps,"dataSource"),{ref_key:"apTableRef",ref:i,"data-source":m.value}),null,16,["columns","row-key","row-selection","bordered","data-source"])]),_:1},16,["open","title","centered"]))}});exports.default=I;
|
|
@@ -797,6 +797,7 @@ export declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonN
|
|
|
797
797
|
onOnSelect?: ((value: T) => any) | undefined;
|
|
798
798
|
title: string;
|
|
799
799
|
request: () => Promise<T[]>;
|
|
800
|
+
onSearch?: ((item: T, val: string) => boolean) | undefined;
|
|
800
801
|
defaultFold?: boolean | undefined;
|
|
801
802
|
} & PublicProps;
|
|
802
803
|
expose(exposed: ShallowUnwrapRef<{}>): void;
|