diff --git a/jeecgboot-vue3/src/components/Table/src/components/editable/EditableCell.vue b/jeecgboot-vue3/src/components/Table/src/components/editable/EditableCell.vue index 71cef02a6..7b0b4d1b6 100644 --- a/jeecgboot-vue3/src/components/Table/src/components/editable/EditableCell.vue +++ b/jeecgboot-vue3/src/components/Table/src/components/editable/EditableCell.vue @@ -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') { diff --git a/jeecgboot-vue3/src/components/Table/src/types/table.ts b/jeecgboot-vue3/src/components/Table/src/types/table.ts index 5fb6eafca..117d85257 100644 --- a/jeecgboot-vue3/src/components/Table/src/types/table.ts +++ b/jeecgboot-vue3/src/components/Table/src/types/table.ts @@ -459,7 +459,9 @@ export interface BasicColumn extends ColumnProps { 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); editValueMap?: (value: any) => string; onEditRow?: () => void;