|
@@ -21,56 +21,8 @@ export type Material = {
|
|
|
|
|
|
export type MaterialPageProps = PagingRequest<Partial<Material> & {groupIds: number[]}>;
|
|
export type MaterialPageProps = PagingRequest<Partial<Material> & {groupIds: number[]}>;
|
|
export const fetchMaterialPage = async (params: MaterialPageProps) => {
|
|
export const fetchMaterialPage = async (params: MaterialPageProps) => {
|
|
- await asyncTimeout(160)
|
|
|
|
- let materials: PagingResult<Material[]> = {
|
|
|
|
- ...params,
|
|
|
|
- total: 100,
|
|
|
|
- list: [
|
|
|
|
- {
|
|
|
|
- id: params.pageNum,
|
|
|
|
- name: "test",
|
|
|
|
- format: params.format || "png",
|
|
|
|
- url: "icon/h_default_64.png",
|
|
|
|
- groupId: 1,
|
|
|
|
- group: "分组1",
|
|
|
|
- size: 1024,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: params.pageNum + 100,
|
|
|
|
- name: "test",
|
|
|
|
- format: params.format || "mp3",
|
|
|
|
- url: "icon/h_default_64.png",
|
|
|
|
- groupId: 1,
|
|
|
|
- group: "分组1",
|
|
|
|
- size: 1024,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: params.pageNum + 200,
|
|
|
|
- name: "test",
|
|
|
|
- format: params.format || "mp4",
|
|
|
|
- url: "icon/h_default_64.png",
|
|
|
|
- groupId: 1,
|
|
|
|
- group: "分组1",
|
|
|
|
- size: 1024,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: params.pageNum + 300,
|
|
|
|
- name: "mesh",
|
|
|
|
- format: "obj",
|
|
|
|
- url: "icon/h_default_64.png",
|
|
|
|
- groupId: 2,
|
|
|
|
- group: "分组2",
|
|
|
|
- modelId: 1055,
|
|
|
|
- size: 254.58 * 1024 * 1024,
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- };
|
|
|
|
- if (params.groupIds) {
|
|
|
|
- materials.list = materials.list.filter(i => params.groupIds.includes(i.groupId))
|
|
|
|
- }
|
|
|
|
- return materials
|
|
|
|
- // const material = await axios.get<PagingResult<Material[]>>(MATERIAL_PAG, { params })
|
|
|
|
- // return material
|
|
|
|
|
|
+ const material = await axios.get<PagingResult<Material[]>>(MATERIAL_PAG, { params })
|
|
|
|
+ return material
|
|
};
|
|
};
|
|
|
|
|
|
export const fetchMaterialGroups = async () => {
|
|
export const fetchMaterialGroups = async () => {
|