huminmin
7 天以前 9ffa576f26402a87abfdd5a341e70057067742e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { requestClient } from '#/api/request';
 
export namespace BiChartConfigApi {
  export interface ChartConfig {
    id?: number;
    dashboardId?: number;
    name?: string;
    chartType?: string;
    dataSourceId?: number;
    querySql?: string;
    position?: string;
    chartOptions?: string;
    refreshInterval?: number;
    sort?: number;
    status?: number;
    creator?: string;
    createTime?: string;
    updater?: string;
    updateTime?: string;
  }
 
  export interface PageParams {
    dashboardId?: number;
    pageNo?: number;
    pageSize?: number;
  }
 
  export interface PageResult {
    list: ChartConfig[];
    total: number;
  }
}
 
export function getChartConfigPage(params?: BiChartConfigApi.PageParams) {
  return requestClient.get<BiChartConfigApi.PageResult>('/bi/chart-config/page', { params });
}
 
export function getChartConfig(id: number) {
  return requestClient.get<BiChartConfigApi.ChartConfig>('/bi/chart-config/get', { params: { id } });
}
 
export function createChartConfig(data: BiChartConfigApi.ChartConfig) {
  return requestClient.post<number>('/bi/chart-config/create', data);
}
 
export function updateChartConfig(data: BiChartConfigApi.ChartConfig) {
  return requestClient.put<boolean>('/bi/chart-config/update', data);
}
 
export function deleteChartConfig(id: number) {
  return requestClient.delete<boolean>('/bi/chart-config/delete', { params: { id } });
}