Commit b9cb11e2 by zhaochengxiang

右键问题

parent 970b0635
......@@ -30,7 +30,7 @@
"less-loader": "^8.0.0",
"local-storage": "^2.0.0",
"react": "^17.0.1",
"react-contexify": "^5.0.0",
"react-contexify": "6.0.0",
"react-contextmenu": "2.14.0",
"react-data-grid": "7.0.0-beta.13",
"react-dnd": "^14.0.2",
......
......@@ -607,7 +607,8 @@ const AssetManageTree = (props) => {
}
const displayMenu = (e) => {
show(e, {
show({
event: e,
position: {
x: e.clientX + 30,
y: e.clientY - 10
......
......@@ -160,10 +160,8 @@ const DefineTable = (props) => {
setCheckedKeys(keys);
};
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === 'update') {
const handleItemClick = ({ id, event, props }) => {
if (id === 'update') {
setAction('update');
setIsTemplateModalVisible(true);
}
......@@ -211,7 +209,9 @@ const DefineTable = (props) => {
return {
onContextMenu: event => {
setCurrentTemplate(record);
show(event);
show({
event
})
},
};
}}
......
......@@ -291,7 +291,8 @@ const DefineTree = (props) => {
selectedKeys={selectedKeys}
onRightClick={({event, node}) => {
setRightSelectNode(node?.origin);
show(event, {
show({
event,
position: {
x: event.clientX + 30,
y: event.clientY - 10
......
......@@ -165,13 +165,11 @@ const ManageTable = (props) => {
setCheckedKeys(keys);
};
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === 'detail') {
const handleItemClick = ({ id, event, props }) => {
if (id === 'detail') {
setAction('detail');
setIsDataMasterModalVisible(true);
} if (key === 'update') {
} if (id === 'update') {
setAction('update');
setIsDataMasterModalVisible(true);
}
......@@ -230,7 +228,9 @@ const ManageTable = (props) => {
return {
onContextMenu: event => {
setCurrentData(record);
show(event);
show({
event
})
},
};
}}
......
......@@ -891,15 +891,15 @@ const ImportActionIndex = (props) => {
}
const displayMenu = (e) => {
show(e);
show({
event: e
})
}
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === 'up') {
const handleItemClick = ({ id, event, props }) => {
if (id === 'up') {
insertToFront(currentItem);
} else if (key === 'down') {
} else if (id === 'down') {
insertToBack(currentItem);
}
}
......
......@@ -1198,15 +1198,15 @@ export const ImportActionTable = (props) => {
}
const displayMenu = (e) => {
show(e);
show({
event: e
})
}
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === 'up') {
const handleItemClick = ({ id, event, props }) => {
if (id === 'up') {
insertToFront(currentItem);
} else if (key === 'down') {
} else if (id === 'down') {
insertToBack(currentItem);
}
}
......
......@@ -134,7 +134,7 @@ const ModelTable = (props) => {
const MENU_ID = (((modelId||'') !== '') ? `model-table-contextmenu-${modelId}` : 'model-table-contextmenu');
const { show } = useContextMenu({
const { show, hideAll } = useContextMenu({
id: MENU_ID,
});
......@@ -733,39 +733,39 @@ const ModelTable = (props) => {
}
const displayMenu = (e) => {
show(e);
show({
event: e
})
}
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === 'edit') {
const handleItemClick = ({ id, event, props }) => {
if (id === 'edit') {
editItem(currentItem);
} else if (key === 'delete') {
} else if (id === 'delete') {
deleteItem(currentItem);
} else if (key === 'sample') {
} else if (id === 'sample') {
setSampleParams({visible: true, service: currentItem})
} else if (key === 'history') {
} else if (id === 'history') {
historyItem(currentItem);
} else if (key === 'copy') {
} else if (id === 'copy') {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(view==='dir')?(catalogId||''):''}&${ModelerId}=${currentItem.id}`);
} else if (key === 'createTable') {
} else if (id === 'createTable') {
deployAction(currentItem);
} else if (key.indexOf('action') !== -1) {
const index = (key.split('-'))[1];
} else if (id.indexOf('action') !== -1) {
const index = (id.split('-'))[1];
const action = currentItem?.state?.supportedActions[index];
stateAction(currentItem, action);
} else if (key === 'admit') {
} else if (id === 'admit') {
app.openAdmit?.({ dirId: catalogId, service: currentItem })
} else if (key === 'enableOData') {
} else if (id === 'enableOData') {
startODataItem(currentItem);
} else if (key === 'disableOData') {
} else if (id === 'disableOData') {
disableODataItem(currentItem);
} else if (key === 'startFlow') {
} else if (id === 'startFlow') {
app.applyServer?.({ service: currentItem });
} else if (key === 'downloadTds') {
} else if (id === 'downloadTds') {
window.open(`/api/pdataservice/pdsCURD/genTDS?id=${currentItem?.id}`);
} else if (key === 'checkout') {
} else if (id === 'checkout') {
dispatch({
type: 'pds.checkoutService',
payload: {
......@@ -776,7 +776,7 @@ const ModelTable = (props) => {
onChange && onChange();
}
})
} else if (key === 'smart') {
} else if (id === 'smart') {
dispatch({
type: 'pds.getSmartBiUrl',
payload: {
......@@ -786,7 +786,7 @@ const ModelTable = (props) => {
window.open(data)
}
})
} else if (key === 'exchangeOwner') {
} else if (id === 'exchangeOwner') {
setExchangeOwnerParams({ visible: true, id: currentItem?.id });
}
}
......
......@@ -457,7 +457,8 @@ const ModelTree = (props) => {
};
const displayMenu = (e) => {
show(e, {
show({
event: e,
position: {
x: e.clientX + 30,
y: e.clientY - 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment