pcs开关机状态判断更新
This commit is contained in:
@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user