@vue-ui-kit/ant 2.2.0 → 2.2.2
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/package.json
CHANGED
|
@@ -117,7 +117,14 @@ export interface GroupMenuItem<F extends Recordable = Recordable> {
|
|
|
117
117
|
export interface PFormGroupProps<F extends Recordable = Recordable> {
|
|
118
118
|
getFormSetting: (data: Partial<F>) => PFormProps<Partial<F>>;
|
|
119
119
|
title?: string;
|
|
120
|
-
tabLabel?: string
|
|
120
|
+
tabLabel?: string;
|
|
121
|
+
/**
|
|
122
|
+
* 获取完整标签页标签
|
|
123
|
+
* @param data 数据
|
|
124
|
+
* @param idx 实际索引
|
|
125
|
+
* @returns 标签页标签
|
|
126
|
+
*/
|
|
127
|
+
getTabLabel?: (data: Partial<F>, idx: number) => string;
|
|
121
128
|
editAble?: boolean;
|
|
122
129
|
showAdd?: boolean;
|
|
123
130
|
/* 是否启用折叠 */
|
|
@@ -73,8 +73,11 @@
|
|
|
73
73
|
blockInstance.value[activeKey.value]?.$form?.validate();
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const calculateTabLabel = (data: Partial<F>, idx: number) => {
|
|
77
|
+
return (
|
|
78
|
+
props.getTabLabel?.(data, idx) ??
|
|
79
|
+
`${props.tabLabel} ${props.keepSerial ? idx + 1 : (data.__index ?? 0) + 1}`
|
|
80
|
+
);
|
|
78
81
|
};
|
|
79
82
|
watch(
|
|
80
83
|
() => model.value,
|
|
@@ -283,7 +286,7 @@
|
|
|
283
286
|
<a-tab-pane
|
|
284
287
|
v-for="(item, idx) in model"
|
|
285
288
|
:key="idx"
|
|
286
|
-
:tab="
|
|
289
|
+
:tab="calculateTabLabel(item, idx)"
|
|
287
290
|
:force-render="fr"
|
|
288
291
|
>
|
|
289
292
|
<template #closeIcon>
|
|
@@ -35,6 +35,7 @@ interface BtnOptions extends ButtonProps {
|
|
|
35
35
|
dropdowns?: BtnOptions[];
|
|
36
36
|
clickEvt?: (p: RenderTableParams) => any;
|
|
37
37
|
hiddenIf?: (p: RenderTableParams) => boolean;
|
|
38
|
+
getProps?: (p: RenderTableParams) => Partial<ButtonProps>;
|
|
38
39
|
}
|
|
39
40
|
export interface RenderWorkshop {
|
|
40
41
|
renderItemContent?: (
|
|
@@ -234,8 +235,10 @@ const renderBtn = (
|
|
|
234
235
|
'icon',
|
|
235
236
|
'clickEvt',
|
|
236
237
|
'dropdowns',
|
|
238
|
+
'getProps',
|
|
237
239
|
])}
|
|
238
240
|
icon={btnOpt.icon ? <Icon icon={btnOpt.icon} /> : <Icon icon="DownOutlined" />}
|
|
241
|
+
{...(btnOpt.getProps?.(params) ?? {})}
|
|
239
242
|
>
|
|
240
243
|
{btnOpt.content || (btnOpt?.getContent?.(params) ?? '')}
|
|
241
244
|
</Button>
|
|
@@ -259,9 +262,11 @@ const renderBtn = (
|
|
|
259
262
|
'icon',
|
|
260
263
|
'clickEvt',
|
|
261
264
|
'dropdowns',
|
|
265
|
+
'getProps',
|
|
262
266
|
])}
|
|
263
267
|
disabled={(!!btnOpt.dropdowns && btnOpt.dropdowns.length > 0) || btnOpt.disabled}
|
|
264
268
|
icon={btnOpt.icon ? <Icon icon={btnOpt.icon} /> : null}
|
|
269
|
+
{...(btnOpt.getProps?.(params) ?? {})}
|
|
265
270
|
onClick={() => {
|
|
266
271
|
if (btnOpt?.clickEvt) {
|
|
267
272
|
btnOpt.clickEvt(params);
|