Files
qhmes/web-dist/js/WorkshopVisualization-Cb5V14g0.js

2 lines
6.8 KiB
Java
Raw Normal View History

2026-06-16 18:19:57 +08:00
import{Scene as $,Color as J,PerspectiveCamera as X,WebGLRenderer as Y,AmbientLight as Z,DirectionalLight as j,PointLight as W,GridHelper as ee,AxesHelper as te,PlaneGeometry as ne,MeshStandardMaterial as S,Mesh as y,LineBasicMaterial as oe,BufferGeometry as ae,LineSegments as ie,Group as re,BoxGeometry as _,MeshBasicMaterial as se,Material as le,Vector3 as C}from"./three.module-DDq6qIBS.js";import{O as ce}from"./OrbitControls-BnVF_s4z.js";import ue from"./DeviceStatusPanel-DcZufM4U.js";import de from"./ProductionDataPanel-C6knz89W.js";import pe from"./DeviceDetail-BHFxOMeV.js";import{aE as me,M as fe,au as ve}from"./index-X7Y8jykP.js";import{e as he,o as we,d as ge,C as ye,Q as p,f as d,r as v,A as h,G as H,c as _e,K as De,z as Me,E as x}from"./vue-vendor-DNhG1Cve.js";import"./index-Wl3jtD-0.js";import"./eagerComputed-BTlOruLW.js";import"./index-J2mOtM3w.js";import"./index-DO8NPWOz.js";import"./Skeleton-CimgOdM7.js";import"./index-DfX9t4DO.js";import"./isNumeric-DjvBa-1E.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";const Ce={class:"workshop-visualization"},xe={class:"workshop-container"},ze={class:"top-bar"},Se={class:"time-display"},Ee={class:"left-panel"},ke={class:"right-panel"},Le={class:"bottom-toolbar"},Ve=he({__name:"WorkshopVisualization",setup(Ge){const E=v(""),k=()=>{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"})};k();const A=setInterval(k,1e3),r=v();let n=null,s=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:"孙工"}]),B=_e(()=>({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),N=e=>{L.value=e,M.value=!0},R=()=>{if(!r.value)return;n=new $,n.background=new J(1710638),s=new X(60,r.value.clientWidth/r.value.clientHeight,.1,1e3),s.position.set(20,15,20),l=new Y({antialias:!0}),l.setSize(r.value.clientWidth,r.value.clientHeight),l.shadowMap.enabled=!0,r.value.appendChild(l.domElement),c=new ce(s,l.domElement),c.enableDamping=!0,c.dampingFactor=.05,c.autoRotate=g.value,c.autoRotateSpeed=2;const e=new Z(16777215,.6);n.add(e);const t=new j(16777215,.8);t.position.set(10,20,10),t.castShadow=!0,n.add(t);const o=new W(65535,.5);o.position.set(0,10,0),n.add(o),I(),u.value.forEach(m=>{F(m)});const a=new ee(30,30,4473924,3355443);n.add(a);const i=new te(5);n.add(i),window.addEventListener("resize",V),G()},I=()=>{if(!n)return;const e=new ne(30,30),t=new S({color:2763338,roughness:.8,metalness:.2}),o=new y(e,t);o.rotation.x=-Math.PI/2,o.position.y=-.1,o.receiveShadow=!0,n.add(o);const a=new oe({color:4868714}),i=[];for(let f=-15;f<=15;f+=10)i.push(new C(f,.1,-15)),i.push(new C(f,.1,15)),i.push(new C(-15,.1,f)),i.push(new C(15,.1,f));const m=new ae().setFromPoin