|
@@ -1,116 +1,142 @@
|
|
|
-<!--
|
|
|
- * @Author: your name
|
|
|
- * @Date: 2021-01-18 15:46:34
|
|
|
- * @LastEditTime: 2021-11-30 18:54:36
|
|
|
- * @LastEditors: Please set LastEditors
|
|
|
- * @Description: In User Settings Edit
|
|
|
- * @FilePath: \vue3-element-admin\src\views\Home.vue
|
|
|
--->
|
|
|
<template>
|
|
|
- <Bg :active="menuType == 'znxy'" ></Bg>
|
|
|
- <Head @selectOrganAndArea="selectOrganAndArea" @changeGarden="changeGarden" @goBack="goBack" :key="hideZnxy" :hideZnxy="hideZnxy" :menuType="menuType"></Head>
|
|
|
- <Navigation v-if="hideZnxy && menuType == 'znxy'" @handleAct="handleAct" @select="navSelect" :val="menuType"></Navigation>
|
|
|
- <Map ref="mapRef" v-if="menuType == 'znxy'" :tabValue="tabValue" @setHideZnxy="setHideZnxy"></Map>
|
|
|
- <ZnxyPage v-if="hideZnxy && menuType == 'znxy'" ref="znxyRef" :tabValue="tabValue" @workerPath="workerPath" @setTreeStyle="setTreeStyle"
|
|
|
- @nsAllot="nsAllot" @selectDay="selectDay"
|
|
|
- ></ZnxyPage>
|
|
|
- <NsAllot v-if="menuType == 'ns_allot'"></NsAllot>
|
|
|
+ <div class="base-container">
|
|
|
+ <div class="header">
|
|
|
+ <div class="title">
|
|
|
+ <img src="@/assets/images/common/logo.png" alt="">
|
|
|
+ <span>飞鸟智慧巡园平台</span>
|
|
|
+ <img src="@/assets/images/common/logo-icon.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="date">
|
|
|
+ <div>111</div>
|
|
|
+ <div class="time">
|
|
|
+ <div>21:05:46</div>
|
|
|
+ <span>2024.11.04 星期一</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <!-- <div class="top"></div> -->
|
|
|
+ <div class="left">
|
|
|
+ <div class="tool-list">
|
|
|
+ <div class="tool-item">气象预警</div>
|
|
|
+ </div>
|
|
|
+ <div class="chart-list">
|
|
|
+ <div class="chart-item">
|
|
|
+ <chart-box name="气象预警"></chart-box>
|
|
|
+ </div>
|
|
|
+ <div class="chart-item">
|
|
|
+ <chart-box name="物候调节"></chart-box>
|
|
|
+ </div>
|
|
|
+ <div class="chart-item">
|
|
|
+ <chart-box name="病虫测报"></chart-box>
|
|
|
+ </div>
|
|
|
+ <div class="chart-item">
|
|
|
+ <chart-box name="树势评估"></chart-box>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div class="list">
|
|
|
+ <chart-box name="农事列表" arrow="arrow-left"></chart-box>
|
|
|
+ </div>
|
|
|
+ <div class="tool-list">
|
|
|
+ <div class="tool-item">气象预警</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {useStore} from "vuex"
|
|
|
-import Map from "./Map";
|
|
|
-import {onMounted, ref, onBeforeUnmount, watchEffect, provide, inject , watch, computed} from "vue";
|
|
|
-import Head from "./Head";
|
|
|
-import Bg from "./Bg";
|
|
|
-import {fitExtent} from "../common/ol_common";
|
|
|
-import ZnxyPage from "./znxy/index"
|
|
|
-import NsAllot from "./ns_allot/index"
|
|
|
-import Navigation from "./Navigation";
|
|
|
-import {WKT} from "ol/format";
|
|
|
-let store = useStore()
|
|
|
-let state = useStore().state;
|
|
|
-const menuType = ref("znxy")
|
|
|
-const title = ref('智能巡园')
|
|
|
-const mapRef = ref(null)
|
|
|
-const znxyRef = ref(null)
|
|
|
-const recordId = ref(null)
|
|
|
-const recordRowData = ref(null)
|
|
|
-let curGardenId = ref(store.getters.userinfo.curGardenId)
|
|
|
-let hideZnxy = ref(true)
|
|
|
-
|
|
|
-/**
|
|
|
- * 给地图中的树设置样式
|
|
|
- * @param style
|
|
|
- */
|
|
|
-function setTreeStyle(style){
|
|
|
- let view = mapRef.value.znxyMap.kmap.view
|
|
|
- mapRef.value.znxyMap.setTreeStyle((f)=>{
|
|
|
- let zoom = view.getZoom();
|
|
|
- return style(f,zoom)
|
|
|
- })
|
|
|
-}
|
|
|
-function navSelect(val,t){
|
|
|
- title.value = t
|
|
|
- menuType.value = val
|
|
|
-}
|
|
|
-function goBack(){
|
|
|
- menuType.value = "znxy"
|
|
|
-}
|
|
|
-function showTreeDialog(f){
|
|
|
- znxyRef.value.showTreeDialog(f)
|
|
|
-}
|
|
|
-function selectOrganAndArea({organ,area}){
|
|
|
- if(organ){
|
|
|
- let geom = new WKT().readGeometry(organ.point)
|
|
|
- mapRef.value.znxyMap.fit(geom.getExtent())
|
|
|
- }
|
|
|
- if(area){
|
|
|
- let geom = new WKT().readGeometry(area.wkt)
|
|
|
- mapRef.value.znxyMap.fit(geom.getExtent())
|
|
|
- }
|
|
|
-}
|
|
|
-function workerPath(e){
|
|
|
- recordRowData.value = e
|
|
|
- menuType.value = "grzxqk"
|
|
|
-}
|
|
|
-function nsAllot(){
|
|
|
- title.value = "分配农事"
|
|
|
- menuType.value = "ns_allot"
|
|
|
-}
|
|
|
-
|
|
|
-const tabValue = ref({})
|
|
|
-
|
|
|
-const handleAct = (v) =>{
|
|
|
- tabValue.value = v
|
|
|
-}
|
|
|
-function selectDay(e){
|
|
|
- mapRef.value.znxyMap.refreshTree(curGardenId.value,e)
|
|
|
-}
|
|
|
-//切换果园
|
|
|
-function changeGarden(){
|
|
|
- let mymap = mapRef.value.znxyMap
|
|
|
- setHideZnxy(false)
|
|
|
- mymap.kmap.getView().fit(mymap.gardenLayer.layer.getSource().getExtent(), { duration: 1000, padding: [250, 150, 150, 150] });
|
|
|
-}
|
|
|
-function setHideZnxy(val){
|
|
|
- hideZnxy.value = val
|
|
|
-}
|
|
|
-onMounted(()=>{
|
|
|
-})
|
|
|
-
|
|
|
+import chartBox from '@/components/chartBox.vue';
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.body{
|
|
|
- min-width:1920px;
|
|
|
- width: 100vw;
|
|
|
+.base-container{
|
|
|
+ width: 100%;
|
|
|
height: 100vh;
|
|
|
+ color: #fff;
|
|
|
position: relative;
|
|
|
- overflow: auto;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: red;
|
|
|
+ .header{
|
|
|
+ width: 100%;
|
|
|
+ height: 76px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ background: #000;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .title{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ font-size: 24px;
|
|
|
+ letter-spacing: 2px;
|
|
|
+ line-height: 72px;
|
|
|
+ padding-left: 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: url('@/assets/images/common/header-bg.png') no-repeat center center /100% 100%;
|
|
|
+ span{
|
|
|
+ margin: 0 5px;
|
|
|
+ font-family: 'PangMenZhengDao';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .date{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: 180px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 76px);
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .left,.right{
|
|
|
+ width: calc(376px + 54px);
|
|
|
+ height: 95%;
|
|
|
+ padding-top: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ .tool-list{
|
|
|
+ width: 54px;
|
|
|
+ height: 100%;
|
|
|
+ background: #232323;
|
|
|
+ border: 0.6px solid rgb(255, 255, 255,0.4);
|
|
|
+ border-left: none;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-right: 10px;
|
|
|
+ .tool-item{
|
|
|
+ font-size: 20px;
|
|
|
+ writing-mode: vertical-rl; /* 从右到左的竖排 */
|
|
|
+ text-orientation: upright; /* 保持文字直立,而不是旋转 */
|
|
|
+ white-space: nowrap; /* 防止文本换行 */
|
|
|
+ line-height: 54px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .chart-list{
|
|
|
+ width: calc(100% - 54px - 10px);
|
|
|
+ height: calc(100% - 30px);
|
|
|
+ .chart-item{
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% / 4);
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right{
|
|
|
+ .tool-list{
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ .list{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-</style>
|
|
|
+</style>
|