whychdw
2021-07-19 4b3272751d1d185e81154ceb8b63e43f4bc917ac
提交内容
3个文件已修改
72 ■■■■■ 已修改文件
src/assets/js/realTime.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/getQgth.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/getSpecialPointIndex.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/realTime.js
@@ -211,6 +211,63 @@
    });
}
export const getHistoryRealtimeData = (params, type) => {
    let url = "";
    switch(type) {
        case 'groupVolGraph':
            url = "Batt_realdataAction!getGroupVolByTime";
            break;
        case 'groupCurrGraph':
            url = "Batt_realdataAction!getGroupCurrByTime";
            break;
        case 'monVolGraph':
            url = "Batt_realdataAction!getMonVolByTime";
            break;
        case 'monTmpGraph':
            url = "Batt_realdataAction!getMonTempByTime";
            break;
        case 'monResGraph':
            url = "Batt_realdataAction!getMonResByTime";
            break;
    }
    // 查询后台
    return axios({
        method: "post",
        url: url,
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * 查询时间段内的组端电压
 * @param params
 * @return {AxiosPromise}
 */
export const getGroupVolByTime = (params) => {
    // 查询后台
    return axios({
        method: "post",
        url: "Batt_realdataAction!getGroupVolByTime",
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * 查询时间段内的组端电流
 * @param params
 * @return {AxiosPromise}
 */
export const getGroupCurrByTime = (params) => {
    // 查询后台
    return axios({
        method: "post",
        url: "Batt_realdataAction!getGroupCurrByTime",
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * 查询历史实时数据
 * @param json:{"dev_id":618500002}
src/assets/js/tools/getQgth.js
@@ -16,7 +16,7 @@
        rs.qt = groupVol?(data.maxVal/groupVol*100).toFixed(1):0;
        rs.qh = groupVol?((data.maxVal-data.minVal)/groupVol*100).toFixed(1):0;
        rs.label = getBattIsGood(rs);
        rs.title = "Qg="+rs.qg+"%;Qt="+rs.qt+"%;Qh="+rs.qh+"%;电池性能:"+rs.label;
        rs.title = "Qg="+rs.qg+"%;Qt="+rs.qt+"%;Qh="+rs.qh+"%;电池性能评估:"+rs.label;
    }
    return rs;
}
src/assets/js/tools/getSpecialPointIndex.js
@@ -53,12 +53,23 @@
            }
        }
    }
    if(rs.min != -Infinity && rs.max == Infinity) {
        let index = data.length - 10;
        rs.max = index;
        rs.maxVal = data[index];
    }
    if(rs.max == Infinity || rs.min == -Infinity) {
    // 未找到锅底
    if(rs.min == -Infinity) {
        rs.code = 0;
    }else {
        rs.code = 1;
    }
    // 驼峰出现在锅底的前面
    if(rs.max < rs.min) {
        rs.code = 0;
    }
    return rs;
}