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';
|
import ViewFactory from '@/components/views';
|
||||||
|
|
||||||
export function Update(props) {
|
export function Update(props) {
|
||||||
console.log(props);
|
|
||||||
const { title, viewName, resourceName, collection_name } = props.schema;
|
const { title, viewName, resourceName, collection_name } = props.schema;
|
||||||
const { activeTab = {}, item = {} } = props;
|
const { resourceKey, activeTab = {}, item = {} } = props;
|
||||||
const { association } = activeTab;
|
const { association } = activeTab;
|
||||||
|
|
||||||
const params = {};
|
const params = {};
|
||||||
@ -16,9 +15,8 @@ export function Update(props) {
|
|||||||
params['associatedKey'] = item.itemId;
|
params['associatedKey'] = item.itemId;
|
||||||
} else {
|
} else {
|
||||||
params['resourceName'] = collection_name;
|
params['resourceName'] = collection_name;
|
||||||
params['resourceKey'] = item.itemId;
|
params['resourceKey'] = item.itemId || resourceKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
const drawerRef = useRef<any>();
|
const drawerRef = useRef<any>();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -31,7 +29,7 @@ export function Update(props) {
|
|||||||
/>
|
/>
|
||||||
<Button type={'primary'} onClick={() => {
|
<Button type={'primary'} onClick={() => {
|
||||||
drawerRef.current.setVisible(true);
|
drawerRef.current.setVisible(true);
|
||||||
drawerRef.current.getData(item.itemId);
|
drawerRef.current.getData(item.itemId || resourceKey);
|
||||||
}}>{title}</Button>
|
}}>{title}</Button>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -91,7 +91,7 @@ function DrawerSelectComponent(props) {
|
|||||||
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
|
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
|
||||||
}}
|
}}
|
||||||
// associatedKey={}
|
// associatedKey={}
|
||||||
associatedName={associatedName}
|
// associatedName={associatedName}
|
||||||
viewName={'table'}
|
viewName={'table'}
|
||||||
/>
|
/>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
Loading…
Reference in New Issue
Block a user