mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:18:03 +00:00
fix the issue of the edit button(update action) on the linkTo data detail page
This commit is contained in:
parent
122796d11f
commit
e6dfcf8418
@ -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>
|
||||
</>
|
||||
)
|
||||
|
@ -91,7 +91,7 @@ function DrawerSelectComponent(props) {
|
||||
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
|
||||
}}
|
||||
// associatedKey={}
|
||||
associatedName={associatedName}
|
||||
// associatedName={associatedName}
|
||||
viewName={'table'}
|
||||
/>
|
||||
</Drawer>
|
||||
|
Loading…
Reference in New Issue
Block a user