bill 2 lat temu
rodzic
commit
538cad376b

Plik diff jest za duży
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 6 - 0
src/graphic/Renderer/Draw.js

@@ -1188,6 +1188,12 @@ export default class Draw {
     const ctx = this.context;
     ctx.save();
     help.setVectorStyle(ctx, vector);
+
+    const lineWidth =
+      Settings.lineWidth *
+      (ctx.lineWidth || 1) *
+      (vector.weight === VectorWeight.Bold ? 2 : 1);
+    ctx.lineWidth = lineWidth
     help.transformCoves([vector.curves]).forEach((coves) => {
       help.drawCoves(ctx, coves);
     });

+ 1 - 1
src/main.ts

@@ -1,7 +1,7 @@
 import VConsole from 'vconsole';
 if (import.meta.env.MODE !== "production") {
   if (!os.isPc) {
-    // new VConsole();
+    new VConsole();
   }
 }
 

+ 1 - 0
src/sdk/types/sdk.ts

@@ -21,6 +21,7 @@ export type SceneEventMap = {
   loaded: void;
   webglError: void;
   visible: boolean;
+  viewChange: "Top" | "Bottom"
 };
 
 export type PointInfo = {

+ 4 - 4
src/views/graphic/geos/normalLine.vue

@@ -19,7 +19,7 @@ import VectorCategory from "@/graphic/enum/VectorCategory";
 const props = defineProps<{ geo: FocusVector }>()
 const vector = computed(() => dataService.getLine(props.geo.vectorId))
 
-console.log(vector)
+const isCurve = props.geo.type === VectorType.CurveLine
 const clickHandlerFactory = (key) => {
   return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
 }
@@ -70,7 +70,7 @@ const lineWidthMenu = [
     text: "宽度",
     onClick: () => {
       clickHandlerFactory(VectorWeight.Thinning)()
-      menus.value[1] = lineWidthMenu[1]
+      menus.value[isCurve ? 0 : 1] = lineWidthMenu[1]
     }
   },
   {
@@ -79,12 +79,12 @@ const lineWidthMenu = [
     text: "宽度",
     onClick: () => {
       clickHandlerFactory(VectorWeight.Bold)()
-      menus.value[1] = lineWidthMenu[0]
+      menus.value[isCurve ? 0 : 1] = lineWidthMenu[0]
     }
   },
 ]
 
-const appendMenus = (props.geo.category === VectorCategory.Line.NormalLine || props.geo.type === VectorType.CurveLine)
+const appendMenus = (props.geo.category === VectorCategory.Line.NormalLine || isCurve)
   ? [
     {
       key: VectorEvents.AddCrossPoint,

+ 1 - 1
src/views/photos/index.vue

@@ -1,7 +1,7 @@
 <template>
   <MainPanel>
     <template v-slot:header>
-      <Header :count="selects.length" :title="`全部照片(${photos.length})`" type="return">
+      <Header :count="selects.length" :title="`全部照片(${photos.length})`" type="return" :on-back="() => router.back()">
         <ui-button type="primary" @click="selectMode = !selectMode" width="96px" v-if="sortPhotos.length">
           {{ selectMode ? '取消' : '选择' }}
         </ui-button>

+ 9 - 1
src/views/scene/menus/menus.ts

@@ -1,6 +1,6 @@
 import {findMenuByAttr, generateMixMenus as generateMixMenusRaw} from '@/utils/menus'
 import {nextTick, ref} from "vue";
-import {useSDK} from "@/hook";
+import {useAsyncSDK, useSDK} from "@/hook";
 import {laserModeStack, modeDisabled} from '@/hook/custom/index'
 import {Mode} from "@/sdk";
 import {baseLines} from "@/store/baseLine";
@@ -31,6 +31,13 @@ export enum menuEnum {
   BASE_POINT = 'basePoint',
 }
 
+const vView = ref(false)
+useAsyncSDK().then(sdk => {
+  sdk.scene.on('viewChange', (view) => {
+    vView.value = view === "Top" || view === "Bottom"
+  })
+})
+
 export const menus: MenuRaw[] = [
   // {
   //   icon: "save",
@@ -59,6 +66,7 @@ export const menus: MenuRaw[] = [
       {
         icon: "line_v",
         continued: true,
+        disabled: () => vView.value,
         text: "垂直",
         key: menuEnum.MEASURE_COLUMN
       },

+ 7 - 0
src/views/scene/menus/pane.vue

@@ -47,6 +47,13 @@ const store = generateMixMenus(
   menusMix.value
 )
 
+watchEffect(() => {
+  const menu = findMenuByKey(store.itemActiveKey.value as any)
+  if (menu?.disabled && menu?.disabled()) {
+    store.itemActiveKey.value = null
+  }
+})
+
 watchEffect((onCleanup) => {
   const menu = store.activeMenuKey.value && findMenuByKey(store.activeMenuKey.value)
   if (store.child && menu?.onClick) {