This commit is contained in:
Iruka 2025-02-11 16:32:15 +08:00
parent bf37828c5d
commit ac158bcdf7

View File

@ -2,7 +2,7 @@
<u-popup :show="open" mode="bottom" @close="close" closeable> <u-popup :show="open" mode="bottom" @close="close" closeable>
<view class="lock"> <view class="lock">
<view class="title">土壤墒情 <view class="title">土壤墒情
<view class="iconfont icon-shuaxin" @click="getList"></view> <view class="iconfont icon-shuaxin" @click="refreshSoilTilth"></view>
</view> </view>
<view class="list-title "> <view class="list-title ">
<view class="fixed"> <view class="fixed">
@ -26,9 +26,9 @@
<view class="list-content"> <view class="list-content">
<view class="fixed" v-for="data in item.data"> <view class="fixed" v-for="data in item.data">
<view>{{data.lv}}</view> <view>{{data.lv}}</view>
<view>{{data.depth}}cm</view> <view>{{data.depth}}</view>
<view>{{data.humidity}}%</view> <view>{{data.humidity}}</view>
<view>{{data.temperature}}</view> <view>{{data.temperature}}</view>
</view> </view>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
@ -41,7 +41,8 @@
<script> <script>
import { import {
getMpDeviceList getMpDeviceList,
mpRefresh
} from "@/api/controlMpInterface.js" } from "@/api/controlMpInterface.js"
export default { export default {
name: "Mp", name: "Mp",
@ -105,6 +106,22 @@
} }
}); });
}, },
refreshSoilTilth() {
console.error("refreshSoilTilth");
let refresh = [];
this.list.forEach(item => {
if (refresh.findIndex(x => x.deviceCode == item.deviceCode) == -1) {
let mp = {
deviceCode: item.deviceCode,
lv: item.floors
};
refresh.push(mp);
}
});
mpRefresh(refresh).then((res) => {
console.error("res:", res);
});
}
} }
} }
</script> </script>