wangqiujuan0808 2023-12-09 00:50:40 +08:00
parent c7010a7ab3
commit d4673fe8f1
7 changed files with 67 additions and 32 deletions

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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": {

View File

@ -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">

View File

@ -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 => {
@ -100,8 +125,8 @@ const init = () => {
camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.25, 2000) camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.25, 2000)
// //
camera.position.set(0, 104.545, -21.637); camera.position.set(-192.936, 180.990, -28.179);
// camera.lookAt(scene.position); camera.lookAt(scene.position);
// //
orbit = new OrbitControls(camera, renderer.domElement); orbit = new OrbitControls(camera, renderer.domElement);
@ -121,6 +146,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 +226,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,