|
@@ -4,9 +4,9 @@
|
|
|
联网模块
|
|
联网模块
|
|
|
</view>
|
|
</view>
|
|
|
<view class="btns">
|
|
<view class="btns">
|
|
|
- <button type="warn" size="mini">升级</button>
|
|
|
|
|
- <button type="warn" size="mini">重启</button>
|
|
|
|
|
- <button type="warn" size="mini">MQTT配置</button>
|
|
|
|
|
|
|
+ <button type="warn" @click="equipBtnControl('dtu_update')" size="mini">升级</button>
|
|
|
|
|
+ <button type="warn" @click="equipBtnControl('dtu_reboot')" size="mini">重启</button>
|
|
|
|
|
+ <button type="warn" @click="mqttInfo" size="mini">MQTT配置</button>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="tit adminTit">
|
|
<view class="tit adminTit">
|
|
|
板子设置
|
|
板子设置
|
|
@@ -34,15 +34,17 @@
|
|
|
<view class="arrow"></view>
|
|
<view class="arrow"></view>
|
|
|
</picker>
|
|
</picker>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="tit">
|
|
|
|
|
- 工作模式
|
|
|
|
|
|
|
+ <!-- <view class="tit">
|
|
|
|
|
+ 工作状态
|
|
|
</view>
|
|
</view>
|
|
|
<view class="uni-list-cell">
|
|
<view class="uni-list-cell">
|
|
|
<picker @change="turnChange($event,'ws')" :value="equipContrlForm.ws" :range="wsArr">
|
|
<picker @change="turnChange($event,'ws')" :value="equipContrlForm.ws" :range="wsArr">
|
|
|
<text class="uni-input">{{wsArr[equipContrlForm.ws]}}</text>
|
|
<text class="uni-input">{{wsArr[equipContrlForm.ws]}}</text>
|
|
|
<view class="arrow"></view>
|
|
<view class="arrow"></view>
|
|
|
</picker>
|
|
</picker>
|
|
|
- </view>
|
|
|
|
|
|
|
+ <u-modal v-model="wsModelShow" content="确定修改工作模式?" show-cancel-button @confirm="wsConfirm" @cancel="wsCancel" ref="uModal" ></u-modal>
|
|
|
|
|
+ <u-toast ref="wsToast" />
|
|
|
|
|
+ </view> -->
|
|
|
<view class="tit">
|
|
<view class="tit">
|
|
|
定时模式
|
|
定时模式
|
|
|
</view>
|
|
</view>
|
|
@@ -117,6 +119,7 @@
|
|
|
<view class="submit-box">
|
|
<view class="submit-box">
|
|
|
<u-button @click="submit" type="success">确定</u-button>
|
|
<u-button @click="submit" type="success">确定</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <u-toast ref="toast" />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -133,11 +136,12 @@
|
|
|
tsIndex:0,
|
|
tsIndex:0,
|
|
|
imgresArr:['高','中','低'],
|
|
imgresArr:['高','中','低'],
|
|
|
imgresIndex:"",
|
|
imgresIndex:"",
|
|
|
|
|
+ wsModelShow:false,
|
|
|
equipContrlForm:{
|
|
equipContrlForm:{
|
|
|
ds:0,//设备开关
|
|
ds:0,//设备开关
|
|
|
- ws:0,//工作模式
|
|
|
|
|
ts:0,//定时模式
|
|
ts:0,//定时模式
|
|
|
tt:1,//定时时长
|
|
tt:1,//定时时长
|
|
|
|
|
+ ws:0,//工作状态
|
|
|
collt: 1,
|
|
collt: 1,
|
|
|
htim: 1,
|
|
htim: 1,
|
|
|
hst: 75,
|
|
hst: 75,
|
|
@@ -259,7 +263,9 @@
|
|
|
this.equipContrlForm.ds=e.target.value
|
|
this.equipContrlForm.ds=e.target.value
|
|
|
}else if(a=='ws'){
|
|
}else if(a=='ws'){
|
|
|
// this.wsIndex = e.target.value
|
|
// this.wsIndex = e.target.value
|
|
|
|
|
+ this.wsModelShow=true
|
|
|
this.equipContrlForm.ws=e.target.value
|
|
this.equipContrlForm.ws=e.target.value
|
|
|
|
|
+
|
|
|
}else if(a=='ts'){
|
|
}else if(a=='ts'){
|
|
|
// this.tsIndex = e.target.value
|
|
// this.tsIndex = e.target.value
|
|
|
this.equipContrlForm.ts=e.target.value
|
|
this.equipContrlForm.ts=e.target.value
|
|
@@ -273,6 +279,29 @@
|
|
|
this.etLabel=e[0].label
|
|
this.etLabel=e[0].label
|
|
|
this.equipContrlForm.et=e[0].value
|
|
this.equipContrlForm.et=e[0].value
|
|
|
},
|
|
},
|
|
|
|
|
+ async wsConfirm(){
|
|
|
|
|
+ console.log(222)
|
|
|
|
|
+ const res=await this.$myRequest({
|
|
|
|
|
+ url:'/api/api_gateway?method=forecast.send_control.device_control',
|
|
|
|
|
+ data:{
|
|
|
|
|
+ device_type_id:3,
|
|
|
|
|
+ d_id:this.d_id,
|
|
|
|
|
+ work_type: this.equipContrlForm.ws,
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ this.$refs.wsToast.show({
|
|
|
|
|
+ title: '修改成功',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ wsCancel(){
|
|
|
|
|
+ this.$refs.wsToast.show({
|
|
|
|
|
+ title: '取消修改',
|
|
|
|
|
+ type: 'default',
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
selectTime(a){
|
|
selectTime(a){
|
|
|
if(a=='st'){
|
|
if(a=='st'){
|
|
|
this.stShow=true;
|
|
this.stShow=true;
|
|
@@ -314,21 +343,48 @@
|
|
|
cmd: 'paramconf'
|
|
cmd: 'paramconf'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ this.stLabel =
|
|
|
|
|
+ res.st && res.st < 10 ? '0' + res.st + ':00' : res.st + ':00'
|
|
|
|
|
+ this.etLabel=
|
|
|
|
|
+ res.et && res.et < 10 ? '0' + res.et + ':00' : res.et + ':00'
|
|
|
this.equipContrlForm=res
|
|
this.equipContrlForm=res
|
|
|
- console.log(res)
|
|
|
|
|
},
|
|
},
|
|
|
async submit(){
|
|
async submit(){
|
|
|
console.log(this.equipContrlForm)
|
|
console.log(this.equipContrlForm)
|
|
|
let res=await this.$myRequest({
|
|
let res=await this.$myRequest({
|
|
|
url:'/api/api_gateway?method=forecast.send_control.device_control',
|
|
url:'/api/api_gateway?method=forecast.send_control.device_control',
|
|
|
data:{
|
|
data:{
|
|
|
- device_type_id:'',
|
|
|
|
|
|
|
+ device_type_id:3,
|
|
|
d_id: this.d_id,
|
|
d_id: this.d_id,
|
|
|
config: JSON.stringify(this.equipContrlForm)
|
|
config: JSON.stringify(this.equipContrlForm)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ this.$refs.toast.show({
|
|
|
|
|
+ title: '修改成功!',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async equipBtnControl(cmd){
|
|
|
|
|
+ let res=await this.$myRequest({
|
|
|
|
|
+ url:'/api/api_gateway?method=forecast.send_control.admin_device_control',
|
|
|
|
|
+ data:{
|
|
|
|
|
+ cmd,
|
|
|
|
|
+ device_type_id: 3,
|
|
|
|
|
+ d_id: this.d_id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ this.$refs.toast.show({
|
|
|
|
|
+ title: '指令下发成功!',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mqttInfo(){
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|