import Mock from 'mockjs'

const body = Mock.mock({
  userId: "@id",
  guid: "@id",
  userName: "@cname",
  depId: "@integer(300, 5000)",
  insId: "1",
  depName: "@sentence(10, 20)",
  token: "7b791ef980964a1fa22f8cba0c68913810001006204e83d2732ecd65",
  depPathUrl: "技术平台/金财互联",
  phone: "13632352279",
  createDate: '@integer(300, 5000)'
})

export default [{
  url: '/org/back/userService/loginExt',
  type: 'post',
  response: (req, res, next) => {
    return {
      body,
      head: {
        errorCode: '0',
        data: null
      }
    }
  }
}, {
  url: '/org/back/userService/logout',
  type: 'post',
  response: (req, res, next) => {
    return {
      head: Mock.mock({
        requestId: "ff0c339b211b9a84a69c0ad75f28cf09",
        errorCode: "100100000018",
        errorMsg: " 用户未登录或登录已超时",
        timestamp: 1585749417035,
        time: 98,
        gtime: 126,
      })
    }
  }
}, {
  url: '/org/back/functionService/querySecFunctionNav',
  type: 'post',
  response: (req, res, next) => {
    return {
      head: {
        requestId: 'af7e6d910532539f10a1a77c93b2d89d',
        errorCode: '0',
        timestamp: 1585749417035,
        time: 98,
        gtime: 126
      },
      body: [{
        functioinId: "home-0",
        name: "home",
        functionType: "menu",
        url: "home",
        parentId: "1",
        imageUrl: "home",
        subNodeFlag: "0",
      }, {
        functioinId: "org-0",
        name: "机构管理",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "layout",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "org-0-1",
          name: "用户部门管理",
          functionType: "menu",
          url: "admin-organization-page-departmentManager",
          parentId: "org-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "org-0-2",
          name: "机构管理",
          functionType: "menu",
          url: "open-portal-base-org-list",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "org-0-3",
          name: "菜单管理",
          functionType: "menu",
          url: "admin-organization-page-menuManager",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "org-0-4",
          name: "角色管理",
          functionType: "menu",
          url: "open-portal-base-role-list",
          parentId: "org-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "org-0-5",
          name: "岗位管理",
          functionType: "menu",
          url: "open-portal-base-post-list",
          parentId: "org-0",
          imageUrl: "",
          subNodeFlag: "0"
        }]
      }, {
        functioinId: "invoice-0",
        name: "发票管理",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "layout",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "invoice-0-1",
          name: "发票开具",
          functionType: "menu",
          url: "e-invoice-normal",
          parentId: "invoice-0",
          imageUrl: "",
          subNodeFlag: "0"
        }]
      }, {
        functioinId: "layout-0",
        name: "布局",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "layout",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "layout-0-1",
          name: "左右布局",
          functionType: "menu",
          url: "left-right",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "layout-0-2",
          name: "上下布局",
          functionType: "menu",
          url: "up-and-down",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "layout-0-3",
          name: "居中布局",
          functionType: "menu",
          url: "center",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "layout-0-4",
          name: "嵌套布局",
          functionType: "menu",
          url: "nesting",
          parentId: "layout-0",
          imageUrl: "",
          subNodeFlag: "0"
        }]
      }, {
        functioinId: "route-0",
        name: "路由使用",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "link",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "route-0-1",
          name: "传参",
          functionType: "menu",
          url: "route-params",
          parentId: "route-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "route-0-2",
          name: "获取路由参数",
          functionType: "menu",
          url: "route-get-params",
          parentId: "route-0",
          imageUrl: "",
          subNodeFlag: "0"
        }]
      }, {
        functioinId: "form-0",
        name: "form",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "form",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "form-0-1",
          name: "编辑/回显",
          functionType: "menu",
          url: "edit-show",
          parentId: "form-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "form-0-2",
          name: "折叠表单",
          functionType: "menu",
          url: "fold",
          parentId: "form-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "form-0-3",
          name: "分步表单",
          functionType: "menu",
          url: "step-form",
          parentId: "form-0",
          imageUrl: "",
          subNodeFlag: "0"
        }, {
          functioinId: "form-0-4",
          name: "表单验证（含异步验证）",
          functionType: "menu",
          url: "validate",
          parentId: "form-0",
          imageUrl: "",
          subNodeFlag: "0"
        }]
      }, {
        functioinId: "table-0",
        name: "tables",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "table",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "table-0-1",
          name: "固定表头和列",
          functionType: "menu",
          url: "fixed-column",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }, {
          functioinId: "table-0-2",
          name: "自适应列宽",
          functionType: "menu",
          url: "auto-width",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }, {
          functioinId: "table-0-3",
          name: "树形表格",
          functionType: "menu",
          url: "tree-table",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }, {
          functioinId: "table-0-4",
          name: "单元格合并",
          functionType: "menu",
          url: "merge-cell",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }, {
          functioinId: "table-0-5",
          name: "表头合并",
          functionType: "menu",
          url: "thead-group",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }, {
          functioinId: "table-0-6",
          name: "表格编辑",
          functionType: "menu",
          url: "edit-table",
          parentId: "table-0",
          imageUrl: "",
          subNodeFlag: "0",
        }]
      }, {
        functioinId: "tabs-0",
        name: "tabs",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "coffee",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "tabs-0-1",
          name: "普通使用",
          functionType: "menu",
          url: "default-tabs",
          parentId: "tabs-0",
          subNodeFlag: "0",
        }, {
          functioinId: "tabs-0-2",
          name: "新增和关闭",
          functionType: "menu",
          url: "add-and-close",
          parentId: "tabs-0",
          subNodeFlag: "0",
        }]
      }, {
        functioinId: "tree-0",
        name: "tree",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "ordered-list",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "tree-0-1",
          name: "普通使用",
          functionType: "menu",
          url: "default-tree",
          parentId: "tree-0",
          subNodeFlag: "0",
        }, {
          functioinId: "tree-0-4",
          name: "异步加载",
          functionType: "menu",
          url: "async-data",
          parentId: "tree-0",
          subNodeFlag: "0",
        }, {
          functioinId: "tree-0-5",
          name: "编辑和排序",
          functionType: "menu",
          url: "edit-and-sort",
          parentId: "tree-0",
          subNodeFlag: "0",
        }]
      }, {
        functioinId: "modal-0",
        name: "modal",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "credit-card",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "modal-0-1",
          name: "message",
          functionType: "menu",
          url: "message-demo",
          parentId: "modal-0",
          subNodeFlag: "0",
        }, {
          functioinId: "modal-0-2",
          name: "modal",
          functionType: "menu",
          url: "modal-demo",
          parentId: "modal-0",
          subNodeFlag: "0",
        }]
      }, {
        functioinId: "iframe-0",
        name: "iframe",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "inbox",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "iframe-0-1",
          name: "容器中打开iframe",
          functionType: "menu",
          url: "open-iframe",
          parentId: "iframe-0",
          subNodeFlag: "0",
          iframeUrl: "http://www.baidu.com"
        }, {
          functioinId: "iframe-0-2",
          name: "iframe和容器通信",
          functionType: "menu",
          url: "open-tab-in-iframe",
          parentId: "iframe-0",
          subNodeFlag: "0",
          iframeUrl: "/#/app-root/test-iframe",
        }]
      }, {
        functioinId: "chart-0",
        name: "chart",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "bar-chart",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "chart-0-1",
          name: "柱状图",
          functionType: "menu",
          url: "bar-chart",
          parentId: "chart-0",
          subNodeFlag: "0",
        },{
          functioinId: "chart-0-2",
          name: "折线图",
          functionType: "menu",
          url: "line-chart",
          parentId: "chart-0",
          subNodeFlag: "0",
        },{
          functioinId: "chart-0-3",
          name: "饼图",
          functionType: "menu",
          url: "pie-chart",
          parentId: "chart-0",
          subNodeFlag: "0",
        }]
      },{
        functioinId: "json-apps",
        name: "json-apps",
        functionType: "menu",
        url: "#",
        parentId: "1",
        imageUrl: "home",
        subNodeFlag: "1",
        childSecFunctioinDTOs: [{
          functioinId: "ttk-edf-app-portal-menu",
          name: "菜单预置",
          functionType: "menu",
          url: "ttk-edf-app-portal-menu",
          parentId: "jsonApps",
          subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-operation",
            name: "操作权限",
            functionType: "menu",
            url: "ttk-edf-app-operation",
            parentId: "jsonApps",
            subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-role-auth",
            name: "角色授权",
            functionType: "menu",
            url: "ttk-edf-app-role-auth",
            parentId: "jsonApps",
            subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-enum",
            name: "枚举预置",
            functionType: "menu",
            url: "ttk-edf-app-enum",
            parentId: "jsonApps",
            subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-column",
            name: "栏目预置",
            functionType: "menu",
            url: "ttk-edf-app-column",
            parentId: "jsonApps",
            subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-voucher",
            name: "单据预置",
            functionType: "menu",
            url: "ttk-edf-app-voucher",
            parentId: "jsonApps",
            subNodeFlag: "0",
        },{
            functioinId: "ttk-edf-app-iframe",
            name: "基础组件API",
            functionType: "menu",
            url: "ttk-edf-app-iframe?src=https://thethreekingdoms.github.io/ttk-component/",
            parentId: "jsonApps",
            subNodeFlag: "0",
        }]
      }]
    }
  }
}]
