微工厂大屏修改

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

View File

@ -13,7 +13,9 @@
<div class="rbottom-title">{{t('MicroExhibition.后整设备')}}</div>
<div class="rbottom-content">
<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="ele-progress">
<el-progress :percentage="i.rationum" :show-text="false" :stroke-width="13">

View File

@ -50,9 +50,14 @@ const handleData = () => {
}
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
})
})
console.log(updateList);
devList.value.updateRows(updateList,config)
}
watch(()=>prop.data, (newVal, oldVal) => {
@ -76,7 +81,7 @@ let statusHtml = (color) => {
.ScrollBoard-container {
width: 100%;
height: 100%;
}
</style>

View File

@ -171,7 +171,7 @@ function getmDevList() {
temp = '0'
}
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]].total = devObj[key].list.length;
@ -190,7 +190,7 @@ function getmDevList() {
}
let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name
return {
name: devname,
name: {devname,label:item.label},
num: item.num,
status: temp,
ratio: item.ratio,