main
			
			
		
		
							parent
							
								
									2cb6a3f4c4
								
							
						
					
					
						commit
						0d2a3c5367
					
				| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="navbar1">
 | 
					  <div class="navbar1" :style="{'backgroundColor' : background}">
 | 
				
			||||||
    <!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" /> -->
 | 
					    <!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" /> -->
 | 
				
			||||||
    <div class="left">
 | 
					    <div class="left">
 | 
				
			||||||
      <!-- <img src="@/assets/logo/logo.png" alt="dark" /> -->
 | 
					      <!-- <img src="@/assets/logo/logo.png" alt="dark" /> -->
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
      </span>
 | 
					      </span>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="middle">
 | 
					    <div class="middle">
 | 
				
			||||||
      BIM运维管理系统
 | 
					      BIM运维管理系统{{ test }}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="right-menu">
 | 
					    <div class="right-menu">
 | 
				
			||||||
      <template v-if="appStore.device !== 'mobile'">
 | 
					      <template v-if="appStore.device !== 'mobile'">
 | 
				
			||||||
| 
						 | 
					@ -71,7 +71,9 @@ import useAppStore from '@/store/modules/app'
 | 
				
			||||||
import useUserStore from '@/store/modules/user'
 | 
					import useUserStore from '@/store/modules/user'
 | 
				
			||||||
import useSettingsStore from '@/store/modules/settings'
 | 
					import useSettingsStore from '@/store/modules/settings'
 | 
				
			||||||
import dayjs from "dayjs";
 | 
					import dayjs from "dayjs";
 | 
				
			||||||
 | 
					import { computed } from 'vue'
 | 
				
			||||||
const router = useRouter();
 | 
					const router = useRouter();
 | 
				
			||||||
 | 
					import bimStore from '@/store/modules/bim';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const appStore = useAppStore()
 | 
					const appStore = useAppStore()
 | 
				
			||||||
const userStore = useUserStore()
 | 
					const userStore = useUserStore()
 | 
				
			||||||
| 
						 | 
					@ -81,9 +83,10 @@ const data = reactive({
 | 
				
			||||||
  interval: "",
 | 
					  interval: "",
 | 
				
			||||||
  currentTime: "",
 | 
					  currentTime: "",
 | 
				
			||||||
  time: "",
 | 
					  time: "",
 | 
				
			||||||
  week: ""
 | 
					  week: "",
 | 
				
			||||||
 | 
					  background: ''
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
const { interval, currentTime, time, week } = toRefs(data);
 | 
					const { interval, currentTime, time, week,background } = toRefs(data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
onMounted(() => {
 | 
					onMounted(() => {
 | 
				
			||||||
  interval.value = setInterval(updateTime, 1000);
 | 
					  interval.value = setInterval(updateTime, 1000);
 | 
				
			||||||
| 
						 | 
					@ -91,6 +94,9 @@ onMounted(() => {
 | 
				
			||||||
onUnmounted(() => {
 | 
					onUnmounted(() => {
 | 
				
			||||||
   clearInterval(interval.value);
 | 
					   clearInterval(interval.value);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					watch(() => bimStore().activateMenu, value => background.value = value.background);
 | 
				
			||||||
function toggleSideBar() {
 | 
					function toggleSideBar() {
 | 
				
			||||||
  appStore.toggleSideBar()
 | 
					  appStore.toggleSideBar()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,14 +37,9 @@ const data = reactive({
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    label: '消防系统',
 | 
					                    label: '消防系统',
 | 
				
			||||||
                    id: '0-1',
 | 
					                    id: '0-1',
 | 
				
			||||||
                    url: '/jz/glb/scene.gltf'
 | 
					                    url: '/jz/glb/scene.gltf',
 | 
				
			||||||
 | 
					                    children:[]
 | 
				
			||||||
                },
 | 
					                }
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    label: '电力系统',
 | 
					 | 
				
			||||||
                    id: '0-2',
 | 
					 | 
				
			||||||
                    url: '/seraphine/scene.gltf'
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,17 +50,17 @@ const { applicationValue, treeData, checkedkeys } = toRefs(data);
 | 
				
			||||||
const emit = defineEmits(['handleNodeClick'])
 | 
					const emit = defineEmits(['handleNodeClick'])
 | 
				
			||||||
onMounted(() => {
 | 
					onMounted(() => {
 | 
				
			||||||
    nextTick(() => {
 | 
					    nextTick(() => {
 | 
				
			||||||
        checkedkeys.value = treeData.value[0].children[0].id;
 | 
					        checkedkeys.value = treeData.value[0].id;
 | 
				
			||||||
        // myTree.setCurrentKey(checkedkeys.value);
 | 
					        bimStore().setActivateApplicationTree(treeData.value[0]);
 | 
				
			||||||
        bimStore().setActivateApplicationTree(treeData.value[0].children[0]);
 | 
					        handleNodeClick(treeData.value[0]);
 | 
				
			||||||
        handleNodeClick(treeData.value[0].children[0]);
 | 
					 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
const handleNodeClick = (value) => {
 | 
					const handleNodeClick = (value) => {
 | 
				
			||||||
    bimStore().setActivateTree(value);
 | 
					    bimStore().setActivateTree(value);
 | 
				
			||||||
 | 
					    const isParent = value.children.length > 0;
 | 
				
			||||||
    emit('handleNodeClick', value);
 | 
					    emit('handleNodeClick', value);
 | 
				
			||||||
    setTimeout(() => {
 | 
					    setTimeout(() => {
 | 
				
			||||||
        Bus.emit('clickApplication');
 | 
					        Bus.emit('clickApplication', isParent );
 | 
				
			||||||
    }, 100)
 | 
					    }, 100)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,9 +15,6 @@
 | 
				
			||||||
            <div class="button" @click="roam()">
 | 
					            <div class="button" @click="roam()">
 | 
				
			||||||
                漫游
 | 
					                漫游
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="button" @click="xiaof()">
 | 
					 | 
				
			||||||
                消防
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
| 
						 | 
					@ -92,9 +89,12 @@ Bus.on('clickDevice', (isParent) => {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 系统树点击
 | 
					// 系统树点击
 | 
				
			||||||
Bus.on('clickApplication', e => {
 | 
					Bus.on('clickApplication', (isParent) => {
 | 
				
			||||||
    // Todo
 | 
					    // Todo
 | 
				
			||||||
    console.log('clickApplication');
 | 
					    if(!isParent) {
 | 
				
			||||||
 | 
					        xiaof();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					   
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
watch(() => bimStore().activateMenu, value => {
 | 
					watch(() => bimStore().activateMenu, value => {
 | 
				
			||||||
| 
						 | 
					@ -219,6 +219,7 @@ const onMouseDownRight = (event) => {
 | 
				
			||||||
        const clickedObject = intersects[0].object;
 | 
					        const clickedObject = intersects[0].object;
 | 
				
			||||||
        console.log('这是我选中的模型', clickedObject);
 | 
					        console.log('这是我选中的模型', clickedObject);
 | 
				
			||||||
        var selectedObject = isSelent(clickedObject);
 | 
					        var selectedObject = isSelent(clickedObject);
 | 
				
			||||||
 | 
					        // addLabel(selectedObject);
 | 
				
			||||||
        emit('handleRightClick', selectedObject);
 | 
					        emit('handleRightClick', selectedObject);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -371,10 +372,16 @@ const renders = () => {
 | 
				
			||||||
let roamdObjects = ref([]);
 | 
					let roamdObjects = ref([]);
 | 
				
			||||||
// 返回初始值
 | 
					// 返回初始值
 | 
				
			||||||
const toHomeView = () => {
 | 
					const toHomeView = () => {
 | 
				
			||||||
 | 
					    // 清除选中框
 | 
				
			||||||
    if (selectBoxByClick) {
 | 
					    if (selectBoxByClick) {
 | 
				
			||||||
        scene.remove(selectBoxByClick);
 | 
					        scene.remove(selectBoxByClick);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // 清除标签
 | 
				
			||||||
 | 
					    if(!isAddLabel.value) {
 | 
				
			||||||
        removeLabel();
 | 
					        removeLabel();
 | 
				
			||||||
 | 
					        isAddLabel.value = !isAddLabel.value;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    // 清除精灵图
 | 
				
			||||||
    controls.reset();
 | 
					    controls.reset();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// 拉近距离
 | 
					// 拉近距离
 | 
				
			||||||
| 
						 | 
					@ -395,16 +402,15 @@ const nearCamera = (floor) => {
 | 
				
			||||||
//标签
 | 
					//标签
 | 
				
			||||||
const setLabel = () => {
 | 
					const setLabel = () => {
 | 
				
			||||||
    if (isAddLabel.value) {
 | 
					    if (isAddLabel.value) {
 | 
				
			||||||
        addLabel();
 | 
					            let obj = scene.getObjectByName('set2');
 | 
				
			||||||
 | 
					            addLabel(obj);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        removeLabel();
 | 
					        removeLabel();
 | 
				
			||||||
        toHomeView();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    isAddLabel.value = !isAddLabel.value;
 | 
					    isAddLabel.value = !isAddLabel.value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// 添加标签
 | 
					// 添加标签
 | 
				
			||||||
const addLabel = () => {
 | 
					const addLabel = (obj) => {
 | 
				
			||||||
    let obj = scene.getObjectByName('set2');
 | 
					 | 
				
			||||||
    // console.log(123, obj);
 | 
					    // console.log(123, obj);
 | 
				
			||||||
    centerSelectedGroup(obj);
 | 
					    centerSelectedGroup(obj);
 | 
				
			||||||
    let text = "设备二";
 | 
					    let text = "设备二";
 | 
				
			||||||
| 
						 | 
					@ -427,10 +433,7 @@ const createLableObj = (text) => {
 | 
				
			||||||
    return pointLabel;
 | 
					    return pointLabel;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const removeLabel = () => {
 | 
					const removeLabel = () => {
 | 
				
			||||||
    if(pointLabel) {
 | 
					 | 
				
			||||||
        isAddLabel.value = true;
 | 
					 | 
				
			||||||
    document.body.removeChild(labelRenderer.domElement);
 | 
					    document.body.removeChild(labelRenderer.domElement);
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -468,7 +471,7 @@ const xfadd = (obj,state)=> {
 | 
				
			||||||
    const sprite = new THREE.Sprite(spriteMaterial);
 | 
					    const sprite = new THREE.Sprite(spriteMaterial);
 | 
				
			||||||
    // 控制精灵大小
 | 
					    // 控制精灵大小
 | 
				
			||||||
    sprite.scale.set(5, 5, 5);
 | 
					    sprite.scale.set(5, 5, 5);
 | 
				
			||||||
    sprite.position.y = 5; //标签底部箭头和空对象标注点重合  
 | 
					    sprite.position.y = 10; //标签底部箭头和空对象标注点重合  
 | 
				
			||||||
    obj.add(sprite); //tag会标注在空对象obj对应的位置
 | 
					    obj.add(sprite); //tag会标注在空对象obj对应的位置
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue