Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
4919824e14
@ -12,6 +12,7 @@ export const historyReq = (data: any) => {
|
||||
url: '/api/data/history',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 60 * 1000,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -442,7 +442,8 @@ const queryHistoryData = () => {
|
||||
startTime: new Date(timeRange.value[0]).getTime(),
|
||||
endTime: new Date(timeRange.value[1]).getTime(),
|
||||
} as any
|
||||
historyReq(requestData).then((res) => {
|
||||
historyReq(requestData)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
const result = res.data
|
||||
if (Object.keys(result)?.length) {
|
||||
@ -453,7 +454,7 @@ const queryHistoryData = () => {
|
||||
tableData.push({
|
||||
name: item,
|
||||
times: realResult[item].times,
|
||||
value: realResult[item].values.map((val: any) => (val === 0 ? 0 : val.toFixed(2))),
|
||||
value: realResult[item].values.map((val: any) => (val === 0 ? 0 : val?.toFixed(2))),
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -486,6 +487,9 @@ const queryHistoryData = () => {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
reportLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 时间转换
|
||||
|
@ -135,6 +135,9 @@ const switchTime = (index: number) => {
|
||||
}
|
||||
times.splice(index, 1)
|
||||
customName.splice(index, 1)
|
||||
customName.forEach((item: any, index: number, arr: any) => {
|
||||
arr[index] = statAnalysisSelect.attributes + String(index + 1)
|
||||
})
|
||||
}
|
||||
const timechange = (value: any) => {
|
||||
if (times.length) {
|
||||
@ -148,11 +151,18 @@ const timechange = (value: any) => {
|
||||
return
|
||||
} else {
|
||||
times.push(value)
|
||||
|
||||
customName.push(statAnalysisSelect.attributes + times.length)
|
||||
customName.forEach((item: any, index: number, arr: any) => {
|
||||
arr[index] = statAnalysisSelect.attributes + String(index + 1)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
times.push(value)
|
||||
customName.push(statAnalysisSelect.attributes + times.length)
|
||||
customName.forEach((item: any, index: number, arr: any) => {
|
||||
arr[index] = statAnalysisSelect.attributes + String(index + 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,6 +170,7 @@ const showTime = ref(false)
|
||||
const clearList = () => {
|
||||
times.length = 0
|
||||
time.value = []
|
||||
customName.length = 0
|
||||
}
|
||||
|
||||
const iotModelId = ref('')
|
||||
|
Loading…
Reference in New Issue
Block a user