Merge branch 'main' of https://git.shikicc.com/wangqiujuan0808/bw into main
commit
13c5c1a86f
|
@ -1,8 +1,8 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VITE_APP_TITLE = 若依管理系统
|
VITE_APP_TITLE = 百威管理系统
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 若依管理系统/开发环境
|
# 百威管理系统/开发环境
|
||||||
VITE_APP_BASE_API = '/dev-api'
|
VITE_APP_BASE_API = '/dev-api'
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VITE_APP_TITLE = 若依管理系统
|
VITE_APP_TITLE = 百威管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
VITE_APP_ENV = 'production'
|
VITE_APP_ENV = 'production'
|
||||||
|
|
||||||
# 若依管理系统/生产环境
|
# 百威管理系统/生产环境
|
||||||
VITE_APP_BASE_API = '/prod-api'
|
VITE_APP_BASE_API = '/prod-api'
|
||||||
|
|
||||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VITE_APP_TITLE = 若依管理系统
|
VITE_APP_TITLE = 百威管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
VITE_APP_ENV = 'staging'
|
VITE_APP_ENV = 'staging'
|
||||||
|
|
||||||
# 若依管理系统/生产环境
|
# 百威管理系统/生产环境
|
||||||
VITE_APP_BASE_API = '/stage-api'
|
VITE_APP_BASE_API = '/stage-api'
|
||||||
|
|
||||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<title>若依管理系统</title>
|
<title>百威管理系统</title>
|
||||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "ruoyi",
|
"name": "ruoyi",
|
||||||
"version": "3.8.6",
|
"version": "3.8.6",
|
||||||
"description": "若依管理系统",
|
"description": "百威管理系统",
|
||||||
"author": "若依",
|
"author": "若依",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img src="@/assets/logo/logo.png" alt="dark" />
|
<img src="@/assets/logo/logo.png" alt="dark" />
|
||||||
<span>
|
<span>
|
||||||
若依管理系统
|
百威管理系统
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
import homeIcon from '@/assets/image/bg7.jpg'
|
import homeIcon from '@/assets/image/bg7.jpg'
|
||||||
import TWEEN from "@tweenjs/tween.js";
|
import TWEEN from "@tweenjs/tween.js";
|
||||||
import Bus from '@/utils/bus.js'
|
import Bus from '@/utils/bus.js'
|
||||||
|
import bimStore from '@/store/modules/bim';
|
||||||
|
|
||||||
let scene = ref(null);
|
let scene = ref(null);
|
||||||
let renderer = ref(null);
|
let renderer = ref(null);
|
||||||
|
@ -50,9 +51,9 @@ const props = defineProps({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
reductionMaterial: null
|
gltfObj: null
|
||||||
});
|
});
|
||||||
const { reductionMaterial } = toRefs(data);
|
const { gltfObj } = toRefs(data);
|
||||||
|
|
||||||
watch(() => props.sceneUrl, val => {
|
watch(() => props.sceneUrl, val => {
|
||||||
init();
|
init();
|
||||||
|
@ -62,6 +63,30 @@ watch(() => props.sceneUrl, val => {
|
||||||
Bus.on('clickBuild', (isParent) => {
|
Bus.on('clickBuild', (isParent) => {
|
||||||
// Todo
|
// Todo
|
||||||
console.log('clickBuild', isParent);
|
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 => {
|
Bus.on('clickDevice', e => {
|
||||||
|
@ -102,7 +127,11 @@ const init = () => {
|
||||||
// 将摄像机对准场景的中心
|
// 将摄像机对准场景的中心
|
||||||
camera.position.set(-192.936, 180.990, -28.179);
|
camera.position.set(-192.936, 180.990, -28.179);
|
||||||
camera.lookAt(scene.position);
|
camera.lookAt(scene.position);
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
|
||||||
|
>>>>>>> c61eb163e061fb935e88a57641d1dc70e363d7b5
|
||||||
// 创建控件对象
|
// 创建控件对象
|
||||||
orbit = new OrbitControls(camera, renderer.domElement);
|
orbit = new OrbitControls(camera, renderer.domElement);
|
||||||
orbit.autoRotate = true;
|
orbit.autoRotate = true;
|
||||||
|
@ -121,6 +150,8 @@ const init = () => {
|
||||||
const loadSence = () => {
|
const loadSence = () => {
|
||||||
const gltfLoader = new GLTFLoader();
|
const gltfLoader = new GLTFLoader();
|
||||||
gltfLoader.load(props.sceneUrl, (gltf) => {
|
gltfLoader.load(props.sceneUrl, (gltf) => {
|
||||||
|
// model.value = gltf.scene;
|
||||||
|
gltfObj.value = gltf;
|
||||||
var model = gltf.scene;
|
var model = gltf.scene;
|
||||||
scene.add(model);
|
scene.add(model);
|
||||||
});
|
});
|
||||||
|
@ -199,31 +230,39 @@ const onMouseDown = (event) => {
|
||||||
selectedMaterial = clickedObject.material;
|
selectedMaterial = clickedObject.material;
|
||||||
// 修改材质为绿色
|
// 修改材质为绿色
|
||||||
selectedObject.material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
|
selectedObject.material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
|
||||||
|
nearCamera(intersects);
|
||||||
}
|
}
|
||||||
// 拉近场景
|
|
||||||
if (!intersects[0]) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (intersects[0].object.name.indexOf('box') > -1) {
|
}
|
||||||
selectedObjects = [];
|
|
||||||
selectedObjects.push(intersects[0].object);
|
|
||||||
positionObj = {
|
|
||||||
x: intersects[0].object.position.x,
|
|
||||||
y: intersects[0].object.position.y,
|
|
||||||
z: intersects[0].object.position.z,
|
|
||||||
};
|
|
||||||
|
|
||||||
initTween(
|
const nearCamera = (intersects) => {
|
||||||
positionObj.x,
|
// 拉近场景
|
||||||
positionObj.y,
|
if (!intersects[0]) {
|
||||||
positionObj.z
|
return;
|
||||||
);
|
} else {
|
||||||
|
if (intersects[0].object.name) {
|
||||||
|
selectedObjects = [];
|
||||||
|
selectedObjects.push(intersects[0].object);
|
||||||
|
positionObj = {
|
||||||
|
x: intersects[0].object.position.x,
|
||||||
|
y: intersects[0].object.position.y,
|
||||||
|
z: intersects[0].object.position.z,
|
||||||
|
};
|
||||||
|
|
||||||
|
initTween(
|
||||||
|
positionObj.x,
|
||||||
|
positionObj.y,
|
||||||
|
positionObj.z+10
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const toHomeView = () => {
|
||||||
|
camera.position.set(-192.936, 180.990, -28.179);
|
||||||
|
camera.lookAt(scene.position);
|
||||||
}
|
}
|
||||||
// 返回主页
|
// 返回主页
|
||||||
const toHomeView = () => {
|
const toHomeView1 = () => {
|
||||||
let initPosition = {
|
let initPosition = {
|
||||||
x: camera.position.x,
|
x: camera.position.x,
|
||||||
y: camera.position.y,
|
y: camera.position.y,
|
||||||
|
|
Loading…
Reference in New Issue