export const algoData = [
  {
    id: 'recentlyUsed',
    name: '最近使用',
    isDir: true,
    children: [
      {
        id: 10,
        defSource: 2,
        docUrl: '',
        ioType: 0,
        up: 148,
        down: 11,
        iconType: 1,
        isDisabled: false,
        author: 'demo author',
        codeName: 'algo_1',
        catId: 1,
        lastModifyTime: '2020-08-25 15:43:39',
        createdTime: '2015-04-16 13:38:11',
        engineType: 0,
        isComposite: false,
        sequence: 0,
        owner: 'system',
        description: '组件描述信息',
        name: '算法组件1',
        parentId: 'recentlyUsed',
        isBranch: false,
        social: {
          defSource: 2,
          isEnabled: true,
          docUrl: '#',
          iconType: 1,
          isDisabled: false,
          author: 'demo author',
          codeName: 'algo_1',
          catId: 1,
          lastModifyTime: '2020-08-25 15:43:39',
          createdTime: '2015-04-16 13:38:11',
          owner: 'system',
          description: '组件描述信息',
          name: '算法组件1',
          id: 10,
        },
      },
      {
        id: 11,
        defSource: 2,
        docUrl: '',
        ioType: 0,
        up: 148,
        down: 11,
        iconType: 1,
        isDisabled: false,
        author: 'demo author',
        codeName: 'algo_2',
        catId: 1,
        lastModifyTime: '2020-08-25 15:43:39',
        createdTime: '2015-04-16 13:38:11',
        engineType: 0,
        isComposite: false,
        sequence: 0,
        owner: 'system',
        description: '组件描述信息',
        name: '算法组件2',
        parentId: 'recentlyUsed',
        isBranch: false,
        social: {
          defSource: 2,
          isEnabled: true,
          docUrl: '#',
          iconType: 1,
          isDisabled: false,
          author: 'demo author',
          codeName: 'algo_2',
          catId: 1,
          lastModifyTime: '2020-08-25 15:43:39',
          createdTime: '2015-04-16 13:38:11',
          owner: 'system',
          description: '组件描述信息',
          name: '算法组件2',
          id: 11,
        },
      },
      {
        id: 12,
        defSource: 2,
        docUrl: '',
        ioType: 0,
        up: 148,
        down: 11,
        iconType: 1,
        isDisabled: false,
        author: 'demo author',
        codeName: 'algo_3',
        catId: 1,
        lastModifyTime: '2020-08-25 15:43:39',
        createdTime: '2015-04-16 13:38:11',
        engineType: 0,
        isComposite: false,
        sequence: 0,
        owner: 'system',
        description: '组件描述信息',
        name: '算法组件3',
        parentId: 'recentlyUsed',
        isBranch: false,
        social: {
          defSource: 2,
          isEnabled: true,
          docUrl: '#',
          iconType: 1,
          isDisabled: false,
          author: 'demo author',
          codeName: 'algo_3',
          catId: 1,
          lastModifyTime: '2020-08-25 15:43:39',
          createdTime: '2015-04-16 13:38:11',
          owner: 'system',
          description: '组件描述信息',
          name: '算法组件3',
          id: 12,
        },
      },
    ],
  },
  {
    name: '数据读写',
    id: 21,
    category: 'source',
    isDir: true,
    children: [
      {
        defSource: 2,
        docUrl: '',
        ioType: 0,
        up: 148,
        down: 11,
        iconType: 1,
        isDisabled: false,
        author: 'demo author',
        codeName: 'odps_source',
        catId: 1,
        lastModifyTime: '2020-08-25 15:43:39',
        createdTime: '2015-04-16 13:38:11',
        engineType: 0,
        isComposite: false,
        sequence: 0,
        owner: 'system',
        description: '组件描述信息',
        name: '读数据表',
        id: 100,
        parentId: 'recentlyUsed',
        isBranch: false,
        social: {
          defSource: 2,
          isEnabled: true,
          docUrl: '#',
          iconType: 1,
          isDisabled: false,
          author: 'demo author',
          codeName: 'odps_source',
          catId: 1,
          lastModifyTime: '2020-08-25 15:43:39',
          createdTime: '2015-04-16 13:38:11',
          owner: 'system',
          description: '组件描述信息',
          name: '读数据表',
          id: 100,
        },
      },
    ],
    isBranch: true,
    isExpanded: false,
    codeName: 'source',
    parentId: 'platformAlgo',
  },
  {
    name: '统计分析',
    id: 22,
    category: 'analytics',
    isDir: true,
    children: [],
    isBranch: true,
    isExpanded: false,
    codeName: 'analytics',
    parentId: 'platformAlgo',
  },
  {
    name: '算法',
    id: 23,
    category: 'ai_algo',
    isDir: true,
    children: [],
    isBranch: true,
    isExpanded: false,
    codeName: 'algorithm',
    parentId: 'platformAlgo',
  },
  {
    name: '预测',
    id: 24,
    category: 'predict',
    isDir: true,
    children: [],
    isBranch: true,
    isExpanded: false,
    codeName: 'predict',
    parentId: 'platformAlgo',
  },
  {
    name: '评估',
    id: 25,
    category: 'evaluation',
    isDir: true,
    children: [],
    isBranch: true,
    isExpanded: false,
    codeName: 'evaluation',
    parentId: 'platformAlgo',
  },
]

export const searchByKeyword = async (keyword: string) => {
  return Array(10)
    .fill(null)
    .map((i, idx) => {
      return {
        defSource: 2,
        docUrl: '',
        ioType: 0,
        up: 148,
        down: 11,
        iconType: 1,
        isDir: false,
        isDisabled: false,
        author: 'demo author',
        codeName: `${keyword}${idx}`,
        catId: 1,
        lastModifyTime: '2020-08-25 15:43:39',
        createdTime: '2015-04-16 13:38:11',
        engineType: 0,
        isComposite: false,
        sequence: 0,
        owner: 'system',
        description: '组件描述信息',
        name: `${keyword}__${idx}`,
        id: idx,
        parentId: 'recentlyUsed',
        isBranch: false,
        social: {
          defSource: 2,
          isEnabled: true,
          docUrl: '#',
          iconType: 1,
          isDisabled: false,
          author: 'demo author',
          name: `${keyword}-${idx}`,
          codeName: `${keyword}${idx}`,
          catId: 1,
          lastModifyTime: '2020-08-25 15:43:39',
          createdTime: '2015-04-16 13:38:11',
          owner: 'system',
          description: '组件描述信息',
          id: idx,
        },
      }
    })
}
