Commit 2ff10eeb by zhaochengxiang

右键操作

parent 6e32fc0e
......@@ -407,21 +407,6 @@ const ModelTable = (props) => {
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) => {
onAutoCreateTable && onAutoCreateTable(record);
}
......@@ -594,21 +579,22 @@ const ModelTable = (props) => {
}
const handleItemClick = ({ event, props, data, triggerEvent }) => {
switch (event.currentTarget.id) {
case "edit":
const key = event.currentTarget.id;
if (key === 'edit') {
editItem(currentItem);
break;
case "delete":
} else if (key === 'delete') {
deleteItem(currentItem);
break;
case "history":
} else if (key === 'history') {
historyItem(currentItem);
break;
case "copy":
} else if (key === 'copy') {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(view==='dir')?(catalogId||''):''}&${ModelerId}=${currentItem.id}`);
break;
default:
break;
} else if (key === 'createTable') {
deployAction(currentItem);
} 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) => {
<RcItem id="copy" onClick={handleItemClick}>
复制模型
</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>
{ contextHolder }
</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