tangning vor 1 Tag
Ursprung
Commit
a2d2f12a1a

+ 1 - 0
src/api/path.ts

@@ -26,6 +26,7 @@ export interface Path {
   visibilityRange: number;
   points: {
     name: string;
+    hide: boolean;
     position: SceneLocalPos;
     modelId: string;
   }[];

+ 3 - 0
src/components/path/sign.vue

@@ -69,6 +69,7 @@ path.bus.on("changePoints", (points) => {
     name: p.name,
     position: { ...p.position },
     modelId: p.modelId.toString(),
+    hide: p.hide || false,
   }));
   emit("updatePoints", currentPoints);
 });
@@ -79,6 +80,7 @@ path.bus.on("changeLineHeight", (val) => {
 
 watchEffect(() => {
   path.changeName(props.path.name);
+  path.changeHide(props.path.hide || false);
 });
 
 watch(
@@ -98,6 +100,7 @@ watchEffect(() => {
   for (const point of props.path.points) {
     watchEffect(() => {
       const ndx = props.path.points.indexOf(point);
+      console.log(ndx, 'watchEffect', ~ndx);
       if (~ndx) {
         path.changePointName(ndx, point.name);
         currentPoints[ndx].name = point.name;

+ 2 - 0
src/sdk/sdk.ts

@@ -299,6 +299,8 @@ export type Path = {
   changeLine: (props: Partial<PathProps["line"]>) => void;
   // 更改标题气泡属性
   changeName: (name: string) => void;
+  // 更改点位是否隐藏
+  changeHide: (hide: boolean) => void;
   // 线段销毁
   destroy: () => void;
 };

+ 8 - 0
src/views/guide/path/edit-path.vue

@@ -141,6 +141,14 @@
             />
           </ui-group-option>
         </ui-group>
+        <ui-group borderBottom>
+          <ui-group-option class="item">
+            <span class="label">隐藏</span>
+            <span class="oper">
+              <Switch v-model:checked="data.points[activePointNdx].show" />
+            </span>
+          </ui-group-option>
+        </ui-group>
         <Button block danger type="primary" ghost size="large" @click="deletePoint">
           删除
         </Button>

+ 1 - 1
src/views/setting/select-back.vue

@@ -32,7 +32,7 @@
                     color:
                       value[1] === item.value ? 'var(--colors-primary-base) ' : '#fff',
                   }"
-                  >{{ item.label }}{{ value }}</span
+                  >{{ item.label }}</span
                 >
               </MenuItem>
             </Menu>