123
parent
c7010a7ab3
commit
d4673fe8f1
|
@ -1,8 +1,8 @@
|
|||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 百威管理系统
|
||||
|
||||
# 开发环境配置
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
# 百威管理系统/开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 百威管理系统
|
||||
|
||||
# 生产环境配置
|
||||
VITE_APP_ENV = 'production'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
# 百威管理系统/生产环境
|
||||
VITE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 百威管理系统
|
||||
|
||||
# 生产环境配置
|
||||
VITE_APP_ENV = 'staging'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
# 百威管理系统/生产环境
|
||||
VITE_APP_BASE_API = '/stage-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title>若依管理系统</title>
|
||||
<title>百威管理系统</title>
|
||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||
<style>
|
||||
html,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "ruoyi",
|
||||
"version": "3.8.6",
|
||||
"description": "若依管理系统",
|
||||
"description": "百威管理系统",
|
||||
"author": "若依",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="left">
|
||||
<img src="@/assets/logo/logo.png" alt="dark" />
|
||||
<span>
|
||||
若依管理系统
|
||||
百威管理系统
|
||||
</span>
|
||||
</div>
|
||||
<div class="middle">
|
||||
|
|
|
@ -21,6 +21,7 @@ import {
|
|||
import homeIcon from '@/assets/image/bg7.jpg'
|
||||
import TWEEN from "@tweenjs/tween.js";
|
||||
import Bus from '@/utils/bus.js'
|
||||
import bimStore from '@/store/modules/bim';
|
||||
|
||||
let scene = ref(null);
|
||||
let renderer = ref(null);
|
||||
|
@ -50,9 +51,9 @@ const props = defineProps({
|
|||
}
|
||||
})
|
||||
const data = reactive({
|
||||
reductionMaterial: null
|
||||
gltfObj: null
|
||||
});
|
||||
const { reductionMaterial } = toRefs(data);
|
||||
const { gltfObj } = toRefs(data);
|
||||
|
||||
watch(() => props.sceneUrl, val => {
|
||||
init();
|
||||
|
@ -62,6 +63,30 @@ watch(() => props.sceneUrl, val => {
|
|||
Bus.on('clickBuild', (isParent) => {
|
||||
// Todo
|
||||
console.log('clickBuild', isParent);
|
||||
if (!isParent) {// 点击子级
|
||||
var clickName = bimStore().activateTree.clickName;
|
||||
console.log(123, clickName);
|
||||
// 恢复之前被选中模型的材质
|
||||
if (selectedObject && selectedMaterial) {
|
||||
selectedObject.material = selectedMaterial;
|
||||
selectedObject = null;
|
||||
selectedMaterial = null;
|
||||
}
|
||||
var Floor = gltfObj.value.scene.getObjectByName(clickName);
|
||||
if (Floor.length > 0) {
|
||||
// 储存被选中的模型和材质
|
||||
selectedObject = Floor;
|
||||
selectedMaterial = selectedObject.material;
|
||||
}
|
||||
console.log(1, Floor);
|
||||
Floor.traverse(e => {
|
||||
e.material = new THREE.MeshLambertMaterial({
|
||||
color: 0x00ff00,
|
||||
});
|
||||
nearCamera(e);
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
// 设备树点击
|
||||
Bus.on('clickDevice', e => {
|
||||
|
@ -100,8 +125,8 @@ const init = () => {
|
|||
|
||||
camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.25, 2000)
|
||||
// 将摄像机对准场景的中心
|
||||
camera.position.set(0, 104.545, -21.637);
|
||||
// camera.lookAt(scene.position);
|
||||
camera.position.set(-192.936, 180.990, -28.179);
|
||||
camera.lookAt(scene.position);
|
||||
|
||||
// 创建控件对象
|
||||
orbit = new OrbitControls(camera, renderer.domElement);
|
||||
|
@ -121,6 +146,8 @@ const init = () => {
|
|||
const loadSence = () => {
|
||||
const gltfLoader = new GLTFLoader();
|
||||
gltfLoader.load(props.sceneUrl, (gltf) => {
|
||||
// model.value = gltf.scene;
|
||||
gltfObj.value = gltf;
|
||||
var model = gltf.scene;
|
||||
scene.add(model);
|
||||
});
|
||||
|
@ -199,13 +226,17 @@ const onMouseDown = (event) => {
|
|||
selectedMaterial = clickedObject.material;
|
||||
// 修改材质为绿色
|
||||
selectedObject.material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
|
||||
nearCamera(intersects);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const nearCamera = (intersects) => {
|
||||
// 拉近场景
|
||||
if (!intersects[0]) {
|
||||
return;
|
||||
} else {
|
||||
|
||||
if (intersects[0].object.name.indexOf('box') > -1) {
|
||||
if (intersects[0].object.name) {
|
||||
selectedObjects = [];
|
||||
selectedObjects.push(intersects[0].object);
|
||||
positionObj = {
|
||||
|
@ -217,13 +248,17 @@ const onMouseDown = (event) => {
|
|||
initTween(
|
||||
positionObj.x,
|
||||
positionObj.y,
|
||||
positionObj.z
|
||||
positionObj.z+10
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 返回主页
|
||||
const toHomeView = () => {
|
||||
camera.position.set(-192.936, 180.990, -28.179);
|
||||
camera.lookAt(scene.position);
|
||||
}
|
||||
// 返回主页
|
||||
const toHomeView1 = () => {
|
||||
let initPosition = {
|
||||
x: camera.position.x,
|
||||
y: camera.position.y,
|
||||
|
|
Loading…
Reference in New Issue