@aplus-frontend/ui 0.0.9 → 0.0.11
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-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +1 -1
- package/es/src/ap-field/date-range/index.vue.mjs +1 -1
- package/es/src/ap-field/number/index.vue.mjs +1 -1
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +1 -1
- package/es/src/ap-field/slider/index.vue.d.ts +3 -0
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +1 -1
- package/es/src/ap-field/text/index.vue2.mjs +1 -1
- package/es/src/ap-field/text/password.vue.mjs +1 -1
- package/es/src/ap-field/text-area/index.vue.mjs +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +5 -3
- package/es/src/ap-table/ap-table.vue.mjs +117 -95
- package/es/src/ap-table/hooks/use-table-content-height.d.ts +9 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +39 -0
- package/es/src/ap-table/interface.d.ts +5 -1
- package/es/src/ap-table/style/ap-table.css +28 -0
- package/es/src/editable-table/interface.d.ts +71 -0
- package/es/src/editable-table/style/index.css +7 -0
- package/es/src/editable-table/utils.d.ts +8 -0
- package/es/src/theme/ap-table/ap-table.css +28 -0
- package/es/src/theme/editable-table/index.css +7 -0
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +3 -0
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +5 -3
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-content-height.d.ts +9 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -0
- package/lib/src/ap-table/interface.d.ts +5 -1
- package/lib/src/ap-table/style/ap-table.css +28 -0
- package/lib/src/editable-table/interface.d.ts +71 -0
- package/lib/src/editable-table/style/index.css +7 -0
- package/lib/src/editable-table/utils.d.ts +8 -0
- package/lib/src/theme/ap-table/ap-table.css +28 -0
- package/lib/src/theme/editable-table/index.css +7 -0
- package/package.json +1 -1
|
@@ -80,7 +80,7 @@ const G = { key: 0 }, oe = /* @__PURE__ */ P({
|
|
|
80
80
|
optionLabelProp: {},
|
|
81
81
|
defaultActiveFirstOption: { type: Boolean, default: void 0 },
|
|
82
82
|
labelInValue: { type: Boolean, default: void 0 },
|
|
83
|
-
emptyText: { default: "
|
|
83
|
+
emptyText: { default: "--" },
|
|
84
84
|
request: {},
|
|
85
85
|
multiple: { type: Boolean, default: void 0 },
|
|
86
86
|
value: {},
|
|
@@ -17,6 +17,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
17
17
|
step: number;
|
|
18
18
|
tooltipOpen: undefined;
|
|
19
19
|
tooltipVisible: undefined;
|
|
20
|
+
emptyText: string;
|
|
20
21
|
}>, {
|
|
21
22
|
focus: typeof focus;
|
|
22
23
|
blur: typeof blur;
|
|
@@ -29,6 +30,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
29
30
|
step: number;
|
|
30
31
|
tooltipOpen: undefined;
|
|
31
32
|
tooltipVisible: undefined;
|
|
33
|
+
emptyText: string;
|
|
32
34
|
}>>> & {
|
|
33
35
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
34
36
|
}, {
|
|
@@ -38,6 +40,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
38
40
|
included: boolean;
|
|
39
41
|
tooltipOpen: boolean;
|
|
40
42
|
tooltipVisible: boolean;
|
|
43
|
+
emptyText: string;
|
|
41
44
|
}, {}>, Readonly<ApFieldSliderSlots> & ApFieldSliderSlots>;
|
|
42
45
|
export default _default;
|
|
43
46
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -36,13 +36,13 @@ const I = /* @__PURE__ */ x({
|
|
|
36
36
|
onFocus: {},
|
|
37
37
|
onBlur: {},
|
|
38
38
|
"onUpdate:value": {},
|
|
39
|
-
emptyText: {}
|
|
39
|
+
emptyText: { default: "--" }
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:value"],
|
|
42
42
|
setup(p, { expose: i, emit: s }) {
|
|
43
|
-
const d = g(), a = k(), l = p,
|
|
43
|
+
const d = g(), a = k(), l = p, f = s, { value: r, updateValue: m } = E(
|
|
44
44
|
l,
|
|
45
|
-
|
|
45
|
+
f
|
|
46
46
|
), c = C(() => {
|
|
47
47
|
const e = o(r);
|
|
48
48
|
return w(e) ? l.emptyText : z(e) ? `${e[0]}-${e[1]}` : e;
|
|
@@ -71,7 +71,7 @@ const I = /* @__PURE__ */ x({
|
|
|
71
71
|
]),
|
|
72
72
|
{
|
|
73
73
|
value: o(r),
|
|
74
|
-
"onUpdate:value": o(
|
|
74
|
+
"onUpdate:value": o(m),
|
|
75
75
|
ref_key: "sliderRef",
|
|
76
76
|
ref: a
|
|
77
77
|
}
|
|
@@ -22,6 +22,7 @@ type ApTableSlots = {
|
|
|
22
22
|
expandColumnTitle?: any;
|
|
23
23
|
customFilterIcon?: any;
|
|
24
24
|
customFilterDropdown?: any;
|
|
25
|
+
searchFormExtra?: any;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* 设置查询表单值
|
|
@@ -47,6 +48,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
47
48
|
searchForm: undefined;
|
|
48
49
|
loading: undefined;
|
|
49
50
|
manual: boolean;
|
|
51
|
+
adaptive: boolean;
|
|
50
52
|
}>, {
|
|
51
53
|
submit: () => void;
|
|
52
54
|
reset: () => void;
|
|
@@ -71,6 +73,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
71
73
|
searchForm: undefined;
|
|
72
74
|
loading: undefined;
|
|
73
75
|
manual: boolean;
|
|
76
|
+
adaptive: boolean;
|
|
74
77
|
}>>>, {
|
|
75
78
|
loading: boolean | Partial< ExtractPropTypes<{
|
|
76
79
|
prefixCls: StringConstructor;
|
|
@@ -164,9 +167,8 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
164
167
|
childrenColumnName: string;
|
|
165
168
|
card: boolean;
|
|
166
169
|
searchForm: false | ApFormSearchFormProps;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}>;
|
|
170
|
+
adaptive: boolean;
|
|
171
|
+
}, {}>, Readonly<ApTableSlots> & ApTableSlots>;
|
|
170
172
|
export default _default;
|
|
171
173
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
172
174
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as X, useSlots as Y, computed as d, createVNode as s, mergeProps as m, unref as l, watch as Z, openBlock as i, createElementBlock as g, normalizeClass as F, normalizeStyle as v, createSlots as P, withCtx as p, Fragment as ee, renderList as I, createBlock as ae, resolveDynamicComponent as te, renderSlot as S, createCommentVNode as k, createElementVNode as E, toDisplayString as oe, normalizeProps as re, guardReactiveProps as le } from "vue";
|
|
2
|
+
import { Typography as ne, Table as de, Tooltip as se } from "ant-design-vue";
|
|
3
|
+
import { ApForm as ue } from "../ap-form/index.mjs";
|
|
4
|
+
import { apTableRenderItemMap as ie, noRenderAsFormItemValueList as O, apTableFormItemMap as pe } from "./constants.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useTablePaging as
|
|
7
|
-
import { isUndefined as
|
|
6
|
+
import { useTablePaging as ce } from "./hooks/use-table-paging.mjs";
|
|
7
|
+
import { isUndefined as fe, omit as me } from "lodash-unified";
|
|
8
8
|
import "./style/ap-table.css";
|
|
9
|
-
import { QuestionCircleOutlined as
|
|
10
|
-
import { apColumnToColumn as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
9
|
+
import { QuestionCircleOutlined as ge } from "@ant-design/icons-vue";
|
|
10
|
+
import { apColumnToColumn as ye, getTableRenderType as he, getTableRenderProps as be, getColumnOrder as z, updateFormProps as Ce, getFieldProps as Fe, getPlaceholder as Se } from "./utils.mjs";
|
|
11
|
+
import Re from "./hooks/use-table-content-height.mjs";
|
|
12
|
+
import { useLocale as xe } from "../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as we } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useGlobalConfig as Te } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
const Be = {
|
|
15
16
|
key: 0
|
|
16
|
-
},
|
|
17
|
+
}, Ae = /* @__PURE__ */ X({
|
|
17
18
|
name: "ApTable",
|
|
18
19
|
__name: "ap-table",
|
|
19
20
|
props: {
|
|
@@ -120,21 +121,28 @@ const Ce = {
|
|
|
120
121
|
},
|
|
121
122
|
size: {
|
|
122
123
|
default: "middle"
|
|
124
|
+
},
|
|
125
|
+
adaptive: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: !1
|
|
123
128
|
}
|
|
124
129
|
},
|
|
125
|
-
setup(
|
|
126
|
-
expose:
|
|
130
|
+
setup(L, {
|
|
131
|
+
expose: V
|
|
127
132
|
}) {
|
|
128
|
-
const
|
|
129
|
-
t:
|
|
130
|
-
} =
|
|
131
|
-
e:
|
|
132
|
-
b:
|
|
133
|
-
} =
|
|
133
|
+
const r = L, R = Y(), {
|
|
134
|
+
t: N
|
|
135
|
+
} = xe(), {
|
|
136
|
+
e: y,
|
|
137
|
+
b: c
|
|
138
|
+
} = we("ap-table"), D = Te("uiMode"), {
|
|
139
|
+
height: W,
|
|
140
|
+
contentRef: _
|
|
141
|
+
} = Re(), h = d(() => {
|
|
134
142
|
var t;
|
|
135
|
-
let e = ((t =
|
|
143
|
+
let e = ((t = r.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
136
144
|
return e = e.map((a) => ({
|
|
137
|
-
...
|
|
145
|
+
...ye(a),
|
|
138
146
|
customRender({
|
|
139
147
|
value: o,
|
|
140
148
|
...n
|
|
@@ -147,24 +155,24 @@ const Ce = {
|
|
|
147
155
|
column: a
|
|
148
156
|
});
|
|
149
157
|
else {
|
|
150
|
-
const
|
|
158
|
+
const B = he(a), U = ie[B], J = be(a, {
|
|
151
159
|
value: o,
|
|
152
160
|
...n
|
|
153
161
|
});
|
|
154
|
-
u = s(
|
|
162
|
+
u = s(U, m(J, {
|
|
155
163
|
mode: "read"
|
|
156
164
|
}), null);
|
|
157
165
|
}
|
|
158
|
-
return
|
|
166
|
+
return $(a, o, u);
|
|
159
167
|
}
|
|
160
168
|
})), e;
|
|
161
|
-
}),
|
|
169
|
+
}), x = d(() => {
|
|
162
170
|
var e, t, a;
|
|
163
|
-
return ((a = (t = (e =
|
|
164
|
-
let u =
|
|
165
|
-
return
|
|
171
|
+
return ((a = (t = (e = r.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !O.includes(o.valueType))) == null ? void 0 : t.sort((o, n) => {
|
|
172
|
+
let u = z(o.order);
|
|
173
|
+
return z(n.order) - u;
|
|
166
174
|
})) == null ? void 0 : a.map((o) => {
|
|
167
|
-
const n =
|
|
175
|
+
const n = Ce(o, Fe(o.fieldProps));
|
|
168
176
|
return {
|
|
169
177
|
...o,
|
|
170
178
|
fieldProps: {
|
|
@@ -172,42 +180,50 @@ const Ce = {
|
|
|
172
180
|
name: o.dataIndex,
|
|
173
181
|
...n || {},
|
|
174
182
|
// 格式化placeholder
|
|
175
|
-
placeholder:
|
|
183
|
+
placeholder: Se(N, o.valueType, n == null ? void 0 : n.placeholder)
|
|
176
184
|
}
|
|
177
185
|
};
|
|
178
186
|
})) || [];
|
|
179
|
-
}),
|
|
187
|
+
}), j = d(() => l(h).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), A = d(() => l(h).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
180
188
|
formRef: b,
|
|
181
|
-
submit:
|
|
182
|
-
reset:
|
|
183
|
-
tableProps:
|
|
184
|
-
handleTableChange:
|
|
185
|
-
data:
|
|
186
|
-
} =
|
|
189
|
+
submit: w,
|
|
190
|
+
reset: T,
|
|
191
|
+
tableProps: f,
|
|
192
|
+
handleTableChange: M,
|
|
193
|
+
data: C
|
|
194
|
+
} = ce({
|
|
187
195
|
async request(e) {
|
|
188
196
|
var a, o;
|
|
189
|
-
const t = await ((a =
|
|
190
|
-
return (o =
|
|
197
|
+
const t = await ((a = r.request) == null ? void 0 : a.call(r, e));
|
|
198
|
+
return (o = r.onLoad) == null || o.call(r, (t == null ? void 0 : t.data) || []), {
|
|
191
199
|
data: (t == null ? void 0 : t.data) || [],
|
|
192
200
|
total: (t == null ? void 0 : t.total) || 0
|
|
193
201
|
};
|
|
194
202
|
},
|
|
195
|
-
filterFields:
|
|
196
|
-
sortFields:
|
|
197
|
-
defaultParams:
|
|
198
|
-
defaultData:
|
|
199
|
-
manual:
|
|
200
|
-
defaultCurrent:
|
|
201
|
-
defaultPageSize:
|
|
202
|
-
formatParams:
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
filterFields: l(A),
|
|
204
|
+
sortFields: l(j),
|
|
205
|
+
defaultParams: r.params,
|
|
206
|
+
defaultData: r.defaultData,
|
|
207
|
+
manual: r.manual,
|
|
208
|
+
defaultCurrent: r.pagination ? r.pagination.defaultCurrent : void 0,
|
|
209
|
+
defaultPageSize: r.pagination ? r.pagination.defaultPageSize : void 0,
|
|
210
|
+
formatParams: r.beforeSearchSubmit
|
|
211
|
+
}), q = d(() => {
|
|
212
|
+
if (r.scroll)
|
|
213
|
+
return r.scroll;
|
|
214
|
+
if (r.adaptive && C.value.total > 0)
|
|
215
|
+
return {
|
|
216
|
+
y: l(W)
|
|
217
|
+
};
|
|
218
|
+
}), H = d(() => ({
|
|
219
|
+
...r,
|
|
220
|
+
...l(f),
|
|
221
|
+
loading: fe(r.loading) ? l(f).loading : r.loading,
|
|
222
|
+
pagination: r.pagination === !1 ? !1 : l(f).pagination,
|
|
223
|
+
scroll: l(q)
|
|
224
|
+
})), K = d(() => [r.card ? null : c("wrapper"), r.adaptive ? c("adaptive") : null].filter(Boolean));
|
|
225
|
+
function $(e, t, a) {
|
|
226
|
+
return O.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(ne.Text, {
|
|
211
227
|
copyable: e.copyable ? {
|
|
212
228
|
text: t,
|
|
213
229
|
tooltip: !1
|
|
@@ -218,76 +234,82 @@ const Ce = {
|
|
|
218
234
|
content: a
|
|
219
235
|
}, null) : a;
|
|
220
236
|
}
|
|
221
|
-
|
|
237
|
+
Z(() => l(C).loading, (e) => {
|
|
222
238
|
var t;
|
|
223
|
-
(t =
|
|
239
|
+
(t = r.onLoadingChange) == null || t.call(r, e);
|
|
224
240
|
});
|
|
225
|
-
function
|
|
241
|
+
function G(e) {
|
|
226
242
|
var t, a, o;
|
|
227
243
|
(o = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || o.call(a, e);
|
|
228
244
|
}
|
|
229
|
-
function
|
|
245
|
+
function Q() {
|
|
230
246
|
var e, t, a;
|
|
231
247
|
return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
232
248
|
}
|
|
233
|
-
return
|
|
234
|
-
submit: () =>
|
|
235
|
-
reset: () =>
|
|
236
|
-
setSearchFormValues:
|
|
237
|
-
getSearchFormValues:
|
|
238
|
-
dataSource: d(() =>
|
|
239
|
-
}), (e, t) => (
|
|
240
|
-
class:
|
|
241
|
-
}, [e.searchForm !== !1 &&
|
|
249
|
+
return V({
|
|
250
|
+
submit: () => w(),
|
|
251
|
+
reset: () => T(),
|
|
252
|
+
setSearchFormValues: G,
|
|
253
|
+
getSearchFormValues: Q,
|
|
254
|
+
dataSource: d(() => l(C).records)
|
|
255
|
+
}), (e, t) => (i(), g("div", {
|
|
256
|
+
class: F(K.value)
|
|
257
|
+
}, [e.searchForm !== !1 && x.value.length > 0 ? (i(), g("div", {
|
|
242
258
|
key: 0,
|
|
243
|
-
class:
|
|
244
|
-
style:
|
|
245
|
-
}, [s(
|
|
259
|
+
class: F(e.card ? l(y)("search-wrapper") : null),
|
|
260
|
+
style: v(e.searchFormWrapperStyle)
|
|
261
|
+
}, [s(l(ue).SearchForm, m(e.searchForm || {}, {
|
|
246
262
|
ref_key: "formRef",
|
|
247
263
|
ref: b,
|
|
248
264
|
"custom-reset": "",
|
|
249
|
-
onSubmit:
|
|
250
|
-
onReset:
|
|
251
|
-
"submit-loading":
|
|
252
|
-
}), {
|
|
253
|
-
default:
|
|
265
|
+
onSubmit: l(w),
|
|
266
|
+
onReset: l(T),
|
|
267
|
+
"submit-loading": l(f).loading
|
|
268
|
+
}), P({
|
|
269
|
+
default: p(() => [(i(!0), g(ee, null, I(x.value, (a) => (i(), ae(te(a.customRenderFormItem ? a.customRenderFormItem(a) : l(pe)[a.valueType || "text"]), m({
|
|
254
270
|
key: a.dataIndex,
|
|
255
271
|
ref_for: !0
|
|
256
272
|
}, a.fieldProps || {}, {
|
|
257
273
|
span: a.span
|
|
258
274
|
}), null, 16, ["span"]))), 128))]),
|
|
259
|
-
_:
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
275
|
+
_: 2
|
|
276
|
+
}, [R.searchFormExtra ? {
|
|
277
|
+
name: "extra",
|
|
278
|
+
fn: p(() => [S(e.$slots, "searchFormExtra")]),
|
|
279
|
+
key: "0"
|
|
280
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : k("", !0), E("div", {
|
|
281
|
+
ref_key: "contentRef",
|
|
282
|
+
ref: _,
|
|
283
|
+
class: F([l(y)("table-wrapper"), e.card ? l(y)("table-wrapper-card") : null]),
|
|
284
|
+
style: v(e.tableWrapperStyle)
|
|
285
|
+
}, [S(e.$slots, "title"), s(l(de), m({
|
|
286
|
+
class: l(D) === "admin" ? l(c)("table-admin") : l(c)("table")
|
|
287
|
+
}, H.value, {
|
|
288
|
+
onChange: l(M),
|
|
289
|
+
columns: h.value
|
|
290
|
+
}), P({
|
|
291
|
+
headerCell: p(({
|
|
270
292
|
column: a,
|
|
271
293
|
title: o
|
|
272
|
-
}) => [a.tooltip ? (
|
|
294
|
+
}) => [a.tooltip ? (i(), g("span", Be, [E("span", null, oe(o), 1), s(l(se), {
|
|
273
295
|
title: a.tooltip,
|
|
274
296
|
placement: "bottom"
|
|
275
297
|
}, {
|
|
276
|
-
default:
|
|
298
|
+
default: p(() => [s(l(ge), {
|
|
277
299
|
style: {
|
|
278
300
|
color: "#0070ff",
|
|
279
301
|
"padding-left": "4px"
|
|
280
302
|
}
|
|
281
303
|
})]),
|
|
282
304
|
_: 2
|
|
283
|
-
}, 1032, ["title"])])) :
|
|
305
|
+
}, 1032, ["title"])])) : k("", !0)]),
|
|
284
306
|
_: 2
|
|
285
|
-
}, [
|
|
307
|
+
}, [I(l(me)(R, ["title", "searchFormExtra"]), (a, o) => ({
|
|
286
308
|
name: o,
|
|
287
|
-
fn:
|
|
309
|
+
fn: p((n) => [S(e.$slots, o, re(le(n || {})))])
|
|
288
310
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
289
311
|
}
|
|
290
312
|
});
|
|
291
313
|
export {
|
|
292
|
-
|
|
314
|
+
Ae as default
|
|
293
315
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
export type TableContentHeightOptions = {
|
|
3
|
+
offset?: number;
|
|
4
|
+
};
|
|
5
|
+
declare const useTableContentHeight: (options?: TableContentHeightOptions) => {
|
|
6
|
+
contentRef: Ref<HTMLDivElement | undefined>;
|
|
7
|
+
height: ComputedRef<number>;
|
|
8
|
+
};
|
|
9
|
+
export default useTableContentHeight;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useElementSize as d } from "@vueuse/core";
|
|
2
|
+
import { ref as g, computed as H, unref as l, onUpdated as S } from "vue";
|
|
3
|
+
function f(t) {
|
|
4
|
+
if (!t)
|
|
5
|
+
return 0;
|
|
6
|
+
const e = parseFloat(t);
|
|
7
|
+
return Number.isNaN(e) ? 0 : e;
|
|
8
|
+
}
|
|
9
|
+
function h(t) {
|
|
10
|
+
if (!t)
|
|
11
|
+
return 0;
|
|
12
|
+
const e = getComputedStyle(t);
|
|
13
|
+
return t.clientHeight + f(e.marginTop) + f(e.marginBottom);
|
|
14
|
+
}
|
|
15
|
+
const v = (t) => {
|
|
16
|
+
const e = g(), { height: s } = d(e), a = g();
|
|
17
|
+
let i = !1;
|
|
18
|
+
const m = H(() => {
|
|
19
|
+
var o, u, c;
|
|
20
|
+
const r = ((u = (o = e.value) == null ? void 0 : o.querySelector(".ant-table-header")) == null ? void 0 : u.clientHeight) || 47, n = (c = e.value) == null ? void 0 : c.querySelector(".ant-pagination"), p = n ? h(n) : l(a);
|
|
21
|
+
return n && (i = !0), Math.ceil(
|
|
22
|
+
l(s) - r - (p || 0) - ((t == null ? void 0 : t.offset) || 0)
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
return S(() => {
|
|
26
|
+
var n;
|
|
27
|
+
if (i)
|
|
28
|
+
return;
|
|
29
|
+
const r = (n = e.value) == null ? void 0 : n.querySelector(".ant-pagination");
|
|
30
|
+
if (!r) {
|
|
31
|
+
a.value = 0;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
a.value = h(r), i = !0;
|
|
35
|
+
}), { contentRef: e, height: m };
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
v as default
|
|
39
|
+
};
|
|
@@ -62,7 +62,7 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters'>
|
|
|
62
62
|
multiple?: number;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = ExtraProColumnType<
|
|
65
|
+
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = ExtraProColumnType<RecordType> & {
|
|
66
66
|
children?: ApColumnType<any, RecordType>[];
|
|
67
67
|
/**
|
|
68
68
|
* 表单项所占据的格子数(1-24格)
|
|
@@ -199,6 +199,10 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
199
199
|
* 表格尺寸(只支持中等大小和小尺寸)
|
|
200
200
|
*/
|
|
201
201
|
size?: 'middle' | 'small';
|
|
202
|
+
/**
|
|
203
|
+
* 表格是否自适应高度
|
|
204
|
+
*/
|
|
205
|
+
adaptive?: boolean;
|
|
202
206
|
};
|
|
203
207
|
export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
204
208
|
/**
|
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
padding: 16px;
|
|
3
3
|
background-color: #fff;
|
|
4
4
|
}
|
|
5
|
+
.aplus-ap-table-adaptive {
|
|
6
|
+
height: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
.aplus-ap-table-adaptive .ant-table-wrapper,
|
|
11
|
+
.aplus-ap-table-adaptive .ant-spin-nested-loading,
|
|
12
|
+
.aplus-ap-table-adaptive .ant-spin-container {
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
.aplus-ap-table-adaptive .ant-spin-container {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
.aplus-ap-table-adaptive .ant-table {
|
|
20
|
+
flex: 1;
|
|
21
|
+
}
|
|
22
|
+
.aplus-ap-table-adaptive .ant-table-container,
|
|
23
|
+
.aplus-ap-table-adaptive .ant-table-content {
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
.aplus-ap-table-adaptive .ant-table-content > table {
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
5
29
|
.aplus-ap-table__search-wrapper {
|
|
6
30
|
padding: 16px;
|
|
7
31
|
padding-bottom: 0;
|
|
@@ -9,8 +33,12 @@
|
|
|
9
33
|
margin-bottom: 16px;
|
|
10
34
|
}
|
|
11
35
|
.aplus-ap-table__table-wrapper {
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
.aplus-ap-table__table-wrapper-card {
|
|
12
39
|
padding: 16px;
|
|
13
40
|
background-color: #fff;
|
|
41
|
+
overflow: hidden;
|
|
14
42
|
}
|
|
15
43
|
.aplus-ap-table-table .ant-pagination {
|
|
16
44
|
margin-bottom: 0 !important;
|