|
@@ -101,21 +101,21 @@
|
|
|
<view class="action-item">
|
|
<view class="action-item">
|
|
|
<image :src="lightning" alt="" class="item-icon">
|
|
<image :src="lightning" alt="" class="item-icon">
|
|
|
</image>
|
|
</image>
|
|
|
- <text>{{item.sensor_params.charging_vol || 0}}v</text>
|
|
|
|
|
|
|
+ <text>{{getcharging_vol(item.sensor_params)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="action-item">
|
|
<view class="action-item">
|
|
|
- <image :src="getSignal(item.sensor_params.rssl)" alt="" class="item-icon">
|
|
|
|
|
|
|
+ <image :src="getSignal(item.sensor_params)" alt="" class="item-icon">
|
|
|
</image>
|
|
</image>
|
|
|
- <text>{{item.sensor_params.rssl}}</text>
|
|
|
|
|
|
|
+ <text>{{getrssl(item.sensor_params)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="action-item">
|
|
<view class="action-item">
|
|
|
<image :src="battery" alt="" class="item-icon">
|
|
<image :src="battery" alt="" class="item-icon">
|
|
|
</image>
|
|
</image>
|
|
|
- <text>{{item.sensor_params.kwh}}%</text>
|
|
|
|
|
|
|
+ <text>{{getopeningValue(item.sensor_params)}}%</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="action-container" v-if="type_id == 49">
|
|
<view class="action-container" v-if="type_id == 49">
|
|
|
- <view class="action-container-item" :class="n.switchValue?'action-container-container-item-active':''" v-for="(n,key) in item.valve_params" :key="key">
|
|
|
|
|
|
|
+ <view class="action-container-item" :class="n.switchValue?'action-container-container-item-active':''" v-for="(n,key) in getvalve_params(item)" :key="key">
|
|
|
<view class="action-open">
|
|
<view class="action-open">
|
|
|
<view class="item-number" :class="{'item-number-active':n.switchValue}">{{n.name}}</view>
|
|
<view class="item-number" :class="{'item-number-active':n.switchValue}">{{n.name}}</view>
|
|
|
<u-switch
|
|
<u-switch
|
|
@@ -147,9 +147,8 @@
|
|
|
<u-popup v-model="showPopup" mode="bottom">
|
|
<u-popup v-model="showPopup" mode="bottom">
|
|
|
<u-form :model="form" label-width="160rpx" :label-style="{marginLeft:'20rpx'}">
|
|
<u-form :model="form" label-width="160rpx" :label-style="{marginLeft:'20rpx'}">
|
|
|
<u-form-item label="开启状态">
|
|
<u-form-item label="开启状态">
|
|
|
- <u-radio-group v-model="value" @change="radioGroupChange">
|
|
|
|
|
|
|
+ <u-radio-group v-model="value">
|
|
|
<u-radio
|
|
<u-radio
|
|
|
- @change="radioChange"
|
|
|
|
|
v-for="(item, index) in radioList" :key="index"
|
|
v-for="(item, index) in radioList" :key="index"
|
|
|
:name="item.value"
|
|
:name="item.value"
|
|
|
active-color="#0BBC58"
|
|
active-color="#0BBC58"
|
|
@@ -167,14 +166,14 @@
|
|
|
<view class="slider-min-value">10</view>
|
|
<view class="slider-min-value">10</view>
|
|
|
<view
|
|
<view
|
|
|
class="custom-progress"
|
|
class="custom-progress"
|
|
|
- @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 120)"
|
|
|
|
|
- @touchmove.stop.prevent="onSliderTouchMove($event, 10, 120)"
|
|
|
|
|
|
|
+ @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
|
|
|
+ @touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@touchend.stop="onSliderTouchEnd"
|
|
|
- @tap.stop="onSliderTap($event, 'openingValue', 10, 120)"
|
|
|
|
|
|
|
+ @tap.stop="onSliderTap($event, 'openingValue', 10, 100)"
|
|
|
>
|
|
>
|
|
|
<view class="progress-track">
|
|
<view class="progress-track">
|
|
|
- <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 120) + '%' }"></view>
|
|
|
|
|
- <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 120) + '%' }"></view>
|
|
|
|
|
|
|
+ <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
|
|
|
|
|
+ <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="slider-max-value">100</view>
|
|
<view class="slider-max-value">100</view>
|
|
@@ -191,14 +190,14 @@
|
|
|
<view class="slider-min-value">10</view>
|
|
<view class="slider-min-value">10</view>
|
|
|
<view
|
|
<view
|
|
|
class="custom-progress"
|
|
class="custom-progress"
|
|
|
- @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 120)"
|
|
|
|
|
- @touchmove.stop.prevent="onSliderTouchMove($event, 10, 120)"
|
|
|
|
|
|
|
+ @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
|
|
|
+ @touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@touchend.stop="onSliderTouchEnd"
|
|
|
- @tap.stop="onSliderTap($event, 'openingValue', 10, 120)"
|
|
|
|
|
|
|
+ @tap.stop="onSliderTap($event, 'openingValue', 10, 100)"
|
|
|
>
|
|
>
|
|
|
<view class="progress-track">
|
|
<view class="progress-track">
|
|
|
- <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 120) + '%' }"></view>
|
|
|
|
|
- <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 120) + '%' }"></view>
|
|
|
|
|
|
|
+ <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
|
|
|
|
|
+ <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="slider-max-value">100</view>
|
|
<view class="slider-max-value">100</view>
|
|
@@ -210,11 +209,12 @@
|
|
|
</u-popup>
|
|
</u-popup>
|
|
|
<u-modal v-model="show3" :content="content" @confirm="confirmClose" @cancel="cancelClose"></u-modal>
|
|
<u-modal v-model="show3" :content="content" @confirm="confirmClose" @cancel="cancelClose"></u-modal>
|
|
|
<u-select v-model="show1" :list="hours" @confirm="changeHour"></u-select>
|
|
<u-select v-model="show1" :list="hours" @confirm="changeHour"></u-select>
|
|
|
- <u-select v-model="show2" :list="minutes" @confirm="changeMinute"></u-select><u-popup v-model="show4" mode="center" width="80%">
|
|
|
|
|
- <view class="progress-container">
|
|
|
|
|
- <u-line-progress :percent="percentage" style="width: 90%;"></u-line-progress>
|
|
|
|
|
- </view>
|
|
|
|
|
- </u-popup>
|
|
|
|
|
|
|
+ <u-select v-model="show2" :list="minutes" @confirm="changeMinute"></u-select>
|
|
|
|
|
+ <u-popup v-model="show4" mode="center" width="80%" :mask-close-able="false">
|
|
|
|
|
+ <view class="progress-container">
|
|
|
|
|
+ <u-line-progress :percent="percentage" style="width: 90%;"></u-line-progress>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -310,6 +310,21 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getvalve_params(item){
|
|
|
|
|
+ return item?.valve_params || [];
|
|
|
|
|
+ },
|
|
|
|
|
+ getcharging_vol(item){
|
|
|
|
|
+ return item?.charging_vol || 0;
|
|
|
|
|
+ },
|
|
|
|
|
+ getrssl(item){
|
|
|
|
|
+ return item?.rssl || 0;
|
|
|
|
|
+ },
|
|
|
|
|
+ getopeningValue(item){
|
|
|
|
|
+ return item?.kwh || 0;
|
|
|
|
|
+ },
|
|
|
|
|
+ getRadioValue(){
|
|
|
|
|
+ return this.value;
|
|
|
|
|
+ },
|
|
|
setPercentage(msg){
|
|
setPercentage(msg){
|
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
|
this.percentage += 1;
|
|
this.percentage += 1;
|
|
@@ -326,7 +341,8 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
}
|
|
}
|
|
|
}, 125);
|
|
}, 125);
|
|
|
},
|
|
},
|
|
|
- getSignal(val){
|
|
|
|
|
|
|
+ getSignal(item){
|
|
|
|
|
+ const val = item?.rssl || 0;
|
|
|
if(val < 0){
|
|
if(val < 0){
|
|
|
return this.signal0;
|
|
return this.signal0;
|
|
|
}
|
|
}
|
|
@@ -395,6 +411,22 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async setEditAction(data){
|
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
|
+ url: '/api/api_gateway?method=irrigation_system.valvecontrol.alter_valvecontrol_valve_percentage',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+ if(res.code == 0){
|
|
|
|
|
+ this.show4 = true;
|
|
|
|
|
+ this.setPercentage(res.message);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res?.message,
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
onSliderTouchStart(e, field, min, max) {
|
|
onSliderTouchStart(e, field, min, max) {
|
|
|
this.sliderField = field
|
|
this.sliderField = field
|
|
|
this.sliderMin = min
|
|
this.sliderMin = min
|
|
@@ -436,7 +468,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
this.showPopup = false;
|
|
this.showPopup = false;
|
|
|
},
|
|
},
|
|
|
submit2(){
|
|
submit2(){
|
|
|
- this.setAction({
|
|
|
|
|
|
|
+ this.setEditAction({
|
|
|
device_id: this.current_device_id,
|
|
device_id: this.current_device_id,
|
|
|
valve_param_key: this.valve_param_key,
|
|
valve_param_key: this.valve_param_key,
|
|
|
var_value: this.equipContrlForm.openingValue,
|
|
var_value: this.equipContrlForm.openingValue,
|