@aplus-frontend/ui 7.19.2 → 7.19.3
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/business/ap-tag/ap-tag-group.vue.mjs +83 -60
- package/es/src/business/ap-tag/interface.d.ts +4 -0
- package/es/src/business/ap-view/ap-view.vue2.mjs +88 -87
- package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -1
- package/es/src/business/ap-view/hooks/use-send-to-url.mjs +25 -24
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/business/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/business/ap-tag/interface.d.ts +4 -0
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -1
- package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,112 +1,107 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { omit as
|
|
1
|
+
import { defineComponent as A, ref as T, computed as p, unref as a, watch as F, nextTick as M, onMounted as U, onUnmounted as q, createBlock as m, openBlock as n, mergeProps as h, createSlots as H, withCtx as u, createElementVNode as t, normalizeStyle as _, normalizeClass as x, createElementBlock as k, createCommentVNode as J, Fragment as z, renderList as K, toDisplayString as f, renderSlot as V, createTextVNode as B } from "vue";
|
|
2
|
+
import O from "@ant-design/icons-vue";
|
|
3
|
+
import { Tooltip as E } from "@aplus-frontend/antdv";
|
|
4
|
+
import { omit as Q } from "lodash-unified";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { useToken as
|
|
6
|
+
import { useToken as X } from "../../config-provider/hooks/use-token.mjs";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { useDevWarning as
|
|
8
|
+
import { useDevWarning as Y } from "../../utils/warning.mjs";
|
|
9
9
|
import "./ap-tag.vue2.mjs";
|
|
10
|
-
import
|
|
11
|
-
import { getTextWidth as
|
|
12
|
-
import { useLocale as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useResize as
|
|
15
|
-
import
|
|
16
|
-
const
|
|
10
|
+
import Z from "./style/group.mjs";
|
|
11
|
+
import { getTextWidth as S } from "./utils.mjs";
|
|
12
|
+
import { useLocale as ee } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useResize as oe } from "../../hooks/useResize.mjs";
|
|
15
|
+
import le from "./ap-tag.vue.mjs";
|
|
16
|
+
const ke = /* @__PURE__ */ A({
|
|
17
17
|
__name: "ap-tag-group",
|
|
18
18
|
props: {
|
|
19
19
|
list: { default: () => [] },
|
|
20
20
|
space: { default: 4 },
|
|
21
21
|
ellipsisColor: {},
|
|
22
|
-
ellipsis: { default: () => ({}) }
|
|
22
|
+
ellipsis: { default: () => ({ isWrapGroup: !0 }) }
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const { t:
|
|
24
|
+
setup(D) {
|
|
25
|
+
const { t: G } = ee(), l = D, { token: P } = X(), $ = Y("ApTagGroup"), { b: g } = te("tag-group"), N = Z("tag-group"), i = T(), { observe: R, unobserve: j } = oe(), r = p(() => ({
|
|
26
26
|
...{
|
|
27
|
-
iconColor:
|
|
27
|
+
iconColor: P.value?.textColor1,
|
|
28
28
|
symbol: "icon",
|
|
29
|
-
text:
|
|
29
|
+
text: G("ap.common.more")
|
|
30
30
|
},
|
|
31
31
|
...l.ellipsis
|
|
32
|
-
})),
|
|
32
|
+
})), w = p(() => r.value.tooltip && typeof r.value.tooltip == "object" ? Q(r.value.tooltip, ["trigger", "title"]) : {}), v = p(() => a(d) < l.list.length), d = T(0), C = p(() => l.list.map((e) => e.text).join("、")), I = p(() => [g(), N.value].filter(Boolean)), W = () => {
|
|
33
33
|
let e = 0, o = 0;
|
|
34
34
|
if (!i.value) return;
|
|
35
|
-
const
|
|
35
|
+
const c = i.value.offsetWidth;
|
|
36
36
|
for (let s of l.list) {
|
|
37
|
-
const
|
|
37
|
+
const y = s.size === "small" ? 8 : 12, b = S(
|
|
38
38
|
s.size === "large" ? 14 : 12,
|
|
39
39
|
s.text
|
|
40
|
-
) +
|
|
41
|
-
if (e +=
|
|
42
|
-
e -=
|
|
40
|
+
) + y + l.space;
|
|
41
|
+
if (e += b, e > c) {
|
|
42
|
+
e -= b;
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
o++;
|
|
46
46
|
}
|
|
47
47
|
if (o < l.list.length) {
|
|
48
|
-
const
|
|
49
|
-
l.ellipsis.symbol === "icon" ? e += 16 : e +=
|
|
48
|
+
const y = S(12, r.value.text);
|
|
49
|
+
l.ellipsis.symbol === "icon" ? e += 16 : e += y, e > c && o--;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
d.value = o;
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
F(
|
|
54
54
|
() => l.list,
|
|
55
55
|
(e, o) => {
|
|
56
|
-
e !== o &&
|
|
57
|
-
|
|
56
|
+
e !== o && M(() => {
|
|
57
|
+
W();
|
|
58
58
|
});
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
immediate: !0
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const L = () => {
|
|
65
|
+
W();
|
|
66
66
|
};
|
|
67
|
-
return
|
|
67
|
+
return U(() => {
|
|
68
68
|
[["ellipsisColor", "ellipse.color"]].forEach(
|
|
69
69
|
([e, o]) => {
|
|
70
|
-
|
|
70
|
+
$.deprecated(
|
|
71
71
|
!l[e],
|
|
72
72
|
e,
|
|
73
73
|
o
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
), i.value &&
|
|
77
|
-
}),
|
|
78
|
-
i.value &&
|
|
79
|
-
}), (e, o) => (
|
|
80
|
-
|
|
81
|
-
q(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
82
|
-
H(b(N.value), 1)
|
|
83
|
-
])
|
|
84
|
-
]),
|
|
85
|
-
default: v(() => [
|
|
76
|
+
), i.value && R(i.value, L);
|
|
77
|
+
}), q(() => {
|
|
78
|
+
i.value && j(i.value);
|
|
79
|
+
}), (e, o) => (n(), m(a(E), h({ trigger: "hover" }, w.value), H({
|
|
80
|
+
default: u(() => [
|
|
86
81
|
t("div", {
|
|
87
82
|
ref_key: "container",
|
|
88
83
|
ref: i,
|
|
89
|
-
class:
|
|
90
|
-
style:
|
|
91
|
-
pointerEvents:
|
|
84
|
+
class: x(I.value),
|
|
85
|
+
style: _({
|
|
86
|
+
pointerEvents: v.value ? "auto" : "none"
|
|
92
87
|
// opacity: isUpdating ? '0' : '1'
|
|
93
88
|
})
|
|
94
89
|
}, [
|
|
95
|
-
(
|
|
90
|
+
(n(!0), k(z, null, K(e.list, (c, s) => (n(), m(le, h({ ref_for: !0 }, c, {
|
|
96
91
|
key: s,
|
|
97
92
|
style: {
|
|
98
|
-
display: s >=
|
|
93
|
+
display: s >= d.value ? "none" : "inline-flex",
|
|
99
94
|
marginRight: `${e.space}px`
|
|
100
95
|
}
|
|
101
96
|
}), null, 16, ["style"]))), 128)),
|
|
102
|
-
|
|
97
|
+
v.value && r.value.symbol === "icon" ? (n(), m(a(O), {
|
|
103
98
|
key: 0,
|
|
104
|
-
style:
|
|
99
|
+
style: _({
|
|
105
100
|
color: e.ellipsisColor || r.value.iconColor,
|
|
106
101
|
cursor: "pointer"
|
|
107
102
|
})
|
|
108
103
|
}, {
|
|
109
|
-
component:
|
|
104
|
+
component: u(() => [...o[0] || (o[0] = [
|
|
110
105
|
t("svg", {
|
|
111
106
|
xmlns: "http://www.w3.org/2000/svg",
|
|
112
107
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
@@ -162,17 +157,45 @@ const xe = /* @__PURE__ */ j({
|
|
|
162
157
|
], -1)
|
|
163
158
|
])]),
|
|
164
159
|
_: 1
|
|
165
|
-
}, 8, ["style"])) :
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
}, 8, ["style"])) : v.value && r.value.symbol === "text" ? (n(), k(z, { key: 1 }, [
|
|
161
|
+
e.ellipsis.isWrapGroup ? (n(), k("span", {
|
|
162
|
+
key: 0,
|
|
163
|
+
class: x(a(g)("ellipsis-text")),
|
|
164
|
+
style: { cursor: "pointer" }
|
|
165
|
+
}, f(r.value.text), 3)) : (n(), m(a(E), h({
|
|
166
|
+
key: 1,
|
|
167
|
+
trigger: "hover"
|
|
168
|
+
}, w.value), {
|
|
169
|
+
title: u(() => [
|
|
170
|
+
V(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
171
|
+
B(f(C.value), 1)
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
default: u(() => [
|
|
175
|
+
t("span", {
|
|
176
|
+
class: x(a(g)("ellipsis-text")),
|
|
177
|
+
style: { cursor: "pointer" }
|
|
178
|
+
}, f(r.value.text), 3)
|
|
179
|
+
]),
|
|
180
|
+
_: 3
|
|
181
|
+
}, 16))
|
|
182
|
+
], 64)) : J("", !0)
|
|
170
183
|
], 6)
|
|
171
184
|
]),
|
|
172
|
-
_:
|
|
173
|
-
},
|
|
185
|
+
_: 2
|
|
186
|
+
}, [
|
|
187
|
+
e.ellipsis.isWrapGroup ? {
|
|
188
|
+
name: "title",
|
|
189
|
+
fn: u(() => [
|
|
190
|
+
V(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
191
|
+
B(f(C.value), 1)
|
|
192
|
+
])
|
|
193
|
+
]),
|
|
194
|
+
key: "0"
|
|
195
|
+
} : void 0
|
|
196
|
+
]), 1040));
|
|
174
197
|
}
|
|
175
198
|
});
|
|
176
199
|
export {
|
|
177
|
-
|
|
200
|
+
ke as default
|
|
178
201
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isValid as
|
|
3
|
-
import { useInjectForm as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as q, computed as n, ref as V, createVNode as F, watch as H, createBlock as J, openBlock as Q, unref as f, mergeProps as X, withCtx as Z, createElementVNode as ee, normalizeClass as te } from "vue";
|
|
2
|
+
import { isValid as ae } from "@aplus-frontend/utils";
|
|
3
|
+
import { useInjectForm as ie } from "../../ap-form/context.mjs";
|
|
4
|
+
import { useInjectApTable as oe } from "../../ap-table/context.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { ApBatchActionGroup as
|
|
6
|
+
import { ApBatchActionGroup as re } from "../ap-batch-action-group/index.mjs";
|
|
7
7
|
import "./components/main-button-content.vue.mjs";
|
|
8
8
|
import "./components/menu-list-content.vue.mjs";
|
|
9
|
-
import { useSendToUrl as
|
|
10
|
-
import { useViewProvide as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import { useSendToUrl as se } from "./hooks/use-send-to-url.mjs";
|
|
10
|
+
import { useViewProvide as le } from "./hooks/use-view-provide.mjs";
|
|
11
|
+
import ne from "./icons/line-down.vue.mjs";
|
|
12
|
+
import me from "./style/index.mjs";
|
|
13
13
|
import { SYSTEM_VIEW_KEY as v } from "./utils/enum.mjs";
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
import { useNamespace as
|
|
16
|
-
import { useLocale as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
14
|
+
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
|
|
17
|
+
import ve from "./components/main-button-content.vue2.mjs";
|
|
18
|
+
import pe from "./components/menu-list-content.vue2.mjs";
|
|
19
|
+
const Oe = /* @__PURE__ */ q({
|
|
20
20
|
name: "ApView",
|
|
21
21
|
__name: "ap-view",
|
|
22
22
|
props: {
|
|
@@ -50,66 +50,67 @@ const _e = /* @__PURE__ */ R({
|
|
|
50
50
|
},
|
|
51
51
|
extraUrlParams: {}
|
|
52
52
|
},
|
|
53
|
-
setup(
|
|
54
|
-
expose:
|
|
53
|
+
setup(N, {
|
|
54
|
+
expose: _
|
|
55
55
|
}) {
|
|
56
|
-
const a =
|
|
57
|
-
b:
|
|
58
|
-
} =
|
|
59
|
-
t:
|
|
60
|
-
} =
|
|
56
|
+
const a = N, O = ue("viewCacheOption"), {
|
|
57
|
+
b: S
|
|
58
|
+
} = ce("ap-view"), {
|
|
59
|
+
t: P
|
|
60
|
+
} = fe(), C = me("ap-view"), h = n(() => ({
|
|
61
61
|
viewKey: v,
|
|
62
|
-
viewName:
|
|
62
|
+
viewName: P("ap.apView.systemView")
|
|
63
63
|
})), {
|
|
64
|
-
getSearchFormValues:
|
|
65
|
-
setSearchFormValues:
|
|
66
|
-
submit:
|
|
67
|
-
reset:
|
|
68
|
-
submitWith:
|
|
69
|
-
getSearchFormSorterItems:
|
|
70
|
-
setSearchFormSorterItems:
|
|
71
|
-
resetSearchFormSorterItems:
|
|
72
|
-
} =
|
|
73
|
-
model:
|
|
74
|
-
} =
|
|
75
|
-
let m = !1,
|
|
76
|
-
const
|
|
64
|
+
getSearchFormValues: B,
|
|
65
|
+
setSearchFormValues: L,
|
|
66
|
+
submit: E,
|
|
67
|
+
reset: M,
|
|
68
|
+
submitWith: j,
|
|
69
|
+
getSearchFormSorterItems: k,
|
|
70
|
+
setSearchFormSorterItems: A,
|
|
71
|
+
resetSearchFormSorterItems: W
|
|
72
|
+
} = oe(), {
|
|
73
|
+
model: G
|
|
74
|
+
} = ie(), $ = V(!1), K = V(!1), w = V("");
|
|
75
|
+
let m = !1, U = !1, b = !0;
|
|
76
|
+
const Y = {
|
|
77
77
|
dropdownType: "dropdown",
|
|
78
|
-
content:
|
|
78
|
+
content: F(ve, {
|
|
79
79
|
maxViewNum: a.maxViewNum
|
|
80
80
|
}, null)
|
|
81
|
-
}, o =
|
|
81
|
+
}, o = V([h.value]), z = n(() => o.value.map((t) => ({
|
|
82
82
|
id: t.viewKey,
|
|
83
|
-
content:
|
|
83
|
+
content: F(pe, {
|
|
84
84
|
view: t
|
|
85
85
|
}, null)
|
|
86
86
|
}))), r = {
|
|
87
|
-
getSearchFormValues:
|
|
88
|
-
setSearchFormValues:
|
|
89
|
-
submit:
|
|
90
|
-
reset:
|
|
91
|
-
submitWith:
|
|
92
|
-
getSearchFormSorterItems:
|
|
93
|
-
setSearchFormSorterItems:
|
|
94
|
-
resetSearchFormSorterItems:
|
|
87
|
+
getSearchFormValues: B,
|
|
88
|
+
setSearchFormValues: L,
|
|
89
|
+
submit: E,
|
|
90
|
+
reset: M,
|
|
91
|
+
submitWith: j,
|
|
92
|
+
getSearchFormSorterItems: k,
|
|
93
|
+
setSearchFormSorterItems: A,
|
|
94
|
+
resetSearchFormSorterItems: W,
|
|
95
95
|
...a.saveDataSource
|
|
96
|
-
},
|
|
97
|
-
...
|
|
96
|
+
}, d = {
|
|
97
|
+
...O.value,
|
|
98
98
|
...a.viewCacheOption
|
|
99
99
|
}, {
|
|
100
|
-
mountedData:
|
|
101
|
-
isValidMountedData:
|
|
102
|
-
|
|
100
|
+
mountedData: D,
|
|
101
|
+
isValidMountedData: T,
|
|
102
|
+
isFirstSendToUrl: y
|
|
103
|
+
} = se({
|
|
103
104
|
saveDataSource: r,
|
|
104
105
|
sendToUrl: n(() => a.sendToUrl),
|
|
105
106
|
tableKey: n(() => a.tableKey),
|
|
106
|
-
searchFormModel: n(() => a?.saveDataSource?.searchFormModel ||
|
|
107
|
+
searchFormModel: n(() => a?.saveDataSource?.searchFormModel || G?.value),
|
|
107
108
|
extraUrlParams: n(() => a.extraUrlParams)
|
|
108
|
-
}),
|
|
109
|
+
}), I = () => a.isDefaultSystemView ? v : (a.isFirstDefaultSystemView || U) && m ? v : o.value.find((i) => i.isDefault)?.viewKey ?? v, u = (t) => {
|
|
109
110
|
w.value = t;
|
|
110
111
|
const i = o.value.find((e) => e.viewKey === w.value);
|
|
111
112
|
i && setTimeout(() => {
|
|
112
|
-
i.viewKey === v ? m ? a.manual || (a.sendToUrl &&
|
|
113
|
+
i.viewKey === v ? m ? a.manual || (a.sendToUrl && b && a.initToUrl && T.value && y.value && (r?.setSearchFormValues?.(D.value), y.value = !1), r?.submitWith?.()) : a.manual || (r?.resetSearchFormSorterItems?.(), r?.reset?.()) : (a.sendToUrl && b && a.initToUrl && T.value && m && y.value ? (r?.setSearchFormValues?.(D.value), y.value = !1) : r?.setSearchFormValues?.({
|
|
113
114
|
...Object.fromEntries(Object.keys(r?.getSearchFormValues?.() ?? {}).map((e) => [e, void 0])) ?? {},
|
|
114
115
|
...a?.emptyData ?? {},
|
|
115
116
|
...[...r?.getSearchFormSorterItems?.() ?? [], ...a?.extraParams?.map((e) => ({
|
|
@@ -117,17 +118,17 @@ const _e = /* @__PURE__ */ R({
|
|
|
117
118
|
})) ?? []].reduce((e, s) => (i.viewConfig?.searchForm?.[s.name] && (e[s.name] = i.viewConfig?.searchForm?.[s.name]), e), {}) ?? {}
|
|
118
119
|
}), r?.setSearchFormSorterItems?.(i.viewConfig?.sorterItems ?? []), m ? a.manual || r?.submitWith?.() : r?.submit?.()), m = !1;
|
|
119
120
|
});
|
|
120
|
-
},
|
|
121
|
+
}, x = {
|
|
121
122
|
getViewList: async (t) => {
|
|
122
123
|
try {
|
|
123
124
|
const {
|
|
124
125
|
tableKey: i
|
|
125
|
-
} = t, e = await
|
|
126
|
+
} = t, e = await d?.getViewList?.({
|
|
126
127
|
tableKey: i
|
|
127
128
|
});
|
|
128
|
-
return o.value = [
|
|
129
|
+
return o.value = [h.value, ...e ?? []], u(I()), o.value;
|
|
129
130
|
} catch {
|
|
130
|
-
return o.value = [
|
|
131
|
+
return o.value = [h.value], u(v), o.value;
|
|
131
132
|
}
|
|
132
133
|
},
|
|
133
134
|
addView: async (t) => {
|
|
@@ -138,7 +139,7 @@ const _e = /* @__PURE__ */ R({
|
|
|
138
139
|
isDefault: l,
|
|
139
140
|
viewConfig: p
|
|
140
141
|
} = t;
|
|
141
|
-
await
|
|
142
|
+
await d?.addView?.({
|
|
142
143
|
tableKey: i,
|
|
143
144
|
viewKey: e,
|
|
144
145
|
viewName: s,
|
|
@@ -162,17 +163,17 @@ const _e = /* @__PURE__ */ R({
|
|
|
162
163
|
isDefault: l,
|
|
163
164
|
viewConfig: p
|
|
164
165
|
} = t;
|
|
165
|
-
await
|
|
166
|
+
await d?.changeView?.({
|
|
166
167
|
tableKey: i,
|
|
167
168
|
viewKey: e,
|
|
168
169
|
viewName: s,
|
|
169
170
|
isDefault: l,
|
|
170
171
|
viewConfig: p
|
|
171
|
-
}), l && (o.value = o.value.map((
|
|
172
|
-
...
|
|
172
|
+
}), l && (o.value = o.value.map((g) => ({
|
|
173
|
+
...g,
|
|
173
174
|
isDefault: !1
|
|
174
175
|
})));
|
|
175
|
-
const c = o.value.find((
|
|
176
|
+
const c = o.value.find((g) => g.viewKey === e);
|
|
176
177
|
c && (c.viewName = s, c.isDefault = l, c.viewConfig = p), u(e);
|
|
177
178
|
},
|
|
178
179
|
removeView: async (t) => {
|
|
@@ -180,54 +181,54 @@ const _e = /* @__PURE__ */ R({
|
|
|
180
181
|
tableKey: i,
|
|
181
182
|
viewKey: e
|
|
182
183
|
} = t;
|
|
183
|
-
await
|
|
184
|
+
await d?.removeView?.({
|
|
184
185
|
tableKey: i,
|
|
185
186
|
viewKey: e
|
|
186
|
-
}), o.value = o.value.filter((s) => s.viewKey !== e), e === w.value && u(
|
|
187
|
+
}), o.value = o.value.filter((s) => s.viewKey !== e), e === w.value && u(I());
|
|
187
188
|
}
|
|
188
|
-
},
|
|
189
|
+
}, R = {
|
|
189
190
|
tableKey: n(() => a.tableKey),
|
|
190
191
|
currentViewKey: w,
|
|
191
192
|
changeCurrentViewKey: u,
|
|
192
|
-
popoverOpen:
|
|
193
|
-
menuOpen:
|
|
193
|
+
popoverOpen: $,
|
|
194
|
+
menuOpen: K,
|
|
194
195
|
viewList: o,
|
|
195
|
-
viewListCRUD:
|
|
196
|
+
viewListCRUD: x,
|
|
196
197
|
saveDataSource: r
|
|
197
198
|
};
|
|
198
|
-
return
|
|
199
|
-
|
|
199
|
+
return le(R), H(() => a.tableKey, (t) => {
|
|
200
|
+
ae(t) && (m = !0, x?.getViewList?.({
|
|
200
201
|
tableKey: t
|
|
201
202
|
}));
|
|
202
203
|
}, {
|
|
203
204
|
immediate: !0
|
|
204
|
-
}),
|
|
205
|
+
}), _({
|
|
205
206
|
setFirstDefaultSystemView: (t) => {
|
|
206
|
-
|
|
207
|
+
U = t;
|
|
207
208
|
},
|
|
208
209
|
setInitToUrl: (t) => {
|
|
209
|
-
|
|
210
|
+
b = t;
|
|
210
211
|
},
|
|
211
|
-
getMountedData: () =>
|
|
212
|
-
}), (t, i) => (
|
|
212
|
+
getMountedData: () => D.value
|
|
213
|
+
}), (t, i) => (Q(), J(f(re), X({
|
|
213
214
|
...t.$attrs
|
|
214
215
|
}, {
|
|
215
|
-
open:
|
|
216
|
-
"onUpdate:open": i[0] || (i[0] = (e) =>
|
|
217
|
-
class: [f(
|
|
218
|
-
"button-props":
|
|
219
|
-
"menu-list":
|
|
220
|
-
"overlay-class-name": [f(
|
|
216
|
+
open: K.value,
|
|
217
|
+
"onUpdate:open": i[0] || (i[0] = (e) => K.value = e),
|
|
218
|
+
class: [f(S)(), f(C)],
|
|
219
|
+
"button-props": Y,
|
|
220
|
+
"menu-list": z.value,
|
|
221
|
+
"overlay-class-name": [f(S)("overlay"), f(C)],
|
|
221
222
|
trigger: "click",
|
|
222
223
|
placement: "bottom"
|
|
223
224
|
}), {
|
|
224
|
-
icon:
|
|
225
|
-
class:
|
|
226
|
-
}, [
|
|
225
|
+
icon: Z(() => [ee("div", {
|
|
226
|
+
class: te([f(S)("icon")])
|
|
227
|
+
}, [F(ne)], 2)]),
|
|
227
228
|
_: 1
|
|
228
229
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
export {
|
|
232
|
-
|
|
233
|
+
Oe as default
|
|
233
234
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
2
|
import { Recordable } from '../../../type';
|
|
3
3
|
import { SaveDataSource } from '../interface';
|
|
4
4
|
export declare const useSendToUrl: (option: {
|
|
@@ -10,4 +10,5 @@ export declare const useSendToUrl: (option: {
|
|
|
10
10
|
}) => {
|
|
11
11
|
mountedData: ComputedRef<Recordable>;
|
|
12
12
|
isValidMountedData: ComputedRef<boolean>;
|
|
13
|
+
isFirstSendToUrl: Ref<boolean, boolean>;
|
|
13
14
|
};
|
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { isObjectWithContent as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { setUrlQuery as C, getUrlQuery as
|
|
5
|
-
const I = (
|
|
1
|
+
import { isObjectWithContent as v } from "@aplus-frontend/utils";
|
|
2
|
+
import { debounce as p } from "lodash-unified";
|
|
3
|
+
import { ref as d, watch as U, onMounted as g, computed as u } from "vue";
|
|
4
|
+
import { setUrlQuery as C, getUrlQuery as y } from "../utils/query.mjs";
|
|
5
|
+
const I = (s) => {
|
|
6
6
|
const {
|
|
7
|
-
saveDataSource:
|
|
8
|
-
sendToUrl:
|
|
9
|
-
tableKey:
|
|
10
|
-
extraUrlParams:
|
|
11
|
-
searchFormModel:
|
|
12
|
-
} =
|
|
7
|
+
saveDataSource: c,
|
|
8
|
+
sendToUrl: r,
|
|
9
|
+
tableKey: n,
|
|
10
|
+
extraUrlParams: i,
|
|
11
|
+
searchFormModel: m
|
|
12
|
+
} = s;
|
|
13
13
|
let t, o = !1;
|
|
14
|
-
const a =
|
|
14
|
+
const a = d({}), l = d(!1), f = p(() => {
|
|
15
15
|
try {
|
|
16
16
|
const e = encodeURIComponent(
|
|
17
17
|
JSON.stringify({
|
|
18
|
-
...
|
|
19
|
-
...
|
|
18
|
+
...c?.getSearchFormValues?.(),
|
|
19
|
+
...i?.value?.() ?? {}
|
|
20
20
|
})
|
|
21
21
|
);
|
|
22
22
|
e !== t && (t = e, o = !0);
|
|
23
23
|
} catch {
|
|
24
24
|
t = "";
|
|
25
25
|
}
|
|
26
|
-
o && (C({ [
|
|
27
|
-
}, 500),
|
|
26
|
+
o && (C({ [n.value]: t }), o = !1);
|
|
27
|
+
}, 500), h = () => {
|
|
28
28
|
try {
|
|
29
|
-
const e =
|
|
30
|
-
a.value = e ? JSON.parse(decodeURIComponent(e)) : {};
|
|
29
|
+
const e = y()[n.value] ?? "";
|
|
30
|
+
a.value = e ? JSON.parse(decodeURIComponent(e)) : {}, l.value = !0;
|
|
31
31
|
} catch {
|
|
32
32
|
a.value = {};
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return
|
|
36
|
-
|
|
35
|
+
return U(
|
|
36
|
+
m,
|
|
37
37
|
() => {
|
|
38
|
-
|
|
38
|
+
r?.value && f();
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
deep: !0,
|
|
42
42
|
immediate: !0
|
|
43
43
|
}
|
|
44
44
|
), g(() => {
|
|
45
|
-
|
|
45
|
+
r?.value && h();
|
|
46
46
|
}), {
|
|
47
|
-
mountedData:
|
|
48
|
-
isValidMountedData:
|
|
47
|
+
mountedData: u(() => a.value),
|
|
48
|
+
isValidMountedData: u(() => v(a.value)),
|
|
49
|
+
isFirstSendToUrl: l
|
|
49
50
|
};
|
|
50
51
|
};
|
|
51
52
|
export {
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.19.
|
|
1
|
+
declare const _default: "7.19.3";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@ant-design/icons-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@ant-design/icons-vue"),v=require("@aplus-frontend/antdv"),_=require("lodash-unified");require("../../config-provider/index.js");const T=require("../../config-provider/hooks/use-token.js");require("../../hooks/index.js");const W=require("../../utils/warning.js");require("./ap-tag.vue2.js");const b=require("./style/group.js"),y=require("./utils.js"),S=require("../../config-provider/hooks/use-locale.js"),z=require("../../config-provider/hooks/use-namespace.js"),D=require("../../hooks/useResize.js"),P=require("./ap-tag.vue.js"),G=e.defineComponent({__name:"ap-tag-group",props:{list:{default:()=>[]},space:{default:4},ellipsisColor:{},ellipsis:{default:()=>({isWrapGroup:!0})}},setup(h){const{t:k}=S.useLocale(),o=h,{token:x}=T.useToken(),C=W.useDevWarning("ApTagGroup"),{b:a}=z.useNamespace("tag-group"),w=b.default("tag-group"),s=e.ref(),{observe:E,unobserve:V}=D.useResize(),r=e.computed(()=>({...{iconColor:x.value?.textColor1,symbol:"icon",text:k("ap.common.more")},...o.ellipsis})),d=e.computed(()=>r.value.tooltip&&typeof r.value.tooltip=="object"?_.omit(r.value.tooltip,["trigger","title"]):{}),u=e.computed(()=>e.unref(c)<o.list.length),c=e.ref(0),m=e.computed(()=>o.list.map(t=>t.text).join("、")),N=e.computed(()=>[a(),w.value].filter(Boolean)),g=()=>{let t=0,l=0;if(!s.value)return;const i=s.value.offsetWidth;for(let n of o.list){const p=n.size==="small"?8:12,f=y.getTextWidth(n.size==="large"?14:12,n.text)+p+o.space;if(t+=f,t>i){t-=f;break}l++}if(l<o.list.length){const p=y.getTextWidth(12,r.value.text);o.ellipsis.symbol==="icon"?t+=16:t+=p,t>i&&l--}c.value=l};e.watch(()=>o.list,(t,l)=>{t!==l&&e.nextTick(()=>{g()})},{immediate:!0});const B=()=>{g()};return e.onMounted(()=>{[["ellipsisColor","ellipse.color"]].forEach(([t,l])=>{C.deprecated(!o[t],t,l)}),s.value&&E(s.value,B)}),e.onUnmounted(()=>{s.value&&V(s.value)}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(v.Tooltip),e.mergeProps({trigger:"hover"},d.value),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"container",ref:s,class:e.normalizeClass(N.value),style:e.normalizeStyle({pointerEvents:u.value?"auto":"none"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,n)=>(e.openBlock(),e.createBlock(P.default,e.mergeProps({ref_for:!0},i,{key:n,style:{display:n>=c.value?"none":"inline-flex",marginRight:`${t.space}px`}}),null,16,["style"]))),128)),u.value&&r.value.symbol==="icon"?(e.openBlock(),e.createBlock(e.unref(q),{key:0,style:e.normalizeStyle({color:t.ellipsisColor||r.value.iconColor,cursor:"pointer"})},{component:e.withCtx(()=>[...l[0]||(l[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"master_svg0_1133_24991"},[e.createElementVNode("rect",{x:"0",y:"0",width:"16",height:"16",rx:"0"})])]),e.createElementVNode("g",{"clip-path":"url(#master_svg0_1133_24991)"},[e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"8",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"3.25",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"12.75",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})])])],-1)])]),_:1},8,["style"])):u.value&&r.value.symbol==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.ellipsis.isWrapGroup?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a)("ellipsis-text")),style:{cursor:"pointer"}},e.toDisplayString(r.value.text),3)):(e.openBlock(),e.createBlock(e.unref(v.Tooltip),e.mergeProps({key:1,trigger:"hover"},d.value),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(m.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a)("ellipsis-text")),style:{cursor:"pointer"}},e.toDisplayString(r.value.text),3)]),_:3},16))],64)):e.createCommentVNode("",!0)],6)]),_:2},[t.ellipsis.isWrapGroup?{name:"title",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(m.value),1)])]),key:"0"}:void 0]),1040))}});exports.default=G;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),G=require("@aplus-frontend/utils"),$=require("../../ap-form/context.js"),z=require("../../ap-table/context.js");require("../../config-provider/index.js");const R=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const H=require("./hooks/use-send-to-url.js"),J=require("./hooks/use-view-provide.js"),Q=require("./icons/line-down.vue.js"),X=require("./style/index.js"),v=require("./utils/enum.js"),Z=require("../../config-provider/hooks/use-global-config.js"),ee=require("../../config-provider/hooks/use-namespace.js"),te=require("../../config-provider/hooks/use-locale.js"),ae=require("./components/main-button-content.vue2.js"),se=require("./components/menu-list-content.vue2.js"),re=e.defineComponent({name:"ApView",__name:"ap-view",props:{tableKey:{},saveDataSource:{},viewCacheOption:{},maxViewNum:{default:20},isDefaultSystemView:{type:Boolean,default:!1},isFirstDefaultSystemView:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},emptyData:{},extraParams:{},sendToUrl:{type:Boolean,default:!0},initToUrl:{type:Boolean,default:!0},extraUrlParams:{}},setup(C,{expose:E}){const s=C,q=Z.useGlobalConfig("viewCacheOption"),{b:y}=ee.useNamespace("ap-view"),{t:U}=te.useLocale(),b=X.default("ap-view"),S=e.computed(()=>({viewKey:v.SYSTEM_VIEW_KEY,viewName:U("ap.apView.systemView")})),{getSearchFormValues:I,setSearchFormValues:x,submit:N,reset:M,submitWith:Y,getSearchFormSorterItems:P,setSearchFormSorterItems:O,resetSearchFormSorterItems:B}=z.useInjectApTable(),{model:L}=$.useInjectForm(),W=e.ref(!1),V=e.ref(!1),d=e.ref("");let l=!1,g=!1,_=!0;const j={dropdownType:"dropdown",content:e.createVNode(ae.default,{maxViewNum:s.maxViewNum},null)},i=e.ref([S.value]),k=e.computed(()=>i.value.map(a=>({id:a.viewKey,content:e.createVNode(se.default,{view:a},null)}))),o={getSearchFormValues:I,setSearchFormValues:x,submit:N,reset:M,submitWith:Y,getSearchFormSorterItems:P,setSearchFormSorterItems:O,resetSearchFormSorterItems:B,...s.saveDataSource},w={...q.value,...s.viewCacheOption},{mountedData:h,isValidMountedData:D,isFirstSendToUrl:p}=H.useSendToUrl({saveDataSource:o,sendToUrl:e.computed(()=>s.sendToUrl),tableKey:e.computed(()=>s.tableKey),searchFormModel:e.computed(()=>s?.saveDataSource?.searchFormModel||L?.value),extraUrlParams:e.computed(()=>s.extraUrlParams)}),T=()=>s.isDefaultSystemView||(s.isFirstDefaultSystemView||g)&&l?v.SYSTEM_VIEW_KEY:i.value.find(r=>r.isDefault)?.viewKey??v.SYSTEM_VIEW_KEY,c=a=>{d.value=a;const r=i.value.find(t=>t.viewKey===d.value);r&&setTimeout(()=>{r.viewKey===v.SYSTEM_VIEW_KEY?l?s.manual||(s.sendToUrl&&_&&s.initToUrl&&D.value&&p.value&&(o?.setSearchFormValues?.(h.value),p.value=!1),o?.submitWith?.()):s.manual||(o?.resetSearchFormSorterItems?.(),o?.reset?.()):(s.sendToUrl&&_&&s.initToUrl&&D.value&&l&&p.value?(o?.setSearchFormValues?.(h.value),p.value=!1):o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(t=>[t,void 0]))??{},...s?.emptyData??{},...[...o?.getSearchFormSorterItems?.()??[],...s?.extraParams?.map(t=>({name:t}))??[]].reduce((t,u)=>(r.viewConfig?.searchForm?.[u.name]&&(t[u.name]=r.viewConfig?.searchForm?.[u.name]),t),{})??{}}),o?.setSearchFormSorterItems?.(r.viewConfig?.sorterItems??[]),l?s.manual||o?.submitWith?.():o?.submit?.()),l=!1})},F={getViewList:async a=>{try{const{tableKey:r}=a,t=await w?.getViewList?.({tableKey:r});return i.value=[S.value,...t??[]],c(T()),i.value}catch{return i.value=[S.value],c(v.SYSTEM_VIEW_KEY),i.value}},addView:async a=>{const{tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}=a;await w?.addView?.({tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(m=>({...m,isDefault:!1}))),i.value=[...i.value,{viewKey:t,viewName:u,isDefault:n,viewConfig:f}],c(t)},changeView:async a=>{const{tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}=a;await w?.changeView?.({tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(K=>({...K,isDefault:!1})));const m=i.value.find(K=>K.viewKey===t);m&&(m.viewName=u,m.isDefault=n,m.viewConfig=f),c(t)},removeView:async a=>{const{tableKey:r,viewKey:t}=a;await w?.removeView?.({tableKey:r,viewKey:t}),i.value=i.value.filter(u=>u.viewKey!==t),t===d.value&&c(T())}},A={tableKey:e.computed(()=>s.tableKey),currentViewKey:d,changeCurrentViewKey:c,popoverOpen:W,menuOpen:V,viewList:i,viewListCRUD:F,saveDataSource:o};return J.useViewProvide(A),e.watch(()=>s.tableKey,a=>{G.isValid(a)&&(l=!0,F?.getViewList?.({tableKey:a}))},{immediate:!0}),E({setFirstDefaultSystemView:a=>{g=a},setInitToUrl:a=>{_=a},getMountedData:()=>h.value}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(R.ApBatchActionGroup),e.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":r[0]||(r[0]=t=>V.value=t),class:[e.unref(y)(),e.unref(b)],"button-props":j,"menu-list":k.value,"overlay-class-name":[e.unref(y)("overlay"),e.unref(b)],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("icon")])},[e.createVNode(Q.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=re;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
2
|
import { Recordable } from '../../../type';
|
|
3
3
|
import { SaveDataSource } from '../interface';
|
|
4
4
|
export declare const useSendToUrl: (option: {
|
|
@@ -10,4 +10,5 @@ export declare const useSendToUrl: (option: {
|
|
|
10
10
|
}) => {
|
|
11
11
|
mountedData: ComputedRef<Recordable>;
|
|
12
12
|
isValidMountedData: ComputedRef<boolean>;
|
|
13
|
+
isFirstSendToUrl: Ref<boolean, boolean>;
|
|
13
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("@aplus-frontend/utils"),y=require("lodash-unified"),e=require("vue"),s=require("../utils/query.js"),S=d=>{const{saveDataSource:c,sendToUrl:o,tableKey:u,extraUrlParams:i,searchFormModel:v}=d;let a,n=!1;const r=e.ref({}),l=e.ref(!1),f=()=>{try{const t=encodeURIComponent(JSON.stringify({...c?.getSearchFormValues?.(),...i?.value?.()??{}}));t!==a&&(a=t,n=!0)}catch{a=""}n&&(s.setUrlQuery({[u.value]:a}),n=!1)},h=y.debounce(f,500),m=()=>{try{const t=s.getUrlQuery()[u.value]??"";r.value=t?JSON.parse(decodeURIComponent(t)):{},l.value=!0}catch{r.value={}}};return e.watch(v,()=>{o?.value&&h()},{deep:!0,immediate:!0}),e.onMounted(()=>{o?.value&&m()}),{mountedData:e.computed(()=>r.value),isValidMountedData:e.computed(()=>U.isObjectWithContent(r.value)),isFirstSendToUrl:l}};exports.useSendToUrl=S;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.19.
|
|
1
|
+
declare const _default: "7.19.3";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.3";exports.default=e;
|