zhengkaixin 1 год назад
Родитель
Сommit
4799868de5
2 измененных файлов с 60 добавлено и 19 удалено
  1. 59 18
      pages/timing/autoOff.vue
  2. 1 1
      pages/timing/timing.vue

+ 59 - 18
pages/timing/autoOff.vue

@@ -65,7 +65,7 @@
 				
 				<view class="time">
 					 <view class="time-slot" >
-						智能停电时间
+						智能停电时间区间
 						
 					 </view>
 					 <view class="type">
@@ -125,12 +125,16 @@
 			 @click="thresholdsPopup=true" >
 				<view class="time">
 					<view class="time-slot">
-						最大功率阈值
+						智能停电条件
 					</view>
-					<view class="type">
-						{{formData.maxPower!=''?formData.maxPower+'kW':'未设置'}}
+					<view class="type" v-if="maxPower">
+						功率阈值:{{maxPower}}kW,持续时间{{closeMinute}}分钟后“自动停电”
+					
 					</view>
+					<view class="type" v-else>
+						未设置
 					
+					</view>
 					
 				</view>
 
@@ -144,8 +148,9 @@
 				<view class="time">
 					
 					<view class="type">
-						1. 功率达到最大阈值时“自动停电”;<br/>
-						2.“智能停电”结束时,如果处于停电状态将打开电源供电;
+						1. 智能停电条件:智能停电是功率大于等于阈值持续达到设定时间后;<br/>
+						2. 达到智能停电条件后“自动停电”,1分钟后恢复电源供电;<br/>
+						3.“智能停电”结束时,如果处于停电状态将打开电源供电;
 
 					</view>
 				</view>
@@ -316,16 +321,21 @@
 
 			</view>
 		</u-popup>
-		<!-- 最大功率阈值 -->
+		 
 		<u-popup v-model="thresholdsPopup" mode="bottom">
 			<view class="thresholds">
 				<view class="headline">
-					最大功率阈值(kW)
+					智能停电条件:功率(kW)
 				</view>
 				<view class="input" style=" padding: 0 24rpx;">
-				  	<u-input type="digit" min="1"
-					 v-model="maxPower" placeholder="填写触发智能停电的功率数值" />
+				  	<u-input type="digit" min="1" placeholderStyle="#777777"
+					 v-model="maxPower" placeholder="填写智能停电条件:功率数值" />
+				</view>
+				<view class="input" style=" padding: 24rpx 24rpx;">
+				  	<u-input type="digit" min="1"  placeholderStyle="#777777"
+					 v-model="closeMinute" placeholder="设置触发条件后多长时间自动断电(分钟)" />
 				</view>
+				
 				<view class="btn-group">
 					<view class="btn cancel" @click="thresholdsPopup=false" >
 						取消
@@ -417,8 +427,10 @@ import {
 					id:"",
 					endTime:"",
 					maxPower:"",
+					closeMinute:"",
 				},
 				progressColor:"#53b56b",
+				closeMinute:"",
 				
 				
 			}
@@ -619,6 +631,7 @@ import {
 						this.endTime=timerSwitch.startTime
 					}
 					this.maxPower=this.formData.maxPower
+					this.closeMinute=this.formData.closeMinute
 					
 				}).catch(error => {
 					uni.showToast({
@@ -628,10 +641,19 @@ import {
 				})
 			},
 			thresholdsPopupApi(){
-				if(this.maxPower!=''){
+				
+				if(this.maxPower!=''&&this.closeMinute!=''){
+					this.maxPower=parseInt(this.maxPower)
+					this.closeMinute=parseInt(this.closeMinute)
+					
 					if(this.maxPower<=0){
 						uni.showToast({
-							title: "请输入大于0的功率阈值(kw)",
+							title: "请输入大于0的功率阈值(kW)",
+							icon: "none"
+						})
+					}else if(this.closeMinute<=0){
+						uni.showToast({
+							title: "请输入大于0的自动断电时间(分钟)",
 							icon: "none"
 						})
 					}else{
@@ -640,10 +662,19 @@ import {
 					}
 				
 				}else{
-					uni.showToast({
-						title: "请填写最大功率阈值(kw)",
-						icon: "none"
-					})
+					if(this.maxPower==''){
+						uni.showToast({
+							title: "请填写智能停电条件:功率(kW)",
+							icon: "none"
+						})
+					}
+					if(this.closeMinute==''){
+						uni.showToast({
+							title: "设置触发条件后多长时间自动断电(分钟)",
+							icon: "none"
+						})
+					}
+					
 				}
 			},
 			pickerShow1confirm2(e){
@@ -730,7 +761,7 @@ import {
 						
 						
 						uni.showToast({
-							title: "请设置智能停电时间",
+							title: "请设置智能停电时间区间",
 							icon: "none"
 						})
 						return
@@ -786,14 +817,24 @@ import {
 				}
 				if(this.formData.switchStatus==3&&this.maxPower==''){
 					uni.showToast({
-						title: "请填写最大功率阈值(kw)",
+						title: "请填写智能停电条件:功率(kW)",
+						icon: "none"
+					})
+					return
+				}else if(this.formData.switchStatus==3&&this.closeMinute==''){
+					uni.showToast({
+						title: "设置触发条件后多长时间自动断电(分钟)",
 						icon: "none"
 					})
 					return
 				}else{
 					this.formData.maxPower=this.maxPower;
+					this.formData.closeMinute=this.closeMinute;
+					this.formData.openMinute=1;
 					if(!this.formData.maxPower){
 						this.formData.maxPower=''
+						this.formData.closeMinute='';
+						this.formData.openMinute='';
 					}
 				}
 				

+ 1 - 1
pages/timing/timing.vue

@@ -14,7 +14,7 @@
 		</u-navbar>
 		<view class="time-group">
 			<checkbox-group @change="checkboxChange">
-				<view class="time-item" v-for="(item,i) in timerSwitchList">
+				<view class="time-item" v-for="(item,i) in timerSwitchList" :key="i" >
 					<view class="time" @click="clicksheetInfo(item)">
 						<view class="time-slot">
 							{{item.startTime}}