Commit b9cb11e2 by zhaochengxiang

右键问题

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