diff --git a/src/assets/css/newicon/iconfont.css b/src/assets/css/newicon/iconfont.css index 8c2021b..ffe36ff 100644 --- a/src/assets/css/newicon/iconfont.css +++ b/src/assets/css/newicon/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4025145 */ - src: url('iconfont.woff2?t=1681876255746') format('woff2'), - url('iconfont.woff?t=1681876255746') format('woff'), - url('iconfont.ttf?t=1681876255746') format('truetype'); + src: url('//at.alicdn.com/t/c/font_4025145_o5efykd2y3.woff2?t=1684721703109') format('woff2'), + url('//at.alicdn.com/t/c/font_4025145_o5efykd2y3.woff?t=1684721703109') format('woff'), + url('//at.alicdn.com/t/c/font_4025145_o5efykd2y3.ttf?t=1684721703109') format('truetype'); } .iconfont { @@ -13,6 +13,14 @@ -moz-osx-font-smoothing: grayscale; } +.icon-WIFI:before { + content: "\e63f"; +} + +.icon-tuoputu_jiaohuanjizu:before { + content: "\e639"; +} + .icon-angle-right:before { content: "\e84e"; } @@ -20,4 +28,3 @@ .icon-angle-left:before { content: "\e84f"; } - diff --git a/src/assets/img/Factory/switch.jpg b/src/assets/img/Factory/switch.jpg new file mode 100644 index 0000000..10d3e8d Binary files /dev/null and b/src/assets/img/Factory/switch.jpg differ diff --git a/src/views/FactoryView/index.vue b/src/views/FactoryView/index.vue index f772dff..345ab31 100644 --- a/src/views/FactoryView/index.vue +++ b/src/views/FactoryView/index.vue @@ -14,7 +14,7 @@ import { getSensorInfodata , deviceDistributeInMachineryFactorydata} from "@/htt import { connectWebsocket, closeWebsocket } from "@/utils/websocket"; import { useFactoryStore } from '@/store/module/Factory'; -import statusBar from '@/components/mapStatus/statusBar.vue'; +import statusBar from './statusBar.vue'; const store = useFactoryStore(); let Acontent = ref(); diff --git a/src/views/FactoryView/statusBar.vue b/src/views/FactoryView/statusBar.vue new file mode 100644 index 0000000..b5af292 --- /dev/null +++ b/src/views/FactoryView/statusBar.vue @@ -0,0 +1,183 @@ + + + + + + diff --git a/src/views/FactoryView/threeMap.vue b/src/views/FactoryView/threeMap.vue index 3a366b1..5cc75f3 100644 --- a/src/views/FactoryView/threeMap.vue +++ b/src/views/FactoryView/threeMap.vue @@ -67,6 +67,7 @@ const requires = { 'door': require("@/assets/img/Factory/door.jpg"), 'sky': require("@/assets/img/Factory/sky.jpg"), 'titleFloor': require("@/assets/img/Factory/screen_title.png"), + 'switch': require("@/assets/img/Factory/switch.jpg"), } const workerShopRoute = { @@ -729,29 +730,53 @@ function createWifi(position: positionType) { } //创建交换机 -function createSwitch(position: positionType, scale: number = 0.2) { - const loader = new GLTFLoader(); +// function createSwitch(position: positionType, scale: number = 0.2) { +// const loader = new GLTFLoader(); - loader.load('/models/gltf/scene.gltf', function (gltf) { - const mesh = gltf.scene.children[0]; +// loader.load('/models/gltf/scene.gltf', function (gltf) { +// const mesh = gltf.scene.children[0]; - const s = scale; - mesh.scale.set(s, s, 0.5); - mesh.position.set(position.x-12.75, position.y, position.z+66.22); - mesh.rotation.z = THREE.MathUtils.degToRad(180) - // mesh.rotation.y = THREE.MathUtils.degToRad(90) - // mesh.rotation.x = THREE.MathUtils.degToRad(45) - mesh.castShadow = true; - mesh.receiveShadow = true; - scene.add(mesh); +// const s = scale; +// mesh.scale.set(s, s, 0.5); +// mesh.position.set(position.x-12.75, position.y, position.z+66.22); +// mesh.rotation.z = THREE.MathUtils.degToRad(180) +// // mesh.rotation.y = THREE.MathUtils.degToRad(90) +// // mesh.rotation.x = THREE.MathUtils.degToRad(45) +// mesh.castShadow = true; +// mesh.receiveShadow = true; +// scene.add(mesh); - }, undefined, function (error) { +// }, undefined, function (error) { - console.error(error); +// console.error(error); - }); +// }); +// } + +const createSwitch = ( boxposition: positionType, shadow: boolean = true): object => { + +const wallTexture = new THREE.TextureLoader().load(requires.switch); +const wall = new THREE.BoxGeometry(15, 5, 10); +const wallMaterial = new THREE.MeshPhongMaterial({ + map: wallTexture, + color: 0xe7e7e7, + transparent: true, +}); +//墙体的网格 +const wallMesh = new THREE.Mesh(wall, wallMaterial); +// 物体移动位置 +// wallMesh.position.set((-size.baseWidth / 2 + boxposition.x + 1), size.baseHeght / 2 + boxposition.y, -size.baseLength / 2 + boxposition.z); +wallMesh.position.set(boxposition.x-6, 5 + boxposition.y, boxposition.z+33.73); +// 对象是否渲染到阴影贴图当中 +wallMesh.castShadow = shadow; +// 将立方体添加到场景中 +group.add(wallMesh) +return wallMesh } + + + //创建服务器 function createGlb() { const loader = new GLTFLoader(); @@ -764,8 +789,8 @@ function createGlb() { mesh.position.set(-346, 0, 51); mesh.castShadow = true; mesh.receiveShadow = true; + createLableObj(mesh, '服务器', { x: 0, y: 60, z: 0 }) scene.add(mesh); - }, undefined, function (error) { console.error(error);