@aplus-frontend/ui 7.1.0 → 7.2.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 +143 -147
- package/es/src/ag-grid/hooks/use-columns-def.mjs +20 -19
- package/es/src/ag-grid/interface.d.ts +4 -0
- package/es/src/ap-pro-card/components/title/index.vue.d.ts +3 -0
- package/es/src/ap-pro-card/components/title/index.vue2.mjs +18 -13
- package/es/src/ap-upload/apUpload.vue.d.ts +1 -1
- package/es/src/business/ap-image/ApImage.vue2.mjs +45 -42
- package/es/src/business/ap-image/interface.d.ts +2 -0
- package/es/src/business/ap-title/ApTitle.vue2.mjs +24 -21
- package/es/src/business/ap-title/interface.d.ts +2 -0
- package/es/src/business/ap-title/style/index.mjs +11 -11
- package/es/src/business/hooks/index.d.ts +0 -2
- package/es/src/business/hooks/index.mjs +5 -9
- package/es/src/business/hooks/usePageListApGrid.d.ts +1 -2
- package/es/src/business/hooks/usePageListApGrid.mjs +35 -44
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -2
- package/es/src/business/hooks/usePageListApTable.mjs +46 -48
- package/es/src/config-provider/config-provider-props.d.ts +20 -3
- package/es/src/config-provider/config-provider-props.mjs +12 -0
- package/es/src/config-provider/config-provider.d.ts +33 -3
- package/es/src/config-provider/config-provider.mjs +35 -35
- package/es/src/config-provider/constants.d.ts +1 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +17 -2
- package/es/src/config-provider/index.d.ts +49 -4
- package/es/src/index.mjs +147 -151
- 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/interface.d.ts +4 -0
- package/lib/src/ap-pro-card/components/title/index.vue.d.ts +3 -0
- package/lib/src/ap-pro-card/components/title/index.vue2.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +1 -1
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/interface.d.ts +2 -0
- package/lib/src/business/ap-title/ApTitle.vue2.js +1 -1
- package/lib/src/business/ap-title/interface.d.ts +2 -0
- package/lib/src/business/ap-title/style/index.js +1 -1
- package/lib/src/business/hooks/index.d.ts +0 -2
- package/lib/src/business/hooks/index.js +1 -1
- package/lib/src/business/hooks/usePageListApGrid.d.ts +1 -2
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -2
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +20 -3
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +33 -3
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +1 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +17 -2
- package/lib/src/config-provider/index.d.ts +49 -4
- package/lib/src/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/es/src/business/hooks/useGridRefresh.d.ts +0 -17
- package/es/src/business/hooks/useGridRefresh.mjs +0 -16
- package/es/src/business/hooks/useTableRefresh.d.ts +0 -20
- package/es/src/business/hooks/useTableRefresh.mjs +0 -57
- package/lib/src/business/hooks/useGridRefresh.d.ts +0 -17
- package/lib/src/business/hooks/useGridRefresh.js +0 -1
- package/lib/src/business/hooks/useTableRefresh.d.ts +0 -20
- package/lib/src/business/hooks/useTableRefresh.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Image as
|
|
3
|
-
import { DownloadOutlined as
|
|
4
|
-
import { injectLocaleToOss as
|
|
1
|
+
import { defineComponent as M, computed as n, ref as S, watchEffect as U, createBlock as p, openBlock as l, unref as a, mergeProps as f, withCtx as j, renderSlot as B, normalizeProps as E, guardReactiveProps as L, createElementVNode as g, normalizeClass as x, createElementBlock as D, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as z } from "vue";
|
|
2
|
+
import { Image as V } from "@aplus-frontend/antdv";
|
|
3
|
+
import { DownloadOutlined as W } from "@ant-design/icons-vue";
|
|
4
|
+
import { injectLocaleToOss as G, getOssInstance as $, getSignatureUrl as q } from "./hooks/useOss.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { omit as
|
|
10
|
-
import { useNamespace as
|
|
6
|
+
import H from "./style/index.mjs";
|
|
7
|
+
import J from "./imgs/admin-fallback.jpg.mjs";
|
|
8
|
+
import K from "./imgs/aplus-fallback.jpg.mjs";
|
|
9
|
+
import { omit as Q } from "lodash-unified";
|
|
10
|
+
import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
-
import { useLocale as
|
|
13
|
-
const
|
|
12
|
+
import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
const ue = /* @__PURE__ */ M({
|
|
14
14
|
__name: "ApImage",
|
|
15
15
|
props: {
|
|
16
16
|
getOssAccess: {},
|
|
@@ -20,20 +20,23 @@ const me = /* @__PURE__ */ S({
|
|
|
20
20
|
fallback: {},
|
|
21
21
|
src: {},
|
|
22
22
|
fileName: {},
|
|
23
|
+
uiMode: {},
|
|
23
24
|
preview: { type: [Boolean, Object], default: !0 }
|
|
24
25
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const { b: i } =
|
|
27
|
-
aplus:
|
|
28
|
-
admin:
|
|
29
|
-
},
|
|
26
|
+
setup(v) {
|
|
27
|
+
const { b: i } = X("ap-image"), m = H("ap-image"), e = v, u = {
|
|
28
|
+
aplus: K,
|
|
29
|
+
admin: J
|
|
30
|
+
}, b = c("apImage", { uiMode: "aplus" }), h = c("apUpload"), d = c(
|
|
30
31
|
"downloadCenterTriggerConfig"
|
|
31
|
-
),
|
|
32
|
+
), k = n(
|
|
33
|
+
() => e.uiMode || b.value?.uiMode
|
|
34
|
+
), { t: w, lang: C } = Y(), O = n(
|
|
32
35
|
() => e.getOssAccess || h.value?.getOssAccess
|
|
33
|
-
),
|
|
34
|
-
() => u[
|
|
35
|
-
),
|
|
36
|
-
|
|
36
|
+
), y = n(
|
|
37
|
+
() => u[k.value] || u.aplus
|
|
38
|
+
), A = n(() => e?.fallback || y.value), s = S("");
|
|
39
|
+
G(w, C), U(async () => {
|
|
37
40
|
if (!e?.src) {
|
|
38
41
|
s.value = "";
|
|
39
42
|
return;
|
|
@@ -43,55 +46,55 @@ const me = /* @__PURE__ */ S({
|
|
|
43
46
|
return;
|
|
44
47
|
}
|
|
45
48
|
try {
|
|
46
|
-
const t = await
|
|
49
|
+
const t = await $(O.value), r = await q({
|
|
47
50
|
oss: t,
|
|
48
51
|
fileName: e.src
|
|
49
52
|
});
|
|
50
|
-
|
|
53
|
+
r && (s.value = r);
|
|
51
54
|
} catch {
|
|
52
55
|
s.value = "";
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
|
-
async function
|
|
58
|
+
async function N() {
|
|
56
59
|
if (!e?.src)
|
|
57
60
|
return;
|
|
58
|
-
const t = e.src,
|
|
61
|
+
const t = e.src, r = e.fileName ?? e.src;
|
|
59
62
|
if (!e.src?.startsWith("Frontend-Upload")) {
|
|
60
|
-
|
|
63
|
+
I(t, r);
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
63
66
|
if (d.value?.trigger) {
|
|
64
|
-
let
|
|
67
|
+
let o = [
|
|
65
68
|
{
|
|
66
69
|
objectName: t,
|
|
67
|
-
fileName:
|
|
70
|
+
fileName: r
|
|
68
71
|
}
|
|
69
72
|
];
|
|
70
|
-
await d.value?.trigger(
|
|
73
|
+
await d.value?.trigger(o);
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
+
const I = (t, r) => {
|
|
77
|
+
const o = document.createElement("a");
|
|
78
|
+
o.href = t, o.rel = "noopener noreferrer", o.setAttribute("download", r), document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
76
79
|
};
|
|
77
|
-
return (t,
|
|
80
|
+
return (t, r) => (l(), p(a(V), f({
|
|
78
81
|
class: [a(i)(), a(m)]
|
|
79
82
|
}, {
|
|
80
|
-
...a(
|
|
81
|
-
fallback:
|
|
83
|
+
...a(Q)(e, ["src", "getOssAccess"]),
|
|
84
|
+
fallback: A.value,
|
|
82
85
|
src: s.value
|
|
83
86
|
}), {
|
|
84
|
-
toolbarRender: j((
|
|
85
|
-
B(t.$slots, "toolbarRender", E(L({ ...
|
|
87
|
+
toolbarRender: j((o) => [
|
|
88
|
+
B(t.$slots, "toolbarRender", E(L({ ...o })), () => [
|
|
86
89
|
g("div", {
|
|
87
|
-
class:
|
|
90
|
+
class: x([a(i)("toolbar"), a(m)])
|
|
88
91
|
}, [
|
|
89
|
-
(l(!0),
|
|
92
|
+
(l(!0), D(P, null, R(o.originalNodes, (_, F) => (l(), p(T(_), f({ ref_for: !0 }, e, { key: F }), null, 16))), 128)),
|
|
90
93
|
g("div", {
|
|
91
94
|
class: "ant-image-preview-operations-operation",
|
|
92
|
-
onClick:
|
|
95
|
+
onClick: N
|
|
93
96
|
}, [
|
|
94
|
-
|
|
97
|
+
z(a(W))
|
|
95
98
|
])
|
|
96
99
|
], 2)
|
|
97
100
|
])
|
|
@@ -101,5 +104,5 @@ const me = /* @__PURE__ */ S({
|
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
106
|
export {
|
|
104
|
-
|
|
107
|
+
ue as default
|
|
105
108
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
|
+
import { UiModeType } from '../../config-provider';
|
|
2
3
|
export interface ApImageProps {
|
|
3
4
|
getOssAccess?: () => Promise<accessCreate>;
|
|
4
5
|
width?: number | string;
|
|
@@ -7,6 +8,7 @@ export interface ApImageProps {
|
|
|
7
8
|
fallback?: string;
|
|
8
9
|
src?: string;
|
|
9
10
|
fileName?: string;
|
|
11
|
+
uiMode?: UiModeType;
|
|
10
12
|
preview?: boolean | {
|
|
11
13
|
visible?: boolean;
|
|
12
14
|
onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, computed as a, createElementBlock as n, openBlock as l, normalizeClass as r, unref as t, createElementVNode as i, renderSlot as p, Fragment as C, createBlock as M, createCommentVNode as v, toDisplayString as k, withCtx as I, createVNode as S, normalizeStyle as T } from "vue";
|
|
2
2
|
import { Tooltip as $ } from "@aplus-frontend/antdv";
|
|
3
3
|
import { QuestionCircleOutlined as N } from "@ant-design/icons-vue";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { useNamespace as
|
|
5
|
+
import A from "./style/index.mjs";
|
|
6
|
+
import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
7
|
import { useGlobalConfig as V } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
-
const O = /* @__PURE__ */
|
|
8
|
+
const O = /* @__PURE__ */ y({
|
|
9
9
|
name: "ApTitle",
|
|
10
10
|
__name: "ApTitle",
|
|
11
11
|
props: {
|
|
@@ -13,39 +13,42 @@ const O = /* @__PURE__ */ g({
|
|
|
13
13
|
helpMessage: { default: "" },
|
|
14
14
|
helpIconColor: { default: "" },
|
|
15
15
|
placement: { default: "top" },
|
|
16
|
-
trigger: { default: "hover" }
|
|
16
|
+
trigger: { default: "hover" },
|
|
17
|
+
uiMode: {}
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
setup(m) {
|
|
20
|
+
const o = m, { b: u, e: s, m: c } = B("ap-title"), d = A("ap-title"), f = V("apTitle", { uiMode: "aplus" }), g = a(
|
|
21
|
+
() => o.uiMode || f.value?.uiMode
|
|
22
|
+
), h = a(() => o.helpIconColor ? {
|
|
23
|
+
color: `${o.helpIconColor}`
|
|
21
24
|
} : {});
|
|
22
|
-
return (e, b) => (
|
|
23
|
-
class:
|
|
25
|
+
return (e, b) => (l(), n("div", {
|
|
26
|
+
class: r([t(u)(), `${t(c)(g.value)}`, t(d)])
|
|
24
27
|
}, [
|
|
25
|
-
|
|
26
|
-
class:
|
|
28
|
+
i("div", {
|
|
29
|
+
class: r(t(s)("prefix"))
|
|
27
30
|
}, [
|
|
28
|
-
e.$slots.prefix ?
|
|
29
|
-
|
|
30
|
-
e.helpMessage ? (
|
|
31
|
+
e.$slots.prefix ? p(e.$slots, "prefix", { key: 0 }) : (l(), n(C, { key: 1 }, [
|
|
32
|
+
i("span", null, k(e.title), 1),
|
|
33
|
+
e.helpMessage ? (l(), M(t($), {
|
|
31
34
|
key: 0,
|
|
32
35
|
title: e.helpMessage,
|
|
33
36
|
placement: e.placement,
|
|
34
37
|
trigger: e.trigger
|
|
35
38
|
}, {
|
|
36
39
|
default: I(() => [
|
|
37
|
-
|
|
38
|
-
style:
|
|
40
|
+
S(t(N), {
|
|
41
|
+
style: T(h.value)
|
|
39
42
|
}, null, 8, ["style"])
|
|
40
43
|
]),
|
|
41
44
|
_: 1
|
|
42
|
-
}, 8, ["title", "placement", "trigger"])) :
|
|
45
|
+
}, 8, ["title", "placement", "trigger"])) : v("", !0)
|
|
43
46
|
], 64))
|
|
44
47
|
], 2),
|
|
45
|
-
|
|
46
|
-
class:
|
|
48
|
+
i("div", {
|
|
49
|
+
class: r(t(s)("suffix"))
|
|
47
50
|
}, [
|
|
48
|
-
|
|
51
|
+
p(e.$slots, "suffix")
|
|
49
52
|
], 2)
|
|
50
53
|
], 2));
|
|
51
54
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
3
|
-
const { componentCls:
|
|
1
|
+
import { genComponentStyleHook as o } from "../../../utils/cssinjs/index.mjs";
|
|
2
|
+
const r = (e) => {
|
|
3
|
+
const { componentCls: t } = e;
|
|
4
4
|
return {
|
|
5
|
-
[
|
|
5
|
+
[t]: {
|
|
6
6
|
position: "relative",
|
|
7
7
|
width: "100%",
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
|
10
10
|
justifyContent: "space-between",
|
|
11
|
-
|
|
11
|
+
paddingInlineStart: "10px",
|
|
12
12
|
fontSize: e.fontSize,
|
|
13
13
|
"&::before": {
|
|
14
14
|
position: "absolute",
|
|
@@ -22,7 +22,7 @@ const i = (e) => {
|
|
|
22
22
|
borderRadius: "0px 4px 4px 0px",
|
|
23
23
|
zIndex: 1
|
|
24
24
|
},
|
|
25
|
-
[`${
|
|
25
|
+
[`${t}__prefix`]: {
|
|
26
26
|
fontWeight: "bold",
|
|
27
27
|
color: e.textColor1,
|
|
28
28
|
display: "flex",
|
|
@@ -47,7 +47,7 @@ const i = (e) => {
|
|
|
47
47
|
background: "#fff",
|
|
48
48
|
zIndex: 1
|
|
49
49
|
},
|
|
50
|
-
[
|
|
50
|
+
[t]: {
|
|
51
51
|
"&__prefix": {
|
|
52
52
|
fontWeight: "bold",
|
|
53
53
|
color: "#333",
|
|
@@ -61,15 +61,15 @@ const i = (e) => {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
[`${
|
|
64
|
+
[`${t}__suffix`]: {
|
|
65
65
|
color: "#526a90"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
}, n =
|
|
70
|
-
|
|
69
|
+
}, n = o("ApTitle", (e) => [
|
|
70
|
+
r(e)
|
|
71
71
|
]);
|
|
72
72
|
export {
|
|
73
73
|
n as default,
|
|
74
|
-
|
|
74
|
+
r as genApTitleStyle
|
|
75
75
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { usePageListApTable as o } from "./usePageListApTable.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useGridRefresh as a } from "./useGridRefresh.mjs";
|
|
5
|
-
import { usePageListAgGrid as u } from "./usePageListAgGrid.mjs";
|
|
2
|
+
import { usePageListApGrid as t } from "./usePageListApGrid.mjs";
|
|
3
|
+
import { usePageListAgGrid as p } from "./usePageListAgGrid.mjs";
|
|
6
4
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
o as usePageListApTable,
|
|
11
|
-
t as useTableRefresh
|
|
5
|
+
p as usePageListAgGrid,
|
|
6
|
+
t as usePageListApGrid,
|
|
7
|
+
o as usePageListApTable
|
|
12
8
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UseTableRefreshOption } from '..';
|
|
2
1
|
import { ApGridExpose, ApGridProps } from '../../ap-grid';
|
|
3
2
|
export interface UsePageListApGrid extends ApGridProps {
|
|
4
3
|
/** 是否显示默认的行选择配置
|
|
@@ -18,7 +17,7 @@ export interface UsePageListApGrid extends ApGridProps {
|
|
|
18
17
|
/**
|
|
19
18
|
* 表格刷新相关
|
|
20
19
|
*/
|
|
21
|
-
tableRefresh?: boolean |
|
|
20
|
+
tableRefresh?: boolean | (() => boolean);
|
|
22
21
|
/** 是否需要在deactivated的时候清空数据
|
|
23
22
|
* @default true
|
|
24
23
|
*/
|
|
@@ -1,75 +1,71 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { merge as i, cloneDeep as F } from "lodash-unified";
|
|
1
|
+
import { isFunction as F, merge as l, cloneDeep as w } from "lodash-unified";
|
|
3
2
|
import { ref as R } from "vue";
|
|
4
|
-
import { useKeepAliveFlag as
|
|
5
|
-
|
|
6
|
-
function W(a) {
|
|
3
|
+
import { useKeepAliveFlag as V } from "./useKeepAliveFlag.mjs";
|
|
4
|
+
function B(u) {
|
|
7
5
|
const r = R(null), {
|
|
8
|
-
isShowRowSelection:
|
|
6
|
+
isShowRowSelection: d = !0,
|
|
9
7
|
clearSelectionOnRequest: f = !0,
|
|
10
8
|
transformSearchFormValues: o,
|
|
11
|
-
api:
|
|
12
|
-
tableRefresh:
|
|
13
|
-
virtual:
|
|
14
|
-
clearDataOnDeactivated:
|
|
15
|
-
...
|
|
16
|
-
} =
|
|
17
|
-
let
|
|
18
|
-
const
|
|
9
|
+
api: a,
|
|
10
|
+
tableRefresh: s = !0,
|
|
11
|
+
virtual: p,
|
|
12
|
+
clearDataOnDeactivated: m = !0,
|
|
13
|
+
...v
|
|
14
|
+
} = u || {};
|
|
15
|
+
let n = null;
|
|
16
|
+
const c = () => {
|
|
19
17
|
r.value?.rowSelection?.clearAll();
|
|
20
|
-
}
|
|
21
|
-
V({
|
|
22
|
-
...b(d),
|
|
23
|
-
apTableRef: r
|
|
24
|
-
});
|
|
25
|
-
const u = () => {
|
|
18
|
+
}, i = () => {
|
|
26
19
|
r.value?.submitWith(!0);
|
|
27
|
-
},
|
|
20
|
+
}, S = () => {
|
|
28
21
|
r.value?.reset();
|
|
29
|
-
}, { isDeactivated:
|
|
30
|
-
|
|
22
|
+
}, { isDeactivated: h } = V({
|
|
23
|
+
afterActivated() {
|
|
24
|
+
(F(s) ? s() : s) && i();
|
|
25
|
+
},
|
|
26
|
+
afterDeactivated: i
|
|
31
27
|
});
|
|
32
|
-
return [
|
|
28
|
+
return [l(
|
|
33
29
|
{
|
|
34
30
|
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
35
31
|
scroll: { x: "100%", y: "100%" },
|
|
36
32
|
columnResizable: !0,
|
|
37
|
-
request:
|
|
38
|
-
if (
|
|
33
|
+
request: a ? async (e) => {
|
|
34
|
+
if (h() && m)
|
|
39
35
|
return {
|
|
40
36
|
data: [],
|
|
41
37
|
total: 0
|
|
42
38
|
};
|
|
43
|
-
|
|
39
|
+
n = e.sort;
|
|
44
40
|
const t = o ? o(e) : e;
|
|
45
|
-
if (!
|
|
46
|
-
const { records: g, total: A } = await
|
|
47
|
-
return f &&
|
|
41
|
+
if (!a) throw new Error("api is not defined");
|
|
42
|
+
const { records: g, total: A } = await a(t);
|
|
43
|
+
return f && c(), {
|
|
48
44
|
data: g,
|
|
49
45
|
total: A
|
|
50
46
|
};
|
|
51
47
|
} : void 0,
|
|
52
|
-
rowSelection:
|
|
48
|
+
rowSelection: d ? {
|
|
53
49
|
fixed: "left",
|
|
54
50
|
columnWidth: 38
|
|
55
51
|
} : void 0,
|
|
56
52
|
ref(e) {
|
|
57
53
|
r.value = e;
|
|
58
54
|
},
|
|
59
|
-
virtual:
|
|
55
|
+
virtual: l(
|
|
60
56
|
{
|
|
61
57
|
oSize: 20,
|
|
62
58
|
y: 20
|
|
63
59
|
},
|
|
64
|
-
|
|
60
|
+
p
|
|
65
61
|
),
|
|
66
62
|
// 新UI规范,需要都添加分割线
|
|
67
63
|
card: !0
|
|
68
64
|
},
|
|
69
|
-
|
|
65
|
+
v
|
|
70
66
|
), {
|
|
71
|
-
reload:
|
|
72
|
-
reset:
|
|
67
|
+
reload: i,
|
|
68
|
+
reset: S,
|
|
73
69
|
getSearchFormValues: (e = !0) => {
|
|
74
70
|
const t = r.value?.getSearchFormValues(!!e) || {};
|
|
75
71
|
return o ? o(t) : t;
|
|
@@ -77,16 +73,11 @@ function W(a) {
|
|
|
77
73
|
getApGridInstance: () => r.value,
|
|
78
74
|
getSearchFormValuesAndSorted: (e = !0) => {
|
|
79
75
|
const t = r.value?.getSearchFormValues(!!e) || {};
|
|
80
|
-
return t.sort =
|
|
76
|
+
return t.sort = n && w(n), o ? o(t) : t;
|
|
81
77
|
},
|
|
82
|
-
clearSelection:
|
|
78
|
+
clearSelection: c
|
|
83
79
|
}];
|
|
84
80
|
}
|
|
85
|
-
function b(a) {
|
|
86
|
-
return a === !0 ? {} : a === !1 ? {
|
|
87
|
-
refreshBefore: () => !1
|
|
88
|
-
} : a;
|
|
89
|
-
}
|
|
90
81
|
export {
|
|
91
|
-
|
|
82
|
+
B as usePageListApGrid
|
|
92
83
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ApTableProps } from '../../';
|
|
2
|
-
import { UseTableRefreshOption } from './useTableRefresh';
|
|
3
2
|
import { Recordable } from '../../type';
|
|
4
3
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
5
4
|
import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
|
|
@@ -22,7 +21,7 @@ export interface UsePageListApTable extends ApTableProps {
|
|
|
22
21
|
/**
|
|
23
22
|
* 表格刷新相关
|
|
24
23
|
*/
|
|
25
|
-
tableRefresh?: boolean |
|
|
24
|
+
tableRefresh?: boolean | (() => boolean);
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* 集成了列表页面的ApTable的默认配置
|
|
@@ -1,29 +1,42 @@
|
|
|
1
|
-
import { merge as
|
|
2
|
-
import { ref as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transformSearchFormValues: a,
|
|
15
|
-
api: s,
|
|
16
|
-
tableRefresh: f = !1,
|
|
17
|
-
...m
|
|
18
|
-
} = o || {};
|
|
1
|
+
import { isFunction as g, merge as v, cloneDeep as b } from "lodash-unified";
|
|
2
|
+
import { ref as A } from "vue";
|
|
3
|
+
import { warning as F } from "../../utils/warning.mjs";
|
|
4
|
+
import { useKeepAliveFlag as w } from "./useKeepAliveFlag.mjs";
|
|
5
|
+
function k(u) {
|
|
6
|
+
const r = A(null), {
|
|
7
|
+
isShowRowSelection: f = !0,
|
|
8
|
+
clearSelectionOnRequest: m = !0,
|
|
9
|
+
transformSearchFormValues: o,
|
|
10
|
+
api: a,
|
|
11
|
+
tableRefresh: s = !1,
|
|
12
|
+
...p
|
|
13
|
+
} = u || {};
|
|
19
14
|
let l = null;
|
|
20
15
|
const c = () => {
|
|
21
16
|
r.value?.rowSelection?.clearAll();
|
|
17
|
+
}, d = async (e) => {
|
|
18
|
+
l = e.sort;
|
|
19
|
+
const t = o ? o(e) : e;
|
|
20
|
+
try {
|
|
21
|
+
if (!a) throw new Error("api is not defined");
|
|
22
|
+
const { records: n, total: S } = await a(t);
|
|
23
|
+
return m && c(), {
|
|
24
|
+
data: n,
|
|
25
|
+
total: S
|
|
26
|
+
};
|
|
27
|
+
} catch (n) {
|
|
28
|
+
return F(!1, n), {
|
|
29
|
+
data: [],
|
|
30
|
+
total: 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
22
33
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
w({
|
|
35
|
+
afterActivated() {
|
|
36
|
+
(g(s) ? s() : s) && i();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const h = v(
|
|
27
40
|
{
|
|
28
41
|
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
29
42
|
scroll: { x: "100%", y: "100%" },
|
|
@@ -31,24 +44,8 @@ function O(o) {
|
|
|
31
44
|
columnResizable: !0,
|
|
32
45
|
// 表格header吸顶效果
|
|
33
46
|
class: "ap-table--sticky",
|
|
34
|
-
request:
|
|
35
|
-
|
|
36
|
-
const t = a ? a(e) : e;
|
|
37
|
-
try {
|
|
38
|
-
if (!s) throw new Error("api is not defined");
|
|
39
|
-
const { records: n, total: p } = await s(t);
|
|
40
|
-
return i && c(), {
|
|
41
|
-
data: n,
|
|
42
|
-
total: p
|
|
43
|
-
};
|
|
44
|
-
} catch (n) {
|
|
45
|
-
return g(!1, n), {
|
|
46
|
-
data: [],
|
|
47
|
-
total: 0
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
} : void 0,
|
|
51
|
-
rowSelection: u ? {
|
|
47
|
+
request: a ? d : void 0,
|
|
48
|
+
rowSelection: f ? {
|
|
52
49
|
mode: "internal",
|
|
53
50
|
fixed: "left",
|
|
54
51
|
columnWidth: 50
|
|
@@ -59,26 +56,27 @@ function O(o) {
|
|
|
59
56
|
// 新UI规范,需要都添加分割线
|
|
60
57
|
card: !0
|
|
61
58
|
},
|
|
62
|
-
|
|
63
|
-
), {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
p
|
|
60
|
+
), i = () => {
|
|
61
|
+
r.value?.submit();
|
|
62
|
+
};
|
|
63
|
+
return [h, {
|
|
64
|
+
reload: i,
|
|
67
65
|
reset: () => {
|
|
68
66
|
r.value?.reset();
|
|
69
67
|
},
|
|
70
68
|
getSearchFormValues: (e) => {
|
|
71
69
|
const t = r.value?.getSearchFormValues(e) || {};
|
|
72
|
-
return
|
|
70
|
+
return o ? o(t) : t;
|
|
73
71
|
},
|
|
74
72
|
getApTableInstance: () => r.value,
|
|
75
73
|
getSearchFormValuesAndSorted: (e) => {
|
|
76
74
|
const t = r.value?.getSearchFormValues(e) || {};
|
|
77
|
-
return t.sort = l &&
|
|
75
|
+
return t.sort = l && b(l), o ? o(t) : t;
|
|
78
76
|
},
|
|
79
77
|
clearSelection: c
|
|
80
78
|
}];
|
|
81
79
|
}
|
|
82
80
|
export {
|
|
83
|
-
|
|
81
|
+
k as usePageListApTable
|
|
84
82
|
};
|