@aplus-frontend/ui 7.19.7 → 7.20.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/editable/form-item.vue.mjs +113 -93
- package/es/src/ag-grid/editable/index.vue.mjs +91 -79
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
- package/es/src/ag-grid/index.vue.mjs +124 -120
- package/es/src/ag-grid/interface.d.ts +6 -0
- package/es/src/ap-button/ap-button.vue.mjs +23 -23
- package/es/src/ap-button/interface.d.ts +1 -1
- package/es/src/ap-button/utils/index.d.ts +1 -1
- package/es/src/ap-button/utils/index.mjs +7 -7
- package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/es/src/business/ag-grid-modal/constants.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +51 -41
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +33 -30
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +71 -68
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -2
- package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/es/src/business/ag-grid-modal/utils.mjs +34 -30
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -23
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +6 -0
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/interface.d.ts +1 -1
- package/lib/src/ap-button/utils/index.d.ts +1 -1
- package/lib/src/ap-button/utils/index.js +1 -1
- package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/constants.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- 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.js +1 -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 +4 -2
- package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -3,36 +3,36 @@ import { omit as a } from "lodash-unified";
|
|
|
3
3
|
function f(o) {
|
|
4
4
|
return typeof o == "object" && typeof o.then == "function" ? o : !1;
|
|
5
5
|
}
|
|
6
|
-
const m = (o) => typeof o == "function" && f(o?.()), h = (o,
|
|
6
|
+
const m = (o, n) => typeof o == "function" && f(o?.(n)), h = (o, n = "0.7") => {
|
|
7
7
|
try {
|
|
8
8
|
let t = o?.toLowerCase();
|
|
9
9
|
if (t && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) {
|
|
10
10
|
if (t.length === 4) {
|
|
11
11
|
let e = "#";
|
|
12
|
-
for (let
|
|
13
|
-
e += t.slice(
|
|
12
|
+
for (let c = 1; c < 4; c += 1)
|
|
13
|
+
e += t.slice(c, c + 1).concat(t.slice(c, c + 1));
|
|
14
14
|
t = e;
|
|
15
15
|
}
|
|
16
16
|
const r = [];
|
|
17
17
|
for (let e = 1; e < 7; e += 2)
|
|
18
18
|
r.push(parseInt("0x" + t.slice(e, e + 2)));
|
|
19
|
-
return "rgba(" + r.join(",") + "," +
|
|
19
|
+
return "rgba(" + r.join(",") + "," + n + ")";
|
|
20
20
|
}
|
|
21
21
|
if (t && t.startsWith("rgb")) {
|
|
22
22
|
let r = t.match(/(\d(\.\d+)?)+/g);
|
|
23
|
-
return r = r?.slice(0, 3)?.concat(
|
|
23
|
+
return r = r?.slice(0, 3)?.concat(n), "rgba(" + r.join(",") + ")";
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
} catch {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
}, p = (o) => {
|
|
30
|
-
const { onOk:
|
|
30
|
+
const { onOk: n = () => ({}) } = o;
|
|
31
31
|
return new Promise((t, s) => {
|
|
32
32
|
i.confirm({
|
|
33
33
|
onOk: async () => {
|
|
34
34
|
try {
|
|
35
|
-
await
|
|
35
|
+
await n(), t(!0);
|
|
36
36
|
} catch (r) {
|
|
37
37
|
s(r);
|
|
38
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridApi as AgGridApi } from 'ag-grid-community';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
3
|
import { AgGridExpose } from '../../../ag-grid';
|
|
3
4
|
import { RefreshType } from '../interface';
|
|
4
5
|
interface Options {
|
|
@@ -22,10 +23,13 @@ export interface GridApi {
|
|
|
22
23
|
removeSelected: (record: any) => void;
|
|
23
24
|
/** 设置表格数据length */
|
|
24
25
|
setDataSourceLength: (len: number) => void;
|
|
26
|
+
/** 获取表格高度 */
|
|
27
|
+
onAgGridUpdate(api: AgGridApi<any> | undefined): void;
|
|
25
28
|
}
|
|
26
29
|
interface GridApiProvider extends GridApi {
|
|
27
30
|
selectedRows?: ComputedRef<any[]>;
|
|
28
|
-
dataSourceLength?:
|
|
31
|
+
dataSourceLength?: Readonly<Ref<number>>;
|
|
32
|
+
agGridBodyHeight?: Readonly<Ref<number>>;
|
|
29
33
|
}
|
|
30
34
|
export declare function useAgGridInstance(options?: Options): [GridApi, any];
|
|
31
35
|
/** 获取上下文中grid的api */
|
|
@@ -1,50 +1,60 @@
|
|
|
1
|
-
import { cloneDeep as
|
|
2
|
-
import { ref as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { cloneDeep as I } from "lodash-unified";
|
|
2
|
+
import { ref as c, watch as g, defineComponent as D, provide as H, toRef as l, inject as x } from "vue";
|
|
3
|
+
const v = /* @__PURE__ */ Symbol("ag-grid-provider-key");
|
|
4
|
+
function _(s) {
|
|
5
|
+
const o = c(), r = c(), a = c(0), d = c(0), w = (e) => {
|
|
6
|
+
o.value = e;
|
|
7
|
+
}, S = (e) => {
|
|
8
|
+
a.value = e;
|
|
9
|
+
}, f = () => o.value, h = (e = "reset") => {
|
|
10
|
+
o.value && e in o.value && o.value[e]();
|
|
11
|
+
}, R = (e) => {
|
|
12
|
+
o.value?.rowSelection.setSelectedRowKeys(e);
|
|
13
|
+
}, p = () => I(o.value?.rowSelection.selectedRows.value), A = () => o.value?.rowSelection.clearAll(), y = (e) => o.value?.rowSelection.unSelectRows([e]), G = (e) => {
|
|
14
|
+
if (!e) return;
|
|
15
|
+
const t = e.getDisplayedRowCount();
|
|
16
|
+
if (console.log("onAgGridUpdate", t), t > 0) {
|
|
17
|
+
const n = e.getDisplayedRowAtIndex(t - 1);
|
|
18
|
+
if (n && n.rowTop && n.rowHeight) {
|
|
19
|
+
const u = n.rowTop + n.rowHeight;
|
|
20
|
+
console.log("height", u), d.value = u;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
g(o, (e) => {
|
|
25
|
+
e && s?.onMounted?.();
|
|
26
|
+
}), g(
|
|
27
|
+
() => o.value?.rowSelection.selectedRows.value,
|
|
18
28
|
(e) => {
|
|
19
|
-
|
|
29
|
+
r.value = e, s?.onSelectedRows?.(e);
|
|
20
30
|
}
|
|
21
31
|
);
|
|
22
|
-
const
|
|
23
|
-
setInstance:
|
|
24
|
-
refresh:
|
|
25
|
-
getInstance:
|
|
26
|
-
setSelectedRowKeys:
|
|
27
|
-
getSelectedRows:
|
|
28
|
-
clearAllSelected:
|
|
29
|
-
removeSelected:
|
|
30
|
-
setDataSourceLength:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)
|
|
39
|
-
}), () =>
|
|
32
|
+
const i = {
|
|
33
|
+
setInstance: w,
|
|
34
|
+
refresh: h,
|
|
35
|
+
getInstance: f,
|
|
36
|
+
setSelectedRowKeys: R,
|
|
37
|
+
getSelectedRows: p,
|
|
38
|
+
clearAllSelected: A,
|
|
39
|
+
removeSelected: y,
|
|
40
|
+
setDataSourceLength: S,
|
|
41
|
+
onAgGridUpdate: G
|
|
42
|
+
}, m = D({
|
|
43
|
+
setup(e, { slots: t }) {
|
|
44
|
+
return H(v, {
|
|
45
|
+
...i,
|
|
46
|
+
selectedRows: l(() => r.value),
|
|
47
|
+
dataSourceLength: l(() => a.value),
|
|
48
|
+
agGridBodyHeight: l(() => d.value)
|
|
49
|
+
}), () => t.default?.();
|
|
40
50
|
}
|
|
41
51
|
});
|
|
42
|
-
return [
|
|
52
|
+
return [i, m];
|
|
43
53
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
54
|
+
function j() {
|
|
55
|
+
return x(v);
|
|
46
56
|
}
|
|
47
57
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
_ as useAgGridInstance,
|
|
59
|
+
j as useAgGridModalInject
|
|
50
60
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as C, ref as P, createVNode as n, mergeProps as
|
|
2
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as C, ref as P, createVNode as n, mergeProps as H } from "vue";
|
|
2
|
+
import { isFunction as w, isEmpty as g, omitBy as y, isUndefined as A, omit as I } from "lodash-unified";
|
|
3
3
|
import "../../../ag-grid/index.mjs";
|
|
4
4
|
import { ApModal as M } from "../../../ap-modal/index.mjs";
|
|
5
|
-
import { genRequest as
|
|
5
|
+
import { genRequest as x } from "../utils.mjs";
|
|
6
6
|
import "../wrapper/index.vue.mjs";
|
|
7
|
-
import { useAgGridInstance as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
7
|
+
import { useAgGridInstance as G } from "./use-ag-grid-instance.mjs";
|
|
8
|
+
import _ from "../wrapper/index.vue2.mjs";
|
|
9
|
+
import q from "../../../ag-grid/index.vue.mjs";
|
|
10
|
+
function L(o) {
|
|
11
11
|
let a = null, l = null;
|
|
12
|
-
const [
|
|
12
|
+
const [r, f] = G(), s = x(o.api, o.getRowKey, r.setDataSourceLength), u = (t) => {
|
|
13
13
|
const {
|
|
14
14
|
title: e,
|
|
15
15
|
width: i,
|
|
16
16
|
modalProps: v,
|
|
17
17
|
...d
|
|
18
|
-
} =
|
|
19
|
-
|
|
20
|
-
const m =
|
|
18
|
+
} = w(t) ? t(o) : t;
|
|
19
|
+
g(d) || l?.(d);
|
|
20
|
+
const m = y({
|
|
21
21
|
title: e,
|
|
22
22
|
width: i,
|
|
23
23
|
modalProps: v
|
|
24
24
|
}, A);
|
|
25
|
-
|
|
26
|
-
},
|
|
25
|
+
g(m) || a?.update(m);
|
|
26
|
+
}, c = /* @__PURE__ */ C({
|
|
27
27
|
name: "AgGridModalPreviewContent",
|
|
28
28
|
props: {
|
|
29
29
|
modalConfig: {
|
|
@@ -38,15 +38,17 @@ function j(r) {
|
|
|
38
38
|
...e.value,
|
|
39
39
|
...i
|
|
40
40
|
};
|
|
41
|
-
}, () => n(
|
|
42
|
-
default: () => [n(
|
|
41
|
+
}, () => n(f, null, {
|
|
42
|
+
default: () => [n(_, {
|
|
43
43
|
height: e.value.height,
|
|
44
|
-
rowHeight: e.value.rowHeight
|
|
44
|
+
rowHeight: e.value.rowHeight,
|
|
45
|
+
minHeight: e.value.minHeight,
|
|
46
|
+
maxHeight: e.value.maxHeight
|
|
45
47
|
}, {
|
|
46
|
-
default: () => [e.value.renderHeader?.(
|
|
48
|
+
default: () => [e.value.renderHeader?.(I(r, "setInstance"), {
|
|
47
49
|
updateProps: u
|
|
48
|
-
}), n(
|
|
49
|
-
ref:
|
|
50
|
+
}), n(q, H({
|
|
51
|
+
ref: r.setInstance,
|
|
50
52
|
searchForm: {
|
|
51
53
|
sortable: !1,
|
|
52
54
|
resize: {
|
|
@@ -60,26 +62,27 @@ function j(r) {
|
|
|
60
62
|
},
|
|
61
63
|
rowHeight: e.value.rowHeight,
|
|
62
64
|
columns: e.value.columns,
|
|
63
|
-
autoHeight:
|
|
64
|
-
|
|
65
|
+
autoHeight: e.value.height === "auto",
|
|
66
|
+
onModelUpdated: r.onAgGridUpdate
|
|
67
|
+
}, o.gridProps), e.value.gridSlots)]
|
|
65
68
|
})]
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
function h() {
|
|
70
73
|
a = M.createModal({
|
|
71
|
-
title:
|
|
72
|
-
width:
|
|
74
|
+
title: o.title,
|
|
75
|
+
width: o.width,
|
|
73
76
|
destroyOnClose: !0,
|
|
74
77
|
maskClosable: !1,
|
|
75
78
|
footer: null,
|
|
76
79
|
afterOpenChange(t) {
|
|
77
|
-
t === !1 && (
|
|
80
|
+
t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
|
|
78
81
|
},
|
|
79
|
-
content: n(
|
|
80
|
-
modalConfig:
|
|
82
|
+
content: n(c, {
|
|
83
|
+
modalConfig: o
|
|
81
84
|
}, null),
|
|
82
|
-
...
|
|
85
|
+
...o.modalProps || {}
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
function p(t) {
|
|
@@ -87,11 +90,11 @@ function j(r) {
|
|
|
87
90
|
}
|
|
88
91
|
return {
|
|
89
92
|
open: p,
|
|
90
|
-
refresh:
|
|
91
|
-
getAgGridInstance:
|
|
93
|
+
refresh: r.refresh,
|
|
94
|
+
getAgGridInstance: r.getInstance,
|
|
92
95
|
updateProps: u
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
98
|
export {
|
|
96
|
-
|
|
99
|
+
L as useAgGridModal
|
|
97
100
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
3
|
-
import { isFunction as u, cloneDeep as
|
|
1
|
+
import { defineComponent as O, ref as _, createVNode as i, mergeProps as G, onUnmounted as L } from "vue";
|
|
2
|
+
import { message as j } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isFunction as u, cloneDeep as q, isEmpty as b, omitBy as D, isUndefined as T, omit as x } from "lodash-unified";
|
|
4
4
|
import "../../../ag-grid/index.mjs";
|
|
5
|
-
import { ApModal as
|
|
5
|
+
import { ApModal as U } from "../../../ap-modal/index.mjs";
|
|
6
6
|
import "../../../config-provider/index.mjs";
|
|
7
|
-
import { ROW_KEY as
|
|
7
|
+
import { ROW_KEY as F } from "../constants.mjs";
|
|
8
8
|
import "../modal-layout/index.vue.mjs";
|
|
9
|
-
import { AsyncCallback as
|
|
9
|
+
import { AsyncCallback as E, genRequest as W, delRowKeyField as $, addRowKeyField as z, getModalLayoutConfig as B } from "../utils.mjs";
|
|
10
10
|
import "../wrapper/index.vue.mjs";
|
|
11
11
|
import { useAgGridInstance as N } from "./use-ag-grid-instance.mjs";
|
|
12
12
|
import { useModalTitle as V } from "./use-modal-title.mjs";
|
|
@@ -14,45 +14,45 @@ import { useLocale as Y } from "../../../config-provider/hooks/use-locale.mjs";
|
|
|
14
14
|
import J from "../wrapper/index.vue2.mjs";
|
|
15
15
|
import Q from "../modal-layout/index.vue2.mjs";
|
|
16
16
|
import X from "../../../ag-grid/index.vue.mjs";
|
|
17
|
-
function we(
|
|
17
|
+
function we(o) {
|
|
18
18
|
let d, f = null, g = null;
|
|
19
|
-
const c = new
|
|
20
|
-
t:
|
|
21
|
-
} = Y(), [
|
|
19
|
+
const c = new E(), [S, p] = V(), {
|
|
20
|
+
t: K
|
|
21
|
+
} = Y(), [l, k] = N({
|
|
22
22
|
onSelectedRows(e) {
|
|
23
|
-
|
|
23
|
+
p.setCount(e?.length || 0);
|
|
24
24
|
}
|
|
25
|
-
}), w = W(
|
|
25
|
+
}), w = W(o.api, o.getRowKey, l.setDataSourceLength), y = (e) => {
|
|
26
26
|
const {
|
|
27
|
-
title:
|
|
28
|
-
width:
|
|
27
|
+
title: t,
|
|
28
|
+
width: s,
|
|
29
29
|
modalProps: n,
|
|
30
30
|
...a
|
|
31
|
-
} = u(e) ? e(
|
|
31
|
+
} = u(e) ? e(q(o)) : e;
|
|
32
32
|
b(a) || g?.(a);
|
|
33
|
-
const r =
|
|
34
|
-
title:
|
|
35
|
-
width:
|
|
33
|
+
const r = D({
|
|
34
|
+
title: t,
|
|
35
|
+
width: s,
|
|
36
36
|
modalProps: n
|
|
37
37
|
}, T);
|
|
38
38
|
b(r) || f?.update(r);
|
|
39
|
-
}, m = u(
|
|
40
|
-
const e =
|
|
39
|
+
}, m = u(o.getRowKey) ? o.getRowKey : (e) => e[o.getRowKey], P = () => {
|
|
40
|
+
const e = o.mergeRule || "old", t = l.getSelectedRows() || [];
|
|
41
41
|
return {
|
|
42
|
-
keys:
|
|
43
|
-
rows:
|
|
42
|
+
keys: H(t),
|
|
43
|
+
rows: t.map((a) => {
|
|
44
44
|
const r = m(a);
|
|
45
45
|
return e === "old" && d?.[r] ? d[r] : $(a);
|
|
46
46
|
})
|
|
47
47
|
};
|
|
48
48
|
}, h = async () => {
|
|
49
|
-
const e = P(),
|
|
50
|
-
return e.keys.length >
|
|
51
|
-
maxCount:
|
|
52
|
-
})), Promise.reject()) : (await
|
|
49
|
+
const e = P(), t = o.maxCount || 1 / 0;
|
|
50
|
+
return e.keys.length > t ? (j.warning(K("ap.apTableModal.messageMaxCount", {
|
|
51
|
+
maxCount: t
|
|
52
|
+
})), Promise.reject()) : (await o.beforeOk?.(e), o.finishCallback?.(e), c.resolve(e), e);
|
|
53
53
|
}, M = () => {
|
|
54
54
|
c.reject("modal is closed!");
|
|
55
|
-
},
|
|
55
|
+
}, v = /* @__PURE__ */ O({
|
|
56
56
|
name: "AgGridModalSelectContent",
|
|
57
57
|
props: {
|
|
58
58
|
modalConfig: {
|
|
@@ -65,31 +65,33 @@ function we(t) {
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
setup(e) {
|
|
68
|
-
const
|
|
69
|
-
return g = (
|
|
70
|
-
|
|
71
|
-
...
|
|
72
|
-
...
|
|
68
|
+
const t = _(e.modalConfig);
|
|
69
|
+
return g = (s) => {
|
|
70
|
+
t.value = {
|
|
71
|
+
...t.value,
|
|
72
|
+
...s
|
|
73
73
|
};
|
|
74
74
|
}, () => {
|
|
75
|
-
const
|
|
76
|
-
return i(
|
|
75
|
+
const s = e.selectedRows?.map((r) => z(r, t.value.getRowKey)), n = t.value, a = B(n.modalLayout);
|
|
76
|
+
return i(k, null, {
|
|
77
77
|
default: () => [i(J, {
|
|
78
78
|
height: n.height,
|
|
79
|
-
rowHeight: n.rowHeight
|
|
79
|
+
rowHeight: n.rowHeight,
|
|
80
|
+
minHeight: t.value.minHeight,
|
|
81
|
+
maxHeight: t.value.maxHeight
|
|
80
82
|
}, {
|
|
81
|
-
default: () => [
|
|
83
|
+
default: () => [o.renderHeader?.(x(l, "setInstance"), {
|
|
82
84
|
updateProps: y
|
|
83
85
|
}), i(Q, a.props, {
|
|
84
|
-
default: () => [i(X,
|
|
85
|
-
ref:
|
|
86
|
+
default: () => [i(X, G({
|
|
87
|
+
ref: l.setInstance,
|
|
86
88
|
searchForm: {
|
|
87
89
|
sortable: !1,
|
|
88
90
|
resize: {
|
|
89
91
|
target: "form"
|
|
90
92
|
}
|
|
91
93
|
},
|
|
92
|
-
rowKey: u(n.getRowKey) ?
|
|
94
|
+
rowKey: u(n.getRowKey) ? F : n.getRowKey,
|
|
93
95
|
request: w.request,
|
|
94
96
|
style: {
|
|
95
97
|
padding: "0px"
|
|
@@ -97,18 +99,19 @@ function we(t) {
|
|
|
97
99
|
rowHeight: n.rowHeight,
|
|
98
100
|
columns: n.columns,
|
|
99
101
|
rowSelection: {
|
|
100
|
-
defaultSelectedRows:
|
|
102
|
+
defaultSelectedRows: s,
|
|
101
103
|
preserveSelectedRowKeys: !0,
|
|
102
104
|
type: n.mode || "checkbox",
|
|
103
105
|
fixed: "left",
|
|
104
106
|
columnWidth: 38,
|
|
105
107
|
disabled(r) {
|
|
106
|
-
return u(n.disabledCheckbox) ? n.disabledCheckbox(r,
|
|
108
|
+
return u(n.disabledCheckbox) ? n.disabledCheckbox(r, x(l, "setInstance")) : n.disabledCheckbox ?? !1;
|
|
107
109
|
},
|
|
108
|
-
...
|
|
110
|
+
...o.rowSelection
|
|
109
111
|
},
|
|
110
|
-
autoHeight:
|
|
111
|
-
|
|
112
|
+
autoHeight: t.value.height === "auto",
|
|
113
|
+
onModelUpdated: l.onAgGridUpdate
|
|
114
|
+
}, o.gridProps), n.gridSlots)],
|
|
112
115
|
...a.slots
|
|
113
116
|
})]
|
|
114
117
|
})]
|
|
@@ -117,51 +120,51 @@ function we(t) {
|
|
|
117
120
|
}
|
|
118
121
|
});
|
|
119
122
|
function C(e) {
|
|
120
|
-
return i(
|
|
121
|
-
modalConfig:
|
|
123
|
+
return i(v, {
|
|
124
|
+
modalConfig: o,
|
|
122
125
|
selectedRows: e
|
|
123
126
|
}, null);
|
|
124
127
|
}
|
|
125
|
-
function
|
|
126
|
-
const e = Object.values(d || {}),
|
|
127
|
-
f =
|
|
128
|
-
title: i(
|
|
129
|
-
title:
|
|
130
|
-
maxCount:
|
|
131
|
-
isShowDefaultSuffix:
|
|
132
|
-
},
|
|
133
|
-
width:
|
|
128
|
+
function A() {
|
|
129
|
+
const e = Object.values(d || {}), t = C(e);
|
|
130
|
+
f = U.createModal({
|
|
131
|
+
title: i(S, {
|
|
132
|
+
title: o.title,
|
|
133
|
+
maxCount: o.maxCount || 1 / 0,
|
|
134
|
+
isShowDefaultSuffix: o.mode !== "radio"
|
|
135
|
+
}, o.modalTitleSlots),
|
|
136
|
+
width: o.width,
|
|
134
137
|
destroyOnClose: !0,
|
|
135
138
|
maskClosable: !1,
|
|
136
139
|
onOk: h,
|
|
137
140
|
onCancel: M,
|
|
138
|
-
afterOpenChange(
|
|
139
|
-
|
|
141
|
+
afterOpenChange(s) {
|
|
142
|
+
s === !1 && (l.setInstance(void 0), l.setDataSourceLength(0));
|
|
140
143
|
},
|
|
141
|
-
content:
|
|
142
|
-
...
|
|
144
|
+
content: t,
|
|
145
|
+
...o.modalProps || {}
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
|
-
function
|
|
148
|
+
function H(e) {
|
|
146
149
|
return e?.map(m) || [];
|
|
147
150
|
}
|
|
148
|
-
function R(e,
|
|
151
|
+
function R(e, t, s = !1) {
|
|
149
152
|
if (d = e?.reduce((n, a) => {
|
|
150
153
|
const r = m(a);
|
|
151
154
|
return n[r] = a, n;
|
|
152
|
-
}, {}), w.setExtraParams(
|
|
155
|
+
}, {}), w.setExtraParams(t?.extraParams), A(), s)
|
|
153
156
|
return c.buildPromise();
|
|
154
157
|
}
|
|
155
|
-
function
|
|
156
|
-
return R(e,
|
|
158
|
+
function I(e, t) {
|
|
159
|
+
return R(e, t, !0);
|
|
157
160
|
}
|
|
158
|
-
return
|
|
161
|
+
return L(() => {
|
|
159
162
|
c.reject("component is Unmounted!");
|
|
160
163
|
}), {
|
|
161
164
|
open: R,
|
|
162
|
-
asyncOpen:
|
|
163
|
-
refresh:
|
|
164
|
-
getAgGridInstance:
|
|
165
|
+
asyncOpen: I,
|
|
166
|
+
refresh: l.refresh,
|
|
167
|
+
getAgGridInstance: l.getInstance,
|
|
165
168
|
genContent: C,
|
|
166
169
|
validate: h,
|
|
167
170
|
updateProps: y
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StyleValue, VNodeChild } from 'vue';
|
|
2
2
|
import { AgGridColumnType, AgGridExpose, AgGridProps, AgGridRowSelection, AgGridSlots } from '../../ag-grid';
|
|
3
3
|
import { CreateModalFuncProps } from '../../ap-modal';
|
|
4
4
|
import { Recordable } from '../../type';
|
|
@@ -19,7 +19,9 @@ export interface AgGridModalBasicProps<TableRowType = any> {
|
|
|
19
19
|
updateProps: UpdatePropsFn<TableRowType>;
|
|
20
20
|
}) => VNodeChild;
|
|
21
21
|
rowHeight?: number;
|
|
22
|
-
height?:
|
|
22
|
+
height?: number | string;
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
maxHeight?: number | string;
|
|
23
25
|
}
|
|
24
26
|
/** 刷新方式 */
|
|
25
27
|
export type RefreshType = 'reset' | 'submit' | 'submitWith';
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { isFunction as p } from "lodash-unified";
|
|
2
|
-
import { ROW_KEY as
|
|
3
|
-
function
|
|
2
|
+
import { ROW_KEY as l } from "./constants.mjs";
|
|
3
|
+
function F(t, e, r) {
|
|
4
4
|
let n = null;
|
|
5
|
-
return { request: async (
|
|
6
|
-
const i =
|
|
5
|
+
return { request: async (o) => {
|
|
6
|
+
const i = t;
|
|
7
7
|
if (!i)
|
|
8
8
|
return r?.(0), {
|
|
9
9
|
data: [],
|
|
10
10
|
total: 0
|
|
11
11
|
};
|
|
12
|
-
n && (
|
|
13
|
-
const { records:
|
|
14
|
-
return r?.(
|
|
15
|
-
data:
|
|
16
|
-
total:
|
|
12
|
+
n && (o = Object.assign(o, n));
|
|
13
|
+
const { records: u, total: a } = await i(Object.assign({}, o));
|
|
14
|
+
return r?.(u?.length || 0), {
|
|
15
|
+
data: u?.map((c) => h(c, e)),
|
|
16
|
+
total: a
|
|
17
17
|
};
|
|
18
|
-
}, setExtraParams: (
|
|
19
|
-
n =
|
|
18
|
+
}, setExtraParams: (o) => {
|
|
19
|
+
n = o || null;
|
|
20
20
|
} };
|
|
21
21
|
}
|
|
22
|
-
function h(
|
|
23
|
-
return p(
|
|
24
|
-
...
|
|
25
|
-
[
|
|
26
|
-
} :
|
|
22
|
+
function h(t, e) {
|
|
23
|
+
return p(e) ? {
|
|
24
|
+
...t,
|
|
25
|
+
[l]: e(t)
|
|
26
|
+
} : t;
|
|
27
27
|
}
|
|
28
|
-
function g(
|
|
29
|
-
return Reflect.deleteProperty(
|
|
28
|
+
function g(t) {
|
|
29
|
+
return Reflect.deleteProperty(t, l), t;
|
|
30
30
|
}
|
|
31
|
-
function j(
|
|
32
|
-
const { renderSelectedItem:
|
|
31
|
+
function j(t) {
|
|
32
|
+
const { renderSelectedItem: e, rightTitle: r, rightBottom: n, ...s } = t || {};
|
|
33
33
|
return {
|
|
34
|
-
props: { ...
|
|
34
|
+
props: { ...s, layoutType: t && "two-column" },
|
|
35
35
|
slots: {
|
|
36
|
-
renderSelectedItem:
|
|
36
|
+
renderSelectedItem: e,
|
|
37
37
|
rightTitle: r,
|
|
38
38
|
rightBottom: n
|
|
39
39
|
}
|
|
@@ -44,10 +44,10 @@ class y {
|
|
|
44
44
|
this.p = null, this.operateFn = null;
|
|
45
45
|
}
|
|
46
46
|
buildPromise() {
|
|
47
|
-
return this.operateFn && this.operateFn.reject("Ignored Reject: reuse"), this.p = new Promise((
|
|
47
|
+
return this.operateFn && this.operateFn.reject("Ignored Reject: reuse"), this.p = new Promise((e, r) => {
|
|
48
48
|
this.operateFn = {
|
|
49
49
|
reject: r,
|
|
50
|
-
resolve:
|
|
50
|
+
resolve: e
|
|
51
51
|
};
|
|
52
52
|
}), this.p;
|
|
53
53
|
}
|
|
@@ -55,18 +55,22 @@ class y {
|
|
|
55
55
|
this.p = null, this.operateFn = null;
|
|
56
56
|
}
|
|
57
57
|
/** 兑现回调 */
|
|
58
|
-
resolve(
|
|
59
|
-
this.operateFn && (this.operateFn.resolve(
|
|
58
|
+
resolve(e) {
|
|
59
|
+
this.operateFn && (this.operateFn.resolve(e), this.clear());
|
|
60
60
|
}
|
|
61
61
|
/** 拒绝回调 */
|
|
62
|
-
reject(
|
|
63
|
-
this.operateFn && (this.operateFn.reject("Ignored Reject: " +
|
|
62
|
+
reject(e) {
|
|
63
|
+
this.operateFn && (this.operateFn.reject("Ignored Reject: " + e), this.clear());
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
function P(t) {
|
|
67
|
+
return typeof t == "number" && t ? `${t}px` : t.toString();
|
|
68
|
+
}
|
|
66
69
|
export {
|
|
67
70
|
y as AsyncCallback,
|
|
68
71
|
h as addRowKeyField,
|
|
69
72
|
g as delRowKeyField,
|
|
70
|
-
|
|
71
|
-
j as getModalLayoutConfig
|
|
73
|
+
F as genRequest,
|
|
74
|
+
j as getModalLayoutConfig,
|
|
75
|
+
P as toHeight
|
|
72
76
|
};
|