You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.9 KiB
TypeScript

1 month ago
import { apiClient } from '../utils/apiClient';
1 month ago
const requestUrl = "/DataManager";
1 month ago
// 获取列名
export const getColumns = async (id: number) => {
1 month ago
console.log("getColumns 请求参数:", id);
return apiClient(`${requestUrl}/getColumns?dataid=${id}`, {
method: 'GET'
});
1 month ago
};
// 查询数据
export const getDatas = async (searchParam: string) => {
1 month ago
console.log("getData 请求参数:", searchParam);
return apiClient(`${requestUrl}/getData`, {
method: 'POST',
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(searchParam),
});
1 month ago
};
// 上传文件
export const uploadData = async (formData: any) => {
1 month ago
return apiClient(`${requestUrl}/uploadData`, {
method: 'POST',
body: formData,
});
1 month ago
};
// 地震能量计算
export const energyCalc = async (energyCalcModel: any) => {
1 month ago
return apiClient(`${requestUrl}/energycalc`, {
method: 'POST',
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(energyCalcModel),
});
1 month ago
};
// 删除数据文件
export const deleteData = async (nodeId: string, id: string) => {
1 month ago
return apiClient(`${requestUrl}/deldata?nodeId=${nodeId}&Id=${id}`, {
method: 'POST',
body: JSON.stringify(id)
});
1 month ago
};
// 根据井名删除微地震云事件点数据
export const deleteEventData = async (wellName: string) => {
1 month ago
return apiClient(`${requestUrl}/delEventData?wellName=${wellName}`, {
method: 'POST',
headers:
{
'Content-Type': 'application/json',
},
body: JSON.stringify(wellName)
});
1 month ago
};
// 根据文件名在后台下载文件,在浏览器中显示
export const downloadDataFile = async (fileName: string) => {
1 month ago
return apiClient(`${requestUrl}/download?fileName=${encodeURIComponent(fileName)}`);
1 month ago
};
/**
*
* @returns
*/
export const fetchBaseMicroSeismic = async () => {
1 month ago
return apiClient(`${requestUrl}/getmicroseismiclist`);
1 month ago
}