Commit 257f5b52 authored by xiexingan's avatar xiexingan

tj

parent 160de698
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
data() { data() {
return { return {
speed: '', //装束 speed: '', //装束
temperature: '',//温度 temperature: '', //温度
models: '', //设定模式 models: '', //设定模式
windSpeed: '', //设定风速 windSpeed: '', //设定风速
state: 1, //开关 state: 1, //开关
...@@ -191,9 +191,8 @@ export default { ...@@ -191,9 +191,8 @@ export default {
}, },
created() { created() {
console.log("------") console.log('------')
this.setData() this.setData()
}, },
methods: { methods: {
init(data, stationId) { init(data, stationId) {
...@@ -249,69 +248,69 @@ export default { ...@@ -249,69 +248,69 @@ export default {
data: { data: {
id: this.dataForm.id, id: this.dataForm.id,
status: state, status: state,
actionName: this.dataForm.name + state==1?'开启':'关闭', actionName: this.dataForm.name + state == 1 ? '开启' : '关闭',
actionType: 1 actionType: 1
} }
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
}else{ } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}, },
// 控制温度、设定模式、设定风速 // 控制温度、设定模式、设定风速
handleSwitch2(val) { handleSwitch2(val) {
let com = "" let com = ''
let actionType = 2 let actionType = 2
let state = "" let state = ''
// 温度 temperature // 温度 temperature
if(val == 1){ if (val == 1) {
com = "设定温度控制为:" + this.temperature com = '设定温度控制为:' + this.temperature
state = this.temperature state = this.temperature
if(this.temperature) { if (this.temperature) {
if (!(/(^[1-9]\d*$)/.test(this.temperature))) { if (!(/(^[1-9]\d*$)/.test(this.temperature))) {
this.$message.warning("温度需要是17-30之间的整数1") this.$message.warning('温度需要是17-30之间的整数1')
return return
     }else if(this.temperature*1 < 17 || this.temperature*1 > 30){      } else if (this.temperature * 1 < 17 || this.temperature * 1 > 30) {
this.$message.warning("温度需要是17-30之间的整数2") this.$message.warning('温度需要是17-30之间的整数2')
return return
     }      }
}else{ } else {
this.$message.warning("温度需要是17-30之间的整数3") this.$message.warning('温度需要是17-30之间的整数3')
return; return
} }
}else if(val == 2){ // 设定模式 models } else if (val == 2) { // 设定模式 models
actionType = 3 actionType = 3
state = this.models state = this.models
if(this.models == 1){ if (this.models == 1) {
com = "设置模式为:自动模式" com = '设置模式为:自动模式'
}else if(this.models == 2){ } else if (this.models == 2) {
com = "设置模式为:制冷模式" com = '设置模式为:制冷模式'
}else if(this.models == 4){ } else if (this.models == 4) {
com = "设置模式为:除湿模式" com = '设置模式为:除湿模式'
}else if(this.models == 8){ } else if (this.models == 8) {
com = "设置模式为:送风模式" com = '设置模式为:送风模式'
}else if(this.models == 16){ } else if (this.models == 16) {
com = "设置模式为:制热模式" com = '设置模式为:制热模式'
} }
if(!this.models) { if (!this.models) {
this.$message.warning("请选择设定模式") this.$message.warning('请选择设定模式')
return; return
} }
}else { // 设定风速 windSpeed } else { // 设定风速 windSpeed
actionType = 4 actionType = 4
state = this.windSpeed state = this.windSpeed
if(windSpeed == 1){ if (windSpeed == 1) {
com = "设置风速为:高风" com = '设置风速为:高风'
}else if(windSpeed == 2){ } else if (windSpeed == 2) {
com = "设置风速为:中风" com = '设置风速为:中风'
}else if(windSpeed == 4){ } else if (windSpeed == 4) {
com = "设置风速为:低风" com = '设置风速为:低风'
} }
if(!this.windSpeed) { if (!this.windSpeed) {
this.$message.warning("请选择设定风速") this.$message.warning('请选择设定风速')
return; return
} }
} }
this.$http({ this.$http({
...@@ -326,7 +325,7 @@ export default { ...@@ -326,7 +325,7 @@ export default {
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
}else{ } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment