@aplus-frontend/ui 0.5.29 → 0.5.30
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 +50 -48
- package/es/src/ap-field/interface.d.ts +3 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +20 -19
- package/es/src/ap-grid/editable/index.vue.mjs +23 -22
- package/es/src/ap-grid/index.vue.mjs +106 -102
- package/es/src/ap-grid/interface.d.ts +5 -0
- package/es/src/ap-grid/utils/col.mjs +88 -77
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
- package/es/src/business/ap-product-info/ApProductInfo.mjs +59 -0
- package/es/src/business/ap-product-info/constans.d.ts +11 -14
- package/es/src/business/ap-product-info/constans.mjs +21 -0
- package/es/src/business/ap-product-info/index.d.ts +86 -0
- package/es/src/business/ap-product-info/index.mjs +7 -0
- package/es/src/business/ap-product-info/interface.d.ts +9 -7
- package/es/src/business/ap-product-info/interface.mjs +1 -0
- package/es/src/business/ap-product-info/style/css.d.ts +0 -0
- package/es/src/business/ap-product-info/style/css.js +1 -0
- package/es/src/business/ap-product-info/style/index.d.ts +0 -0
- package/es/src/business/ap-product-info/style/index.js +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +21 -19
- package/es/src/components.d.ts +1 -0
- package/es/src/index.mjs +36 -34
- package/es/src/path-map.mjs +1 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/interface.d.ts +3 -0
- 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 +5 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -0
- package/lib/src/business/ap-product-info/constans.d.ts +11 -14
- package/lib/src/business/ap-product-info/constans.js +1 -0
- package/lib/src/business/ap-product-info/index.d.ts +86 -0
- package/lib/src/business/ap-product-info/index.js +1 -0
- package/lib/src/business/ap-product-info/interface.d.ts +9 -7
- package/lib/src/business/ap-product-info/interface.js +1 -0
- package/lib/src/business/ap-product-info/style/css.cjs +1 -0
- package/lib/src/business/ap-product-info/style/css.d.ts +0 -0
- package/lib/src/business/ap-product-info/style/index.cjs +1 -0
- package/lib/src/business/ap-product-info/style/index.d.ts +0 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/components.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +1 -1
- package/theme/ap-product-info/ap-product-info.css +87 -0
- package/theme/ap-product-info/ap-product-info.less +100 -0
- package/theme/index.css +87 -0
- package/theme/index.less +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as F, createElementBlock as B, openBlock as s, normalizeStyle as z, normalizeClass as
|
|
1
|
+
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as F, createElementBlock as B, openBlock as s, normalizeStyle as z, normalizeClass as g, createCommentVNode as S, createElementVNode as I, createVNode as U, mergeProps as h, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as p, 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";
|
|
5
5
|
import { VxeUI as Y } from "vxe-pc-ui";
|
|
6
|
-
import { isUndefined as
|
|
6
|
+
import { isUndefined as b, omit as Ne } from "lodash-unified";
|
|
7
7
|
import { ApForm as Te } from "../ap-form/index.mjs";
|
|
8
8
|
import "../config-provider/index.mjs";
|
|
9
9
|
import { noRenderAsFormItemValueList as ze } from "../ap-table/constants.mjs";
|
|
@@ -93,6 +93,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
93
93
|
defaultData: {},
|
|
94
94
|
dataSource: {},
|
|
95
95
|
onLoadingChange: {},
|
|
96
|
+
onShownColumnsChange: {},
|
|
96
97
|
searchForm: { type: [Boolean, Object], default: void 0 },
|
|
97
98
|
beforeSearchSubmit: {},
|
|
98
99
|
pagination: { type: [Boolean, Object], default: void 0 },
|
|
@@ -111,35 +112,35 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
111
112
|
},
|
|
112
113
|
setup(ae, { expose: re }) {
|
|
113
114
|
var q;
|
|
114
|
-
const L = Be(), a = ae,
|
|
115
|
-
|
|
116
|
-
const { e: P, b:
|
|
115
|
+
const L = Be(), a = ae, w = (q = Ie()) == null ? void 0 : q.appContext.app;
|
|
116
|
+
w && !w.__VXE_PC_UI_INSTALLED__ && (w.use(Y), w.__VXE_PC_UI_INSTALLED__ = !0);
|
|
117
|
+
const { e: P, b: i, be: te } = Xe("ap-grid"), le = Je("valueTypeMap"), d = k([]), D = k([]), m = k(), C = k(a.size), [, c] = Ge(), { t: ne } = Qe();
|
|
117
118
|
Y.setConfig({
|
|
118
|
-
i18n: (e,
|
|
119
|
+
i18n: (e, r) => ne(`ap.${e}`, r)
|
|
119
120
|
});
|
|
120
|
-
const { renderConfig: se, updateSignal:
|
|
121
|
+
const { renderConfig: se, updateSignal: de } = Ue(d);
|
|
121
122
|
let O = 0;
|
|
122
|
-
const
|
|
123
|
+
const ie = n(() => {
|
|
123
124
|
if (m.value)
|
|
124
125
|
return m.value.$el.querySelector(
|
|
125
126
|
".vxe-table--header-inner-wrapper"
|
|
126
127
|
);
|
|
127
128
|
}), K = n(() => {
|
|
128
|
-
var e,
|
|
129
|
-
return O++, ((
|
|
130
|
-
(
|
|
131
|
-
)) == null ? void 0 :
|
|
132
|
-
let y = Z(
|
|
129
|
+
var e, r, l;
|
|
130
|
+
return O++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
|
|
131
|
+
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !ze.includes(t.valueType)
|
|
132
|
+
)) == null ? void 0 : r.sort((t, u) => {
|
|
133
|
+
let y = Z(t.order);
|
|
133
134
|
return Z(u.order) - y;
|
|
134
|
-
})) == null ? void 0 :
|
|
135
|
+
})) == null ? void 0 : l.map((t) => {
|
|
135
136
|
const u = Ae(
|
|
136
|
-
|
|
137
|
-
_e(
|
|
137
|
+
t,
|
|
138
|
+
_e(t.fieldProps, {})
|
|
138
139
|
), y = {
|
|
139
|
-
...
|
|
140
|
+
...t,
|
|
140
141
|
fieldProps: {
|
|
141
|
-
label:
|
|
142
|
-
name:
|
|
142
|
+
label: t.title,
|
|
143
|
+
name: t.dataIndex,
|
|
143
144
|
...u || {},
|
|
144
145
|
_signal: O
|
|
145
146
|
},
|
|
@@ -151,14 +152,14 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
151
152
|
), y;
|
|
152
153
|
})) || [];
|
|
153
154
|
}), ce = n(() => [
|
|
154
|
-
|
|
155
|
-
a.card ? null :
|
|
156
|
-
a.adaptive ?
|
|
157
|
-
a.sticky ?
|
|
158
|
-
].filter(Boolean)), $ = n(() => ee(o(
|
|
155
|
+
i(),
|
|
156
|
+
a.card ? null : i("wrapper"),
|
|
157
|
+
a.adaptive ? i("adaptive") : null,
|
|
158
|
+
a.sticky ? i("sticky") : null
|
|
159
|
+
].filter(Boolean)), $ = n(() => ee(o(d), (e) => {
|
|
159
160
|
if (e.sorter === !0)
|
|
160
161
|
return e.key || e.dataIndex;
|
|
161
|
-
}).filter(Boolean)), H = n(() => ee(o(
|
|
162
|
+
}).filter(Boolean)), H = n(() => ee(o(d), (e) => {
|
|
162
163
|
if (e.filters && !e.onFilter)
|
|
163
164
|
return e.key || e.dataIndex;
|
|
164
165
|
}).filter(Boolean)), {
|
|
@@ -166,24 +167,24 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
166
167
|
submit: j,
|
|
167
168
|
reset: W,
|
|
168
169
|
refresh: ue,
|
|
169
|
-
data:
|
|
170
|
+
data: f,
|
|
170
171
|
tableProps: M,
|
|
171
172
|
setDataSource: pe,
|
|
172
173
|
handleTableChange: me
|
|
173
174
|
} = Le({
|
|
174
175
|
async request(e) {
|
|
175
|
-
var
|
|
176
|
-
if (!R.value.preserveSelectedRowKeys &&
|
|
177
|
-
const
|
|
176
|
+
var l;
|
|
177
|
+
if (!R.value.preserveSelectedRowKeys && b(a.dataSource) && T(), !b(a.dataSource)) {
|
|
178
|
+
const t = e.pageSize * (e.current - 1);
|
|
178
179
|
return {
|
|
179
|
-
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(
|
|
180
|
+
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(t, t + e.pageSize)) || [],
|
|
180
181
|
total: a.dataSource.length || 0
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
const
|
|
184
|
+
const r = await ((l = a.request) == null ? void 0 : l.call(a, e));
|
|
184
185
|
return {
|
|
185
|
-
data: (
|
|
186
|
-
total: (
|
|
186
|
+
data: (r == null ? void 0 : r.data) || [],
|
|
187
|
+
total: (r == null ? void 0 : r.total) || 0
|
|
187
188
|
};
|
|
188
189
|
},
|
|
189
190
|
namespace: "ap-grid",
|
|
@@ -194,31 +195,33 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
194
195
|
manual: a.manual,
|
|
195
196
|
formatParams: a.beforeSearchSubmit,
|
|
196
197
|
pagination: a.pagination
|
|
197
|
-
}), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent:
|
|
198
|
+
}), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent: he } = Oe(me);
|
|
198
199
|
We({
|
|
199
|
-
columns: n(() =>
|
|
200
|
+
columns: n(() => d.value),
|
|
200
201
|
columnsBackup: n(() => D.value),
|
|
201
|
-
size: n(() =>
|
|
202
|
+
size: n(() => C.value ? qe[C.value] : "middle"),
|
|
202
203
|
updateColumns(e) {
|
|
203
|
-
|
|
204
|
+
var r;
|
|
205
|
+
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e);
|
|
204
206
|
},
|
|
205
207
|
updateSize(e) {
|
|
206
|
-
|
|
208
|
+
C.value = Me[e];
|
|
207
209
|
},
|
|
208
210
|
renderConfig: n(() => ({
|
|
209
211
|
className: te("table-header", "title"),
|
|
210
212
|
color: c.value.colorPrimary
|
|
211
|
-
}))
|
|
213
|
+
})),
|
|
214
|
+
dataSource: n(() => o(f).records)
|
|
212
215
|
});
|
|
213
|
-
const
|
|
214
|
-
() =>
|
|
216
|
+
const ve = n(
|
|
217
|
+
() => d.value.some(
|
|
215
218
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
216
219
|
) ? "left" : void 0
|
|
217
220
|
), Ce = n(
|
|
218
|
-
() =>
|
|
221
|
+
() => b(a.loading) ? f.loading : a.loading
|
|
219
222
|
), ye = n(
|
|
220
|
-
() =>
|
|
221
|
-
), { selectedRows: x, rowSelection: R, ...
|
|
223
|
+
() => b(a.dataSource) ? f.records : a.dataSource
|
|
224
|
+
), { selectedRows: x, rowSelection: R, ...Se } = je({
|
|
222
225
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
223
226
|
dataSource: ye,
|
|
224
227
|
rowKey: a.rowKey
|
|
@@ -228,39 +231,40 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
228
231
|
...e.getCheckboxReserveRecords(),
|
|
229
232
|
...e.getCheckboxRecords()
|
|
230
233
|
]);
|
|
231
|
-
},
|
|
234
|
+
}, be = () => {
|
|
232
235
|
const e = m.value;
|
|
233
236
|
e && (x.value = [e.getRadioRecord()]);
|
|
234
237
|
};
|
|
235
|
-
function
|
|
238
|
+
function we() {
|
|
236
239
|
var e;
|
|
237
|
-
return ((e = a.columns) == null ? void 0 : e.filter((
|
|
240
|
+
return ((e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInTable)) || [];
|
|
238
241
|
}
|
|
239
242
|
function xe(e) {
|
|
240
|
-
var l, t
|
|
241
|
-
(
|
|
243
|
+
var r, l, t;
|
|
244
|
+
(t = (l = (r = E.value) == null ? void 0 : r.apForm) == null ? void 0 : l.setFieldsValue) == null || t.call(l, e);
|
|
242
245
|
}
|
|
243
246
|
function Re(e = !1) {
|
|
244
|
-
var
|
|
245
|
-
const
|
|
246
|
-
return (u = (
|
|
247
|
+
var l, t, u;
|
|
248
|
+
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
249
|
+
return (u = (t = (l = E.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : u.call(t, !0);
|
|
247
250
|
}
|
|
248
251
|
function T() {
|
|
249
|
-
|
|
252
|
+
Se.clearAll();
|
|
250
253
|
const e = m.value;
|
|
251
254
|
e && (R.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
252
255
|
}
|
|
253
|
-
async function ke(e,
|
|
254
|
-
var
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
return (
|
|
256
|
+
async function ke(e, r) {
|
|
257
|
+
var t;
|
|
258
|
+
const l = f.records[e];
|
|
259
|
+
if (l)
|
|
260
|
+
return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
|
|
258
261
|
}
|
|
259
262
|
return F(
|
|
260
263
|
() => [a.columnResizable, a.columns],
|
|
261
264
|
() => {
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
var r;
|
|
266
|
+
const e = we();
|
|
267
|
+
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e), D.value = e;
|
|
264
268
|
},
|
|
265
269
|
{
|
|
266
270
|
deep: !0,
|
|
@@ -273,15 +277,15 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
273
277
|
},
|
|
274
278
|
{ immediate: !0, deep: !0 }
|
|
275
279
|
), F(
|
|
276
|
-
() => o(
|
|
280
|
+
() => o(f).loading,
|
|
277
281
|
(e) => {
|
|
278
|
-
var
|
|
279
|
-
(
|
|
282
|
+
var r;
|
|
283
|
+
(r = a.onLoadingChange) == null || r.call(a, e);
|
|
280
284
|
}
|
|
281
285
|
), F(
|
|
282
286
|
() => a.size,
|
|
283
287
|
(e) => {
|
|
284
|
-
|
|
288
|
+
C.value = e;
|
|
285
289
|
}
|
|
286
290
|
), re({
|
|
287
291
|
submit: j,
|
|
@@ -289,22 +293,22 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
289
293
|
refresh: ue,
|
|
290
294
|
setSearchFormValues: xe,
|
|
291
295
|
getSearchFormValues: Re,
|
|
292
|
-
getShowColumns: () => o(
|
|
296
|
+
getShowColumns: () => o(d),
|
|
293
297
|
rowSelection: {
|
|
294
298
|
selectedRows: n(() => x.value),
|
|
295
299
|
clearAll: T
|
|
296
300
|
},
|
|
297
301
|
scrollToRow: ke
|
|
298
|
-
}), (e,
|
|
299
|
-
class:
|
|
302
|
+
}), (e, r) => (s(), B("div", {
|
|
303
|
+
class: g(ce.value),
|
|
300
304
|
style: z(e.wrapperStyle)
|
|
301
305
|
}, [
|
|
302
|
-
o(
|
|
306
|
+
o(b)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), B("div", {
|
|
303
307
|
key: 0,
|
|
304
|
-
class:
|
|
308
|
+
class: g(e.card ? o(P)("search-wrapper") : null),
|
|
305
309
|
style: z(e.searchFormWrapperStyle)
|
|
306
310
|
}, [
|
|
307
|
-
U(o(Te).SearchForm,
|
|
311
|
+
U(o(Te).SearchForm, h(e.searchForm || {}, {
|
|
308
312
|
ref_key: "formRef",
|
|
309
313
|
ref: E,
|
|
310
314
|
"custom-reset": "",
|
|
@@ -313,13 +317,13 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
313
317
|
onReset: o(W)
|
|
314
318
|
}), G({
|
|
315
319
|
default: v(() => [
|
|
316
|
-
(s(!0), B(X, null, A(K.value, (
|
|
317
|
-
key:
|
|
318
|
-
item:
|
|
320
|
+
(s(!0), B(X, null, A(K.value, (l) => (s(), p(_(l.renderNode.Comp), h({
|
|
321
|
+
key: l.dataIndex,
|
|
322
|
+
item: l,
|
|
319
323
|
ref_for: !0
|
|
320
|
-
},
|
|
321
|
-
span:
|
|
322
|
-
"custom-render":
|
|
324
|
+
}, l.fieldProps || {}, {
|
|
325
|
+
span: l.span,
|
|
326
|
+
"custom-render": l.renderNode.render
|
|
323
327
|
}), null, 16, ["item", "span", "custom-render"]))), 128))
|
|
324
328
|
]),
|
|
325
329
|
_: 2
|
|
@@ -332,29 +336,29 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
332
336
|
key: "0"
|
|
333
337
|
} : void 0
|
|
334
338
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
335
|
-
], 6)) :
|
|
339
|
+
], 6)) : S("", !0),
|
|
336
340
|
I("div", {
|
|
337
|
-
class:
|
|
341
|
+
class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
|
|
338
342
|
style: z(e.tableWrapperStyle)
|
|
339
343
|
}, [
|
|
340
344
|
I("div", {
|
|
341
|
-
class:
|
|
345
|
+
class: g(o(i)("header-wrapper"))
|
|
342
346
|
}, [
|
|
343
347
|
V(e.$slots, "title", {
|
|
344
348
|
selectedRows: o(x),
|
|
345
349
|
selectedRowKeys: o(R).selectedRowKeys,
|
|
346
|
-
shownColumns:
|
|
350
|
+
shownColumns: d.value,
|
|
347
351
|
clearAll: T
|
|
348
352
|
})
|
|
349
353
|
], 2),
|
|
350
354
|
I("div", {
|
|
351
|
-
class:
|
|
355
|
+
class: g(o(i)("vxe-wrapper"))
|
|
352
356
|
}, [
|
|
353
|
-
(s(), p(o(Ee),
|
|
357
|
+
(s(), p(o(Ee), h(o(Ke)(a), {
|
|
354
358
|
ref_key: "tableRef",
|
|
355
359
|
ref: m,
|
|
356
|
-
key: o(
|
|
357
|
-
data: o(
|
|
360
|
+
key: o(de),
|
|
361
|
+
data: o(f).records,
|
|
358
362
|
"sort-config": { remote: $.value.length > 0 },
|
|
359
363
|
"filter-config": { remote: H.value.length > 0 },
|
|
360
364
|
loading: Ce.value,
|
|
@@ -374,13 +378,13 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
374
378
|
"--vxe-ui-font-color": o(c).colorTextBase,
|
|
375
379
|
"--vxe-ui-table-border-color": o(c).colorBorderSecondary
|
|
376
380
|
},
|
|
377
|
-
size:
|
|
381
|
+
size: C.value,
|
|
378
382
|
onSortChange: o(fe),
|
|
379
383
|
onFilterChange: o(ge),
|
|
380
384
|
onCheckboxChange: N,
|
|
381
385
|
onCheckboxRangeChange: N,
|
|
382
386
|
onCheckboxAll: N,
|
|
383
|
-
onRadioChange:
|
|
387
|
+
onRadioChange: be
|
|
384
388
|
}), G({
|
|
385
389
|
empty: v(() => [
|
|
386
390
|
U(o(oe), {
|
|
@@ -388,39 +392,39 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
388
392
|
}, null, 8, ["image"])
|
|
389
393
|
]),
|
|
390
394
|
default: v(() => [
|
|
391
|
-
a.expandable ? (s(), p(o(Q),
|
|
392
|
-
content: v((
|
|
393
|
-
(s(), p(_(a.expandable.renderContent(
|
|
395
|
+
a.expandable ? (s(), p(o(Q), h({ key: 0 }, o($e)(e.expandable), { fixed: ve.value }), {
|
|
396
|
+
content: v((l) => [
|
|
397
|
+
(s(), p(_(a.expandable.renderContent(l))))
|
|
394
398
|
]),
|
|
395
399
|
_: 1
|
|
396
|
-
}, 16, ["fixed"])) :
|
|
397
|
-
a.rowSelection ? (s(), p(o(Q), J(
|
|
398
|
-
(s(!0), B(X, null, A(o(se), (
|
|
399
|
-
key:
|
|
400
|
+
}, 16, ["fixed"])) : S("", !0),
|
|
401
|
+
a.rowSelection ? (s(), p(o(Q), J(h({ key: 1 }, o(He)(o(R), d.value))), null, 16)) : S("", !0),
|
|
402
|
+
(s(!0), B(X, null, A(o(se), (l) => (s(), p(_(l), {
|
|
403
|
+
key: l.props.colId
|
|
400
404
|
}))), 128))
|
|
401
405
|
]),
|
|
402
406
|
_: 2
|
|
403
407
|
}, [
|
|
404
|
-
A(o(Ne)(L, ["searchFormExtra"]), (
|
|
405
|
-
name:
|
|
408
|
+
A(o(Ne)(L, ["searchFormExtra"]), (l, t) => ({
|
|
409
|
+
name: t,
|
|
406
410
|
fn: v((u) => [
|
|
407
|
-
V(e.$slots,
|
|
411
|
+
V(e.$slots, t, J(Pe(u || {})))
|
|
408
412
|
])
|
|
409
413
|
}))
|
|
410
414
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
|
|
411
415
|
], 2),
|
|
412
416
|
I("div", {
|
|
413
|
-
class:
|
|
417
|
+
class: g(o(i)("pagination-wrapper"))
|
|
414
418
|
}, [
|
|
415
419
|
e.sticky ? (s(), p(o(Ye), {
|
|
416
420
|
key: 0,
|
|
417
421
|
direction: "horizontal",
|
|
418
|
-
"scroll-container":
|
|
419
|
-
}, null, 8, ["scroll-container"])) :
|
|
420
|
-
e.pagination !== !1 ? (s(), p(o(De),
|
|
422
|
+
"scroll-container": ie.value
|
|
423
|
+
}, null, 8, ["scroll-container"])) : S("", !0),
|
|
424
|
+
e.pagination !== !1 ? (s(), p(o(De), h({
|
|
421
425
|
key: 1,
|
|
422
|
-
class: o(
|
|
423
|
-
}, o(M).pagination, { onChange: o(
|
|
426
|
+
class: o(i)("pagination")
|
|
427
|
+
}, o(M).pagination, { onChange: o(he) }), null, 16, ["class", "onChange"])) : S("", !0)
|
|
424
428
|
], 2)
|
|
425
429
|
], 6)
|
|
426
430
|
], 6));
|
|
@@ -162,6 +162,11 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
162
162
|
* @returns
|
|
163
163
|
*/
|
|
164
164
|
onLoadingChange?: (loading: boolean) => void;
|
|
165
|
+
/**
|
|
166
|
+
* 当可显示列变更后触发
|
|
167
|
+
* @returns
|
|
168
|
+
*/
|
|
169
|
+
onShownColumnsChange?: (columns: ApGridColumnType<RecordType>[]) => void;
|
|
165
170
|
/**
|
|
166
171
|
* 查询表单配置,设置为false表示不渲染查询表单
|
|
167
172
|
*/
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { isUndefined as
|
|
3
|
-
import { valueEnumToArray as
|
|
4
|
-
import { noRenderAsFormItemValueList as
|
|
1
|
+
import { createVNode as h, Fragment as x } from "vue";
|
|
2
|
+
import { isUndefined as j, isArray as B, isString as b, isBoolean as c, isNumber as N, pick as w } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as W, objectToString as _, getTableTitle as E, getTableRenderType as k, getTableRenderProps as z, getTableCellRenderNode as G } from "../../ap-table/utils.mjs";
|
|
4
|
+
import { noRenderAsFormItemValueList as I } from "../../ap-table/constants.mjs";
|
|
5
5
|
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
function
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
6
|
+
import L from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
7
|
+
function O(e) {
|
|
8
|
+
if (!j(e))
|
|
9
|
+
return B(e) ? e.reduce((r, i) => b(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function S(e) {
|
|
12
12
|
if (e)
|
|
13
13
|
return e === !0 ? "left" : e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function U(e) {
|
|
16
|
+
return c(e) ? {
|
|
17
17
|
sortable: e
|
|
18
18
|
} : e ? {
|
|
19
19
|
sortable: !0,
|
|
@@ -23,19 +23,19 @@ function G(e) {
|
|
|
23
23
|
sortable: !1
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function q(e) {
|
|
27
27
|
let r;
|
|
28
|
-
return
|
|
29
|
-
label:
|
|
28
|
+
return c(e.filters) && e.valueEnum ? r = W(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
|
|
29
|
+
label: b(i.text) ? i.text : "",
|
|
30
30
|
value: i.value
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function D(e) {
|
|
34
34
|
if (e)
|
|
35
35
|
return (r) => e(r.value, r.row);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return e ?
|
|
37
|
+
function H(e, r) {
|
|
38
|
+
return e ? N(e) ? {
|
|
39
39
|
tooltip: r,
|
|
40
40
|
rows: e
|
|
41
41
|
} : e === !0 || e === "tooltip" ? {
|
|
@@ -47,91 +47,102 @@ function U(e, r) {
|
|
|
47
47
|
htmlTitle: e === "title" ? r : ""
|
|
48
48
|
} : !1;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
50
|
+
function A(e, r, i) {
|
|
51
|
+
if (I.includes(e.valueType))
|
|
52
52
|
return i;
|
|
53
53
|
if (e.copyable || e.ellipsis) {
|
|
54
|
-
const
|
|
55
|
-
return
|
|
54
|
+
const n = H(e.ellipsis, r), t = _(r);
|
|
55
|
+
return h(L, {
|
|
56
56
|
rawValue: t,
|
|
57
57
|
copyable: e.copyable,
|
|
58
|
-
ellipsis:
|
|
58
|
+
ellipsis: n,
|
|
59
59
|
content: i
|
|
60
60
|
}, null);
|
|
61
61
|
}
|
|
62
62
|
return i;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
header: () =>
|
|
68
|
-
},
|
|
64
|
+
function R(e, r, i) {
|
|
65
|
+
const n = w(e, ["width", "minWidth", "align"]);
|
|
66
|
+
return n.field = O(e.dataIndex), n.fixed = S(e.fixed), n.slots = {
|
|
67
|
+
header: () => E(e, i, void 0, r)
|
|
68
|
+
}, n.headerAlign = e.align, n.showOverflow = !1, n.showFooterOverflow = !1, n;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
72
|
-
t.field =
|
|
73
|
-
const
|
|
74
|
-
value:
|
|
75
|
-
|
|
70
|
+
function v(e, r, i, n) {
|
|
71
|
+
const t = w(e, ["width", "minWidth", "align", "resizable"]);
|
|
72
|
+
t.field = O(e.dataIndex), t.fixed = S(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, U(e.sorter)), t.filters = q(e), t.filterMultiple = e.filterMultiple, t.filterMethod = D(e.onFilter);
|
|
73
|
+
const u = ({
|
|
74
|
+
value: l,
|
|
75
|
+
_columnIndex: s,
|
|
76
|
+
footer: f,
|
|
77
|
+
...d
|
|
76
78
|
}) => {
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
+
var y, F;
|
|
80
|
+
if (f && s === 0)
|
|
81
|
+
return A(e, l, h(x, null, [l]));
|
|
82
|
+
const o = k(e), $ = z({
|
|
79
83
|
...e,
|
|
80
|
-
valueType:
|
|
84
|
+
valueType: o
|
|
81
85
|
}, {
|
|
82
|
-
value:
|
|
83
|
-
...
|
|
84
|
-
}),
|
|
85
|
-
value:
|
|
86
|
-
...
|
|
87
|
-
})) ||
|
|
88
|
-
value:
|
|
89
|
-
...
|
|
90
|
-
})]) :
|
|
91
|
-
let p =
|
|
86
|
+
value: l,
|
|
87
|
+
...d
|
|
88
|
+
}), M = G(o, $, d.record, n), T = ((y = e.renderText) == null ? void 0 : y.call(e, {
|
|
89
|
+
value: l,
|
|
90
|
+
...d
|
|
91
|
+
})) || l, V = e.renderText ? h(x, null, [(F = e.renderText) == null ? void 0 : F.call(e, {
|
|
92
|
+
value: l,
|
|
93
|
+
...d
|
|
94
|
+
})]) : M;
|
|
95
|
+
let p = A(e, T, V);
|
|
92
96
|
return e.customRender && (p = e.customRender({
|
|
93
|
-
value:
|
|
94
|
-
...
|
|
97
|
+
value: l,
|
|
98
|
+
...d,
|
|
95
99
|
column: e,
|
|
96
100
|
originalNode: p,
|
|
97
|
-
originalText:
|
|
101
|
+
originalText: T
|
|
98
102
|
})), p;
|
|
99
|
-
},
|
|
100
|
-
row:
|
|
101
|
-
rowIndex:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
}, a = ({
|
|
104
|
+
row: l,
|
|
105
|
+
rowIndex: s,
|
|
106
|
+
_columnIndex: f,
|
|
107
|
+
footer: d
|
|
108
|
+
}) => u({
|
|
109
|
+
value: l[t.field],
|
|
110
|
+
text: l[t.field],
|
|
111
|
+
record: l,
|
|
112
|
+
index: s,
|
|
113
|
+
renderIndex: s,
|
|
114
|
+
column: e,
|
|
115
|
+
_columnIndex: f,
|
|
116
|
+
footer: d
|
|
109
117
|
});
|
|
110
118
|
return t.slots = {
|
|
111
|
-
header: () =>
|
|
112
|
-
default:
|
|
113
|
-
footer:
|
|
119
|
+
header: () => E(e, i, void 0, r),
|
|
120
|
+
default: a,
|
|
121
|
+
footer: (l) => a({
|
|
122
|
+
...l,
|
|
123
|
+
footer: !0
|
|
124
|
+
})
|
|
114
125
|
}, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
|
|
115
126
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
118
|
-
if (!((
|
|
119
|
-
return
|
|
120
|
-
function t(
|
|
121
|
-
return
|
|
127
|
+
function P(e, r, i, n) {
|
|
128
|
+
var a;
|
|
129
|
+
if (!((a = e.children) != null && a.length))
|
|
130
|
+
return v(e, r, i, n);
|
|
131
|
+
function t(l) {
|
|
132
|
+
return l.map((s) => {
|
|
122
133
|
var f;
|
|
123
|
-
if ((f =
|
|
124
|
-
const
|
|
125
|
-
return
|
|
134
|
+
if ((f = s.children) != null && f.length) {
|
|
135
|
+
const d = R(s, r, i);
|
|
136
|
+
return d.children = t(s.children), d;
|
|
126
137
|
}
|
|
127
|
-
return
|
|
138
|
+
return v(s, r, i, n);
|
|
128
139
|
});
|
|
129
140
|
}
|
|
130
|
-
const
|
|
131
|
-
return
|
|
141
|
+
const u = R(e, r, i);
|
|
142
|
+
return u.children = t(e.children), u;
|
|
132
143
|
}
|
|
133
144
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
145
|
+
P as transformCol,
|
|
146
|
+
R as transformToColGroup,
|
|
147
|
+
v as transformToColumn
|
|
137
148
|
};
|