import React, { useMemo } from 'react';
import { Menu, Dropdown, } from 'antd';
import { current_main_site_url,main_web_site_url} from '../../static';

import './index.scss';

const { SubMenu } = Menu;

export default props => {

  const projectMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${current_main_site_url}/admins`}>项目管理后台</a></Menu.Item>
    </Menu>
  });

  const taskMenu = useMemo(() => {
    return <Menu>
      <SubMenu title="基础数据" >
        <Menu.Item><a href={`${main_web_site_url}/admin/categories/list`}>任务领域</a></Menu.Item>
        <Menu.Item><a href={`${main_web_site_url}/admin/industries/list`}>行业信息</a></Menu.Item>
        <Menu.Item><a href={`${main_web_site_url}/admin/placements/list`}>职位信息</a></Menu.Item>
        <Menu.Item><a href={`${main_web_site_url}/admin/task_templates/list`}>需求导入模板</a></Menu.Item>
        <Menu.Item><a href={`${main_web_site_url}/admin/agreement_setting`}>签订协议内容</a></Menu.Item>
        <Menu.Item><a href={`${main_web_site_url}/admin/sign_agreement_setting`}>应征投稿协议内容</a></Menu.Item>
      </SubMenu>
      <SubMenu title="代办事项" >
        <Menu.Item><a href={`/task/delayManage`}>延期任务处理</a></Menu.Item>
        {/* <Menu.Item><a href={`${main_web_site_url}/admin/audit_files`}>协议签订凭证上传</a></Menu.Item> */}
        <Menu.Item><a href="/task/payProof">支付报酬凭证上传</a></Menu.Item>
      </SubMenu>

      <Menu.Item><a href="/task/taskAdmin">任务列表</a></Menu.Item>
      <Menu.Item><a href="/task/paperManage">创意征集评论</a></Menu.Item>
    </Menu>
  });

  const competitionMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/competitions/list`}>竞赛列表</a></Menu.Item>
    </Menu>
  });

  const userMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/users`}>用户列表</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/entities`}>主体信息列表</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/users_trial`}>试用授权列表</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/auto_users_trial`}>自动授权列表</a></Menu.Item>
    </Menu>
  });

  const forumMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/messages_list`}>帖子</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/apply_destroy_memos`}>申请删帖</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/memo_reply_list`}>回复</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/forum_sections`}>版块配置</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/banned_users`}>禁言列表</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/forum_applies`}>版主审批</a></Menu.Item>
    </Menu>
  });


  const checkMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/enterprise_authentication`}>企业认证</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/reviews/projects_list`}>开源项目</a></Menu.Item>
      <Menu.Item><a href="/task/taskManage/1">统筹任务发布审批</a></Menu.Item>
      <Menu.Item><a href="/task/taskManage/0">自主任务发布审批</a></Menu.Item>
      <Menu.Item><a href="/task/paperComplain">成果上传申诉审批</a></Menu.Item>
      <Menu.Item><a href="/task/publicityComplain">公示期成果申诉审批</a></Menu.Item>
      <Menu.Item><a href="/task/agreementManage">协议审批</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/tasks/report_result_tasks`}>成果举报申诉</a></Menu.Item>
      <Menu.Item><a href="/task/proofManage">评选佐证材料</a></Menu.Item>
    </Menu>
  });


  const limitsMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/user_admin_roles`}>权限组配置</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/admin_role_permissions`}>权限操作配置</a></Menu.Item>
    </Menu>
  });


  const configMenu = useMemo(() => {
    return <Menu>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/about_infos/new"`}>关于我们</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/home_sections"`}>首页版块</a></Menu.Item>
      <Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/partners`}>合作伙伴</a></Menu.Item>
    </Menu>
  });


  return (
    <div className="centerbox managements_menus clearfix">
      <Dropdown key={'projectMenu'}  overlay={projectMenu} placement="bottomLeft">
        <div className="drop-div">
            项目
        </div>
      </Dropdown>

      <Dropdown key={'taskMenu'} overlay={taskMenu} placement="bottomLeft">
        <div className="drop-div">
          创客
        </div>
      </Dropdown>

      <Dropdown key={'competitionMenu'} overlay={competitionMenu} placement="bottomLeft">
        <div className="drop-div">竞赛</div>
      </Dropdown>

      <Dropdown key={'userMenu'} overlay={userMenu} placement="bottomLeft">
        <div className="drop-div">用户</div>
      </Dropdown>

      <Dropdown key={'forumMenu'} overlay={forumMenu} placement="bottomLeft">
        <div className="drop-div">论坛交流</div>
      </Dropdown>

      <Dropdown key={'checkMenu'} overlay={checkMenu} placement="bottomLeft">
        <div className="drop-div">审批</div>
      </Dropdown>

      <Dropdown key={'limitsMenu'} overlay={limitsMenu} placement="bottomLeft">
        <div className="drop-div">权限管理</div>
      </Dropdown>

      <Dropdown key={'configMenu'} overlay={configMenu} placement="bottomLeft">
        <div className="drop-div">网站配置</div>
      </Dropdown>
    </div>
  )
}