Przeglądaj źródła

Merge branch 'v2.0.0-yunnan' of http://192.168.0.115:3000/bill/fuse-code into v2.0.0-yunnan

xzw 1 dzień temu
rodzic
commit
e046c588cc

+ 17 - 9
src/components/path/sign.vue

@@ -65,6 +65,7 @@ let currentPoints = props.path.points;
 let changPointsTimeout: any;
 path.bus.on("changePoints", (points) => {
   clearTimeout(changPointsTimeout);
+  console.log('points', points)
   currentPoints = points.map((p, ndx) => ({
     name: p.name,
     position: { ...p.position },
@@ -80,12 +81,12 @@ path.bus.on("changeLineHeight", (val) => {
 
 watchEffect(() => {
   path.changeName(props.path.name);
-  path.changeHide(props.path.hide || false);
 });
 
 watch(
   () => props.path.points.map((i) => ({ modelId: i.modelId, position: i.position })),
   (p) => {
+    console.log(p, 'watchEffect0', props.path.points);
     changPointsTimeout = setTimeout(() => {
       if (inRevise(props.path.points, currentPoints)) {
         path.changePathPoints(p);
@@ -97,16 +98,23 @@ watch(
 );
 
 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;
+    props.path.points.forEach((point, index) => {
+    // 监听 name 属性
+    watch(() => point.name, (newName) => {
+      path.changePointName(index, newName);
+      currentPoints[index].name = newName;
+    });
+    
+    // 监听 hide 属性
+    watch(() => point.hide, (newHide) => {
+      if (path.changePointDisplay) {
+        path.changePointDisplay(index, !newHide);
       }
     });
-  }
+  });
+},{ deep: true, flush: "post" });
+watchEffect(() => {
+  path.changeDirection(props.path.showDirection, props.path.reverseDirection);
 });
 
 let currentLine = getLineProps();

+ 2 - 1
src/sdk/cover/index.js

@@ -468,7 +468,8 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     bus.emit('changePoints', measure.dataset_points.map((p,i)=>{return {
                         position: (p || measure.points[i]).clone(), 
                         modelId: measure.points_datasets[i] == void 0 ? Id_noIntersect : measure.points_datasets[i], 
-                        name: measure.markerLabels[i].originText
+                        name: measure.markerLabels[i].originText,
+                        hide: false,
                     }}))
                     updatePathFakeLines(measure)
                 }else{

+ 1 - 1
src/sdk/sdk.ts

@@ -300,7 +300,7 @@ export type Path = {
   // 更改标题气泡属性
   changeName: (name: string) => void;
   // 更改点位是否隐藏
-  changeHide: (hide: boolean) => void;
+  changePointDisplay: (index: number, hide: boolean) => void;
   // 线段销毁
   destroy: () => void;
 };

+ 1 - 1
src/views/guide/path/edit-path.vue

@@ -145,7 +145,7 @@
           <ui-group-option class="item">
             <span class="label">隐藏</span>
             <span class="oper">
-              <Switch v-model:checked="data.points[activePointNdx].show" />
+              <Switch v-model:checked="data.points[activePointNdx].hide" />
             </span>
           </ui-group-option>
         </ui-group>

+ 8 - 2
src/views/setting/back-item.vue

@@ -22,12 +22,18 @@ const emit = defineEmits(['del']);
   img {
     display: block;
     height: 88px;
+    width: 88px;
+    object-fit: cover;
     cursor: pointer;
     outline: 2px solid transparent;
     transition: all 0.3s;
     border-radius: 4px;
   }
-
+  &:hover{
+    .iconclose {
+      display: block;
+    }
+  }
   .iconfonts {
     display: flex;
     align-items: center;
@@ -58,7 +64,7 @@ const emit = defineEmits(['del']);
 .iconclose{
   font-size: 14px !important;
   height: 14px !important;
-
+  display: none;
   position: absolute;
   right: 0;
   top: 0;

+ 3 - 2
src/views/tagging/hot/edit.vue

@@ -51,7 +51,7 @@
         v-model="tagging.desc"
         :maxlength="200"
       /> -->
-      <editorInput :placeholder="defStyleType.id === type ? '描述:' : '特征描述:'" v-model="tagging.desc" />
+      <editorInput :placeholder="defStyleType.id === type ? '描述:' : '特征描述:'" v-model:value="tagging.desc" />
 
       <template v-if="defStyleType.id !== type">
         <ui-input
@@ -179,7 +179,7 @@
         <div class="edit-hot">
           <a @click="submitHandler">
             <ui-icon type="nav-edit" />
-            确定
+            确定1
           </a>
         </div>
       </div>
@@ -304,6 +304,7 @@ if (!activeStyle.value && defaultStyle.value) {
 const type = ref(activeStyle.value ? activeStyle.value.typeId : defStyleType.id);
 
 const submitHandler = () => {
+  console.log(tagging.value);
   if (activeStyle.value?.typeId !== type.value) {
     Message.error("请选择图标样式!");
   } else if (!tagging.value.title.trim()) {

+ 0 - 1
src/views/tagging/hot/index.vue

@@ -94,7 +94,6 @@ const saveHandler = (tagging: Tagging) => {
   } else {
     Object.assign(editTagging.value, tagging);
   }
-
   editTagging.value = null;
 };