【issues/8680】editComponentProps 可接受一个函数传入record

This commit is contained in:
JEECG
2025-08-19 14:03:51 +08:00
parent 1de07ff3ff
commit e002cd3bf3
2 changed files with 11 additions and 2 deletions

View File

@@ -100,7 +100,14 @@
});
const getComponentProps = computed(() => {
const compProps = props.column?.editComponentProps ?? {};
let compProps;
// update-begin--author:liaozhiyang---date:20250818---for【issues/8680】editComponentProps可接受一个函数传入record
if (isFunction(props.column?.editComponentProps)) {
compProps = props.column?.editComponentProps(props.record);
} else {
compProps = props.column?.editComponentProps ?? {};
}
// update-end--author:liaozhiyang---date:20250818---for【issues/8680】editComponentProps可接受一个函数传入record
const component = unref(getComponent);
const apiSelectProps: Recordable = {};
if (component === 'ApiSelect') {

View File

@@ -459,7 +459,9 @@ export interface BasicColumn extends ColumnProps<Recordable> {
editRow?: boolean;
editable?: boolean;
editComponent?: ComponentType;
editComponentProps?: Recordable;
// update-begin--author:liaozhiyang---date:20250818---for【issues/8680】editComponentProps可接受一个函数传入record
editComponentProps?: Recordable | ((record: Recordable) => Recordable);
// update-end--author:liaozhiyang---date:20250818---for【issues/8680】editComponentProps可接受一个函数传入record
editRule?: boolean | ((text: string, record: Recordable) => Promise<string>);
editValueMap?: (value: any) => string;
onEditRow?: () => void;