From bbc45d35dbf86e375fa8d09879f887673ec0fe19 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 02 十二月 2022 01:58:41 +0800
Subject: [PATCH] 完成断流监控前端显示

---
 src/views/hashrate/HashManage/components/HashCard.vue |   84 ++++++++++++++---------------------------
 1 files changed, 29 insertions(+), 55 deletions(-)

diff --git a/src/views/hashrate/HashManage/components/HashCard.vue b/src/views/hashrate/HashManage/components/HashCard.vue
index c512a86..b1b63a0 100644
--- a/src/views/hashrate/HashManage/components/HashCard.vue
+++ b/src/views/hashrate/HashManage/components/HashCard.vue
@@ -36,7 +36,7 @@
           >璺�
         </div>
       </div>
-      <div class="detailItem" @click="dialogVisible = true">
+      <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
@@ -45,46 +45,18 @@
       </div>
     </div>
     <el-dialog
-      title="寮傚父鏁版嵁鏌ヨ"
+      title="鍙栨祦寮傚父鏁版嵁"
       destroy-on-close
       :visible.sync="dialogVisible"
-      width="40%"
+      width="70%"
       :before-close="handleClose"
     >
-      <!-- <div style="width: 600px">
-        v-if="dialogVisible"
-      </div> -->
-      <el-row :gutter="50">
-        <el-col :span="15">
-          <el-form label-width="140px">
-            <el-form-item label="鎽勫儚鏈哄悕绉�/閫氶亾鍙�">
-              <el-input placeholder="璇疯緭鍑烘憚鍍忔満鍚嶇О/閫氶亾鍙�" v-model="id"></el-input>
-            </el-form-item>
-          </el-form>
-        </el-col>
-        <el-col :span="9"><el-button type="primary">鏌ヨ</el-button></el-col>
-      </el-row>
       <el-table :data="tableData" stripe style="width: 100%">
-        <el-table-column prop="date" label="鏃ユ湡" width="180"> </el-table-column>
-        <el-table-column prop="name" label="濮撳悕" width="180"> </el-table-column>
-        <el-table-column prop="address" label="鍦板潃"> </el-table-column>
+        <el-table-column prop="device" label="璁惧" > </el-table-column>
+        <el-table-column prop="name" label="鍚嶇О" > </el-table-column>
+        <el-table-column prop="rtsp" label="閫氶亾鍙�"> </el-table-column>
       </el-table>
-      <div>
-        <el-pagination
-          @current-change="refrash"
-          @size-change="handleSizeChange"
-          :current-page="page"
-          :page-size="size"
-          layout="total, sizes, prev, pager, next, jumper"
-          :page-sizes="[5, 10, 15, 20, 25]"
-          :total="total"
-          background
-        ></el-pagination>
-      </div>
-      <!-- <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
-        <el-button type="primary" @click="dialogVisible = false">纭� 瀹�</el-button>
-      </span> -->
+      
     </el-dialog>
   </div>
 </template>
@@ -104,30 +76,28 @@
       id: "",
       dialogVisible: false,
       tableData: [
-        {
-          date: "2016-05-02",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
-        },
-        {
-          date: "2016-05-04",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�"
-        },
-        {
-          date: "2016-05-01",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�"
-        },
-        {
-          date: "2016-05-03",
-          name: "鐜嬪皬铏�",
-          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�"
-        }
       ]
     }
   },
   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("->")
+          this.tableData.push({
+            "device":cameraInfo[0],
+            "name":cameraInfo[1],
+            "rtsp":cameraInfo[2]
+            })            
+        });
+
+        this.dialogVisible = true
+      }
+    },
     refrash(page) {
       this.page = page
       this.lookUp()
@@ -236,6 +206,10 @@
         border-right: 1px solid #e9ebee;
       }
     }
+
+    .click{
+      cursor: pointer;
+    }
   }
 }
 .el-pagination ::v-deep {

--
Gitblit v1.8.0