@aplus-frontend/ui 6.39.1 → 6.40.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/ag-grid/index.vue.mjs +138 -134
- package/es/src/ag-grid/interface.d.ts +7 -0
- package/es/src/ap-action/interface.d.ts +5 -1
- package/es/src/ap-action/item/index.vue2.mjs +17 -16
- package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
- package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +1 -9
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
- package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +23 -23
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +7 -0
- package/lib/src/ap-action/interface.d.ts +5 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +1 -9
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
- package/theme/ag-grid-modal/index.css +1 -0
- package/theme/ag-grid-modal/index.less +1 -0
- package/theme/index.css +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as i, useSlots as s, createBlock as
|
|
1
|
+
import { defineComponent as i, useSlots as s, createBlock as p, openBlock as c, mergeProps as m, unref as d, createSlots as f, renderList as u, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as P } from "vue";
|
|
2
2
|
import { Modal as B } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../item/index.vue.mjs";
|
|
4
4
|
import { omit as k } from "lodash-unified";
|
|
@@ -16,10 +16,11 @@ const z = /* @__PURE__ */ i({
|
|
|
16
16
|
loading: { type: Boolean, default: !1 },
|
|
17
17
|
icon: {},
|
|
18
18
|
iconFirst: { type: Boolean },
|
|
19
|
+
tooltip: {},
|
|
19
20
|
modalProps: { default: () => ({}) }
|
|
20
21
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const r = s(), o =
|
|
22
|
+
setup(n) {
|
|
23
|
+
const r = s(), o = n;
|
|
23
24
|
async function a(e) {
|
|
24
25
|
B.confirm({
|
|
25
26
|
...o.modalProps,
|
|
@@ -29,11 +30,11 @@ const z = /* @__PURE__ */ i({
|
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
return (e, g) => (
|
|
33
|
-
u(r, (h,
|
|
34
|
-
name:
|
|
33
|
+
return (e, g) => (c(), p(x, m(d(k)(o, ["modalProps", "onAction"]), { onAction: a }), f({ _: 2 }, [
|
|
34
|
+
u(r, (h, t) => ({
|
|
35
|
+
name: t,
|
|
35
36
|
fn: _((l) => [
|
|
36
|
-
y(e.$slots,
|
|
37
|
+
y(e.$slots, t, A(P(l || {})))
|
|
37
38
|
])
|
|
38
39
|
}))
|
|
39
40
|
]), 1040));
|
|
@@ -912,15 +912,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
|
|
|
912
912
|
type: PropType<string | number | Partial<Record< Breakpoint, string | number>>>;
|
|
913
913
|
default: string | number | Partial<Record< Breakpoint, string | number>>;
|
|
914
914
|
};
|
|
915
|
-
footer:
|
|
916
|
-
type: PropType< VueNode | ((params: {
|
|
917
|
-
originNode: VueNode;
|
|
918
|
-
extra: {
|
|
919
|
-
okBtn: VueNode;
|
|
920
|
-
cancelBtn: VueNode;
|
|
921
|
-
};
|
|
922
|
-
}) => VueNode)>;
|
|
923
|
-
};
|
|
915
|
+
footer: VueTypeValidableDef<any>;
|
|
924
916
|
okText: VueTypeValidableDef<any>;
|
|
925
917
|
okType: PropType<LegacyButtonType>;
|
|
926
918
|
cancelText: VueTypeValidableDef<any>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { AgGridPreviewModalProps, PreviewModalReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
2
3
|
/** ag-grid弹框 */
|
|
3
|
-
export declare function useAgGridModal<T = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType<T>;
|
|
4
|
+
export declare function useAgGridModal<T extends Recordable = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType<T>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApModal as
|
|
1
|
+
import { defineComponent as P, ref as v, createVNode as n, mergeProps as w } from "vue";
|
|
2
|
+
import { ApModal as y } from "../../../ap-modal/index.mjs";
|
|
3
3
|
import "../../../ag-grid/index.mjs";
|
|
4
|
-
import { genRequest as
|
|
5
|
-
import { useAgGridInstance as
|
|
6
|
-
import { isFunction as
|
|
4
|
+
import { genRequest as I } from "../utils.mjs";
|
|
5
|
+
import { useAgGridInstance as A } from "./use-ag-grid-instance.mjs";
|
|
6
|
+
import { isFunction as M, isEmpty as f, omitBy as _, isUndefined as q, omit as G } from "lodash-unified";
|
|
7
7
|
import "../wrapper/index.vue.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
8
|
+
import H from "../wrapper/index.vue2.mjs";
|
|
9
|
+
import x from "../../../ag-grid/index.vue.mjs";
|
|
10
|
+
function j(r) {
|
|
11
11
|
let a = null, s = null;
|
|
12
|
-
const [
|
|
12
|
+
const [o, c] = A(), l = I(r.api, r.getRowKey, o.setDataSourceLength), u = (t) => {
|
|
13
13
|
const {
|
|
14
14
|
title: e,
|
|
15
15
|
width: i,
|
|
16
16
|
modalProps: C,
|
|
17
17
|
...d
|
|
18
|
-
} =
|
|
18
|
+
} = M(t) ? t(r) : t;
|
|
19
19
|
f(d) || s?.(d);
|
|
20
|
-
const m =
|
|
20
|
+
const m = _({
|
|
21
21
|
title: e,
|
|
22
22
|
width: i,
|
|
23
23
|
modalProps: C
|
|
24
|
-
},
|
|
24
|
+
}, q);
|
|
25
25
|
f(m) || a?.update(m);
|
|
26
|
-
}, g = /* @__PURE__ */
|
|
26
|
+
}, g = /* @__PURE__ */ P({
|
|
27
27
|
name: "AgGridModalPreviewContent",
|
|
28
28
|
props: {
|
|
29
29
|
modalConfig: {
|
|
@@ -32,20 +32,20 @@ function L(o) {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
setup(t) {
|
|
35
|
-
const e =
|
|
35
|
+
const e = v(t.modalConfig);
|
|
36
36
|
return s = (i) => {
|
|
37
37
|
e.value = {
|
|
38
38
|
...e.value,
|
|
39
39
|
...i
|
|
40
40
|
};
|
|
41
41
|
}, () => n(c, null, {
|
|
42
|
-
default: () => [n(
|
|
42
|
+
default: () => [n(H, {
|
|
43
43
|
rowHeight: e.value.rowHeight
|
|
44
44
|
}, {
|
|
45
|
-
default: () => [e.value.renderHeader?.(
|
|
45
|
+
default: () => [e.value.renderHeader?.(G(o, "setInstance"), {
|
|
46
46
|
updateProps: u
|
|
47
|
-
}), n(
|
|
48
|
-
ref:
|
|
47
|
+
}), n(x, w({
|
|
48
|
+
ref: o.setInstance,
|
|
49
49
|
searchForm: {
|
|
50
50
|
sortable: !1,
|
|
51
51
|
resize: {
|
|
@@ -59,25 +59,25 @@ function L(o) {
|
|
|
59
59
|
},
|
|
60
60
|
rowHeight: e.value.rowHeight,
|
|
61
61
|
columns: e.value.columns
|
|
62
|
-
}, e.value.gridSlots)]
|
|
62
|
+
}, r.gridProps), e.value.gridSlots)]
|
|
63
63
|
})]
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
function p() {
|
|
68
|
-
a =
|
|
69
|
-
title:
|
|
70
|
-
width:
|
|
68
|
+
a = y.createModal({
|
|
69
|
+
title: r.title,
|
|
70
|
+
width: r.width,
|
|
71
71
|
destroyOnClose: !0,
|
|
72
72
|
maskClosable: !1,
|
|
73
73
|
footer: null,
|
|
74
74
|
afterOpenChange(t) {
|
|
75
|
-
t === !1 && (
|
|
75
|
+
t === !1 && (o.setInstance(void 0), o.setDataSourceLength(0), a = null);
|
|
76
76
|
},
|
|
77
77
|
content: n(g, {
|
|
78
|
-
modalConfig:
|
|
78
|
+
modalConfig: r
|
|
79
79
|
}, null),
|
|
80
|
-
...
|
|
80
|
+
...r.modalProps || {}
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
function h(t) {
|
|
@@ -85,11 +85,11 @@ function L(o) {
|
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
87
|
open: h,
|
|
88
|
-
refresh:
|
|
89
|
-
getAgGridInstance:
|
|
88
|
+
refresh: o.refresh,
|
|
89
|
+
getAgGridInstance: o.getInstance,
|
|
90
90
|
updateProps: u
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
j as useAgGridModal
|
|
95
95
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { AgGridSelectModalProps, SelectModalReturnType } from '../interface';
|
|
2
|
-
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
export declare function useAgGridSelectModal<T extends Recordable = any>(props: AgGridSelectModalProps<T>): SelectModalReturnType<T>;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as L, createVNode as i, mergeProps as j, onUnmounted as q } from "vue";
|
|
2
2
|
import { ApModal as G } from "../../../ap-modal/index.mjs";
|
|
3
3
|
import "../../../ag-grid/index.mjs";
|
|
4
|
-
import { AsyncCallback as H, genRequest as T, delRowKeyField as
|
|
5
|
-
import { useAgGridInstance as
|
|
6
|
-
import { isFunction as
|
|
7
|
-
import { ROW_KEY as
|
|
8
|
-
import { useModalTitle as
|
|
9
|
-
import { message as
|
|
4
|
+
import { AsyncCallback as H, genRequest as T, delRowKeyField as D, addRowKeyField as F, getModalLayoutConfig as E } from "../utils.mjs";
|
|
5
|
+
import { useAgGridInstance as U } from "./use-ag-grid-instance.mjs";
|
|
6
|
+
import { isFunction as u, cloneDeep as W, isEmpty as b, omitBy as $, isUndefined as z, omit as p } from "lodash-unified";
|
|
7
|
+
import { ROW_KEY as B } from "../constants.mjs";
|
|
8
|
+
import { useModalTitle as N } from "./use-modal-title.mjs";
|
|
9
|
+
import { message as V } from "@aplus-frontend/antdv";
|
|
10
10
|
import "../../../config-provider/index.mjs";
|
|
11
11
|
import "../modal-layout/index.vue.mjs";
|
|
12
12
|
import "../wrapper/index.vue.mjs";
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
t:
|
|
21
|
-
} =
|
|
13
|
+
import { useLocale as Y } from "../../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import J from "../wrapper/index.vue2.mjs";
|
|
15
|
+
import Q from "../modal-layout/index.vue2.mjs";
|
|
16
|
+
import X from "../../../ag-grid/index.vue.mjs";
|
|
17
|
+
function we(t) {
|
|
18
|
+
let c, f = null, g = null;
|
|
19
|
+
const d = new H(), [K, S] = N(), {
|
|
20
|
+
t: k
|
|
21
|
+
} = Y(), [s, x] = U({
|
|
22
22
|
onSelectedRows(e) {
|
|
23
|
-
|
|
23
|
+
S.setCount(e?.length || 0);
|
|
24
24
|
}
|
|
25
|
-
}),
|
|
25
|
+
}), w = T(t.api, t.getRowKey, s.setDataSourceLength), y = (e) => {
|
|
26
26
|
const {
|
|
27
|
-
title:
|
|
28
|
-
width:
|
|
29
|
-
modalProps:
|
|
30
|
-
...
|
|
31
|
-
} =
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
title:
|
|
35
|
-
width:
|
|
36
|
-
modalProps:
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
const e =
|
|
27
|
+
title: o,
|
|
28
|
+
width: l,
|
|
29
|
+
modalProps: n,
|
|
30
|
+
...a
|
|
31
|
+
} = u(e) ? e(W(t)) : e;
|
|
32
|
+
b(a) || g?.(a);
|
|
33
|
+
const r = $({
|
|
34
|
+
title: o,
|
|
35
|
+
width: l,
|
|
36
|
+
modalProps: n
|
|
37
|
+
}, z);
|
|
38
|
+
b(r) || f?.update(r);
|
|
39
|
+
}, m = u(t.getRowKey) ? t.getRowKey : (e) => e[t.getRowKey], P = () => {
|
|
40
|
+
const e = t.mergeRule || "old", o = s.getSelectedRows() || [];
|
|
41
41
|
return {
|
|
42
|
-
keys:
|
|
43
|
-
rows:
|
|
44
|
-
const
|
|
45
|
-
return e === "old" &&
|
|
42
|
+
keys: O(o),
|
|
43
|
+
rows: o.map((a) => {
|
|
44
|
+
const r = m(a);
|
|
45
|
+
return e === "old" && c?.[r] ? c[r] : D(a);
|
|
46
46
|
})
|
|
47
47
|
};
|
|
48
48
|
}, C = async () => {
|
|
49
|
-
const e =
|
|
50
|
-
return e.keys.length >
|
|
51
|
-
maxCount:
|
|
52
|
-
})), Promise.reject()) : (await
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
49
|
+
const e = P(), o = t.maxCount || 1 / 0;
|
|
50
|
+
return e.keys.length > o ? (V.warning(k("ap.apTableModal.messageMaxCount", {
|
|
51
|
+
maxCount: o
|
|
52
|
+
})), Promise.reject()) : (await t.beforeOk?.(e), t.finishCallback?.(e), d.resolve(e), e);
|
|
53
|
+
}, M = () => {
|
|
54
|
+
d.reject("modal is closed!");
|
|
55
|
+
}, I = /* @__PURE__ */ _({
|
|
56
56
|
name: "AgGridModalSelectContent",
|
|
57
57
|
props: {
|
|
58
58
|
modalConfig: {
|
|
@@ -65,45 +65,49 @@ function fe(o) {
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
setup(e) {
|
|
68
|
-
const
|
|
69
|
-
return g = (
|
|
70
|
-
|
|
68
|
+
const o = L(e.modalConfig);
|
|
69
|
+
return g = (l) => {
|
|
70
|
+
o.value = {
|
|
71
|
+
...o.value,
|
|
72
|
+
...l
|
|
73
|
+
};
|
|
71
74
|
}, () => {
|
|
72
|
-
const
|
|
73
|
-
return i(
|
|
74
|
-
default: () => [i(
|
|
75
|
-
rowHeight:
|
|
75
|
+
const l = e.selectedRows?.map((r) => F(r, o.value.getRowKey)), n = o.value, a = E(n.modalLayout);
|
|
76
|
+
return i(x, null, {
|
|
77
|
+
default: () => [i(J, {
|
|
78
|
+
rowHeight: n.rowHeight
|
|
76
79
|
}, {
|
|
77
|
-
default: () => [
|
|
78
|
-
updateProps:
|
|
79
|
-
}), i(
|
|
80
|
-
default: () => [i(
|
|
81
|
-
ref:
|
|
80
|
+
default: () => [t.renderHeader?.(p(s, "setInstance"), {
|
|
81
|
+
updateProps: y
|
|
82
|
+
}), i(Q, a.props, {
|
|
83
|
+
default: () => [i(X, j({
|
|
84
|
+
ref: s.setInstance,
|
|
82
85
|
searchForm: {
|
|
83
86
|
sortable: !1,
|
|
84
87
|
resize: {
|
|
85
88
|
target: "form"
|
|
86
89
|
}
|
|
87
90
|
},
|
|
88
|
-
rowKey:
|
|
89
|
-
request:
|
|
91
|
+
rowKey: u(n.getRowKey) ? B : n.getRowKey,
|
|
92
|
+
request: w.request,
|
|
90
93
|
style: {
|
|
91
94
|
padding: "0px"
|
|
92
95
|
},
|
|
93
|
-
rowHeight:
|
|
94
|
-
columns:
|
|
96
|
+
rowHeight: n.rowHeight,
|
|
97
|
+
columns: n.columns,
|
|
95
98
|
rowSelection: {
|
|
96
|
-
defaultSelectedRows:
|
|
99
|
+
defaultSelectedRows: l,
|
|
97
100
|
preserveSelectedRowKeys: !0,
|
|
98
|
-
type:
|
|
101
|
+
type: n.mode || "checkbox",
|
|
99
102
|
fixed: "left",
|
|
100
103
|
columnWidth: 38,
|
|
101
104
|
disabled(r) {
|
|
102
|
-
return
|
|
103
|
-
}
|
|
105
|
+
return u(n.disabledCheckbox) ? n.disabledCheckbox(r, p(s, "setInstance")) : n.disabledCheckbox ?? !1;
|
|
106
|
+
},
|
|
107
|
+
...t.rowSelection
|
|
104
108
|
}
|
|
105
|
-
}, t.gridSlots)],
|
|
106
|
-
...
|
|
109
|
+
}, t.gridProps), n.gridSlots)],
|
|
110
|
+
...a.slots
|
|
107
111
|
})]
|
|
108
112
|
})]
|
|
109
113
|
});
|
|
@@ -111,55 +115,55 @@ function fe(o) {
|
|
|
111
115
|
}
|
|
112
116
|
});
|
|
113
117
|
function R(e) {
|
|
114
|
-
return i(
|
|
115
|
-
modalConfig:
|
|
118
|
+
return i(I, {
|
|
119
|
+
modalConfig: t,
|
|
116
120
|
selectedRows: e
|
|
117
121
|
}, null);
|
|
118
122
|
}
|
|
119
123
|
function A() {
|
|
120
|
-
const e = Object.values(
|
|
124
|
+
const e = Object.values(c || {}), o = R(e);
|
|
121
125
|
f = G.createModal({
|
|
122
|
-
title: i(
|
|
123
|
-
title:
|
|
124
|
-
maxCount:
|
|
125
|
-
},
|
|
126
|
-
width:
|
|
126
|
+
title: i(K, {
|
|
127
|
+
title: t.title,
|
|
128
|
+
maxCount: t.maxCount || 1 / 0
|
|
129
|
+
}, t.modalTitleSlots),
|
|
130
|
+
width: t.width,
|
|
127
131
|
destroyOnClose: !0,
|
|
128
132
|
maskClosable: !1,
|
|
129
133
|
onOk: C,
|
|
130
|
-
onCancel:
|
|
131
|
-
afterOpenChange(
|
|
132
|
-
|
|
134
|
+
onCancel: M,
|
|
135
|
+
afterOpenChange(l) {
|
|
136
|
+
l === !1 && (s.setInstance(void 0), s.setDataSourceLength(0));
|
|
133
137
|
},
|
|
134
|
-
content:
|
|
135
|
-
...
|
|
138
|
+
content: o,
|
|
139
|
+
...t.modalProps || {}
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
|
-
function
|
|
139
|
-
return e?.map(
|
|
142
|
+
function O(e) {
|
|
143
|
+
return e?.map(m) || [];
|
|
140
144
|
}
|
|
141
|
-
function h(e,
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
return r
|
|
145
|
-
}, {}),
|
|
146
|
-
return
|
|
145
|
+
function h(e, o, l = !1) {
|
|
146
|
+
if (c = e?.reduce((n, a) => {
|
|
147
|
+
const r = m(a);
|
|
148
|
+
return n[r] = a, n;
|
|
149
|
+
}, {}), w.setExtraParams(o?.extraParams), A(), l)
|
|
150
|
+
return d.buildPromise();
|
|
147
151
|
}
|
|
148
|
-
function
|
|
149
|
-
return h(e,
|
|
152
|
+
function v(e, o) {
|
|
153
|
+
return h(e, o, !0);
|
|
150
154
|
}
|
|
151
|
-
return
|
|
152
|
-
|
|
155
|
+
return q(() => {
|
|
156
|
+
d.reject("component is Unmounted!");
|
|
153
157
|
}), {
|
|
154
158
|
open: h,
|
|
155
|
-
asyncOpen:
|
|
156
|
-
refresh:
|
|
157
|
-
getAgGridInstance:
|
|
159
|
+
asyncOpen: v,
|
|
160
|
+
refresh: s.refresh,
|
|
161
|
+
getAgGridInstance: s.getInstance,
|
|
158
162
|
genContent: R,
|
|
159
163
|
validate: C,
|
|
160
|
-
updateProps:
|
|
164
|
+
updateProps: y
|
|
161
165
|
};
|
|
162
166
|
}
|
|
163
167
|
export {
|
|
164
|
-
|
|
168
|
+
we as useAgGridSelectModal
|
|
165
169
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleValue, VNodeChild } from 'vue';
|
|
2
|
-
import { AgGridColumnType, AgGridExpose, AgGridProps, AgGridSlots } from '../../ag-grid';
|
|
2
|
+
import { AgGridColumnType, AgGridExpose, AgGridProps, AgGridRowSelection, AgGridSlots } from '../../ag-grid';
|
|
3
3
|
import { CreateModalFuncProps } from '../../ap-modal';
|
|
4
4
|
import { Recordable } from '../../type';
|
|
5
5
|
import { GridApi } from './hooks/use-ag-grid-instance';
|
|
@@ -26,6 +26,8 @@ export type RefreshType = 'reset' | 'submit' | 'submitWith';
|
|
|
26
26
|
export interface AgGridPreviewModalProps<RowType = any> extends AgGridModalBasicProps<RowType> {
|
|
27
27
|
/** ag-grid 插槽 */
|
|
28
28
|
gridSlots?: AgGridSlots<RowType>;
|
|
29
|
+
/** ag-grid 额外配置 */
|
|
30
|
+
gridProps?: Omit<AgGridProps<RowType>, 'rowHeight' | 'rowKey'>;
|
|
29
31
|
}
|
|
30
32
|
/** 只读模式返回值 */
|
|
31
33
|
export interface PreviewModalReturnType<RowType = any> {
|
|
@@ -67,13 +69,15 @@ export interface AgGridSelectModalProps<RowType = any> extends AgGridModalBasicP
|
|
|
67
69
|
/** 禁用选项 */
|
|
68
70
|
disabledCheckbox?: boolean | ((record: RowType, actions: Omit<GridApi, 'setInstance'>) => boolean);
|
|
69
71
|
/** 额外的rowSelection配置 */
|
|
70
|
-
rowSelection?: Omit<
|
|
72
|
+
rowSelection?: Omit<AgGridRowSelection<RowType>, 'disabled'>;
|
|
71
73
|
/** modal标题插槽 */
|
|
72
74
|
modalTitleSlots?: ModalTitleSlots;
|
|
73
75
|
/** 在finishCallback执行前执行,返回reject终止后续执行 */
|
|
74
76
|
beforeOk?: (data: OpenReturnType<RowType>) => Promise<any> | void;
|
|
75
77
|
/** 设置是否是复杂布局 */
|
|
76
78
|
modalLayout?: ModalLayoutConfig<RowType>;
|
|
79
|
+
/** ag-grid 额外配置 */
|
|
80
|
+
gridProps?: Omit<AgGridProps<RowType>, 'rowHeight' | 'rowSelection' | 'rowKey'>;
|
|
77
81
|
}
|
|
78
82
|
export interface SelectModalReturnType<T = any> {
|
|
79
83
|
/** 打开弹框 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as E, ref as d, unref as r, computed as G, h as H, createBlock as
|
|
2
|
-
import { message as R, Modal as
|
|
1
|
+
import { defineComponent as E, ref as d, unref as r, computed as G, h as H, createBlock as w, openBlock as g, mergeProps as m, withCtx as k, createCommentVNode as U, createVNode as h, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import { message as R, Modal as V } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApTable as
|
|
5
|
-
import { cloneDeep as
|
|
4
|
+
import { ApTable as $ } from "../../ap-table/index.mjs";
|
|
5
|
+
import { cloneDeep as j, omit as T } from "lodash-unified";
|
|
6
6
|
import { transformTableParams as z } from "@aplus-frontend/utils";
|
|
7
7
|
import "./modal-title.vue.mjs";
|
|
8
8
|
import { AsyncOpenResultError as y } from "./interface.mjs";
|
|
@@ -38,7 +38,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
38
38
|
afterOpenChange: {},
|
|
39
39
|
centered: { type: Boolean, default: void 0 },
|
|
40
40
|
width: {},
|
|
41
|
-
footer: {
|
|
41
|
+
footer: {},
|
|
42
42
|
okText: {},
|
|
43
43
|
okType: {},
|
|
44
44
|
cancelText: {},
|
|
@@ -65,10 +65,10 @@ const ue = /* @__PURE__ */ E({
|
|
|
65
65
|
},
|
|
66
66
|
emits: ["finish"],
|
|
67
67
|
setup(S, { expose: B, emit: P }) {
|
|
68
|
-
const e = S, M = P, s = d(!1), v = d({}), i = d(null), a = d([]),
|
|
68
|
+
const e = S, M = P, s = d(!1), v = d({}), i = d(null), a = d([]), C = d();
|
|
69
69
|
let f = null, u = null;
|
|
70
|
-
const { t:
|
|
71
|
-
switch (a.value = [...t], s.value = !0, v.value = o?.extraParams,
|
|
70
|
+
const { t: b } = W(), K = async (t = [], o = {}) => {
|
|
71
|
+
switch (a.value = [...t], s.value = !0, v.value = o?.extraParams, C.value = o.apTableDataSources || e.apTableProps?.dataSource, o.refreshMode || "reset") {
|
|
72
72
|
case "reset":
|
|
73
73
|
i.value?.reset();
|
|
74
74
|
break;
|
|
@@ -99,7 +99,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
if (e.getRowKey) {
|
|
102
|
-
const t =
|
|
102
|
+
const t = j(r(a)), o = t.map(e.getRowKey);
|
|
103
103
|
if (e.onOk && await e.onOk({
|
|
104
104
|
keys: o,
|
|
105
105
|
rows: t
|
|
@@ -122,7 +122,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
122
122
|
onSelectAll(o, n) {
|
|
123
123
|
if (n.length > e.maxCount) {
|
|
124
124
|
R.warning(
|
|
125
|
-
|
|
125
|
+
b("ap.apTableModal.messageMaxCount", {
|
|
126
126
|
maxCount: e.maxCount
|
|
127
127
|
})
|
|
128
128
|
);
|
|
@@ -130,7 +130,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
130
130
|
}
|
|
131
131
|
const l = i.value?.dataSource;
|
|
132
132
|
if (o) {
|
|
133
|
-
const c = r(l).filter((p) => !a.value.some((
|
|
133
|
+
const c = r(l).filter((p) => !a.value.some((F) => t(F) === t(p)));
|
|
134
134
|
a.value = a.value.concat(c);
|
|
135
135
|
} else
|
|
136
136
|
a.value = a.value?.filter((c) => !l.some((p) => t(p) === t(c)));
|
|
@@ -139,7 +139,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
139
139
|
if (n) {
|
|
140
140
|
if (a.value.length >= e.maxCount) {
|
|
141
141
|
R.warning(
|
|
142
|
-
|
|
142
|
+
b("ap.apTableModal.messageMaxCount", {
|
|
143
143
|
maxCount: e.maxCount
|
|
144
144
|
})
|
|
145
145
|
);
|
|
@@ -159,7 +159,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
159
159
|
}),
|
|
160
160
|
...e.rowSelection || {}
|
|
161
161
|
};
|
|
162
|
-
}),
|
|
162
|
+
}), D = () => e.isRenderModalTitleSuffix ? H(
|
|
163
163
|
J,
|
|
164
164
|
{
|
|
165
165
|
title: e.title,
|
|
@@ -169,9 +169,9 @@ const ue = /* @__PURE__ */ E({
|
|
|
169
169
|
{
|
|
170
170
|
default: e.renderModalTitleSuffix ?? void 0
|
|
171
171
|
}
|
|
172
|
-
) : e.title,
|
|
172
|
+
) : e.title, L = () => i.value, N = () => {
|
|
173
173
|
a.value = [];
|
|
174
|
-
},
|
|
174
|
+
}, A = (t) => {
|
|
175
175
|
const o = e.getRowKey;
|
|
176
176
|
if (!o) return;
|
|
177
177
|
const n = a.value.findIndex(
|
|
@@ -182,8 +182,8 @@ const ue = /* @__PURE__ */ E({
|
|
|
182
182
|
return B({
|
|
183
183
|
open: K,
|
|
184
184
|
close: x,
|
|
185
|
-
getApTableInstance:
|
|
186
|
-
}), (t, o) => (
|
|
185
|
+
getApTableInstance: L
|
|
186
|
+
}), (t, o) => (g(), w(r(V), m(
|
|
187
187
|
{
|
|
188
188
|
open: s.value,
|
|
189
189
|
"onUpdate:open": o[0] || (o[0] = (n) => s.value = n)
|
|
@@ -203,21 +203,21 @@ const ue = /* @__PURE__ */ E({
|
|
|
203
203
|
"tableLayoutConfig"
|
|
204
204
|
]),
|
|
205
205
|
{
|
|
206
|
-
title:
|
|
206
|
+
title: D(),
|
|
207
207
|
centered: e.centered ?? !0,
|
|
208
208
|
onOk: _,
|
|
209
209
|
onCancel: x
|
|
210
210
|
}
|
|
211
211
|
), {
|
|
212
212
|
default: k(() => [
|
|
213
|
-
e.renderHeader ? (
|
|
213
|
+
e.renderHeader ? (g(), w(q(e.renderHeader), { key: 0 })) : U("", !0),
|
|
214
214
|
h(Q, m(e.tableLayoutConfig || {}, {
|
|
215
215
|
"selected-list": a.value,
|
|
216
|
-
onClear:
|
|
217
|
-
onDeleteItem:
|
|
216
|
+
onClear: N,
|
|
217
|
+
onDeleteItem: A
|
|
218
218
|
}), {
|
|
219
219
|
default: k(() => [
|
|
220
|
-
h(r(
|
|
220
|
+
h(r($), m({
|
|
221
221
|
ref_key: "apTableRef",
|
|
222
222
|
ref: i,
|
|
223
223
|
scroll: { y: 450 },
|
|
@@ -226,7 +226,7 @@ const ue = /* @__PURE__ */ E({
|
|
|
226
226
|
request: O,
|
|
227
227
|
"row-key": t.getRowKey,
|
|
228
228
|
"row-selection": I.value,
|
|
229
|
-
"data-source":
|
|
229
|
+
"data-source": C.value,
|
|
230
230
|
"search-form": {
|
|
231
231
|
sortable: !1,
|
|
232
232
|
countPerRow: 2
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.40.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED