From 2162dec5e0acc98f8e22fa9907cdc5f70eba6dcc Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期四, 23 十一月 2023 17:57:39 +0800
Subject: [PATCH] 1.修改了风险模型页面有效率,在线率的展示百分比 2.站点审核辅助页面增加了标识

---
 src/utils/chartFunction/lineChart.js |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/src/utils/chartFunction/lineChart.js b/src/utils/chartFunction/lineChart.js
index 6c0c2fd..e43ead8 100644
--- a/src/utils/chartFunction/lineChart.js
+++ b/src/utils/chartFunction/lineChart.js
@@ -46,9 +46,10 @@
       if (tempData) {
         xData.push(tempData.lst)
         yAvg.push(tempData.dayAvg)
-        yOnline.push(this.deleteLastStr(tempData.dayOnline))
-        yValid.push(this.deleteLastStr(tempData.dayValid))
-        yExceed.push(this.deleteLastStr(tempData.dayExceeding))
+
+        yOnline.push(tempData.dayOnline)
+        yValid.push(tempData.dayValid)
+        yExceed.push(tempData.dayExceeding)
         continue
       }
 
@@ -113,8 +114,12 @@
     return result
   },
 
-  //   缁勬垚鏃犳暟鎹尯鍩�
-  getMarkArea(timeInteval) {
+  /**
+   * 缁勬垚鏃犳暟鎹尯鍩�
+   * @param锛� 2缁存暟缁�
+   * @returns锛�
+   */
+  getMarkArea(timeInteval, describe = '鏃犳暟鎹�') {
     let result = []
     for (let i = 0; i < timeInteval.length; i++) {
       let temp = []
@@ -122,7 +127,7 @@
         let obj = {}
         // 缁欑涓�涓璞″姞涓妌ame灞炴��
         if (j == 0) {
-          obj.name = '鏃犳暟鎹�'
+          obj.name = describe
         }
         obj.xAxis = timeInteval[i][j]
         temp.push(obj)
@@ -159,5 +164,46 @@
    */
   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