Commit 2ff10eeb by zhaochengxiang

右键操作

parent 6e32fc0e
...@@ -407,21 +407,6 @@ const ModelTable = (props) => { ...@@ -407,21 +407,6 @@ const ModelTable = (props) => {
onItemAction && onItemAction(record, 'detail'); onItemAction && onItemAction(record, 'detail');
} }
const onMoreMenuClick = (e, record) => {
const { key } = e;
if (key === 'history') {
historyItem(record);
} else if (key === 'copy') {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(view==='dir')?(catalogId||''):''}&${ModelerId}=${record.id}`);
} else if (key === 'createTable') {
deployAction(record);
} else if (key.indexOf('action') !== -1) {
const index = (key.split('-'))[1];
const action = record.state?.supportedActions[index];
stateAction(record, action);
}
}
const deployAction = (record) => { const deployAction = (record) => {
onAutoCreateTable && onAutoCreateTable(record); onAutoCreateTable && onAutoCreateTable(record);
} }
...@@ -594,21 +579,22 @@ const ModelTable = (props) => { ...@@ -594,21 +579,22 @@ const ModelTable = (props) => {
} }
const handleItemClick = ({ event, props, data, triggerEvent }) => { const handleItemClick = ({ event, props, data, triggerEvent }) => {
switch (event.currentTarget.id) { const key = event.currentTarget.id;
case "edit":
if (key === 'edit') {
editItem(currentItem); editItem(currentItem);
break; } else if (key === 'delete') {
case "delete":
deleteItem(currentItem); deleteItem(currentItem);
break; } else if (key === 'history') {
case "history":
historyItem(currentItem); historyItem(currentItem);
break; } else if (key === 'copy') {
case "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}`);
break; } else if (key === 'createTable') {
default: deployAction(currentItem);
break; } else if (key.indexOf('action') !== -1) {
const index = (key.split('-'))[1];
const action = currentItem?.state?.supportedActions[index];
stateAction(currentItem, action);
} }
} }
...@@ -705,6 +691,21 @@ const ModelTable = (props) => { ...@@ -705,6 +691,21 @@ const ModelTable = (props) => {
<RcItem id="copy" onClick={handleItemClick}> <RcItem id="copy" onClick={handleItemClick}>
复制模型 复制模型
</RcItem> </RcItem>
{
(currentItem?.state?.supportedActions||[]).length>0 && currentItem?.state?.supportedActions.map((item, index) => {
return (
<RcItem id={`action-${index}`} onClick={handleItemClick}>
{item.cnName||''}
</RcItem>
);
})
}
{
currentItem?.deployable && <RcItem id='createTable' onClick={handleItemClick}>
建表
</RcItem>
}
</RcMenu> </RcMenu>
{ contextHolder } { contextHolder }
</div> </div>
......
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