| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 | <template>  <div class="base-container no-events">    <fnHeader showDate></fnHeader>    <div class="content">      <navigation></navigation>      <div class="left yes-events">        <tool-list          direction="left"          :list="leftToolList"          @handleActive="handleActiveLeft"        ></tool-list>        <component :is="components[currentComponent]" />      </div>      <div class="home-bottom">        <div class="log-box yes-events">          <chart-box name="果园日志"></chart-box>        </div>        <div class="file-box yes-events">          <chart-box name="果园档案">            <template #title-right>              <el-icon class="arrow-icon cursor-pointer" color="#141414"                ><DArrowLeft              /></el-icon>              <div class="edit-btn cursor-pointer" @click="toFilePage">编辑</div>            </template>            <file-bar></file-bar>          </chart-box>        </div>      </div>      <div class="right yes-events">        <div class="list">          <chart-box name="农事列表" arrow="arrow-left"></chart-box>        </div>        <tool-list direction="right" :list="rightToolList"></tool-list>      </div>    </div>  </div>  <div ref="mapRef" class="bottom-map"></div></template><script setup>import { onMounted, ref } from "vue";import fnHeader from "@/components/fnHeader.vue";import navigation from "@/components/navigation.vue";import chartBox from "@/components/chartBox.vue";import toolList from "@/components/toolList.vue";import fileBar from "@/components/fileBar.vue";import HomeMap from "./homeMap";import homePage from "./components/homePage.vue";import weatherPage from "./components/weatherPage.vue";import phenologyPage from "./components/phenologyPage.vue";import { useRouter } from "vue-router";import SamplePointLayer from "./samplePointLayer";import {useStore} from "vuex";let store = useStore()const components = {  homePage,  weatherPage,  phenologyPage,};//当前农场const currentFarm = {  id: store.getters.userinfo.curFarmId,  name: store.getters.userinfo.curFarmName,}//当前区域const currentRegion = {  id: null,  name: null}let homeMap = new HomeMap();let samplePointLayer = nullconst router = useRouter();const mapRef = ref();onMounted(() => {  homeMap.initMap(store.getters.userinfo.location, mapRef.value);  samplePointLayer = new SamplePointLayer(homeMap.kmap.map, currentFarm, currentRegion)});const currentComponent = ref("homePage");const handleActiveLeft = (e) => {  currentComponent.value = e.componentName;};const leftToolList = [  {    title: "首页",    name: "home",    componentName: "homePage",  },  {    title: "气象预警",    componentName: "weatherPage",  },  {    title: "物候调节",    componentName: "phenologyPage",  },  {    title: "病虫测报",  },  {    title: "营养评估",  },];const rightToolList = [  {    title: "农事列表",  },  {    title: "新增农事",  },  {    title: "复核对比",  },];// 跳转果园档案const toFilePage = () => {  router.push('/garden-file')}</script><style lang="scss" scoped>.base-container {  width: 100%;  height: 100vh;  color: #fff;  position: absolute;  box-sizing: border-box;  z-index: 1;  .content {    width: 100%;    height: calc(100% - 74px - 48px);    display: flex;    justify-content: space-between;    box-sizing: border-box;    .left,    .right {      width: calc(376px + 54px);      height: 100%;      padding-top: 10px;      box-sizing: border-box;      display: flex;    }    .right {      .list {        width: 100%;        height: 100%;      }    }    .home-bottom {      display: flex;      align-items: flex-end;      width: calc(100% - 430px - 430px - 72px);      height: 100%;      align-self: flex-end;      .log-box {        height: 30%;        width: calc(100% - 340px - 28px);        margin-right: 28px;      }      .file-box {        height: 25%;        min-height: 210px;        width: 340px;        position: relative;        .arrow-icon {          top: -32px;          left: 50%;          position: absolute;          background: #fff;          width: 16px;          height: 80px;          line-height: 80px;          border-radius: 5px 0 0 5px;          text-align: center;          transform: translateX(-50%) rotate(270deg);        }        .edit-btn {          padding: 2px 24px;          background: #2199f8;          border-radius: 4px;        }      }    }  }}.bottom-map {  width: 100%;  height: 100vh;  position: absolute;  z-index: 0;}</style>
 |