import { request } from 'umi';
import type { AnalysisData } from './data';

export async function fakeChartData(): Promise<{ data: AnalysisData }> {
  return request('/api/fake_analysis_chart_data');
}



/** 获取考试列表 GET  /dsideal_yy/zygh/training/examination/getExaminationList */
// export async function queryExaminationList(
//   params: {
//     // query
//     /** 当前的页码 */
//     current?: number;
//     /** 页面的容量 */
//     pageSize?: number;
//   },
//   options?: Record<string, any>,
// ) {
//   return request<{
//     data: TableListItem[];
//     /** 列表的内容总数 */
//     total_row?: number;
//     /** 页面的容量 */
//     page_size?: number;
//     success?: boolean;
//   }>('/dsideal_yy/zygh/training/examination/getExaminationList', {
//     method: 'GET',
//     params: {
//       ...params,
//     },
//     ...(options || {}),
//   });
// }


/**
 * 获取省市区
 * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
 * @param params
 * @returns
 */
export async function getAsyncOrgTree(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/org/getAsyncOrgTree', {
    params,
  });
}


/**
 * 获取学校列表
 * /dsideal_yy/ypt/sys/org/getEduUnitList
 * @param params
 * @returns
 */
export async function getEduUnitList(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/sys/org/getEduUnitList', {
    params,
  });
}
/**
 * 市获取资质证书
 * /dsideal_yy/zygh/training/statistics/getCredentialPersonStatistics
 * @param params
 * @returns
 */
export async function getCredentialPersonStatistics(params: {
  province_id: { province_id: number };
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/statistics/getCredentialPersonStatistics', {
    params,
  });
}
/**
 * 市获取资质证书
 * /dsideal_yy/zygh/training/statistics/getCredentialPersonStatistics
 * @param params
 * @returns
 */
export async function getExaminationPersonStatistics(params: {
  page_number: number,
  page_size: number,
  sort_colum: number,
  sort_type: number,
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/statistics/getExaminationPersonStatistics', {
    params,
  });
}

//获取 获取资质考试数据
export async function getExaminationStatistics(params: {
  bureau_id: number,
  city_id: number,
  district_id: number,
  province_id: number,
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/statistics/getExaminationStatistics', {
    params,
  });
}




/*
获取云南省所有市列表：
http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=100025&org_type=1&get_next=1
参数：org_id（云南省ID 100025），org_type（默认传1），get_next（默认传1）

/dsideal_yy/ypt/sys/org/getEduUnitList?random_num=277470&area_id=200125116&edu_type=-1&main_school_id=200125116&org_name=&org_type=2&pageNumber=1&pageSize=20&school_type=-1&showPassWord=true

获取市区下的区列表：
http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=200265&org_type=2&get_next=1
参数：org_id（市ID），org_type（默认传2），get_next（默认传1）
*/
