Browse Source

修改设备快捷添加及样式修改

plg 11 months ago
parent
commit
816bb54419

BIN
src/renderer/assets/manage/bg_title.png


+ 49 - 46
src/renderer/components/AnimationDes.vue

@@ -202,32 +202,34 @@
         <el-button type="primary" @click="tableVisible = false">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog
-      class="dialog_bo"
-      title="查看波形图"
-      :visible.sync="echartsVisible"
-      width="90%"
-      center
-    >
-      <div class="dialog_height">
-        <div class="outPage" v-show="equipment == '1'">
-          <div id="eegOne" class="naoOneClass"></div>
-        </div>
-        <div class="outPage" v-show="equipment == '1'">
-          <div id="eegTwo" class="naoOneClass"></div>
-        </div>
-        <div class="outThreePage" v-show="equipment == '1'">
-          <div id="eegThree" class="naoOneClass"></div>
-        </div>
-        <div class="outPage" v-show="equipment == '2'">
-          <div id="ecgOne" class="naoOneClass" style="height: 500px"></div>
+    <div class="dialog1">
+      <el-dialog
+        class="dialog_bo"
+        title="查看波形图"
+        :visible.sync="echartsVisible"
+        width="90%"
+        center
+      >
+        <div class="dialog_height">
+          <div class="outPage" v-show="equipment == '1'">
+            <div id="eegOne" class="naoOneClass"></div>
+          </div>
+          <div class="outPage" v-show="equipment == '1'">
+            <div id="eegTwo" class="naoOneClass"></div>
+          </div>
+          <div class="outThreePage" v-show="equipment == '1'">
+            <div id="eegThree" class="naoOneClass"></div>
+          </div>
+          <div class="outPage" v-show="equipment == '2'">
+            <div id="ecgOne" class="naoOneClass" style="height: 500px"></div>
+          </div>
         </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="echartsVisible = false">取 消</el-button>
-        <el-button type="primary" @click="echartsVisible = false">确 定</el-button>
-      </span>
-    </el-dialog>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="echartsVisible = false">取 消</el-button>
+          <el-button type="primary" @click="echartsVisible = false">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
   </div>
 </template>
 <script>
@@ -393,8 +395,8 @@ export default {
       focusNao: [],
       // 全量
       focusNaoAll: [],
-      // urlThreeP: "../../../static/loong_3/index.html",
-      urlThreeP: __static + "/loong_3/index.html",
+      urlThreeP: "../../../static/loong_3/index.html",
+      // urlThreeP: __static + "/loong_3/index.html",
       pubsrc: __static,
       userLink: {
         num: "",
@@ -1683,8 +1685,8 @@ export default {
       this.clearDataFun();
       switch (val) {
         case 1:
-          // this.urlThreeP = "../../../static/loong_3/index.html";
-          this.urlThreeP = __static + "/loong_3/index.html";
+          this.urlThreeP = "../../../static/loong_3/index.html";
+          // this.urlThreeP = __static + "/loong_3/index.html";
           this.delayTime();
           break;
         case 2:
@@ -1840,9 +1842,7 @@ export default {
           text: "频谱成分",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -2162,9 +2162,7 @@ export default {
           text: "注意力指标",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -2315,9 +2313,7 @@ export default {
           text: "原始信号",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -2379,11 +2375,7 @@ export default {
   },
 };
 </script>
-<style>
-.dialog_bo >>> .el-dialog {
-  background: #000000 !important;
-}
-</style>
+
 <style scoped>
 .equipment_status {
   display: flex;
@@ -2487,9 +2479,9 @@ canvas {
   overflow: auto;
 }
 
-/* .outPage{
-  background-color:#ffffff !important;
-} */
+.outPage {
+  margin-bottom: 20px;
+}
 .naoOneClass {
   width: 100%;
   height: 30vh;
@@ -2497,3 +2489,14 @@ canvas {
   background-color: #ffffff !important;
 }
 </style>
+<style>
+.dialog_bo .el-dialog {
+  background: #efefef !important ;
+}
+.dialog_bo .el-dialog__title{
+  line-height: 20px;
+  font-size: 20px;
+  color: #303133;
+  font-weight: 600;
+}
+</style>

+ 47 - 24
src/renderer/components/AnimationDouble.vue

@@ -274,8 +274,14 @@
         <el-button type="primary" @click="userComfirm">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="查看波形图" :visible.sync="echartsVisible" width="90%" center>
-      <span>
+    <el-dialog
+      title="查看波形图"
+      class="dialog_bo1"
+      :visible.sync="echartsVisible"
+      width="90%"
+      center
+    >
+      <div class="dialog_height">
         <div class="outPage" v-show="equipment == '1'">
           <div id="eegOne" class="naoOneClass"></div>
         </div>
@@ -288,7 +294,7 @@
         <div class="outPage" v-show="equipment == '2'">
           <div id="ecgOne" class="naoOneClass" style="height: 500px"></div>
         </div>
-      </span>
+      </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="echartsVisible = false">取 消</el-button>
         <el-button type="primary" @click="echartsVisible = false">确 定</el-button>
@@ -296,8 +302,14 @@
     </el-dialog>
 
     <!-- //第二个人的渲染图 -->
-    <el-dialog title="查看波形图" :visible.sync="echartsSecondVisible" width="90%" center>
-      <span>
+    <el-dialog
+      title="查看波形图"
+      class="dialog_bo2"
+      :visible.sync="echartsSecondVisible"
+      width="90%"
+      center
+    >
+      <div class="dialog_height">
         <div class="outPage" v-show="equipment == '1'">
           <div id="eegOneSecond" class="naoOneClass"></div>
         </div>
@@ -310,7 +322,7 @@
         <div class="outPage" v-show="equipment == '2'">
           <div id="ecgTwo" class="naoOneClass" style="height: 500px"></div>
         </div>
-      </span>
+      </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="echartsSecondVisible = false">取 消</el-button>
         <el-button type="primary" @click="echartsSecondVisible = false">确 定</el-button>
@@ -2595,9 +2607,7 @@ export default {
           text: "频谱成分",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -2917,9 +2927,7 @@ export default {
           text: "注意力指标",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -3070,9 +3078,7 @@ export default {
           text: "原始信号",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -3156,9 +3162,7 @@ export default {
           text: "频谱成分",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -3482,9 +3486,7 @@ export default {
           text: "注意力指标",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -3640,9 +3642,7 @@ export default {
           text: "原始信号",
           subtext: "",
           left: "center",
-          align: "right",
-          x: "center",
-          y: "bottom",
+          bottom: "20",
         },
         grid: {
           bottom: 80,
@@ -3730,6 +3730,12 @@ canvas {
 }
 </style>
 <style>
+.dialog_bo1 .el-dialog {
+  background: #efefef !important ;
+}
+.dialog_bo2 .el-dialog {
+  background: #efefef !important ;
+}
 .footer {
   text-align: center;
 }
@@ -3802,4 +3808,21 @@ canvas {
 
   flex-direction: row;
 }
+.dialog_height {
+  height: 500px;
+  overflow: auto;
+}
+.dialog_bo1 .el-dialog__title {
+  line-height: 20px;
+  font-size: 20px;
+  color: #303133;
+  font-weight: 600;
+}
+
+.dialog_bo2 .el-dialog__title {
+  line-height: 20px;
+  font-size: 20px;
+  color: #303133;
+  font-weight: 600;
+}
 </style>

+ 62 - 4
src/renderer/components/ManageEquipment.vue

@@ -35,7 +35,7 @@
             </el-table-column>
             <el-table-column prop="Mac" align="center" label="mac"> </el-table-column>
 
-            <el-table-column label="操作" align="center">
+            <el-table-column label="操作" align="center" width='100px'>
               <template slot-scope="scope">
                 <!-- <el-button
                   class="xl_d_button"
@@ -93,7 +93,7 @@
             >
             </el-table-column>
             <el-table-column prop="mac" align="center" label="mac"> </el-table-column>
-            <el-table-column label="操作" align="center">
+            <el-table-column label="操作" align="center" width='200px'>
               <template slot-scope="scope">
                 <el-button
                   :disabled="buttonLinkFlag"
@@ -105,6 +105,18 @@
                   <span v-if="scope.row.connect">断开连接</span
                   ><span v-if="!scope.row.connect">连接</span></el-button
                 >
+
+                <el-button
+                style='margin-top:10px'
+                  v-show="scope.row.addFlag"
+                  :disabled="buttonLinkFlag"
+                  class="xl_d_button"
+                  size="mini"
+                  slot="reference"
+                  @click="addEquiLine(scope.row)"
+                >
+                  <span>添加至设备列表</span>
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -127,6 +139,12 @@
     <el-dialog :visible.sync="centerDialogVisible" width="545px" center class="dig_equi">
       <div slot="title" class="title_di" style="width: 545px">
         <img width="545px" src="../assets/manage/bg_di.png" />
+        <img
+          class="equipment_bg"
+          width="85px"
+          height="85px"
+          src="../assets/manage/bg_title.png"
+        />
       </div>
       <span class="min_equi">
         <div class="equipment_class">
@@ -239,6 +257,22 @@ export default {
     //离开之后断开websocket连接
   },
   methods: {
+    //新增设备
+    addEquiLine(val) {
+      let path = "v1/device/add";
+      let data = {
+        type: val.type,
+        mac: val.mac,
+      };
+      this.$http.postTmp(path, data, (res) => {
+        if (res.data.code == 200) {
+          this.$message.success('添加成功');
+          this.queryEle();
+        } else {
+          this.$message.error(res.data.message);
+        }
+      });
+    },
     //状态切换
     linkJudge(index, val, flag) {
       if (flag) {
@@ -279,8 +313,11 @@ export default {
       }
     },
     rssiFor(val) {
+      debugger;
       if (val == 0) {
         return "";
+      }else{
+        return val.rssi
       }
     },
     nameFormatter(val) {
@@ -379,7 +416,7 @@ export default {
       let that = this;
       //数据接收
       const redata = JSON.parse(e.data);
-      // console.log(redata);
+      console.log(redata);
       // if(redata.content == "设备连接成功"){
       //   console.log(redata);
       // }
@@ -776,7 +813,23 @@ export default {
       }
       //将数组其他选项
 
-      this.mergeData = currentDeviceList;
+      //将此数组与设备列表数组进行比较
+      let finalData = [];
+      finalData = JSON.parse(JSON.stringify(currentDeviceList));
+
+      for (let p = 0; p < finalData.length; p++) {
+        finalData[p].addFlag = true;
+      }
+
+      for (let p = 0; p < finalData.length; p++) {
+        for (let m = 0; m < this.tableData.length; m++) {
+          if (finalData[p].mac == this.tableData[m].Mac) {
+            finalData[p].addFlag = false;
+          }
+        }
+      }
+      console.log(finalData)
+      this.mergeData = finalData;
     },
     changeList(obj) {
       // console.log(obj);
@@ -1006,4 +1059,9 @@ export default {
   font-weight: normal;
   font-size: 20px;
 }
+.equipment_bg {
+  position: absolute;
+  left: 10px;
+  top: -10px;
+}
 </style>