screenFront/src/views/MicroExhibition/index.vue

201 lines
4.0 KiB
Vue
Raw Normal View History

2023-12-05 09:01:51 +00:00
<!--
* @Author: hzz hzz
* @Date: 2023-12-05 13:30:45
* @LastEditors: hzz hzz
* @LastEditTime: 2023-12-05 16:54:15
* @FilePath: \screenFront\src\views\MicroExhibition\index.vue
* @Description:
*
* Copyright (c) 2023 by ${hzz}, All Rights Reserved.
-->
2023-08-23 10:06:47 +00:00
<template>
<div class="container">
<div class="header">
<div class="title">
2023-12-05 09:01:51 +00:00
<Header :title="'富怡服装微工厂物联管理平台'" :wh="{ width: '100%', height: '100px'}"></Header>
2023-08-23 10:06:47 +00:00
</div>
</div>
<div class="content">
<div class="left">
2023-12-05 09:01:51 +00:00
<div class="ltop">
<BoardVue :title="'裁剪设备'"></BoardVue>
2023-08-23 10:06:47 +00:00
</div>
2023-12-05 09:01:51 +00:00
<div class="lbottom">
<BoardVue :title="'缝前设备'"></BoardVue>
2023-08-23 10:06:47 +00:00
</div>
</div>
2023-12-05 09:01:51 +00:00
<div class="right">
<div class="rtop">
<div class="rtleft">
<div class="rtltop"></div>
<div class="rtlbottom"></div>
2023-08-23 10:06:47 +00:00
</div>
2023-12-05 09:01:51 +00:00
<div class="rtright">
<BoardVue :title="'缝中设备'"></BoardVue>
2023-08-23 10:06:47 +00:00
</div>
</div>
2023-12-05 09:01:51 +00:00
<div class="rbottom">
右下
2023-08-24 10:10:09 +00:00
</div>
2023-08-23 10:06:47 +00:00
</div>
</div>
2023-12-05 09:01:51 +00:00
2023-08-23 10:06:47 +00:00
</div>
</template>
<script setup lang='ts'>
2023-12-05 09:01:51 +00:00
import Header from './component/Header.vue'
import BoardVue from './component/Border.vue'
2023-09-08 10:02:15 +00:00
import { ref, onMounted, onUnmounted, getCurrentInstance, watch, onUpdated, computed } from 'vue'
import { useMicroExhibitionStore } from '@/store/module/MicroExhibition'
2023-09-11 08:46:02 +00:00
import { connectWebsocket, closeWebsocket } from "@/utils/websocket"
2023-08-23 10:06:47 +00:00
import { useI18n } from 'vue-i18n'
let { t } = useI18n();
const store = useMicroExhibitionStore()
2023-12-05 09:01:51 +00:00
2023-09-11 08:46:02 +00:00
let timer = null
2023-12-05 09:01:51 +00:00
let dev_caijian_title = ['设备名称', '编号','状态', '稼动率', '工作时长']
2023-09-12 10:11:14 +00:00
2023-09-09 04:01:37 +00:00
2023-09-11 08:46:02 +00:00
function getWebsocket(val) {
try {
let data = JSON.parse(val)
2023-12-05 09:01:51 +00:00
// if (data.type == 'StateChart') {
// store.setDevnum(data.msg)
// }
// if (data.type == 'WorkingState') {
// store.changestatus(data.msg)
// }
2023-09-11 08:46:02 +00:00
} catch (err) {
console.log(err);
2023-09-09 04:01:37 +00:00
}
2023-09-11 08:46:02 +00:00
}
function errWebsocket(val) {
2023-09-09 04:01:37 +00:00
// console.log(val);
}
2023-09-08 08:03:33 +00:00
onMounted(() => {
2023-09-11 08:46:02 +00:00
connectWebsocket(null, null, getWebsocket, errWebsocket)
2023-12-05 09:01:51 +00:00
document.getElementById('app').style.backgroundColor = 'rgba(0, 11, 18, 1)'
2023-09-08 08:03:33 +00:00
})
onUnmounted(() => {
2023-09-12 10:11:14 +00:00
closeWebsocket()
2023-12-05 09:01:51 +00:00
document.getElementById('app').style.backgroundColor = 'rgba(0, 11, 18, 1)'
2023-09-08 08:03:33 +00:00
})
2023-08-23 10:06:47 +00:00
</script>
2023-09-08 08:03:33 +00:00
2023-08-23 10:06:47 +00:00
<style scoped>
.container {
height: 1080px;
width: 1920px;
2023-09-06 10:05:57 +00:00
color: #FFFFFF;
2023-12-05 09:01:51 +00:00
background-color: rgba(0, 11, 18, 1);
2023-09-08 08:03:33 +00:00
position: relative;
2023-09-06 10:05:57 +00:00
2023-08-23 10:06:47 +00:00
}
.header {
2023-09-06 10:05:57 +00:00
height: 100px;
2023-08-23 10:06:47 +00:00
width: 1920px;
}
.content {
2023-09-06 10:05:57 +00:00
height: 980px;
2023-08-23 10:06:47 +00:00
width: 1920px;
display: flex;
flex-direction: row;
justify-content: space-between;
2023-09-06 10:05:57 +00:00
padding: 0 5px;
box-sizing: border-box;
2023-08-23 10:06:47 +00:00
}
2023-12-05 09:01:51 +00:00
.left {
width: 540px;
height: 100%;
margin-left: 13px;
2023-08-23 10:06:47 +00:00
display: flex;
flex-direction: column;
justify-content: space-between;
2023-12-05 09:01:51 +00:00
align-items: center;
2023-08-23 10:06:47 +00:00
}
2023-12-05 09:01:51 +00:00
.ltop {
2023-09-06 10:05:57 +00:00
width: 100%;
2023-12-05 09:01:51 +00:00
height: 630px;
2023-09-06 10:05:57 +00:00
}
2023-09-08 08:03:33 +00:00
2023-12-05 09:01:51 +00:00
.lbottom {
2023-09-06 10:05:57 +00:00
width: 100%;
2023-12-05 09:01:51 +00:00
height: 335px;
2023-09-06 10:05:57 +00:00
}
2023-08-24 10:10:09 +00:00
2023-12-05 09:01:51 +00:00
.right {
width: 1330px;
2023-08-24 10:10:09 +00:00
height: 100%;
2023-12-05 09:01:51 +00:00
margin-right: 13px;
2023-08-24 10:10:09 +00:00
display: flex;
2023-12-05 09:01:51 +00:00
flex-direction: column;
justify-content: space-between;
2023-08-24 10:10:09 +00:00
align-items: center;
2023-08-23 10:06:47 +00:00
}
2023-08-24 10:10:09 +00:00
2023-12-05 09:01:51 +00:00
.rtop {
width: 100%;
height: 715px;
2023-09-08 08:03:33 +00:00
display: flex;
2023-12-05 09:01:51 +00:00
flex-direction: row;
2023-09-08 08:03:33 +00:00
justify-content: space-between;
align-items: center;
}
2023-09-08 10:02:15 +00:00
2023-12-05 09:01:51 +00:00
.rbottom {
width: 100%;
height: 250px;
background: #bfe;
}
.rtleft {
width: 777px;
2023-09-08 08:03:33 +00:00
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
2023-09-08 10:02:15 +00:00
2023-12-05 09:01:51 +00:00
.rtltop {
width: 100%;
height: 120px;
background: #bff;
2023-09-08 08:03:33 +00:00
}
2023-12-05 09:01:51 +00:00
.rtlbottom {
width: 100%;
height: 580px;
background: #bf1;
2023-09-08 08:03:33 +00:00
}
2023-09-08 10:02:15 +00:00
2023-12-05 09:01:51 +00:00
.rtright {
width: 540px;
2023-09-08 08:03:33 +00:00
height: 100%;
}
2023-09-08 10:02:15 +00:00
2023-09-09 04:01:37 +00:00
2023-09-11 10:08:18 +00:00
2023-09-12 10:11:14 +00:00
2023-12-05 09:01:51 +00:00
2023-09-11 08:46:02 +00:00
</style>