import type { AxiosResponse } from 'axios' import { apiHttp as http } from '@/utils/http' import type { LayoutData, SimpleLayoutData } from './type' /*** * 获取页面数据 * @param index 页面ID * url: `/api/api/report/list/${index}` `/page/page/${index}/` */ export const getPageApi = async (index: string): Promise> => { return http.get({ url: `/api/api/report/list/${index}` }) } /*** * 获取页面数据列表 */ export const getPageListApi = async (): Promise> => { return http.get({ url: '/api/api/report/list' }) } /** * 保存页面数据 * @param componentData 页面数据 */ export const savePageApi = (componentData: LayoutData): Promise> => { return http.post({ url: '/api/api/report', data: componentData }) } /** * 更新页面数据 * @param id 页面ID * @param componentData 页面数据 */ export const updatePageApi = ( id: string, componentData: LayoutData ): Promise> => { return http.put({ url: `/api/api/report/${id}`, data: componentData }) } /** * 删除页面数据 * @param id 页面ID */ export const deletePageApi = (id: string): Promise> => { return http.delete({ url: `/api/api/report/${id}` }) }