import { observer } from "mobx-react";
import { observable, action, computed } from "mobx";
import { Icon } from 'antd';
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
export const RightMenu = observer(({ store, onToggleChildren,menus }) => {
const { left, top, visible, hasChild, childVisible, isRoot } = store;
// console.log(data);
return (
{hasChild && -
}
{/* {onBatchReject && hasChild && data && data.current && data.status != 2 && data.arrival && -
{getLabel('506005','批量退回')}
}
{onSetting && -
{getLabel('502283', '设置')}
}
{onAddChild && -
{getLabel('502284', '添加下级')}
}
{onDeleteChild && -
{getLabel('502285', '删除下级')}
}
{!isRoot && onDelete && -
{getLabel('502286', '删除')}
}
{onReject && data.status == 2 && data.parent && data.parent.current && data.parent.iscurrentnode == 1
&& data.parent.status != 2 && -
{getLabel('502287', '退回')}
}
{onSynchro && -
{getLabel('506099', '同步')}
} */}
{
menus.length > 0 && menus.map((obj)=>{
return - {obj.action(e)}}>
})
}
)
});
export class RightMenuStore {
@observable visible = false;
@observable left = 0;
@observable top = 0;
@observable isRoot = false;
@observable hasChild = false;
@observable childVisible = false;
@action show = (left, top, isRoot, hasChild, childVisible) => {
this.visible = true;
this.left = left;
this.top = top;
this.isRoot = isRoot;
this.hasChild = hasChild;
this.childVisible = childVisible;
}
@action hide = () => {
this.visible = false;
}
@action position = (left, top) => {
this.left = left;
this.top = top;
}
}