fix the issue of the edit button(update action) on the linkTo data detail page

This commit is contained in:
chenos 2020-12-22 21:16:54 +08:00
parent 122796d11f
commit e6dfcf8418
2 changed files with 4 additions and 6 deletions

View File

@ -3,9 +3,8 @@ import { Button } from 'antd';
import ViewFactory from '@/components/views';
export function Update(props) {
console.log(props);
const { title, viewName, resourceName, collection_name } = props.schema;
const { activeTab = {}, item = {} } = props;
const { resourceKey, activeTab = {}, item = {} } = props;
const { association } = activeTab;
const params = {};
@ -16,9 +15,8 @@ export function Update(props) {
params['associatedKey'] = item.itemId;
} else {
params['resourceName'] = collection_name;
params['resourceKey'] = item.itemId;
params['resourceKey'] = item.itemId || resourceKey;
}
const drawerRef = useRef<any>();
return (
<>
@ -31,7 +29,7 @@ export function Update(props) {
/>
<Button type={'primary'} onClick={() => {
drawerRef.current.setVisible(true);
drawerRef.current.getData(item.itemId);
drawerRef.current.getData(item.itemId || resourceKey);
}}>{title}</Button>
</>
)

View File

@ -91,7 +91,7 @@ function DrawerSelectComponent(props) {
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
}}
// associatedKey={}
associatedName={associatedName}
// associatedName={associatedName}
viewName={'table'}
/>
</Drawer>