|
@@ -10,24 +10,30 @@
|
|
|
<span>机器人状态</span>
|
|
|
<div class="status">
|
|
|
<div class="status-list">
|
|
|
- <img src="./assets/status1-active.png" width="58">
|
|
|
+ <img :src="robotInfoVo.robotState === 1 ? require('./assets/status1-active.png') : require('./assets/status1.png')"
|
|
|
+ width="58">
|
|
|
<div class="staus-info">
|
|
|
- <div class="infoimg"><img src="./assets/success.png"></div>
|
|
|
- <div class="infotext active">运行</div>
|
|
|
+ <div class="infoimg"><img src="./assets/success.png"
|
|
|
+ v-if="robotInfoVo.robotState === 1"></div>
|
|
|
+ <div class="infotext" :class="{ active: robotInfoVo.robotState === 1 }">运行</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="status-list">
|
|
|
- <img src="./assets/status2.png" width="58">
|
|
|
+ <img :src="robotInfoVo.robotState === 2 ? require('./assets/status2-active.png') : require('./assets/status2.png')"
|
|
|
+ width="58">
|
|
|
<div class="staus-info">
|
|
|
- <div class="infoimg"><img src="./assets/warn.png"></div>
|
|
|
- <div class="infotext">待机</div>
|
|
|
+ <div class="infoimg"><img src="./assets/warn.png"
|
|
|
+ v-if="robotInfoVo.robotState === 2"></div>
|
|
|
+ <div class="infotext" :class="{ active: robotInfoVo.robotState === 2 }">待机</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="status-list">
|
|
|
- <img src="./assets/status3.png" width="58">
|
|
|
+ <img :src="robotInfoVo.robotState === 3 ? require('./assets/status3-active.png') : require('./assets/status3.png')"
|
|
|
+ width="58">
|
|
|
<div class="staus-info">
|
|
|
- <div class="infoimg"><img src="./assets/danger.png"></div>
|
|
|
- <div class="infotext">故障</div>
|
|
|
+ <div class="infoimg"><img src="./assets/danger.png"
|
|
|
+ v-if="robotInfoVo.robotState === 3"></div>
|
|
|
+ <div class="infotext" :class="{ active: robotInfoVo.robotState === 3 }">故障</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -37,31 +43,36 @@
|
|
|
<div class="signal-status">
|
|
|
<div class="signal-status-list">
|
|
|
<div class="signal-icon">
|
|
|
- <img src="./assets/info1.png" width="58"><img src="./assets/signal1.png">
|
|
|
+ <img src="./assets/info1.png" width="58"><img
|
|
|
+ :src="robotInfoVo.plcState ? require('./assets/signal1.png') : require('./assets/signal2.png')">
|
|
|
</div>
|
|
|
<div class="signal-text">PLC通信</div>
|
|
|
</div>
|
|
|
<div class="signal-status-list">
|
|
|
<div class="signal-icon">
|
|
|
- <img src="./assets/info2.png" width="58"><img src="./assets/signal1.png">
|
|
|
+ <img src="./assets/info2.png" width="58"><img
|
|
|
+ :src="robotInfoVo.liftingServo ? require('./assets/signal1.png') : require('./assets/signal2.png')">
|
|
|
</div>
|
|
|
<div class="signal-text">举升伺服</div>
|
|
|
</div>
|
|
|
<div class="signal-status-list">
|
|
|
<div class="signal-icon">
|
|
|
- <img src="./assets/info3.png" width="58"><img src="./assets/signal1.png">
|
|
|
+ <img src="./assets/info3.png" width="58"><img
|
|
|
+ :src="robotInfoVo.rotaryServo ? require('./assets/signal1.png') : require('./assets/signal2.png')">
|
|
|
</div>
|
|
|
<div class="signal-text">旋转伺服</div>
|
|
|
</div>
|
|
|
<div class="signal-status-list">
|
|
|
<div class="signal-icon">
|
|
|
- <img src="./assets/info4.png" width="58"><img src="./assets/signal2.png">
|
|
|
+ <img src="./assets/info4.png" width="58"><img
|
|
|
+ :src="robotInfoVo.palletServo ? require('./assets/signal1.png') : require('./assets/signal2.png')">
|
|
|
</div>
|
|
|
<div class="signal-text">货叉伺服</div>
|
|
|
</div>
|
|
|
<div class="signal-status-list">
|
|
|
<div class="signal-icon">
|
|
|
- <img src="./assets/info5.png" width="58"><img src="./assets/signal2.png">
|
|
|
+ <img src="./assets/info5.png" width="58"><img
|
|
|
+ :src="robotInfoVo.walkServo ? require('./assets/signal1.png') : require('./assets/signal2.png')">
|
|
|
</div>
|
|
|
<div class="signal-text">行走伺服</div>
|
|
|
</div>
|
|
@@ -71,42 +82,66 @@
|
|
|
<li>
|
|
|
<span>轴转速度</span>
|
|
|
<div class="speed">
|
|
|
- <p>X轴速度:<font>0.11</font> <em>m/s</em></p>
|
|
|
- <p>Y轴速度:<font>0.11</font> <em>m/s</em></p>
|
|
|
- <p>Z轴速度:<font>0.11</font> <em>m/s</em></p>
|
|
|
+ <p>X轴速度:<font>{{ robotInfoVo.xAxis }}</font> <em>m/s</em></p>
|
|
|
+ <p>Y轴速度:<font>{{ robotInfoVo.yAxis }}</font> <em>m/s</em></p>
|
|
|
+ <p>Z轴速度:<font>{{ robotInfoVo.zAxis }}</font> <em>m/s</em></p>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>时间</span>
|
|
|
<div class="times">
|
|
|
- 换电时间:<font>2分00秒</font>
|
|
|
+ 换电时间:<font>{{ robotInfoVo.swapTime }}</font>
|
|
|
</div>
|
|
|
<div class="times">
|
|
|
- 剩余时间:<font>约2分00秒</font>
|
|
|
+ 剩余时间:<font>{{ robotInfoVo.residueTime }}</font>
|
|
|
</div>
|
|
|
- </Li>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-second">
|
|
|
<sub-title name="储充信息" statement="STORAGE AND CHARGING INFORMATION" num="8" step="1"></sub-title>
|
|
|
- <div class="storage-bottom" :style="{height:screenHeight}">
|
|
|
+ <div class="storage-bottom" :style="{ height: screenHeight }">
|
|
|
<el-carousel indicator-position="outside" :height="height" :autoplay="false">
|
|
|
<el-carousel-item>
|
|
|
<div class="storagebox">
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
+ <StorageInfo
|
|
|
+ v-for="(item,index) in storeInfoListFirst" :key="index"
|
|
|
+ :storeCode="item.storeCode"
|
|
|
+ :comState="item.comState"
|
|
|
+ :sn="item.sn"
|
|
|
+ :chgEstimatedTime="item.chargerInfoVo.chgEstimatedTime"
|
|
|
+ :current="item.current"
|
|
|
+ :voltage="item.voltage"
|
|
|
+ :minTemperature="item.minTemperature"
|
|
|
+ :maxTemperature="item.maxTemperature"
|
|
|
+ :maxCellVoltage="item.maxCellVoltage"
|
|
|
+ :minCellVoltage="item.minCellVoltage"
|
|
|
+ :soh="item.soh"
|
|
|
+ :storeState="item.storeState"
|
|
|
+ :chargerInfoVo="item.chargerInfoVo"
|
|
|
+ ></StorageInfo>
|
|
|
</div>
|
|
|
</el-carousel-item>
|
|
|
<el-carousel-item>
|
|
|
<div class="storagebox">
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
- <StorageInfo></StorageInfo>
|
|
|
+ <StorageInfo
|
|
|
+ v-for="(item,index) in storeInfoListSecond" :key="index"
|
|
|
+ :storeCode="item.storeCode"
|
|
|
+ :comState="item.comState"
|
|
|
+ :sn="item.sn"
|
|
|
+ :chgEstimatedTime="item.chargerInfoVo.chgEstimatedTime"
|
|
|
+ :current="item.current"
|
|
|
+ :voltage="item.voltage"
|
|
|
+ :minTemperature="item.minTemperature"
|
|
|
+ :maxTemperature="item.maxTemperature"
|
|
|
+ :maxCellVoltage="item.maxCellVoltage"
|
|
|
+ :minCellVoltage="item.minCellVoltage"
|
|
|
+ :soh="item.soh"
|
|
|
+ :storeState="item.storeState"
|
|
|
+ :chargerInfoVo="item.chargerInfoVo"
|
|
|
+ ></StorageInfo>
|
|
|
</div>
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
@@ -117,8 +152,10 @@
|
|
|
|
|
|
<script>
|
|
|
import "./index.scss";
|
|
|
+import wsUrl from "../../../vue.config.js";
|
|
|
import SubTitle from "./components/SubTitle.vue";
|
|
|
import StorageInfo from "./components/StorageInfo.vue";
|
|
|
+import { getToken} from '@/utils/auth'
|
|
|
export default {
|
|
|
name: "EquipmentMonitoring",
|
|
|
components: {
|
|
@@ -127,37 +164,107 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ ws: null,
|
|
|
height: "100%",
|
|
|
- screenHeight:null,
|
|
|
+ screenHeight: null,
|
|
|
+ robotInfoVo: {},
|
|
|
+ storeInfoListFirst: [],//第一屏储充信息
|
|
|
+ storeInfoListSecond: [], //第二屏储充信息
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.onLoadHeight()
|
|
|
this.changeWindow()
|
|
|
+ if(getToken()){
|
|
|
+ if (this.ws) {
|
|
|
+ this.ws.close();
|
|
|
+ }
|
|
|
+ this.websocketConnect();
|
|
|
+ //清除定时器
|
|
|
+ this.clearTimerList();
|
|
|
+ //检测断开重连
|
|
|
+ this.detectWebsocketConnection();
|
|
|
+ //开启定时器
|
|
|
+ this.setTimerList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ this.websocketOnClose();
|
|
|
+ this.clearTimerList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //定时器列表
|
|
|
+ setTimerList() {
|
|
|
+ this.exchargeTimer = setInterval(() => {
|
|
|
+
|
|
|
+ }, 5000);
|
|
|
+ },
|
|
|
+ //清除定时器列表
|
|
|
+ clearTimerList() {
|
|
|
+ if (this.exchargeTimer) {
|
|
|
+ clearInterval(this.exchargeTimer);
|
|
|
+ }
|
|
|
+ if (this.wsTimer) {
|
|
|
+ clearInterval(this.wsTimer);
|
|
|
+ }
|
|
|
+ },
|
|
|
/*设置初始视窗高度*/
|
|
|
- onLoadHeight() {
|
|
|
- this.$nextTick(() => {
|
|
|
- if(document.body.clientHeight >= 1080){
|
|
|
- this.screenHeight = '65vh'
|
|
|
- }else{
|
|
|
- this.screenHeight = '72vh'
|
|
|
+ onLoadHeight() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (document.body.clientHeight >= 1080) {
|
|
|
+ this.screenHeight = '65vh'
|
|
|
+ } else {
|
|
|
+ this.screenHeight = '72vh'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /*设置窗口变化高度*/
|
|
|
+ changeWindow() {
|
|
|
+ window.onresize = () => {
|
|
|
+ return (() => {
|
|
|
+ if (document.body.clientHeight >= 1080) {
|
|
|
+ this.screenHeight = '65vh'
|
|
|
+ } else {
|
|
|
+ this.screenHeight = '72vh'
|
|
|
+ }
|
|
|
+ })();
|
|
|
+ };
|
|
|
+ },
|
|
|
+ websocketOnOpen() {
|
|
|
+ console.log("socket连接成功");
|
|
|
+ },
|
|
|
+ websocketOnMessage(m) {
|
|
|
+ let d = JSON.parse(m.data)
|
|
|
+ // console.log(d)
|
|
|
+ if (d.robotInfoVo) {
|
|
|
+ this.robotInfoVo = d.robotInfoVo
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- /*设置窗口变化高度*/
|
|
|
- changeWindow() {
|
|
|
- window.onresize = () => {
|
|
|
- return (() => {
|
|
|
- if(document.body.clientHeight >= 1080){
|
|
|
- this.screenHeight = '65vh'
|
|
|
- }else{
|
|
|
- this.screenHeight = '72vh'
|
|
|
+ if(d.storeInfoList){
|
|
|
+ this.storeInfoListFirst = d.storeInfoList
|
|
|
+ this.storeInfoListSecond = d.storeInfoList.splice(5)
|
|
|
}
|
|
|
- })();
|
|
|
- };
|
|
|
- },
|
|
|
+ },
|
|
|
+ websocketOnError(e) {
|
|
|
+ console.log("socket错误", e);
|
|
|
+ },
|
|
|
+ websocketOnClose(e) {
|
|
|
+ console.log("socket断开", e);
|
|
|
+ },
|
|
|
+ detectWebsocketConnection() {
|
|
|
+ this.wsTimer = setInterval(() => {
|
|
|
+ if (this.ws.readyState != 1) {
|
|
|
+ this.ws.close();
|
|
|
+ this.websocketConnect();
|
|
|
+ }
|
|
|
+ }, 3000);
|
|
|
+ },
|
|
|
+ websocketConnect() {
|
|
|
+ this.ws = new WebSocket(wsUrl.devServer.proxy["/ws"].target);
|
|
|
+ this.ws.onopen = this.websocketOnOpen;
|
|
|
+ this.ws.onerror = this.websocketOnError;
|
|
|
+ this.ws.onmessage = this.websocketOnMessage;
|
|
|
+ this.ws.onclose = this.websocketOnClose;
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -166,6 +273,7 @@ export default {
|
|
|
width: 100%;
|
|
|
min-height: 100%;
|
|
|
height: auto !important;
|
|
|
+
|
|
|
ul {
|
|
|
display: none;
|
|
|
}
|