|
|
@@ -9,8 +9,10 @@
|
|
|
<image :src="rotate" class="rotate-rotate" />
|
|
|
<image :src="water" class="rotate-water" />
|
|
|
<view class="rotationflow-time">
|
|
|
- <view class="rotationflow-time-title">{{ currentFq.name }}</view>
|
|
|
- <view class="rotationflow-time-content"> {{ time }}</view>
|
|
|
+ <view class="rotationflow-time-title" style="font-size: 28px">{{
|
|
|
+ currentFq.name
|
|
|
+ }}</view>
|
|
|
+ <!-- <view class="rotationflow-time-content"> {{ time }}</view> -->
|
|
|
<view class="rotationflow-time-label">{{ label }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -31,17 +33,17 @@
|
|
|
<view class="rotationflow-content-top">
|
|
|
<view
|
|
|
:class="
|
|
|
- tktype == '0'
|
|
|
+ tktype == '1'
|
|
|
? 'rotationflow-content-top-title'
|
|
|
: 'rotationflow-content-top-title-rever'
|
|
|
"
|
|
|
>
|
|
|
- {{ tktype == '0' ? '灌溉' : '水肥' }}
|
|
|
+ {{ tktype == '1' ? '灌溉' : '水肥' }}
|
|
|
</view>
|
|
|
<view class="rotationflow-content-top-desc">已选灌区</view>
|
|
|
</view>
|
|
|
<view class="rotationflow-content-list">
|
|
|
- <view class="rotationflow-content-list-wrapper" v-if="tktype == 0">
|
|
|
+ <view class="rotationflow-content-list-wrapper" v-if="tktype == 1">
|
|
|
<view class="rotationflow-content-num">
|
|
|
<view class="rotationflow-content-num-title"
|
|
|
>轮灌次数:{{ currentFq.lgcs || 0 }}</view
|
|
|
@@ -61,7 +63,7 @@
|
|
|
> </view
|
|
|
><view class="rotationflow-content-num">
|
|
|
<view class="rotationflow-content-num-title"
|
|
|
- >轮灌次数:{{ currentFq.lgjg || 0 }} 分钟</view
|
|
|
+ >轮灌间隔:{{ currentFq.lgjg || 0 }} 分钟</view
|
|
|
>
|
|
|
<view class="rotationflow-content-num-title"
|
|
|
>肥后水:{{ currentFq.fhcx || 0 }} 分钟</view
|
|
|
@@ -76,7 +78,7 @@
|
|
|
<view
|
|
|
class="rotationflow-content-list-item"
|
|
|
v-for="(item, index) in fqList"
|
|
|
- :class="index === 0 ? 'haveYet' : index === 1 ? 'currentYet' : ''"
|
|
|
+ :class="item.value === '2' ? 'haveYet' : ''"
|
|
|
:key="index"
|
|
|
>
|
|
|
<view
|
|
|
@@ -126,6 +128,8 @@ export default {
|
|
|
fqList: [],
|
|
|
currentFq: {},
|
|
|
label: '灌溉中.',
|
|
|
+ devName: '',
|
|
|
+ devStatus: '',
|
|
|
};
|
|
|
},
|
|
|
components: {},
|
|
|
@@ -183,19 +187,40 @@ export default {
|
|
|
devBid: this.devBid,
|
|
|
},
|
|
|
});
|
|
|
- const data = res.data || {};
|
|
|
+
|
|
|
+ console.log(res, 'resresresres 12222222222222222222');
|
|
|
+ const data = res || {};
|
|
|
+ if (data.status === undefined || data.status / 1 !== 1) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ clearInterval(this.taskTimer);
|
|
|
+ uni.showLoading({
|
|
|
+ title: '灌溉任务已结束',
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/pages/cb/shuifeizs/detail?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
this.list = data?.sensorList || [];
|
|
|
+
|
|
|
+ console.log(this.list, '-------------------- run status ----------');
|
|
|
this.tktype = data?.tktype;
|
|
|
this.lgjg = data?.lgjg || 0;
|
|
|
this.lgcs = data?.lgcs || 0;
|
|
|
this.fqList = data?.fqList || [];
|
|
|
+ // value 0 未灌溉 1 灌溉中 2 灌溉完成
|
|
|
this.fqList.forEach((item) => {
|
|
|
if (item.value === '1') {
|
|
|
this.currentFq = item;
|
|
|
}
|
|
|
});
|
|
|
this.formartTime(this.currentFq.lgjg);
|
|
|
- this.setTime(this.currentFq.lgjg);
|
|
|
+ // this.setTime(this.currentFq.lgjg);
|
|
|
},
|
|
|
rotationflowEnd() {
|
|
|
const payload = {
|
|
|
@@ -225,7 +250,7 @@ export default {
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
uni.navigateTo({
|
|
|
- url: `/pages/cb/shuifeizs/detail?devBid=${this.devBid}`,
|
|
|
+ url: `/pages/cb/shuifeizs/detail?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
|
|
|
});
|
|
|
}, 1000);
|
|
|
} else {
|
|
|
@@ -237,10 +262,12 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- const { devBid } = options;
|
|
|
+ const { devBid, devName, devStatus } = options;
|
|
|
this.devBid = devBid;
|
|
|
+ this.devName = devName;
|
|
|
+ this.devStatus = devStatus;
|
|
|
this.getRunStatus();
|
|
|
- setInterval(() => {
|
|
|
+ this.labelTimer = setInterval(() => {
|
|
|
if (this.label === '灌溉中.') {
|
|
|
this.label = '灌溉中..';
|
|
|
} else if (this.label === '灌溉中..') {
|
|
|
@@ -249,6 +276,10 @@ export default {
|
|
|
this.label = '灌溉中.';
|
|
|
}
|
|
|
}, 500);
|
|
|
+
|
|
|
+ this.taskTimer = setInterval(() => {
|
|
|
+ this.getRunStatus();
|
|
|
+ }, 30000);
|
|
|
},
|
|
|
onUnload() {
|
|
|
clearInterval(this.timer);
|