究极更新

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 class="right">
<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>
</div>
@ -23,7 +23,7 @@
<span></span>
<span></span>
</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>
<div class="right-line">
<span></span>

View File

@ -47,9 +47,21 @@ import { areaObj } from "@/store/index.js"
import { landListApi } from "@/api.js"
import { globalEventBus } from '@/common/eventBus'
import { sendMsg } from "@/api.js"
const sendFn = (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"))
let geoJson = geoJsonLuxian
const areaStore = areaObj()
@ -82,7 +94,7 @@ const pointerFn = () => {
geoJson.center.forEach((item, index) => {
list.push({
coord: item,
symbol: index == geoJson.center.length - 1 ? ('image://' + lx) : ('image://' + icon),//
symbol: ('image://' + icon),//
symbolSize: [100, 30], //
symbolOffset: ['50%', '-50%'],
value: geoJson.features[index]?.properties.name || '泸县',
@ -112,6 +124,9 @@ const pointerFn2 = (lists) => {
})
return list
}
const initAreaMap =async () => {
showArea.value = true
await nextTick()
@ -258,25 +273,33 @@ const initAreaMap =async () => {
},
//
symbolSize: function (val) {
symbolSize: function (val,parmas) {
return 4
// return val[2] / 10;
},
markPoint: {
data: pointerFn()
},
itemStyle:{ //
// color:'green'
color:function(params) // seriesIndex, dataIndex, data, value
{
return 'blue';
}
},
data: (() => {
let data = {
资产数: geoJson.center
资产数:farmarCenter
}
console.log(farmarCenter,"center")
let finalData = []
Object.keys(data).map((i, index) => {
let child = data[i].map((row, index) => ({
value: row,
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)
}
})
params.data.data.forEach(item => {
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}`)
@ -543,6 +567,7 @@ watch(() => areaStore.userInfo, (value, oldValue) => {
)
onMounted(async () => {
getFamrCenter()
if(areaStore.userInfo.streetCode)return;
setTimeout(() => {showArea.value? initAreaMap(): initTownMap() }, 500)
})

View File

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

View File

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