@aplus-frontend/ui 6.22.0-beta.0 → 6.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +164 -161
- package/es/src/ag-grid/components/header-cell/index.vue2.mjs +42 -36
- package/es/src/ag-grid/context.d.ts +18 -0
- package/es/src/ag-grid/context.mjs +17 -0
- package/es/src/ag-grid/index.vue.d.ts +4 -2
- package/es/src/ag-grid/index.vue.mjs +337 -201
- package/es/src/ag-grid/interface.d.ts +109 -3
- package/es/src/ag-grid/theme.d.ts +3 -0
- package/es/src/ag-grid/theme.mjs +25 -0
- package/es/src/ap-field/number/index.vue.mjs +25 -25
- package/es/src/ap-grid/utils/col.d.ts +1 -1
- package/es/src/ap-grid/utils/col.mjs +29 -29
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +108 -98
- package/es/src/ap-pro-card/components/divider/index.vue.d.ts +13 -0
- package/es/src/ap-pro-card/components/divider/index.vue.mjs +4 -0
- package/es/src/ap-pro-card/components/divider/index.vue2.mjs +29 -0
- package/es/src/ap-pro-card/components/operation/index.vue.d.ts +18 -0
- package/es/src/ap-pro-card/components/operation/index.vue.mjs +4 -0
- package/es/src/ap-pro-card/components/operation/index.vue2.mjs +20 -0
- package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +51 -0
- package/es/src/ap-pro-card/components/statistic/index.vue.mjs +4 -0
- package/es/src/ap-pro-card/components/statistic/index.vue2.mjs +134 -0
- package/es/src/ap-pro-card/components/statistic-card/index.vue.d.ts +25 -0
- package/es/src/ap-pro-card/components/statistic-card/index.vue.mjs +4 -0
- package/es/src/ap-pro-card/components/statistic-card/index.vue2.mjs +116 -0
- package/es/src/ap-pro-card/components/title/index.vue.d.ts +23 -0
- package/es/src/ap-pro-card/components/title/index.vue.mjs +4 -0
- package/es/src/ap-pro-card/components/title/index.vue2.mjs +28 -0
- package/es/src/ap-pro-card/index.d.ts +20 -42
- package/es/src/ap-pro-card/index.mjs +22 -4
- package/es/src/ap-pro-card/interface.d.ts +66 -2
- package/es/src/ap-tag/ap-tag-group.vue.mjs +42 -42
- package/es/src/business/ap-label/group/ApLabelGroup.mjs +17 -15
- package/es/src/business/hooks/index.d.ts +1 -0
- package/es/src/business/hooks/index.mjs +8 -6
- package/es/src/business/hooks/usePageListAgGrid.d.ts +37 -0
- package/es/src/business/hooks/usePageListAgGrid.mjs +88 -0
- package/es/src/index.mjs +277 -274
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/context.d.ts +18 -0
- package/lib/src/ag-grid/context.js +1 -0
- package/lib/src/ag-grid/index.vue.d.ts +4 -2
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +109 -3
- package/lib/src/ag-grid/theme.d.ts +3 -0
- package/lib/src/ag-grid/theme.js +1 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/col.d.ts +1 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-pro-card/components/card/index.vue2.js +1 -1
- package/lib/src/ap-pro-card/components/divider/index.vue.d.ts +13 -0
- package/lib/src/ap-pro-card/components/divider/index.vue.js +1 -0
- package/lib/src/ap-pro-card/components/divider/index.vue2.js +1 -0
- package/lib/src/ap-pro-card/components/operation/index.vue.d.ts +18 -0
- package/lib/src/ap-pro-card/components/operation/index.vue.js +1 -0
- package/lib/src/ap-pro-card/components/operation/index.vue2.js +1 -0
- package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +51 -0
- package/lib/src/ap-pro-card/components/statistic/index.vue.js +1 -0
- package/lib/src/ap-pro-card/components/statistic/index.vue2.js +1 -0
- package/lib/src/ap-pro-card/components/statistic-card/index.vue.d.ts +25 -0
- package/lib/src/ap-pro-card/components/statistic-card/index.vue.js +1 -0
- package/lib/src/ap-pro-card/components/statistic-card/index.vue2.js +1 -0
- package/lib/src/ap-pro-card/components/title/index.vue.d.ts +23 -0
- package/lib/src/ap-pro-card/components/title/index.vue.js +1 -0
- package/lib/src/ap-pro-card/components/title/index.vue2.js +1 -0
- package/lib/src/ap-pro-card/index.d.ts +20 -42
- package/lib/src/ap-pro-card/index.js +1 -1
- package/lib/src/ap-pro-card/interface.d.ts +66 -2
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
- package/lib/src/business/hooks/index.d.ts +1 -0
- package/lib/src/business/hooks/index.js +1 -1
- package/lib/src/business/hooks/usePageListAgGrid.d.ts +37 -0
- package/lib/src/business/hooks/usePageListAgGrid.js +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +470 -0
- package/theme/ag-grid/index.less +27 -0
- package/theme/ap-button/ap-button.css +1 -1
- package/theme/ap-button/ap-button.less +1 -1
- package/theme/ap-pro-card/index.css +199 -0
- package/theme/ap-pro-card/index.less +203 -0
- package/theme/ap-tag/ap-tag.css +1 -1
- package/theme/ap-tag/ap-tag.less +1 -1
- package/theme/index.css +220 -2
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as Ve, useSlots as We, ref as u, toRef as J, computed as s, unref as n, watch as k, nextTick as Ee, createElementBlock as z, openBlock as y, normalizeStyle as b, normalizeClass as m, createCommentVNode as Q, createElementVNode as v, createVNode as P, mergeProps as X, createSlots as Me, withCtx as Y, Fragment as Oe, renderList as Le, createBlock as Z, resolveDynamicComponent as $e, renderSlot as _, withDirectives as Ge, vShow as He } from "vue";
|
|
2
|
+
import { AgGridVue as je } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as qe, AllCommunityModule as Ue } from "ag-grid-community";
|
|
4
|
+
import { Spin as Je, Pagination as Qe } from "@aplus-frontend/antdv";
|
|
5
|
+
import { isFunction as ee, isUndefined as R } from "lodash-unified";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { ApForm as
|
|
8
|
-
import { noRenderAsFormItemValueList as
|
|
9
|
-
import { getColumnOrder as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import { dataIndexToField as
|
|
12
|
-
import { isDef as
|
|
7
|
+
import { ApForm as Xe } from "../ap-form/index.mjs";
|
|
8
|
+
import { noRenderAsFormItemValueList as Ye } from "../ap-table/constants.mjs";
|
|
9
|
+
import { getColumnOrder as te, updateFormProps as Ze, getFieldProps as _e, getSearchFormItemRenderNode as et, recursionApColumns as tt } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as ot } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import { dataIndexToField as rt } from "../ap-grid/utils/col.mjs";
|
|
12
|
+
import { isDef as at } from "../utils/index.mjs";
|
|
13
13
|
import "./components/header-cell/index.vue.mjs";
|
|
14
14
|
import "./components/body-cell/index.vue.mjs";
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
15
|
+
import nt from "./hooks/use-row-selection.mjs";
|
|
16
|
+
import { useProvideSorter as lt } from "./context.mjs";
|
|
17
|
+
import { useProvideApTable as st } from "../ap-table/context.mjs";
|
|
18
|
+
import { sizeReverseMap as it, sizeMap as dt } from "../ap-grid/constants.mjs";
|
|
19
|
+
import { useToken as ct } from "@aplus-frontend/antdv/es/theme/internal";
|
|
20
|
+
import { useTheme as ut } from "./theme.mjs";
|
|
21
|
+
import { useNamespace as mt } from "../config-provider/hooks/use-namespace.mjs";
|
|
22
|
+
import { useGlobalConfig as pt } from "../config-provider/hooks/use-global-config.mjs";
|
|
23
|
+
import ft from "./components/body-cell/index.vue2.mjs";
|
|
24
|
+
import gt from "./components/header-cell/index.vue2.mjs";
|
|
25
|
+
const Lt = /* @__PURE__ */ Ve({
|
|
21
26
|
name: "AgGrid",
|
|
22
27
|
__name: "index",
|
|
23
28
|
props: {
|
|
@@ -72,176 +77,205 @@ const no = /* @__PURE__ */ ce({
|
|
|
72
77
|
searchFormWrapperStyle: {},
|
|
73
78
|
tableWrapperStyle: {},
|
|
74
79
|
wrapperStyle: {},
|
|
80
|
+
tableStyle: {},
|
|
75
81
|
manual: { type: Boolean, default: void 0 },
|
|
76
82
|
size: { default: "mini" },
|
|
77
83
|
adaptive: { type: Boolean },
|
|
78
84
|
columnResizable: { type: Boolean, default: !1 },
|
|
79
85
|
loading: { type: Boolean, default: void 0 },
|
|
80
|
-
summary: {}
|
|
86
|
+
summary: {},
|
|
87
|
+
rowHeight: {}
|
|
81
88
|
},
|
|
82
|
-
setup(
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
let w =
|
|
86
|
-
const
|
|
87
|
-
var e, r,
|
|
88
|
-
return
|
|
89
|
-
(
|
|
90
|
-
)) == null ? void 0 : r.sort((
|
|
91
|
-
let
|
|
92
|
-
return
|
|
93
|
-
})) == null ? void 0 :
|
|
94
|
-
const l =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
...
|
|
89
|
+
setup(oe, { expose: re }) {
|
|
90
|
+
qe.registerModules([Ue]);
|
|
91
|
+
const o = oe, ae = We(), { e: C, b: d, em: ne, be: le } = mt("ag-grid"), g = u(o.size), se = ut(g, J(o, "rowHeight")), S = u(), [, ie] = ct();
|
|
92
|
+
let w = !!o.dataSource, D = 0;
|
|
93
|
+
const A = pt("valueTypeMap"), K = s(() => {
|
|
94
|
+
var e, r, a;
|
|
95
|
+
return D++, ((a = (r = (e = o.columns) == null ? void 0 : e.filter(
|
|
96
|
+
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !Ye.includes(t.valueType)
|
|
97
|
+
)) == null ? void 0 : r.sort((t, l) => {
|
|
98
|
+
let i = te(t.order);
|
|
99
|
+
return te(l.order) - i;
|
|
100
|
+
})) == null ? void 0 : a.map((t) => {
|
|
101
|
+
const l = Ze(
|
|
102
|
+
t,
|
|
103
|
+
_e(t.fieldProps, {})
|
|
104
|
+
), i = {
|
|
105
|
+
...t,
|
|
99
106
|
fieldProps: {
|
|
100
|
-
label:
|
|
101
|
-
name:
|
|
107
|
+
label: t.title,
|
|
108
|
+
name: t.dataIndex,
|
|
102
109
|
// tips: 在表格中的查询表单项默认是带边框的
|
|
103
110
|
bordered: !0,
|
|
104
111
|
...l || {},
|
|
105
|
-
_signal:
|
|
112
|
+
_signal: D
|
|
106
113
|
},
|
|
107
114
|
renderNode: void 0
|
|
108
115
|
};
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
),
|
|
116
|
+
return i.renderNode = et(
|
|
117
|
+
i,
|
|
118
|
+
n(A)
|
|
119
|
+
), i;
|
|
113
120
|
})) || [];
|
|
114
|
-
}),
|
|
115
|
-
function
|
|
121
|
+
}), c = u([]), N = u([]);
|
|
122
|
+
function de() {
|
|
116
123
|
var e;
|
|
117
|
-
return ((e =
|
|
124
|
+
return ((e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInTable)) || [];
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
() =>
|
|
126
|
+
k(
|
|
127
|
+
() => o.columns,
|
|
121
128
|
() => {
|
|
122
129
|
var r;
|
|
123
|
-
const e =
|
|
124
|
-
|
|
130
|
+
const e = de();
|
|
131
|
+
c.value = e, N.value = e, (r = o.onShownColumnsChange) == null || r.call(o, e);
|
|
125
132
|
},
|
|
126
133
|
{
|
|
127
134
|
deep: !0,
|
|
128
135
|
immediate: !0
|
|
129
136
|
}
|
|
130
137
|
);
|
|
131
|
-
const
|
|
132
|
-
const e =
|
|
133
|
-
function r(
|
|
134
|
-
return
|
|
135
|
-
var
|
|
138
|
+
const ce = s(() => {
|
|
139
|
+
const e = n(c);
|
|
140
|
+
function r(a) {
|
|
141
|
+
return a.map((t) => {
|
|
142
|
+
var i;
|
|
136
143
|
const l = {
|
|
137
|
-
field:
|
|
138
|
-
colId:
|
|
139
|
-
sortable: !!
|
|
140
|
-
comparator:
|
|
144
|
+
field: rt(t.dataIndex),
|
|
145
|
+
colId: at(t.key) ? String(t.key) : void 0,
|
|
146
|
+
sortable: !!t.sorter,
|
|
147
|
+
comparator: t.sorter === !0 ? () => 0 : t.sorter,
|
|
141
148
|
headerComponentParams: {
|
|
142
|
-
column:
|
|
149
|
+
column: t
|
|
143
150
|
},
|
|
144
151
|
cellRendererParams: {
|
|
145
|
-
column:
|
|
146
|
-
extraValueType:
|
|
152
|
+
column: t,
|
|
153
|
+
extraValueType: n(A)
|
|
147
154
|
},
|
|
148
|
-
resizable:
|
|
149
|
-
width:
|
|
150
|
-
minWidth:
|
|
151
|
-
maxWidth:
|
|
152
|
-
flex:
|
|
155
|
+
resizable: t.resizable,
|
|
156
|
+
width: t.width,
|
|
157
|
+
minWidth: t.minWidth,
|
|
158
|
+
maxWidth: t.maxWidth,
|
|
159
|
+
flex: t.width ? void 0 : 1,
|
|
153
160
|
// 如果没有设置确切的宽度,则设置为可自由伸缩列
|
|
154
|
-
pinned:
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
pinned: t.fixed || null,
|
|
162
|
+
// undefined to null
|
|
163
|
+
colSpan: t.colSpan,
|
|
164
|
+
cellClass: (h) => {
|
|
165
|
+
const I = t.cellClass || "", Ne = ee(I) ? I(h.data, h.node) : I;
|
|
157
166
|
return [
|
|
158
|
-
`${
|
|
159
|
-
|
|
167
|
+
`${ne("cell", t.align || "left")}`,
|
|
168
|
+
Ne
|
|
160
169
|
].flat().filter(Boolean);
|
|
161
|
-
}
|
|
170
|
+
},
|
|
171
|
+
wrapText: !t.ellipsis,
|
|
172
|
+
autoHeight: !t.ellipsis
|
|
162
173
|
};
|
|
163
|
-
return (
|
|
174
|
+
return (i = t.children) != null && i.length ? {
|
|
164
175
|
...l,
|
|
165
|
-
children: r(
|
|
176
|
+
children: r(t.children)
|
|
166
177
|
} : l;
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
return r(e);
|
|
170
|
-
}),
|
|
171
|
-
headerComponent:
|
|
172
|
-
cellRenderer:
|
|
173
|
-
resizable:
|
|
181
|
+
}), ue = u({
|
|
182
|
+
headerComponent: gt,
|
|
183
|
+
cellRenderer: ft,
|
|
184
|
+
resizable: o.columnResizable,
|
|
174
185
|
suppressMovable: !0,
|
|
175
|
-
cellDataType: !1
|
|
176
|
-
|
|
186
|
+
cellDataType: !1,
|
|
187
|
+
cellStyle: {
|
|
188
|
+
whiteSpace: "pre-line"
|
|
189
|
+
}
|
|
190
|
+
}), V = u({});
|
|
191
|
+
lt({
|
|
192
|
+
sorter: V,
|
|
193
|
+
setSorter(e) {
|
|
194
|
+
V.value = e;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const me = {
|
|
177
198
|
asc: "ascend",
|
|
178
199
|
desc: "descend"
|
|
179
200
|
};
|
|
180
|
-
function
|
|
181
|
-
var
|
|
182
|
-
const e = (
|
|
183
|
-
if (e && e.length
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
201
|
+
function pe() {
|
|
202
|
+
var l;
|
|
203
|
+
const e = (l = S.value.getColumns()) == null ? void 0 : l.filter((i) => i.getSort() !== void 0);
|
|
204
|
+
if (!(e != null && e.length))
|
|
205
|
+
return;
|
|
206
|
+
const r = e[0], a = r.getColDef(), t = r.getSort();
|
|
207
|
+
E(void 0, void 0, {
|
|
208
|
+
column: a,
|
|
209
|
+
field: a.field,
|
|
210
|
+
order: t ? me[t] : null
|
|
211
|
+
});
|
|
191
212
|
}
|
|
192
|
-
const
|
|
213
|
+
const fe = s(() => tt(n(c), (e) => {
|
|
193
214
|
if (e.sorter === !0)
|
|
194
215
|
return e.key || e.dataIndex;
|
|
195
216
|
}).filter(Boolean)), {
|
|
196
|
-
formRef:
|
|
197
|
-
submit:
|
|
198
|
-
reset:
|
|
199
|
-
data:
|
|
200
|
-
tableProps:
|
|
201
|
-
handleTableChangeOptional:
|
|
202
|
-
|
|
217
|
+
formRef: p,
|
|
218
|
+
submit: x,
|
|
219
|
+
reset: F,
|
|
220
|
+
data: f,
|
|
221
|
+
tableProps: W,
|
|
222
|
+
handleTableChangeOptional: E,
|
|
223
|
+
submitWith: M,
|
|
224
|
+
refresh: O,
|
|
225
|
+
getPaging: ge,
|
|
226
|
+
setPaging: Se
|
|
227
|
+
} = ot({
|
|
203
228
|
async request(e) {
|
|
204
|
-
var
|
|
205
|
-
if (w = !1, !
|
|
206
|
-
const
|
|
229
|
+
var a;
|
|
230
|
+
if (w = !1, !R(o.dataSource)) {
|
|
231
|
+
const t = e.pageSize * (e.current - 1);
|
|
207
232
|
return {
|
|
208
|
-
data: (
|
|
209
|
-
total:
|
|
233
|
+
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(t, t + e.pageSize)) || [],
|
|
234
|
+
total: o.dataSource.length || 0
|
|
210
235
|
};
|
|
211
236
|
}
|
|
212
|
-
const r = await ((
|
|
237
|
+
const r = await ((a = o.request) == null ? void 0 : a.call(o, e));
|
|
213
238
|
return {
|
|
214
239
|
data: (r == null ? void 0 : r.data) || [],
|
|
215
240
|
total: (r == null ? void 0 : r.total) || 0
|
|
216
241
|
};
|
|
217
242
|
},
|
|
218
243
|
namespace: "ap-grid",
|
|
219
|
-
filterFields:
|
|
220
|
-
params:
|
|
221
|
-
defaultData:
|
|
222
|
-
manual:
|
|
223
|
-
formatParams:
|
|
224
|
-
pagination:
|
|
225
|
-
sortFields:
|
|
226
|
-
}),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
244
|
+
filterFields: u([]),
|
|
245
|
+
params: J(o, "params"),
|
|
246
|
+
defaultData: o.defaultData,
|
|
247
|
+
manual: o.manual,
|
|
248
|
+
formatParams: o.beforeSearchSubmit,
|
|
249
|
+
pagination: o.pagination,
|
|
250
|
+
sortFields: fe
|
|
251
|
+
}), we = s(
|
|
252
|
+
() => R(o.dataSource) ? f.records : o.dataSource
|
|
253
|
+
), {
|
|
254
|
+
select: he,
|
|
255
|
+
unSelect: ye,
|
|
256
|
+
selectedRows: T,
|
|
257
|
+
selectedRowKeys: ve,
|
|
258
|
+
clearAll: Ce,
|
|
259
|
+
selectMultiByKeys: be
|
|
260
|
+
} = nt({
|
|
261
|
+
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
262
|
+
dataSource: we,
|
|
263
|
+
rowKey: o.rowKey
|
|
264
|
+
}), Re = {
|
|
231
265
|
checkbox: "multiRow",
|
|
232
266
|
radio: "singleRow"
|
|
233
|
-
},
|
|
234
|
-
if (!
|
|
267
|
+
}, xe = s(() => {
|
|
268
|
+
if (!o.rowSelection)
|
|
235
269
|
return;
|
|
236
|
-
const { type: e = "checkbox", disabled: r } =
|
|
270
|
+
const { type: e = "checkbox", disabled: r } = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
237
271
|
return {
|
|
238
|
-
mode:
|
|
239
|
-
isRowSelectable: (
|
|
272
|
+
mode: Re[e],
|
|
273
|
+
isRowSelectable: (a) => r ? !r(a.data) : !0
|
|
240
274
|
};
|
|
241
|
-
}),
|
|
242
|
-
if (!
|
|
275
|
+
}), Fe = s(() => {
|
|
276
|
+
if (!o.rowSelection)
|
|
243
277
|
return;
|
|
244
|
-
const e =
|
|
278
|
+
const e = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
245
279
|
return {
|
|
246
280
|
sortable: !1,
|
|
247
281
|
resizable: !1,
|
|
@@ -249,123 +283,225 @@ const no = /* @__PURE__ */ ce({
|
|
|
249
283
|
pinned: e.fixed
|
|
250
284
|
};
|
|
251
285
|
});
|
|
252
|
-
function
|
|
253
|
-
return
|
|
286
|
+
function B(e) {
|
|
287
|
+
return ee(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
254
288
|
}
|
|
255
|
-
const
|
|
256
|
-
|
|
289
|
+
const L = ({
|
|
290
|
+
api: e = S.value
|
|
291
|
+
}) => {
|
|
292
|
+
if (!o.rowSelection)
|
|
257
293
|
return;
|
|
258
|
-
const r =
|
|
259
|
-
if (
|
|
294
|
+
const r = T.value;
|
|
295
|
+
if (!r.length)
|
|
260
296
|
return;
|
|
261
297
|
w = !1;
|
|
262
|
-
const
|
|
263
|
-
e.forEachNode((
|
|
264
|
-
const l =
|
|
265
|
-
r.find((
|
|
266
|
-
}), e.setNodesSelected({ nodes:
|
|
298
|
+
const a = [];
|
|
299
|
+
e.forEachNode((t) => {
|
|
300
|
+
const l = t.data, i = B(l);
|
|
301
|
+
r.find((h) => B(h) === i) && a.push(t);
|
|
302
|
+
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
267
303
|
w = !0;
|
|
268
304
|
}, 0);
|
|
269
|
-
},
|
|
270
|
-
w && (e.node.isSelected() ?
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
305
|
+
}, Te = (e) => {
|
|
306
|
+
w && (e.node.isSelected() ? he(e.data) : ye(e.data));
|
|
307
|
+
}, Be = () => {
|
|
308
|
+
w = !0;
|
|
309
|
+
}, $ = () => {
|
|
310
|
+
var e;
|
|
311
|
+
Ce(), (e = S.value) == null || e.deselectAll();
|
|
312
|
+
};
|
|
313
|
+
function Ie(e) {
|
|
314
|
+
be(e), Ee(() => {
|
|
315
|
+
L({});
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function G(e = !1) {
|
|
319
|
+
var a, t, l;
|
|
320
|
+
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
321
|
+
return (l = (t = (a = p.value) == null ? void 0 : a.apForm) == null ? void 0 : t[r]) == null ? void 0 : l.call(t, !0);
|
|
322
|
+
}
|
|
323
|
+
function H(e) {
|
|
324
|
+
var r, a, t;
|
|
325
|
+
(t = (a = (r = p.value) == null ? void 0 : r.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
|
|
326
|
+
}
|
|
327
|
+
function j() {
|
|
328
|
+
var e;
|
|
329
|
+
return ((e = p.value) == null ? void 0 : e.getSorterItems()) || [];
|
|
330
|
+
}
|
|
331
|
+
function q(e) {
|
|
332
|
+
var r;
|
|
333
|
+
(r = p.value) == null || r.setSorterItems(e);
|
|
334
|
+
}
|
|
335
|
+
function U() {
|
|
336
|
+
var e;
|
|
337
|
+
(e = p.value) == null || e.resetSorterItems();
|
|
338
|
+
}
|
|
339
|
+
st({
|
|
340
|
+
columns: s(() => c.value),
|
|
341
|
+
columnsBackup: s(() => N.value),
|
|
342
|
+
size: s(() => dt[g.value]),
|
|
343
|
+
updateColumns(e) {
|
|
344
|
+
var r;
|
|
345
|
+
console.log(e), c.value = e, (r = o.onShownColumnsChange) == null || r.call(o, e);
|
|
346
|
+
},
|
|
347
|
+
updateSize(e) {
|
|
348
|
+
g.value = it[e];
|
|
349
|
+
},
|
|
350
|
+
renderConfig: s(() => ({
|
|
351
|
+
className: le("table-header", "title"),
|
|
352
|
+
color: ie.value.colorTextTertiary
|
|
353
|
+
})),
|
|
354
|
+
dataSource: s(() => n(f).records),
|
|
355
|
+
getSearchFormValues: G,
|
|
356
|
+
setSearchFormValues: H,
|
|
357
|
+
submit: x,
|
|
358
|
+
submitWith: M,
|
|
359
|
+
reset: F,
|
|
360
|
+
refresh: O,
|
|
361
|
+
getSearchFormSorterItems: j,
|
|
362
|
+
setSearchFormSorterItems: q,
|
|
363
|
+
resetSearchFormSorterItems: U
|
|
364
|
+
});
|
|
365
|
+
const ke = s(
|
|
366
|
+
() => R(o.loading) ? f.loading : o.loading
|
|
367
|
+
), ze = s(() => [
|
|
368
|
+
d(),
|
|
369
|
+
o.card ? null : d("wrapper"),
|
|
370
|
+
d("adaptive"),
|
|
371
|
+
d(`size-${g.value}`)
|
|
372
|
+
].filter(Boolean)), Pe = s(() => ({
|
|
373
|
+
height: "100%",
|
|
374
|
+
...o.tableStyle || {}
|
|
375
|
+
})), De = (e, r) => {
|
|
376
|
+
E({ current: e, pageSize: r });
|
|
279
377
|
};
|
|
280
|
-
function
|
|
378
|
+
function Ae(e) {
|
|
281
379
|
const r = e.data;
|
|
282
|
-
return
|
|
380
|
+
return B(r);
|
|
283
381
|
}
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
|
|
287
|
-
|
|
382
|
+
function Ke(e, r) {
|
|
383
|
+
var a;
|
|
384
|
+
(a = S.value) == null || a.ensureIndexVisible(e, r);
|
|
385
|
+
}
|
|
386
|
+
return k(
|
|
387
|
+
() => o.size,
|
|
388
|
+
(e) => {
|
|
389
|
+
g.value = e;
|
|
390
|
+
}
|
|
391
|
+
), k(
|
|
392
|
+
() => n(f).loading,
|
|
393
|
+
(e) => {
|
|
394
|
+
var r;
|
|
395
|
+
(r = o.onLoadingChange) == null || r.call(o, e);
|
|
396
|
+
}
|
|
397
|
+
), re({
|
|
398
|
+
submit: x,
|
|
399
|
+
reset: F,
|
|
400
|
+
refresh: O,
|
|
401
|
+
submitWith: M,
|
|
402
|
+
setSearchFormValues: H,
|
|
403
|
+
getSearchFormValues: G,
|
|
404
|
+
getShowColumns: () => n(c),
|
|
405
|
+
rowSelection: {
|
|
406
|
+
selectedRows: s(() => T.value),
|
|
407
|
+
setSelectedRowKeys: Ie,
|
|
408
|
+
clearAll: $
|
|
409
|
+
},
|
|
410
|
+
scrollToRow: Ke,
|
|
411
|
+
getDataSource: () => n(f.records),
|
|
412
|
+
getPaging: ge,
|
|
413
|
+
setPaging: Se,
|
|
414
|
+
getSearchFormSorterItems: j,
|
|
415
|
+
setSearchFormSorterItems: q,
|
|
416
|
+
resetSearchFormSorterItems: U
|
|
417
|
+
}), (e, r) => {
|
|
418
|
+
var a, t;
|
|
419
|
+
return y(), z("div", {
|
|
420
|
+
class: m(ze.value),
|
|
288
421
|
style: b(e.wrapperStyle)
|
|
289
422
|
}, [
|
|
290
|
-
|
|
423
|
+
n(R)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (y(), z("div", {
|
|
291
424
|
key: 0,
|
|
292
|
-
class:
|
|
425
|
+
class: m(e.card ? n(C)("search-wrapper") : null),
|
|
293
426
|
style: b(e.searchFormWrapperStyle)
|
|
294
427
|
}, [
|
|
295
|
-
|
|
428
|
+
P(n(Xe).SearchForm, X(e.searchForm || {}, {
|
|
296
429
|
ref_key: "formRef",
|
|
297
|
-
ref:
|
|
430
|
+
ref: p,
|
|
298
431
|
"custom-reset": "",
|
|
299
|
-
"submit-loading":
|
|
300
|
-
onSubmit:
|
|
301
|
-
onReset:
|
|
302
|
-
}),
|
|
303
|
-
default:
|
|
304
|
-
(
|
|
432
|
+
"submit-loading": n(W).loading,
|
|
433
|
+
onSubmit: n(x),
|
|
434
|
+
onReset: n(F)
|
|
435
|
+
}), Me({
|
|
436
|
+
default: Y(() => [
|
|
437
|
+
(y(!0), z(Oe, null, Le(K.value, (l) => (y(), Z($e(l.renderNode), {
|
|
305
438
|
key: l.dataIndex
|
|
306
439
|
}))), 128))
|
|
307
440
|
]),
|
|
308
441
|
_: 2
|
|
309
442
|
}, [
|
|
310
|
-
|
|
443
|
+
ae.searchFormExtra ? {
|
|
311
444
|
name: "extra",
|
|
312
|
-
fn:
|
|
313
|
-
|
|
445
|
+
fn: Y(() => [
|
|
446
|
+
_(e.$slots, "searchFormExtra")
|
|
314
447
|
]),
|
|
315
448
|
key: "0"
|
|
316
449
|
} : void 0
|
|
317
450
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
318
|
-
], 6)) :
|
|
319
|
-
|
|
320
|
-
class:
|
|
451
|
+
], 6)) : Q("", !0),
|
|
452
|
+
v("div", {
|
|
453
|
+
class: m([n(C)("table-wrapper"), e.card ? n(C)("table-wrapper-card") : null]),
|
|
321
454
|
style: b(e.tableWrapperStyle)
|
|
322
455
|
}, [
|
|
323
|
-
|
|
324
|
-
class:
|
|
456
|
+
v("div", {
|
|
457
|
+
class: m(n(d)("header-wrapper"))
|
|
325
458
|
}, [
|
|
326
|
-
|
|
327
|
-
selectedRows:
|
|
328
|
-
selectedRowKeys:
|
|
329
|
-
shownColumns:
|
|
459
|
+
_(e.$slots, "title", {
|
|
460
|
+
selectedRows: n(T),
|
|
461
|
+
selectedRowKeys: n(ve),
|
|
462
|
+
shownColumns: c.value,
|
|
463
|
+
clearAll: $
|
|
330
464
|
})
|
|
331
465
|
], 2),
|
|
332
|
-
|
|
333
|
-
class:
|
|
466
|
+
v("div", {
|
|
467
|
+
class: m(n(d)("grid-wrapper"))
|
|
334
468
|
}, [
|
|
335
|
-
|
|
336
|
-
style:
|
|
337
|
-
"row-data":
|
|
338
|
-
"column-defs":
|
|
339
|
-
"default-col-def":
|
|
469
|
+
P(n(je), {
|
|
470
|
+
style: b(Pe.value),
|
|
471
|
+
"row-data": n(f).records,
|
|
472
|
+
"column-defs": ce.value,
|
|
473
|
+
"default-col-def": ue.value,
|
|
340
474
|
"locale-text": {
|
|
341
475
|
noRowsToShow: ""
|
|
342
476
|
// 为了隐藏默认的无数据提示,因为外部已经自行实现了loading
|
|
343
477
|
},
|
|
344
|
-
"row-selection":
|
|
345
|
-
"selection-column-def":
|
|
346
|
-
"get-row-id":
|
|
347
|
-
"pinned-top-row-data": (
|
|
348
|
-
"pinned-bottom-row-data": (
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
478
|
+
"row-selection": xe.value,
|
|
479
|
+
"selection-column-def": Fe.value,
|
|
480
|
+
"get-row-id": Ae,
|
|
481
|
+
"pinned-top-row-data": (a = e.summary) == null ? void 0 : a.top,
|
|
482
|
+
"pinned-bottom-row-data": (t = e.summary) == null ? void 0 : t.bottom,
|
|
483
|
+
theme: n(se),
|
|
484
|
+
onSortChanged: pe,
|
|
485
|
+
onGridReady: r[0] || (r[0] = (l) => S.value = l.api),
|
|
486
|
+
onRowDataUpdated: L,
|
|
487
|
+
onRowSelected: Te,
|
|
488
|
+
onFirstDataRendered: Be
|
|
489
|
+
}, null, 8, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "pinned-top-row-data", "pinned-bottom-row-data", "theme"]),
|
|
490
|
+
Ge(v("div", {
|
|
491
|
+
class: m(n(C)("table-loading-wrapper"))
|
|
356
492
|
}, [
|
|
357
|
-
|
|
493
|
+
P(n(Je), { delay: 300 })
|
|
358
494
|
], 2), [
|
|
359
|
-
[
|
|
495
|
+
[He, ke.value]
|
|
360
496
|
])
|
|
361
497
|
], 2),
|
|
362
|
-
|
|
363
|
-
class:
|
|
498
|
+
v("div", {
|
|
499
|
+
class: m(n(d)("pagination-wrapper"))
|
|
364
500
|
}, [
|
|
365
|
-
e.pagination !== !1 ? (
|
|
501
|
+
e.pagination !== !1 ? (y(), Z(n(Qe), X({
|
|
366
502
|
key: 0,
|
|
367
|
-
class:
|
|
368
|
-
},
|
|
503
|
+
class: n(d)("pagination")
|
|
504
|
+
}, n(W).pagination, { onChange: De }), null, 16, ["class"])) : Q("", !0)
|
|
369
505
|
], 2)
|
|
370
506
|
], 6)
|
|
371
507
|
], 6);
|
|
@@ -373,5 +509,5 @@ const no = /* @__PURE__ */ ce({
|
|
|
373
509
|
}
|
|
374
510
|
});
|
|
375
511
|
export {
|
|
376
|
-
|
|
512
|
+
Lt as default
|
|
377
513
|
};
|