@aplus-frontend/ui 0.1.37 → 0.1.39
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/ap-descriptions/formatter/index.mjs +24 -24
- package/es/src/ap-form/interface.d.ts +29 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +56 -47
- package/es/src/ap-form/style/drawer-form.css +10 -0
- package/es/src/ap-table/ap-table.vue.mjs +69 -68
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +37 -37
- package/es/src/ap-table/style/ap-table.css +6 -0
- package/es/src/business/ap-card/ApCard.vue2.mjs +18 -20
- package/es/src/business/ap-select-layout/interface.d.ts +1 -0
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +66 -62
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +41 -24
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +12 -11
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +11 -10
- package/es/src/business/ap-table-modal/index.d.ts +21 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +31 -30
- package/es/src/business/index.d.ts +1 -0
- package/es/src/theme/ap-form/drawer-form.css +10 -0
- package/es/src/theme/ap-table/ap-table.css +6 -0
- package/es/src/theme/css-var/index.mjs +10 -0
- package/lib/src/ap-descriptions/formatter/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +29 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/drawer-form.css +10 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/style/ap-table.css +6 -0
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
- package/lib/src/business/ap-select-layout/interface.d.ts +1 -0
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +21 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/theme/ap-form/drawer-form.css +10 -0
- package/lib/src/theme/ap-table/ap-table.css +6 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
2
|
-
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { Ref, ComputedRef, ShallowRef } from 'vue';
|
|
3
3
|
export declare const useTableColumnState: (columnSetting: ApTableSettingType, initialColumnState: ApColumnState[]) => {
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
@@ -16,7 +16,7 @@ export declare const useTableColumnState: (columnSetting: ApTableSettingType, in
|
|
|
16
16
|
setColumnState: (nextColumnState: ApColumnState[]) => void;
|
|
17
17
|
isAllSelected: ComputedRef<boolean>;
|
|
18
18
|
toggleSelectAll: () => void;
|
|
19
|
-
columnStateBackup: ApColumnState[]
|
|
19
|
+
columnStateBackup: ShallowRef<ApColumnState[]>;
|
|
20
20
|
setColumnStateBackup: (nextBackup: ApColumnState[]) => void;
|
|
21
21
|
cacheColumnStateIfNeeded: (nextColumnState: ApColumnState[]) => void;
|
|
22
22
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ref as _, unref as i, computed as j, watchEffect as z } from "vue";
|
|
1
|
+
import { ref as R, shallowRef as _, unref as i, computed as j, watchEffect as z } from "vue";
|
|
2
2
|
import { isDef as D } from "../../utils/index.mjs";
|
|
3
|
-
import G, { customCloneColumnStates as
|
|
4
|
-
import { useInjectApTable as
|
|
5
|
-
import { isObject as
|
|
6
|
-
function
|
|
3
|
+
import G, { customCloneColumnStates as A, getColumnStateString as W } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as X } from "../context.mjs";
|
|
5
|
+
import { isObject as k, mergeWith as E, isBoolean as q, omit as H, isNumber as N } from "lodash-unified";
|
|
6
|
+
function u(r, n) {
|
|
7
7
|
r.forEach((t) => {
|
|
8
8
|
var c;
|
|
9
|
-
|
|
9
|
+
n(t), (c = t.children) != null && c.length && u(t.children, n);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
12
|
+
function L(r, n) {
|
|
13
|
+
if (!n)
|
|
14
14
|
return {};
|
|
15
|
-
const t = r.getItem(
|
|
15
|
+
const t = r.getItem(n);
|
|
16
16
|
return t ? JSON.parse(t) : {};
|
|
17
17
|
}
|
|
18
|
-
function I(r,
|
|
19
|
-
if (
|
|
20
|
-
return E({}, r,
|
|
18
|
+
function I(r, n) {
|
|
19
|
+
if (k(r) && k(n))
|
|
20
|
+
return E({}, r, n, I);
|
|
21
21
|
}
|
|
22
|
-
const B = Number.MAX_SAFE_INTEGER,
|
|
23
|
-
const t = _(
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const B = Number.MAX_SAFE_INTEGER, $ = (r, n) => {
|
|
23
|
+
const t = R(n), c = _(
|
|
24
|
+
A(n)
|
|
25
|
+
), { columnsBackup: h, updateColumns: f } = X(), T = r.persistenceType || "localStorage", S = window[T];
|
|
26
26
|
function F() {
|
|
27
|
-
const e =
|
|
27
|
+
const e = L(
|
|
28
28
|
S,
|
|
29
29
|
r.persistenceKey
|
|
30
|
-
),
|
|
30
|
+
), o = E(
|
|
31
31
|
{},
|
|
32
32
|
r.defaultValue || {},
|
|
33
33
|
e,
|
|
34
34
|
I
|
|
35
35
|
), l = i(h);
|
|
36
|
-
function
|
|
36
|
+
function v(M, d, b) {
|
|
37
37
|
return M.map((s) => {
|
|
38
|
-
var
|
|
38
|
+
var x;
|
|
39
39
|
const a = (d == null ? void 0 : d[s.key]) || {}, m = {
|
|
40
40
|
key: s.key,
|
|
41
41
|
label: s.title,
|
|
42
42
|
show: !0,
|
|
43
|
-
fixed:
|
|
43
|
+
fixed: b ? b.fixed : q(s.fixed) ? s.fixed ? "left" : void 0 : s.fixed,
|
|
44
44
|
disabled: !1,
|
|
45
|
-
...
|
|
45
|
+
...H(a, "children")
|
|
46
46
|
};
|
|
47
|
-
return m.children = (
|
|
47
|
+
return m.children = (x = s.children) != null && x.length ? v(
|
|
48
48
|
s.children,
|
|
49
49
|
a.children,
|
|
50
50
|
m
|
|
@@ -53,49 +53,49 @@ const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
|
|
|
53
53
|
(s, a) => (N(s.order) ? s.order : B) - (N(a.order) ? a.order : B)
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return v(l || [], o);
|
|
57
57
|
}
|
|
58
58
|
const g = j(() => i(t).every((e) => e.show));
|
|
59
59
|
function p() {
|
|
60
60
|
const e = i(t);
|
|
61
|
-
|
|
62
|
-
!
|
|
61
|
+
u(e, (o) => {
|
|
62
|
+
!o.disabled && (o.show = !0);
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function C() {
|
|
66
66
|
const e = i(t);
|
|
67
|
-
|
|
68
|
-
!
|
|
67
|
+
u(e, (o) => {
|
|
68
|
+
!o.disabled && (o.show = !1);
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
function O() {
|
|
72
72
|
i(g) ? C() : p();
|
|
73
73
|
}
|
|
74
|
-
function K(e,
|
|
75
|
-
|
|
76
|
-
l.key === e && (l.show = D(
|
|
74
|
+
function K(e, o) {
|
|
75
|
+
u(i(t), (l) => {
|
|
76
|
+
l.key === e && (l.show = D(o) ? o : !l.show);
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
function w(e) {
|
|
80
80
|
t.value = e;
|
|
81
81
|
}
|
|
82
82
|
function J(e) {
|
|
83
|
-
c = e;
|
|
83
|
+
c.value = e;
|
|
84
84
|
}
|
|
85
85
|
function y(e) {
|
|
86
86
|
if (r.persistenceKey) {
|
|
87
|
-
const
|
|
88
|
-
S.setItem(r.persistenceKey, JSON.stringify(
|
|
87
|
+
const o = W(e);
|
|
88
|
+
S.setItem(r.persistenceKey, JSON.stringify(o));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return z(() => {
|
|
92
92
|
const e = F();
|
|
93
|
-
w(e),
|
|
93
|
+
w(e), f == null || f(
|
|
94
94
|
G(
|
|
95
95
|
i(h),
|
|
96
96
|
i(e)
|
|
97
97
|
)
|
|
98
|
-
), c =
|
|
98
|
+
), c.value = A(e), y(e);
|
|
99
99
|
}), {
|
|
100
100
|
columnState: t,
|
|
101
101
|
selectAll: p,
|
|
@@ -110,5 +110,5 @@ const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
|
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
$ as useTableColumnState
|
|
114
114
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as g, computed as r, openBlock as t, createElementBlock as s, normalizeClass as C, unref as
|
|
1
|
+
import { defineComponent as g, computed as r, openBlock as t, createElementBlock as s, normalizeClass as C, unref as u, normalizeStyle as h, createBlock as a, mergeProps as S, createSlots as B, withCtx as x, isVNode as P, resolveDynamicComponent as y, toDisplayString as _, createCommentVNode as N, renderSlot as $ } from "vue";
|
|
2
2
|
import "./index.css";
|
|
3
3
|
import "../ap-title/ApTitle.vue.mjs";
|
|
4
4
|
import { omit as b } from "lodash-unified";
|
|
@@ -12,44 +12,42 @@ const V = { key: 1 }, j = { key: 1 }, H = /* @__PURE__ */ g({
|
|
|
12
12
|
padding: {}
|
|
13
13
|
},
|
|
14
14
|
setup(k) {
|
|
15
|
-
const e = k, { b: f } = z("ap-card"),
|
|
15
|
+
const e = k, { b: f } = z("ap-card"), v = r(
|
|
16
16
|
() => b((e == null ? void 0 : e.titleProps) || {}, ["prefix", "suffix"])
|
|
17
|
-
),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
), v = r(() => e.padding ?? (c.value ? "14px 24px 24px" : "24px"));
|
|
17
|
+
), m = r(() => {
|
|
18
|
+
var n;
|
|
19
|
+
return (n = Object.keys((e == null ? void 0 : e.titleProps) || {})) == null ? void 0 : n.length;
|
|
20
|
+
}), p = r(() => e.padding ?? (m.value ? "14px 24px 24px" : "24px"));
|
|
23
21
|
return (n, w) => {
|
|
24
|
-
var
|
|
22
|
+
var c, d;
|
|
25
23
|
return t(), s("div", {
|
|
26
|
-
class: C([
|
|
24
|
+
class: C([u(f)()]),
|
|
27
25
|
style: h({
|
|
28
|
-
padding:
|
|
26
|
+
padding: p.value
|
|
29
27
|
})
|
|
30
28
|
}, [
|
|
31
|
-
|
|
29
|
+
m.value ? (t(), a(D, S({
|
|
32
30
|
key: 0,
|
|
33
|
-
class: [`${
|
|
31
|
+
class: [`${u(f)()}-title`]
|
|
34
32
|
}, {
|
|
35
|
-
...
|
|
33
|
+
...v.value
|
|
36
34
|
}), B({ _: 2 }, [
|
|
37
|
-
(
|
|
35
|
+
(c = e == null ? void 0 : e.titleProps) != null && c.suffix ? {
|
|
38
36
|
name: "suffix",
|
|
39
|
-
fn:
|
|
37
|
+
fn: x(() => {
|
|
40
38
|
var i, o, l;
|
|
41
39
|
return [
|
|
42
|
-
|
|
40
|
+
P((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.suffix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.suffix), { key: 0 })) : (t(), s("div", V, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.suffix), 1))
|
|
43
41
|
];
|
|
44
42
|
}),
|
|
45
43
|
key: "0"
|
|
46
44
|
} : void 0,
|
|
47
|
-
(
|
|
45
|
+
(d = e == null ? void 0 : e.titleProps) != null && d.prefix ? {
|
|
48
46
|
name: "prefix",
|
|
49
|
-
fn:
|
|
47
|
+
fn: x(() => {
|
|
50
48
|
var i, o, l;
|
|
51
49
|
return [
|
|
52
|
-
|
|
50
|
+
P((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.prefix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.prefix), { key: 0 })) : (t(), s("div", j, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.prefix), 1))
|
|
53
51
|
];
|
|
54
52
|
}),
|
|
55
53
|
key: "1"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
1
|
+
import { defineComponent as M, ref as r, computed as O, onMounted as U, openBlock as p, createElementBlock as f, normalizeClass as o, unref as e, createVNode as d, Transition as W, withCtx as u, withDirectives as E, createElementVNode as s, toDisplayString as $, createTextVNode as x, Fragment as z, renderList as R, renderSlot as A, vShow as N, createCommentVNode as j } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { IconApLeftarrow as G, IconApMenu as H } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -12,127 +12,131 @@ const X = ["onClick"], de = /* @__PURE__ */ M({
|
|
|
12
12
|
props: {
|
|
13
13
|
title: {},
|
|
14
14
|
request: {},
|
|
15
|
+
onSearch: {},
|
|
15
16
|
defaultFold: { type: Boolean, default: !1 }
|
|
16
17
|
},
|
|
17
18
|
emits: ["onSelect", "afterEnter", "afterLeave"],
|
|
18
19
|
setup(_, { emit: w }) {
|
|
19
|
-
const { b: m, be:
|
|
20
|
-
|
|
20
|
+
const { b: m, be: h, bem: i } = P("ap-select-layout"), a = _, y = w, C = r(), v = r(a.defaultFold), g = r(!a.defaultFold), S = r(), T = r(), b = r(), k = r(""), L = () => {
|
|
21
|
+
v.value = !v.value, S.value = !1, T.value = !1;
|
|
21
22
|
}, F = (t) => {
|
|
22
|
-
b.value = t,
|
|
23
|
+
b.value = t, y("onSelect", t);
|
|
23
24
|
}, B = K((t) => {
|
|
24
|
-
var
|
|
25
|
-
k.value = (
|
|
25
|
+
var n;
|
|
26
|
+
k.value = (n = t.target) == null ? void 0 : n.value;
|
|
26
27
|
}, 500), q = O(() => {
|
|
27
28
|
var t;
|
|
28
|
-
return (t =
|
|
29
|
+
return (t = C.value) == null ? void 0 : t.filter((n) => {
|
|
30
|
+
var c, l;
|
|
31
|
+
return a != null && a.onSearch ? (c = a.onSearch) == null ? void 0 : c.call(a, n, k.value) : (l = n == null ? void 0 : n.name) == null ? void 0 : l.includes(k.value);
|
|
32
|
+
});
|
|
29
33
|
}), D = (t) => {
|
|
30
|
-
|
|
34
|
+
g.value = !0, y("afterEnter", t);
|
|
31
35
|
}, I = (t) => {
|
|
32
|
-
|
|
36
|
+
g.value = !1, y("afterLeave", t);
|
|
33
37
|
};
|
|
34
38
|
return U(() => {
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
39
|
+
a.request().then((t) => {
|
|
40
|
+
var n;
|
|
41
|
+
C.value = t, F((n = C.value) == null ? void 0 : n[0]);
|
|
38
42
|
});
|
|
39
|
-
}), (t,
|
|
40
|
-
var
|
|
41
|
-
return p(),
|
|
42
|
-
class:
|
|
43
|
+
}), (t, n) => {
|
|
44
|
+
var c;
|
|
45
|
+
return p(), f("div", {
|
|
46
|
+
class: o(e(m)())
|
|
43
47
|
}, [
|
|
44
|
-
|
|
48
|
+
d(W, {
|
|
45
49
|
mode: "out-in",
|
|
46
50
|
onAfterEnter: D,
|
|
47
51
|
onAfterLeave: I
|
|
48
52
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
|
|
51
|
-
class:
|
|
53
|
+
default: u(() => [
|
|
54
|
+
E(s("div", {
|
|
55
|
+
class: o(e(m)("side"))
|
|
52
56
|
}, [
|
|
53
|
-
|
|
54
|
-
class:
|
|
57
|
+
s("div", {
|
|
58
|
+
class: o(e(h)("side", "header"))
|
|
55
59
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class:
|
|
60
|
+
s("h3", null, $(a.title), 1),
|
|
61
|
+
s("div", {
|
|
62
|
+
class: o(e(i)("side", "header", "imgWrap"))
|
|
59
63
|
}, [
|
|
60
|
-
|
|
61
|
-
open:
|
|
62
|
-
"onUpdate:open":
|
|
64
|
+
d(e(V), {
|
|
65
|
+
open: S.value,
|
|
66
|
+
"onUpdate:open": n[0] || (n[0] = (l) => S.value = l)
|
|
63
67
|
}, {
|
|
64
|
-
title:
|
|
68
|
+
title: u(() => [
|
|
65
69
|
x("收起")
|
|
66
70
|
]),
|
|
67
|
-
default:
|
|
68
|
-
|
|
71
|
+
default: u(() => [
|
|
72
|
+
d(e(G), { onClick: L })
|
|
69
73
|
]),
|
|
70
74
|
_: 1
|
|
71
75
|
}, 8, ["open"])
|
|
72
76
|
], 2)
|
|
73
77
|
], 2),
|
|
74
|
-
|
|
75
|
-
class:
|
|
78
|
+
s("div", {
|
|
79
|
+
class: o(e(h)("side", "body"))
|
|
76
80
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
81
|
+
s("div", {
|
|
82
|
+
class: o(e(i)("side", "body", "search"))
|
|
79
83
|
}, [
|
|
80
|
-
|
|
84
|
+
d(e(Q), {
|
|
81
85
|
placeholder: "请输入",
|
|
82
86
|
onChange: e(B)
|
|
83
87
|
}, null, 8, ["onChange"])
|
|
84
88
|
], 2),
|
|
85
|
-
|
|
86
|
-
class:
|
|
89
|
+
s("div", {
|
|
90
|
+
class: o(e(i)("side", "body", "scroll"))
|
|
87
91
|
}, [
|
|
88
|
-
(p(!0),
|
|
89
|
-
key:
|
|
90
|
-
class:
|
|
91
|
-
onClick: (Y) => F(
|
|
92
|
+
(p(!0), f(z, null, R(q.value, (l) => E((p(), f("div", {
|
|
93
|
+
key: l.value,
|
|
94
|
+
class: o(`${e(i)("side", "body", "scroll-item")} ${b.value === l ? "active" : ""}`),
|
|
95
|
+
onClick: (Y) => F(l)
|
|
92
96
|
}, [
|
|
93
|
-
A(t.$slots, "itemRender", { item:
|
|
94
|
-
|
|
95
|
-
ellipsis: { tooltip:
|
|
96
|
-
content: `${
|
|
97
|
+
A(t.$slots, "itemRender", { item: l }, () => [
|
|
98
|
+
d(e(J), {
|
|
99
|
+
ellipsis: { tooltip: l.name },
|
|
100
|
+
content: `${l.name}`
|
|
97
101
|
}, null, 8, ["ellipsis", "content"])
|
|
98
102
|
])
|
|
99
103
|
], 10, X)), [
|
|
100
|
-
[N,
|
|
104
|
+
[N, g.value]
|
|
101
105
|
])), 128))
|
|
102
106
|
], 2)
|
|
103
107
|
], 2)
|
|
104
108
|
], 2), [
|
|
105
|
-
[N, !
|
|
109
|
+
[N, !v.value]
|
|
106
110
|
])
|
|
107
111
|
]),
|
|
108
112
|
_: 3
|
|
109
113
|
}),
|
|
110
|
-
|
|
111
|
-
class:
|
|
114
|
+
s("div", {
|
|
115
|
+
class: o(e(m)("content"))
|
|
112
116
|
}, [
|
|
113
|
-
|
|
114
|
-
class:
|
|
117
|
+
s("div", {
|
|
118
|
+
class: o(e(h)("content", "header"))
|
|
115
119
|
}, [
|
|
116
|
-
|
|
120
|
+
v.value ? (p(), f("div", {
|
|
117
121
|
key: 0,
|
|
118
|
-
class:
|
|
122
|
+
class: o(e(i)("content", "header", "imgWrap"))
|
|
119
123
|
}, [
|
|
120
|
-
|
|
124
|
+
d(e(V), {
|
|
121
125
|
open: T.value,
|
|
122
|
-
"onUpdate:open":
|
|
126
|
+
"onUpdate:open": n[1] || (n[1] = (l) => T.value = l)
|
|
123
127
|
}, {
|
|
124
|
-
title:
|
|
128
|
+
title: u(() => [
|
|
125
129
|
x("展开")
|
|
126
130
|
]),
|
|
127
|
-
default:
|
|
128
|
-
|
|
131
|
+
default: u(() => [
|
|
132
|
+
d(e(H), { onClick: L })
|
|
129
133
|
]),
|
|
130
134
|
_: 1
|
|
131
135
|
}, 8, ["open"])
|
|
132
136
|
], 2)) : j("", !0),
|
|
133
|
-
|
|
134
|
-
class:
|
|
135
|
-
}, $((
|
|
137
|
+
s("div", {
|
|
138
|
+
class: o(e(i)("content", "header", "title"))
|
|
139
|
+
}, $((c = b.value) == null ? void 0 : c.name), 3)
|
|
136
140
|
], 2),
|
|
137
141
|
A(t.$slots, "default")
|
|
138
142
|
], 2)
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
3
5
|
readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
|
|
4
6
|
readonly closeModal: () => void;
|
|
5
7
|
readonly destroy: () => void;
|
|
8
|
+
readonly reloadApTableData: () => void;
|
|
9
|
+
readonly resetApTableData: () => void;
|
|
10
|
+
readonly getApTableInstance: () => {
|
|
11
|
+
submit: () => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
15
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
16
|
+
dataSource: any;
|
|
17
|
+
rowSelection?: {
|
|
18
|
+
select: (item: any) => void;
|
|
19
|
+
selectAll: () => void;
|
|
20
|
+
unSelectAll: () => void;
|
|
21
|
+
selectedRows: any[];
|
|
22
|
+
unSelect: (item: any) => void;
|
|
23
|
+
isSelected: (item: any) => boolean;
|
|
24
|
+
clearAll: () => void;
|
|
25
|
+
toggleSelect: (item: any) => void;
|
|
26
|
+
} | undefined;
|
|
27
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
28
|
+
} | null | undefined;
|
|
6
29
|
readonly isDestroyed: true;
|
|
7
30
|
};
|
|
@@ -1,40 +1,57 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as T, defineComponent as g, h as r, render as u, onUnmounted as C } from "vue";
|
|
2
2
|
import "../table-modal.vue.mjs";
|
|
3
3
|
import "../../../index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { ConfigProvider as
|
|
6
|
-
import
|
|
7
|
-
function E(
|
|
8
|
-
let
|
|
9
|
-
const
|
|
10
|
-
const e =
|
|
4
|
+
import { omit as y } from "lodash-unified";
|
|
5
|
+
import { ConfigProvider as A, globalConfigCached as h } from "../../../config-provider/config-provider.mjs";
|
|
6
|
+
import I from "../table-modal.vue2.mjs";
|
|
7
|
+
function E(l) {
|
|
8
|
+
let n = !0;
|
|
9
|
+
const s = document.body, t = T(), { destroyOnUnmounted: i = !0 } = l, a = document.createElement("div"), m = () => {
|
|
10
|
+
const e = g({
|
|
11
11
|
setup() {
|
|
12
12
|
return () => r(
|
|
13
|
-
|
|
14
|
-
{ ...
|
|
15
|
-
r(
|
|
16
|
-
...
|
|
13
|
+
A,
|
|
14
|
+
{ ...h.value },
|
|
15
|
+
r(I, {
|
|
16
|
+
...y(l, "destroyOnUnmounted"),
|
|
17
17
|
ref: t
|
|
18
18
|
})
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
},
|
|
22
|
+
s.appendChild(a), u(r(e), a), n = !1;
|
|
23
|
+
}, c = () => {
|
|
24
24
|
var e;
|
|
25
|
-
(e = t.value) == null || e.close(),
|
|
26
|
-
|
|
25
|
+
(e = t.value) == null || e.close(), n || setTimeout(() => {
|
|
26
|
+
u(null, a), s.removeChild(a), n = !0;
|
|
27
27
|
}, 400);
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
return t.value ||
|
|
31
|
-
},
|
|
28
|
+
}, f = async (e = [], o = {}) => {
|
|
29
|
+
var d;
|
|
30
|
+
return t.value || m(), (d = t.value) == null ? void 0 : d.open(e, o);
|
|
31
|
+
}, p = () => {
|
|
32
32
|
var e;
|
|
33
|
-
|
|
33
|
+
n || (e = t.value) == null || e.close();
|
|
34
|
+
}, v = () => {
|
|
35
|
+
var e, o;
|
|
36
|
+
(o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.submit();
|
|
37
|
+
}, b = () => {
|
|
38
|
+
var e, o;
|
|
39
|
+
(o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.reset();
|
|
40
|
+
};
|
|
41
|
+
return C(() => {
|
|
42
|
+
i && c();
|
|
43
|
+
}), {
|
|
44
|
+
openModal: f,
|
|
45
|
+
closeModal: p,
|
|
46
|
+
destroy: c,
|
|
47
|
+
reloadApTableData: v,
|
|
48
|
+
resetApTableData: b,
|
|
49
|
+
getApTableInstance: () => {
|
|
50
|
+
var e;
|
|
51
|
+
return (e = t.value) == null ? void 0 : e.getApTableInstance();
|
|
52
|
+
},
|
|
53
|
+
isDestroyed: n
|
|
34
54
|
};
|
|
35
|
-
return y(() => {
|
|
36
|
-
s && l();
|
|
37
|
-
}), { openModal: c, closeModal: f, destroy: l, isDestroyed: o };
|
|
38
55
|
}
|
|
39
56
|
export {
|
|
40
57
|
E as useCreateTableModal
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { ApTableModalProps, OpenOptions } from '../interface';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { TableColumnsType } from 'ant-design-vue';
|
|
2
4
|
/** 函数式调用弹框表格 */
|
|
3
5
|
export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
|
|
6
|
+
reloadApTableData: () => void;
|
|
7
|
+
resetApTableData: () => void;
|
|
8
|
+
getApTableInstance: () => {
|
|
9
|
+
submit: () => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
refresh: () => void;
|
|
12
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
13
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
14
|
+
dataSource: any;
|
|
15
|
+
rowSelection?: {
|
|
16
|
+
select: (item: any) => void;
|
|
17
|
+
selectAll: () => void;
|
|
18
|
+
unSelectAll: () => void;
|
|
19
|
+
selectedRows: any[];
|
|
20
|
+
unSelect: (item: any) => void;
|
|
21
|
+
isSelected: (item: any) => boolean;
|
|
22
|
+
clearAll: () => void;
|
|
23
|
+
toggleSelect: (item: any) => void;
|
|
24
|
+
} | undefined;
|
|
25
|
+
getShownColumns: () => TableColumnsType<any>;
|
|
26
|
+
} | null | undefined;
|
|
27
|
+
isDestroyed: true;
|
|
4
28
|
open: (options?: OpenOptions) => Promise<void>;
|
|
5
29
|
destroy: () => void;
|
|
6
30
|
close: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { onUnmounted as
|
|
2
|
-
import { merge as
|
|
3
|
-
import { useCreateTableModal as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { onUnmounted as p } from "vue";
|
|
2
|
+
import { merge as f } from "lodash-unified";
|
|
3
|
+
import { useCreateTableModal as u } from "./use-create-table-modal.mjs";
|
|
4
|
+
function T(t) {
|
|
5
|
+
const l = f(t, {
|
|
6
6
|
...{
|
|
7
7
|
footer: null
|
|
8
8
|
},
|
|
@@ -11,19 +11,20 @@ function P(l) {
|
|
|
11
11
|
},
|
|
12
12
|
destroyOnUnmounted: !1,
|
|
13
13
|
isRenderModalTitleSuffix: !1
|
|
14
|
-
}), { destroy: o, openModal: r, closeModal: s } =
|
|
15
|
-
r([],
|
|
14
|
+
}), { destroy: o, openModal: r, closeModal: s, ...a } = u(l), n = async (d) => {
|
|
15
|
+
r([], d);
|
|
16
16
|
}, e = () => {
|
|
17
17
|
s();
|
|
18
18
|
};
|
|
19
|
-
return
|
|
19
|
+
return p(() => {
|
|
20
20
|
e(), o();
|
|
21
21
|
}), {
|
|
22
|
-
open:
|
|
22
|
+
open: n,
|
|
23
23
|
destroy: o,
|
|
24
|
-
close: e
|
|
24
|
+
close: e,
|
|
25
|
+
...a
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
T as useTableModal
|
|
29
30
|
};
|