2023-10-23 22:00:14 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface Field {
|
|
|
|
id: number | string
|
|
|
|
datasourceId: number | string
|
|
|
|
datasetTableId: number | string
|
|
|
|
datasetGroupId: number | string
|
|
|
|
originName: string
|
|
|
|
name: string
|
|
|
|
dataeaseName: string
|
|
|
|
groupType: string
|
|
|
|
type: string
|
|
|
|
deType: number
|
|
|
|
deExtractType: number
|
|
|
|
extField: number
|
|
|
|
checked: boolean
|
|
|
|
fieldShortName: string
|
2023-12-07 17:57:08 +08:00
|
|
|
desensitized: boolean
|
2023-10-23 22:00:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ComponentInfo {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
deType: number
|
|
|
|
type: string
|
|
|
|
datasetId: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getFieldByDQ = async (id, chartId): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `/chart/listByDQ/${id}/${chartId}`, data: {} }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-06-06 18:28:43 +08:00
|
|
|
export const copyChartField = async (id, chartId): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `/chart/copyField/${id}/${chartId}`, data: {} }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export const deleteChartField = async (id): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `/chart/deleteField/${id}`, data: {} }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-06-12 10:37:30 +08:00
|
|
|
export const deleteChartFieldByChartId = async (chartId): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `/chart/deleteFieldByChart/${chartId}`, data: {} }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-03-04 17:08:58 +08:00
|
|
|
// 通过图表对象获取数据
|
2023-10-23 22:00:14 +08:00
|
|
|
export const getData = async (data): Promise<IResponse> => {
|
|
|
|
delete data.data
|
|
|
|
return request.post({ url: '/chartData/getData', data }).then(res => {
|
|
|
|
if (res.code === 0) {
|
|
|
|
return res?.data
|
|
|
|
} else {
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export const innerExportDetails = async (data): Promise<IResponse> => {
|
|
|
|
return request.post({
|
|
|
|
url: '/chartData/innerExportDetails',
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
loading: true,
|
|
|
|
responseType: 'blob'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-03-04 17:08:58 +08:00
|
|
|
// 通过图表id获取数据
|
2023-10-23 22:00:14 +08:00
|
|
|
export const getChart = async (id): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `/chart/getChart/${id}`, data: {} }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-03-04 17:08:58 +08:00
|
|
|
// 单个图表保存测试
|
2023-10-23 22:00:14 +08:00
|
|
|
export const saveChart = async (data): Promise<IResponse> => {
|
|
|
|
delete data.data
|
|
|
|
return request.post({ url: '/chart/save', data }).then(res => {
|
|
|
|
return res?.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取单个字段枚举值
|
|
|
|
export const getFieldData = async (fieldId, fieldType, data): Promise<IResponse> => {
|
|
|
|
delete data.data
|
|
|
|
return request
|
|
|
|
.post({ url: `/chartData/getFieldData/${fieldId}/${fieldType}`, data })
|
|
|
|
.then(res => {
|
|
|
|
return res
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getChartDetail = async (id: string): Promise<IResponse> => {
|
|
|
|
return request.post({ url: `chart/getDetail/${id}`, data: {} }).then(res => {
|
|
|
|
return res
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export const checkSameDataSet = async (viewIdSource, viewIdTarget) =>
|
|
|
|
request.get({ url: '/chart/checkSameDataSet/' + viewIdSource + '/' + viewIdTarget })
|