2023-08-23 10:06:47 +00:00
|
|
|
<template>
|
|
|
|
<div class="container">
|
|
|
|
<div class="header">
|
|
|
|
<div class="title">
|
2023-09-09 04:01:37 +00:00
|
|
|
<header2 ref="headerref" :width="'100%'" :height="'100px'" :title="'设备工况物联系统'" :titleTip="[]"
|
2023-08-24 10:10:09 +00:00
|
|
|
:typeFun="['time']" :alarmType="[]"></header2>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="left">
|
|
|
|
<div class="lt">
|
2023-09-06 10:05:57 +00:00
|
|
|
<NewBoder :title="'裁剪设备'">
|
2023-09-08 08:03:33 +00:00
|
|
|
<DevCard :dev_title="dev_caijian_title" :dev_value="store.caijian.value" :last_index="3">
|
2023-09-08 10:02:15 +00:00
|
|
|
<BarChart style="width: 100%;height: 100%;" :xData="store.caijian.chart.xData"
|
|
|
|
:seriesData="store.caijian.chart.series"></BarChart>
|
2023-09-06 10:05:57 +00:00
|
|
|
</DevCard>
|
|
|
|
</NewBoder>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
<div class="lb">
|
2023-09-08 08:03:33 +00:00
|
|
|
<NewBoder :title="'缝中设备'">
|
2023-09-09 04:01:37 +00:00
|
|
|
<BoardBar :data="store.fengzhong.value" :xData="store.fengzhong.chart.xData"
|
|
|
|
:seriesData="store.fengzhong.chart.series"></BoardBar>
|
2023-09-08 08:03:33 +00:00
|
|
|
</NewBoder>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="center">
|
|
|
|
<div class="ct">
|
|
|
|
<div class="top-item">
|
|
|
|
<h2>设备总数</h2>
|
|
|
|
<div class="div_p" style="color: #ff9e5b;font-size: 40px;">
|
|
|
|
<!-- <i class="iconfont icon-zhengque1 div-p-tip"></i> -->
|
2023-08-28 10:05:54 +00:00
|
|
|
<h5>{{ store.devnum.all }} {{ t('messages.units') }}</h5>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="top-item">
|
|
|
|
<h2>网关状态</h2>
|
|
|
|
<div class="div_p">
|
|
|
|
<i :class="true
|
2023-08-24 10:10:09 +00:00
|
|
|
? 'iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan on'
|
|
|
|
: 'iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan off'
|
2023-08-23 10:06:47 +00:00
|
|
|
"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-06 10:05:57 +00:00
|
|
|
<div class="cc">
|
|
|
|
<NewBoder :title="'设备状态总览'">
|
|
|
|
<ringChart :data="ringData"></ringChart>
|
|
|
|
</NewBoder>
|
|
|
|
</div>
|
2023-08-24 10:10:09 +00:00
|
|
|
<div class="cb">
|
2023-09-06 10:05:57 +00:00
|
|
|
<NewBoder :title="'板房设备'">
|
2023-09-09 04:01:37 +00:00
|
|
|
<BoardBar :data="store.banfang.value" :xData="store.banfang.chart.xData"
|
|
|
|
:seriesData="store.banfang.chart.series"></BoardBar>
|
2023-09-06 10:05:57 +00:00
|
|
|
</NewBoder>
|
2023-08-24 10:10:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="right">
|
|
|
|
<div class="rt">
|
2023-09-06 10:05:57 +00:00
|
|
|
<NewBoder :title="'一次性拖鞋自动生产线'">
|
2023-09-08 08:03:33 +00:00
|
|
|
<DevCard :dev_title="dev_tuoxie_title" :dev_value="store.tuoxie.value" :last_index="2">
|
2023-09-08 10:02:15 +00:00
|
|
|
<BarChart style="width: 100%;height: 100%;" :xData="store.tuoxie.chart.xData"
|
|
|
|
:seriesData="store.tuoxie.chart.series"></BarChart>
|
2023-08-24 10:10:09 +00:00
|
|
|
</DevCard>
|
2023-09-06 10:05:57 +00:00
|
|
|
</NewBoder>
|
|
|
|
</div>
|
|
|
|
<div class="rb">
|
2023-09-08 08:03:33 +00:00
|
|
|
<NewBoder :title="'座椅面套生产线'">
|
2023-09-09 04:01:37 +00:00
|
|
|
<BoardBar :data="store.zuoyi.value" :xData="store.zuoyi.chart.xData"
|
|
|
|
:seriesData="store.zuoyi.chart.series"></BoardBar>
|
2023-09-08 08:03:33 +00:00
|
|
|
</NewBoder>
|
2023-08-24 10:10:09 +00:00
|
|
|
</div>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-08 08:03:33 +00:00
|
|
|
<div class="left-tip-type">
|
|
|
|
<div class="left-tip-type-item">
|
|
|
|
<div class="yuan green"></div>
|
|
|
|
<div class="left-tip-type-item-text">工作</div>
|
|
|
|
</div>
|
|
|
|
<div class="left-tip-type-item">
|
|
|
|
<div class="yuan yello"></div>
|
|
|
|
<div class="left-tip-type-item-text">待机</div>
|
|
|
|
</div>
|
|
|
|
<div class="left-tip-type-item">
|
|
|
|
<div class="yuan red"></div>
|
|
|
|
<div class="left-tip-type-item-text">停机</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="right-tip-type">
|
|
|
|
<div class="right-tip-type-item blue">
|
|
|
|
<div class="iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan gatway"></div>
|
|
|
|
<div class="left-tip-type-item-text">在线</div>
|
|
|
|
</div>
|
|
|
|
<div class="right-tip-type-item err">
|
|
|
|
<div class="iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan gatway"></div>
|
|
|
|
<div class="left-tip-type-item-text">离线</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-09 04:01:37 +00:00
|
|
|
<div class="wrap"></div>
|
2023-08-23 10:06:47 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang='ts'>
|
2023-09-09 04:01:37 +00:00
|
|
|
import header2 from './components/header2.vue'
|
2023-09-06 10:05:57 +00:00
|
|
|
import NewBoder from './components/NewBoder.vue';
|
|
|
|
import DevCard from "./components/DevCard.vue";
|
2023-08-24 10:10:09 +00:00
|
|
|
import BarChart from './components/BarChart.vue'
|
|
|
|
import ringChart from "./components/ringChart.vue";
|
2023-09-08 08:03:33 +00:00
|
|
|
import BoardBar from "./components/BoardBar.vue";
|
2023-09-06 10:05:57 +00:00
|
|
|
|
2023-09-09 04:01:37 +00:00
|
|
|
import { getTopDevice, getCismaList } from '@/http/cisma'
|
2023-09-08 10:02:15 +00:00
|
|
|
import { ref, onMounted, onUnmounted, getCurrentInstance, watch, onUpdated, computed } from 'vue'
|
2023-08-28 10:05:54 +00:00
|
|
|
import { useMicroExhibitionStore } from '@/store/module/MicroExhibition'
|
2023-09-09 04:01:37 +00:00
|
|
|
import {connectWebsocket,closeWebsocket} from "@/utils/websocket"
|
2023-08-23 10:06:47 +00:00
|
|
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
let { t } = useI18n();
|
2023-08-28 10:05:54 +00:00
|
|
|
const store = useMicroExhibitionStore()
|
2023-09-08 10:02:15 +00:00
|
|
|
let ringData = computed(() => {
|
|
|
|
return [
|
2023-09-09 04:01:37 +00:00
|
|
|
{ name: '工作', value: store.devnum.on },
|
|
|
|
{ name: '停机', value: store.devnum.off },
|
|
|
|
{ name: '待机', value: store.devnum.wait },
|
|
|
|
]
|
2023-09-08 10:02:15 +00:00
|
|
|
})
|
2023-09-08 08:03:33 +00:00
|
|
|
let dev_caijian_title = ['设备名称', '设备编码', '稼动率', '状态']
|
|
|
|
let dev_tuoxie_title = ['设备编码', '稼动率', '状态']
|
2023-08-24 10:10:09 +00:00
|
|
|
let dev_value = [
|
2023-09-08 08:03:33 +00:00
|
|
|
['全自动针梭两用铺布机', '待机', '40层', '1'],
|
|
|
|
['全自动9公分电脑裁床', '待机', '40层', '0'],
|
2023-08-24 10:10:09 +00:00
|
|
|
]
|
2023-09-08 08:03:33 +00:00
|
|
|
|
2023-09-09 04:01:37 +00:00
|
|
|
async function getTopDeviceData() {
|
|
|
|
let res = await getTopDevice() as any
|
|
|
|
if (res.code === 200) {
|
|
|
|
store.setbanfang(res.data.板房设备)
|
|
|
|
store.setcaijian(res.data.裁剪设备)
|
|
|
|
store.setfengzhong(res.data.缝中设备)
|
|
|
|
store.settuoxie(res.data.拖鞋自动生产线)
|
|
|
|
store.setzuoyi(res.data.座椅面套生产线)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function getCismaListData() {
|
|
|
|
let res = await getCismaList() as any
|
|
|
|
if (res.code === 200) {
|
|
|
|
store.setDevnum(res.data.devnum)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWebsocket(val){
|
|
|
|
try{
|
|
|
|
let data=JSON.parse(val)
|
|
|
|
|
|
|
|
|
|
|
|
if(data.type=='StateChart'){
|
|
|
|
store.setDevnum(data.msg)
|
|
|
|
}
|
|
|
|
if(data.type=='WorkingState'){
|
|
|
|
store.setDevnum(data.msg)
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch(err){
|
|
|
|
console.log(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function errWebsocket(val){
|
|
|
|
// console.log(val);
|
|
|
|
}
|
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
onMounted(() => {
|
2023-09-09 04:01:37 +00:00
|
|
|
getTopDeviceData()
|
|
|
|
getCismaListData()
|
|
|
|
connectWebsocket(null,null,getWebsocket,errWebsocket)
|
2023-09-08 08:03:33 +00:00
|
|
|
document.getElementById('app').style.backgroundColor = '#0E0E0E'
|
|
|
|
})
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
document.getElementById('app').style.backgroundColor = '#100c2a'
|
|
|
|
})
|
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;
|
|
|
|
background-color: #0E0E0E;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
.left,
|
|
|
|
.right {
|
2023-09-06 10:05:57 +00:00
|
|
|
height: 980px;
|
2023-08-23 10:06:47 +00:00
|
|
|
width: 600px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
.center {
|
2023-09-08 08:03:33 +00:00
|
|
|
width: 670px;
|
2023-09-06 10:05:57 +00:00
|
|
|
height: 980px;
|
2023-08-23 10:06:47 +00:00
|
|
|
margin: 0 20px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.lt,
|
|
|
|
.rt {
|
2023-08-23 10:06:47 +00:00
|
|
|
width: 100%;
|
2023-09-06 10:05:57 +00:00
|
|
|
height: 450px;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.lb,
|
|
|
|
.rb {
|
2023-08-23 10:06:47 +00:00
|
|
|
width: 100%;
|
|
|
|
height: 530px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ct {
|
|
|
|
width: 100%;
|
|
|
|
height: 110px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-around;
|
|
|
|
}
|
2023-09-08 08:03:33 +00:00
|
|
|
|
2023-09-06 10:05:57 +00:00
|
|
|
.cc {
|
|
|
|
width: 100%;
|
|
|
|
height: 350px;
|
|
|
|
}
|
2023-09-08 08:03:33 +00:00
|
|
|
|
2023-09-06 10:05:57 +00:00
|
|
|
.cb {
|
|
|
|
width: 100%;
|
|
|
|
height: 500px;
|
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
.top-item {
|
2023-08-24 10:10:09 +00:00
|
|
|
width: 30%;
|
|
|
|
height: 100%;
|
|
|
|
background-image: url(@/assets/img/u8.png);
|
|
|
|
background-size: 100% 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 5px;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
.top-item .div_p {
|
2023-08-24 10:10:09 +00:00
|
|
|
height: 60%;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
position: relative;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
.div_p .div-p-tip {
|
2023-08-24 10:10:09 +00:00
|
|
|
position: absolute;
|
|
|
|
font-size: 1.5rem;
|
|
|
|
top: 10%;
|
|
|
|
left: 20%;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
h2 {
|
2023-08-24 10:10:09 +00:00
|
|
|
/* color: #fff; */
|
|
|
|
font-size: 18px;
|
|
|
|
line-height: 1.5rem;
|
2023-09-06 10:05:57 +00:00
|
|
|
color: #02C1D7;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
.on {
|
2023-08-24 10:10:09 +00:00
|
|
|
color: #20AEC5;
|
|
|
|
font-size: 3.5rem;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
|
2023-08-23 10:06:47 +00:00
|
|
|
.off {
|
2023-08-24 10:10:09 +00:00
|
|
|
color: #797979;
|
|
|
|
font-size: 3.5rem;
|
2023-08-23 10:06:47 +00:00
|
|
|
}
|
2023-09-08 08:03:33 +00:00
|
|
|
|
|
|
|
.left-tip-type {
|
|
|
|
position: absolute;
|
|
|
|
top: 69px;
|
|
|
|
left: 462px;
|
|
|
|
width: 160px;
|
|
|
|
height: 50px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.left-tip-type-item {
|
|
|
|
width: 33%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.yuan {
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.green {
|
|
|
|
background-color: #7CFFB2;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.yello {
|
|
|
|
background-color: #FDDD60;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.red {
|
|
|
|
background-color: #FF6E76;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.blue {
|
|
|
|
color: #20AEC5;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.err {
|
|
|
|
color: #FF6E76;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.right-tip-type {
|
|
|
|
position: absolute;
|
|
|
|
top: 15px;
|
|
|
|
left: 1550px;
|
|
|
|
width: 120px;
|
|
|
|
height: 70px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.right-tip-type-item {
|
|
|
|
width: 58px;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-09-08 10:02:15 +00:00
|
|
|
|
2023-09-08 08:03:33 +00:00
|
|
|
.gatway {
|
|
|
|
font-size: 36px;
|
2023-09-09 04:01:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.wrap {
|
|
|
|
position: absolute;
|
|
|
|
top: 2px;
|
|
|
|
left: 582px;
|
|
|
|
width: 537px;
|
|
|
|
border-bottom: 0px solid transparent;
|
|
|
|
border-top: 92px solid #0E1D2F;
|
|
|
|
border-left: 109px solid transparent;
|
|
|
|
border-right: 110px solid transparent;
|
2023-09-08 10:02:15 +00:00
|
|
|
}</style>
|