wuhb 1 年之前
父節點
當前提交
d2f56e6424
共有 3 個文件被更改,包括 28 次插入7 次删除
  1. 1 1
      index.html
  2. 26 6
      src/layout/index.vue
  3. 1 0
      src/router/index.ts

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" href="/favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>数字孪生编辑器</title>
+    <title>宇光同行-数字孪生</title>
   </head>
   <body>
     <div id="app"></div>

+ 26 - 6
src/layout/index.vue

@@ -5,6 +5,7 @@
         <el-button type="primary" @click="clearScene" style="margin-left: 3px;">清空</el-button>
         <el-button type="primary" @click="resetCamera" style="margin-left: 3px;">重置</el-button>
         <el-button type="primary" @click="toView" style="margin-left: 3px;">预览</el-button>
+        <el-button type="primary" @click="toFull" style="margin-left: 3px;">全屏</el-button>
         <el-button @click="showDrawer" type="primary" style="margin-left: 3px;">
           模型
         </el-button>
@@ -65,25 +66,43 @@
   var scene:any;
   var settings = {selMesh: selMesh, color: '#ff0000' , x: 0, y: 0, z:0, rx:0, ry:0, rz:0, sx:1, sy:1, sz:1}
   let data = getWallData(maxWidth, maxLength);
+  let pathname:any;
   var drawer = ref(false);
   var isOperater = ref(true);
   var activeNames = ref(['1', '2'])
   var baseScaleX = 1;
   var baseScaleY = 1;
   var baseScaleZ = 1;
+
+  const isShowView=(val:boolean)=>{
+    pathname = window.location.pathname;
+    if("/showView" == pathname){
+      isOperater.value = false;
+    }else{
+      isOperater.value = val;
+    }
+  }
+  
+  const showView =() =>{
+    pathname = window.location.pathname;
+    isShowView(true);
+  }
+  showView();
   
   const isFullScreen=()=>{
-    isOperater.value = false;
+    isShowView(false);
     fullscreenToggel();
   }
+  function toFull(){
+    isFullScreen();
+  }
 
   const showDrawer =() =>{
     drawer.value = true;
   }
 
   function toView(){
-    // window.open("/showView", '_blank');
-    isFullScreen();
+    window.open("/showView", '_blank');
   }
 
   function handleChange(val:string){
@@ -207,7 +226,7 @@
     let currentWidth = window.innerWidth;
     let currentHeight = window.innerHeight;
     if (currentWidth < prevWidth || currentHeight < prevHeight) {
-      isOperater.value = true;;
+      isShowView(true);
     }
     prevWidth = currentWidth;
     prevHeight = currentHeight;
@@ -445,7 +464,8 @@
     localStorage.removeItem("scene");
     location.reload();
   };
-  
+
+
   window.addEventListener('keydown', function(event) {
     if (event.key === 'Delete' || event.keyCode === 46) {
       if(settings.selMesh){
@@ -480,7 +500,7 @@
       // }
     }
     if (event.key === 'Escape'|| event.keyCode === 27) {
-      isOperater.value = true;
+      isShowView(true);
     }
     // if(event.key == "up"||event.key == "right" || event.keyCode === 39 || event.keyCode === 38){
     //   var element:any = getFocusElement();

+ 1 - 0
src/router/index.ts

@@ -77,6 +77,7 @@ const router = createRouter({
     },
     {
       path: '/showView',
+      name:'showView',
       component: () => import('@/layout/index.vue'),
     }
   ]