소스 검색

feat:2d/大屏场景跳转编辑

ananzhusen 9 달 전
부모
커밋
10a9d7a68b
1개의 변경된 파일40개의 추가작업 그리고 11개의 파일을 삭제
  1. 40 11
      src/views/components/ContextMenu.vue

+ 40 - 11
src/views/components/ContextMenu.vue

@@ -15,6 +15,8 @@
       <t-menu-item v-if="!selections.mode&&hasC()" value="updateC"> 一键更新我的组件 </t-menu-item>
       <t-menu-item v-if="isAppend()" value="appendChild"> 追加状态 </t-menu-item>
       <t-menu-item v-if="is3D()" value="goto3d"> 进入3D可视化编辑 </t-menu-item>
+      <t-menu-item v-if="is2D()" value="goto2d"> 进入2D可视化编辑 </t-menu-item>
+      <t-menu-item v-if="isV()" value="gotov"> 进入大屏可视化编辑 </t-menu-item>
       <t-menu-item v-if="isTableNoFocus()" value="focus"> 
         <div class="flex">进入编辑模式<span class="flex-grow"></span>Enter</div>
       </t-menu-item>
@@ -121,6 +123,7 @@ onMounted(() => {
 });
 
 const onMenu = (val: string) => {
+  let id,url;
   switch (val) {
     case 'addAnchorHand':
       meta2d.addAnchorHand();
@@ -192,17 +195,35 @@ const onMenu = (val: string) => {
       meta2d.store.active[0].calculative.focus = false;
       break;
     case 'goto3d':
-    let id = meta2d?.store.active[0].iframe.split("id=")[1];
-    let url = `https://3d${rootDomain}/?id=`;
-    if(isDownload){
-      //安装包
-      url = location.origin+ `/3d/?id=`;
-    }
-    if (window.url3D) {
-      url = window.url3D;
-    }
-    window.open(url + id, '_blank');
-    break;
+      id = meta2d?.store.active[0].iframe.split("id=")[1];
+      url = `https://3d${rootDomain}/?id=`;
+      if(isDownload){
+        //安装包
+        url = location.origin+ `/3d/?id=`;
+      }
+      if (window.url3D) {
+        url = window.url3D;
+      }
+      window.open(url + id, '_blank');
+      break;
+    case 'goto2d':
+      id = meta2d?.store.active[0].iframe.split("id=")[1];
+      url = `https://2d${rootDomain}/?id=`;
+      if(isDownload){
+        //安装包
+        url = location.origin+ `/2d/?id=`;
+      }
+      window.open(url + id, '_blank');
+      break;
+    case 'gotov':
+      id = meta2d?.store.active[0].iframe.split("id=")[1];
+      url = `https://v${rootDomain}/?id=`;
+      if(isDownload){
+        //安装包
+        url = location.origin+ `/v/?id=`;
+      }
+      window.open(url + id, '_blank');
+      break;
   }
 
   emit('changeVisible', false);
@@ -228,6 +249,14 @@ const is3D = ()=>{
   return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "iframe" && (meta2d?.store.active[0].iframe.indexOf("3d.") > -1||meta2d?.store.active[0].iframe.indexOf("/3d") > -1);
 }
 
+const is2D = ()=>{
+  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "iframe" && (meta2d?.store.active[0].iframe.indexOf("2d.") > -1||meta2d?.store.active[0].iframe.indexOf("/2d") > -1);
+}
+
+const isV = ()=>{
+  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "iframe" && (meta2d?.store.active[0].iframe.indexOf("v.") > -1||meta2d?.store.active[0].iframe.indexOf("/v") > -1) &&(meta2d?.store.active[0].iframe.indexOf(`v${rootDomain}`) !== -1 || meta2d?.store.active[0].iframe.indexOf(`view${rootDomain}/v`) !== -1);
+}
+
 </script>
 
 <style lang="postcss" scoped>