import Mock from 'mockjs'
import { doCustomTimes } from '@/libs/util'
import orgData from './data/org-data'
import cityData from './data/city-data'
import routerData from './data/router-data'
import routerData1 from './data/router-xian-data'
import { treeData } from './data/tree-select'
import gridData from './data/grid-data'
const Random = Mock.Random

export const getTableData = req => {
  let tableData = []
  doCustomTimes(5, () => {
    tableData.push(Mock.mock({
      name: '<a>111</a>',
      email: '@email',
      createTime: '@date'
    }))
  })
  return tableData
}

export const getDragList = req => {
  let dragList = []
  doCustomTimes(5, () => {
    dragList.push(Mock.mock({
      name: Random.csentence(10, 13),
      id: Random.increment(10)
    }))
  })
  return dragList
}

export const uploadImage = req => {
  return Promise.resolve()
}

export const getOrgData = req => {
  return orgData
}

export const getTreeSelectData = req => {
  return treeData
}

export const getRouterData = req => {
  return routerData
}
export const getRouterXianData = req => {
  return routerData1
}
export const getCityData = req => {
  return cityData
}
export const getGridData = req => {
  return gridData
}
