微工厂大屏修改

This commit is contained in:
hzz 2024-03-28 17:04:43 +08:00
parent eebd14903e
commit 09969fa1a1
3 changed files with 34 additions and 19 deletions

View File

@ -116,7 +116,7 @@ let getImgSrc = computed(() => {
})
//
let speed = ref(200)
let speed = ref(2000)
function scatteredLayoutExhibitionDeviceFun() {
scatteredLayoutExhibitionDevice({ s: 'WME' }).then((res: any) => {
if (res.code == 200) {
@ -133,8 +133,16 @@ function scatteredLayoutExhibitionDeviceFun() {
if (name == '电脑绗绣机') {
device_data.value.push({ key: '花型编号', value: device_info['fileName'] })
}
if (device_info['status'] == 2) {
speed.value = 200
if (name == '电脑绣花机') {
device_data.value.push({ key: '版型', value: "展会560"})
}
if (name == '零等待皮革缝纫机') {
device_data.value.push({ key: '版型', value: "零等待(骨头).DSR" })
}
if (name == '床笠裙边机') {
speed.value = 3000
} else if (device_info['status'] == 2) {
speed.value = 2000
} else {
speed.value = 0
}
@ -257,7 +265,10 @@ function getWebsocket(val) {
if (device_data.value[2].value == RackNumber) {
device_data.value[1].value = WorkingState
speed.value = data.msg?.speed
if (device_data.value[0].value !="床笠裙边机") {
speed.value = data.msg?.speed
}
}
}

View File

@ -26,12 +26,12 @@
</div>
<div class="footer">
<div class="footer-left">
<button class="btn" :class="[isOn ? 'green' : 'gray']" :disabled="!isOn" @click="openDevice">
<button class="btn" :class="[isOn ? 'green' : 'gray']" :disabled="!isOn||(isOn&&loading)" :loading="isOn&&loading" @click="openDevice">
<img class="image" src="./images/on.svg" alt="">&nbsp;&nbsp;开机
</button>
</div>
<div class="footer-right">
<button class="btn" :class="[isOff ? 'red' : 'gray']" :disabled="!isOff" @click="closeDevice">
<button class="btn" :class="[isOff ? 'red' : 'gray']" :disabled="!isOff||(isOff&&loading)" :loading="isOff&&loading" @click="closeDevice">
<img class="image" src="./images/off.svg" alt="">&nbsp;&nbsp;关机
</button>
</div>
@ -55,16 +55,16 @@ const isOn = ref(false)
const isOff = ref(false)
let timer = null
let isShow = true
let loading = ref(false)
//
async function getDeviceStatus(query) {
try {
const result:any = await getStatus(query)
const result: any = await getStatus(query)
if (result.code == 200) {
let data = result.data
deviceList.value = [
{ val: data.name },
{ val: data.model },
{ val: data.model||data.name },
{ val: data.label },
]
image.value = process.env.VUE_APP_BASE_API + data.img
@ -89,13 +89,15 @@ async function openDevice() {
if (!isOn.value) return
clearInterval(timer)
let queryData = { id: device_id }
let result:any = await setOpen(queryData)
loading.value = true
let result: any = await setOpen(queryData)
if (result.code == 200) {
let data = result.data
isOn.value = data.open
isOff.value = data.close
isShow = true
}
loading.value = false
timer = setInterval(() => {
getDeviceStatus({ id: device_id })
}, 10000)
@ -106,7 +108,8 @@ async function closeDevice() {
if (!isOff.value) return
clearInterval(timer)
let queryData = { id: device_id }
let result:any = await setClose(queryData)
loading.value = true
let result: any = await setClose(queryData)
if (result.code == 200) {
let data = result.data
isOn.value = data.open
@ -119,6 +122,7 @@ async function closeDevice() {
}, 10000)
isShow = true
}
loading.value = false
}
@ -144,7 +148,6 @@ onUnmounted(() => {
</script>
<style scoped>
@import url("@/assets/css/styles/iconfont.css");
@font-face {
@ -343,4 +346,5 @@ onUnmounted(() => {
.container .footer .footer-right .btn .image {
width: 50px;
height: 119px;
}</style>
}
</style>

View File

@ -80,7 +80,7 @@ let { t } = useI18n();
let route = useRoute()
const store = useMicroExhibitionStore()
let lang = route.query.lang as string
let videoUrl = ref('https://d.tufting222.cn/video/yzy/a.mp4')
let videoUrl = ref('http://d.tufting222.cn/video/yzy/a.mp4')
const videoElement = ref(null)
let timer = null
let thisLang = getStoredLanguage();
@ -136,7 +136,7 @@ function getDeviceProduction() {
data: item.data
}
})
let xDataArr = thisLang != "简体中文"?data.exData:data.xData
let xDataArr = thisLang&&thisLang != "简体中文"?data.exData:data.xData
xData.value = xDataArr
}
})
@ -170,7 +170,7 @@ function getmDevList() {
} else if (item.status == "false") {
temp = '0'
}
let devname = thisLang == "简体中文"?item.name:item.ename
let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name
return [i + 1, devname, item.num, temp, item.ratio, item.workTime]
})
stepList[statusObj[key]].online = online;
@ -188,7 +188,7 @@ function getmDevList() {
} else if (item.status == "false") {
temp = '0'
}
let devname = thisLang == "简体中文"?item.name:item.ename
let devname = thisLang&&thisLang != "简体中文"?item.ename:item.name
return {
name: devname,
num: item.num,
@ -282,8 +282,8 @@ function errWebsocket(val) {
onMounted(() => {
if (thisLang != "简体中文") {
videoUrl.value = "https://d.tufting222.cn/video/yzy/micor_edos_english.mp4"
if (thisLang&&thisLang != "简体中文") {
videoUrl.value = "http://d.tufting222.cn/video/yzy/micor_edos_english.mp4"
}
getDeviceProduction()