2024-12-18 16:26:40 +08:00
|
|
|
|
<template>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
<z-paging ref="paging" use-virtual-list @query="queryList" bg-color="#F3F3F3" :loading-more-enabled="false">
|
|
|
|
|
<template #top>
|
|
|
|
|
<custom-nav-bar :left="false" leftText="" @leftClick="" title="首部">
|
2025-01-17 17:53:12 +08:00
|
|
|
|
<!-- <template v-slot:left>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
<view @click="$refs.landRef.open()">地块</view>
|
2025-01-17 17:53:12 +08:00
|
|
|
|
</template> -->
|
2025-01-14 17:59:17 +08:00
|
|
|
|
</custom-nav-bar>
|
|
|
|
|
</template>
|
|
|
|
|
<view class="text-intel" v-if="landName">
|
|
|
|
|
<view class="iconfont icon-ditu">
|
2025-01-13 18:30:46 +08:00
|
|
|
|
</view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
<view>
|
|
|
|
|
<span>{{landName}}</span>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<template #cell="{item}">
|
|
|
|
|
<view class="card" @click="onClickItem(item)">
|
|
|
|
|
<view class="cards-title">
|
|
|
|
|
<view>
|
|
|
|
|
<view class="text" v-if="item.deviceTypeId==4">
|
|
|
|
|
施肥机编号
|
|
|
|
|
</view>
|
|
|
|
|
<view class="text" v-if="item.deviceTypeId==5">
|
|
|
|
|
首部控制器
|
|
|
|
|
</view>
|
2024-12-18 16:26:40 +08:00
|
|
|
|
<view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
{{item.deviceCode}}
|
2024-12-18 16:26:40 +08:00
|
|
|
|
</view>
|
2025-01-13 18:30:46 +08:00
|
|
|
|
</view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="cards-content">
|
|
|
|
|
<view class="txt-list">
|
2025-01-16 17:22:27 +08:00
|
|
|
|
<view class="list2">
|
2025-01-14 17:59:17 +08:00
|
|
|
|
<view><text>状态:</text><text
|
|
|
|
|
:class="item.status=='offline'?'font-red':''">{{item.status=="online"?"在线":"离线"}}</text>
|
2025-01-13 18:30:46 +08:00
|
|
|
|
</view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
<view><text>水流:</text><text>{{item.deviceData.fs == 1 ? "有" : "无"}}</text></view>
|
|
|
|
|
<view><text>水泵开关:</text><text>{{item.deviceData.sc=="1"?"启动":"停止"}}</text></view>
|
|
|
|
|
<view><text>压力:</text><text>{{item.deviceData.wip?item.deviceData.wip:"--"}}Mpa</text>
|
2025-01-13 18:30:46 +08:00
|
|
|
|
</view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="right">
|
|
|
|
|
<view class="iconfont icon-you">
|
2024-12-18 16:26:40 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-01-14 17:59:17 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
</z-paging>
|
|
|
|
|
<!-- 地块选择 -->
|
|
|
|
|
<custom-select-land ref="landRef" :data="ijs.companys" :defaultSelect="ijs.land" @getLand="getLand"
|
|
|
|
|
@select="landChange" />
|
|
|
|
|
|
2024-12-18 16:26:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
checkPermi
|
|
|
|
|
} from "@/utils/permission"
|
|
|
|
|
import store from "@/store"
|
|
|
|
|
import plugin from "@/plugins"
|
|
|
|
|
import {
|
|
|
|
|
getHeadDeviceList
|
|
|
|
|
} from "@/api/controlHeadInterface";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
ijs: getApp().ijs, // 首页公共js
|
|
|
|
|
title: "",
|
|
|
|
|
isFirst: true,
|
|
|
|
|
user: store.state.user.user,
|
2025-01-14 17:59:17 +08:00
|
|
|
|
landName: null,
|
2024-12-18 16:26:40 +08:00
|
|
|
|
query: {
|
|
|
|
|
landId: null,
|
|
|
|
|
landName: null
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
2025-01-14 17:59:17 +08:00
|
|
|
|
onShow() {
|
|
|
|
|
if (this.ijs.land) {
|
2025-01-14 10:40:02 +08:00
|
|
|
|
this.landName = this.ijs.land.landName;
|
2024-12-19 18:12:16 +08:00
|
|
|
|
this.query.landId = this.ijs.land.id;
|
|
|
|
|
this.queryList();
|
|
|
|
|
}
|
2024-12-18 16:26:40 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
queryList() {
|
|
|
|
|
if (this.query.landId) {
|
|
|
|
|
getHeadDeviceList(this.query.landId).then(res => {
|
2025-01-14 10:40:02 +08:00
|
|
|
|
console.log(res)
|
2024-12-18 16:26:40 +08:00
|
|
|
|
this.$refs.paging.complete(res.data)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取地块信息
|
|
|
|
|
getLand(e) {
|
|
|
|
|
this.ijs.getLand(e.node).then(res => {
|
|
|
|
|
this.$refs.landRef.addLand(e, res.data);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 地块选择回调
|
|
|
|
|
landChange(e) {
|
|
|
|
|
this.title = e.landName;
|
2024-12-25 17:54:00 +08:00
|
|
|
|
this.query.landId = e.id;
|
|
|
|
|
this.queryList();
|
2024-12-18 16:26:40 +08:00
|
|
|
|
},
|
2025-01-14 17:59:17 +08:00
|
|
|
|
onClickItem(item) {
|
2024-12-18 16:26:40 +08:00
|
|
|
|
if (item.deviceTypeId === 4) {
|
2025-01-14 17:59:17 +08:00
|
|
|
|
if (item.controlMode == 1) {
|
|
|
|
|
plugin.tab.navigateTo("/pages/head/fertilizerapplicator/detail?item=" + encodeURIComponent(JSON
|
|
|
|
|
.stringify(
|
|
|
|
|
item)))
|
2024-12-18 16:26:40 +08:00
|
|
|
|
}
|
2025-01-14 17:59:17 +08:00
|
|
|
|
if (item.controlMode == 2) {
|
|
|
|
|
plugin.tab.navigateTo("/pages/head/fertilizerapplicator/detailkl?item=" + encodeURIComponent(JSON
|
|
|
|
|
.stringify(
|
|
|
|
|
item)))
|
2024-12-18 16:26:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.deviceTypeId === 5) {
|
|
|
|
|
plugin.tab.navigateTo("/pages/head/headdevice/detail?item=" + encodeURIComponent(JSON.stringify(item)))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2025-01-13 18:30:46 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2025-01-16 12:41:23 +08:00
|
|
|
|
// 顶部nav
|
|
|
|
|
::v-deep.uni-navbar__header-container {
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
&>view {
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep.uni-navbar__header-btns-left {
|
|
|
|
|
font-size: 27rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep.uni-navbar__header-btns-right .icon {
|
|
|
|
|
font-size: 44rpx;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
2025-01-14 17:59:17 +08:00
|
|
|
|
|
2024-12-18 16:26:40 +08:00
|
|
|
|
</style>
|