From 924b3b75d7dd5be259a3e00b3b4e1d7aaf65fa41 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期四, 13 七月 2023 18:24:03 +0800
Subject: [PATCH] 更换图标

---
 src/views/HomeView.vue |   35 ++++++++++++++++++++++++++++++++---
 public/index.html      |    3 ++-
 public/favicon.ico     |    0 
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/public/favicon.ico b/public/favicon.ico
index df36fcf..d9a3d2a 100644
--- a/public/favicon.ico
+++ b/public/favicon.ico
Binary files differ
diff --git a/public/index.html b/public/index.html
index 3e5a139..242ca1b 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,8 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
+    <!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
+    <title>SQI鑳芥晥璇勪及绯荤粺</title>
   </head>
   <body>
     <noscript>
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index b913d58..9039be9 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -116,6 +116,7 @@
 import * as echarts from "echarts"; //寮曞叆echarts
 import axios from "axios";
 import { useRouter } from "vue-router";
+import { showLoadingToast, showFailToast, allowMultipleToast } from "vant";
 const router = useRouter();
 const pointName = ref("");
 const myChart = shallowRef(null);
@@ -156,6 +157,7 @@
   c_monitorList: [],
   // PointID: "1620681990539972608",
   PointID: "",
+  CorpID: "",
   // token:
   //   "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOjEsIkxvZ2luTmFtZSI6Inl3YWRtaW4iLCJMb2dpblB3ZCI6ImFkbWluIiwiQ29ycElEIjoxLCJJc0FkbWluIjp0cnVlLCJpYXQiOjE2ODkyMTg3NzEsIm5iZiI6MTY4OTIxODc3MSwiZXhwIjoxNjg5MzA1MTcxLCJpc3MiOiJpc3RhdGlvbiIsImF1ZCI6ImlzdGF0aW9uIn0.cUxpJbn8krlTpaHkmd_nTgzc6YQzPxBn6pCJ0mFHAS8",
   token: "",
@@ -164,6 +166,22 @@
   // console.log(router.currentRoute.value.query, 162);
   state.PointID = router.currentRoute.value.query.PointID;
   state.token = router.currentRoute.value.query.Token;
+  state.CorpID = router.currentRoute.value.query.CorpID;
+  console.log(state.CorpID, 170);
+  allowMultipleToast();
+
+  if (state.token == "") {
+    showFailToast("token鏃犳晥,璇烽噸璇�");
+    return;
+  }
+  if (state.PointID == "") {
+    showFailToast("娴嬬偣ID闇�瑕�>0,璇烽噸璇�");
+    return;
+  }
+  if (state.CorpID == undefined || state.CorpID == "") {
+    showFailToast("CorpID闇�瑕�>0,璇烽噸璇�");
+    return;
+  }
   state.currentRecordParas.RecordTime = moment().format("YYYY-MM-DD");
   initialRealTimeRecord();
   getRecordDetail();
@@ -192,7 +210,7 @@
       Authorization: `Bearer ${state.token}`,
     },
     params: {
-      CorpID: 14,
+      CorpID: state.CorpID,
       MonitorPointID: state.PointID,
     },
   })
@@ -250,6 +268,10 @@
 };
 //鍒濆鍖栬幏鍙栨暟鎹�
 const initialRealTimeRecord = () => {
+  let loading = showLoadingToast({
+    message: "鍔犺浇涓�...",
+    forbidClick: true,
+  });
   axios({
     url: "http://47.101.141.88:9019/Run/MonitorRealRecord/Mobile/GetByMonitorPointIDOfDay@V1.0",
     method: "GET",
@@ -257,12 +279,13 @@
       Authorization: `Bearer ${state.token}`,
     },
     params: {
-      CorpID: 14,
+      CorpID: state.CorpID,
       MonitorPointID: state.PointID,
       Day: state.currentRecordParas.RecordTime,
     },
   })
     .then((res) => {
+      loading.close();
       if (res.data.Code != 0) {
         return;
       }
@@ -271,6 +294,7 @@
       }
       var data = res.data.Data || [];
       state.chartData = data;
+
       var last_record = state.chartData[state.chartData.length - 1]; //鑾峰彇鏈�鍚庝竴鏉℃暟鎹�
       state.currentRecordParas.RecordStatusName = DataStatusTextEmun(
         last_record.DataStatus
@@ -440,7 +464,7 @@
       Authorization: `Bearer ${state.token}`,
     },
     params: {
-      CorpID: 14,
+      CorpID: state.CorpID,
       ID: state.PointID,
     },
   })
@@ -646,4 +670,9 @@
     box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
   }
 }
+.loading {
+  position: absolute;
+  padding-top: 75%;
+  padding-left: 45%;
+}
 </style>

--
Gitblit v1.9.3