import request from '@/config/axios'

export const getTableListApi = (params: any) => {
  //return request.post({ url: '/export/spi/export/format/ExportFormatConfigQueryPage', params })
  const data: any = [
    {
      serviceName: '可信区表字段信息查询',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '台账查询接口',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '可信区操作日志查询',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '任务状态查询',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '重报申请查询服务',
      queryTableInfo: '实时数据查询',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '重报申请查询服务',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '任务完成确认',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '任务完成确认',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '任务完成确认',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    },
    {
      serviceName: '任务完成确认',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    }
  ]
  const data1: any = [
    {
      serviceName: '任务完成确认',
      serviceType: '联机服务',
      serviceVersion: 'v1.0',
      requestType: 'GET',
      requestDate: '20220308',
      requestTime: '20220308 09:09:16',
      responseDate: '20220308',
      responseTime: '20220308 09:13:16',
      responseState: '失败',
      responseMsg: '102 -- 查询对象不存在或者权限不足 400 -- 机构信息不一致 500 -- 机构端系统异常',
      useTime: ''
    }
  ]
  return {
    data: {
      list: params.pageNum === 1 ? data : data1,
      total: 11
    }
  }
}

export const getTreeTableListApi = (params: any) => {
  return request.get({ url: '/example/treeList', params })
}

export const delTableListApi = (pkid: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/export/spi/format/ExportFormatConfigDelete', data: { pkid } })
}
