@aplus-frontend/ui 0.0.20 → 0.0.21
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-form/hooks/use-watch.d.ts +2 -2
- package/es/src/ap-list/interface.d.ts +67 -0
- package/es/src/ap-list/style/index.css +6 -0
- package/es/src/ap-table/ap-table.vue.mjs +123 -113
- package/es/src/ap-table/interface.d.ts +6 -4
- package/es/src/ap-table/style/ap-table.css +19 -0
- package/es/src/ap-table/utils.d.ts +826 -670
- package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -25
- package/es/src/editable-table/hooks/use-get-columns.mjs +47 -45
- package/es/src/editable-table/interface.d.ts +6 -1
- package/es/src/editable-table/style/index.css +3 -0
- package/es/src/theme/ap-list/index.css +6 -0
- package/es/src/theme/ap-table/ap-table.css +19 -0
- package/es/src/theme/editable-table/index.css +3 -0
- package/lib/src/ap-form/hooks/use-watch.d.ts +2 -2
- package/lib/src/ap-list/interface.d.ts +67 -0
- package/lib/src/ap-list/style/index.css +6 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -4
- package/lib/src/ap-table/style/ap-table.css +19 -0
- package/lib/src/ap-table/utils.d.ts +826 -670
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -25
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/interface.d.ts +6 -1
- package/lib/src/editable-table/style/index.css +3 -0
- package/lib/src/theme/ap-list/index.css +6 -0
- package/lib/src/theme/ap-table/ap-table.css +19 -0
- package/lib/src/theme/editable-table/index.css +3 -0
- package/package.json +1 -1
|
@@ -2,6 +2,6 @@ import { NamePath } from 'ant-design-vue/es/form/interface';
|
|
|
2
2
|
import { ApFormExpose } from '../interface';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
|
|
5
|
-
type ApFormIns = ApFormExpose
|
|
6
|
-
declare const useWatch: <ValueType = any>(name: NamePath, form?: Ref<ApFormIns | undefined>) => Ref<ValueType | undefined>;
|
|
5
|
+
type ApFormIns<T> = ApFormExpose<T>;
|
|
6
|
+
declare const useWatch: <ValueType = any>(name: NamePath, form?: Ref<ApFormIns<ValueType> | undefined> | undefined) => Ref<ValueType | undefined>;
|
|
7
7
|
export default useWatch;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { RequestData } from '../ap-table';
|
|
3
|
+
import { Recordable } from '../type';
|
|
4
|
+
|
|
5
|
+
export type ApListProps<RecordType = any, ParamsType = Recordable> = {
|
|
6
|
+
/**
|
|
7
|
+
* 列表数据源,传入后`request`和`defaultData`都将失效
|
|
8
|
+
*/
|
|
9
|
+
dataSource?: RecordType[];
|
|
10
|
+
/**
|
|
11
|
+
* 是否是加载中
|
|
12
|
+
*/
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 当点击列表项时触发
|
|
16
|
+
* @deprecated 暂未实现
|
|
17
|
+
*/
|
|
18
|
+
onItem?: (record: RecordType, index: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* 依赖的额外的参数(该参数变更不会触发网络请求)
|
|
21
|
+
*/
|
|
22
|
+
params?: ParamsType;
|
|
23
|
+
/**
|
|
24
|
+
* 请求数据
|
|
25
|
+
* @param params
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
request?: (params: Partial<ParamsType> & {
|
|
29
|
+
pageSize?: number;
|
|
30
|
+
current?: number;
|
|
31
|
+
}) => Promise<Partial<RequestData<RecordType>>>;
|
|
32
|
+
/**
|
|
33
|
+
* 表格的默认数据源,这些数据源将会在第一次请求后被替换
|
|
34
|
+
*/
|
|
35
|
+
defaultData?: RecordType[];
|
|
36
|
+
/**
|
|
37
|
+
* 表格loading状态变更后触发
|
|
38
|
+
* @param loading
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
42
|
+
/**
|
|
43
|
+
* 查询表单提交之前,一般用于自定义对查询数据进行变更
|
|
44
|
+
* @param params
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
beforeSearchSubmit?: (params: Partial<ParamsType>) => any;
|
|
48
|
+
/**
|
|
49
|
+
* 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
|
|
50
|
+
*/
|
|
51
|
+
pagination?: false | {
|
|
52
|
+
defaultCurrent?: number;
|
|
53
|
+
defaultPageSize?: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 是否手动发起第一次网络请求
|
|
57
|
+
*/
|
|
58
|
+
manual?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* List容器的自定义样式
|
|
61
|
+
*/
|
|
62
|
+
containerStyle?: CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* 底部分页器容器的样式
|
|
65
|
+
*/
|
|
66
|
+
footerWarpperStyle?: CSSProperties;
|
|
67
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as x, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
|
|
2
|
+
import { Typography as ie, Table as pe, Tooltip as ce } from "ant-design-vue";
|
|
3
|
+
import { useToken as fe } from "ant-design-vue/es/theme/internal";
|
|
4
|
+
import { ApForm as me } from "../ap-form/index.mjs";
|
|
5
|
+
import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as z, apTableFormItemMap as ye } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { isUndefined as T,
|
|
7
|
+
import { useTablePaging as be } from "./hooks/use-table-paging.mjs";
|
|
8
|
+
import { omit as N, isUndefined as T, isBoolean as he } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
|
-
import { QuestionCircleOutlined as
|
|
11
|
-
import { apColumnToColumn as
|
|
12
|
-
import
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { useNamespace as
|
|
15
|
-
import { useGlobalConfig as
|
|
16
|
-
const
|
|
10
|
+
import { QuestionCircleOutlined as Ce } from "@ant-design/icons-vue";
|
|
11
|
+
import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as V, updateFormProps as xe, getFieldProps as Te, getPlaceholder as we } from "./utils.mjs";
|
|
12
|
+
import Be from "./hooks/use-table-content-height.mjs";
|
|
13
|
+
import { useLocale as Pe } from "../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useNamespace as ve } from "../config-provider/hooks/use-namespace.mjs";
|
|
15
|
+
import { useGlobalConfig as Ie } from "../config-provider/hooks/use-global-config.mjs";
|
|
16
|
+
const ke = {
|
|
17
17
|
key: 0
|
|
18
|
-
},
|
|
18
|
+
}, $e = /* @__PURE__ */ ae({
|
|
19
19
|
name: "ApTable",
|
|
20
20
|
__name: "ap-table",
|
|
21
21
|
props: {
|
|
@@ -129,150 +129,159 @@ const ve = {
|
|
|
129
129
|
default: !1
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
setup(
|
|
133
|
-
expose:
|
|
132
|
+
setup(D, {
|
|
133
|
+
expose: W
|
|
134
134
|
}) {
|
|
135
|
-
const
|
|
136
|
-
t:
|
|
137
|
-
} =
|
|
135
|
+
const o = D, w = te(), [, j] = fe(), {
|
|
136
|
+
t: _
|
|
137
|
+
} = Pe(), {
|
|
138
138
|
e: g,
|
|
139
139
|
b: u
|
|
140
|
-
} =
|
|
141
|
-
height:
|
|
142
|
-
contentRef:
|
|
143
|
-
} =
|
|
144
|
-
var
|
|
145
|
-
let e = ((
|
|
140
|
+
} = ve("ap-table"), A = Ie("uiMode", "aplus"), {
|
|
141
|
+
height: M,
|
|
142
|
+
contentRef: q
|
|
143
|
+
} = Be(), y = s(() => {
|
|
144
|
+
var t;
|
|
145
|
+
let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
146
146
|
return e = e.map((a) => ({
|
|
147
|
-
...
|
|
147
|
+
...N(Se(a), ["ellipsis"]),
|
|
148
148
|
customRender({
|
|
149
149
|
value: r,
|
|
150
|
-
...
|
|
150
|
+
...n
|
|
151
151
|
}) {
|
|
152
|
-
const C =
|
|
152
|
+
const C = Fe(a), I = ge[C], ee = Re(a, {
|
|
153
153
|
value: r,
|
|
154
|
-
...
|
|
154
|
+
...n
|
|
155
155
|
});
|
|
156
|
-
let S =
|
|
156
|
+
let S = X(a, r, d(I, f(ee, {
|
|
157
157
|
mode: "read"
|
|
158
158
|
}), null));
|
|
159
159
|
return a.customRender && (S = a.customRender({
|
|
160
160
|
value: r,
|
|
161
|
-
...
|
|
161
|
+
...n,
|
|
162
162
|
column: a,
|
|
163
163
|
originalNode: S
|
|
164
164
|
})), S;
|
|
165
165
|
}
|
|
166
166
|
})), e;
|
|
167
|
-
}), B =
|
|
168
|
-
var e,
|
|
169
|
-
return ((a = (
|
|
170
|
-
let C =
|
|
171
|
-
return
|
|
167
|
+
}), B = s(() => {
|
|
168
|
+
var e, t, a;
|
|
169
|
+
return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
|
|
170
|
+
let C = V(r.order);
|
|
171
|
+
return V(n.order) - C;
|
|
172
172
|
})) == null ? void 0 : a.map((r) => {
|
|
173
|
-
const
|
|
173
|
+
const n = xe(r, Te(r.fieldProps, {}));
|
|
174
174
|
return {
|
|
175
175
|
...r,
|
|
176
176
|
fieldProps: {
|
|
177
177
|
label: r.title,
|
|
178
178
|
name: r.dataIndex,
|
|
179
|
-
...
|
|
179
|
+
...n || {},
|
|
180
180
|
// 格式化placeholder
|
|
181
|
-
placeholder:
|
|
181
|
+
placeholder: we(_, r.valueType, n == null ? void 0 : n.placeholder)
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
})) || [];
|
|
185
|
-
}),
|
|
186
|
-
formRef:
|
|
185
|
+
}), H = s(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), K = s(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
186
|
+
formRef: b,
|
|
187
187
|
submit: P,
|
|
188
188
|
reset: v,
|
|
189
189
|
tableProps: c,
|
|
190
|
-
handleTableChange:
|
|
191
|
-
data:
|
|
192
|
-
} =
|
|
190
|
+
handleTableChange: $,
|
|
191
|
+
data: h
|
|
192
|
+
} = be({
|
|
193
193
|
async request(e) {
|
|
194
194
|
var a, r;
|
|
195
|
-
const
|
|
196
|
-
return (r =
|
|
197
|
-
data: (
|
|
198
|
-
total: (
|
|
195
|
+
const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
|
|
196
|
+
return (r = o.onLoad) == null || r.call(o, (t == null ? void 0 : t.data) || []), {
|
|
197
|
+
data: (t == null ? void 0 : t.data) || [],
|
|
198
|
+
total: (t == null ? void 0 : t.total) || 0
|
|
199
199
|
};
|
|
200
200
|
},
|
|
201
|
-
filterFields:
|
|
202
|
-
sortFields:
|
|
203
|
-
defaultParams:
|
|
204
|
-
defaultData:
|
|
205
|
-
manual:
|
|
206
|
-
defaultCurrent:
|
|
207
|
-
defaultPageSize:
|
|
208
|
-
formatParams:
|
|
209
|
-
}),
|
|
201
|
+
filterFields: l(K),
|
|
202
|
+
sortFields: l(H),
|
|
203
|
+
defaultParams: o.params,
|
|
204
|
+
defaultData: o.defaultData,
|
|
205
|
+
manual: o.manual,
|
|
206
|
+
defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
|
|
207
|
+
defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
|
|
208
|
+
formatParams: o.beforeSearchSubmit
|
|
209
|
+
}), G = s(() => {
|
|
210
210
|
var e;
|
|
211
|
-
return
|
|
212
|
-
y:
|
|
211
|
+
return o.scroll ? o.scroll : o.adaptive && (h.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
|
|
212
|
+
y: l(M),
|
|
213
213
|
x: "100%"
|
|
214
214
|
} : {
|
|
215
215
|
x: !0
|
|
216
216
|
};
|
|
217
|
-
}),
|
|
218
|
-
|
|
217
|
+
}), Q = s(() => {
|
|
218
|
+
var e;
|
|
219
|
+
if (o.tableLayout)
|
|
220
|
+
return o.tableLayout;
|
|
221
|
+
if ((e = o.columns) != null && e.some((t) => t.ellipsis))
|
|
222
|
+
return "fixed";
|
|
223
|
+
}), U = s(() => {
|
|
224
|
+
const e = l(c), t = T(o.dataSource) ? e : {
|
|
219
225
|
...e,
|
|
220
|
-
dataSource:
|
|
221
|
-
onChange:
|
|
226
|
+
dataSource: o.dataSource,
|
|
227
|
+
onChange: o.onChange
|
|
222
228
|
};
|
|
223
229
|
return {
|
|
224
|
-
...t,
|
|
225
230
|
...o,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
...t,
|
|
232
|
+
loading: T(o.loading) ? l(c).loading : o.loading,
|
|
233
|
+
pagination: o.pagination === !1 ? !1 : l(c).pagination,
|
|
234
|
+
scroll: l(G)
|
|
229
235
|
};
|
|
230
|
-
}),
|
|
231
|
-
function
|
|
232
|
-
return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ?
|
|
236
|
+
}), J = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
|
|
237
|
+
function X(e, t, a) {
|
|
238
|
+
return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
|
|
233
239
|
copyable: e.copyable ? {
|
|
234
|
-
text:
|
|
240
|
+
text: t,
|
|
235
241
|
tooltip: !1
|
|
236
242
|
} : !1,
|
|
237
|
-
ellipsis: e.ellipsis ? {
|
|
238
|
-
tooltip:
|
|
243
|
+
ellipsis: e.ellipsis ? he(e.ellipsis) ? {
|
|
244
|
+
tooltip: t
|
|
245
|
+
} : {
|
|
246
|
+
...e.ellipsis,
|
|
247
|
+
tooltip: t
|
|
239
248
|
} : !1,
|
|
240
|
-
content: a
|
|
249
|
+
content: e.ellipsis ? t : a
|
|
241
250
|
}, null) : a;
|
|
242
251
|
}
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
(
|
|
252
|
+
oe(() => l(h).loading, (e) => {
|
|
253
|
+
var t;
|
|
254
|
+
(t = o.onLoadingChange) == null || t.call(o, e);
|
|
246
255
|
});
|
|
247
|
-
function
|
|
248
|
-
var
|
|
249
|
-
(r = (a = (
|
|
256
|
+
function Y(e) {
|
|
257
|
+
var t, a, r;
|
|
258
|
+
(r = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
|
|
250
259
|
}
|
|
251
|
-
function
|
|
252
|
-
var e,
|
|
253
|
-
return (a = (
|
|
260
|
+
function Z() {
|
|
261
|
+
var e, t, a;
|
|
262
|
+
return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
254
263
|
}
|
|
255
|
-
return
|
|
264
|
+
return W({
|
|
256
265
|
submit: () => P(),
|
|
257
266
|
reset: () => v(),
|
|
258
|
-
setSearchFormValues:
|
|
259
|
-
getSearchFormValues:
|
|
260
|
-
dataSource:
|
|
261
|
-
}), (e,
|
|
262
|
-
class: F(
|
|
263
|
-
}, [
|
|
267
|
+
setSearchFormValues: Y,
|
|
268
|
+
getSearchFormValues: Z,
|
|
269
|
+
dataSource: s(() => l(h).records)
|
|
270
|
+
}), (e, t) => (i(), m("div", {
|
|
271
|
+
class: F(J.value)
|
|
272
|
+
}, [l(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
|
|
264
273
|
key: 0,
|
|
265
|
-
class: F(e.card ?
|
|
274
|
+
class: F(e.card ? l(g)("search-wrapper") : null),
|
|
266
275
|
style: R(e.searchFormWrapperStyle)
|
|
267
|
-
}, [
|
|
276
|
+
}, [d(l(me).SearchForm, f(e.searchForm || {}, {
|
|
268
277
|
ref_key: "formRef",
|
|
269
|
-
ref:
|
|
278
|
+
ref: b,
|
|
270
279
|
"custom-reset": "",
|
|
271
|
-
onSubmit:
|
|
272
|
-
onReset:
|
|
273
|
-
"submit-loading":
|
|
280
|
+
onSubmit: l(P),
|
|
281
|
+
onReset: l(v),
|
|
282
|
+
"submit-loading": l(c).loading
|
|
274
283
|
}), k({
|
|
275
|
-
default: p(() => [(i(!0),
|
|
284
|
+
default: p(() => [(i(!0), m(re, null, L(B.value, (a) => (i(), le(ne(a.customRenderFormItem ? a.customRenderFormItem(a) : l(ye)[a.valueType || "text"]), f({
|
|
276
285
|
key: a.dataIndex,
|
|
277
286
|
ref_for: !0
|
|
278
287
|
}, a.fieldProps || {}, {
|
|
@@ -283,39 +292,40 @@ const ve = {
|
|
|
283
292
|
name: "extra",
|
|
284
293
|
fn: p(() => [x(e.$slots, "searchFormExtra")]),
|
|
285
294
|
key: "0"
|
|
286
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
295
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : E("", !0), O("div", {
|
|
287
296
|
ref_key: "contentRef",
|
|
288
|
-
ref:
|
|
289
|
-
class: F([
|
|
297
|
+
ref: q,
|
|
298
|
+
class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
|
|
290
299
|
style: R(e.tableWrapperStyle)
|
|
291
|
-
}, [x(e.$slots, "title"),
|
|
292
|
-
class:
|
|
293
|
-
},
|
|
294
|
-
|
|
300
|
+
}, [x(e.$slots, "title"), d(l(pe), f({
|
|
301
|
+
class: l(A) === "admin" ? l(u)("table-admin") : l(u)("table")
|
|
302
|
+
}, U.value, {
|
|
303
|
+
"table-layout": Q.value,
|
|
304
|
+
onChange: l($),
|
|
295
305
|
columns: y.value
|
|
296
306
|
}), k({
|
|
297
307
|
headerCell: p(({
|
|
298
308
|
column: a,
|
|
299
309
|
title: r
|
|
300
|
-
}) => [a.tooltip ? (i(),
|
|
310
|
+
}) => [a.tooltip ? (i(), m("span", ke, [O("span", null, se(r), 1), d(l(ce), {
|
|
301
311
|
title: a.tooltip,
|
|
302
312
|
placement: "bottom"
|
|
303
313
|
}, {
|
|
304
|
-
default: p(() => [
|
|
314
|
+
default: p(() => [d(l(Ce), {
|
|
305
315
|
style: R({
|
|
306
316
|
paddingLeft: "4px",
|
|
307
|
-
color:
|
|
317
|
+
color: l(j).colorPrimary
|
|
308
318
|
})
|
|
309
319
|
}, null, 8, ["style"])]),
|
|
310
320
|
_: 2
|
|
311
|
-
}, 1032, ["title"])])) :
|
|
321
|
+
}, 1032, ["title"])])) : E("", !0)]),
|
|
312
322
|
_: 2
|
|
313
|
-
}, [
|
|
323
|
+
}, [L(l(N)(w, ["title", "searchFormExtra"]), (a, r) => ({
|
|
314
324
|
name: r,
|
|
315
|
-
fn: p((
|
|
316
|
-
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
325
|
+
fn: p((n) => [x(e.$slots, r, de(ue(n || {})))])
|
|
326
|
+
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
317
327
|
}
|
|
318
328
|
});
|
|
319
329
|
export {
|
|
320
|
-
|
|
330
|
+
$e as default
|
|
321
331
|
};
|
|
@@ -6,6 +6,7 @@ import { Recordable } from '../type';
|
|
|
6
6
|
import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
7
7
|
import { ApActionGroupProps } from '../ap-action';
|
|
8
8
|
import { ApTableIndexProps } from './components/interface';
|
|
9
|
+
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
9
10
|
|
|
10
11
|
export type ValueEnumType = {
|
|
11
12
|
text: string;
|
|
@@ -56,7 +57,7 @@ export type ApTableValueFields = {
|
|
|
56
57
|
};
|
|
57
58
|
export type ApTableValueTypes = keyof ApTableValueFields;
|
|
58
59
|
export type ValueEnum = Record<string, ValueEnumType>;
|
|
59
|
-
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' | 'customRender'> & {
|
|
60
|
+
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' | 'customRender' | 'ellipsis'> & {
|
|
60
61
|
sorter?: string | boolean | CompareFn<T> | {
|
|
61
62
|
compare?: CompareFn<T>;
|
|
62
63
|
/** Config multiple sorter order priority */
|
|
@@ -77,6 +78,10 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
77
78
|
* 是否可以复制
|
|
78
79
|
*/
|
|
79
80
|
copyable?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 是否省略自动溢出,自动溢出省略,为对象时可设置省略行数、是否可展开、添加后缀等
|
|
83
|
+
*/
|
|
84
|
+
ellipsis?: boolean | EllipsisConfig;
|
|
80
85
|
/**
|
|
81
86
|
* 是否搜索表单中隐藏
|
|
82
87
|
*/
|
|
@@ -248,6 +253,3 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
248
253
|
*/
|
|
249
254
|
dataSource: ComputedRef<RecordType>;
|
|
250
255
|
};
|
|
251
|
-
export type FixedApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = Omit<ApColumnType<RecordType, ValueType>, 'filters'> & {
|
|
252
|
-
filters?: ColumnType<RecordType>['filters'];
|
|
253
|
-
};
|
|
@@ -85,3 +85,22 @@
|
|
|
85
85
|
.aplus-ap-table .ant-table-small .ant-table-placeholder .ant-table-cell {
|
|
86
86
|
padding: 0 !important;
|
|
87
87
|
}
|
|
88
|
+
.aplus-ap-table .ant-table-column-sorters {
|
|
89
|
+
justify-content: unset;
|
|
90
|
+
}
|
|
91
|
+
.aplus-ap-table .ant-table-column-sorters .ant-table-column-title {
|
|
92
|
+
flex: unset;
|
|
93
|
+
}
|
|
94
|
+
.aplus-ap-table .ant-table-filter-column {
|
|
95
|
+
justify-content: unset;
|
|
96
|
+
}
|
|
97
|
+
.aplus-ap-table .ant-table-filter-column .ant-table-column-title {
|
|
98
|
+
flex: unset;
|
|
99
|
+
}
|
|
100
|
+
.aplus-ap-table .ant-table-filter-column .ant-table-filter-trigger {
|
|
101
|
+
margin-left: 2px;
|
|
102
|
+
padding-left: 2px;
|
|
103
|
+
}
|
|
104
|
+
.aplus-ap-table .ant-table-cell .ant-typography {
|
|
105
|
+
margin-bottom: 0;
|
|
106
|
+
}
|