|
@@ -81,15 +81,15 @@
|
|
|
<div ref="mapRef" class="bottom-map"></div>
|
|
|
|
|
|
<!-- 图片弹窗 -->
|
|
|
- <!-- <PicturePreview
|
|
|
- :show="dialogVisible"
|
|
|
+ <PicturePreview
|
|
|
:imageUrl="urls"
|
|
|
:curIndex="urlsIndex"
|
|
|
- ></PicturePreview> -->
|
|
|
+ ></PicturePreview>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref } from "vue";
|
|
|
+import config from "@/api/config.js"
|
|
|
import PicturePreview from "@/components/PicturePreview.vue";
|
|
|
import fnHeader from "@/components/fnHeader.vue";
|
|
|
import navigation from "@/components/navigation.vue";
|
|
@@ -106,7 +106,6 @@ import SamplePointLayer from "./map/samplePointLayer";
|
|
|
import {useStore} from "vuex";
|
|
|
import RegionLayer from "./map/regionLayer";
|
|
|
import eventBus from "@/api/eventBus";
|
|
|
-// import "./map/mockFarmLayer"
|
|
|
let store = useStore()
|
|
|
const components = {
|
|
|
homePage,
|
|
@@ -129,24 +128,44 @@ let regionLayer = null
|
|
|
const router = useRouter();
|
|
|
const mapRef = ref();
|
|
|
onMounted(() => {
|
|
|
- homeMap.initMap(store.getters.userinfo.location, mapRef.value);
|
|
|
+ homeMap.initMap("POINT(113.61448114737868 23.585550924763083)", mapRef.value);
|
|
|
+ // homeMap.initMap(store.getters.userinfo.location, mapRef.value);
|
|
|
samplePointLayer = new SamplePointLayer(homeMap.kmap.map, currentFarm, currentRegion)
|
|
|
regionLayer = new RegionLayer(homeMap.kmap.map, currentFarm, currentRegion)
|
|
|
+
|
|
|
+ getYellow()
|
|
|
});
|
|
|
|
|
|
-const dialogVisible = ref(true)
|
|
|
+const urls = ref([])
|
|
|
+const urlsIndex = ref(0)
|
|
|
+const getYellow = () =>{
|
|
|
+ VE_API.home.getYellowList().then(res =>{
|
|
|
+ urls.value = res.data.map(item =>{
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ imgPath:config.base_img_url2+item.cloudFilename
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
const btnIndex = ref(null)
|
|
|
const btnName = ref("")
|
|
|
const handleBtn = (e) =>{
|
|
|
+ btnName.value = ""
|
|
|
btnIndex.value = e
|
|
|
+ eventBus.emit("clear:area")
|
|
|
+ regionLayer.resetData()
|
|
|
+ samplePointLayer.resetPoint()
|
|
|
}
|
|
|
|
|
|
//点击果园日志
|
|
|
const handleSelectArea = () =>{
|
|
|
+ btnName.value = ""
|
|
|
+ btnIndex.value = null
|
|
|
eventBus.emit("clear:area")
|
|
|
- console.log('currentFarm',currentFarm);
|
|
|
- regionLayer.reset(currentFarm)
|
|
|
+ regionLayer.resetData()
|
|
|
+ samplePointLayer.resetPoint()
|
|
|
}
|
|
|
|
|
|
//农事点击高亮
|
|
@@ -158,6 +177,9 @@ const handleAct = (v) =>{
|
|
|
|
|
|
//柱状图点击事件监听
|
|
|
eventBus.on('echart:barClick',(e)=>{
|
|
|
+ btnName.value = ""
|
|
|
+ btnIndex.value = null
|
|
|
+ eventBus.emit("clear:area")
|
|
|
const arr = ["病虫害03", "病害1", "虫害1","病虫害02"]
|
|
|
const isDraw = arr.includes(e)
|
|
|
if(isDraw){
|
|
@@ -165,6 +187,11 @@ eventBus.on('echart:barClick',(e)=>{
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+//黄板点击事件监听
|
|
|
+eventBus.on('click:yellowBlock',()=>{
|
|
|
+ eventBus.emit('dialog:show',true)
|
|
|
+})
|
|
|
+
|
|
|
const showPoint = ref(true)
|
|
|
//地图点击事件
|
|
|
eventBus.on('click:point',(e)=>{
|
|
@@ -187,6 +214,7 @@ eventBus.on('click:area',(e)=>{
|
|
|
}else{
|
|
|
showPoint.value = false
|
|
|
}
|
|
|
+ regionLayer.selectArea((e.name*1)===0?0: (e.name*1) - 1,["#f2d1909c","#f2d1909c"])
|
|
|
}
|
|
|
})
|
|
|
|