plantScreen/src/view/home.vue

296 lines
8.3 KiB
Vue
Raw Normal View History

2023-12-14 20:08:53 +08:00
<template>
<div class="box">
<div class="l">
<div class="top">
2023-12-19 18:15:24 +08:00
<leftTop :key="userInfoStore.userInfo.streetCode"></leftTop>
2023-12-14 20:08:53 +08:00
</div>
<div class="center top">
2023-12-19 18:15:24 +08:00
<leftCenter :key="userInfoStore.userInfo.streetCode"></leftCenter>
2023-12-14 20:08:53 +08:00
</div>
<div class="bottom top">
2023-12-19 18:15:24 +08:00
<leftBottom :key="userInfoStore.userInfo.streetCode"></leftBottom>
2023-12-14 20:08:53 +08:00
</div>
</div>
<div class="c">
<div class="top">
2023-12-24 21:56:23 +08:00
<div style="display: flex;justify-content: space-between;" v-if="userInfoStore.userInfo.streetCode">
2024-01-04 18:54:49 +08:00
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font" @click="back">返回首页</span></div>
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font">{{ townName }}地块</span> </div>
2023-12-24 21:56:23 +08:00
</div>
<div class="c-top-tit" v-else>
<div class="c-top-li">种植面积 <span class="color-font"
2023-12-18 18:49:52 +08:00
style="font-size: 18px;margin-left: 1vw; ">{{ centerData.totalArea }}</span> </div>
2023-12-14 20:08:53 +08:00
<div class="c-top-li">种植种类 <span class="color-font"
2023-12-18 18:49:52 +08:00
style="font-size: 18px;margin-left: 1vw; ">{{ centerData.plantCount }}</span> </div>
2023-12-14 20:08:53 +08:00
<div class="c-top-li">地块数量 <span class="color-font"
2023-12-18 18:49:52 +08:00
style="font-size: 18px;margin-left: 1vw; ">{{ centerData.landCount }}</span> </div>
2023-12-14 20:08:53 +08:00
</div>
2023-12-24 21:56:23 +08:00
2024-01-04 18:54:49 +08:00
2023-12-14 20:08:53 +08:00
<div class="map">
2024-01-04 18:54:49 +08:00
<areaMap @getTowmName="getTowmName"></areaMap>
2023-12-14 20:08:53 +08:00
</div>
</div>
<div class="bottom">
2023-12-19 18:15:24 +08:00
<centerBottom :key="userInfoStore.userInfo.streetCode"></centerBottom>
2023-12-14 20:08:53 +08:00
</div>
</div>
<div class="r">
<div class="top">
2023-12-19 18:15:24 +08:00
<rightTop :key="userInfoStore.userInfo.streetCode"></rightTop>
2023-12-14 20:08:53 +08:00
</div>
2023-12-15 18:20:02 +08:00
<div class="bottoms">
2023-12-14 20:08:53 +08:00
<div style="height: 35%;">
2023-12-15 18:20:02 +08:00
<div class="landa">
2023-12-19 18:15:24 +08:00
<div class="land-li" @click="choseUrl(item)" v-for="(item, index) in landlist" :key="index">{{ item.title }}</div>
2023-12-14 20:08:53 +08:00
</div>
</div>
<div class="video" style="height: 65%;">
2024-01-04 18:54:49 +08:00
<div class="video-tit "> 实时监测影像 </div>
2023-12-19 18:15:24 +08:00
<JessibucaDemo v-if="video_url" :src="video_url"></JessibucaDemo>
<div style="height: 100%;height: 100%;background-color: #0C2856;position: relative;" v-else>
2024-01-04 18:54:49 +08:00
<img src="/static/index/video.png" style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);width: 50px;height: 50px;" alt="">
2023-12-19 18:15:24 +08:00
</div>
2023-12-14 20:08:53 +08:00
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from "vue"
import leftTop from "@/components/index/leftTop.vue"
2023-12-15 18:20:02 +08:00
import leftCenter from "../components/index/leftCenter.vue"
import leftBottom from "../components/index/leftBottom.vue"
import centerBottom from "../components/index/centerBottom.vue"
2023-12-14 20:08:53 +08:00
import JessibucaDemo from "@/components/videoFlv.vue"
2023-12-18 18:49:52 +08:00
import { centralCountApi } from "@/api.js"
2023-12-14 20:08:53 +08:00
import areaMap from "@/components/areaMap.vue"
2023-12-18 18:49:52 +08:00
import { landListApi } from "@/api.js"
2023-12-15 18:20:02 +08:00
import rightTop from "../components/index/rightTop.vue"
2023-12-19 18:15:24 +08:00
import { areaObj } from "@/store/index.js"
2023-12-24 21:56:23 +08:00
import { useRouter } from "vue-router"
const router=useRouter()
2023-12-19 18:15:24 +08:00
const userInfoStore= areaObj()
// ...userInfoStore.userInfo
2023-12-14 20:08:53 +08:00
2023-12-18 18:49:52 +08:00
centralCountApi({
2023-12-19 18:15:24 +08:00
...userInfoStore.userInfo
2023-12-18 18:49:52 +08:00
}).then(res => {
2023-12-14 20:08:53 +08:00
2023-12-18 18:49:52 +08:00
for (let key in centerData){
centerData[key]=res.data[key]
}
})
const centerData = reactive({
landCount: "",
plantCount: "",
totalArea: "",
2023-12-14 20:08:53 +08:00
2023-12-18 18:49:52 +08:00
})
2023-12-15 18:20:02 +08:00
// 地块
2023-12-18 18:49:52 +08:00
const landlist = reactive([])
2023-12-15 18:20:02 +08:00
2023-12-18 18:49:52 +08:00
landListApi({
2023-12-19 18:15:24 +08:00
...userInfoStore.userInfo
2023-12-18 18:49:52 +08:00
}).then(res => {
res.data.list.forEach(item => { landlist.push(item) })
2023-12-15 18:20:02 +08:00
2023-12-14 20:08:53 +08:00
})
2023-12-19 18:15:24 +08:00
const video_url=ref('')
2023-12-14 20:08:53 +08:00
2023-12-19 18:15:24 +08:00
const choseUrl=(item)=>{
video_url.value=''
setTimeout( ()=>{
video_url.value=item.video_url
2023-12-14 20:08:53 +08:00
2023-12-19 18:15:24 +08:00
},500)
2023-12-14 20:08:53 +08:00
2023-12-19 18:15:24 +08:00
}
2023-12-24 21:56:23 +08:00
const back=()=>{
2024-01-04 18:54:49 +08:00
console.log("back")
2023-12-24 21:56:23 +08:00
router.go(0)
}
2024-01-04 18:54:49 +08:00
const townName=ref("")
const getTowmName=(e)=>{
townName.value=e
}
2023-12-14 20:08:53 +08:00
</script>
<style lang="scss">
.box {
width: 100vw;
height: 93vh;
margin-top: 1vh;
display: flex;
justify-content: space-between;
.l {
width: 25vw;
height: 93vh;
.top {
width: 25vw;
height: 30vh;
background-size: 100% 100%;
// background-color: pink;
background-image: url('/static/index/SBGJTJ.png');
margin-top: 1vh;
box-sizing: border-box;
padding: 6vh 2vh 1vh 2vh;
color: white;
font-size: 14px;
position: relative;
}
.center {
background-image: url('/static/index/JCSBSLTJ.png');
2023-12-18 18:49:52 +08:00
2023-12-14 20:08:53 +08:00
}
.bottom {
background-image: url('/static/index/SYCPTJ.png');
}
}
.c {
width: 49vw;
height: 93vh;
.top {
margin-top: 1vh;
width: 49vw;
height: 61vh;
// background-color: RED;
background-image: url('/static/index/ZBK.png');
background-size: 100% 100%;
box-sizing: border-box;
padding: 2vh 2vw;
.c-top-tit {
display: flex;
color: white;
justify-content: space-between;
font-size: 12px;
line-height: 2vh;
.c-top-li {
padding: 2vh 3vw;
// background-color: #fff;
background-image: url('/static/index/DBTC.png');
background-size: 100% 100%;
}
}
.map {
width: 100%;
height: 50vh;
// background-color: #fff;
// border: 1px solid red;
}
}
.bottom {
width: 49vw;
height: 30vh;
margin-top: 1vh;
background-image: url('/static/index/ZNYJ.png');
background-size: 100% 100%;
box-sizing: border-box;
padding: 6vh 1vh 1vh 2vh;
position: relative;
}
}
.r {
width: 25vw;
height: 93vh;
2023-12-15 18:20:02 +08:00
.bottoms {
2023-12-14 20:08:53 +08:00
width: 25vw;
box-sizing: border-box;
padding-top: 6vh;
padding: 6vh 1vh 0;
height: 61vh;
background-size: 100% 100%;
background-image: url('/static/index/MQ.png');
margin-top: 1vh;
2023-12-15 18:20:02 +08:00
.landa {
2023-12-14 20:08:53 +08:00
display: flex;
flex-wrap: wrap;
font-size: 14px;
2023-12-15 18:20:02 +08:00
flex-wrap: wrap;
2023-12-18 18:49:52 +08:00
2023-12-15 18:20:02 +08:00
.land-li {
2023-12-18 18:49:52 +08:00
2023-12-15 18:20:02 +08:00
padding: 2px 20px;
margin-right: 10px;
2023-12-14 20:08:53 +08:00
background-image: url('/static/index/DK.png');
background-size: 100% 100%;
color: white;
text-align: center;
line-height: 3vh;
}
}
.video {
.video-tit {
2024-01-04 18:54:49 +08:00
color: #CEE4FE;
2023-12-14 20:08:53 +08:00
width: 110px;
text-align: center;
line-height: 30px;
height: 30px;
background-image: url('/static/index/JKBT.png');
background-size: cover;
font-size: 15px;
margin-bottom: 3vh;
2024-01-04 18:54:49 +08:00
font-size: 15px;
font-family: FZCYJ;
2023-12-14 20:08:53 +08:00
}
}
}
.top {
width: 25vw;
height: 30vh;
padding: 2vh;
box-sizing: border-box;
background-size: 100% 100%;
background-image: url('/static/index/YJCP.png');
margin-top: 1vh;
padding-top: 6vh;
}
}
2024-01-04 18:54:49 +08:00
}
.c-top-tits {
padding: 1vh 1vw;
font-size: 20px;
// border: 1px solid red;
cursor: pointer;
background-image: url('/static/detail/FHSY.png');
background-size: 100% 100%;
2023-12-14 20:08:53 +08:00
}
</style>