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

View File

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