Commit 257f5b52 authored by xiexingan's avatar xiexingan

tj

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