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