Forráskód Böngészése

Merge branch 'xj' of http://192.168.0.115:3000/bill/fuse-code into xj

bill 1 éve
szülő
commit
d8867aac8d
3 módosított fájl, 112 hozzáadás és 24 törlés
  1. BIN
      src/assets/icon_switch.png
  2. 32 10
      src/model/app.vue
  3. 80 14
      src/views/setting/index.vue

BIN
src/assets/icon_switch.png


+ 32 - 10
src/model/app.vue

@@ -2,14 +2,20 @@
   <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'">
-        <ui-icon type="f-l" ctrl />
+      <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>
       <div id="direction"></div>
     </div>
     <div id="scene-map" :class="{ full: full === 'map' }">
       <span class="taggle switch" v-if="full === 'scene'" @click="full = 'map'">
-        <ui-icon type="f-l" ctrl />
+        <!-- <ui-icon type="f-l" ctrl /> -->
+        <img src="@/assets/icon_switch.png" ctrl />
       </span>
 
       <span class="scale" :style="{ width: scaleInfo.width + 'px' }">
@@ -20,7 +26,14 @@
 </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";
@@ -30,7 +43,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(() => {
@@ -48,7 +61,9 @@ 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) {
@@ -149,7 +164,8 @@ 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";
@@ -208,7 +224,9 @@ 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 {
@@ -246,7 +264,9 @@ 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;
@@ -255,7 +275,9 @@ 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;

+ 80 - 14
src/views/setting/index.vue

@@ -11,7 +11,22 @@
 
     <ui-group title="指北针">
       <template #icon>
-        <ui-icon
+        <ui-input
+          ctrl
+          type="switch"
+          v-model="setting.openCompass"
+          @click="
+            changeBack(
+              setting!.back,
+              setting!.backType,
+              !setting!.openCompass,
+              setting!.mapOpen,
+              setting!.mapType,
+              { scale: setting!.scale!, rotate: setting?.rotate! }
+            )
+          "
+        ></ui-input>
+        <!-- <ui-icon
           ctrl
           :type="setting?.openCompass ? 'eye-s' : 'eye-n'"
           @click="
@@ -24,13 +39,29 @@
               { scale: setting!.scale!, rotate: setting?.rotate! }
             )
           "
-        />
+        /> -->
       </template>
     </ui-group>
 
     <ui-group title="地图" v-if="caseProject!.tmProject?.latlng">
       <template #icon>
-        <ui-icon
+        <ui-input
+          ctrl
+          type="switch"
+          v-model="setting.mapOpen"
+          @click="
+            changeBack(
+              setting!.back,
+              setting!.backType,
+              setting!.openCompass,
+              !setting!.mapOpen,
+              setting!.mapType,
+              { scale: setting!.scale!, rotate: setting?.rotate! }
+            )
+          "
+        ></ui-input>
+
+        <!-- <ui-icon
           ctrl
           :type="setting?.mapOpen ? 'eye-s' : 'eye-n'"
           @click="
@@ -43,7 +74,7 @@
               { scale: setting!.scale!, rotate: setting?.rotate! }
             )
           "
-        />
+        /> -->
       </template>
       <ui-group-option v-if="setting?.mapOpen">
         <ui-input
@@ -123,6 +154,9 @@
               class="del"
               @click.stop="delBack(back)"
             />
+            <!-- <ui-button type="primary" class="del" @click.stop="delBack(back)">
+              删除
+            </ui-button> -->
           </div>
           <ui-input
             class="input"
@@ -204,10 +238,14 @@
         maxlength="15"
       />
       <div class="edit-hot">
-        <a @click="addBack">
+        <ui-button type="submit" @click.stop="addTemp = undefined">
+          取消
+        </ui-button>
+        <ui-button type="primary" @click="addBack"> 确定 </ui-button>
+        <!-- <a @click="addBack">
           <ui-icon type="nav-edit" />
           确定
-        </a>
+        </a> -->
       </div>
     </div>
   </div>
@@ -240,7 +278,7 @@ import { SettingResource, addSettingResource } from "@/api/setting-resource";
 import { SettingResourceType } from "@/api/setting-resource";
 import { Dialog } from "bill/index";
 import { Slider, Tooltip } from "ant-design-vue";
-import 'ant-design-vue/lib/tooltip/style/index.css';
+import "ant-design-vue/lib/tooltip/style/index.css";
 import { RoutesName } from "@/router";
 
 fetchSettingResources();
@@ -511,9 +549,18 @@ const iconUpload = async (data: any) => {
     height: 20px;
     top: -10px;
     right: -10px;
+    border-radius: 50%;
     opacity: 0;
+    // top: 60px;
+    // left: 0;
+
     // opacity: 1;
-    border-radius: 50%;
+
+    :global(.ui-button) {
+      height: 28px;
+      border-top-left-radius: 0;
+      border-top-right-radius: 0;
+    }
 
     &.iconfont {
       font-size: 10px;
@@ -526,7 +573,7 @@ const iconUpload = async (data: any) => {
   }
 
   &:hover .del {
-    opacity: 0.9;
+    opacity: 1;
   }
 
   .iconfont {
@@ -593,12 +640,31 @@ const iconUpload = async (data: any) => {
 .edit-hot {
   margin-top: 20px;
   text-align: right;
-
-  span {
-    font-size: 14px;
-    color: rgba(255, 255, 255, 0.6);
-    cursor: pointer;
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  padding-top: 20px;
+  position: relative;
+  gap: 0 20px;
+  margin-right: -20px;
+  margin-left: -20px;
+  &::before {
+    position: absolute;
+    content: "";
+    height: 1px;
+    width: 100%;
+    top: 0px;
+    background: rgba(255, 255, 255, 0.16);
   }
+  .ui-button {
+    width: 100px;
+  }
+
+  // span {
+  //   font-size: 14px;
+  //   color: rgba(255, 255, 255, 0.6);
+  //   cursor: pointer;
+  // }
 }
 
 .edit-close {