From cc890f987b770e5a73f5ef12d41b25f6bb448fcd Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 23 十一月 2023 16:37:45 +0800 Subject: [PATCH] 1.增加了风险模型跳转逻辑 2.修改了风险模型页面部分逻辑 --- src/utils/chartFunction/lineChart.js | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 1 deletions(-) diff --git a/src/utils/chartFunction/lineChart.js b/src/utils/chartFunction/lineChart.js index 8c06873..39b7146 100644 --- a/src/utils/chartFunction/lineChart.js +++ b/src/utils/chartFunction/lineChart.js @@ -1,4 +1,5 @@ import dayjs from 'dayjs' +import { time } from 'echarts' export default { // 鑾峰彇璇ユ湀浠藉ぉ鏁� @@ -163,5 +164,50 @@ */ deleteLastStr(valueStr) { return valueStr.slice(0, -1) - } + }, + + + /** + * 鎸囧畾鏃堕棿鍖洪棿鐨勭嚎娈靛彉棰滆壊 + * @param锛� + * @returns锛� + */ + getLineColor(timeInteval,xList){ + let result = [] + + // 鍙彇 + let temp = [] + for (let i = 0; i < timeInteval.length; i++){ + if(timeInteval[i][0]!=timeInteval[i][1]){ + temp.push(timeInteval[i]) + } + } + + // 鏃犺繛缁殑鏁版嵁 鐩存帴閫�鍑� + if(temp.length == 0){ + return [] + } + + // 鍙栫涓�涓繛缁殑鏃舵 + result.push( + [ + { + lte: temp[0][0], + color: 'green' + }, + { + gt: temp[0][0], + lte:temp[0][1], + color: 'red' + }, + { + gt: temp[0][1], + lte:xList[xList.length-1], + color: 'green' + } + ] + ) + return result[0] + }, + } -- Gitblit v1.9.3