修复之前的bug

进入大棚详情页面不获取限位时间
feasure
lld 2026-02-24 18:05:01 +08:00
parent fe134407d3
commit d7941db749
2 changed files with 39 additions and 30 deletions

View File

@ -37,12 +37,14 @@
:liveData="liveData"
:show="show"
:status="status"
:limitTimes="limitTimes"
:dtu_remark="dtu_remark"
:selectedText="selectedText"
:value="value"
:agriId="agriId"
@publicMsg="publishMessage"
@getRemark="getRemarkByImei"
@getAgriRemark="getRemarkByImei"
@getAgriLimit="getAgriByImei"
/>
</uni-section>
</view>
@ -68,6 +70,7 @@ import {getRemarkByImei} from "../../../api/system/assets/remark";
import CustomRefresher from "../../../components/custom-refresher/custom-refresher.vue";
import ZPaging from "../../../uni_modules/z-paging/components/z-paging/z-paging.vue";
import {findDtuDataByInfo} from "../../../api/system/data";
import {getAgriByImei} from "../../../api/system/assets/limit";
export default {
dicts: ['sys_data_map'],
@ -129,6 +132,19 @@ export default {
jm3g: 0,
deviceTime:"正在加载中..."
},
//
limitTimes: {
jbkLimit: 0,
jbgLimit: 0,
jlkLimit: 0,
jlgLimit: 0,
jm1kLimit: 0,
jm1gLimit: 0,
jm2kLimit: 0,
jm2gLimit: 0,
jm3kLimit: 0,
jm3gLimit: 0
},
testMsg:'由于线上为真实数据。任何操作均可影响线上功能,故仅作演示',
};
},
@ -173,8 +189,6 @@ export default {
this.change(this.imei)
mqttUtil.setOnMessageCallback(this.ackMessage);
this.$refs.paging.complete();
this.$refs[this.currentMode?"autoPage":"manualPage"].getAgriByImei();
},
getNewSpecialData() {
getNewSpecialData().then(response => {
@ -210,6 +224,7 @@ export default {
this.liveData.temp = "最后更新时间:"+response.data.time;
this.fontStyle = 'font-size:16px;'
})
this.getAgriByImei();
//
this.getRemarkByImei();
if (e!=="862538065276939"){
@ -228,7 +243,16 @@ export default {
}
});
},
getAgriByImei() {
getAgriByImei(this.imei).then(response => {
if (response.code === 200) {
if (!response.data) {
return;
}
this.limitTimes = response.data;
}
})
},
getAgriList() {
listAgri().then(response => {
if (response.code === 200) {
@ -543,6 +567,7 @@ export default {
.card {
border-radius: 20rpx;
overflow: hidden;
height: calc(100vh - var(--window-top, 0px) - 100rpx);
}
.switch-row {
display: flex;

View File

@ -132,7 +132,7 @@
//
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; //
import mqttUtil from '@/utils/mqtt';
import {addLimit, getAgriByImei, updateLimit} from "../../../api/system/assets/limit";
import {addLimit, updateLimit} from "../../../api/system/assets/limit";
import store from "../../../store";
import {addRemark, updateRemark} from "../../../api/system/assets/remark";
@ -168,6 +168,12 @@ export default {
return {}
}
},
limitTimes: {
type: Object,
default() {
return {}
}
},
show: {
type: Object,
default() {
@ -242,19 +248,6 @@ export default {
// connected
connected: false,
imei: '',
//
limitTimes: {
jbkLimit: 0,
jbgLimit: 0,
jlkLimit: 0,
jlgLimit: 0,
jm1kLimit: 0,
jm1gLimit: 0,
jm2kLimit: 0,
jm2gLimit: 0,
jm3kLimit: 0,
jm3gLimit: 0
},
// 湿1234湿1234
sensorCard:{},
};
@ -434,7 +427,7 @@ export default {
: await addLimit(limitTimes);
if (limitRes.code === 200) {
isAllSuccess = true;
this.getAgriByImei();
this.$emit("getAgriLimit")
}
}
@ -450,7 +443,7 @@ export default {
? await updateRemark(dtu_remark)
: await addRemark(dtu_remark);
if (remarkRes.code === 200) {
this.$emit("getRemark")
this.$emit("getAgriRemark")
isAllSuccess = true;
}
}
@ -540,16 +533,7 @@ export default {
}
});
},
getAgriByImei() {
getAgriByImei(this.imei).then(response => {
if (response.code === 200) {
if (!response.data) {
return;
}
this.limitTimes = response.data;
}
})
},
}
};
</script>