| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import { WebSocketHost } from '@/utils/constants' |
| | | |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const tableDatad = ref([]) |
| | | const tableDatae = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const height = ref([]); |
| | | |
| | | const carposition1 = ref(60); |
| | | const carposition2 = ref(220); |
| | |
| | | const timers2 =ref(true); |
| | | const timers3 =ref(true); |
| | | const timers4 =ref(true); |
| | | const cellshow=ref(false); |
| | | const cellshow5=ref(false); |
| | | const c1=ref(false); |
| | | const c2=ref(false); |
| | |
| | | const million1=ref(0); |
| | | const million3=ref(0); |
| | | const million4=ref(0); |
| | | const cell1=ref(true); |
| | | const cell2=ref(true); |
| | | const cell3=ref(true); |
| | | const cell4=ref(true); |
| | | const cell5=ref(true); |
| | | const cell6=ref(true); |
| | | const cell7=ref(true); |
| | | const cell8=ref(true); |
| | | |
| | | const currentPage4 = ref(4) |
| | | const pageSize4 = ref(100) |
| | |
| | | } |
| | | }else{ |
| | | million1.value=million.value; |
| | | if(cellshow.value==true){ |
| | | cellshow.value=false; |
| | | |
| | | }else{ |
| | | cellshow.value=true; |
| | | |
| | | } |
| | | |
| | | if(cellshow1.value==true){ |
| | | cellshow1.value=false; |
| | | }else{ |
| | |
| | | } |
| | | |
| | | |
| | | const socketUrl = `ws://10.153.19.150:88/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | const socketUrl = `ws://${WebSocketHost}:88/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | adjustedRects.value = data.bigStorageCageInfo1[0] |
| | | // adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // height: rect.length *0.5, |
| | | |
| | | // })); |
| | | window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length) |
| | | let length = window.localStorage.getItem('length') |
| | | console.log(length); |
| | | |
| | | }; |
| | | // function getRectHeight(length: number) { |
| | | // return length > 0 ? 29 / length : 29; |
| | | // } |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | |
| | | </div> |
| | | </el-card> |
| | | <div style="padding: 10px;display: flex;height:110px;"> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#2</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#3</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#4</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#5</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#6</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#7</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#8</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <!-- <div v-for="n in 8" :key="n" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> --> |
| | | <div v-for="(item, index) in tableDatae" :key="index" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span>使用率</span><span>{{ item.percentage }}</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span>空闲(格子数)</span><span>{{ item.count }}</span> |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | | <!-- <div id="awatch"> |
| | | <img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;"> |
| | |
| | | </div> |
| | | |
| | | <div v-show="c2" class="img-car3" :style="'z-index:999;left:247px;top:' + carposition3 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow3" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | <div v-show="cellshow3" style="margin-top:10px;width:220px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div v-show="cellshow" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: absolute;top:55px;left: 465px;"> |
| | | <div |
| | | v-for="(item, index) in adjustedRects" |
| | | :key="index" |
| | | :style="{ |
| | | top: `1px`, width: `227px`, |
| | | backgroundColor: '#409EFF', |
| | | height: `height`+ `px` |
| | | }" |
| | | > |
| | | </div> |
| | | <div v-show="cellshow5" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;"> |
| | | <!-- <div |
| | | v-for="(item, index) in adjustedRects" |
| | | height: `${rect.height}px`, |
| | | :key="index" |
| | | :style="{ |
| | | width: '227px', |
| | | height: '1px', |
| | | backgroundColor: '#409EFF', |
| | | top: '1px' |
| | | }" |
| | | > |
| | | </div> --> |
| | | </div> |
| | | <!-- <div v-show="cell2" style="width: 227px;height: 29px;position: absolute;top:86px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;"> |
| | | </div> --> |
| | | </div> |
| | | |
| | | </div> |