@aplus-frontend/ui 0.6.0-beta.7 → 0.6.0-beta.8
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-form/search-form/components/popover-sorter/index.vue2.mjs +57 -51
- package/es/src/ap-grid/constants.d.ts +3 -3
- package/es/src/ap-grid/constants.mjs +9 -9
- package/es/src/ap-grid/index.vue.mjs +44 -46
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +121 -118
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-grid/constants.d.ts +3 -3
- package/lib/src/ap-grid/constants.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/package.json +1 -1
- package/theme/ap-grid/index.css +11 -0
- package/theme/ap-grid/index.less +11 -0
- package/theme/ap-table/ap-table.css +4 -4
- package/theme/ap-table/ap-table.less +4 -4
- package/theme/ap-table-modal/index.css +4 -4
- package/theme/index.css +15 -4
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { IconApLayoutOutlined as
|
|
1
|
+
import { defineComponent as N, ref as y, watch as T, unref as e, createBlock as B, openBlock as S, withCtx as t, createVNode as o, createElementVNode as s, normalizeClass as r, toDisplayString as p, createTextVNode as C } from "vue";
|
|
2
|
+
import { Popover as D, Tooltip as P, Button as v, Flex as g, Divider as V } from "@aplus-frontend/antdv";
|
|
3
|
+
import { IconApLayoutOutlined as j } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../../../config-provider/index.mjs";
|
|
5
|
-
import
|
|
5
|
+
import A from "vuedraggable";
|
|
6
6
|
import "./sortable-item.vue.mjs";
|
|
7
|
-
import { getStringName as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
7
|
+
import { getStringName as I } from "../../../item-group/helper.mjs";
|
|
8
|
+
import { useNamespace as k } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as L } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import R from "./sortable-item.vue2.mjs";
|
|
11
|
+
const M = /* @__PURE__ */ N({
|
|
12
12
|
name: "ApFormSearchFormPopoverSorter",
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
15
15
|
children: {},
|
|
16
16
|
onClickConfirm: { type: Function }
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
setup(_) {
|
|
19
|
+
const i = _, c = y(i.children);
|
|
20
|
+
let h = [...i.children];
|
|
21
|
+
T(
|
|
22
|
+
() => i.children,
|
|
23
|
+
(n) => {
|
|
24
|
+
c.value = n, h = n;
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const { e: m } = k("ap-form-search-form"), { b: a } = k("search-form-sorter"), { t: l } = L(), f = y(!1);
|
|
28
|
+
function F(n) {
|
|
29
|
+
return n.closest(".ant-form") || document.body;
|
|
24
30
|
}
|
|
25
31
|
function b() {
|
|
26
|
-
|
|
32
|
+
f.value = !1, console.log(e(c)), i.onClickConfirm(e(c));
|
|
27
33
|
}
|
|
28
34
|
function x() {
|
|
29
|
-
|
|
35
|
+
c.value = [...h];
|
|
30
36
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
37
|
+
function w(n) {
|
|
38
|
+
return I(n.props.name);
|
|
33
39
|
}
|
|
34
|
-
return (
|
|
35
|
-
open:
|
|
36
|
-
"onUpdate:open":
|
|
37
|
-
"overlay-class-name": e(
|
|
40
|
+
return (n, u) => (S(), B(e(D), {
|
|
41
|
+
open: f.value,
|
|
42
|
+
"onUpdate:open": u[1] || (u[1] = (d) => f.value = d),
|
|
43
|
+
"overlay-class-name": e(m)("popover"),
|
|
38
44
|
trigger: "click",
|
|
39
45
|
placement: "bottom",
|
|
40
46
|
mask: "",
|
|
@@ -42,64 +48,64 @@ const J = /* @__PURE__ */ T({
|
|
|
42
48
|
"get-popup-container": F
|
|
43
49
|
}, {
|
|
44
50
|
content: t(() => [
|
|
45
|
-
|
|
51
|
+
s("div", {
|
|
46
52
|
class: r(e(a)("header"))
|
|
47
53
|
}, [
|
|
48
|
-
|
|
54
|
+
s("span", {
|
|
49
55
|
class: r(e(a)("header-title"))
|
|
50
|
-
},
|
|
51
|
-
o(e(
|
|
56
|
+
}, p(e(l)("ap.apForm.search.sorterTitle")), 3),
|
|
57
|
+
o(e(g), { justify: "space-between" }, {
|
|
52
58
|
default: t(() => [
|
|
53
|
-
|
|
59
|
+
s("span", {
|
|
54
60
|
class: r(e(a)("header-desc"))
|
|
55
|
-
},
|
|
56
|
-
|
|
61
|
+
}, p(e(l)("ap.apForm.search.sorterDesc")), 3),
|
|
62
|
+
s("div", {
|
|
57
63
|
class: r(e(a)("header-action-wrapper")),
|
|
58
64
|
onClick: x
|
|
59
65
|
}, [
|
|
60
|
-
|
|
66
|
+
s("span", {
|
|
61
67
|
class: r(e(a)("header-reset-btn"))
|
|
62
|
-
},
|
|
68
|
+
}, p(e(l)("ap.apForm.search.sorterReset")), 3)
|
|
63
69
|
], 2)
|
|
64
70
|
]),
|
|
65
71
|
_: 1
|
|
66
72
|
})
|
|
67
73
|
], 2),
|
|
68
|
-
|
|
69
|
-
class: r([e(
|
|
74
|
+
s("div", {
|
|
75
|
+
class: r([e(m)("popover-content"), e(a)("content")])
|
|
70
76
|
}, [
|
|
71
|
-
o(e(
|
|
72
|
-
list:
|
|
77
|
+
o(e(A), {
|
|
78
|
+
list: c.value,
|
|
73
79
|
class: r(e(a)("sorter-wrapper")),
|
|
74
|
-
"item-key":
|
|
80
|
+
"item-key": w
|
|
75
81
|
}, {
|
|
76
|
-
item: t(({ element:
|
|
77
|
-
o(
|
|
82
|
+
item: t(({ element: d }) => [
|
|
83
|
+
o(R, { item: d }, null, 8, ["item"])
|
|
78
84
|
]),
|
|
79
85
|
_: 1
|
|
80
86
|
}, 8, ["list", "class"])
|
|
81
87
|
], 2),
|
|
82
|
-
o(e(
|
|
83
|
-
|
|
84
|
-
class: r(e(
|
|
88
|
+
o(e(V), { style: { margin: "0" } }),
|
|
89
|
+
s("div", {
|
|
90
|
+
class: r(e(m)("popover-footer"))
|
|
85
91
|
}, [
|
|
86
|
-
o(e(
|
|
92
|
+
o(e(g), { justify: "end" }, {
|
|
87
93
|
default: t(() => [
|
|
88
94
|
o(e(v), {
|
|
89
|
-
onClick:
|
|
95
|
+
onClick: u[0] || (u[0] = (d) => f.value = !1)
|
|
90
96
|
}, {
|
|
91
97
|
default: t(() => [
|
|
92
|
-
|
|
98
|
+
C(p(e(l)("ap.common.cancelText")), 1)
|
|
93
99
|
]),
|
|
94
100
|
_: 1
|
|
95
101
|
}),
|
|
96
102
|
o(e(v), {
|
|
97
|
-
class: r(e(
|
|
103
|
+
class: r(e(m)("popover-footer-confirm-btn")),
|
|
98
104
|
type: "primary",
|
|
99
105
|
onClick: b
|
|
100
106
|
}, {
|
|
101
107
|
default: t(() => [
|
|
102
|
-
|
|
108
|
+
C(p(e(l)("ap.apForm.search.sorterConfirmBtn")), 1)
|
|
103
109
|
]),
|
|
104
110
|
_: 1
|
|
105
111
|
}, 8, ["class"])
|
|
@@ -109,14 +115,14 @@ const J = /* @__PURE__ */ T({
|
|
|
109
115
|
], 2)
|
|
110
116
|
]),
|
|
111
117
|
default: t(() => [
|
|
112
|
-
o(e(
|
|
113
|
-
title: e(
|
|
118
|
+
o(e(P), {
|
|
119
|
+
title: e(l)("ap.apForm.search.sorterTitle"),
|
|
114
120
|
placement: "top"
|
|
115
121
|
}, {
|
|
116
122
|
default: t(() => [
|
|
117
123
|
o(e(v), null, {
|
|
118
124
|
icon: t(() => [
|
|
119
|
-
o(e(
|
|
125
|
+
o(e(j))
|
|
120
126
|
]),
|
|
121
127
|
_: 1
|
|
122
128
|
})
|
|
@@ -129,5 +135,5 @@ const J = /* @__PURE__ */ T({
|
|
|
129
135
|
}
|
|
130
136
|
});
|
|
131
137
|
export {
|
|
132
|
-
|
|
138
|
+
M as default
|
|
133
139
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const sizeMap: {
|
|
2
2
|
readonly mini: "small";
|
|
3
3
|
readonly small: "small";
|
|
4
|
-
readonly medium: "
|
|
4
|
+
readonly medium: "middle";
|
|
5
5
|
};
|
|
6
6
|
export declare const sizeReverseMap: {
|
|
7
|
-
readonly small: "
|
|
8
|
-
readonly middle:
|
|
7
|
+
readonly small: "mini";
|
|
8
|
+
readonly middle: "medium";
|
|
9
9
|
};
|
|
10
10
|
export declare const ROW_SELECTION_FIELD = "_ap-grid-row-selection-field";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
mini: "small",
|
|
3
3
|
small: "small",
|
|
4
|
-
medium: "
|
|
5
|
-
},
|
|
6
|
-
small: "
|
|
7
|
-
middle:
|
|
8
|
-
},
|
|
4
|
+
medium: "middle"
|
|
5
|
+
}, i = {
|
|
6
|
+
small: "mini",
|
|
7
|
+
middle: "medium"
|
|
8
|
+
}, l = "_ap-grid-row-selection-field";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
l as ROW_SELECTION_FIELD,
|
|
11
|
+
e as sizeMap,
|
|
12
|
+
i as sizeReverseMap
|
|
13
13
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as Be, useSlots as Fe, getCurrentInstance as Ie, ref as B, computed as n, unref as o, watch as F, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as
|
|
1
|
+
import { defineComponent as Be, useSlots as Fe, getCurrentInstance as Ie, ref as B, computed as n, unref as o, watch as F, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as y, createElementVNode as E, createVNode as X, mergeProps as h, createSlots as J, withCtx as v, Fragment as Q, renderList as L, createBlock as p, resolveDynamicComponent as D, renderSlot as O, normalizeProps as Ee, guardReactiveProps as Pe } from "vue";
|
|
2
2
|
import { VxeTable as Ne, VxeColumn as Y } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
5
5
|
import { VxeUI as Z } from "vxe-pc-ui";
|
|
6
|
-
import { isUndefined as
|
|
6
|
+
import { isUndefined as S, omit as Te } from "lodash-unified";
|
|
7
7
|
import { ApForm as ze } from "../ap-form/index.mjs";
|
|
8
8
|
import "../config-provider/index.mjs";
|
|
9
9
|
import { noRenderAsFormItemValueList as _e } from "../ap-table/constants.mjs";
|
|
@@ -115,13 +115,13 @@ const No = /* @__PURE__ */ Be({
|
|
|
115
115
|
},
|
|
116
116
|
setup(re, { expose: te }) {
|
|
117
117
|
var G;
|
|
118
|
-
const C = Fe(), a = re,
|
|
119
|
-
|
|
120
|
-
const { e: P, b: c, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"),
|
|
118
|
+
const C = Fe(), a = re, w = (G = Ie()) == null ? void 0 : G.appContext.app;
|
|
119
|
+
w && !w.__VXE_PC_UI_INSTALLED__ && (w.use(Z), w.__VXE_PC_UI_INSTALLED__ = !0);
|
|
120
|
+
const { e: P, b: c, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"), d = B([]), $ = B([]), m = B(), x = B(a.size), [, i] = Je(), { t: se } = oo();
|
|
121
121
|
Z.setConfig({
|
|
122
122
|
i18n: (e, r) => se(`ap.${e}`, r)
|
|
123
123
|
});
|
|
124
|
-
const { renderConfig:
|
|
124
|
+
const { renderConfig: de, updateSignal: ie } = Xe(d);
|
|
125
125
|
let K = 0;
|
|
126
126
|
const ce = n(() => {
|
|
127
127
|
if (m.value)
|
|
@@ -133,13 +133,13 @@ const No = /* @__PURE__ */ Be({
|
|
|
133
133
|
return K++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
|
|
134
134
|
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !_e.includes(t.valueType)
|
|
135
135
|
)) == null ? void 0 : r.sort((t, u) => {
|
|
136
|
-
let
|
|
137
|
-
return ee(u.order) -
|
|
136
|
+
let b = ee(t.order);
|
|
137
|
+
return ee(u.order) - b;
|
|
138
138
|
})) == null ? void 0 : l.map((t) => {
|
|
139
139
|
const u = Ae(
|
|
140
140
|
t,
|
|
141
141
|
Ve(t.fieldProps, {})
|
|
142
|
-
),
|
|
142
|
+
), b = {
|
|
143
143
|
...t,
|
|
144
144
|
fieldProps: {
|
|
145
145
|
label: t.title,
|
|
@@ -151,10 +151,10 @@ const No = /* @__PURE__ */ Be({
|
|
|
151
151
|
},
|
|
152
152
|
renderNode: void 0
|
|
153
153
|
};
|
|
154
|
-
return
|
|
155
|
-
|
|
154
|
+
return b.renderNode = Le(
|
|
155
|
+
b,
|
|
156
156
|
o(ne)
|
|
157
|
-
),
|
|
157
|
+
), b;
|
|
158
158
|
})) || [];
|
|
159
159
|
}), ue = n(() => {
|
|
160
160
|
var r;
|
|
@@ -167,10 +167,10 @@ const No = /* @__PURE__ */ Be({
|
|
|
167
167
|
a.card ? null : c("wrapper"),
|
|
168
168
|
a.adaptive ? c("adaptive") : null,
|
|
169
169
|
a.sticky ? c("sticky") : null
|
|
170
|
-
].filter(Boolean)), j = n(() => oe(o(
|
|
170
|
+
].filter(Boolean)), j = n(() => oe(o(d), (e) => {
|
|
171
171
|
if (e.sorter === !0)
|
|
172
172
|
return e.key || e.dataIndex;
|
|
173
|
-
}).filter(Boolean)), H = n(() => oe(o(
|
|
173
|
+
}).filter(Boolean)), H = n(() => oe(o(d), (e) => {
|
|
174
174
|
if (e.filters && !e.onFilter)
|
|
175
175
|
return e.key || e.dataIndex;
|
|
176
176
|
}).filter(Boolean)), {
|
|
@@ -185,7 +185,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
185
185
|
} = De({
|
|
186
186
|
async request(e) {
|
|
187
187
|
var l;
|
|
188
|
-
if (!k.value.preserveSelectedRowKeys &&
|
|
188
|
+
if (!k.value.preserveSelectedRowKeys && S(a.dataSource) && A(), !S(a.dataSource)) {
|
|
189
189
|
const t = e.pageSize * (e.current - 1);
|
|
190
190
|
return {
|
|
191
191
|
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(t, t + e.pageSize)) || [],
|
|
@@ -208,19 +208,19 @@ const No = /* @__PURE__ */ Be({
|
|
|
208
208
|
pagination: a.pagination
|
|
209
209
|
}), { sortChangeEvent: he, filterChangeEvent: ve, paginationChangeEvent: Ce } = $e(ge);
|
|
210
210
|
Me({
|
|
211
|
-
columns: n(() =>
|
|
211
|
+
columns: n(() => d.value),
|
|
212
212
|
columnsBackup: n(() => $.value),
|
|
213
|
-
size: n(() =>
|
|
213
|
+
size: n(() => Ue[x.value]),
|
|
214
214
|
updateColumns(e) {
|
|
215
215
|
var r;
|
|
216
|
-
|
|
216
|
+
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e);
|
|
217
217
|
},
|
|
218
218
|
updateSize(e) {
|
|
219
|
-
|
|
219
|
+
x.value = qe[e];
|
|
220
220
|
},
|
|
221
221
|
renderConfig: n(() => ({
|
|
222
222
|
className: le("table-header", "title"),
|
|
223
|
-
color:
|
|
223
|
+
color: i.value.colorPrimary
|
|
224
224
|
})),
|
|
225
225
|
dataSource: n(() => o(f).records),
|
|
226
226
|
getSearchFormValues: U,
|
|
@@ -229,13 +229,13 @@ const No = /* @__PURE__ */ Be({
|
|
|
229
229
|
reset: z
|
|
230
230
|
});
|
|
231
231
|
const be = n(
|
|
232
|
-
() =>
|
|
232
|
+
() => d.value.some(
|
|
233
233
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
234
234
|
) ? "left" : void 0
|
|
235
235
|
), ye = n(
|
|
236
|
-
() =>
|
|
236
|
+
() => S(a.loading) ? f.loading : a.loading
|
|
237
237
|
), Se = n(
|
|
238
|
-
() =>
|
|
238
|
+
() => S(a.dataSource) ? f.records : a.dataSource
|
|
239
239
|
), { selectedRows: R, rowSelection: k, ...we } = He({
|
|
240
240
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
241
241
|
dataSource: Se,
|
|
@@ -279,7 +279,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
279
279
|
() => {
|
|
280
280
|
var r;
|
|
281
281
|
const e = Re();
|
|
282
|
-
|
|
282
|
+
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e), $.value = e;
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
deep: !0,
|
|
@@ -300,7 +300,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
300
300
|
), F(
|
|
301
301
|
() => a.size,
|
|
302
302
|
(e) => {
|
|
303
|
-
|
|
303
|
+
x.value = e;
|
|
304
304
|
}
|
|
305
305
|
), te({
|
|
306
306
|
submit: T,
|
|
@@ -308,7 +308,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
308
308
|
refresh: me,
|
|
309
309
|
setSearchFormValues: q,
|
|
310
310
|
getSearchFormValues: U,
|
|
311
|
-
getShowColumns: () => o(
|
|
311
|
+
getShowColumns: () => o(d),
|
|
312
312
|
rowSelection: {
|
|
313
313
|
selectedRows: n(() => R.value),
|
|
314
314
|
clearAll: A
|
|
@@ -319,7 +319,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
319
319
|
class: g(pe.value),
|
|
320
320
|
style: V(e.wrapperStyle)
|
|
321
321
|
}, [
|
|
322
|
-
o(
|
|
322
|
+
o(S)(e.dataSource) && e.searchForm !== !1 && W.value.length > 0 ? (s(), I("div", {
|
|
323
323
|
key: 0,
|
|
324
324
|
class: g(e.card ? o(P)("search-wrapper") : null),
|
|
325
325
|
style: V(e.searchFormWrapperStyle)
|
|
@@ -352,7 +352,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
352
352
|
key: "0"
|
|
353
353
|
} : void 0
|
|
354
354
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
355
|
-
], 6)) :
|
|
355
|
+
], 6)) : y("", !0),
|
|
356
356
|
E("div", {
|
|
357
357
|
class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
|
|
358
358
|
style: V(e.tableWrapperStyle)
|
|
@@ -363,7 +363,7 @@ const No = /* @__PURE__ */ Be({
|
|
|
363
363
|
O(e.$slots, "title", {
|
|
364
364
|
selectedRows: o(R),
|
|
365
365
|
selectedRowKeys: o(k).selectedRowKeys,
|
|
366
|
-
shownColumns:
|
|
366
|
+
shownColumns: d.value,
|
|
367
367
|
clearAll: A
|
|
368
368
|
})
|
|
369
369
|
], 2),
|
|
@@ -373,27 +373,25 @@ const No = /* @__PURE__ */ Be({
|
|
|
373
373
|
(s(), p(o(Ne), h(o(Ke)(a), {
|
|
374
374
|
ref_key: "tableRef",
|
|
375
375
|
ref: m,
|
|
376
|
-
key: o(
|
|
376
|
+
key: o(ie),
|
|
377
377
|
data: o(f).records,
|
|
378
378
|
"sort-config": { remote: j.value.length > 0 },
|
|
379
379
|
"filter-config": { remote: H.value.length > 0 },
|
|
380
380
|
loading: ye.value,
|
|
381
381
|
style: {
|
|
382
|
-
"--vxe-ui-table-row-checkbox-checked-background-color": o(
|
|
383
|
-
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(
|
|
384
|
-
"--vxe-ui-font-primary-color": o(
|
|
382
|
+
"--vxe-ui-table-row-checkbox-checked-background-color": o(i).controlItemBgActive,
|
|
383
|
+
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(i).controlItemBgActiveHover,
|
|
384
|
+
"--vxe-ui-font-primary-color": o(i).colorPrimary,
|
|
385
385
|
"--vxe-ui-table-header-background-color": "var(--ap-table-header-bg)",
|
|
386
386
|
"--vxe-ui-table-cell-padding-default": "12px",
|
|
387
387
|
"--vxe-ui-table-cell-padding-medium": "9px",
|
|
388
|
-
"--vxe-ui-table-row-radio-checked-background-color": o(
|
|
389
|
-
"--vxe-ui-table-row-hover-radio-checked-background-color": o(
|
|
390
|
-
"--vxe-ui-font-color": o(
|
|
391
|
-
"--vxe-ui-table-border-color": o(
|
|
392
|
-
"--vxe-ui-table-header-font-color": o(
|
|
393
|
-
"--vxe-ui-table-cell-padding-mini": "8px",
|
|
394
|
-
"--vxe-ui-table-row-line-height": "18px"
|
|
388
|
+
"--vxe-ui-table-row-radio-checked-background-color": o(i).controlItemBgActive,
|
|
389
|
+
"--vxe-ui-table-row-hover-radio-checked-background-color": o(i).controlItemBgActiveHover,
|
|
390
|
+
"--vxe-ui-font-color": o(i).colorTextBase,
|
|
391
|
+
"--vxe-ui-table-border-color": o(i).colorBorderSecondary,
|
|
392
|
+
"--vxe-ui-table-header-font-color": o(i).colorTextBase
|
|
395
393
|
},
|
|
396
|
-
size:
|
|
394
|
+
size: x.value,
|
|
397
395
|
onSortChange: o(he),
|
|
398
396
|
onFilterChange: o(ve),
|
|
399
397
|
onCheckboxChange: _,
|
|
@@ -412,9 +410,9 @@ const No = /* @__PURE__ */ Be({
|
|
|
412
410
|
(s(), p(D(a.expandable.renderContent(l))))
|
|
413
411
|
]),
|
|
414
412
|
_: 1
|
|
415
|
-
}, 16, ["fixed"])) :
|
|
416
|
-
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k),
|
|
417
|
-
(s(!0), I(Q, null, L(o(
|
|
413
|
+
}, 16, ["fixed"])) : y("", !0),
|
|
414
|
+
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), d.value), { field: o(Ge) }), null, 16, ["field"])) : y("", !0),
|
|
415
|
+
(s(!0), I(Q, null, L(o(de), (l) => (s(), p(D(l), {
|
|
418
416
|
key: l.props.colId
|
|
419
417
|
}))), 128))
|
|
420
418
|
]),
|
|
@@ -438,11 +436,11 @@ const No = /* @__PURE__ */ Be({
|
|
|
438
436
|
"extra-size": -4.2,
|
|
439
437
|
"bar-color": "var(--basic-scrollbar-thumb-color-base, #bfbfbf)",
|
|
440
438
|
"track-color": "var(--ap-table-header-bg, #f2f6f9)"
|
|
441
|
-
}, null, 8, ["scroll-container"])) :
|
|
439
|
+
}, null, 8, ["scroll-container"])) : y("", !0),
|
|
442
440
|
e.pagination !== !1 ? (s(), p(o(Oe), h({
|
|
443
441
|
key: 1,
|
|
444
442
|
class: o(c)("pagination")
|
|
445
|
-
}, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) :
|
|
443
|
+
}, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) : y("", !0)
|
|
446
444
|
], 2)
|
|
447
445
|
], 6)
|
|
448
446
|
], 6));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, computed as E, ref as d, createVNode as _, watch as z, createBlock as M, openBlock as W, unref as v, mergeProps as h, withCtx as q, createElementVNode as H, normalizeClass as J } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { ApBatchActionGroup as
|
|
3
|
+
import Q from "./icons/line-down.vue.mjs";
|
|
4
|
+
import { ApBatchActionGroup as X } from "../ap-batch-action-group/index.mjs";
|
|
5
5
|
import "./components/main-button-content.vue.mjs";
|
|
6
6
|
import "./components/menu-list-content.vue.mjs";
|
|
7
|
-
import { useViewProvide as
|
|
8
|
-
import { useInjectApTable as
|
|
9
|
-
import { SYSTEM_VIEW_KEY as
|
|
10
|
-
import { isValid as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import
|
|
7
|
+
import { useViewProvide as Z } from "./hooks/use-view-provide.mjs";
|
|
8
|
+
import { useInjectApTable as U } from "../../ap-table/context.mjs";
|
|
9
|
+
import { SYSTEM_VIEW_KEY as y } from "./utils/enum.mjs";
|
|
10
|
+
import { isValid as R } from "@aplus-frontend/utils";
|
|
11
|
+
import { useGlobalConfig as C } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useNamespace as O } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as S } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import D from "./components/main-button-content.vue2.mjs";
|
|
15
15
|
import ee from "./components/menu-list-content.vue2.mjs";
|
|
16
|
-
const
|
|
16
|
+
const Ve = /* @__PURE__ */ Y({
|
|
17
17
|
name: "ApView",
|
|
18
18
|
__name: "ap-view",
|
|
19
19
|
props: {
|
|
@@ -28,160 +28,163 @@ const ye = /* @__PURE__ */ I({
|
|
|
28
28
|
default: !1
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
b:
|
|
34
|
-
} =
|
|
35
|
-
t:
|
|
36
|
-
} =
|
|
37
|
-
viewKey:
|
|
38
|
-
viewName:
|
|
31
|
+
setup(F) {
|
|
32
|
+
const f = F, k = C("viewCacheOption"), {
|
|
33
|
+
b: K
|
|
34
|
+
} = O("ap-view"), {
|
|
35
|
+
t: A
|
|
36
|
+
} = S(), b = E(() => ({
|
|
37
|
+
viewKey: y,
|
|
38
|
+
viewName: A("ap.apView.systemView")
|
|
39
39
|
})), {
|
|
40
|
-
getSearchFormValues:
|
|
41
|
-
setSearchFormValues:
|
|
42
|
-
submit:
|
|
43
|
-
reset:
|
|
44
|
-
} =
|
|
45
|
-
let
|
|
46
|
-
const
|
|
40
|
+
getSearchFormValues: B,
|
|
41
|
+
setSearchFormValues: L,
|
|
42
|
+
submit: P,
|
|
43
|
+
reset: T
|
|
44
|
+
} = U(), j = d(!1), g = d(!1), V = d("");
|
|
45
|
+
let N = !1;
|
|
46
|
+
const G = {
|
|
47
47
|
dropdownType: "dropdown",
|
|
48
|
-
content: _(
|
|
49
|
-
maxViewNum:
|
|
48
|
+
content: _(D, {
|
|
49
|
+
maxViewNum: f.maxViewNum
|
|
50
50
|
}, null)
|
|
51
|
-
}, o =
|
|
52
|
-
id:
|
|
51
|
+
}, o = d([b.value]), $ = E(() => o.value.map((t) => ({
|
|
52
|
+
id: t.viewKey,
|
|
53
53
|
content: _(ee, {
|
|
54
|
-
view:
|
|
54
|
+
view: t
|
|
55
55
|
}, null)
|
|
56
|
-
}))),
|
|
57
|
-
getSearchFormValues:
|
|
58
|
-
setSearchFormValues:
|
|
59
|
-
submit:
|
|
60
|
-
reset:
|
|
61
|
-
...
|
|
62
|
-
},
|
|
63
|
-
...
|
|
64
|
-
...
|
|
56
|
+
}))), e = {
|
|
57
|
+
getSearchFormValues: B,
|
|
58
|
+
setSearchFormValues: L,
|
|
59
|
+
submit: P,
|
|
60
|
+
reset: T,
|
|
61
|
+
...f.saveDataSource
|
|
62
|
+
}, i = {
|
|
63
|
+
...k.value,
|
|
64
|
+
...f.viewCacheOption
|
|
65
65
|
}, x = () => {
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
68
|
-
const
|
|
69
|
-
return (
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
var s,
|
|
75
|
-
|
|
66
|
+
if (f.isDefaultSystemView)
|
|
67
|
+
return y;
|
|
68
|
+
const t = o.value.find((l) => l.isDefault);
|
|
69
|
+
return (t == null ? void 0 : t.viewKey) ?? y;
|
|
70
|
+
}, p = (t) => {
|
|
71
|
+
V.value = t;
|
|
72
|
+
const l = o.value.find((s) => s.viewKey === V.value);
|
|
73
|
+
l && setTimeout(() => {
|
|
74
|
+
var s, n, m, a, r, u;
|
|
75
|
+
l.viewKey === y ? N ? (s = e == null ? void 0 : e.submit) == null || s.call(e) : (n = e == null ? void 0 : e.reset) == null || n.call(e) : ((r = e == null ? void 0 : e.setSearchFormValues) == null || r.call(e, {
|
|
76
|
+
...Object.fromEntries(Object.keys(((m = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : m.call(e)) ?? {}).map((w) => [w, void 0])) ?? {},
|
|
77
|
+
...((a = l.viewConfig) == null ? void 0 : a.searchForm) ?? {}
|
|
78
|
+
}), (u = e == null ? void 0 : e.submit) == null || u.call(e)), N = !1;
|
|
76
79
|
});
|
|
77
80
|
}, c = {
|
|
78
|
-
getViewList: async (
|
|
79
|
-
var
|
|
81
|
+
getViewList: async (t) => {
|
|
82
|
+
var l;
|
|
80
83
|
try {
|
|
81
84
|
const {
|
|
82
85
|
tableKey: s
|
|
83
|
-
} =
|
|
86
|
+
} = t, n = await ((l = i == null ? void 0 : i.getViewList) == null ? void 0 : l.call(i, {
|
|
84
87
|
tableKey: s
|
|
85
88
|
}));
|
|
86
|
-
return o.value = [
|
|
89
|
+
return o.value = [b.value, ...n ?? []], p(x()), o.value;
|
|
87
90
|
} catch {
|
|
88
|
-
return o.value = [
|
|
91
|
+
return o.value = [b.value], p(y), o.value;
|
|
89
92
|
}
|
|
90
93
|
},
|
|
91
|
-
addView: async (
|
|
94
|
+
addView: async (t) => {
|
|
92
95
|
var r;
|
|
93
96
|
const {
|
|
94
|
-
tableKey:
|
|
97
|
+
tableKey: l,
|
|
95
98
|
viewKey: s,
|
|
96
|
-
viewName:
|
|
97
|
-
isDefault:
|
|
98
|
-
viewConfig:
|
|
99
|
-
} =
|
|
100
|
-
await ((r =
|
|
101
|
-
tableKey:
|
|
99
|
+
viewName: n,
|
|
100
|
+
isDefault: m,
|
|
101
|
+
viewConfig: a
|
|
102
|
+
} = t;
|
|
103
|
+
await ((r = i == null ? void 0 : i.addView) == null ? void 0 : r.call(i, {
|
|
104
|
+
tableKey: l,
|
|
102
105
|
viewKey: s,
|
|
103
|
-
viewName:
|
|
104
|
-
isDefault:
|
|
105
|
-
viewConfig:
|
|
106
|
-
})),
|
|
107
|
-
...
|
|
106
|
+
viewName: n,
|
|
107
|
+
isDefault: m,
|
|
108
|
+
viewConfig: a
|
|
109
|
+
})), m && (o.value = o.value.map((u) => ({
|
|
110
|
+
...u,
|
|
108
111
|
isDefault: !1
|
|
109
112
|
}))), o.value = [...o.value, {
|
|
110
113
|
viewKey: s,
|
|
111
|
-
viewName:
|
|
112
|
-
isDefault:
|
|
113
|
-
viewConfig:
|
|
114
|
-
}],
|
|
114
|
+
viewName: n,
|
|
115
|
+
isDefault: m,
|
|
116
|
+
viewConfig: a
|
|
117
|
+
}], p(s);
|
|
115
118
|
},
|
|
116
|
-
changeView: async (
|
|
117
|
-
var
|
|
119
|
+
changeView: async (t) => {
|
|
120
|
+
var u;
|
|
118
121
|
const {
|
|
119
|
-
tableKey:
|
|
122
|
+
tableKey: l,
|
|
120
123
|
viewKey: s,
|
|
121
|
-
viewName:
|
|
122
|
-
isDefault:
|
|
123
|
-
viewConfig:
|
|
124
|
-
} =
|
|
125
|
-
await ((
|
|
126
|
-
tableKey:
|
|
124
|
+
viewName: n,
|
|
125
|
+
isDefault: m,
|
|
126
|
+
viewConfig: a
|
|
127
|
+
} = t;
|
|
128
|
+
await ((u = i == null ? void 0 : i.changeView) == null ? void 0 : u.call(i, {
|
|
129
|
+
tableKey: l,
|
|
127
130
|
viewKey: s,
|
|
128
|
-
viewName:
|
|
129
|
-
isDefault:
|
|
130
|
-
viewConfig:
|
|
131
|
-
})),
|
|
132
|
-
...
|
|
131
|
+
viewName: n,
|
|
132
|
+
isDefault: m,
|
|
133
|
+
viewConfig: a
|
|
134
|
+
})), m && (o.value = o.value.map((w) => ({
|
|
135
|
+
...w,
|
|
133
136
|
isDefault: !1
|
|
134
137
|
})));
|
|
135
|
-
const r = o.value.find((
|
|
136
|
-
r && (r.viewName =
|
|
138
|
+
const r = o.value.find((w) => w.viewKey === s);
|
|
139
|
+
r && (r.viewName = n, r.isDefault = m, r.viewConfig = a), p(s);
|
|
137
140
|
},
|
|
138
|
-
removeView: async (
|
|
139
|
-
var
|
|
141
|
+
removeView: async (t) => {
|
|
142
|
+
var n;
|
|
140
143
|
const {
|
|
141
|
-
tableKey:
|
|
144
|
+
tableKey: l,
|
|
142
145
|
viewKey: s
|
|
143
|
-
} =
|
|
144
|
-
await ((
|
|
145
|
-
tableKey:
|
|
146
|
+
} = t;
|
|
147
|
+
await ((n = i == null ? void 0 : i.removeView) == null ? void 0 : n.call(i, {
|
|
148
|
+
tableKey: l,
|
|
146
149
|
viewKey: s
|
|
147
|
-
})), o.value = o.value.filter((
|
|
150
|
+
})), o.value = o.value.filter((m) => m.viewKey !== s), s === V.value && p(x());
|
|
148
151
|
}
|
|
149
|
-
},
|
|
150
|
-
tableKey:
|
|
151
|
-
currentViewKey:
|
|
152
|
-
changeCurrentViewKey:
|
|
153
|
-
popoverOpen:
|
|
154
|
-
menuOpen:
|
|
152
|
+
}, I = {
|
|
153
|
+
tableKey: f.tableKey,
|
|
154
|
+
currentViewKey: V,
|
|
155
|
+
changeCurrentViewKey: p,
|
|
156
|
+
popoverOpen: j,
|
|
157
|
+
menuOpen: g,
|
|
155
158
|
viewList: o,
|
|
156
159
|
viewListCRUD: c,
|
|
157
|
-
saveDataSource:
|
|
160
|
+
saveDataSource: e
|
|
158
161
|
};
|
|
159
|
-
return
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
tableKey:
|
|
162
|
+
return Z(I), z(() => f.tableKey, (t) => {
|
|
163
|
+
var l;
|
|
164
|
+
R(t) && (N = !0, (l = c == null ? void 0 : c.getViewList) == null || l.call(c, {
|
|
165
|
+
tableKey: t
|
|
163
166
|
}));
|
|
164
167
|
}, {
|
|
165
168
|
immediate: !0
|
|
166
|
-
}), (
|
|
167
|
-
...
|
|
169
|
+
}), (t, l) => (W(), M(v(X), h({
|
|
170
|
+
...t.$attrs
|
|
168
171
|
}, {
|
|
169
|
-
open:
|
|
170
|
-
"onUpdate:open":
|
|
171
|
-
class: [
|
|
172
|
-
"button-props":
|
|
172
|
+
open: g.value,
|
|
173
|
+
"onUpdate:open": l[0] || (l[0] = (s) => g.value = s),
|
|
174
|
+
class: [v(K)()],
|
|
175
|
+
"button-props": G,
|
|
173
176
|
"menu-list": $.value,
|
|
174
|
-
"overlay-class-name": [
|
|
177
|
+
"overlay-class-name": [v(K)("overlay")],
|
|
175
178
|
trigger: "click",
|
|
176
179
|
placement: "bottom"
|
|
177
180
|
}), {
|
|
178
|
-
icon:
|
|
179
|
-
class:
|
|
180
|
-
}, [_(
|
|
181
|
+
icon: q(() => [H("div", {
|
|
182
|
+
class: J([v(K)("icon")])
|
|
183
|
+
}, [_(Q)], 2)]),
|
|
181
184
|
_: 1
|
|
182
185
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
183
186
|
}
|
|
184
187
|
});
|
|
185
188
|
export {
|
|
186
|
-
|
|
189
|
+
Ve as default
|
|
187
190
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@aplus-frontend/antdv"),N=require("@aplus-frontend/icon");require("../../../../config-provider/index.js");const g=require("vuedraggable");require("./sortable-item.vue.js");const y=require("../../../item-group/helper.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@aplus-frontend/antdv"),N=require("@aplus-frontend/icon");require("../../../../config-provider/index.js");const g=require("vuedraggable");require("./sortable-item.vue.js");const y=require("../../../item-group/helper.js"),f=require("../../../../config-provider/hooks/use-namespace.js"),V=require("../../../../config-provider/hooks/use-locale.js"),_=require("./sortable-item.vue2.js"),x=e.defineComponent({name:"ApFormSearchFormPopoverSorter",__name:"index",props:{children:{},onClickConfirm:{type:Function}},setup(m){const s=m,a=e.ref(s.children);let p=[...s.children];e.watch(()=>s.children,n=>{a.value=n,p=n});const{e:l}=f.useNamespace("ap-form-search-form"),{b:r}=f.useNamespace("search-form-sorter"),{t:o}=V.useLocale(),c=e.ref(!1);function d(n){return n.closest(".ant-form")||document.body}function C(){c.value=!1,console.log(e.unref(a)),s.onClickConfirm(e.unref(a))}function h(){a.value=[...p]}function v(n){return y.getStringName(n.props.name)}return(n,i)=>(e.openBlock(),e.createBlock(e.unref(t.Popover),{open:c.value,"onUpdate:open":i[1]||(i[1]=u=>c.value=u),"overlay-class-name":e.unref(l)("popover"),trigger:"click",placement:"bottom",mask:"","mask-style":{backgroundColor:"transparent"},"get-popup-container":d},{content:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-title"))},e.toDisplayString(e.unref(o)("ap.apForm.search.sorterTitle")),3),e.createVNode(e.unref(t.Flex),{justify:"space-between"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-desc"))},e.toDisplayString(e.unref(o)("ap.apForm.search.sorterDesc")),3),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header-action-wrapper")),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-reset-btn"))},e.toDisplayString(e.unref(o)("ap.apForm.search.sorterReset")),3)],2)]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass([e.unref(l)("popover-content"),e.unref(r)("content")])},[e.createVNode(e.unref(g),{list:a.value,class:e.normalizeClass(e.unref(r)("sorter-wrapper")),"item-key":v},{item:e.withCtx(({element:u})=>[e.createVNode(_.default,{item:u},null,8,["item"])]),_:1},8,["list","class"])],2),e.createVNode(e.unref(t.Divider),{style:{margin:"0"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("popover-footer"))},[e.createVNode(e.unref(t.Flex),{justify:"end"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),{onClick:i[0]||(i[0]=u=>c.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.common.cancelText")),1)]),_:1}),e.createVNode(e.unref(t.Button),{class:e.normalizeClass(e.unref(l)("popover-footer-confirm-btn")),type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apForm.search.sorterConfirmBtn")),1)]),_:1},8,["class"])]),_:1})],2)]),default:e.withCtx(()=>[e.createVNode(e.unref(t.Tooltip),{title:e.unref(o)("ap.apForm.search.sorterTitle"),placement:"top"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(N.IconApLayoutOutlined))]),_:1})]),_:1},8,["title"])]),_:1},8,["open","overlay-class-name"]))}});exports.default=x;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const sizeMap: {
|
|
2
2
|
readonly mini: "small";
|
|
3
3
|
readonly small: "small";
|
|
4
|
-
readonly medium: "
|
|
4
|
+
readonly medium: "middle";
|
|
5
5
|
};
|
|
6
6
|
export declare const sizeReverseMap: {
|
|
7
|
-
readonly small: "
|
|
8
|
-
readonly middle:
|
|
7
|
+
readonly small: "mini";
|
|
8
|
+
readonly middle: "medium";
|
|
9
9
|
};
|
|
10
10
|
export declare const ROW_SELECTION_FIELD = "_ap-grid-row-selection-field";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={mini:"small",small:"small",medium:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={mini:"small",small:"small",medium:"middle"},i={small:"mini",middle:"medium"},s="_ap-grid-row-selection-field";exports.ROW_SELECTION_FIELD=s;exports.sizeMap=e;exports.sizeReverseMap=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("vxe-table");require("vxe-table/es/style.css");require("vxe-pc-ui/es/style.css");const D=require("vxe-pc-ui"),p=require("lodash-unified"),ce=require("../ap-form/index.js");require("../config-provider/index.js");const de=require("../ap-table/constants.js"),f=require("../ap-table/utils.js"),ie=require("../ap-table/hooks/use-table-paging-ng.js"),E=require("@aplus-frontend/antdv"),fe=require("./hooks/use-inner-params.js"),F=require("./utils/table.js"),pe=require("../ap-table/hooks/use-table-row-selection.js"),me=require("../ap-table/context.js"),P=require("./constants.js"),ge=require("./hooks/use-render-columns.js"),he=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const Ce=require("../utils/index.js"),ve=require("../utils/slot.js"),be=require("../config-provider/hooks/use-namespace.js"),ye=require("../config-provider/hooks/use-global-config.js"),xe=require("../config-provider/hooks/use-locale.js"),Se=require("../scroll-bar/index.vue.js"),we=e.defineComponent({name:"ApGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},tableLayout:{},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean,default:void 0},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{}},setup(O,{expose:U}){var L;const m=e.useSlots(),o=O,C=(L=e.getCurrentInstance())==null?void 0:L.appContext.app;C&&!C.__VXE_PC_UI_INSTALLED__&&(C.use(D.VxeUI),C.__VXE_PC_UI_INSTALLED__=!0);const{e:y,b:s,be:$}=be.useNamespace("ap-grid"),K=ye.useGlobalConfig("valueTypeMap"),l=e.ref([]),N=e.ref([]),d=e.ref(),g=e.ref(o.size),[,u]=he.useToken(),{t:M}=xe.useLocale();D.VxeUI.setConfig({i18n:(r,a)=>M(`ap.${r}`,a)});const{renderConfig:j,updateSignal:W}=ge.useRenderColumns(l);let I=0;const H=e.computed(()=>{if(d.value)return d.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),q=e.computed(()=>{var r,a,n;return I++,((n=(a=(r=o.columns)==null?void 0:r.filter(t=>!t.hideInSearch&&t.dataIndex&&(t.valueType||t.customRenderFormItem)&&!de.noRenderAsFormItemValueList.includes(t.valueType)))==null?void 0:a.sort((t,c)=>{let h=f.getColumnOrder(t.order);return f.getColumnOrder(c.order)-h}))==null?void 0:n.map(t=>{const c=f.updateFormProps(t,f.getFieldProps(t.fieldProps,{})),h={...t,fieldProps:{label:t.title,name:t.dataIndex,bordered:!0,...c||{},_signal:I},renderNode:void 0};return h.renderNode=f.getSearchFormItemRenderNode(h,e.unref(K)),h}))||[]}),G=e.computed(()=>{var a;return Ce.isDef(o.manual)?o.manual:ve.getValidVNodeList(((a=m.searchFormExtra)==null?void 0:a.call(m))||[]).some(n=>{var t;return((t=n.type)==null?void 0:t.name)==="ApView"})}),X=e.computed(()=>[s(),o.card?null:s("wrapper"),o.adaptive?s("adaptive"):null,o.sticky?s("sticky"):null].filter(Boolean)),V=e.computed(()=>f.recursionApColumns(e.unref(l),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),z=e.computed(()=>f.recursionApColumns(e.unref(l),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),{formRef:x,submit:S,reset:w,refresh:J,data:i,tableProps:_,setDataSource:Q,handleTableChange:Y}=ie.useTablePaging({async request(r){var n;if(!b.value.preserveSelectedRowKeys&&p.isUndefined(o.dataSource)&&B(),!p.isUndefined(o.dataSource)){const t=r.pageSize*(r.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(t,t+r.pageSize))||[],total:o.dataSource.length||0}}const a=await((n=o.request)==null?void 0:n.call(o,r));return{data:(a==null?void 0:a.data)||[],total:(a==null?void 0:a.total)||0}},namespace:"ap-grid",filterFields:z,sortFields:V,defaultParams:o.params,defaultData:o.defaultData,manual:e.unref(G),formatParams:o.beforeSearchSubmit,pagination:o.pagination}),{sortChangeEvent:Z,filterChangeEvent:ee,paginationChangeEvent:re}=fe.useInnerParams(Y);me.useProvideApTable({columns:e.computed(()=>l.value),columnsBackup:e.computed(()=>N.value),size:e.computed(()=>g.value?P.sizeMap[g.value]:"middle"),updateColumns(r){var a;l.value=r,(a=o.onShownColumnsChange)==null||a.call(o,r)},updateSize(r){g.value=P.sizeReverseMap[r]},renderConfig:e.computed(()=>({className:$("table-header","title"),color:u.value.colorPrimary})),dataSource:e.computed(()=>e.unref(i).records),getSearchFormValues:A,setSearchFormValues:T,submit:S,reset:w});const oe=e.computed(()=>l.value.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),ae=e.computed(()=>p.isUndefined(o.loading)?i.loading:o.loading),te=e.computed(()=>p.isUndefined(o.dataSource)?i.records:o.dataSource),{selectedRows:v,rowSelection:b,...ne}=pe.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:te,rowKey:o.rowKey}),k=()=>{const r=d.value;r&&(v.value=[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},le=()=>{const r=d.value;r&&(v.value=[r.getRadioRecord()])};function ue(){var r;return((r=o.columns)==null?void 0:r.filter(a=>!a.hideInTable))||[]}function T(r){var a,n,t;(t=(n=(a=x.value)==null?void 0:a.apForm)==null?void 0:n.setFieldsValue)==null||t.call(n,r)}function A(r=!1){var n,t,c;const a=r?"getFieldsValueTransformed":"getFieldsValue";return(c=(t=(n=x.value)==null?void 0:n.apForm)==null?void 0:t[a])==null?void 0:c.call(t,!0)}function B(){ne.clearAll();const r=d.value;r&&(b.value.type==="radio"?(r.clearRadioRow(),r.clearRadioReserve()):(r.clearCheckboxRow(),r.clearCheckboxReserve()))}async function se(r,a){var t;const n=i.records[r];if(n)return(t=d.value)==null?void 0:t.scrollToRow(n,a)}return e.watch(()=>[o.columnResizable,o.columns],()=>{var a;const r=ue();l.value=r,(a=o.onShownColumnsChange)==null||a.call(o,r),N.value=r},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,r=>{Q(r)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(i).loading,r=>{var a;(a=o.onLoadingChange)==null||a.call(o,r)}),e.watch(()=>o.size,r=>{g.value=r}),U({submit:S,reset:w,refresh:J,setSearchFormValues:T,getSearchFormValues:A,getShowColumns:()=>e.unref(l),rowSelection:{selectedRows:e.computed(()=>v.value),clearAll:B},scrollToRow:se,getDataSource:()=>e.unref(i.records)}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(X.value),style:e.normalizeStyle(r.wrapperStyle)},[e.unref(p.isUndefined)(r.dataSource)&&r.searchForm!==!1&&q.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(y)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(ce.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:x,"custom-reset":"","submit-loading":e.unref(_).loading,onSubmit:e.unref(S),onReset:e.unref(w)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode.Comp),e.mergeProps({key:n.dataIndex,item:n,ref_for:!0},n.fieldProps||{},{span:n.span,"custom-render":n.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[m.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("table-wrapper"),r.card?e.unref(y)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("header-wrapper"))},[e.renderSlot(r.$slots,"title",{selectedRows:e.unref(v),selectedRowKeys:e.unref(b).selectedRowKeys,shownColumns:l.value,clearAll:B})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(R.VxeTable),e.mergeProps(e.unref(F.toVxeProps)(o),{ref_key:"tableRef",ref:d,key:e.unref(W),data:e.unref(i).records,"sort-config":{remote:V.value.length>0},"filter-config":{remote:z.value.length>0},loading:ae.value,style:{"--vxe-ui-table-row-checkbox-checked-background-color":e.unref(u).controlItemBgActive,"--vxe-ui-table-row-hover-checkbox-checked-background-color":e.unref(u).controlItemBgActiveHover,"--vxe-ui-font-primary-color":e.unref(u).colorPrimary,"--vxe-ui-table-header-background-color":"var(--ap-table-header-bg)","--vxe-ui-table-cell-padding-default":"12px","--vxe-ui-table-cell-padding-medium":"9px","--vxe-ui-table-row-radio-checked-background-color":e.unref(u).controlItemBgActive,"--vxe-ui-table-row-hover-radio-checked-background-color":e.unref(u).controlItemBgActiveHover,"--vxe-ui-font-color":e.unref(u).colorTextBase,"--vxe-ui-table-border-color":e.unref(u).colorBorderSecondary,"--vxe-ui-table-header-font-color":e.unref(u).colorTextBase,"--vxe-ui-table-cell-padding-mini":"8px","--vxe-ui-table-row-line-height":"18px"},size:g.value,onSortChange:e.unref(Z),onFilterChange:e.unref(ee),onCheckboxChange:k,onCheckboxRangeChange:k,onCheckboxAll:k,onRadioChange:le}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(E.Empty),{image:e.unref(E.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),default:e.withCtx(()=>[o.expandable?(e.openBlock(),e.createBlock(e.unref(R.VxeColumn),e.mergeProps({key:0},e.unref(F.getRowExpandProps)(r.expandable),{fixed:oe.value}),{content:e.withCtx(n=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(n))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection?(e.openBlock(),e.createBlock(e.unref(R.VxeColumn),e.mergeProps({key:1},e.unref(F.getRowSelectionProps)(e.unref(b),l.value),{field:e.unref(P.ROW_SELECTION_FIELD)}),null,16,["field"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(j),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:n.props.colId}))),128))]),_:2},[e.renderList(e.unref(p.omit)(m,["searchFormExtra"]),(n,t)=>({name:t,fn:e.withCtx(c=>[e.renderSlot(r.$slots,t,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["data","sort-config","filter-config","loading","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("pagination-wrapper"))},[r.sticky?(e.openBlock(),e.createBlock(e.unref(Se.default),{key:0,direction:"horizontal","scroll-container":H.value,"extra-size":-4.2,"bar-color":"var(--basic-scrollbar-thumb-color-base, #bfbfbf)","track-color":"var(--ap-table-header-bg, #f2f6f9)"},null,8,["scroll-container"])):e.createCommentVNode("",!0),r.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(E.Pagination),e.mergeProps({key:1,class:e.unref(s)("pagination")},e.unref(_).pagination,{onChange:e.unref(re)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=we;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("vxe-table");require("vxe-table/es/style.css");require("vxe-pc-ui/es/style.css");const D=require("vxe-pc-ui"),p=require("lodash-unified"),ce=require("../ap-form/index.js");require("../config-provider/index.js");const de=require("../ap-table/constants.js"),f=require("../ap-table/utils.js"),ie=require("../ap-table/hooks/use-table-paging-ng.js"),E=require("@aplus-frontend/antdv"),fe=require("./hooks/use-inner-params.js"),F=require("./utils/table.js"),pe=require("../ap-table/hooks/use-table-row-selection.js"),me=require("../ap-table/context.js"),P=require("./constants.js"),ge=require("./hooks/use-render-columns.js"),he=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const Ce=require("../utils/index.js"),ve=require("../utils/slot.js"),be=require("../config-provider/hooks/use-namespace.js"),ye=require("../config-provider/hooks/use-global-config.js"),Se=require("../config-provider/hooks/use-locale.js"),we=require("../scroll-bar/index.vue.js"),xe=e.defineComponent({name:"ApGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},tableLayout:{},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean,default:void 0},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{}},setup(O,{expose:U}){var L;const m=e.useSlots(),o=O,h=(L=e.getCurrentInstance())==null?void 0:L.appContext.app;h&&!h.__VXE_PC_UI_INSTALLED__&&(h.use(D.VxeUI),h.__VXE_PC_UI_INSTALLED__=!0);const{e:y,b:u,be:$}=be.useNamespace("ap-grid"),K=ye.useGlobalConfig("valueTypeMap"),l=e.ref([]),N=e.ref([]),d=e.ref(),C=e.ref(o.size),[,s]=he.useToken(),{t:M}=Se.useLocale();D.VxeUI.setConfig({i18n:(r,a)=>M(`ap.${r}`,a)});const{renderConfig:j,updateSignal:W}=ge.useRenderColumns(l);let I=0;const H=e.computed(()=>{if(d.value)return d.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),q=e.computed(()=>{var r,a,n;return I++,((n=(a=(r=o.columns)==null?void 0:r.filter(t=>!t.hideInSearch&&t.dataIndex&&(t.valueType||t.customRenderFormItem)&&!de.noRenderAsFormItemValueList.includes(t.valueType)))==null?void 0:a.sort((t,c)=>{let g=f.getColumnOrder(t.order);return f.getColumnOrder(c.order)-g}))==null?void 0:n.map(t=>{const c=f.updateFormProps(t,f.getFieldProps(t.fieldProps,{})),g={...t,fieldProps:{label:t.title,name:t.dataIndex,bordered:!0,...c||{},_signal:I},renderNode:void 0};return g.renderNode=f.getSearchFormItemRenderNode(g,e.unref(K)),g}))||[]}),G=e.computed(()=>{var a;return Ce.isDef(o.manual)?o.manual:ve.getValidVNodeList(((a=m.searchFormExtra)==null?void 0:a.call(m))||[]).some(n=>{var t;return((t=n.type)==null?void 0:t.name)==="ApView"})}),X=e.computed(()=>[u(),o.card?null:u("wrapper"),o.adaptive?u("adaptive"):null,o.sticky?u("sticky"):null].filter(Boolean)),V=e.computed(()=>f.recursionApColumns(e.unref(l),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),z=e.computed(()=>f.recursionApColumns(e.unref(l),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),{formRef:S,submit:w,reset:x,refresh:J,data:i,tableProps:_,setDataSource:Q,handleTableChange:Y}=ie.useTablePaging({async request(r){var n;if(!b.value.preserveSelectedRowKeys&&p.isUndefined(o.dataSource)&&B(),!p.isUndefined(o.dataSource)){const t=r.pageSize*(r.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(t,t+r.pageSize))||[],total:o.dataSource.length||0}}const a=await((n=o.request)==null?void 0:n.call(o,r));return{data:(a==null?void 0:a.data)||[],total:(a==null?void 0:a.total)||0}},namespace:"ap-grid",filterFields:z,sortFields:V,defaultParams:o.params,defaultData:o.defaultData,manual:e.unref(G),formatParams:o.beforeSearchSubmit,pagination:o.pagination}),{sortChangeEvent:Z,filterChangeEvent:ee,paginationChangeEvent:re}=fe.useInnerParams(Y);me.useProvideApTable({columns:e.computed(()=>l.value),columnsBackup:e.computed(()=>N.value),size:e.computed(()=>P.sizeMap[C.value]),updateColumns(r){var a;l.value=r,(a=o.onShownColumnsChange)==null||a.call(o,r)},updateSize(r){C.value=P.sizeReverseMap[r]},renderConfig:e.computed(()=>({className:$("table-header","title"),color:s.value.colorPrimary})),dataSource:e.computed(()=>e.unref(i).records),getSearchFormValues:A,setSearchFormValues:T,submit:w,reset:x});const oe=e.computed(()=>l.value.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),ae=e.computed(()=>p.isUndefined(o.loading)?i.loading:o.loading),te=e.computed(()=>p.isUndefined(o.dataSource)?i.records:o.dataSource),{selectedRows:v,rowSelection:b,...ne}=pe.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:te,rowKey:o.rowKey}),k=()=>{const r=d.value;r&&(v.value=[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},le=()=>{const r=d.value;r&&(v.value=[r.getRadioRecord()])};function se(){var r;return((r=o.columns)==null?void 0:r.filter(a=>!a.hideInTable))||[]}function T(r){var a,n,t;(t=(n=(a=S.value)==null?void 0:a.apForm)==null?void 0:n.setFieldsValue)==null||t.call(n,r)}function A(r=!1){var n,t,c;const a=r?"getFieldsValueTransformed":"getFieldsValue";return(c=(t=(n=S.value)==null?void 0:n.apForm)==null?void 0:t[a])==null?void 0:c.call(t,!0)}function B(){ne.clearAll();const r=d.value;r&&(b.value.type==="radio"?(r.clearRadioRow(),r.clearRadioReserve()):(r.clearCheckboxRow(),r.clearCheckboxReserve()))}async function ue(r,a){var t;const n=i.records[r];if(n)return(t=d.value)==null?void 0:t.scrollToRow(n,a)}return e.watch(()=>[o.columnResizable,o.columns],()=>{var a;const r=se();l.value=r,(a=o.onShownColumnsChange)==null||a.call(o,r),N.value=r},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,r=>{Q(r)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(i).loading,r=>{var a;(a=o.onLoadingChange)==null||a.call(o,r)}),e.watch(()=>o.size,r=>{C.value=r}),U({submit:w,reset:x,refresh:J,setSearchFormValues:T,getSearchFormValues:A,getShowColumns:()=>e.unref(l),rowSelection:{selectedRows:e.computed(()=>v.value),clearAll:B},scrollToRow:ue,getDataSource:()=>e.unref(i.records)}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(X.value),style:e.normalizeStyle(r.wrapperStyle)},[e.unref(p.isUndefined)(r.dataSource)&&r.searchForm!==!1&&q.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(y)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(ce.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:S,"custom-reset":"","submit-loading":e.unref(_).loading,onSubmit:e.unref(w),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode.Comp),e.mergeProps({key:n.dataIndex,item:n,ref_for:!0},n.fieldProps||{},{span:n.span,"custom-render":n.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[m.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("table-wrapper"),r.card?e.unref(y)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("header-wrapper"))},[e.renderSlot(r.$slots,"title",{selectedRows:e.unref(v),selectedRowKeys:e.unref(b).selectedRowKeys,shownColumns:l.value,clearAll:B})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(R.VxeTable),e.mergeProps(e.unref(F.toVxeProps)(o),{ref_key:"tableRef",ref:d,key:e.unref(W),data:e.unref(i).records,"sort-config":{remote:V.value.length>0},"filter-config":{remote:z.value.length>0},loading:ae.value,style:{"--vxe-ui-table-row-checkbox-checked-background-color":e.unref(s).controlItemBgActive,"--vxe-ui-table-row-hover-checkbox-checked-background-color":e.unref(s).controlItemBgActiveHover,"--vxe-ui-font-primary-color":e.unref(s).colorPrimary,"--vxe-ui-table-header-background-color":"var(--ap-table-header-bg)","--vxe-ui-table-cell-padding-default":"12px","--vxe-ui-table-cell-padding-medium":"9px","--vxe-ui-table-row-radio-checked-background-color":e.unref(s).controlItemBgActive,"--vxe-ui-table-row-hover-radio-checked-background-color":e.unref(s).controlItemBgActiveHover,"--vxe-ui-font-color":e.unref(s).colorTextBase,"--vxe-ui-table-border-color":e.unref(s).colorBorderSecondary,"--vxe-ui-table-header-font-color":e.unref(s).colorTextBase},size:C.value,onSortChange:e.unref(Z),onFilterChange:e.unref(ee),onCheckboxChange:k,onCheckboxRangeChange:k,onCheckboxAll:k,onRadioChange:le}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(E.Empty),{image:e.unref(E.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),default:e.withCtx(()=>[o.expandable?(e.openBlock(),e.createBlock(e.unref(R.VxeColumn),e.mergeProps({key:0},e.unref(F.getRowExpandProps)(r.expandable),{fixed:oe.value}),{content:e.withCtx(n=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(n))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection?(e.openBlock(),e.createBlock(e.unref(R.VxeColumn),e.mergeProps({key:1},e.unref(F.getRowSelectionProps)(e.unref(b),l.value),{field:e.unref(P.ROW_SELECTION_FIELD)}),null,16,["field"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(j),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:n.props.colId}))),128))]),_:2},[e.renderList(e.unref(p.omit)(m,["searchFormExtra"]),(n,t)=>({name:t,fn:e.withCtx(c=>[e.renderSlot(r.$slots,t,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["data","sort-config","filter-config","loading","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("pagination-wrapper"))},[r.sticky?(e.openBlock(),e.createBlock(e.unref(we.default),{key:0,direction:"horizontal","scroll-container":H.value,"extra-size":-4.2,"bar-color":"var(--basic-scrollbar-thumb-color-base, #bfbfbf)","track-color":"var(--ap-table-header-bg, #f2f6f9)"},null,8,["scroll-container"])):e.createCommentVNode("",!0),r.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(E.Pagination),e.mergeProps({key:1,class:e.unref(u)("pagination")},e.unref(_).pagination,{onChange:e.unref(re)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=xe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue");require("../../config-provider/index.js");const L=require("./icons/line-down.vue.js"),W=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const j=require("./hooks/use-view-provide.js"),k=require("../../ap-table/context.js"),V=require("./utils/enum.js"),A=require("@aplus-frontend/utils"),G=require("../../config-provider/hooks/use-global-config.js"),S=require("../../config-provider/hooks/use-namespace.js"),z=require("../../config-provider/hooks/use-locale.js"),$=require("./components/main-button-content.vue2.js"),h=require("./components/menu-list-content.vue2.js"),H=n.defineComponent({name:"ApView",__name:"ap-view",props:{tableKey:{},saveDataSource:{},viewCacheOption:{},maxViewNum:{default:20},isDefaultSystemView:{type:Boolean,default:!1}},setup(E){const m=E,q=G.useGlobalConfig("viewCacheOption"),{b:v}=S.useNamespace("ap-view"),{t:N}=z.useLocale(),_=n.computed(()=>({viewKey:V.SYSTEM_VIEW_KEY,viewName:N("ap.apView.systemView")})),{getSearchFormValues:Y,setSearchFormValues:T,submit:M,reset:x}=k.useInjectApTable(),I=n.ref(!1),K=n.ref(!1),p=n.ref("");let b=!1;const P={dropdownType:"dropdown",content:n.createVNode($.default,{maxViewNum:m.maxViewNum},null)},u=n.ref([_.value]),B=n.computed(()=>u.value.map(t=>({id:t.viewKey,content:n.createVNode(h.default,{view:t},null)}))),e={getSearchFormValues:Y,setSearchFormValues:T,submit:M,reset:x,...m.saveDataSource},s={...q.value,...m.viewCacheOption},g=()=>{if(m.isDefaultSystemView)return V.SYSTEM_VIEW_KEY;const t=u.value.find(i=>i.isDefault);return(t==null?void 0:t.viewKey)??V.SYSTEM_VIEW_KEY},w=t=>{p.value=t;const i=u.value.find(l=>l.viewKey===p.value);i&&setTimeout(()=>{var l,r,o,c,a,f;i.viewKey===V.SYSTEM_VIEW_KEY?b?(l=e==null?void 0:e.submit)==null||l.call(e):(r=e==null?void 0:e.reset)==null||r.call(e):((a=e==null?void 0:e.setSearchFormValues)==null||a.call(e,{...Object.fromEntries(Object.keys(((o=e==null?void 0:e.getSearchFormValues)==null?void 0:o.call(e))??{}).map(d=>[d,void 0]))??{},...((c=i.viewConfig)==null?void 0:c.searchForm)??{}}),(f=e==null?void 0:e.submit)==null||f.call(e)),b=!1})},y={getViewList:async t=>{var i;try{const{tableKey:l}=t,r=await((i=s==null?void 0:s.getViewList)==null?void 0:i.call(s,{tableKey:l}));return u.value=[_.value,...r??[]],w(g()),u.value}catch{return u.value=[_.value],w(V.SYSTEM_VIEW_KEY),u.value}},addView:async t=>{var a;const{tableKey:i,viewKey:l,viewName:r,isDefault:o,viewConfig:c}=t;await((a=s==null?void 0:s.addView)==null?void 0:a.call(s,{tableKey:i,viewKey:l,viewName:r,isDefault:o,viewConfig:c})),o&&(u.value=u.value.map(f=>({...f,isDefault:!1}))),u.value=[...u.value,{viewKey:l,viewName:r,isDefault:o,viewConfig:c}],w(l)},changeView:async t=>{var f;const{tableKey:i,viewKey:l,viewName:r,isDefault:o,viewConfig:c}=t;await((f=s==null?void 0:s.changeView)==null?void 0:f.call(s,{tableKey:i,viewKey:l,viewName:r,isDefault:o,viewConfig:c})),o&&(u.value=u.value.map(d=>({...d,isDefault:!1})));const a=u.value.find(d=>d.viewKey===l);a&&(a.viewName=r,a.isDefault=o,a.viewConfig=c),w(l)},removeView:async t=>{var r;const{tableKey:i,viewKey:l}=t;await((r=s==null?void 0:s.removeView)==null?void 0:r.call(s,{tableKey:i,viewKey:l})),u.value=u.value.filter(o=>o.viewKey!==l),l===p.value&&w(g())}},F={tableKey:m.tableKey,currentViewKey:p,changeCurrentViewKey:w,popoverOpen:I,menuOpen:K,viewList:u,viewListCRUD:y,saveDataSource:e};return j.useViewProvide(F),n.watch(()=>m.tableKey,t=>{var i;A.isValid(t)&&(b=!0,(i=y==null?void 0:y.getViewList)==null||i.call(y,{tableKey:t}))},{immediate:!0}),(t,i)=>(n.openBlock(),n.createBlock(n.unref(W.ApBatchActionGroup),n.mergeProps({...t.$attrs},{open:K.value,"onUpdate:open":i[0]||(i[0]=l=>K.value=l),class:[n.unref(v)()],"button-props":P,"menu-list":B.value,"overlay-class-name":[n.unref(v)("overlay")],trigger:"click",placement:"bottom"}),{icon:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass([n.unref(v)("icon")])},[n.createVNode(L.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=H;
|
package/package.json
CHANGED
package/theme/ap-grid/index.css
CHANGED
|
@@ -468,6 +468,17 @@
|
|
|
468
468
|
.aplus-ap-grid ::-webkit-scrollbar-thumb:active {
|
|
469
469
|
background-color: var(--basic-scrollbar-thumb-color-hover, #787878);
|
|
470
470
|
}
|
|
471
|
+
.aplus-ap-grid .vxe-table .vxe-cell {
|
|
472
|
+
min-height: unset !important;
|
|
473
|
+
padding: 9px 12px !important;
|
|
474
|
+
font-size: 12px;
|
|
475
|
+
line-height: 1.5;
|
|
476
|
+
}
|
|
477
|
+
.aplus-ap-grid .vxe-table.size--mini .vxe-cell {
|
|
478
|
+
min-height: unset !important;
|
|
479
|
+
padding: 6px 9px !important;
|
|
480
|
+
line-height: 1.5;
|
|
481
|
+
}
|
|
471
482
|
.aplus-ap-grid-adaptive {
|
|
472
483
|
height: 100%;
|
|
473
484
|
display: flex;
|
package/theme/ap-grid/index.less
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
|
|
12
12
|
.b(ap-grid, {
|
|
13
13
|
.reset-scrollbar();
|
|
14
|
+
.vxe-table .vxe-cell {
|
|
15
|
+
min-height: unset !important;
|
|
16
|
+
padding: 9px 12px !important;
|
|
17
|
+
font-size: @font-size-base;
|
|
18
|
+
line-height: @line-height-base;
|
|
19
|
+
}
|
|
20
|
+
.vxe-table.size--mini .vxe-cell {
|
|
21
|
+
min-height: unset !important;
|
|
22
|
+
padding: 6px 9px !important;
|
|
23
|
+
line-height: @line-height-base;
|
|
24
|
+
}
|
|
14
25
|
&-adaptive {
|
|
15
26
|
height: 100%;
|
|
16
27
|
display: flex;
|
|
@@ -764,16 +764,16 @@
|
|
|
764
764
|
background-color: #D8DDE5 !important;
|
|
765
765
|
}
|
|
766
766
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
767
|
-
padding: 12px;
|
|
767
|
+
padding: 9px 12px;
|
|
768
768
|
}
|
|
769
769
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
770
|
-
padding: 12px;
|
|
770
|
+
padding: 9px 12px;
|
|
771
771
|
}
|
|
772
772
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
773
|
-
padding:
|
|
773
|
+
padding: 6px 9px;
|
|
774
774
|
}
|
|
775
775
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
776
|
-
padding:
|
|
776
|
+
padding: 6px 9px;
|
|
777
777
|
}
|
|
778
778
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
779
779
|
border-inline-end-width: 0px !important;
|
|
@@ -76,16 +76,16 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
.ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
79
|
-
padding: 12px;
|
|
79
|
+
padding: 9px 12px;
|
|
80
80
|
}
|
|
81
81
|
.ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
82
|
-
padding: 12px;
|
|
82
|
+
padding: 9px 12px;
|
|
83
83
|
}
|
|
84
84
|
.ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
85
|
-
padding:
|
|
85
|
+
padding: 6px 9px;
|
|
86
86
|
}
|
|
87
87
|
.ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
88
|
-
padding:
|
|
88
|
+
padding: 6px 9px;
|
|
89
89
|
}
|
|
90
90
|
.ant-table-placeholder .ant-table-expanded-row-fixed {
|
|
91
91
|
// 这里不需要滚动的时候显示单边框,因为默认情况下会显示双边框
|
|
@@ -764,16 +764,16 @@
|
|
|
764
764
|
background-color: #D8DDE5 !important;
|
|
765
765
|
}
|
|
766
766
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
767
|
-
padding: 12px;
|
|
767
|
+
padding: 9px 12px;
|
|
768
768
|
}
|
|
769
769
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
770
|
-
padding: 12px;
|
|
770
|
+
padding: 9px 12px;
|
|
771
771
|
}
|
|
772
772
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
773
|
-
padding:
|
|
773
|
+
padding: 6px 9px;
|
|
774
774
|
}
|
|
775
775
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
776
|
-
padding:
|
|
776
|
+
padding: 6px 9px;
|
|
777
777
|
}
|
|
778
778
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
779
779
|
border-inline-end-width: 0px !important;
|
package/theme/index.css
CHANGED
|
@@ -1621,16 +1621,16 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
1621
1621
|
background-color: #D8DDE5 !important;
|
|
1622
1622
|
}
|
|
1623
1623
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
1624
|
-
padding: 12px;
|
|
1624
|
+
padding: 9px 12px;
|
|
1625
1625
|
}
|
|
1626
1626
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
1627
|
-
padding: 12px;
|
|
1627
|
+
padding: 9px 12px;
|
|
1628
1628
|
}
|
|
1629
1629
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
1630
|
-
padding:
|
|
1630
|
+
padding: 6px 9px;
|
|
1631
1631
|
}
|
|
1632
1632
|
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
1633
|
-
padding:
|
|
1633
|
+
padding: 6px 9px;
|
|
1634
1634
|
}
|
|
1635
1635
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
1636
1636
|
border-inline-end-width: 0px !important;
|
|
@@ -2745,6 +2745,17 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
2745
2745
|
.aplus-ap-grid ::-webkit-scrollbar-thumb:active {
|
|
2746
2746
|
background-color: var(--basic-scrollbar-thumb-color-hover, #787878);
|
|
2747
2747
|
}
|
|
2748
|
+
.aplus-ap-grid .vxe-table .vxe-cell {
|
|
2749
|
+
min-height: unset !important;
|
|
2750
|
+
padding: 9px 12px !important;
|
|
2751
|
+
font-size: 12px;
|
|
2752
|
+
line-height: 1.5;
|
|
2753
|
+
}
|
|
2754
|
+
.aplus-ap-grid .vxe-table.size--mini .vxe-cell {
|
|
2755
|
+
min-height: unset !important;
|
|
2756
|
+
padding: 6px 9px !important;
|
|
2757
|
+
line-height: 1.5;
|
|
2758
|
+
}
|
|
2748
2759
|
.aplus-ap-grid-adaptive {
|
|
2749
2760
|
height: 100%;
|
|
2750
2761
|
display: flex;
|