zmdms-webui 1.8.7 → 1.8.8
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.
|
@@ -228,7 +228,7 @@ interface IColumnType<RecordType> extends Omit<ColumnType<RecordType>, "render">
|
|
|
228
228
|
/**
|
|
229
229
|
* 添加角标
|
|
230
230
|
*/
|
|
231
|
-
badge?: IBadgeProps;
|
|
231
|
+
badge?: IBadgeProps | ((record: any) => IBadgeProps);
|
|
232
232
|
}
|
|
233
233
|
interface IRenderOptions {
|
|
234
234
|
insertTableFromClipboard: IFuncInsertTableFromClipboard;
|
|
@@ -302,7 +302,13 @@ function useColumns(columns, options) {
|
|
|
302
302
|
if (record[IS_SUMMARY]) {
|
|
303
303
|
return v;
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
var props = typeof _column.badge === "function"
|
|
306
|
+
? _column.badge(record)
|
|
307
|
+
: _column.badge;
|
|
308
|
+
if (!props) {
|
|
309
|
+
return v;
|
|
310
|
+
}
|
|
311
|
+
return jsx(Badge, __assign({}, props, { children: v }));
|
|
306
312
|
};
|
|
307
313
|
}
|
|
308
314
|
// 添加render字段,
|