import { request } from '@/plugins/http-fetch';

/**图组名称信息 */
export function getGraphGroups() {
  return request({
    url: '/chart/graph/groups',
    method: 'get',
  });
}

/**获取图数据 */
export function getGraphData(group: string) {
  return request({
    url: '/chart/graph',
    method: 'get',
    params: {
      group,
    },
  });
}

/**保存图数据 */
export function saveGraphData(group: string, data: Record<string, any>) {
  return request({
    url: '/chart/graph',
    method: 'post',
    data: {
      group,
      data,
    },
  });
}

/**删除图组数据 */
export function delGraphData(group: string) {
  return request({
    url: `/chart/graph/${group}`,
    method: 'delete',
  });
}
