究极更新

This commit is contained in:
zmj 2024-02-03 11:23:29 +08:00
parent f8d436a1a0
commit e5c98a16d2
4 changed files with 39 additions and 16 deletions

View File

@ -6,7 +6,7 @@
<!-- <div style="color: red;">{{ areaStore.userInfo }}</div> --> <!-- <div style="color: red;">{{ areaStore.userInfo }}</div> -->
<div class="right"> <div class="right">
<div class="rigth-li b-cls" @click="choseArea = true"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;" <div class="rigth-li b-cls" @click="choseArea = true"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;"
:src="u('DW')" alt=""> {{ areaStore.userInfo.name|| '泸县' }} src="/static/index/DW.png" alt=""> {{ areaStore.userInfo.name|| '泸县' }}
<areaList :choseArea="choseArea" @offAreaList="offAreaList" :key="areaStore.userInfo.name" class="a-cls"></areaList> <areaList :choseArea="choseArea" @offAreaList="offAreaList" :key="areaStore.userInfo.name" class="a-cls"></areaList>
</div> </div>
@ -23,7 +23,7 @@
<span></span> <span></span>
<span></span> <span></span>
</div> </div>
<div class="rigth-li" @click="out"><img style="width: 1VW;height:1VW;margin-right: 0.5vw;" :src="u('GJ')" <div class="rigth-li" @click="out"><img style="width: 1VW;height:1VW;margin-right: 0.5vw;" src="/static/index/GJ.png"
alt=""></div> alt=""></div>
<div class="right-line"> <div class="right-line">
<span></span> <span></span>

View File

@ -47,9 +47,21 @@ import { areaObj } from "@/store/index.js"
import { landListApi } from "@/api.js" import { landListApi } from "@/api.js"
import { globalEventBus } from '@/common/eventBus' import { globalEventBus } from '@/common/eventBus'
import { sendMsg } from "@/api.js" import { sendMsg } from "@/api.js"
const sendFn = (event, data = '') => { const sendFn = (event, data = '') => {
sendMsg({ channel: 'user-11', event, data }) sendMsg({ channel: 'user-11', event, data })
} }
let farmarCenter=[]
const getFamrCenter=async()=>{
let res=await landListApi({
...areaStore.userInfo
})
farmarCenter=res.data.list.map( item=>([item.longitude,item.latitude]) )
}
const isMainScreen = JSON.parse(localStorage.getItem("TRADE_TYPE")) const isMainScreen = JSON.parse(localStorage.getItem("TRADE_TYPE"))
let geoJson = geoJsonLuxian let geoJson = geoJsonLuxian
const areaStore = areaObj() const areaStore = areaObj()
@ -82,7 +94,7 @@ const pointerFn = () => {
geoJson.center.forEach((item, index) => { geoJson.center.forEach((item, index) => {
list.push({ list.push({
coord: item, coord: item,
symbol: index == geoJson.center.length - 1 ? ('image://' + lx) : ('image://' + icon),// symbol: ('image://' + icon),//
symbolSize: [100, 30], // symbolSize: [100, 30], //
symbolOffset: ['50%', '-50%'], symbolOffset: ['50%', '-50%'],
value: geoJson.features[index]?.properties.name || '泸县', value: geoJson.features[index]?.properties.name || '泸县',
@ -112,6 +124,9 @@ const pointerFn2 = (lists) => {
}) })
return list return list
} }
const initAreaMap =async () => { const initAreaMap =async () => {
showArea.value = true showArea.value = true
await nextTick() await nextTick()
@ -258,25 +273,33 @@ const initAreaMap =async () => {
}, },
// //
symbolSize: function (val) { symbolSize: function (val,parmas) {
return 4 return 4
// return val[2] / 10; // return val[2] / 10;
}, },
markPoint: { markPoint: {
data: pointerFn() data: pointerFn()
}, },
itemStyle:{ //
// color:'green'
color:function(params) // seriesIndex, dataIndex, data, value
{
return 'blue';
}
},
data: (() => { data: (() => {
let data = { let data = {
资产数: geoJson.center 资产数:farmarCenter
} }
console.log(farmarCenter,"center")
let finalData = [] let finalData = []
Object.keys(data).map((i, index) => { Object.keys(data).map((i, index) => {
let child = data[i].map((row, index) => ({ let child = data[i].map((row, index) => ({
value: row, value: row,
itemStyle: { itemStyle: {
color: index == geoJson.center.length - 1 ? '#FEB821' : '#F0733A', // color: index == geoJson.center.length - 1 ? '#FEB821' : '#F0733A',
color: '#F0733A',
}, },
})) }))
@ -526,6 +549,7 @@ const initTownMap = async (name) => {
areaStore.changeUserInfoFn(510521, item.code) areaStore.changeUserInfoFn(510521, item.code)
} }
}) })
params.data.data.forEach(item => { params.data.data.forEach(item => {
if (item.value[0] == longInfo[0] && item.value[1] == longInfo[1]) { if (item.value[0] == longInfo[0] && item.value[1] == longInfo[1]) {
router.push(`/detail?landId=${item.id}&town=${name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${item.name}`) router.push(`/detail?landId=${item.id}&town=${name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${item.name}`)
@ -543,6 +567,7 @@ watch(() => areaStore.userInfo, (value, oldValue) => {
) )
onMounted(async () => { onMounted(async () => {
getFamrCenter()
if(areaStore.userInfo.streetCode)return; if(areaStore.userInfo.streetCode)return;
setTimeout(() => {showArea.value? initAreaMap(): initTownMap() }, 500) setTimeout(() => {showArea.value? initAreaMap(): initTownMap() }, 500)
}) })

View File

@ -8,7 +8,7 @@
<leftCenter :data="data" :key="data.land_id"></leftCenter> <leftCenter :data="data" :key="data.land_id"></leftCenter>
</div> </div>
<div class="top center"> <div class="top center">
<!-- <JessibucaDemo v-if="video_url&&showVideo" :src="video_url"></JessibucaDemo> --> <JessibucaDemo v-if="video_url&&showVideo" :src="video_url"></JessibucaDemo>
</div> </div>
</div> </div>
<div class="center"> <div class="center">
@ -49,7 +49,6 @@ import { areaObj } from "@/store/index.js"
import JessibucaDemo from "@/components/videoFlv.vue" import JessibucaDemo from "@/components/videoFlv.vue"
const areaStore=areaObj() const areaStore=areaObj()
const showVideo = ref(false) const showVideo = ref(false)
const video_url = ref('') const video_url = ref('')
const router = useRouter() const router = useRouter()
@ -78,7 +77,7 @@ const pullStream = () => {
socket.addEventListener('close', onSocketClose); socket.addEventListener('close', onSocketClose);
socket.addEventListener('error', onSocketError); socket.addEventListener('error', onSocketError);
} }
// pullStream() pullStream()
const getDetail = () => { const getDetail = () => {
@ -86,16 +85,15 @@ const getDetail = () => {
landListApi({ landListApi({
...data ...data
}).then(res => { }).then(res => {
console.log(res.data,'res,data')
res.data.list.forEach(item => { res.data.list.forEach(item => {
if (item.id == data.land_id) { if (item.id == data.land_id) {
video_url.value = item.video_url video_url.value = item.video_url
showVideo.value = true showVideo.value = true
console.log(showVideo.value,video_url.value)
let data = { let data = {
username: item.master_phone, username: item.master_phone,
device: 'lihai_lot_walnutpi_dev_' + item.id, device: 'lihai_lot_walnutpi_dev_' + item.device_id,
// device: 'lihai_lot_walnutpi_dev_' + 5,
scene: 'screen' scene: 'screen'
} }
socket.send(JSON.stringify(data)) socket.send(JSON.stringify(data))
@ -104,7 +102,7 @@ const getDetail = () => {
}) })
} }
// getDetail() getDetail()
onBeforeUnmount(() => { onBeforeUnmount(() => {
socket.close() socket.close()
}) })

View File

@ -12,7 +12,7 @@ townsCenter({
geoJsonLuxian.features.forEach(item=>{ geoJsonLuxian.features.forEach(item=>{
geoJsonLuxian.center.push(item.center) geoJsonLuxian.center.push(item.center)
}) })
geoJsonLuxian.center.push([105.370, 29.145]) // geoJsonLuxian.center.push([105.370, 29.145])
}) })
let geoJsonLuxian = { let geoJsonLuxian = {
"type": "FeatureCollection", "type": "FeatureCollection",