pcs开关机状态判断更新

This commit is contained in:
白菜
2026-01-23 20:06:47 +08:00
parent fccddab04a
commit 81f8f75d7e
2 changed files with 7 additions and 204 deletions

View File

@ -40,14 +40,18 @@ export default {
required: true
}
},
data() {
return {
runningStatusMap: ['0', '3', '4', '6']
}
},
computed: {
label() {
return this.data.workStatus === '0' ? '关机' : '开机'
return this.runningStatusMap.includes(this.data.workStatus) ? '关机' : '开机'
}
},
methods: {
switchStatus() {
console.log(this.data, 11111111)
const {workStatus, deviceId, deviceName, siteId} = this.data
this.$confirm(`确认要${this.label}设备${deviceName || ''}吗?`, {
confirmButtonText: "确定",
@ -61,7 +65,7 @@ export default {
//做开关机操作,更新成功后刷新表格
updateDeviceStatus({
siteId,
workStatus: workStatus === '0' ? "1" : '0',
workStatus: this.runningStatusMap.includes(workStatus) ? "1" : '0',
deviceId
})
.then((response) => {