This commit is contained in:
2025-12-23 18:58:47 +08:00
parent 039e0ce421
commit 5ae5dc7224
7 changed files with 548 additions and 32 deletions

View File

@ -56,8 +56,7 @@
<Yszs />
</div>
<div class="flex middle-bottom mt10">
<div
style="width: 30px;position: absolute;z-index: 100;left: 0;background-color: #07274d;height: 30px;text-align: center;line-height:30px;">
<div style="width: 30px;position: absolute;z-index: 100;left: 0;background-color: #07274d;height: 30px;text-align: center;line-height:30px;">
<el-icon :size="20" v-if="ispLayBack" @click="closeLayBack">
<Bell />
</el-icon>
@ -65,6 +64,14 @@
<MuteNotification />
</el-icon>
</div>
<div style="width: 30px;position: absolute;z-index: 100;left: 34px;background-color: #07274d;height: 30px;text-align: center;line-height:30px;">
<el-tooltip class="item" effect="dark" :content="showNotification ? '通知关闭' : '通知打开'" placement="bottom">
<el-icon :size="20" @click="handleOpenNotification" style="top: 3px;">
<Open v-if="showNotification" />
<TurnOff v-else />
</el-icon>
</el-tooltip>
</div>
<div style="width: 100%;border: 1px sienna;position: relative">
<GdMap></GdMap>
</div>
@ -142,15 +149,13 @@ const changeXzqh = (val, trg) => {
// 先移除已有的边界
emitter.emit('removeBj')
if (trg) {
console.log("多个");
// 如果传入的是多个区域数据(二维数组)
const features = val.map((area, index) => ({
geometry: {
type: "Polygon",
coordinates: [area] // 确保格式正确
},
properties: {
},
properties: { },
type: "Feature"
}))
// 循环为每个区域创建单独的多边形,这样可以设置不同的样式
@ -162,6 +167,7 @@ const changeXzqh = (val, trg) => {
},
color: 'rgba(209, 112, 65, 0.8)',
fillColor: 'rgba(255, 255, 255,0)',
outLineWidth: 2,
})
})
} else {
@ -222,24 +228,46 @@ const getDepId = () => {
changeXzqh(data, true)
break;
}
}
}
const indexNum = ref(0) //当前展示的气泡框
const showNotification = ref(false) //是否自动展开提示
const allDep = ref([]) //所有部门
const handleOpenNotification = () => {
showNotification.value = !showNotification.value;
emitter.emit('deletePointArea','hm_pop')
if(showNotification.value){
// 主动展开提示,默认展示所有
allDep.value.forEach(item => {
emitter.emit("makerPopup", { data:item, flag: "hm_pop",type:'Custom'});
})
}
}
const makerCenter = () => {
const dw = require("@/assets/point/dingwei.png")
qcckGet({},'/mosty-gsxt/tbYjxx/selectSsbm').then(res=>{
emitter.emit('deletePointArea','hm')
emitter.emit('deletePointArea','hm_pop')
if(!showNotification.value) emitter.emit('deletePointArea','hm_pop')
let list = res || [];
list.forEach(item => {
let obj = centralPoint.find(i => i.name == item.ssbm);
let obj = centralPoint.find(i => i.name == item.ssbm || i.ssbmdm == item.ssbmdm);
if(obj){
item.jd = obj.point[0];
item.wd = obj.point[1];
}
})
allDep.value = list;
emitter.emit("addPointArea", { coords:list, icon: dw, flag: "hm", size: '14px', showTitle: false, offset: [0, -25] });
if(!showNotification.value){
setTimeout(() => {
// 没有主动展开提示,默认循环一个一个展示
if(list.length > 0){
emitter.emit("makerPopup", { data:list[indexNum.value], flag: "hm_pop",type:'Custom'});
indexNum.value == list.length ? indexNum.value = 0 : indexNum.value++
}
}, 1000);
}
})
}
//播放音频