@aplus-frontend/ui 6.38.0 → 6.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +108 -104
- package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
- package/es/src/ag-grid/index.vue.mjs +201 -200
- package/es/src/ag-grid/interface.d.ts +14 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
- package/es/src/ap-table/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/es/src/business/ag-grid-modal/constants.mjs +6 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
- package/es/src/business/ag-grid-modal/index.d.ts +2 -0
- package/es/src/business/ag-grid-modal/index.mjs +6 -0
- package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
- package/es/src/business/ag-grid-modal/style/css.d.ts +0 -0
- package/es/src/business/ag-grid-modal/style/css.js +1 -0
- package/es/src/business/ag-grid-modal/style/index.d.ts +0 -0
- package/es/src/business/ag-grid-modal/style/index.js +1 -0
- package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/es/src/business/ag-grid-modal/utils.mjs +72 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/index.d.ts +3 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/index.mjs +78 -74
- package/es/src/path-map.mjs +3 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +14 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/constants.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
- package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/index.js +1 -0
- package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/css.d.ts +0 -0
- package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/index.d.ts +0 -0
- package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/index.d.ts +3 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +3 -0
- package/theme/ag-grid-modal/index.css +773 -0
- package/theme/ag-grid-modal/index.less +58 -0
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/ap-upload/index.css +5 -0
- package/theme/ap-upload/multiple-file.css +5 -0
- package/theme/ap-upload/multiple-file.less +6 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +54 -0
- package/theme/index.less +1 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as y, Modal as
|
|
3
|
-
import { getSingleVNode as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as L, ref as v, unref as e, computed as M, useSlots as P, createVNode as t, cloneVNode as q, createElementBlock as H, openBlock as h, Fragment as J, createBlock as Q, createCommentVNode as W, resolveDynamicComponent as X, withCtx as u, withDirectives as Y, createElementVNode as s, normalizeClass as i, toDisplayString as c, createTextVNode as S, isRef as Z, vShow as ee } from "vue";
|
|
2
|
+
import { Button as y, Modal as te, RadioGroup as le, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getSingleVNode as ne } from "../../../../utils/slot.mjs";
|
|
4
|
+
import { useInjectApTable as ae } from "../../../context.mjs";
|
|
5
5
|
import "../tree-select/index.vue.mjs";
|
|
6
|
-
import { useTableColumnState as
|
|
6
|
+
import { useTableColumnState as oe } from "../../../hooks/use-table-column-state.mjs";
|
|
7
7
|
import "../../../../config-provider/index.mjs";
|
|
8
8
|
import "../sorter/index.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { SettingOutlined as
|
|
11
|
-
import { useLocale as
|
|
9
|
+
import se, { customCloneColumnStates as B } from "../utils.mjs";
|
|
10
|
+
import { SettingOutlined as ie } from "@ant-design/icons-vue";
|
|
11
|
+
import { useLocale as ue } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
13
|
+
import re from "../tree-select/index.vue2.mjs";
|
|
14
|
+
import pe from "../sorter/index.vue2.mjs";
|
|
15
|
+
const Be = /* @__PURE__ */ L({
|
|
16
16
|
name: "ApTableSetting",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -20,85 +20,86 @@ const Te = /* @__PURE__ */ G({
|
|
|
20
20
|
default: () => ({})
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
columnsBackup:
|
|
26
|
-
size:
|
|
27
|
-
updateSize:
|
|
28
|
-
updateColumns:
|
|
29
|
-
} =
|
|
30
|
-
columnState:
|
|
31
|
-
setColumnState:
|
|
32
|
-
isAllSelected:
|
|
33
|
-
toggleSelectAll:
|
|
34
|
-
columnStateBackup:
|
|
35
|
-
setColumnStateBackup:
|
|
36
|
-
cacheColumnStateIfNeeded:
|
|
37
|
-
} =
|
|
38
|
-
t:
|
|
39
|
-
} =
|
|
23
|
+
setup(_) {
|
|
24
|
+
const m = _, {
|
|
25
|
+
columnsBackup: z,
|
|
26
|
+
size: A,
|
|
27
|
+
updateSize: V,
|
|
28
|
+
updateColumns: w
|
|
29
|
+
} = ae(), d = v(e(A)), R = M(() => m.config.persistenceKey), {
|
|
30
|
+
columnState: n,
|
|
31
|
+
setColumnState: D,
|
|
32
|
+
isAllSelected: O,
|
|
33
|
+
toggleSelectAll: U,
|
|
34
|
+
columnStateBackup: E,
|
|
35
|
+
setColumnStateBackup: I,
|
|
36
|
+
cacheColumnStateIfNeeded: K
|
|
37
|
+
} = oe(m.config, R, []), {
|
|
38
|
+
t: a
|
|
39
|
+
} = ue(), {
|
|
40
40
|
b: f,
|
|
41
41
|
be: g
|
|
42
42
|
} = N("ap-column-setting"), {
|
|
43
|
-
b:
|
|
44
|
-
} = N("ap-table"), r =
|
|
45
|
-
icon: t(
|
|
46
|
-
class:
|
|
47
|
-
}, null),
|
|
43
|
+
b: $
|
|
44
|
+
} = N("ap-table"), r = v(!1), C = v(!1), j = P(), b = ne(j.trigger) || t(y, {
|
|
45
|
+
icon: t(ie, null, null),
|
|
46
|
+
class: $("setting-trigger-button")
|
|
47
|
+
}, null), k = b ? q(b, {
|
|
48
48
|
onClick: () => {
|
|
49
49
|
r.value = !0;
|
|
50
50
|
}
|
|
51
51
|
}) : null;
|
|
52
|
-
function j() {
|
|
53
|
-
w(B(e(U)));
|
|
54
|
-
}
|
|
55
52
|
function F() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
D(B(e(E)));
|
|
54
|
+
}
|
|
55
|
+
function G() {
|
|
56
|
+
w?.(se(e(z), e(n))), V?.(e(d)), r.value = !1;
|
|
57
|
+
const p = B(n.value);
|
|
58
|
+
I(p), K(p), m.config?.onChange?.(p);
|
|
59
59
|
}
|
|
60
|
-
return (p, o) => (
|
|
60
|
+
return (p, o) => (h(), H(J, null, [e(k) ? (h(), Q(X(e(k)), {
|
|
61
61
|
key: 0
|
|
62
|
-
})) :
|
|
62
|
+
})) : W("", !0), t(e(te), {
|
|
63
63
|
open: r.value,
|
|
64
|
-
"onUpdate:open": o[2] || (o[2] = (
|
|
65
|
-
title: e(
|
|
64
|
+
"onUpdate:open": o[2] || (o[2] = (l) => r.value = l),
|
|
65
|
+
title: e(a)("ap.apTable.setting.title"),
|
|
66
66
|
width: 900,
|
|
67
67
|
centered: !0,
|
|
68
68
|
"body-style": {
|
|
69
69
|
padding: "0px !important",
|
|
70
70
|
height: "450px"
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
"after-open-change": (l) => C.value = l,
|
|
73
|
+
onOk: G
|
|
73
74
|
}, {
|
|
74
|
-
default: u(() => [
|
|
75
|
-
class:
|
|
76
|
-
}, [
|
|
77
|
-
class:
|
|
78
|
-
}, [
|
|
79
|
-
class:
|
|
80
|
-
}, [
|
|
81
|
-
class:
|
|
82
|
-
},
|
|
75
|
+
default: u(() => [Y(s("div", {
|
|
76
|
+
class: i(e(f)("wrapper"))
|
|
77
|
+
}, [s("div", {
|
|
78
|
+
class: i(e(f)("left"))
|
|
79
|
+
}, [s("div", {
|
|
80
|
+
class: i(e(g)("left", "header"))
|
|
81
|
+
}, [s("div", null, [s("span", {
|
|
82
|
+
class: i(e(g)("left", "header-tips"))
|
|
83
|
+
}, c(e(a)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
|
|
83
84
|
type: "link",
|
|
84
85
|
size: "small",
|
|
85
|
-
onClick: e(
|
|
86
|
+
onClick: e(U)
|
|
86
87
|
}, {
|
|
87
|
-
default: u(() => [
|
|
88
|
+
default: u(() => [S(c(e(O) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
|
|
88
89
|
_: 1
|
|
89
|
-
}, 8, ["onClick"])]), t(e(
|
|
90
|
+
}, 8, ["onClick"])]), t(e(le), {
|
|
90
91
|
value: d.value,
|
|
91
|
-
"onUpdate:value": o[0] || (o[0] = (
|
|
92
|
+
"onUpdate:value": o[0] || (o[0] = (l) => d.value = l)
|
|
92
93
|
}, {
|
|
93
94
|
default: u(() => [t(e(T), {
|
|
94
95
|
value: "small"
|
|
95
96
|
}, {
|
|
96
|
-
default: u(() => [
|
|
97
|
+
default: u(() => [S(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
97
98
|
_: 1
|
|
98
99
|
}), t(e(T), {
|
|
99
100
|
value: "middle"
|
|
100
101
|
}, {
|
|
101
|
-
default: u(() => [
|
|
102
|
+
default: u(() => [S(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
102
103
|
_: 1
|
|
103
104
|
})]),
|
|
104
105
|
_: 1
|
|
@@ -107,26 +108,26 @@ const Te = /* @__PURE__ */ G({
|
|
|
107
108
|
style: {
|
|
108
109
|
margin: "0px"
|
|
109
110
|
}
|
|
110
|
-
}), t(
|
|
111
|
-
class:
|
|
112
|
-
value: e(
|
|
111
|
+
}), t(re, {
|
|
112
|
+
class: i(e(g)("left", "content")),
|
|
113
|
+
value: e(n)
|
|
113
114
|
}, null, 8, ["class", "value"])], 2), t(e(x), {
|
|
114
115
|
type: "vertical",
|
|
115
116
|
style: {
|
|
116
117
|
height: "100%",
|
|
117
118
|
margin: "0px"
|
|
118
119
|
}
|
|
119
|
-
}),
|
|
120
|
-
class:
|
|
121
|
-
}, [t(
|
|
122
|
-
value: e(
|
|
123
|
-
"onUpdate:value": o[1] || (o[1] = (
|
|
124
|
-
onReset:
|
|
125
|
-
}, null, 8, ["value"])], 2)], 2)]),
|
|
120
|
+
}), s("div", {
|
|
121
|
+
class: i(e(f)("right"))
|
|
122
|
+
}, [t(pe, {
|
|
123
|
+
value: e(n),
|
|
124
|
+
"onUpdate:value": o[1] || (o[1] = (l) => Z(n) ? n.value = l : null),
|
|
125
|
+
onReset: F
|
|
126
|
+
}, null, 8, ["value"])], 2)], 2), [[ee, C.value]])]),
|
|
126
127
|
_: 1
|
|
127
|
-
}, 8, ["open", "title"])], 64));
|
|
128
|
+
}, 8, ["open", "title", "after-open-change"])], 64));
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
131
|
export {
|
|
131
|
-
|
|
132
|
+
Be as default
|
|
132
133
|
};
|
|
@@ -352,6 +352,12 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
352
352
|
* 查询表单提交
|
|
353
353
|
*/
|
|
354
354
|
submit: () => void;
|
|
355
|
+
/**
|
|
356
|
+
* 表格查询提交(重制页码但查询参数不会重置)
|
|
357
|
+
* @param resetCurrent 是否重置当前页码,默认为`false`
|
|
358
|
+
* @returns
|
|
359
|
+
*/
|
|
360
|
+
submitWith: (resetCurrent?: boolean) => void;
|
|
355
361
|
/**
|
|
356
362
|
* 查询表单重置
|
|
357
363
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { AgGridExpose } from '../../../ag-grid';
|
|
3
|
+
import { RefreshType } from '../interface';
|
|
4
|
+
interface Options {
|
|
5
|
+
onMounted?: () => void;
|
|
6
|
+
onSelectedRows?: (rows?: any[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface GridApi {
|
|
9
|
+
/** 设置 AgGrid 实例 */
|
|
10
|
+
setInstance: (node: any) => void;
|
|
11
|
+
/** 刷新表格 */
|
|
12
|
+
refresh: (type?: RefreshType) => void;
|
|
13
|
+
/** 获取 AgGrid 实例 */
|
|
14
|
+
getInstance: () => AgGridExpose | undefined;
|
|
15
|
+
/** 设置 AgGrid 选中行 */
|
|
16
|
+
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
17
|
+
/** 获取 AgGrid 选中行 */
|
|
18
|
+
getSelectedRows: () => any[] | undefined;
|
|
19
|
+
/** 清空所有选中行 */
|
|
20
|
+
clearAllSelected: () => void;
|
|
21
|
+
/** 清除某一行数据 */
|
|
22
|
+
removeSelected: (record: any) => void;
|
|
23
|
+
/** 设置表格数据length */
|
|
24
|
+
setDataSourceLength: (len: number) => void;
|
|
25
|
+
}
|
|
26
|
+
interface GridApiProvider extends GridApi {
|
|
27
|
+
selectedRows?: ComputedRef<any[]>;
|
|
28
|
+
dataSourceLength?: ComputedRef<number>;
|
|
29
|
+
}
|
|
30
|
+
export declare function useAgGridInstance(options?: Options): [GridApi, any];
|
|
31
|
+
/** 获取上下文中grid的api */
|
|
32
|
+
export declare function useAgGridModalInject(): GridApiProvider | undefined;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ref as o, watch as r, defineComponent as A, provide as h, toRef as a, inject as I } from "vue";
|
|
2
|
+
import { cloneDeep as y } from "lodash-unified";
|
|
3
|
+
const u = Symbol("ag-grid-provider-key");
|
|
4
|
+
function L(n) {
|
|
5
|
+
const t = o(), c = o(), l = o(0), d = (e) => {
|
|
6
|
+
t.value = e;
|
|
7
|
+
}, i = (e) => {
|
|
8
|
+
l.value = e;
|
|
9
|
+
}, v = () => t.value, S = (e = "reset") => {
|
|
10
|
+
t.value && e in t.value && t.value[e]();
|
|
11
|
+
}, w = (e) => {
|
|
12
|
+
t.value?.rowSelection.setSelectedRowKeys(e);
|
|
13
|
+
}, g = () => y(t.value?.rowSelection.selectedRows.value), f = () => t.value?.rowSelection.clearAll(), R = (e) => t.value?.rowSelection.unSelectRows([e]);
|
|
14
|
+
r(t, (e) => {
|
|
15
|
+
e && n?.onMounted?.();
|
|
16
|
+
}), r(
|
|
17
|
+
() => t.value?.rowSelection.selectedRows.value,
|
|
18
|
+
(e) => {
|
|
19
|
+
c.value = e, n?.onSelectedRows?.(e);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
const s = {
|
|
23
|
+
setInstance: d,
|
|
24
|
+
refresh: S,
|
|
25
|
+
getInstance: v,
|
|
26
|
+
setSelectedRowKeys: w,
|
|
27
|
+
getSelectedRows: g,
|
|
28
|
+
clearAllSelected: f,
|
|
29
|
+
removeSelected: R,
|
|
30
|
+
setDataSourceLength: i
|
|
31
|
+
}, p = A({
|
|
32
|
+
setup(e, { slots: m }) {
|
|
33
|
+
return h(u, {
|
|
34
|
+
...s,
|
|
35
|
+
selectedRows: a(() => c.value),
|
|
36
|
+
dataSourceLength: a(
|
|
37
|
+
() => l.value
|
|
38
|
+
)
|
|
39
|
+
}), m.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return [s, p];
|
|
43
|
+
}
|
|
44
|
+
function _() {
|
|
45
|
+
return I(u);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
L as useAgGridInstance,
|
|
49
|
+
_ as useAgGridModalInject
|
|
50
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { ApModal as m } from "../../../ap-modal/index.mjs";
|
|
3
|
+
import "../../../ag-grid/index.mjs";
|
|
4
|
+
import { genRequest as d } from "../utils.mjs";
|
|
5
|
+
import { useAgGridInstance as l } from "./use-ag-grid-instance.mjs";
|
|
6
|
+
import { omit as c } from "lodash-unified";
|
|
7
|
+
import "../wrapper/index.vue.mjs";
|
|
8
|
+
import f from "../wrapper/index.vue2.mjs";
|
|
9
|
+
import u from "../../../ag-grid/index.vue.mjs";
|
|
10
|
+
function C(e) {
|
|
11
|
+
const [t, n] = l(), o = d(e.api, e.getRowKey, t.setDataSourceLength);
|
|
12
|
+
function a() {
|
|
13
|
+
m.createModal({
|
|
14
|
+
title: e.title,
|
|
15
|
+
width: e.width,
|
|
16
|
+
destroyOnClose: !0,
|
|
17
|
+
maskClosable: !1,
|
|
18
|
+
footer: null,
|
|
19
|
+
onCancel() {
|
|
20
|
+
t.setInstance(void 0), t.setDataSourceLength(0);
|
|
21
|
+
},
|
|
22
|
+
content: r(n, null, {
|
|
23
|
+
default: () => [r(f, {
|
|
24
|
+
rowHeight: e.rowHeight
|
|
25
|
+
}, {
|
|
26
|
+
default: () => [e.renderHeader?.(c(t, "setInstance")), r(u, {
|
|
27
|
+
ref: t.setInstance,
|
|
28
|
+
searchForm: {
|
|
29
|
+
sortable: !1,
|
|
30
|
+
resize: {
|
|
31
|
+
target: "form"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
rowKey: e.getRowKey,
|
|
35
|
+
request: o.request,
|
|
36
|
+
style: {
|
|
37
|
+
padding: "0px"
|
|
38
|
+
},
|
|
39
|
+
rowHeight: e.rowHeight,
|
|
40
|
+
columns: e.columns
|
|
41
|
+
}, e.gridSlots)]
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
...e.modalProps || {}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function i(s) {
|
|
48
|
+
o.setExtraParams(s?.extraParams), a();
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
open: i,
|
|
52
|
+
refresh: t.refresh,
|
|
53
|
+
getAgGridInstance: t.getInstance
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
C as useAgGridModal
|
|
58
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { createVNode as r, onUnmounted as O } from "vue";
|
|
2
|
+
import { ApModal as _ } from "../../../ap-modal/index.mjs";
|
|
3
|
+
import "../../../ag-grid/index.mjs";
|
|
4
|
+
import { AsyncCallback as L, genRequest as P, delRowKeyField as H, getModalLayoutConfig as T, addRowKeyField as j } from "../utils.mjs";
|
|
5
|
+
import { useAgGridInstance as q } from "./use-ag-grid-instance.mjs";
|
|
6
|
+
import { isFunction as u, omit as h } from "lodash-unified";
|
|
7
|
+
import { ROW_KEY as v } from "../constants.mjs";
|
|
8
|
+
import { useModalTitle as F } from "./use-modal-title.mjs";
|
|
9
|
+
import { message as G } from "@aplus-frontend/antdv";
|
|
10
|
+
import "../../../config-provider/index.mjs";
|
|
11
|
+
import "../modal-layout/index.vue.mjs";
|
|
12
|
+
import "../wrapper/index.vue.mjs";
|
|
13
|
+
import { useLocale as D } from "../../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import E from "../wrapper/index.vue2.mjs";
|
|
15
|
+
import U from "../modal-layout/index.vue2.mjs";
|
|
16
|
+
import W from "../../../ag-grid/index.vue.mjs";
|
|
17
|
+
function le(e) {
|
|
18
|
+
let i;
|
|
19
|
+
const c = new L(), [C, b] = F(), {
|
|
20
|
+
t: K
|
|
21
|
+
} = D(), [n, k] = q({
|
|
22
|
+
onSelectedRows(t) {
|
|
23
|
+
b.setCount(t?.length || 0);
|
|
24
|
+
}
|
|
25
|
+
}), f = P(e.api, e.getRowKey, n.setDataSourceLength), d = u(e.getRowKey) ? e.getRowKey : (t) => t[e.getRowKey], x = () => {
|
|
26
|
+
const t = e.mergeRule || "old", o = n.getSelectedRows() || [];
|
|
27
|
+
return {
|
|
28
|
+
keys: M(o),
|
|
29
|
+
rows: o.map((l) => {
|
|
30
|
+
const s = d(l);
|
|
31
|
+
return t === "old" && i?.[s] ? i[s] : H(l);
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
}, g = async () => {
|
|
35
|
+
const t = x(), o = e.maxCount || 1 / 0;
|
|
36
|
+
return t.keys.length > o ? (G.warning(K("ap.apTableModal.messageMaxCount", {
|
|
37
|
+
maxCount: o
|
|
38
|
+
})), Promise.reject()) : (await e.beforeOk?.(t), e.finishCallback?.(t), c.resolve(t), t);
|
|
39
|
+
}, S = () => {
|
|
40
|
+
c.reject("modal is closed!"), n.setInstance(void 0), n.setDataSourceLength(0);
|
|
41
|
+
}, w = T(e.modalLayout);
|
|
42
|
+
function y(t) {
|
|
43
|
+
const o = t?.map((a) => j(a, e.getRowKey));
|
|
44
|
+
return r(k, null, {
|
|
45
|
+
default: () => [r(E, {
|
|
46
|
+
rowHeight: e.rowHeight
|
|
47
|
+
}, {
|
|
48
|
+
default: () => [e.renderHeader?.(h(n, "setInstance")), r(U, w.props, {
|
|
49
|
+
default: () => [r(W, {
|
|
50
|
+
ref: n.setInstance,
|
|
51
|
+
searchForm: {
|
|
52
|
+
sortable: !1,
|
|
53
|
+
resize: {
|
|
54
|
+
target: "form"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
rowKey: u(e.getRowKey) ? v : e.getRowKey,
|
|
58
|
+
request: f.request,
|
|
59
|
+
style: {
|
|
60
|
+
padding: "0px"
|
|
61
|
+
},
|
|
62
|
+
rowHeight: e.rowHeight,
|
|
63
|
+
columns: e.columns,
|
|
64
|
+
rowSelection: {
|
|
65
|
+
defaultSelectedRows: o,
|
|
66
|
+
preserveSelectedRowKeys: !0,
|
|
67
|
+
type: e.mode || "checkbox",
|
|
68
|
+
fixed: "left",
|
|
69
|
+
columnWidth: 38,
|
|
70
|
+
disabled(a) {
|
|
71
|
+
return u(e.disabledCheckbox) ? e.disabledCheckbox(a, h(n, "setInstance")) : e.disabledCheckbox ?? !1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, e.gridSlots)],
|
|
75
|
+
...w.slots
|
|
76
|
+
})]
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function I() {
|
|
81
|
+
const t = Object.values(i || {}), o = y(t);
|
|
82
|
+
_.createModal({
|
|
83
|
+
title: r(C, {
|
|
84
|
+
title: e.title,
|
|
85
|
+
maxCount: e.maxCount || 1 / 0
|
|
86
|
+
}, e.modalTitleSlots),
|
|
87
|
+
width: e.width,
|
|
88
|
+
destroyOnClose: !0,
|
|
89
|
+
maskClosable: !1,
|
|
90
|
+
onOk: g,
|
|
91
|
+
onCancel: S,
|
|
92
|
+
content: o,
|
|
93
|
+
...e.modalProps || {}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function M(t) {
|
|
97
|
+
return t?.map(d) || [];
|
|
98
|
+
}
|
|
99
|
+
function R(t, o, a = !1) {
|
|
100
|
+
if (i = t?.reduce((m, l) => {
|
|
101
|
+
const s = d(l);
|
|
102
|
+
return m[s] = l, m;
|
|
103
|
+
}, {}), f.setExtraParams(o?.extraParams), I(), a)
|
|
104
|
+
return c.buildPromise();
|
|
105
|
+
}
|
|
106
|
+
function A(t, o) {
|
|
107
|
+
return R(t, o, !0);
|
|
108
|
+
}
|
|
109
|
+
return O(() => {
|
|
110
|
+
c.reject("component is Unmounted!");
|
|
111
|
+
}), {
|
|
112
|
+
open: R,
|
|
113
|
+
asyncOpen: A,
|
|
114
|
+
refresh: n.refresh,
|
|
115
|
+
getAgGridInstance: n.getInstance,
|
|
116
|
+
genContent: y,
|
|
117
|
+
validate: g
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
le as useAgGridSelectModal
|
|
122
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
export declare function useModalTitle(): readonly [ DefineComponent<ExtractPropTypes<{
|
|
3
|
+
title: {
|
|
4
|
+
type: any;
|
|
5
|
+
default: null;
|
|
6
|
+
};
|
|
7
|
+
maxCount: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
12
|
+
title: {
|
|
13
|
+
type: any;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
maxCount: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{}>, {
|
|
21
|
+
title: any;
|
|
22
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
23
|
+
readonly setCount: (data: number) => void;
|
|
24
|
+
}];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ref as n, defineComponent as u, createVNode as a } from "vue";
|
|
2
|
+
import "../../../config-provider/index.mjs";
|
|
3
|
+
import { useLocale as i } from "../../../config-provider/hooks/use-locale.mjs";
|
|
4
|
+
function d() {
|
|
5
|
+
const e = n(0);
|
|
6
|
+
return [/* @__PURE__ */ u({
|
|
7
|
+
props: {
|
|
8
|
+
title: {
|
|
9
|
+
type: null,
|
|
10
|
+
default: null
|
|
11
|
+
},
|
|
12
|
+
maxCount: {
|
|
13
|
+
type: Number,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(t, {
|
|
18
|
+
slots: l
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
t: o
|
|
22
|
+
} = i();
|
|
23
|
+
return () => a("div", null, [t.title, l.default ? l.default({
|
|
24
|
+
maxCount: t.maxCount,
|
|
25
|
+
count: e.value
|
|
26
|
+
}) : a("span", {
|
|
27
|
+
style: {
|
|
28
|
+
color: "var(--ap-text-color-3)",
|
|
29
|
+
fontSize: "12px",
|
|
30
|
+
fontWeight: "normal",
|
|
31
|
+
marginLeft: "12px"
|
|
32
|
+
}
|
|
33
|
+
}, [isFinite(t.maxCount) ? o("ap.apTableModal.titleSuffixOne", {
|
|
34
|
+
maxCount: t.maxCount
|
|
35
|
+
}) : "", o("ap.apTableModal.titleSuffixTwo"), a("span", {
|
|
36
|
+
style: {
|
|
37
|
+
color: "var(--ap-color-primary)"
|
|
38
|
+
}
|
|
39
|
+
}, [e.value]), o("ap.apTableModal.titleSuffixThree")])]);
|
|
40
|
+
}
|
|
41
|
+
}), {
|
|
42
|
+
setCount: (t) => {
|
|
43
|
+
e.value = t;
|
|
44
|
+
}
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
d as useModalTitle
|
|
49
|
+
};
|