Prechádzať zdrojové kódy

首页用户数据新增风控率

wangzhiqiang 4 mesiacov pred
rodič
commit
47af53540d

+ 2 - 2
.env.development

@@ -3,9 +3,9 @@ ENV = 'development'
 # 线上测试
 # VITE_BASE_URL = 'http://advise.ytmdm.com/yt-gateway'
 # VITE_BASE_URL = 'https://test.book.ytpm.net/yt-gateway'
-# VITE_BASE_URL = 'http://119.45.71.139:25001'
+VITE_BASE_URL = 'http://119.45.71.139:25001'
 
 # 本地 
 # VITE_BASE_URL = 'http://192.168.1.9:25001'
-VITE_BASE_URL = 'http://192.168.1.159:25001'
+# VITE_BASE_URL = 'http://192.168.1.159:25001'
 

+ 5 - 0
src/views/main/dashboard/components/card/row.vue

@@ -69,6 +69,11 @@ export default defineComponent({
       }
     }
   }
+
+  .card:hover {
+    transform: translateY(-2px);
+  }
+  
   @media screen and ( max-width: 1200px ) {
     .card {
       width: calc(50% - 26px);

+ 11 - 2
src/views/main/dashboard/components/charts/userDataChart.vue

@@ -35,7 +35,8 @@ const tableData = ref([
     { name: '新增封禁', today: 0, yesterday: 0, month: 0 },
     { name: '总封禁数', today: 0, yesterday: 0, month: 0 },
     { name: '新增封号', today: 0, yesterday: 0, month: 0 },
-    { name: '总封号', today: 0, yesterday: 0, month: 0 }
+    { name: '总封号', today: 0, yesterday: 0, month: 0 },
+    { name: '风控率', today: 0, yesterday: 0, month: 0 },
 ]);
 
 const xAxisList = [
@@ -81,7 +82,8 @@ const getIndexUserStatisticData = async () => {
         { name: '新增封禁', today: res.todayLock, yesterday: res.yesterdayLock, month: res.monthLock },
         // { name: '总封禁数', today: 0, yesterday: 0, month: 0 },
         { name: '新增封号', today: res.todayRisk, yesterday: res.yesterdayRisk, month: res.monthRisk },
-        // { name: '总封号', today: 0, yesterday: 0, month: 0 }
+        // { name: '总封号', today: 0, yesterday: 0, month: 0 },
+        { name: '风控率', today: getPercent(res.todayLock,res.today), yesterday: getPercent(res.yesterdayLock,res.yesterday), month: getPercent(res.monthLock,res.month) },
     ]
 
     const { todayUser, todayLockHour, todayRiskHour } = res
@@ -104,6 +106,13 @@ const getIndexUserStatisticData = async () => {
         },
     ]
 }
+
+function getPercent(a, b) {
+  if (a===0 || b === 0) return '0%';
+  let percent = (a / b * 100).toFixed(2);
+  return percent + '%';
+}
+
 onBeforeMount(async () => {
     await getIndexUserStatisticData()
 })