修改 方案数据echart数据格式

This commit is contained in:
GGJ
2024-10-14 20:15:54 +08:00
parent 3fd897fca2
commit d18e4a9bf5
6 changed files with 280 additions and 413 deletions

View File

@@ -11,7 +11,11 @@ export const yMethod = (arr: any) => {
if (maxValue > 1000) {
max = Math.ceil(maxValue / 100) * 100
min = (Math.floor(minValue / 100) - 1) * 100
if (minValue == 0) {
min = 0
} else {
min = (Math.floor(minValue / 100) - 1) * 100
}
} else {
max = Math.ceil(maxValue / 10) * 10
min = Math.floor(minValue / 10) * 10
@@ -19,9 +23,9 @@ export const yMethod = (arr: any) => {
if (maxValue > 0 && maxValue < 1) {
max = 1
} else if (max == 0 && minValue > -1 && minValue < 0) {
} else if (max == 0 && minValue > -1 && minValue < 0) {
min = -1
}
}
return [min, max, interval]
}

View File

@@ -226,14 +226,16 @@ function getPendingKey(config: AxiosRequestConfig) {
/**
* 根据请求方法组装请求数据/参数
*/
export function requestPayload(method: Method, data: anyObj) {
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
if (method == 'GET') {
return {
params: data
}
} else if (method == 'POST') {
return {
data: data
if (paramsPOST) {
return { params: data }
} else {
return { data: data }
}
}
}