|
@@ -29,7 +29,7 @@
|
|
|
<view class="timing">
|
|
<view class="timing">
|
|
|
<p class="operation_title">上传时间间隔(min)</p>
|
|
<p class="operation_title">上传时间间隔(min)</p>
|
|
|
<view class="timing_text">
|
|
<view class="timing_text">
|
|
|
- <slider value="1" @change="sliderChange" step="1" min="1" max="360" show-value block-size="18" activeColor="#57C878" />
|
|
|
|
|
|
|
+ <slider value="1" v-model="config.interval" @change="sliderChange" step="1" min="1" max="360" show-value block-size="18" activeColor="#57C878" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="ensure">
|
|
<view class="ensure">
|
|
@@ -48,22 +48,47 @@
|
|
|
config: {
|
|
config: {
|
|
|
content: "",
|
|
content: "",
|
|
|
timeout: "",
|
|
timeout: "",
|
|
|
- interval: ""
|
|
|
|
|
|
|
+ interval: 1
|
|
|
},
|
|
},
|
|
|
id: ''
|
|
id: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // forecast.send_control.device_control_info 设备配置查询
|
|
|
|
|
+ async controsdata(datas) { //提交数据
|
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
|
+ url: '/api/api_gateway?method=forecast.send_control.device_control_info',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ d_id: this.id,
|
|
|
|
|
+ cmd: "config"
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.config.interval = res.interval
|
|
|
|
|
+ this.config.content = res.content
|
|
|
|
|
+ this.config.timeout = res.timeout
|
|
|
|
|
+ },
|
|
|
//forecast.send_control.device_control config: {"interval":10,"content":"content","timeout":"1"}
|
|
//forecast.send_control.device_control config: {"interval":10,"content":"content","timeout":"1"}
|
|
|
async timing(datas) { //提交数据
|
|
async timing(datas) { //提交数据
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
- url: '/api/api_gateway?method=weather.weather.qxz_status',
|
|
|
|
|
|
|
+ url: '/api/api_gateway?method=forecast.send_control.device_control',
|
|
|
data: {
|
|
data: {
|
|
|
device_type_id: 5,
|
|
device_type_id: 5,
|
|
|
d_id: this.id,
|
|
d_id: this.id,
|
|
|
config: JSON.stringify(datas)
|
|
config: JSON.stringify(datas)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '指令下发成功!'
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '指令下发失败!',
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
//forecast.send_control.admin_device_control
|
|
//forecast.send_control.admin_device_control
|
|
|
async restart(datas) { //重启
|
|
async restart(datas) { //重启
|
|
@@ -81,7 +106,8 @@
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '指令下发失败!'
|
|
|
|
|
|
|
+ title: '指令下发失败!',
|
|
|
|
|
+ icon: "none"
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -92,7 +118,7 @@
|
|
|
data: {
|
|
data: {
|
|
|
device_type_id: 5,
|
|
device_type_id: 5,
|
|
|
d_id: this.id,
|
|
d_id: this.id,
|
|
|
- control_type: "data"
|
|
|
|
|
|
|
+ control_type: "interval"
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -102,7 +128,8 @@
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '指令下发失败!'
|
|
|
|
|
|
|
+ title: '指令下发失败!',
|
|
|
|
|
+ icon: "none"
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -113,6 +140,7 @@
|
|
|
},
|
|
},
|
|
|
ensure() { //提交
|
|
ensure() { //提交
|
|
|
this.timing(this.config)
|
|
this.timing(this.config)
|
|
|
|
|
+ console.log(this.config)
|
|
|
},
|
|
},
|
|
|
sliderChange(e) { //滑动块
|
|
sliderChange(e) { //滑动块
|
|
|
this.config.interval = e.detail.value
|
|
this.config.interval = e.detail.value
|
|
@@ -129,6 +157,9 @@
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
this.id = option.id
|
|
this.id = option.id
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ this.controsdata()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|