From 0dbf19e9f92f5cb1d5ca9a06fd268d3b16e466e3 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 07 十二月 2022 15:22:01 +0800
Subject: [PATCH] 完善断流监控,集群和设备详情的查询

---
 src/views/hashrate/HashManage/components/HashCard.vue |  101 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 87 insertions(+), 14 deletions(-)

diff --git a/src/views/hashrate/HashManage/components/HashCard.vue b/src/views/hashrate/HashManage/components/HashCard.vue
index cb0fcd5..d050c20 100644
--- a/src/views/hashrate/HashManage/components/HashCard.vue
+++ b/src/views/hashrate/HashManage/components/HashCard.vue
@@ -1,9 +1,9 @@
 <template>
   <div class="HashCard">
     <div class="hashrate">
-      <img v-if="type == 0" src="/images/hashrate/杞绠楀姏.png" alt="" />
-      <img v-if="type == 1" src="/images/hashrate/瀹炴椂绠楀姏.png" alt="" />
-      <img v-if="type == 2" src="/images/hashrate/鏁版嵁鏍堢畻鍔�.png" alt="" />
+      <img v-if="type == 0" src="/images/hashrate/polling.png" alt="" />
+      <img v-if="type == 1" src="/images/hashrate/realTime2.png" alt="" />
+      <img v-if="type == 2" src="/images/hashrate/static.png" alt="" />
       <div class="hashrateContent">
         <div class="label" v-if="type == 0">杞绠楀姏</div>
         <div class="label" v-if="type == 1">瀹炴椂绠楀姏</div>
@@ -16,9 +16,7 @@
     </div>
     <div class="detail">
       <div class="detailItem">
-        <div class="label">
-          <span class="iconfont">&#xe62f;</span>鎵撳紑鍒嗘瀽寮�鍏�
-        </div>
+        <div class="label"><span class="iconfont">&#xe62f;</span>鎵撳紑鍒嗘瀽寮�鍏�</div>
         <div class="data">
           <span class="number">{{ hashrate.valid }}</span
           >璺�
@@ -38,16 +36,28 @@
           >璺�
         </div>
       </div>
-      <div class="detailItem">
-        <div class="label" title="鍥犳湭鐭ュ師鍥犳湭澶勭悊">
-          <span class="iconfont">&#xe631;</span>鍥犳湭鐭ュ師鍥犳湭澶勭悊
-        </div>
+      <div class="detailItem click" @click="showDetail">
+        <div class="label" title="鍥犳湭鐭ュ師鍥犳湭澶勭悊"><span class="iconfont">&#xe631;</span>鍥犳湭鐭ュ師鍥犳湭澶勭悊</div>
         <div class="data">
           <span class="number">{{ hashrate.noDeal }}</span
           >璺�
         </div>
       </div>
     </div>
+    <el-dialog
+      title="鍙栨祦寮傚父鏁版嵁"
+      destroy-on-close
+      :visible.sync="dialogVisible"
+      width="70%"
+      :before-close="handleClose"
+    >
+      <el-table :data="tableData" stripe style="width: 100%">
+        <el-table-column prop="device" label="璁惧ID" > </el-table-column>
+        <el-table-column prop="name" label="閫氶亾鍚嶇О" > </el-table-column>
+        <el-table-column prop="rtsp" label="閫氶亾鍙�"> </el-table-column>
+      </el-table>
+      
+    </el-dialog>
   </div>
 </template>
 
@@ -55,12 +65,62 @@
 export default {
   props: {
     type: {},
-    hashrate: {},
+    hashrate: {}
   },
   data() {
-    return {};
+    return {
+      page: 1,
+      size: 10, //鍒嗛〉鐩稿叧
+      total: 0, //鎬绘暟,
+
+      id: "",
+      dialogVisible: false,
+      tableData: [
+      ]
+    }
   },
-};
+  methods: {
+    showDetail() {
+      console.log(this.hashrate)
+
+      // 鏈夋柇娴佹憚鍍忔満鐨勪俊鎭墠鏄剧ず, 鍏朵粬鍘熷洜涓嶅睍绀烘槑缁�
+      if (this.hashrate.hasOwnProperty("duanliu") && this.hashrate.duanliu.length > 0) {
+        this.tableData = []
+        this.hashrate.duanliu.forEach(element => {
+          let cameraInfo = element.split("->")
+          if (cameraInfo.length != 4) {
+            return
+          }
+          
+          this.tableData.push({
+            "device":cameraInfo[0],
+            "name":cameraInfo[2],
+            "rtsp":cameraInfo[3]
+            })            
+        });
+
+        this.dialogVisible = true
+      }
+    },
+    refrash(page) {
+      this.page = page
+      this.lookUp()
+    },
+    handleSizeChange(size) {
+      this.size = size
+      this.lookUp()
+    },
+
+    handleClose(done) {
+      // this.dialogVisible = false
+      // this.$confirm("纭鍏抽棴锛�")
+      //   .then((_) => {
+      done()
+      // })
+      // .catch((_) => {})
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -150,6 +210,19 @@
         border-right: 1px solid #e9ebee;
       }
     }
+
+    .click{
+      cursor: pointer;
+    }
   }
 }
-</style>
\ No newline at end of file
+.el-pagination ::v-deep {
+  margin-top: 30px;
+
+  text-align: center;
+  height: 24px;
+  .el-pagination__sizes {
+    margin-right: 0;
+  }
+}
+</style>

--
Gitblit v1.8.0