蒋珅 преди 1 година
родител
ревизия
950a78947a
променени са 7 файла, в които са добавени 85 реда и са изтрити 13 реда
  1. 1 0
      index.html
  2. 11 0
      public/static/config/config.js
  3. 1 1
      src/components/Header.vue
  4. 20 0
      src/pages/buildTable/create/index.vue
  5. 15 3
      src/pages/look/create/index.vue
  6. 35 7
      src/pages/search/create/index.vue
  7. 2 2
      src/router/index.js

+ 1 - 0
index.html

@@ -1,3 +1,4 @@
+
 <!DOCTYPE html>
 <html lang="en">
 

+ 11 - 0
public/static/config/config.js

@@ -7,6 +7,17 @@ const config = {
     taosURL: 'http://192.168.10.9:5085',
     taosetURL: 'ws://192.168.10.9:5085'
 }
+
+
+// const config = {
+//     baseURL: 'http://10.0.118.76:6041',
+//     socketURL: 'ws://10.0.118.76:6041',
+//     redisURL: 'http://10.0.118.76:5087',
+//     redisetURL: 'ws://10.0.118.76:5087',
+//     taosURL: 'http://10.0.118.76:5085',
+//     taosetURL: 'ws://10.0.118.76:5085'
+// }
+
 // const config = {
 //     baseURL: 'http://10.0.118.76:6041',
 //     socketURL: 'ws://10.0.118.76:6041',

+ 1 - 1
src/components/Header.vue

@@ -8,7 +8,7 @@
         <el-icon v-if="!collapse"><Fold /></el-icon>
         <el-icon v-else><Expand /></el-icon>
       </div>
-      <div class="logo">taos管理</div>
+      <div class="logo">光耀历史数据库管理</div>
     </div>
     <div class="header-right">
       <div class="header-user-con">

+ 20 - 0
src/pages/buildTable/create/index.vue

@@ -160,6 +160,11 @@ const funCurrentChange = async ({ current, currentNode }) => {
     dateItem.databaseName = databaseName;
     dateItem.tableName = tableName;
     newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   // console.log(999999,newdata);
   tableData.value = newdata;
@@ -245,6 +250,11 @@ const nbsubmit = async () => {
       // dateItem.tableName = tableName;
       newdata.push(dateItem);
       console.log("224", newdata);
+      newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
     tableData.value = newdata;
   }
@@ -359,6 +369,11 @@ const left1 = async () => {
       dateItem[map[key]] = ele[key];
     }
     newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   tableData.value = newdata;
 };
@@ -390,6 +405,11 @@ const right1 = async () => {
       dateItem[map[key]] = ele[key];
     }
     newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   tableData.value = newdata;
 };

+ 15 - 3
src/pages/look/create/index.vue

@@ -138,6 +138,11 @@ const looksubmit = async (point) => {
         dateItem[map[key]] = ele[key];
       }
       newdata.push(dateItem);
+       newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
 
     // console.log(6666,newdata);
@@ -177,6 +182,11 @@ const left1 =async () => {
         dateItem[map[key]] = ele[key];
       }
       newdata.push(dateItem);
+       newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
 
     // console.log(6666,newdata);
@@ -210,11 +220,13 @@ const right1 =async () => {
         dateItem[map[key]] = ele[key];
       }
       newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
-
-    // console.log(6666,newdata);
     tableData.value = newdata;
-    console.log(88, tableData.value);
     
   };
 

+ 35 - 7
src/pages/search/create/index.vue

@@ -8,6 +8,7 @@ import {
   reactive,
   onActivated,
   nextTick,
+  onBeforeUnmount,
   onUnmounted,
 } from "vue";
 import request from "@/api/axios.js";
@@ -126,8 +127,9 @@ const funCurrentChange = async ({ current, currentNode }) => {
   //拿取表格数据
   const res = await request.post(
     "/rest/sql",
-    `SELECT tbname as point,description,ts,val,station,category,facility,uniformcode,rate,remark FROM ${myData.nxxy}.${myData.nxxy1} limit 99;`
+    `SELECT tbname as point,description,ts,val,station,category,facility,uniformcode,rate,remark FROM ${databaseName}.${tableName} limit 99;`
   );
+ 
   //映射数组里的数据
   let newdata = [];
   const map = {
@@ -146,10 +148,16 @@ const funCurrentChange = async ({ current, currentNode }) => {
     let dateItem = {};
     for (let key in ele) {
       dateItem[map[key]] = ele[key];
+    
     }
     dateItem.databaseName = databaseName;
     dateItem.tableName = tableName;
     newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   // console.log(999999,newdata);
 
@@ -240,6 +248,11 @@ const nbsubmit = async () => {
       // dateItem.databaseName = databaseName;
       // dateItem.tableName = tableName;
       newdata.push(dateItem);
+     newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
     console.log('665', newdata);
     tableData.value = newdata;
@@ -275,7 +288,6 @@ const funSubmit = async (params) => {
 let pagenumber = ref(1); //当前的页数
 let pagenb = ref(99); //当前的条数
 
-console.log('667', pagenumber.value);
 const left1 = async () => {
   pagenumber.value -= 1;
 
@@ -306,6 +318,11 @@ const left1 = async () => {
       dateItem[map[key]] = ele[key];
     }
     newdata.push(dateItem);
+   newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   tableData.value = newdata;
 };
@@ -339,6 +356,11 @@ const right1 = async () => {
       dateItem[map[key]] = ele[key];
     }
     newdata.push(dateItem);
+  newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
   });
   tableData.value = newdata;
 };
@@ -375,16 +397,19 @@ const startTimer = async () => {
         dateItem[map[key]] = ele[key];
       }
       newdata.push(dateItem);
+    newdata.forEach((ele)=>{
+let utcTimeStr = ele.ts
+const formattedDateTime = utcTimeStr.replace("T", " ").replace(".000Z", "");
+  ele.ts=formattedDateTime
+    })
     });
     tableData.value = newdata;
-  console.log('8686',tableData.value )
-  }else{
-    clearInterval()
+  // console.log('8686',tableData.value )
   }
 };
 
 // 实时刷新数据
-setInterval(() => {
+const timerId=setInterval(() => {
   startTimer();
   console.log("刷新");
 }, 3000);
@@ -402,7 +427,10 @@ onMounted(() => {
   });
 });
 onUnmounted(() => {
- clearInterval()
+ clearInterval(timerId)
+});
+onBeforeUnmount(() => {
+ clearInterval(timerId)
 });
 
 /**activated */

+ 2 - 2
src/router/index.js

@@ -45,7 +45,7 @@ const routes = [{
             name: 'redis',
             redirect: '/redis/create',
             meta: {
-                title: 'Redis服务',
+                title: '缓存服务',
             },
             component: () =>
                 import(
@@ -57,7 +57,7 @@ const routes = [{
                     path: '/redis/create',
                     name: 'redisCreate',
                     meta: {
-                        title: 'Redis服务',
+                        title: '缓存服务',
                     },
                     component: () =>
                         import(