bill hai 1 ano
pai
achega
f661303006
Modificáronse 2 ficheiros con 10 adicións e 29 borrados
  1. 9 29
      src/model/app.vue
  2. 1 0
      src/views/sign-model/index.vue

+ 9 - 29
src/model/app.vue

@@ -2,11 +2,7 @@
   <iframe class="external" :src="url" ref="iframeRef" v-if="url"></iframe>
   <div class="laser-layer" v-show="!url">
     <div class="scene-canvas" ref="fuseRef" :class="{ full: full === 'scene' }">
-      <span
-        class="taggle switch"
-        v-if="full !== 'scene'"
-        @click="full = 'scene'"
-      >
+      <span class="taggle switch" v-if="full !== 'scene'" @click="full = 'scene'">
         <!-- <ui-icon type="f-l" ctrl /> -->
         <img src="@/assets/icon_switch.png" ctrl />
       </span>
@@ -26,14 +22,7 @@
 </template>
 
 <script lang="ts">
-import {
-  defineComponent,
-  ref,
-  watchEffect,
-  computed,
-  watch,
-  nextTick,
-} from "vue";
+import { defineComponent, ref, watchEffect, computed, watch, nextTick } from "vue";
 import { SceneType } from "@/store";
 import { params } from "@/env";
 import { fuseModel, modelProps } from "./index";
@@ -43,7 +32,7 @@ import { round } from "@/utils";
 
 const typeChange = () => {
   const oldType = modelProps.type;
-  let stopWatch = null as unknown as () => void;
+  let stopWatch = (null as unknown) as () => void;
 
   const typePromise = new Promise((_, reject) => {
     stopWatch = watchEffect(() => {
@@ -61,9 +50,7 @@ export const full = ref("scene");
 export const Model = defineComponent({
   name: "model",
   setup() {
-    const scene = computed(
-      () => modelProps.type !== fuseModel && modelProps.type
-    );
+    const scene = computed(() => modelProps.type !== fuseModel && modelProps.type);
     const url = ref("");
     const setUrl = (newURL: string) => {
       if (newURL !== url.value) {
@@ -95,7 +82,7 @@ export const Model = defineComponent({
             [SceneType.SWKJ]: `/swkk/spg.html?m=${scene.value.num}&lang=zh`,
             [SceneType.SWSS]: `/swss/index.html?m=${scene.value.num}&lang=zh`,
             [SceneType.SWSSMX]: `/swkk/spg.html?m=${scene.value.num}&lang=zh`,
-            [SceneType.SWMX]: `index.html?caseId=${params.caseId}&app=${params.app}&modelId=${scene.value.num}&share=1#sign-model&lang=zh`,
+            [SceneType.SWMX]: `index.html?caseId=${params.caseId}&app=${params.app}&modelId=${scene.value.num}&share=1#sign-model`,
             [SceneType.SWYDSS]: `/swss/index.html?m=${scene.value.num}&lang=zh`,
             [SceneType.SWYDMX]: `/swkk/spg.html?m=${scene.value.num}&lang=zh`,
           }
@@ -164,8 +151,7 @@ export const Model = defineComponent({
           console.error(doc, doc.head);
           const target = doc.head;
           clearInterval(interval);
-          (window as any).iframeCreated &&
-            (window as any).iframeCreated(iframeRef.value);
+          (window as any).iframeCreated && (window as any).iframeCreated(iframeRef.value);
           if (type === SceneType.SWSS) {
             const $style = document.createElement("style");
             $style.type = "text/css";
@@ -224,9 +210,7 @@ export const Model = defineComponent({
 
       // return `${rlen} ${unit}`
 
-      return `${
-        unit === "dm" ? rlen / 10 : unit === "cm" ? rlen / 100 : rlen
-      }m`;
+      return `${unit === "dm" ? rlen / 10 : unit === "cm" ? rlen / 100 : rlen}m`;
     };
 
     return {
@@ -264,9 +248,7 @@ export default Model;
 }
 
 #direction {
-  right: calc(
-    var(--editor-menu-right) + var(--editor-toolbox-width)
-  ) !important;
+  right: calc(var(--editor-menu-right) + var(--editor-toolbox-width)) !important;
   top: calc(var(--header-top) + var(--editor-head-height)) !important;
   margin: 10px;
   transition: top 0.3s ease, right 0.3s ease;
@@ -275,9 +257,7 @@ export default Model;
 #scene-map {
   &:not(.full) {
     position: absolute !important;
-    right: calc(
-      var(--editor-menu-right) + var(--editor-toolbox-width)
-    ) !important;
+    right: calc(var(--editor-menu-right) + var(--editor-toolbox-width)) !important;
     bottom: 0;
     width: 320px;
     height: 200px;

+ 1 - 0
src/views/sign-model/index.vue

@@ -58,6 +58,7 @@ const loadSignModel = async () => {
       show: true,
       url: scene.modelGlbUrl || scene.modelObjUrl,
       type: scene.type,
+      renderType: scene.renderType,
       opacity: 100,
       modelType: scene.modelDateType,
     });