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.

77 lines
2.0 KiB

import { request } from 'umi';
import { TableListItem } from './data';
import type { ProFormColumnsType } from '@ant-design/pro-form';
/** 获取考点数据结构 GET /api/dataSource?key=examination&schema=true&data=false */
export async function schemaExamination(
params: {
// query
},
options?: { [key: string]: any },
) {
return request<{
data: any[];
/** 字段总数 */
total?: number;
success?: boolean;
}>('/api/dataSource?key=examination&schema=true&data=false', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 获取考点列表数据 GET /api/dataSource?key=examination&schema=false&data=true */
export async function dataExamination(
params: {
// query
/** 当前的页码 */
current?: number;
/** 页面的容量 */
pageSize?: number;
},
options?: { [key: string]: any },
) {
return request<{
data: TableListItem[];
/** 列表的内容总数 */
total?: number;
success?: boolean;
}>('/api/dataSource?key=examination&schema=false&data=true', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新建考点 PUT /api/dataSource?key=examination */
export async function updateExamination(data: { [key: string]: any }, options?: { [key: string]: any }) {
return request<TableListItem>('/api/examination', {
data,
method: 'PUT',
...(options || {}),
});
}
/** 新建考点 POST /api/dataSource?key=examination */
export async function addExamination(data: { [key: string]: any }, options?: { [key: string]: any }) {
return request<TableListItem>('/api/examination', {
data,
method: 'POST',
...(options || {}),
});
}
/** 删除考点 DELETE /api/dataSource?key=examination */
export async function removeExamination(data: { key: number[] }, options?: { [key: string]: any }) {
return request<Record<string, any>>('/api/examination', {
data,
method: 'DELETE',
...(options || {}),
});
}