You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import type { ParamsType } from '@ant-design/pro-table/node_modules/@ant-design/pro-provider';
import { request } from 'umi';
import type { TableListItem } from './data';
/** 获取课程列表 GET /dsideal_yy/ypt/careerTraining/train/list */
export async function queryTrainList(
params: {
// query
/** 当前的页码 */
current?: number;
/** 页面的容量 */
pageSize?: number;
},
options?: Record<string, any>,
) {
return request<{
data: TableListItem[];
/** 列表的内容总数 */
total_row?: number;
/** 页面的容量 */
page_size?: number;
success?: boolean;
}>('/dsideal_yy/ypt/careerTraining/train/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新建/修改课程 POST /dsideal_yy/ypt/careerTraining/train/save */
export async function saveTrain(data: Record<string, any>, options?: Record<string, any>) {
return request<TableListItem>('/dsideal_yy/ypt/careerTraining/train/save', {
data,
method: 'POST',
...(options || {}),
});
}
/** 删除课程 POST /dsideal_yy/ypt/careerTraining/train/delete */
export async function removeTrain(data: { key: number[] }, options?: Record<string, any>) {
return request<Record<string, any>>('/dsideal_yy/ypt/careerTraining/train/delete', {
data,
method: 'POST',
...(options || {}),
});
}
/** 查看课程仅仅获取课程详情不标记浏览量GET /dsideal_yy/ypt/careerTraining/course/view */
export async function queryTrainView(data: Record<string, any>, options?: Record<string, any>) {
return request<TableListItem>('/dsideal_yy/ypt/careerTraining/train/view', {
data,
method: 'POST',
...(options || {}),
});
}
/** 获取机构树 GET /dsideal_yy/ypt/sys/org/getOrgTreeForOa?org_id=200051&org_type=2&school_type=1 */
export async function queryOrgTree(
params: ParamsType,
): Promise<any> {
return request('/dsideal_yy/ypt/sys/org/getOrgTreeForOa', {
params,
});
}
/** 获取机构树根id (平台配置全局)*/
export async function queryValueByKey(
params: ParamsType,
): Promise<any> {
return request('/dsideal_yy/golbal/getValueByKey?key=common.org.id', {
params,
});
}
/**
* 获取主题列表
* http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
* @param params
* @returns
*/
export async function querySubjectList(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/ypt/careerTraining/subject/listSubject', {
params,
});
}