微工厂大屏修改

This commit is contained in:
hzz 2024-04-24 17:02:29 +08:00
parent fec8589136
commit 7356ed773e
4 changed files with 21 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<div class="header"> <div class="header">
<div class="title">再登软件工况物联系统</div> <div class="title">再登软件工况物联系统</div>
</div> </div>
<div class="content"> <div class="content" v-loading="link_loading" element-loading-text="连接中...">
<div class="content-item"> <div class="content-item">
<img :src="image" alt="" class="image"> <img :src="image" alt="" class="image">
</div> </div>
@ -56,8 +56,11 @@ const isOff = ref(false)
let timer = null let timer = null
let isShow = true let isShow = true
let loading = ref(false) let loading = ref(false)
let link_loading = ref(true)
let is_response = false
// //
async function getDeviceStatus(query) { async function getDeviceStatus(query) {
is_response = false
try { try {
const result: any = await getStatus(query) const result: any = await getStatus(query)
if (result.code == 200) { if (result.code == 200) {
@ -79,6 +82,9 @@ async function getDeviceStatus(query) {
clearInterval(timer) clearInterval(timer)
console.log(e); console.log(e);
} finally {
link_loading.value = false
is_response = true
} }
@ -138,6 +144,9 @@ onMounted(() => {
getDeviceStatus({ id: device_id }) getDeviceStatus({ id: device_id })
timer = setInterval(() => { timer = setInterval(() => {
if (!is_response) {
return
}
getDeviceStatus({ id: device_id }) getDeviceStatus({ id: device_id })
}, 10000) }, 10000)
}) })

View File

@ -13,7 +13,9 @@
<div class="rbottom-title">{{t('MicroExhibition.后整设备')}}</div> <div class="rbottom-title">{{t('MicroExhibition.后整设备')}}</div>
<div class="rbottom-content"> <div class="rbottom-content">
<div class="rbottom-bg" v-for="i in (prop.data as any)"> <div class="rbottom-bg" v-for="i in (prop.data as any)">
<div class="dev-name">{{ i.name }}</div> <div class="dev-name">
<div style="display: flex;flex-direction: column;justify-content: center;align-items: center;"><div>{{i.name.devname}}</div><div>{{i.name.label}}</div></div>
</div>
<div class="dev-progress"> <div class="dev-progress">
<div class="ele-progress"> <div class="ele-progress">
<el-progress :percentage="i.rationum" :show-text="false" :stroke-width="13"> <el-progress :percentage="i.rationum" :show-text="false" :stroke-width="13">

View File

@ -50,9 +50,14 @@ const handleData = () => {
} }
return statusHtml(status_color[temp]) return statusHtml(status_color[temp])
} }
if (index == 1) {
return `<div style="display: flex;flex-direction: column;justify-content: center;align-items: center;"><div>${item.devname}</div><div>${item.label}</div></div>`
}
return item return item
}) })
}) })
console.log(updateList);
devList.value.updateRows(updateList,config) devList.value.updateRows(updateList,config)
} }
watch(()=>prop.data, (newVal, oldVal) => { watch(()=>prop.data, (newVal, oldVal) => {

View File

@ -171,7 +171,7 @@ function getmDevList() {
temp = '0' temp = '0'
} }
let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name
return [i + 1, devname, item.num, temp, item.ratio, item.workTime] return [i + 1, {devname,label:item.label}, item.num, temp, item.ratio, item.workTime]
}) })
stepList[statusObj[key]].online = online; stepList[statusObj[key]].online = online;
stepList[statusObj[key]].total = devObj[key].list.length; stepList[statusObj[key]].total = devObj[key].list.length;
@ -190,7 +190,7 @@ function getmDevList() {
} }
let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name
return { return {
name: devname, name: {devname,label:item.label},
num: item.num, num: item.num,
status: temp, status: temp,
ratio: item.ratio, ratio: item.ratio,