历史数据:数据保留两位小数
This commit is contained in:
parent
bfcb771437
commit
12b809879c
@ -184,6 +184,7 @@ import { getModelAttributeListReq, getRealValueRangeReq } from '/@/api/backend/d
|
||||
import { getTemplateListReq, addTemplateListReq, delTemplateListReq } from '/@/api/backend/historyData/request'
|
||||
import { windowReq } from '/@/api/backend/statAnalysis/request'
|
||||
import { selectData } from '/@/views/backend/historyData/type'
|
||||
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
|
||||
const shortcuts = [
|
||||
{
|
||||
@ -399,10 +400,11 @@ const getRealValueRange = () => {
|
||||
interpolationAttr.forEach((attr) => {
|
||||
device[attr].times.forEach((t: number, index: number) => {
|
||||
const attrNameKey = attr + '--interpolation'
|
||||
const val = getCutDecimalsValue(device[attr].values[index], 2)
|
||||
tableDataList.push({
|
||||
name: deviceNameData[deviceId],
|
||||
time: dayjs(t).format('YYYY-MM-DD HH:mm:ss'),
|
||||
[attrNameKey]: device[attr].values[index],
|
||||
[attrNameKey]: val,
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -414,10 +416,11 @@ const getRealValueRange = () => {
|
||||
averageAttr.forEach((attr) => {
|
||||
device[attr].times.forEach((t: number, index: number) => {
|
||||
const attrNameKey = attr + '--average'
|
||||
const val = getCutDecimalsValue(device[attr].values[index], 2)
|
||||
const tableDataIndex = tableDataList.findIndex(
|
||||
(data: any) => data.name == deviceNameData[deviceId] && data.time == dayjs(t).format('YYYY-MM-DD HH:mm:ss')
|
||||
)
|
||||
tableDataList[tableDataIndex][attrNameKey] = device[attr].values[index]
|
||||
tableDataList[tableDataIndex][attrNameKey] = val
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -428,10 +431,11 @@ const getRealValueRange = () => {
|
||||
maxAttr.forEach((attr) => {
|
||||
device[attr].times.forEach((t: number, index: number) => {
|
||||
const attrNameKey = attr + '--max'
|
||||
const val = getCutDecimalsValue(device[attr].values[index], 2)
|
||||
const tableDataIndex = tableDataList.findIndex(
|
||||
(data: any) => data.name == deviceNameData[deviceId] && data.time == dayjs(t).format('YYYY-MM-DD HH:mm:ss')
|
||||
)
|
||||
tableDataList[tableDataIndex][attrNameKey] = device[attr].values[index]
|
||||
tableDataList[tableDataIndex][attrNameKey] = val
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -442,10 +446,11 @@ const getRealValueRange = () => {
|
||||
minAttr.forEach((attr) => {
|
||||
device[attr].times.forEach((t: number, index: number) => {
|
||||
const attrNameKey = attr + '--min'
|
||||
const val = getCutDecimalsValue(device[attr].values[index], 2)
|
||||
const tableDataIndex = tableDataList.findIndex(
|
||||
(data: any) => data.name == deviceNameData[deviceId] && data.time == dayjs(t).format('YYYY-MM-DD HH:mm:ss')
|
||||
)
|
||||
tableDataList[tableDataIndex][attrNameKey] = device[attr].values[index]
|
||||
tableDataList[tableDataIndex][attrNameKey] = val
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -458,7 +463,6 @@ const getRealValueRange = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const exportData = () => {}
|
||||
const addTemplate = () => {
|
||||
ElMessageBox.prompt('请输入模板名称', '添加模板', {
|
||||
confirmButtonText: '确定',
|
||||
|
Loading…
Reference in New Issue
Block a user