Browse Source

Merge branch 'master' of http://101.43.129.26:10880/psychological_camera/RZGY

root 1 year ago
parent
commit
653d16f4c2

+ 5 - 2
src/main/index.js

@@ -419,6 +419,9 @@ const startJiZhantoothServer = function () {
 
 startJiZhantoothServer();
 
+
+
+
 const startBluetoothServer = function () {
   let syncData = cmd.runSync('netstat -ano|findstr 8000')
   if (syncData.data === null || syncData.data.trim().toUpperCase().indexOf('LISTENING') <= 0) {
@@ -437,7 +440,7 @@ const startBluetoothServer = function () {
   }
 }
 
-startBluetoothServer();
+
 
 //增加pyhton中解析心电代码
 //用户1的心电处理方法
@@ -1211,7 +1214,7 @@ ipcMain.on('main-windows-python-exe', function (event, arg) {
   }
   if (arg.type === 'startJar') {
     startJar()
-
+    startBluetoothServer();
   }
   if (arg.type === 'webGlobal') {
     //

+ 222 - 88
src/renderer/components/AnimationDes.vue

@@ -10,27 +10,59 @@
       <el-col :span="1">&nbsp;</el-col>
     </el-row> -->
 
-
     <div class="main_sp">
-      <div style="flex:1"></div>
+      <div style="flex: 1">&nbsp;</div>
       <div class="main_second">
         <div class="select_class_animation">
           <span class="desSty">选择设备</span>&nbsp;
-          <el-select v-model="equipment" placeholder="请选择" class="selectSty" size="mini" @change="equipmentFun">
-            <el-option class="select_option" v-for="item in optionsEquipment" :key="item.value" :label="item.label"
-              :value="item.value">
+          <el-select
+            v-model="equipment"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="equipmentFun"
+          >
+            <el-option
+              class="select_option"
+              v-for="item in optionsEquipment"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
           &nbsp;&nbsp;&nbsp;&nbsp;
           <span class="desSty">游戏难度</span>&nbsp;
-          <el-select v-model="gameDifficulty" placeholder="请选择" class="selectSty" size="mini" @change="gameDiffFun">
-            <el-option v-for="item in difficultyOptions" :key="item.value" :label="item.label" :value="item.value">
+          <el-select
+            v-model="gameDifficulty"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="gameDiffFun"
+          >
+            <el-option
+              v-for="item in difficultyOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
           &nbsp;&nbsp;&nbsp;&nbsp;
           <span class="desSty">游戏时间</span>&nbsp;
-          <el-select v-model="gameTime" placeholder="请选择" class="selectSty" size="mini" @change="gameTimeFun">
-            <el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value">
+          <el-select
+            v-model="gameTime"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="gameTimeFun"
+          >
+            <el-option
+              v-for="item in timeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
           &nbsp;&nbsp;&nbsp;&nbsp;
@@ -42,49 +74,101 @@
               >设备已连接:</span
             > -->
             <!-- <span class="desSty" v-show="!linkStatus">设备未连接:</span> -->
-            <img v-show="!linkStatus" @click="openTableFun" style="width: 70px; height: 24px; color: #ffffff"
-              src="../assets/newAnimation/lanya1.png" />
-            <img v-show="linkStatus" @click="openTableFun" style="width: 70px; height: 24px; color: #ffffff"
-              src="../assets/newAnimation/lanyaActive1.png" />
+            <img
+              v-show="!linkStatus"
+              @click="openTableFun"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanya1.png"
+            />
+            <img
+              v-show="linkStatus"
+              @click="openTableFun"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanyaActive1.png"
+            />
           </div>
           &nbsp;&nbsp;&nbsp;&nbsp;
-          <i class="el-icon-search" @click="viewEchartsFun(1)" style="margin-left:2px;font-size: 12px;"
-            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"></i>&nbsp;
-          <span class="desSty" @click="viewEchartsFun"
-            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }">查看波形图</span>
+          <i
+            class="el-icon-search"
+            @click="viewEchartsFun(1)"
+            style="margin-left: 2px; font-size: 12px"
+            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"
+          ></i
+          >&nbsp;
+          <span
+            class="desSty"
+            @click="viewEchartsFun"
+            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"
+            >查看波形图</span
+          >
           &nbsp;&nbsp;&nbsp;&nbsp;
-          <span style="font-size: 12px" v-show="equipment == '2' && pulseTimeNum < 180 && pulseTimeNum > 0">还剩{{
-      timeShow }}开始
+          <span
+            style="font-size: 12px"
+            v-show="equipment == '2' && pulseTimeNum < 180 && pulseTimeNum > 0"
+            >还剩{{ timeShow }}开始
           </span>
-          <span style="font-size: 12px" v-show="buttonFlag == '结束' && gameTimeTimerFlag">{{ timeShow }}</span>
+          <span
+            style="font-size: 12px"
+            v-show="buttonFlag == '结束' && gameTimeTimerFlag"
+            >{{ timeShow }}</span
+          >
           <div class="animation-middle-m">&nbsp;</div>
-          <el-button @click="startTest" size="small" class="xl_animation_button"
-            style="float: right; font-size: 12px">{{ buttonFlag }}</el-button>
+          <el-button
+            @click="startTest"
+            size="small"
+            class="xl_animation_button"
+            style="float: right; font-size: 12px"
+            >{{ buttonFlag }}</el-button
+          >
         </div>
 
-
-
         <div class="flood-plan-page" ref="animationFlow">
-          <iframe scrolling="no" :src="urlThreeP" ref="unityIframe" frameborder="0" :width="widthIframe"
-            :height="heightIframe">
+          <iframe
+            scrolling="yes"
+            v-if="visibleFlag"
+            :src="urlThreeP"
+            ref="unityIframe"
+            width="100px"
+            frameborder="0"
+            :width="widthIframe"
+            :height="heightIframe"
+          >
           </iframe>
         </div>
       </div>
-      <div style="flex:1"></div>
-
-
+      <div style="flex: 1">&nbsp;</div>
     </div>
 
-    <el-dialog title="提示" :visible.sync="tableVisible" width="60%" center :before-close="closeScan">
+    <el-dialog
+      title="提示"
+      :visible.sync="tableVisible"
+      width="60%"
+      center
+      :before-close="closeScan"
+    >
       <span>
-        <el-table :data="mergeData" style="width: 100%; height: 400px" :header-cell-style="{
-      background: '#66B497',
-      color: '#FFFFFF',
-      'letter-spacing': '4px',
-    }">
-          <el-table-column prop="rssi" align="center" label="信号强度" :formatter="rssiFor">
+        <el-table
+          :data="mergeData"
+          style="width: 100%; height: 400px"
+          :header-cell-style="{
+            background: '#66B497',
+            color: '#FFFFFF',
+            'letter-spacing': '4px',
+          }"
+        >
+          <el-table-column
+            prop="rssi"
+            align="center"
+            label="信号强度"
+            :formatter="rssiFor"
+          >
           </el-table-column>
-          <el-table-column prop="deviceType" align="center" label="类型" :formatter="typeFormatter">
+          <el-table-column
+            prop="deviceType"
+            align="center"
+            label="类型"
+            :formatter="typeFormatter"
+          >
           </el-table-column>
           <!-- <el-table-column
                 prop="Name"
@@ -99,9 +183,16 @@
 
           <el-table-column label="操作" align="center">
             <template slot-scope="scope">
-              <el-button :disabled="buttonLinkFlag" class="xl_d_button" size="mini" slot="reference"
-                @click="linkJudge(scope.$index, scope.row, scope.row.connect)">
-                <span v-if="scope.row.connect">断开连接</span><span v-if="!scope.row.connect">连接</span></el-button>
+              <el-button
+                :disabled="buttonLinkFlag"
+                class="xl_d_button"
+                size="mini"
+                slot="reference"
+                @click="linkJudge(scope.$index, scope.row, scope.row.connect)"
+              >
+                <span v-if="scope.row.connect">断开连接</span
+                ><span v-if="!scope.row.connect">连接</span></el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -111,8 +202,14 @@
         <el-button type="primary" @click="tableVisible = false">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="查看波形图" :visible.sync="echartsVisible" width="90%" center>
-      <span>
+    <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>
@@ -125,7 +222,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>
@@ -145,6 +242,7 @@ const RingBuffer = require("ringbufferjs");
 export default {
   data() {
     return {
+      visibleFlag: true,
       activeName: "first",
       //echarts渲染标志
       echartsVisible: false,
@@ -357,12 +455,16 @@ export default {
     var k = 1;
     var flagAnimation = true;
     window.addEventListener("resize", function () {
-      console.log('窗口')
-      // that.getSize();
+      console.log("窗口");
       if (flagAnimation) {
         setTimeout(() => {
           console.log("窗口变化了,需要调整");
           that.getSize();
+
+          // setTimeout(() => {
+          //   that.changeGame(parseInt(that.$route.query.gameType));
+          //   console.log(that.$route.query.gameType);
+          // }, 1000);
           //当前是脑电时,且打开的窗口是第一个用户时
           if (that.equipment == "1") {
             if (that.echartsVisible) {
@@ -386,7 +488,6 @@ export default {
     }, 0);
     setTimeout(() => {
       that.changeGame(parseInt(that.$route.query.gameType));
-      console.log(that.$route.query.gameType);
     }, 0);
     that.singleFlag = that.$route.query.single;
 
@@ -421,12 +522,10 @@ export default {
     this.closeScan();
     this.disconnectDevice();
   },
-  destroyed() { },
+  destroyed() {},
   methods: {
     initHRV(event, arg) {
       let that = this;
-      console.log("INITHRV");
-      console.log(arg);
       let data1 = "";
       //判断arg是否为空
       if (arg === "") {
@@ -451,7 +550,7 @@ export default {
         data1 = arg.data1;
         //判断返回值是否包含rmssd对象
         // data1.hasOwnProperty('rmssd')
-        console.log(data1.hasOwnProperty("rmssd"));
+
         if (data1.hasOwnProperty("rmssd")) {
           let a = data1.rmssd.toFixed(2);
           let b = (a - 15) * 4;
@@ -485,18 +584,15 @@ export default {
     },
     //单人人向传输数据
     sendAtten() {
-      // this.attentionAnimation = Math.random();
-      // console.log(this.attentionAnimation);
       let val = this.attentionAnimation;
       let a = parseFloat(val / 100);
       this.send(a);
     },
     readFile() {
-      console.log("--------");
       let bb = [];
       //判断长度是否超过 30秒
       //然后取30秒数据
-      console.log(this.userLink.ecgAllList.length);
+      // console.log(this.userLink.ecgAllList.length);
       if (this.userLink.ecgAllList.length >= 3000) {
         bb = this.userLink.ecgAllList.slice(this.userLink.ecgAllList.length - 3000);
         let cc = [];
@@ -831,8 +927,6 @@ export default {
           //判断当前的列表是否存在该用户已点击的列表
         });
       }
-
-
     },
     typeFormatter(val) {
       if (val.type == "1") {
@@ -849,15 +943,14 @@ export default {
     //开启扫描扫描
     queryScan() {
       let that = this;
-      that.$http.getTmp(`/v2/device/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/scan`, {}, (res) => {});
     },
 
     //关闭扫描
     closeScan() {
-
       this.tableVisible = false;
       let that = this;
-      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => {});
     },
     //进来后先连接websocket
     //连上后进行扫描
@@ -892,7 +985,8 @@ export default {
       let that = this;
       //数据接收
       const redata = JSON.parse(e.data);
-      console.log(redata)
+      console.log("websocket接收的数据如下");
+      console.log(redata);
       if (
         redata.content != "开启扫描成功" &&
         redata.content != "设置过滤成功" &&
@@ -986,7 +1080,6 @@ export default {
               };
 
               that.isSelectedList.push(obj);
-              // console.log(obj)
 
               //创建一个变量,将变量赋值根据mac进行去重
               let list = JSON.parse(JSON.stringify(that.isSelectedList));
@@ -1017,7 +1110,6 @@ export default {
                 for (let k = 0; k < listStatus.length; k++) {
                   if (listStatus[k].mac == that.userLink.mac) {
                     that.linkStatus = true;
-                    console.log(true);
                   }
                 }
               } else {
@@ -1052,7 +1144,6 @@ export default {
                 that.userLink.mac = "";
               }
             } else if (redata.msgType == "connect") {
-              console.log("1111111111111111");
               console.log(dataLin);
               //设备正在等待
               //设备连接成功
@@ -1207,7 +1298,7 @@ export default {
     },
     equipmentFun(val) {
       //将发送的数据改为0
-      this.attentionAnimation=0;
+      this.attentionAnimation = 0;
       //先判断当选择的设备是否连接
       //如果已连接,则继续测试
       //如果未连接则提示连接设备
@@ -1231,12 +1322,13 @@ export default {
     //断开所有设备的操作
     disconnectDevice() {
       let that = this;
+      that.$http.postTmp(`v2/device/dis/connAll`, {}, (res) => {
+        if (res.data.code == 200) {
+        } else {
+          this.$message.error(res.message);
+        }
+      });
       //获取到当前已连接的列表
-      let list = JSON.parse(JSON.stringify(this.connectedData));
-      console.log(list);
-      for (let i = 0; i < list.length; i++) {
-        that.disconnectEquipment(list[i]);
-      }
     },
     //需要先判断代码是否点击开始测试按钮了
     //如果点击开始测试按钮了//才能发送信号到游戏
@@ -1532,13 +1624,41 @@ export default {
       console.log(params);
       console.log("游戏和数据保存");
     },
-    setUrl() { },
+    setUrl() {},
     getSize() {
-      let width = this.$refs.animationFlow.clientWidth;
-      let height = this.$refs.animationFlow.clientHeight - 40;
-      this.widthIframe = width;
-      this.heightIframe = height;
-      this.changeSize(width, height);
+      let that = this;
+      // this.changeSize(100, 100);
+      that.visibleFlag = false;
+      setTimeout(() => {
+        that.visibleFlag = true;
+        let width = that.$refs.animationFlow.clientWidth;
+        let height = that.$refs.animationFlow.clientHeight - 40;
+        that.widthIframe = width;
+        that.heightIframe = height;
+
+        that.changeSize(width, height);
+      }, 0);
+      // let that =this;
+      // let width = that.$refs.animationFlow.clientWidth;
+      // let height = that.$refs.animationFlow.clientHeight-40;
+      // that.widthIframe = width;
+      // that.heightIframe = height;
+      // console.log(width, height)
+      // that.changeSize(width, height);
+
+      // setTimeout(() => {
+      //   that.changeGame1()
+      // },0 );
+      // setTimeout(() => {
+      //   that.changeGame(parseInt(that.$route.query.gameType))
+      // },20 );
+      // that.changeGame(parseInt(that.$route.query.gameType));
+      // let width = this.$refs.animationFlow.clientWidth;
+      // let height = this.$refs.animationFlow.clientHeight;
+      // this.widthIframe = width;
+      // this.heightIframe = height;
+      // console.log(width, height)
+      // this.changeSize(width, height);
     },
     changeSize(width, height) {
       this.$refs.unityIframe.contentWindow.changeSize(width, height);
@@ -1553,9 +1673,10 @@ export default {
     // },
     delayTime() {
       let that = this;
+
       setTimeout(() => {
         that.getSize();
-      }, 5000);
+      }, 0);
     },
     changeGame(val) {
       console.log(val);
@@ -2258,6 +2379,11 @@ export default {
   },
 };
 </script>
+<style>
+.dialog_bo >>> .el-dialog {
+  background: #000000 !important;
+}
+</style>
 <style scoped>
 .equipment_status {
   display: flex;
@@ -2269,7 +2395,7 @@ export default {
   height: 100vh !important;
   display: flex !important;
   flex-direction: column;
-  overflow-y: auto !important;
+  overflow: hidden;
   background: #ffffff;
 }
 
@@ -2302,9 +2428,10 @@ canvas {
 }
 
 .flood-plan-page {
-  margin-top:20px;
+  margin-top: 20px;
   flex: 1;
   width: 100%;
+  overflow: visible;
 }
 
 .selectSty {
@@ -2319,7 +2446,8 @@ canvas {
   /* color: #0f0f0f; */
 }
 
-.animation_fk {}
+.animation_fk {
+}
 
 .select_option {
   font-size: 10px;
@@ -2337,18 +2465,10 @@ canvas {
   flex: 1;
 }
 
-.naoOneClass {
-  width: 100%;
-  height: 30vh;
-  width: 100%;
-}
-
 .main_sp {
   display: flex;
   flex: 1;
-
   flex-direction: row;
-
 }
 
 .main_top {
@@ -2360,6 +2480,20 @@ canvas {
 .main_second {
   display: flex;
   flex-direction: column;
-  flex:22;
+  flex: 22;
+}
+.dialog_height {
+  height: 500px;
+  overflow: auto;
+}
+
+/* .outPage{
+  background-color:#ffffff !important;
+} */
+.naoOneClass {
+  width: 100%;
+  height: 30vh;
+  width: 100%;
+  background-color: #ffffff !important;
 }
 </style>

+ 213 - 80
src/renderer/components/AnimationDouble.vue

@@ -2,57 +2,120 @@
   <div class="main_right_height">
     <TopDes :flag="true" topDesFont="生物反馈记录"></TopDes>
 
-    <div class='main_sp'>
-      <div style="flex:1"></div>
+    <div class="main_sp">
+      <div style="flex: 1"></div>
       <div class="main_second">
-
         <div class="select_class_animation">
           <span class="desSty">选择设备</span>&nbsp;
-          <el-select v-model="equipment" placeholder="请选择" class="selectSty" size="mini" @change="equipmentFun">
-            <el-option class="select_option" v-for="item in optionsEquipment" :key="item.value" :label="item.label"
-              :value="item.value">
+          <el-select
+            v-model="equipment"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="equipmentFun"
+          >
+            <el-option
+              class="select_option"
+              v-for="item in optionsEquipment"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
           &nbsp;&nbsp;&nbsp;&nbsp;
           <span class="desSty">游戏难度</span>&nbsp;
-          <el-select v-model="gameDifficulty" placeholder="请选择" class="selectSty" size="mini" @change="gameDiffFun">
-            <el-option v-for="item in difficultyOptions" :key="item.value" :label="item.label" :value="item.value">
+          <el-select
+            v-model="gameDifficulty"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="gameDiffFun"
+          >
+            <el-option
+              v-for="item in difficultyOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
           &nbsp;&nbsp;&nbsp;&nbsp;
           <span class="desSty">游戏时间</span>&nbsp;
-          <el-select v-model="gameTime" placeholder="请选择" class="selectSty" size="mini" @change="gameTimeFun">
-            <el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value">
+          <el-select
+            v-model="gameTime"
+            placeholder="请选择"
+            class="selectSty"
+            size="mini"
+            @change="gameTimeFun"
+          >
+            <el-option
+              v-for="item in timeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
 
           &nbsp;&nbsp;&nbsp;&nbsp;
-          <span style="font-size: 12px" v-show="equipment == '2' && pulseTimeNum < 180 && pulseTimeNum > 0">还剩{{
-      timeShow }}开始</span>
-          <span style="font-size: 12px" v-show="buttonFlag == '结束' && gameTimeTimerFlag">{{ timeShow }}</span>
+          <span
+            style="font-size: 12px"
+            v-show="equipment == '2' && pulseTimeNum < 180 && pulseTimeNum > 0"
+            >还剩{{ timeShow }}开始</span
+          >
+          <span
+            style="font-size: 12px"
+            v-show="buttonFlag == '结束' && gameTimeTimerFlag"
+            >{{ timeShow }}</span
+          >
           <div class="animation-middle-m">&nbsp;</div>
-          <el-button @click="startTest" size="small" class="xl_animation_button"
-            style="float: right; font-size: 12px">{{ buttonFlag }}</el-button>
+          <el-button
+            @click="startTest"
+            size="small"
+            class="xl_animation_button"
+            style="float: right; font-size: 12px"
+            >{{ buttonFlag }}</el-button
+          >
         </div>
         <div class="select_class_animation" style="margin-top: 10px">
           <div class="equipment_status">
             <div class="desSty">用户编号:</div>
-            <div class="desSty user_num" v-show="userLink.num != ''">{{ userLink.num }}</div>
+            <div class="desSty user_num" v-show="userLink.num != ''">
+              {{ userLink.num }}
+            </div>
             <!-- <div class="desSty user_num" v-show="true">{{ '111111111111111111111111' }}</div> -->
             &nbsp;&nbsp;&nbsp;&nbsp;
             <!-- <span class="desSty" v-show="userLink.linkStatus"
               :style="{ color: userLink.linkStatus ? '#0FB577' : '#000000' }">设备已连接:</span>
             <span class="desSty" v-show="!userLink.linkStatus">设备未连接:</span> -->
-            <img v-show="!userLink.linkStatus" @click="openTableFun(1)"
-              style="width: 70px; height: 24px; color: #ffffff" src="../assets/newAnimation/lanya1.png" />
-            <img v-show="userLink.linkStatus" @click="openTableFun(1)" style="width: 70px; height: 24px; color: #ffffff"
-              src="../assets/newAnimation/lanyaActive1.png" />
+            <img
+              v-show="!userLink.linkStatus"
+              @click="openTableFun(1)"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanya1.png"
+            />
+            <img
+              v-show="userLink.linkStatus"
+              @click="openTableFun(1)"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanyaActive1.png"
+            />
           </div>
           &nbsp;&nbsp;&nbsp;&nbsp;
-          <i class="el-icon-search" @click="viewEchartsFun(1)" style="margin-left:2px;font-size: 12px;"
-            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"></i>&nbsp;
-          <span class="desSty" @click="viewEchartsFun(1)"
-            :style="{ color: userLink.linkStatus ? '#1FD18E' : '#1FD18E' }">查看波形图</span>
+          <i
+            class="el-icon-search"
+            @click="viewEchartsFun(1)"
+            style="margin-left: 2px; font-size: 12px"
+            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"
+          ></i
+          >&nbsp;
+          <span
+            class="desSty"
+            @click="viewEchartsFun(1)"
+            :style="{ color: userLink.linkStatus ? '#1FD18E' : '#1FD18E' }"
+            >查看波形图</span
+          >
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <div class="equipment_status">
             <div class="desSty">用户编号:</div>
@@ -61,38 +124,80 @@
             <!-- <span class="desSty" v-show="userTwoLink.linkStatus"
               :style="{ color: userTwoLink.linkStatus ? '#0FB577' : '#000000' }">设备已连接:</span>
             <span class="desSty" v-show="!userTwoLink.linkStatus">设备未连接:</span> -->
-            <img v-show="!userTwoLink.linkStatus" @click="openTableFun(2)"
-              style="width: 70px; height: 24px; color: #ffffff" src="../assets/newAnimation/lanya1.png" />
-            <img v-show="userTwoLink.linkStatus" @click="openTableFun(2)"
-              style="width: 70px; height: 24px; color: #ffffff" src="../assets/newAnimation/lanyaActive1.png" />
+            <img
+              v-show="!userTwoLink.linkStatus"
+              @click="openTableFun(2)"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanya1.png"
+            />
+            <img
+              v-show="userTwoLink.linkStatus"
+              @click="openTableFun(2)"
+              style="width: 70px; height: 24px; color: #ffffff"
+              src="../assets/newAnimation/lanyaActive1.png"
+            />
           </div>
           &nbsp;&nbsp;&nbsp;&nbsp;
-          <i class="el-icon-search" @click="viewEchartsFun(1)" style="margin-left:2px;font-size: 12px;"
-            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"></i>&nbsp;
-          <span class="desSty" @click="viewEchartsFun(2)"
-            :style="{ color: userTwoLink.linkStatus ? '#1FD18E' : '#1FD18E' }">查看波形图</span>
+          <i
+            class="el-icon-search"
+            @click="viewEchartsFun(1)"
+            style="margin-left: 2px; font-size: 12px"
+            :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"
+          ></i
+          >&nbsp;
+          <span
+            class="desSty"
+            @click="viewEchartsFun(2)"
+            :style="{ color: userTwoLink.linkStatus ? '#1FD18E' : '#1FD18E' }"
+            >查看波形图</span
+          >
         </div>
 
-
         <div class="flood-plan-page" ref="animationFlow">
-          <iframe scrolling="no" :src="urlThreeP" ref="unityIframe" frameborder="0" :width="widthIframe"
-            :height="heightIframe">
+          <iframe
+            scrolling="no"
+            :src="urlThreeP"
+            v-if="visibleFlag"
+            ref="unityIframe"
+            frameborder="0"
+            :width="widthIframe"
+            :height="heightIframe"
+          >
           </iframe>
         </div>
-
       </div>
-      <div style="flex:1"></div>
+      <div style="flex: 1"></div>
     </div>
-    <el-dialog title="提示" :visible.sync="tableVisible" width="60%" center :before-close="closeScan">
+    <el-dialog
+      title="提示"
+      :visible.sync="tableVisible"
+      width="60%"
+      center
+      :before-close="closeScan"
+    >
       <span>
-        <el-table :data="mergeData" style="width: 100%; max-height: 400px; overflow-y: auto" :header-cell-style="{
-      background: '#66B497',
-      color: '#FFFFFF',
-      'letter-spacing': '4px',
-    }">
-          <el-table-column prop="rssi" align="center" label="信号强度" :formatter="rssiFormatter">
+        <el-table
+          :data="mergeData"
+          style="width: 100%; max-height: 400px; overflow-y: auto"
+          :header-cell-style="{
+            background: '#66B497',
+            color: '#FFFFFF',
+            'letter-spacing': '4px',
+          }"
+        >
+          <el-table-column
+            prop="rssi"
+            align="center"
+            label="信号强度"
+            :formatter="rssiFormatter"
+          >
           </el-table-column>
-          <el-table-column prop="deviceType" align="center" label="类型" :formatter="typeFormatter">
+          <el-table-column
+            prop="deviceType"
+            align="center"
+            label="类型"
+            :formatter="typeFormatter"
+          >
           </el-table-column>
           <el-table-column prop="userNum" align="center" label="已绑用户">
           </el-table-column>
@@ -100,9 +205,16 @@
 
           <el-table-column label="操作" align="center">
             <template slot-scope="scope">
-              <el-button :disabled="buttonLinkFlag" class="xl_d_button" size="mini" slot="reference"
-                @click="linkJudge(scope.row, scope.row.connect)">
-                <span v-if="scope.row.connect">断开连接</span><span v-if="!scope.row.connect">连接</span></el-button>
+              <el-button
+                :disabled="buttonLinkFlag"
+                class="xl_d_button"
+                size="mini"
+                slot="reference"
+                @click="linkJudge(scope.row, scope.row.connect)"
+              >
+                <span v-if="scope.row.connect">断开连接</span
+                ><span v-if="!scope.row.connect">连接</span></el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -115,17 +227,29 @@
     <!-- 用户选择框 -->
     <el-dialog title="选择连接用户" :visible.sync="userVisible" width="50%" center>
       <span>
-        <el-input style="width: 180px; margin-bottom: 10px" placeholder="请输入搜索内容" v-model="nameSearch"
-          prefix-icon="el-icon-search" @input="searchUser" size="small">
+        <el-input
+          style="width: 180px; margin-bottom: 10px"
+          placeholder="请输入搜索内容"
+          v-model="nameSearch"
+          prefix-icon="el-icon-search"
+          @input="searchUser"
+          size="small"
+        >
         </el-input>
-        <el-table :data="userData" style="width: 100%; max-height: 300px; overflow-y: auto" :header-cell-style="{
-      background: '#66B497',
-      color: '#FFFFFF',
-      'letter-spacing': '4px',
-    }">
+        <el-table
+          :data="userData"
+          style="width: 100%; max-height: 300px; overflow-y: auto"
+          :header-cell-style="{
+            background: '#66B497',
+            color: '#FFFFFF',
+            'letter-spacing': '4px',
+          }"
+        >
           <el-table-column>
             <template slot-scope="scope">
-              <el-radio v-model="selectUserRadio" :label="scope.row.identifier">&nbsp;</el-radio>
+              <el-radio v-model="selectUserRadio" :label="scope.row.identifier"
+                >&nbsp;</el-radio
+              >
             </template>
           </el-table-column>
           <el-table-column prop="userName" align="center" label="姓名"> </el-table-column>
@@ -133,8 +257,14 @@
           </el-table-column>
         </el-table>
         <p align="center" style="margin-bottom: 40px">
-          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
-            :page-size="pageSize" layout="total,  prev, pager, next, jumper" :total="totolSize">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="pageNum"
+            :page-size="pageSize"
+            layout="total,  prev, pager, next, jumper"
+            :total="totolSize"
+          >
           </el-pagination>
         </p>
       </span>
@@ -490,6 +620,7 @@ export default {
       HRV2: [{ name: "LF/HF", value: "-", unit: "个", section: "1.5~2.0" }],
       //心电刷新频率控制器
       ecgTimeFlag: null,
+      visibleFlag: true,
     };
   },
   mounted() {
@@ -509,7 +640,6 @@ export default {
     var k = 1;
     var flagAnimation = true;
     window.addEventListener("resize", function () {
-      // that.getSize();
       if (flagAnimation) {
         setTimeout(() => {
           that.getSize();
@@ -583,7 +713,7 @@ export default {
     ipcRenderer.removeListener("ecg_two_data", this.initTwoHRV);
     this.disconnectDevice();
   },
-  destroyed() { },
+  destroyed() {},
   methods: {
     initHRV(event, arg) {
       let that = this;
@@ -895,12 +1025,12 @@ export default {
     //开启扫描
     queryScan() {
       let that = this;
-      that.$http.getTmp(`/v2/device/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/scan`, {}, (res) => {});
     },
     closeScan() {
       this.tableVisible = false;
       let that = this;
-      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => {});
     },
     searchUser() {
       this.pageNum = 1;
@@ -1424,8 +1554,6 @@ export default {
           //判断当前的列表是否存在该用户已点击的列表
         });
       }
-
-
     },
     typeFormatter(val) {
       if (val.type == "1") {
@@ -1841,12 +1969,12 @@ export default {
     //断开所有设备的操作
     disconnectDevice() {
       let that = this;
-      //获取到当前已连接的列表
-      let list = JSON.parse(JSON.stringify(this.connectedData));
-      console.log(list);
-      for (let i = 0; i < list.length; i++) {
-        that.disconnectEquipment(list[i]);
-      }
+      that.$http.postTmp(`v2/device/dis/connAll`, {}, (res) => {
+        if (res.data.code == 200) {
+        } else {
+          this.$message.error(res.message);
+        }
+      });
     },
     //需要先判断代码是否点击开始测试按钮了
     //如果点击开始测试按钮了//才能发送信号到游戏
@@ -2169,13 +2297,18 @@ export default {
       this.clearFirstDataFun();
       this.clearSecondDataFun();
     },
-    setUrl() { },
+    setUrl() {},
     getSize() {
-      let width = this.$refs.animationFlow.clientWidth;
-      let height = this.$refs.animationFlow.clientHeight - 40;
-      this.widthIframe = width;
-      this.heightIframe = height;
-      this.changeSize(width, height);
+      let that = this;
+      that.visibleFlag = false;
+      setTimeout(() => {
+        that.visibleFlag = true;
+        let width = this.$refs.animationFlow.clientWidth;
+        let height = this.$refs.animationFlow.clientHeight - 40;
+        that.widthIframe = width;
+        that.heightIframe = height;
+        that.changeSize(width, height);
+      }, 0);
     },
     changeSize(width, height) {
       this.$refs.unityIframe.contentWindow.changeSize(width, height);
@@ -2187,7 +2320,7 @@ export default {
       let that = this;
       setTimeout(() => {
         that.getSize();
-      }, 5000);
+      }, 0);
     },
     changeGame(val) {
       console.log(val);
@@ -3633,7 +3766,8 @@ canvas {
   /* color: #0f0f0f; */
 }
 
-.animation_fk {}
+.animation_fk {
+}
 
 .select_option {
   font-size: 10px;
@@ -3658,7 +3792,7 @@ canvas {
 }
 
 .user_num {
-  background-color: #F5F5F5;
+  background-color: #f5f5f5;
   padding: 4px;
 }
 
@@ -3667,6 +3801,5 @@ canvas {
   flex: 1;
 
   flex-direction: row;
-
 }
 </style>

+ 94 - 44
src/renderer/components/ManageEquipment.vue

@@ -6,7 +6,8 @@
         <el-col :span="1">&nbsp;</el-col>
         <el-col :span="10" style="text-align: left">
           <el-button size="small" class="xl_down_button" @click="addEquipment()">
-            新增设备</el-button>
+            新增设备</el-button
+          >
         </el-col>
         <el-col :span="11" style="text-align: left"> </el-col>
         <el-col :span="1">&nbsp;</el-col>
@@ -16,11 +17,17 @@
       <el-row>
         <el-col :span="1"> &nbsp;</el-col>
         <el-col :span="10">
-          <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" :header-cell-style="{
-      background: '#66B497',
-      color: '#FFFFFF',
-      'letter-spacing': '4px',
-    }" :row-class-name="tableRowClassName">
+          <el-table
+            :data="tableData"
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
+            :header-cell-style="{
+              background: '#66B497',
+              color: '#FFFFFF',
+              'letter-spacing': '4px',
+            }"
+            :row-class-name="tableRowClassName"
+          >
             <!-- <el-table-column type="selection" align="center" width="55">
             </el-table-column> -->
             <el-table-column prop="ID" align="center" label="id"> </el-table-column>
@@ -36,9 +43,17 @@
                   @click="singleDownload(scope.$index, scope.row)"
                   >扫描设备</el-button
                 > -->
-                <el-popconfirm confirmButtonText="确定" cancelButtonText="取消"
-                  @confirm="removeFun(scope.$index, scope.row)" icon="el-icon-info" iconColor="red" title="确定要删除该设备吗?">
-                  <el-button class="xl_d_button" size="mini" slot="reference">删除</el-button>
+                <el-popconfirm
+                  confirmButtonText="确定"
+                  cancelButtonText="取消"
+                  @confirm="removeFun(scope.$index, scope.row)"
+                  icon="el-icon-info"
+                  iconColor="red"
+                  title="确定要删除该设备吗?"
+                >
+                  <el-button class="xl_d_button" size="mini" slot="reference"
+                    >删除</el-button
+                  >
                 </el-popconfirm>
                 <!-- <el-button
                   class="xl_d_button"
@@ -52,21 +67,44 @@
         </el-col>
         <el-col :span="2">&nbsp;</el-col>
         <el-col :span="10">
-          <el-table :data="mergeData" style="width: 100%" @selection-change="handleSelectionChange" :header-cell-style="{
-      background: '#66B497',
-      color: '#FFFFFF',
-      'letter-spacing': '4px',
-    }" :row-class-name="tableRowClassName">
-            <el-table-column prop="rssi" align="center" label="信号强度" :formatter="rssiFor">
+          <el-table
+            :data="mergeData"
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
+            :header-cell-style="{
+              background: '#66B497',
+              color: '#FFFFFF',
+              'letter-spacing': '4px',
+            }"
+            :row-class-name="tableRowClassName"
+          >
+            <el-table-column
+              prop="rssi"
+              align="center"
+              label="信号强度"
+              :formatter="rssiFor"
+            >
             </el-table-column>
-            <el-table-column prop="deviceType" align="center" label="类型" :formatter="typeFormatter">
+            <el-table-column
+              prop="deviceType"
+              align="center"
+              label="类型"
+              :formatter="typeFormatter"
+            >
             </el-table-column>
             <el-table-column prop="mac" align="center" label="mac"> </el-table-column>
             <el-table-column label="操作" align="center">
               <template slot-scope="scope">
-                <el-button :disabled="buttonLinkFlag" class="xl_d_button" size="mini" slot="reference"
-                  @click="linkJudge(scope.$index, scope.row, scope.row.connect)">
-                  <span v-if="scope.row.connect">断开连接</span><span v-if="!scope.row.connect">连接</span></el-button>
+                <el-button
+                  :disabled="buttonLinkFlag"
+                  class="xl_d_button"
+                  size="mini"
+                  slot="reference"
+                  @click="linkJudge(scope.$index, scope.row, scope.row.connect)"
+                >
+                  <span v-if="scope.row.connect">断开连接</span
+                  ><span v-if="!scope.row.connect">连接</span></el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -87,20 +125,33 @@
       </el-pagination>
     </p> -->
     <el-dialog :visible.sync="centerDialogVisible" width="545px" center class="dig_equi">
-      <div slot="title" class="title_di" style="width:545px">
+      <div slot="title" class="title_di" style="width: 545px">
         <img width="545px" src="../assets/manage/bg_di.png" />
       </div>
       <span class="min_equi">
         <div class="equipment_class">
-          <div style="margin-left:40px;width:120px">选择设备:&nbsp;&nbsp;</div>
-          <el-select v-model="type" style="width: 100%;margin-right:40px" placeholder="请选择设备">
-            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+          <div style="margin-left: 40px; width: 120px">选择设备:&nbsp;&nbsp;</div>
+          <el-select
+            v-model="type"
+            style="width: 100%; margin-right: 40px"
+            placeholder="请选择设备"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
         </div>
         <div class="equipment_class">
-          <div style="margin-left:40px;width:120px">设备mac:&nbsp;&nbsp;</div>
-          <el-input style="width: 100%;margin-right:40px" v-model="mac" placeholder="例如DC:0D:30:03:39:05"></el-input>
+          <div style="margin-left: 40px; width: 120px">设备mac:&nbsp;&nbsp;</div>
+          <el-input
+            style="width: 100%; margin-right: 40px"
+            v-model="mac"
+            placeholder="例如DC:0D:30:03:39:05"
+          ></el-input>
         </div>
       </span>
       <span slot="footer" class="dialog-footer">
@@ -201,12 +252,12 @@ export default {
     //断开所有设备的操作
     disconnectDevice() {
       let that = this;
-      //获取到当前已连接的列表
-      let list = JSON.parse(JSON.stringify(this.connectedData));
-      console.log(list);
-      for (let i = 0; i < list.length; i++) {
-        that.disconnectEquipment(list[i]);
-      }
+      that.$http.postTmp(`v2/device/dis/connAll`, {}, (res) => {
+        if (res.data.code == 200) {
+        } else {
+          this.$message.error(res.message);
+        }
+      });
     },
     //断开连接的脑电
     disconnectEquipment(val) {
@@ -778,14 +829,14 @@ export default {
     //开启扫描扫描
     queryScan() {
       let that = this;
-      that.$http.getTmp(`/v2/device/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/scan`, {}, (res) => {});
     },
 
     //关闭扫描
     closeScan() {
       this.tableVisible = false;
       let that = this;
-      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => { });
+      that.$http.getTmp(`/v2/device/stop/scan`, {}, (res) => {});
     },
     singleDownload(index, row) {
       let baseUrl = sessionStorage.getItem("baseUrl");
@@ -868,7 +919,7 @@ export default {
       //   console.log("请求数据的list", res);
       // });
     },
-    handleDelete(index, row) { },
+    handleDelete(index, row) {},
     tableRowClassName({ rowIndex }) {
       if (rowIndex % 2 === 0) {
         return "warning-row";
@@ -905,16 +956,16 @@ export default {
   align-items: center;
 }
 
-.dig_equi>>>.el-dialog__header {
+.dig_equi >>> .el-dialog__header {
   padding: 0 !important;
 }
 
-.dig_equi>>>.el-dialog {
+.dig_equi >>> .el-dialog {
   border-top-left-radius: 12px;
   border-top-right-radius: 12px;
 }
 
-.dig_equi>>>.el-dialog__headerbtn .el-dialog__close {
+.dig_equi >>> .el-dialog__headerbtn .el-dialog__close {
   color: #ffffff;
 }
 
@@ -933,26 +984,25 @@ export default {
   cursor: pointer;
   width: 87px;
   height: 45px;
-  background: #FFFFFF;
+  background: #ffffff;
   border-radius: 4px;
-  border: 1px solid #E5E5E5;
+  border: 1px solid #e5e5e5;
   margin-right: 40px;
-  font-family: Alibaba PuHuiTi 2.0;
+  font-family: Alibaba PuHuiTi 2;
   font-weight: normal;
   font-size: 20px;
   color: #666666;
-
 }
 
 .com_add {
   cursor: pointer;
   width: 87px;
   height: 45px;
-  background-color: #5E8AF7;
+  background-color: #5e8af7;
   border-radius: 4px;
-  border: 1px solid #E5E5E5;
+  border: 1px solid #e5e5e5;
   color: #ffffff;
-  font-family: Alibaba PuHuiTi 2.0;
+  font-family: Alibaba PuHuiTi 2;
   font-weight: normal;
   font-size: 20px;
 }

+ 1 - 1
src/utils/http.js

@@ -14,7 +14,7 @@ axios.defaults.baseURL = global.dev;
 // 创建一个 Axios 实例并设置 baseURL 适应不同服务器的baseUrl
 const apiInstance = axios.create({
   baseURL: 'http://localhost:8000/'
-  // baseURL: 'http://192.168.1.13:8000/'
+  // baseURL: 'http://10.113.248.3:8000/'
 });
 
 // axios.defaults.baseURL = "/api";

+ 1 - 1
static/loading.html

@@ -192,7 +192,7 @@
             let qq = document.getElementById('pro')
                 qq.style.width = '100%'
             dian.innerHTML = "后台服务启动完成";
-          showMainWindows()
+            showMainWindows()
         }
         // if (arg.type === "webGlobal") {
         //   //可以关闭动画,打开mainwindows

+ 4 - 0
static/loong_3/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("Main Camera","Fireworklocity",val);
       }

+ 4 - 0
static/mabenpao/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("horse","Fireworklocity",val);
       }

+ 4 - 0
static/run/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("Runvelocity","Firstvelocity",val);
       }

+ 4 - 0
static/saiche/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("car","Fireworklocity",val);
       }

+ 4 - 0
static/tianping/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("Tianping","Balance",val);
       }

+ 4 - 0
static/tianqi/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
           this.gameInstance.SendMessage("Tianping","Balance",val);
       }

+ 4 - 0
static/yanhua/index.html

@@ -98,6 +98,10 @@
           alert(message);
         });
       };
+      function changeSize(width, height) {
+            canvas.style.width = width + 'px';
+            canvas.style.height = height + 'px';
+        }
       function Bloomsize(val){
         this.gameInstance.SendMessage("Fireworks","Fireworklocity",val);
       }