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