|
@@ -10,27 +10,59 @@
|
|
|
<el-col :span="1"> </el-col>
|
|
|
</el-row> -->
|
|
|
|
|
|
-
|
|
|
<div class="main_sp">
|
|
|
- <div style="flex:1"></div>
|
|
|
+ <div style="flex: 1"> </div>
|
|
|
<div class="main_second">
|
|
|
<div class="select_class_animation">
|
|
|
<span class="desSty">选择设备</span>
|
|
|
- <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>
|
|
|
|
|
|
<span class="desSty">游戏难度</span>
|
|
|
- <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>
|
|
|
|
|
|
<span class="desSty">游戏时间</span>
|
|
|
- <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>
|
|
|
|
|
@@ -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>
|
|
|
|
|
|
- <i class="el-icon-search" @click="viewEchartsFun(1)" style="margin-left:2px;font-size: 12px;"
|
|
|
- :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"></i>
|
|
|
- <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
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="desSty"
|
|
|
+ @click="viewEchartsFun"
|
|
|
+ :style="{ color: linkStatus ? '#1FD18E' : '#1FD18E' }"
|
|
|
+ >查看波形图</span
|
|
|
+ >
|
|
|
|
|
|
- <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"> </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"> </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>
|