修改场外接收socket处理方式

修改机械分厂设备大屏 标题装饰
添加装饰组件 和svg图片
This commit is contained in:
hzz 2023-06-27 17:00:43 +08:00
parent fcd2b922e1
commit 550a042107
11 changed files with 163 additions and 78 deletions

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="58px" height="14px" xmlns="http://www.w3.org/2000/svg">
<defs>
<mask fill="white" id="clip1">
<path d="M 255 113 C 253.89 113 253 112.11 253 111 L 253 101 C 253 99.89 253.89 99 255 99 L 309 99 C 310.11 99 311 99.89 311 101 L 311 111 C 311 112.11 310.11 113 309 113 " fill-rule="evenodd" />
</mask>
</defs>
<g transform="matrix(1 0 0 1 -253 -99 )">
<image preserveAspectRatio="none" style="overflow:visible" width="58" height="14" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAAOCAYAAAB+UA+TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJ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IVlZhXIJx4z9ufd8X7nat+7vy3/yBVwc+12sNB5VFiH7PdrSfAIXz4rqsZPGxXQO44KmceF8jymPtpyEx4W75a65ekEqxF3cC/Y/gTBgyHY4CD7kLDyDODtgDFygu/AA4nj/aeiEOzAFcbz/ImyDCbgKcTzzb8IBGIdzsJyKrlbSrEZyHuIESc9OJe9DnCDpcyjpRzBOkFQmSPqsIUGyH4Jk+emMRVtW0gTRlpY0ilpdmySdvEnS/iZJq16TpH8/BXWS/gS8AHWSznsdlPS3cEXSeLxY/RzMMp5KGqvfWrDEp5ImVEeLTippnNT3PIdU0ji/VdZ/CNLCY5RaACv1tZV2msfgM5yHimRRFMUf5rMaGf6QPUsAAAAASUVORK5CYII=" x="253px" y="99px" mask="url(#clip1)" />
</g>
</svg>

View File

@ -0,0 +1,35 @@
<template>
<div class="title">
<slot></slot>
</div>
</template>
<script setup lang='ts'>
</script>
<style scoped>
.title {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.title::before {
content: '';
width: 70px;
height: 20px;
background: url('@/assets/img/bg_left.svg');
background-size: 100% 100%;
}
.title::after {
content: '';
width: 70px;
height: 20px;
background: url('@/assets/img/bg_left.svg');
background-size: 100% 100%;
transform: rotateY(180deg);
}
</style>

View File

@ -75,7 +75,7 @@ export const Offsite = defineStore(Names.offsite, {
val.forEach((res) => {
if (res.name == ele.type) {
//网关是否在线
ele.status=res.gatewayStatus
// ele.status=res.gatewayStatus
ele.num = res.counts;
}
});

View File

@ -9,7 +9,11 @@
-->
<template>
<div style="height: 100%; width: 100%">
<h2 class="components-header">{{ title }}</h2>
<h2 class="components-header">
<DecorationFadeOut>
&nbsp;{{ title }}&nbsp;
</DecorationFadeOut>
</h2>
<div class="components-content" :key="keynum">
<swiper-container :slidesPerView="props.per_view" :loop="true" :initialSlide="0" :spaceBetween="0"
direction="vertical" :autoplay="{
@ -70,6 +74,7 @@
import { reactive, ref, watch } from "vue";
import { register } from "swiper/element/bundle";
import { useI18n } from "vue-i18n";
import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
let { t } = useI18n();
register();
const props: any = defineProps({
@ -152,5 +157,6 @@ swiper-container {
width: 100%;
height: 100%;
display: inline-block !important;
}</style>
}
</style>

View File

@ -11,9 +11,14 @@
<div class="box" :style="{ width: '100%', height: '100%' }">
<div class="title-box">
<h2>{{ props.title }}</h2>
<h2>
<DecorationFadeOut>
&nbsp;{{ props.title }}&nbsp;
</DecorationFadeOut>
</h2>
<div class="colorTip">
<div><i class="iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan icon-blue"></i> {{t('messages.onLine')}}</div>
<div><i class="iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan icon-blue"></i>
{{ t('messages.onLine') }}</div>
<div style="color:#e43961"><i class="iconfont icon-beikongshuiwupingtaimenhu-tubiao_zhinengwangguan icon-red"></i>
{{ t('messages.offline') }}</div>
</div>
@ -36,6 +41,7 @@ import border13 from "@/components/border/Border13.vue";
import { useI18n } from 'vue-i18n'
import { useMechanicsStore } from "@/store/module/Mechanics";
import { useRouter } from "vue-router";
import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
const router = useRouter()
const store = useMechanicsStore();
let { t } = useI18n();

View File

@ -8,13 +8,21 @@
* 版权信息 : 2023 by ${再登软件}, All Rights Reserved.
-->
<template>
<div class="container">
<h2 class="title">
<DecorationFadeOut>
&nbsp;{{ t('messages.设备状态总览') }}&nbsp;
</DecorationFadeOut>
</h2>
<div class="ring" ref="ringRef"></div>
</div>
</template>
<script setup lang='ts'>
import { ref, onMounted, onUnmounted, getCurrentInstance, watch, onUpdated } from 'vue'
const { proxy } = getCurrentInstance() as any;
import { useI18n } from 'vue-i18n'
import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
let { t } = useI18n();
let ringRef = ref();
let ringChart = null;
@ -25,21 +33,12 @@ const prop = defineProps({
const init = () => {
ringChart = proxy.$echarts.init(ringRef.value, 'dark')
let option = {
title: {
text: t('messages.设备状态总览'),
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
left: 'center'
},
tooltip: {
trigger: "item",
},
legend: {
type: "scroll",
top: "10%",
top: "5%",
left: "center",
textStyle: {
color: "#fff",
@ -69,7 +68,7 @@ const init = () => {
labelLine: {
show: true,
},
top: '20%',
top: '10%',
data: prop.data,
},
],
@ -92,8 +91,20 @@ onMounted(() => {
</script>
<style scoped>
.ring {
.container {
width: 100%;
height: 100%;
}
.title {
color: #fff;
font-size: 20px;
margin-bottom: 10px;
text-align: center;
}
.ring {
width: 100%;
height: calc(100% - 50px);
}
</style>

View File

@ -9,14 +9,19 @@
-->
<template>
<div class="box">
<div class="box-title">{{t('messages.机械分厂设备列表')}}</div>
<div class="box-title">
<DecorationFadeOut>
&nbsp;{{ t('messages.机械分厂设备列表') }}&nbsp;
</DecorationFadeOut>
</div>
<div class="box-body">
<dv-scroll-board ref="devList" @click="dvClick" :config="prop.config" @mouseover="dvMouseover" @mouseend="dvmouseleave" :style="{
<dv-scroll-board ref="devList" @click="dvClick" :config="prop.config" @mouseover="dvMouseover"
@mouseend="dvmouseleave" :style="{
width: '100%',
height: '100%',
}" />
<el-tooltip v-model:visible="visible" :content="tipcontent" placement="top" effect="light" trigger="click" popper-class="tooltip-class"
virtual-triggering :virtual-ref="triggerRef" />
<el-tooltip v-model:visible="visible" :content="tipcontent" placement="top" effect="light" trigger="click"
popper-class="tooltip-class" virtual-triggering :virtual-ref="triggerRef" />
</div>
</div>
</template>
@ -26,6 +31,7 @@ import { getCurrentInstance, onMounted, reactive, ref } from "vue";
import { devListType } from "@/type/InPlantProducts";
import { useRouter } from "vue-router"
import { useI18n } from 'vue-i18n'
import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
let { t } = useI18n();
const prop = defineProps({
config: Object,
@ -123,6 +129,7 @@ const dvmouseleave = () => {
white-space: pre-wrap;
text-overflow: none
}
:deep(.dv-scroll-board .rows .row-item) {
font-size: 16px;
}

View File

@ -14,7 +14,11 @@
<div style="width: 100%; height: 68%;">
<border13>
<div style="width: 100%;height: 100%;">
<h2 class="module-header">设备总览</h2>
<h2 class="module-header">
<DecorationFadeOut>
&nbsp;设备总览&nbsp;
</DecorationFadeOut>
</h2>
<div class="module-content">
<DevOverview :title="'设备总数'" :value="{ onLine: facTotal.onLine, total: facTotal.total }"></DevOverview>
<DevOverview :title="item.name" :value="{ onLine: item.onLine, total: item.total }"
@ -64,6 +68,7 @@
<script setup lang="ts">
import { nextTick, onMounted, onUnmounted, reactive, ref } from "vue";
import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
import header2 from "@/components/headerBox/header2.vue";
import border13 from '@/components/border/Border13.vue'
import DevOverview from "./components/DevOverview.vue";

View File

@ -81,6 +81,10 @@ const box = (width: any, height: any) => {
watch(
() => store.devlist,
(newVal, oldVal) => {
city1['on'] = 0
city1['off'] = 0
city2['on'] = 0
city2['off'] = 0
newVal.forEach(res => {
if (res.city == '广东省') {
if (res.deviceStatus == "true") {
@ -108,6 +112,8 @@ watch(
{ deep: true, flush: "post" }
);
function setdata(data: any) {
city1['num'] = 0
city2['num'] = 0
data.forEach(res => {

View File

@ -81,7 +81,7 @@ watch(
(newVal, oldVal) => {
let arr = [];
newVal.forEach((res) => {
if (res.type == t('messages.OnProduct') || res.type == t('messages.OffProduct')) {
if (res.type == '在线产品' || res.type == '离线产品') {
arr.push({ name: res.title, value: res.num });
}
});

View File

@ -78,9 +78,9 @@ let {t} = useI18n();
if(result.code==200){
result.data.forEach(res=>{
if(res.deptId=='true'){
res.name=t('messages.OnProduct')
res.name='在线产品'
}else{
res.name=t('messages.OffProduct')
res.name='离线产品'
}
})
@ -98,7 +98,6 @@ let {t} = useI18n();
city.push(res.city)
})
store.setcity([...new Set(city)]);
console.log(store.city);
}
}
@ -109,17 +108,16 @@ let {t} = useI18n();
if(data.type=='deviceStatusCountsOfOutPlant'){
data.msg.forEach(res=>{
if(res.deptId=='true'){
res.name=t('messages.OnProduct')
res.name='在线产品'
}else{
res.name=t('messages.OffProduct')
res.name='离线产品'
}
store.setdevitem(res)
})
store.setdevitem(data.msg)
// store.socketMechanicsDatadata(data.msg)
}
if(data.type=='DeviceOutPlant'){
store.changeDevList(data.msg)
console.log(data.msg);
}