@aplus-frontend/ui 0.5.27 → 0.5.28
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-grid/editable/form-item.vue.mjs +20 -18
- package/es/src/ap-grid/editable/index.vue.mjs +22 -20
- package/es/src/ap-grid/index.vue.mjs +32 -30
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/business/hooks/usePageListApGrid.mjs +11 -11
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.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/hooks/usePageListApGrid.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as
|
|
2
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as s, watch as W, nextTick as G, createBlock as K, openBlock as U, mergeProps as g, withCtx as C, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { ApForm as y } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isArray as Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { isDef as w } from "../../utils/index.mjs";
|
|
@@ -9,7 +9,7 @@ import { useInjectForm as ae } from "../../ap-form/context.mjs";
|
|
|
9
9
|
import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import ne from "../index.vue.mjs";
|
|
12
|
-
const
|
|
12
|
+
const Ce = /* @__PURE__ */ P({
|
|
13
13
|
name: "EditableGrid",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -106,6 +106,8 @@ const ye = /* @__PURE__ */ P({
|
|
|
106
106
|
default: void 0
|
|
107
107
|
},
|
|
108
108
|
loadingConfig: {},
|
|
109
|
+
headerCellConfig: {},
|
|
110
|
+
footerCellConfig: {},
|
|
109
111
|
rowSelection: {
|
|
110
112
|
type: Boolean,
|
|
111
113
|
default: void 0
|
|
@@ -163,7 +165,7 @@ const ye = /* @__PURE__ */ P({
|
|
|
163
165
|
const {
|
|
164
166
|
internalInstance: a,
|
|
165
167
|
model: F
|
|
166
|
-
} = ae(), p = H(l.name), d = h(S(
|
|
168
|
+
} = ae(), p = H(l.name), d = h(S(s(F), p.value) || []), N = y.useWatch(p);
|
|
167
169
|
W(() => N.value, async (e) => {
|
|
168
170
|
var o;
|
|
169
171
|
await G(), d.value = e, (o = l.onChange) == null || o.call(l, e);
|
|
@@ -173,19 +175,19 @@ const ye = /* @__PURE__ */ P({
|
|
|
173
175
|
const c = h(), v = le("valueTypeMap"), D = oe(l, v);
|
|
174
176
|
function L(e, o) {
|
|
175
177
|
var u;
|
|
176
|
-
const n = ((u =
|
|
178
|
+
const n = ((u = s(d)) == null ? void 0 : u.length) || 0;
|
|
177
179
|
if (w(l.maxLength) && n >= l.maxLength)
|
|
178
180
|
return;
|
|
179
181
|
const t = {
|
|
180
182
|
...e || {}
|
|
181
183
|
};
|
|
182
|
-
a == null || a.setFieldValue(l.name, t, !0, (
|
|
183
|
-
|
|
184
|
+
a == null || a.setFieldValue(l.name, t, !0, (f, r) => {
|
|
185
|
+
f[r] || (f[r] = [t]), I(o) ? f[r].push(t) : f[r].splice(o, 0, t);
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
188
|
function V(e, o = "suffix") {
|
|
187
|
-
var
|
|
188
|
-
const n = ((
|
|
189
|
+
var f;
|
|
190
|
+
const n = ((f = s(d)) == null ? void 0 : f.length) || 0, t = m(e) ? e : e.length;
|
|
189
191
|
if (w(l.maxLength) && n + t > l.maxLength)
|
|
190
192
|
return;
|
|
191
193
|
const u = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
|
|
@@ -196,15 +198,15 @@ const ye = /* @__PURE__ */ P({
|
|
|
196
198
|
function T(e) {
|
|
197
199
|
const o = new Set(m(e) ? [e] : e);
|
|
198
200
|
a == null || a.setFieldValue(l.name, void 0, !0, (n, t) => {
|
|
199
|
-
n[t] = n[t].filter((u,
|
|
201
|
+
n[t] = n[t].filter((u, f) => !o.has(f));
|
|
200
202
|
});
|
|
201
203
|
}
|
|
202
204
|
function _() {
|
|
203
|
-
return
|
|
205
|
+
return s(d);
|
|
204
206
|
}
|
|
205
207
|
function E(e) {
|
|
206
208
|
var o;
|
|
207
|
-
return (o =
|
|
209
|
+
return (o = s(d)) == null ? void 0 : o[e];
|
|
208
210
|
}
|
|
209
211
|
function k(e, o, n = !0) {
|
|
210
212
|
a == null || a.setFieldValue(l.name, void 0, !0, (t, u) => {
|
|
@@ -236,27 +238,27 @@ const ye = /* @__PURE__ */ P({
|
|
|
236
238
|
scrollTo: z,
|
|
237
239
|
setTableData: j,
|
|
238
240
|
clear: O
|
|
239
|
-
}), (e, o) => (U(), K(
|
|
241
|
+
}), (e, o) => (U(), K(s(y).FormItem, g(e.formItem, {
|
|
240
242
|
name: e.name,
|
|
241
243
|
label: e.label
|
|
242
244
|
}), {
|
|
243
|
-
default:
|
|
245
|
+
default: C(() => [$(ne, g(s(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
244
246
|
ref_key: "tableRef",
|
|
245
247
|
ref: c,
|
|
246
|
-
class:
|
|
247
|
-
columns:
|
|
248
|
+
class: s(B)(),
|
|
249
|
+
columns: s(D),
|
|
248
250
|
"data-source": d.value,
|
|
249
251
|
"search-form": !1
|
|
250
252
|
}), q({
|
|
251
253
|
_: 2
|
|
252
254
|
}, [J(R, (n, t) => ({
|
|
253
255
|
name: t,
|
|
254
|
-
fn:
|
|
256
|
+
fn: C((u) => [Q(e.$slots, t, X(Y(u || {})))])
|
|
255
257
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
256
258
|
_: 3
|
|
257
259
|
}, 16, ["name", "label"]));
|
|
258
260
|
}
|
|
259
261
|
});
|
|
260
262
|
export {
|
|
261
|
-
|
|
263
|
+
Ce as default
|
|
262
264
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, createBlock as q, openBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isEqual as ae, isArray as R, isUndefined as te, isNumber as
|
|
2
|
+
import { ApForm as g } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as R, isUndefined as te, isNumber as y, cloneDeep as le, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import { isDef as b } from "../../utils/index.mjs";
|
|
7
7
|
import { useGetEditableColumns as ne } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
9
|
+
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as se } from "../../hooks/useControllableValue.mjs";
|
|
11
11
|
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import ie from "../index.vue.mjs";
|
|
13
13
|
const Re = /* @__PURE__ */ U({
|
|
@@ -107,6 +107,8 @@ const Re = /* @__PURE__ */ U({
|
|
|
107
107
|
default: void 0
|
|
108
108
|
},
|
|
109
109
|
loadingConfig: {},
|
|
110
|
+
headerCellConfig: {},
|
|
111
|
+
footerCellConfig: {},
|
|
110
112
|
rowSelection: {
|
|
111
113
|
type: Boolean,
|
|
112
114
|
default: void 0
|
|
@@ -157,10 +159,10 @@ const Re = /* @__PURE__ */ U({
|
|
|
157
159
|
}) {
|
|
158
160
|
const N = $(), t = B, {
|
|
159
161
|
b: V
|
|
160
|
-
} =
|
|
162
|
+
} = re("editable-grid"), _ = S, C = w(), {
|
|
161
163
|
value: m,
|
|
162
164
|
updateValue: L
|
|
163
|
-
} =
|
|
165
|
+
} = se(t, _), i = w(), E = ue("valueTypeMap"), c = g.useWatch(t.name, i);
|
|
164
166
|
x(() => c.value, (e) => {
|
|
165
167
|
var a;
|
|
166
168
|
L(e), (a = t.onChange) == null || a.call(t, e);
|
|
@@ -187,32 +189,32 @@ const Re = /* @__PURE__ */ U({
|
|
|
187
189
|
return l == null ? void 0 : l[t.name];
|
|
188
190
|
}
|
|
189
191
|
function j(e, a) {
|
|
190
|
-
var n,
|
|
192
|
+
var n, r, s;
|
|
191
193
|
const l = ((n = u(m)) == null ? void 0 : n.length) || 0;
|
|
192
194
|
if (b(t.maxLength) && l >= t.maxLength)
|
|
193
195
|
return;
|
|
194
196
|
const o = {
|
|
195
197
|
...e || {}
|
|
196
198
|
};
|
|
197
|
-
(
|
|
199
|
+
(s = (r = i.value) == null ? void 0 : r.setFieldValue) == null || s.call(r, t.name, o, !0, (d, f) => {
|
|
198
200
|
d[f] || (d[f] = [o]), te(a) ? d[f].push(o) : d[f].splice(a, 0, o);
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
203
|
function z(e, a = "suffix") {
|
|
202
|
-
var
|
|
203
|
-
const l = ((
|
|
204
|
+
var r, s, d;
|
|
205
|
+
const l = ((r = u(m)) == null ? void 0 : r.length) || 0, o = y(e) ? e : e.length;
|
|
204
206
|
if (b(t.maxLength) && l + o > t.maxLength)
|
|
205
207
|
return;
|
|
206
|
-
const n =
|
|
207
|
-
(d = (
|
|
208
|
+
const n = y(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
|
|
209
|
+
(d = (s = i.value) == null ? void 0 : s.setFieldValue) == null || d.call(s, t.name, n, !0, (f, p) => {
|
|
208
210
|
f[p] || (f[p] = [...n]), a === "suffix" ? f[p].push(...n) : f[p].unshift(...n);
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
function I(e) {
|
|
212
214
|
var l, o;
|
|
213
|
-
const a = new Set(
|
|
214
|
-
(o = (l = i.value) == null ? void 0 : l.setFieldValue) == null || o.call(l, t.name, void 0, !0, (n,
|
|
215
|
-
n[
|
|
215
|
+
const a = new Set(y(e) ? [e] : e);
|
|
216
|
+
(o = (l = i.value) == null ? void 0 : l.setFieldValue) == null || o.call(l, t.name, void 0, !0, (n, r) => {
|
|
217
|
+
n[r] = n[r].filter((s, d) => !a.has(d));
|
|
216
218
|
});
|
|
217
219
|
}
|
|
218
220
|
function O() {
|
|
@@ -228,9 +230,9 @@ const Re = /* @__PURE__ */ U({
|
|
|
228
230
|
}
|
|
229
231
|
function W(e, a, l = !0) {
|
|
230
232
|
var o, n;
|
|
231
|
-
(n = (o = i.value) == null ? void 0 : o.setFieldValue) == null || n.call(o, t.name, void 0, !0, (
|
|
232
|
-
!s
|
|
233
|
-
...l ? s
|
|
233
|
+
(n = (o = i.value) == null ? void 0 : o.setFieldValue) == null || n.call(o, t.name, void 0, !0, (r, s) => {
|
|
234
|
+
!r[s] || !r[s][e] || (r[s][e] = {
|
|
235
|
+
...l ? r[s][e] : {},
|
|
234
236
|
...a
|
|
235
237
|
});
|
|
236
238
|
});
|
|
@@ -256,7 +258,7 @@ const Re = /* @__PURE__ */ U({
|
|
|
256
258
|
scrollTo: G,
|
|
257
259
|
clear: K,
|
|
258
260
|
setTableData: P
|
|
259
|
-
}), (e, a) => (J(), q(u(
|
|
261
|
+
}), (e, a) => (J(), q(u(g), {
|
|
260
262
|
ref_key: "formRef",
|
|
261
263
|
ref: i,
|
|
262
264
|
"initial-values": {
|
|
@@ -266,7 +268,7 @@ const Re = /* @__PURE__ */ U({
|
|
|
266
268
|
height: "100%"
|
|
267
269
|
}
|
|
268
270
|
}, {
|
|
269
|
-
default: h(() => [v(u(
|
|
271
|
+
default: h(() => [v(u(g).FormItem, {
|
|
270
272
|
name: e.name,
|
|
271
273
|
"no-style": ""
|
|
272
274
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as T, createElementBlock as F, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as
|
|
1
|
+
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as T, createElementBlock as F, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as y, createElementVNode as B, createVNode as U, mergeProps as g, createSlots as G, withCtx as h, Fragment as X, renderList as A, createBlock as c, resolveDynamicComponent as _, renderSlot as V, normalizeProps as J, guardReactiveProps as Pe } from "vue";
|
|
2
2
|
import { VxeTable as Ee, VxeColumn as Q } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
@@ -83,6 +83,8 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
83
83
|
cellConfig: {},
|
|
84
84
|
loading: { type: Boolean, default: void 0 },
|
|
85
85
|
loadingConfig: {},
|
|
86
|
+
headerCellConfig: {},
|
|
87
|
+
footerCellConfig: {},
|
|
86
88
|
columns: {},
|
|
87
89
|
rowSelection: { type: Boolean },
|
|
88
90
|
card: { type: Boolean, default: !1 },
|
|
@@ -127,13 +129,13 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
127
129
|
return O++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
|
|
128
130
|
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !ze.includes(r.valueType)
|
|
129
131
|
)) == null ? void 0 : l.sort((r, u) => {
|
|
130
|
-
let
|
|
131
|
-
return Z(u.order) -
|
|
132
|
+
let C = Z(r.order);
|
|
133
|
+
return Z(u.order) - C;
|
|
132
134
|
})) == null ? void 0 : t.map((r) => {
|
|
133
135
|
const u = Ae(
|
|
134
136
|
r,
|
|
135
137
|
_e(r.fieldProps, {})
|
|
136
|
-
),
|
|
138
|
+
), C = {
|
|
137
139
|
...r,
|
|
138
140
|
fieldProps: {
|
|
139
141
|
label: r.title,
|
|
@@ -143,10 +145,10 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
143
145
|
},
|
|
144
146
|
renderNode: void 0
|
|
145
147
|
};
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
+
return C.renderNode = Ve(
|
|
149
|
+
C,
|
|
148
150
|
o(le)
|
|
149
|
-
),
|
|
151
|
+
), C;
|
|
150
152
|
})) || [];
|
|
151
153
|
}), ue = n(() => [
|
|
152
154
|
d(),
|
|
@@ -164,7 +166,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
164
166
|
submit: j,
|
|
165
167
|
reset: W,
|
|
166
168
|
refresh: ce,
|
|
167
|
-
data:
|
|
169
|
+
data: v,
|
|
168
170
|
tableProps: M,
|
|
169
171
|
setDataSource: pe,
|
|
170
172
|
handleTableChange: me
|
|
@@ -192,7 +194,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
192
194
|
manual: a.manual,
|
|
193
195
|
formatParams: a.beforeSearchSubmit,
|
|
194
196
|
pagination: a.pagination
|
|
195
|
-
}), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent:
|
|
197
|
+
}), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent: he } = Oe(me);
|
|
196
198
|
We({
|
|
197
199
|
columns: n(() => i.value),
|
|
198
200
|
columnsBackup: n(() => D.value),
|
|
@@ -208,17 +210,17 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
208
210
|
color: m.value.colorPrimary
|
|
209
211
|
}))
|
|
210
212
|
});
|
|
211
|
-
const
|
|
213
|
+
const ve = n(
|
|
212
214
|
() => i.value.some(
|
|
213
215
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
214
216
|
) ? "left" : void 0
|
|
215
|
-
), ye = n(
|
|
216
|
-
() => b(a.loading) ? h.loading : a.loading
|
|
217
217
|
), Ce = n(
|
|
218
|
-
() => b(a.
|
|
218
|
+
() => b(a.loading) ? v.loading : a.loading
|
|
219
|
+
), ye = n(
|
|
220
|
+
() => b(a.dataSource) ? v.records : a.dataSource
|
|
219
221
|
), { selectedRows: x, rowSelection: R, ...be } = je({
|
|
220
222
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
221
|
-
dataSource:
|
|
223
|
+
dataSource: ye,
|
|
222
224
|
rowKey: a.rowKey
|
|
223
225
|
}), E = () => {
|
|
224
226
|
const e = p.value;
|
|
@@ -250,7 +252,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
250
252
|
}
|
|
251
253
|
async function ke(e, l) {
|
|
252
254
|
var r;
|
|
253
|
-
const t =
|
|
255
|
+
const t = v.records[e];
|
|
254
256
|
if (t)
|
|
255
257
|
return (r = p.value) == null ? void 0 : r.scrollToRow(t, l);
|
|
256
258
|
}
|
|
@@ -271,7 +273,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
271
273
|
},
|
|
272
274
|
{ immediate: !0, deep: !0 }
|
|
273
275
|
), T(
|
|
274
|
-
() => o(
|
|
276
|
+
() => o(v).loading,
|
|
275
277
|
(e) => {
|
|
276
278
|
var l;
|
|
277
279
|
(l = a.onLoadingChange) == null || l.call(a, e);
|
|
@@ -305,7 +307,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
305
307
|
onSubmit: o(j),
|
|
306
308
|
onReset: o(W)
|
|
307
309
|
}), G({
|
|
308
|
-
default:
|
|
310
|
+
default: h(() => [
|
|
309
311
|
(s(!0), F(X, null, A(K.value, (t) => (s(), c(_(t.renderNode.Comp), g({
|
|
310
312
|
key: t.dataIndex,
|
|
311
313
|
item: t,
|
|
@@ -319,13 +321,13 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
319
321
|
}, [
|
|
320
322
|
L.searchFormExtra ? {
|
|
321
323
|
name: "extra",
|
|
322
|
-
fn:
|
|
324
|
+
fn: h(() => [
|
|
323
325
|
V(e.$slots, "searchFormExtra")
|
|
324
326
|
]),
|
|
325
327
|
key: "0"
|
|
326
328
|
} : void 0
|
|
327
329
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
328
|
-
], 6)) :
|
|
330
|
+
], 6)) : y("", !0),
|
|
329
331
|
B("div", {
|
|
330
332
|
class: f([o(I)("table-wrapper"), e.card ? o(I)("table-wrapper-card") : null]),
|
|
331
333
|
style: z(e.tableWrapperStyle)
|
|
@@ -347,10 +349,10 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
347
349
|
ref_key: "tableRef",
|
|
348
350
|
ref: p,
|
|
349
351
|
key: o(ie),
|
|
350
|
-
data: o(
|
|
352
|
+
data: o(v).records,
|
|
351
353
|
"sort-config": { remote: $.value.length > 0 },
|
|
352
354
|
"filter-config": { remote: H.value.length > 0 },
|
|
353
|
-
loading:
|
|
355
|
+
loading: Ce.value,
|
|
354
356
|
"row-config": {
|
|
355
357
|
isHover: !0,
|
|
356
358
|
keyField: a.rowKey
|
|
@@ -373,19 +375,19 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
373
375
|
onCheckboxAll: E,
|
|
374
376
|
onRadioChange: we
|
|
375
377
|
}), G({
|
|
376
|
-
empty:
|
|
378
|
+
empty: h(() => [
|
|
377
379
|
U(o(oe), {
|
|
378
380
|
image: o(oe).PRESENTED_IMAGE_SIMPLE
|
|
379
381
|
}, null, 8, ["image"])
|
|
380
382
|
]),
|
|
381
|
-
default:
|
|
382
|
-
a.expandable ? (s(), c(o(Q), g({ key: 0 }, o($e)(e.expandable), { fixed:
|
|
383
|
-
content:
|
|
383
|
+
default: h(() => [
|
|
384
|
+
a.expandable ? (s(), c(o(Q), g({ key: 0 }, o($e)(e.expandable), { fixed: ve.value }), {
|
|
385
|
+
content: h((t) => [
|
|
384
386
|
(s(), c(_(a.expandable.renderContent(t))))
|
|
385
387
|
]),
|
|
386
388
|
_: 1
|
|
387
|
-
}, 16, ["fixed"])) :
|
|
388
|
-
a.rowSelection ? (s(), c(o(Q), J(g({ key: 1 }, o(He)(o(R), i.value))), null, 16)) :
|
|
389
|
+
}, 16, ["fixed"])) : y("", !0),
|
|
390
|
+
a.rowSelection ? (s(), c(o(Q), J(g({ key: 1 }, o(He)(o(R), i.value))), null, 16)) : y("", !0),
|
|
389
391
|
(s(!0), F(X, null, A(o(se), (t) => (s(), c(_(t), {
|
|
390
392
|
key: t.props.colId
|
|
391
393
|
}))), 128))
|
|
@@ -394,7 +396,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
394
396
|
}, [
|
|
395
397
|
A(o(Ne)(L, ["searchFormExtra"]), (t, r) => ({
|
|
396
398
|
name: r,
|
|
397
|
-
fn:
|
|
399
|
+
fn: h((u) => [
|
|
398
400
|
V(e.$slots, r, J(Pe(u || {})))
|
|
399
401
|
])
|
|
400
402
|
}))
|
|
@@ -407,11 +409,11 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
407
409
|
key: 0,
|
|
408
410
|
direction: "horizontal",
|
|
409
411
|
"scroll-container": de.value
|
|
410
|
-
}, null, 8, ["scroll-container"])) :
|
|
412
|
+
}, null, 8, ["scroll-container"])) : y("", !0),
|
|
411
413
|
e.pagination !== !1 ? (s(), c(o(De), g({
|
|
412
414
|
key: 1,
|
|
413
415
|
class: o(d)("pagination")
|
|
414
|
-
}, o(M).pagination, { onChange: o(
|
|
416
|
+
}, o(M).pagination, { onChange: o(he) }), null, 16, ["class", "onChange"])) : y("", !0)
|
|
415
417
|
], 2)
|
|
416
418
|
], 6)
|
|
417
419
|
], 6));
|
|
@@ -115,7 +115,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
115
115
|
*/
|
|
116
116
|
range?: boolean;
|
|
117
117
|
};
|
|
118
|
-
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig'> & {
|
|
118
|
+
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
|
|
119
119
|
/**
|
|
120
120
|
* 列配置
|
|
121
121
|
*/
|
|
@@ -9,17 +9,17 @@ function k(s) {
|
|
|
9
9
|
isShowRowSelection: c = !0,
|
|
10
10
|
clearSelectionOnRequest: i = !0,
|
|
11
11
|
transformSearchFormValues: a,
|
|
12
|
-
api:
|
|
13
|
-
tableRefresh:
|
|
14
|
-
...
|
|
12
|
+
api: n,
|
|
13
|
+
tableRefresh: d = !0,
|
|
14
|
+
...f
|
|
15
15
|
} = s || {};
|
|
16
|
-
let
|
|
16
|
+
let l = null;
|
|
17
17
|
const m = v("uiMode", "aplus"), u = () => {
|
|
18
18
|
var e, r;
|
|
19
19
|
(r = (e = o.value) == null ? void 0 : e.rowSelection) == null || r.clearAll();
|
|
20
20
|
};
|
|
21
21
|
return b({
|
|
22
|
-
...R(
|
|
22
|
+
...R(d),
|
|
23
23
|
apTableRef: o
|
|
24
24
|
}), [h(
|
|
25
25
|
{
|
|
@@ -28,12 +28,12 @@ function k(s) {
|
|
|
28
28
|
columnResizable: !0,
|
|
29
29
|
// 表格分页器吸底效果
|
|
30
30
|
sticky: !0,
|
|
31
|
-
request:
|
|
32
|
-
|
|
31
|
+
request: n ? async (e) => {
|
|
32
|
+
l = e.sort;
|
|
33
33
|
const r = a ? a(e) : e;
|
|
34
34
|
try {
|
|
35
|
-
if (!
|
|
36
|
-
const { records: t, total: p } = await
|
|
35
|
+
if (!n) throw new Error("api is not defined");
|
|
36
|
+
const { records: t, total: p } = await n(r);
|
|
37
37
|
return i && u(), {
|
|
38
38
|
data: t,
|
|
39
39
|
total: p
|
|
@@ -56,7 +56,7 @@ function k(s) {
|
|
|
56
56
|
card: !0,
|
|
57
57
|
bordered: m.value === "admin"
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
f
|
|
60
60
|
), {
|
|
61
61
|
reload: () => {
|
|
62
62
|
var e;
|
|
@@ -75,7 +75,7 @@ function k(s) {
|
|
|
75
75
|
getSearchFormValuesAndSorted: (e = !0) => {
|
|
76
76
|
var t;
|
|
77
77
|
const r = ((t = o.value) == null ? void 0 : t.getSearchFormValues(!!e)) || {};
|
|
78
|
-
return r.sort =
|
|
78
|
+
return r.sort = l && S(l), a ? a(r) : r;
|
|
79
79
|
},
|
|
80
80
|
clearSelection: u
|
|
81
81
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("../../ap-form/index.js"),i=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const k=require("../../ap-form/context.js"),P=require("../../config-provider/hooks/use-namespace.js"),O=require("../../config-provider/hooks/use-global-config.js"),z=require("../index.vue.js"),A=t.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},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:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("../../ap-form/index.js"),i=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const k=require("../../ap-form/context.js"),P=require("../../config-provider/hooks/use-namespace.js"),O=require("../../config-provider/hooks/use-global-config.js"),z=require("../index.vue.js"),A=t.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},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:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(C,{expose:y}){const b=t.useSlots(),u=C,{b:w}=P.useNamespace("editable-grid");function x(e,o){return i.isArray(o)?o.reduce((n,l)=>n==null?void 0:n[l],e):e==null?void 0:e[o]}const{internalInstance:a,model:R}=k.useInjectForm(),p=t.toRef(u.name),d=t.ref(x(t.unref(R),p.value)||[]),S=g.ApForm.useWatch(p);t.watch(()=>S.value,async e=>{var o;await t.nextTick(),d.value=e,(o=u.onChange)==null||o.call(u,e)},{deep:!0});const m=t.ref(),B=O.useGlobalConfig("valueTypeMap"),v=j.useGetEditableColumns(u,B);function N(e,o){var s;const n=((s=t.unref(d))==null?void 0:s.length)||0;if(h.isDef(u.maxLength)&&n>=u.maxLength)return;const l={...e||{}};a==null||a.setFieldValue(u.name,l,!0,(r,f)=>{r[f]||(r[f]=[l]),i.isUndefined(o)?r[f].push(l):r[f].splice(o,0,l)})}function _(e,o="suffix"){var r;const n=((r=t.unref(d))==null?void 0:r.length)||0,l=i.isNumber(e)?e:e.length;if(h.isDef(u.maxLength)&&n+l>u.maxLength)return;const s=i.isNumber(e)?new Array(e).fill(0).map(()=>({})):i.cloneDeep(e);a==null||a.setFieldValue(u.name,s,!0,(f,c)=>{f[c]||(f[c]=[...s]),o==="suffix"?f[c].push(...s):f[c].unshift(...s)})}function F(e){const o=new Set(i.isNumber(e)?[e]:e);a==null||a.setFieldValue(u.name,void 0,!0,(n,l)=>{n[l]=n[l].filter((s,r)=>!o.has(r))})}function q(){return t.unref(d)}function D(e){var o;return(o=t.unref(d))==null?void 0:o[e]}function L(e,o,n=!0){a==null||a.setFieldValue(u.name,void 0,!0,(l,s)=>{!l[s]||!l[s][e]||(l[s][e]={...n?l[s][e]:{},...o})})}function T(e){a==null||a.setFieldValue(u.name,e)}function V(e){var n;const o=e==="end"?d.value.length-1:e;(n=m.value)==null||n.scrollToRow(o)}function E(){var e;(e=a==null?void 0:a.setFieldValue)==null||e.call(a,u.name,[])}return y({add:N,remove:F,getRowData:D,getRowsData:q,setRowData:L,addMultiple:_,scrollTo:V,setTableData:T,clear:E}),(e,o)=>(t.openBlock(),t.createBlock(t.unref(g.ApForm).FormItem,t.mergeProps(e.formItem,{name:e.name,label:e.label}),{default:t.withCtx(()=>[t.createVNode(z.default,t.mergeProps(t.unref(i.omit)(u,["name","value","onUpdate:value","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:m,class:t.unref(w)(),columns:t.unref(v),"data-source":d.value,"search-form":!1}),t.createSlots({_:2},[t.renderList(b,(n,l)=>({name:l,fn:t.withCtx(s=>[t.renderSlot(e.$slots,l,t.normalizeProps(t.guardReactiveProps(s||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),g=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),g=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const y=require("../../utils/index.js"),z=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const I=require("../../config-provider/hooks/use-namespace.js"),G=require("../../hooks/useControllableValue.js"),H=require("../../config-provider/hooks/use-global-config.js"),U=require("../index.vue.js"),W=a.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},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:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(w,{expose:x,emit:v}){const b=a.useSlots(),n=w,{b:R}=I.useNamespace("editable-grid"),F=v,C=a.ref(),{value:p,updateValue:S}=G.useControllableValue(n,F),i=a.ref(),B=H.useGlobalConfig("valueTypeMap"),h=g.ApForm.useWatch(n.name,i);a.watch(()=>h.value,e=>{var t;S(e),(t=n.onChange)==null||t.call(n,e)},{deep:!0,flush:"post"}),a.watch(p,e=>{var t;e!==a.unref(h)&&(c.isEqual(e,a.unref(h))||(t=i.value)==null||t.setFieldValue(n.name,e))},{deep:!0});const _=z.useGetEditableColumns(n,B);function N(){var e;(e=i.value)==null||e.resetFields()}function V(e){return e?(c.isArray(e)?e:[e]).map(l=>c.isArray(l)?[n.name,...l]:[n.name,l]):void 0}async function q(e,t){var o;const l=await((o=i.value)==null?void 0:o.validateFields(V(e),t));return l==null?void 0:l[n.name]}function E(e,t){var u,r,s;const l=((u=a.unref(p))==null?void 0:u.length)||0;if(y.isDef(n.maxLength)&&l>=n.maxLength)return;const o={...e||{}};(s=(r=i.value)==null?void 0:r.setFieldValue)==null||s.call(r,n.name,o,!0,(d,f)=>{d[f]||(d[f]=[o]),c.isUndefined(t)?d[f].push(o):d[f].splice(t,0,o)})}function L(e,t="suffix"){var r,s,d;const l=((r=a.unref(p))==null?void 0:r.length)||0,o=c.isNumber(e)?e:e.length;if(y.isDef(n.maxLength)&&l+o>n.maxLength)return;const u=c.isNumber(e)?new Array(e).fill(0).map(()=>({})):c.cloneDeep(e);(d=(s=i.value)==null?void 0:s.setFieldValue)==null||d.call(s,n.name,u,!0,(f,m)=>{f[m]||(f[m]=[...u]),t==="suffix"?f[m].push(...u):f[m].unshift(...u)})}function A(e){var l,o;const t=new Set(c.isNumber(e)?[e]:e);(o=(l=i.value)==null?void 0:l.setFieldValue)==null||o.call(l,n.name,void 0,!0,(u,r)=>{u[r]=u[r].filter((s,d)=>!t.has(d))})}function D(){return a.unref(p)}function T(e){var t;(t=i.value)==null||t.setFieldValue(n.name,e)}function k(e){var t;return(t=a.unref(p))==null?void 0:t[e]}function j(e,t,l=!0){var o,u;(u=(o=i.value)==null?void 0:o.setFieldValue)==null||u.call(o,n.name,void 0,!0,(r,s)=>{!r[s]||!r[s][e]||(r[s][e]={...l?r[s][e]:{},...t})})}function O(e){var l;const t=e==="end"?p.value.length-1:e;(l=C.value)==null||l.scrollToRow(t)}function P(){var e,t;(t=(e=i.value)==null?void 0:e.setFieldValue)==null||t.call(e,n.name,[])}return x({resetFields:N,validateFields:q,add:E,remove:A,getRowData:k,getRowsData:D,setRowData:j,addMultiple:L,scrollTo:O,clear:P,setTableData:T}),(e,t)=>(a.openBlock(),a.createBlock(a.unref(g.ApForm),{ref_key:"formRef",ref:i,"initial-values":{[n.name]:a.unref(p)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(g.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(U.default,a.mergeProps(a.unref(c.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:C,class:a.unref(R)(),columns:a.unref(_),"data-source":a.unref(p),"search-form":!1}),a.createSlots({_:2},[a.renderList(b,(l,o)=>({name:o,fn:a.withCtx(u=>[a.renderSlot(e.$slots,o,a.normalizeProps(a.guardReactiveProps(u||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=W;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("vxe-table");require("vxe-table/es/style.css");require("vxe-pc-ui/es/style.css");const T=require("vxe-pc-ui"),p=require("lodash-unified"),ue=require("../ap-form/index.js");require("../config-provider/index.js");const ce=require("../ap-table/constants.js"),d=require("../ap-table/utils.js"),de=require("../ap-table/hooks/use-table-paging-ng.js"),k=require("@aplus-frontend/antdv"),ie=require("./hooks/use-inner-params.js"),R=require("./utils/table.js"),pe=require("../ap-table/hooks/use-table-row-selection.js"),fe=require("../ap-table/context.js"),A=require("./constants.js"),me=require("./hooks/use-render-columns.js"),ge=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const ve=require("../config-provider/hooks/use-namespace.js"),Ce=require("../config-provider/hooks/use-global-config.js"),he=require("../config-provider/hooks/use-locale.js"),ye=require("../scroll-bar/index.vue.js"),be=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:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:void 0},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(L,{expose:D}){var _;const B=e.useSlots(),o=L,g=(_=e.getCurrentInstance())==null?void 0:_.appContext.app;g&&!g.__VXE_PC_UI_INSTALLED__&&(g.use(T.VxeUI),g.__VXE_PC_UI_INSTALLED__=!0);const{e:y,b:s,be:O}=ve.useNamespace("ap-grid"),U=Ce.useGlobalConfig("valueTypeMap"),l=e.ref([]),P=e.ref([]),c=e.ref(),v=e.ref(o.size),[,i]=ge.useToken(),{t:K}=he.useLocale();T.VxeUI.setConfig({i18n:(r,n)=>K(`ap.${r}`,n)});const{renderConfig:$,updateSignal:j}=me.useRenderColumns(l);let F=0;const H=e.computed(()=>{if(c.value)return c.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),E=e.computed(()=>{var r,n,t;return F++,((t=(n=(r=o.columns)==null?void 0:r.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!ce.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:n.sort((a,u)=>{let m=d.getColumnOrder(a.order);return d.getColumnOrder(u.order)-m}))==null?void 0:t.map(a=>{const u=d.updateFormProps(a,d.getFieldProps(a.fieldProps,{})),m={...a,fieldProps:{label:a.title,name:a.dataIndex,...u||{},_signal:F},renderNode:void 0};return m.renderNode=d.getSearchFormItemRenderNode(m,e.unref(U)),m}))||[]}),M=e.computed(()=>[s(),o.card?null:s("wrapper"),o.adaptive?s("adaptive"):null,o.sticky?s("sticky"):null].filter(Boolean)),I=e.computed(()=>d.recursionApColumns(e.unref(l),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),N=e.computed(()=>d.recursionApColumns(e.unref(l),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),{formRef:b,submit:q,reset:z,refresh:W,data:f,tableProps:V,setDataSource:G,handleTableChange:X}=de.useTablePaging({async request(r){var t;if(!h.value.preserveSelectedRowKeys&&p.isUndefined(o.dataSource)&&S(),!p.isUndefined(o.dataSource)){const a=r.pageSize*(r.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(a,a+r.pageSize))||[],total:o.dataSource.length||0}}const n=await((t=o.request)==null?void 0:t.call(o,r));return{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},namespace:"ap-grid",filterFields:N,sortFields:I,defaultParams:o.params,defaultData:o.defaultData,manual:o.manual,formatParams:o.beforeSearchSubmit,pagination:o.pagination}),{sortChangeEvent:J,filterChangeEvent:Q,paginationChangeEvent:Y}=ie.useInnerParams(X);fe.useProvideApTable({columns:e.computed(()=>l.value),columnsBackup:e.computed(()=>P.value),size:e.computed(()=>v.value?A.sizeMap[v.value]:"middle"),updateColumns(r){l.value=r},updateSize(r){v.value=A.sizeReverseMap[r]},renderConfig:e.computed(()=>({className:O("table-header","title"),color:i.value.colorPrimary}))});const Z=e.computed(()=>l.value.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),ee=e.computed(()=>p.isUndefined(o.loading)?f.loading:o.loading),re=e.computed(()=>p.isUndefined(o.dataSource)?f.records:o.dataSource),{selectedRows:C,rowSelection:h,...oe}=pe.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:re,rowKey:o.rowKey}),w=()=>{const r=c.value;r&&(C.value=[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},ae=()=>{const r=c.value;r&&(C.value=[r.getRadioRecord()])};function te(){var r;return((r=o.columns)==null?void 0:r.filter(n=>!n.hideInTable))||[]}function ne(r){var n,t,a;(a=(t=(n=b.value)==null?void 0:n.apForm)==null?void 0:t.setFieldsValue)==null||a.call(t,r)}function le(r=!1){var t,a,u;const n=r?"getFieldsValueTransformed":"getFieldsValue";return(u=(a=(t=b.value)==null?void 0:t.apForm)==null?void 0:a[n])==null?void 0:u.call(a,!0)}function S(){oe.clearAll();const r=c.value;r&&(h.value.type==="radio"?(r.clearRadioRow(),r.clearRadioReserve()):(r.clearCheckboxRow(),r.clearCheckboxReserve()))}async function se(r,n){var a;const t=f.records[r];if(t)return(a=c.value)==null?void 0:a.scrollToRow(t,n)}return e.watch(()=>[o.columnResizable,o.columns],()=>{const r=te();l.value=r,P.value=r},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,r=>{G(r)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(f).loading,r=>{var n;(n=o.onLoadingChange)==null||n.call(o,r)}),D({submit:q,reset:z,refresh:W,setSearchFormValues:ne,getSearchFormValues:le,getShowColumns:()=>e.unref(l),rowSelection:{selectedRows:e.computed(()=>C.value),clearAll:S},scrollToRow:se}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(M.value),style:e.normalizeStyle(r.wrapperStyle)},[e.unref(p.isUndefined)(r.dataSource)&&r.searchForm!==!1&&E.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(ue.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:b,"custom-reset":"","submit-loading":e.unref(V).loading,onSubmit:e.unref(q),onReset:e.unref(z)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,t=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderNode.Comp),e.mergeProps({key:t.dataIndex,item:t,ref_for:!0},t.fieldProps||{},{span:t.span,"custom-render":t.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[B.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(C),selectedRowKeys:e.unref(h).selectedRowKeys,shownColumns:l.value,clearAll:S})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(x.VxeTable),e.mergeProps(e.unref(R.toVxeProps)(o),{ref_key:"tableRef",ref:c,key:e.unref(j),data:e.unref(f).records,"sort-config":{remote:I.value.length>0},"filter-config":{remote:N.value.length>0},loading:ee.value,"row-config":{isHover:!0,keyField:o.rowKey},style:{"--vxe-ui-table-row-checkbox-checked-background-color":e.unref(i).controlItemBgActive,"--vxe-ui-table-row-hover-checkbox-checked-background-color":e.unref(i).controlItemBgActiveHover,"--vxe-ui-font-primary-color":e.unref(i).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(i).controlItemBgActive,"--vxe-ui-table-row-hover-radio-checked-background-color":e.unref(i).controlItemBgActiveHover},size:v.value,onSortChange:e.unref(J),onFilterChange:e.unref(Q),onCheckboxChange:w,onCheckboxRangeChange:w,onCheckboxAll:w,onRadioChange:ae}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(k.Empty),{image:e.unref(k.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),default:e.withCtx(()=>[o.expandable?(e.openBlock(),e.createBlock(e.unref(x.VxeColumn),e.mergeProps({key:0},e.unref(R.getRowExpandProps)(r.expandable),{fixed:Z.value}),{content:e.withCtx(t=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(t))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection?(e.openBlock(),e.createBlock(e.unref(x.VxeColumn),e.normalizeProps(e.mergeProps({key:1},e.unref(R.getRowSelectionProps)(e.unref(h),l.value))),null,16)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($),t=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{key:t.props.colId}))),128))]),_:2},[e.renderList(e.unref(p.omit)(B,["searchFormExtra"]),(t,a)=>({name:a,fn:e.withCtx(u=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1040,["data","sort-config","filter-config","loading","row-config","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("pagination-wrapper"))},[r.sticky?(e.openBlock(),e.createBlock(e.unref(ye.default),{key:0,direction:"horizontal","scroll-container":H.value},null,8,["scroll-container"])):e.createCommentVNode("",!0),r.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(k.Pagination),e.mergeProps({key:1,class:e.unref(s)("pagination")},e.unref(V).pagination,{onChange:e.unref(Y)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=be;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("vxe-table");require("vxe-table/es/style.css");require("vxe-pc-ui/es/style.css");const T=require("vxe-pc-ui"),p=require("lodash-unified"),ue=require("../ap-form/index.js");require("../config-provider/index.js");const ce=require("../ap-table/constants.js"),d=require("../ap-table/utils.js"),de=require("../ap-table/hooks/use-table-paging-ng.js"),k=require("@aplus-frontend/antdv"),ie=require("./hooks/use-inner-params.js"),R=require("./utils/table.js"),pe=require("../ap-table/hooks/use-table-row-selection.js"),fe=require("../ap-table/context.js"),A=require("./constants.js"),me=require("./hooks/use-render-columns.js"),ge=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const Ce=require("../config-provider/hooks/use-namespace.js"),ve=require("../config-provider/hooks/use-global-config.js"),he=require("../config-provider/hooks/use-locale.js"),ye=require("../scroll-bar/index.vue.js"),be=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:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:void 0},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(L,{expose:D}){var _;const B=e.useSlots(),o=L,g=(_=e.getCurrentInstance())==null?void 0:_.appContext.app;g&&!g.__VXE_PC_UI_INSTALLED__&&(g.use(T.VxeUI),g.__VXE_PC_UI_INSTALLED__=!0);const{e:y,b:s,be:O}=Ce.useNamespace("ap-grid"),U=ve.useGlobalConfig("valueTypeMap"),l=e.ref([]),P=e.ref([]),c=e.ref(),C=e.ref(o.size),[,i]=ge.useToken(),{t:K}=he.useLocale();T.VxeUI.setConfig({i18n:(r,n)=>K(`ap.${r}`,n)});const{renderConfig:$,updateSignal:j}=me.useRenderColumns(l);let F=0;const H=e.computed(()=>{if(c.value)return c.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),E=e.computed(()=>{var r,n,t;return F++,((t=(n=(r=o.columns)==null?void 0:r.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!ce.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:n.sort((a,u)=>{let m=d.getColumnOrder(a.order);return d.getColumnOrder(u.order)-m}))==null?void 0:t.map(a=>{const u=d.updateFormProps(a,d.getFieldProps(a.fieldProps,{})),m={...a,fieldProps:{label:a.title,name:a.dataIndex,...u||{},_signal:F},renderNode:void 0};return m.renderNode=d.getSearchFormItemRenderNode(m,e.unref(U)),m}))||[]}),M=e.computed(()=>[s(),o.card?null:s("wrapper"),o.adaptive?s("adaptive"):null,o.sticky?s("sticky"):null].filter(Boolean)),I=e.computed(()=>d.recursionApColumns(e.unref(l),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),N=e.computed(()=>d.recursionApColumns(e.unref(l),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),{formRef:b,submit:q,reset:z,refresh:W,data:f,tableProps:V,setDataSource:G,handleTableChange:X}=de.useTablePaging({async request(r){var t;if(!h.value.preserveSelectedRowKeys&&p.isUndefined(o.dataSource)&&S(),!p.isUndefined(o.dataSource)){const a=r.pageSize*(r.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(a,a+r.pageSize))||[],total:o.dataSource.length||0}}const n=await((t=o.request)==null?void 0:t.call(o,r));return{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},namespace:"ap-grid",filterFields:N,sortFields:I,defaultParams:o.params,defaultData:o.defaultData,manual:o.manual,formatParams:o.beforeSearchSubmit,pagination:o.pagination}),{sortChangeEvent:J,filterChangeEvent:Q,paginationChangeEvent:Y}=ie.useInnerParams(X);fe.useProvideApTable({columns:e.computed(()=>l.value),columnsBackup:e.computed(()=>P.value),size:e.computed(()=>C.value?A.sizeMap[C.value]:"middle"),updateColumns(r){l.value=r},updateSize(r){C.value=A.sizeReverseMap[r]},renderConfig:e.computed(()=>({className:O("table-header","title"),color:i.value.colorPrimary}))});const Z=e.computed(()=>l.value.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),ee=e.computed(()=>p.isUndefined(o.loading)?f.loading:o.loading),re=e.computed(()=>p.isUndefined(o.dataSource)?f.records:o.dataSource),{selectedRows:v,rowSelection:h,...oe}=pe.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:re,rowKey:o.rowKey}),w=()=>{const r=c.value;r&&(v.value=[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},ae=()=>{const r=c.value;r&&(v.value=[r.getRadioRecord()])};function te(){var r;return((r=o.columns)==null?void 0:r.filter(n=>!n.hideInTable))||[]}function ne(r){var n,t,a;(a=(t=(n=b.value)==null?void 0:n.apForm)==null?void 0:t.setFieldsValue)==null||a.call(t,r)}function le(r=!1){var t,a,u;const n=r?"getFieldsValueTransformed":"getFieldsValue";return(u=(a=(t=b.value)==null?void 0:t.apForm)==null?void 0:a[n])==null?void 0:u.call(a,!0)}function S(){oe.clearAll();const r=c.value;r&&(h.value.type==="radio"?(r.clearRadioRow(),r.clearRadioReserve()):(r.clearCheckboxRow(),r.clearCheckboxReserve()))}async function se(r,n){var a;const t=f.records[r];if(t)return(a=c.value)==null?void 0:a.scrollToRow(t,n)}return e.watch(()=>[o.columnResizable,o.columns],()=>{const r=te();l.value=r,P.value=r},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,r=>{G(r)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(f).loading,r=>{var n;(n=o.onLoadingChange)==null||n.call(o,r)}),D({submit:q,reset:z,refresh:W,setSearchFormValues:ne,getSearchFormValues:le,getShowColumns:()=>e.unref(l),rowSelection:{selectedRows:e.computed(()=>v.value),clearAll:S},scrollToRow:se}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(M.value),style:e.normalizeStyle(r.wrapperStyle)},[e.unref(p.isUndefined)(r.dataSource)&&r.searchForm!==!1&&E.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(ue.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:b,"custom-reset":"","submit-loading":e.unref(V).loading,onSubmit:e.unref(q),onReset:e.unref(z)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,t=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderNode.Comp),e.mergeProps({key:t.dataIndex,item:t,ref_for:!0},t.fieldProps||{},{span:t.span,"custom-render":t.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[B.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(h).selectedRowKeys,shownColumns:l.value,clearAll:S})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(x.VxeTable),e.mergeProps(e.unref(R.toVxeProps)(o),{ref_key:"tableRef",ref:c,key:e.unref(j),data:e.unref(f).records,"sort-config":{remote:I.value.length>0},"filter-config":{remote:N.value.length>0},loading:ee.value,"row-config":{isHover:!0,keyField:o.rowKey},style:{"--vxe-ui-table-row-checkbox-checked-background-color":e.unref(i).controlItemBgActive,"--vxe-ui-table-row-hover-checkbox-checked-background-color":e.unref(i).controlItemBgActiveHover,"--vxe-ui-font-primary-color":e.unref(i).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(i).controlItemBgActive,"--vxe-ui-table-row-hover-radio-checked-background-color":e.unref(i).controlItemBgActiveHover},size:C.value,onSortChange:e.unref(J),onFilterChange:e.unref(Q),onCheckboxChange:w,onCheckboxRangeChange:w,onCheckboxAll:w,onRadioChange:ae}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(k.Empty),{image:e.unref(k.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),default:e.withCtx(()=>[o.expandable?(e.openBlock(),e.createBlock(e.unref(x.VxeColumn),e.mergeProps({key:0},e.unref(R.getRowExpandProps)(r.expandable),{fixed:Z.value}),{content:e.withCtx(t=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(t))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection?(e.openBlock(),e.createBlock(e.unref(x.VxeColumn),e.normalizeProps(e.mergeProps({key:1},e.unref(R.getRowSelectionProps)(e.unref(h),l.value))),null,16)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($),t=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{key:t.props.colId}))),128))]),_:2},[e.renderList(e.unref(p.omit)(B,["searchFormExtra"]),(t,a)=>({name:a,fn:e.withCtx(u=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1040,["data","sort-config","filter-config","loading","row-config","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("pagination-wrapper"))},[r.sticky?(e.openBlock(),e.createBlock(e.unref(ye.default),{key:0,direction:"horizontal","scroll-container":H.value},null,8,["scroll-container"])):e.createCommentVNode("",!0),r.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(k.Pagination),e.mergeProps({key:1,class:e.unref(s)("pagination")},e.unref(V).pagination,{onChange:e.unref(Y)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=be;
|
|
@@ -115,7 +115,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
115
115
|
*/
|
|
116
116
|
range?: boolean;
|
|
117
117
|
};
|
|
118
|
-
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig'> & {
|
|
118
|
+
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
|
|
119
119
|
/**
|
|
120
120
|
* 列配置
|
|
121
121
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../config-provider/index.js");require("../index.js");const c=require("lodash-unified"),m=require("vue"),v=require("../../config-provider/hooks/use-global-config.js"),b=require("./useTableRefresh.js");function q(a){const o=m.ref(null),{isShowRowSelection:i=!0,clearSelectionOnRequest:d=!0,transformSearchFormValues:s,api:n,tableRefresh:f=!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../config-provider/index.js");require("../index.js");const c=require("lodash-unified"),m=require("vue"),v=require("../../config-provider/hooks/use-global-config.js"),b=require("./useTableRefresh.js");function q(a){const o=m.ref(null),{isShowRowSelection:i=!0,clearSelectionOnRequest:d=!0,transformSearchFormValues:s,api:n,tableRefresh:f=!0,...h}=a||{};let u=null;const p=v.useGlobalConfig("uiMode","aplus"),l=()=>{var e,r;(r=(e=o.value)==null?void 0:e.rowSelection)==null||r.clearAll()};b.useTableRefresh({...G(f),apTableRef:o});const S=async e=>{u=e.sort;const r=s?s(e):e;try{if(!n)throw new Error("api is not defined");const{records:t,total:g}=await n(r);return d&&l(),{data:t,total:g}}catch(t){return console.error(t),{data:[],total:0}}};return[c.merge({scroll:{x:"100%",y:"100%"},columnResizable:!0,sticky:!0,request:n?S:void 0,rowSelection:i?{fixed:"left",columnWidth:50}:void 0,ref(e){o.value=e},card:!0,bordered:p.value==="admin"},h),{reload:()=>{var e;(e=o.value)==null||e.submit()},reset:()=>{var e;(e=o.value)==null||e.reset()},getSearchFormValues:(e=!0)=>{var t;const r=((t=o.value)==null?void 0:t.getSearchFormValues(!!e))||{};return s?s(r):r},getApGridInstance:()=>o.value,getSearchFormValuesAndSorted:(e=!0)=>{var t;const r=((t=o.value)==null?void 0:t.getSearchFormValues(!!e))||{};return r.sort=u&&c.cloneDeep(u),s?s(r):r},clearSelection:l}]}function G(a){return a===!0?{}:a===!1?{refreshBefore:()=>!1}:a}exports.usePageListApGrid=q;
|