Files
qhmes/deploy-qhmes/frontend/js/WorkshopVisualization-CkpL80YK.js

2 lines
6.7 KiB
Java
Raw Normal View History

2026-05-15 11:34:12 +08:00
import{d as Q,o as X,b as Y,ah as S,ar as Z,as as j,au as p,k as d,f as v,aF as h,av as H,e as ee,G as C}from"./vue-vendor-C7Zq48Yl.js";import{Scene as te,Color as ne,PerspectiveCamera as ae,WebGLRenderer as oe,AmbientLight as ie,DirectionalLight as se,PointLight as B,GridHelper as re,AxesHelper as le,PlaneGeometry as ce,MeshStandardMaterial as k,Mesh as y,LineBasicMaterial as ue,BufferGeometry as de,LineSegments as pe,Group as me,BoxGeometry as _,MeshBasicMaterial as fe,Material as ve,Vector3 as x}from"./three.module-C62V74CF.js";import{O as he}from"./OrbitControls-CJGLS2vR.js";import we from"./DeviceStatusPanel-DxeiGLZO.js";import ge from"./ProductionDataPanel-BaebLdjT.js";import ye from"./DeviceDetail-Cq7UlRoo.js";import{d as _e}from"./index-BI6CMai0.js";import"./antd-vue-vendor-BPnV8VqP.js";import"./vxe-table-vendor-B88kchpX.js";const De={class:"workshop-visualization"},Me={class:"workshop-container"},Ce={class:"top-bar"},xe={class:"time-display"},ze={class:"left-panel"},Se={class:"right-panel"},ke={class:"bottom-toolbar"},Ee=Q({__name:"WorkshopVisualization",setup(be){const E=v(""),b=()=>{const e=new Date;E.value=e.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})};b();const N=setInterval(b,1e3),s=v();let n=null,r=null,l=null,c=null,z=null;const g=v(!0),D=v(!1),u=v([{id:"DEV001",name:"数控机床 #1",type:"CNC机床",status:"running",temperature:65,efficiency:92,location:{x:0,y:0,z:0},production:150,maintenance:"正常",operator:"张工"},{id:"DEV002",name:"数控机床 #2",type:"CNC机床",status:"idle",temperature:45,efficiency:88,location:{x:8,y:0,z:0},production:120,maintenance:"正常",operator:"李工"},{id:"DEV003",name:"工业机器人 #1",type:"机器人",status:"running",temperature:55,efficiency:95,location:{x:0,y:0,z:8},production:200,maintenance:"正常",operator:"王工"},{id:"DEV004",name:"工业机器人 #2",type:"机器人",status:"warning",temperature:78,efficiency:70,location:{x:8,y:0,z:8},production:180,maintenance:"需要检查",operator:"赵工"},{id:"DEV005",name:"自动化流水线",type:"流水线",status:"running",temperature:40,efficiency:90,location:{x:4,y:0,z:4},production:500,maintenance:"正常",operator:"系统"},{id:"DEV006",name:"检测设备",type:"检测设备",status:"stopped",temperature:30,efficiency:0,location:{x:-4,y:0,z:4},production:0,maintenance:"维护中",operator:"孙工"}]),R=ee(()=>({totalProduction:u.value.reduce((e,t)=>e+t.production,0),efficiency:Math.round(u.value.reduce((e,t)=>e+t.efficiency,0)/u.value.length),deviceCount:u.value.length,runningDevices:u.value.filter(e=>e.status==="running").length,warningDevices:u.value.filter(e=>e.status==="warning").length,stoppedDevices:u.value.filter(e=>e.status==="stopped").length})),L=v(null),M=v(!1),A=e=>{L.value=e,M.value=!0},F=()=>{if(!s.value)return;n=new te,n.background=new ne(1710638),r=new ae(60,s.value.clientWidth/s.value.clientHeight,.1,1e3),r.position.set(20,15,20),l=new oe({antialias:!0}),l.setSize(s.value.clientWidth,s.value.clientHeight),l.shadowMap.enabled=!0,s.value.appendChild(l.domElement),c=new he(r,l.domElement),c.enableDamping=!0,c.dampingFactor=.05,c.autoRotate=g.value,c.autoRotateSpeed=2;const e=new ie(16777215,.6);n.add(e);const t=new se(16777215,.8);t.position.set(10,20,10),t.castShadow=!0,n.add(t);const a=new B(65535,.5);a.position.set(0,10,0),n.add(a),I(),u.value.forEach(m=>{T(m)});const o=new re(30,30,4473924,3355443);n.add(o);const i=new le(5);n.add(i),window.addEventListener("resize",V),G()},I=()=>{if(!n)return;const e=new ce(30,30),t=new k({color:2763338,roughness:.8,metalness:.2}),a=new y(e,t);a.rotation.x=-Math.PI/2,a.position.y=-.1,a.receiveShadow=!0,n.add(a);const o=new ue({color:4868714}),i=[];for(let f=-15;f<=15;f+=10)i.push(new x(f,.1,-15)),i.push(new x(f,.1,15)),i.push(new x(-15,.1,f)),i.push(new x(15,.1,f));const m=new de().setFromPoints(i),w=new pe(m,o);n.add(w)},T=e=>{if(!n)return;const t=new me;t.userData={deviceId:e.id};let a,o=2;e.type==="CNC机床"?a=new _(3,o,2):e.type==="机器人"?a=new _(1.5,o,1.5):e.type