Bladeren bron

添加粘贴选择功能,修改复制粘贴按钮不生效问题,打开切换楼层功能

zhangyu 4 jaren geleden
bovenliggende
commit
852c4773b7
3 gewijzigde bestanden met toevoegingen van 23 en 9 verwijderingen
  1. 2 1
      src/components/baseEditer.vue
  2. 7 7
      src/components/edit/top_toolbar.vue
  3. 14 1
      src/components/mapClass/EditScence.ts

+ 2 - 1
src/components/baseEditer.vue

@@ -768,7 +768,8 @@ export default {
       });
       //粘贴操作
       bus.$on("stickmsg", () => {
-        this.scene.paste();
+        const text = sessionStorage.getItem("copyString");
+        this.scene.crossPagePaste(text);
       });
       //选中同类
       bus.$on("selectSimilar", () => {

+ 7 - 7
src/components/edit/top_toolbar.vue

@@ -3,8 +3,8 @@
     <!-- 顶部编辑器 -->
     <div class="tit">
       <a-icon style="cursor: pointer;" type="left" @click="goDrafts" />
-      {{this.urlMsg.floorName}}
-      <!-- <el-popover placement="bottom-start" width="300" trigger="click">
+      <!-- {{this.urlMsg.floorName}} -->
+      <el-popover placement="bottom-start" width="300" trigger="click">
         <div style="max-height:400px;overflow-y:auto;">
           <el-tree
             :data="treeData"
@@ -17,9 +17,9 @@
           {{this.urlMsg.floorName}}
           <i class="el-icon-caret-bottom"></i>
         </span>
-      </el-popover> -->
+      </el-popover>
       <div class="OpenEdit" style="width:400px;">
-        <!-- <i class="el-icon-back el-icon-back-two"></i>
+        <i class="el-icon-back el-icon-back-two"></i>
         <p v-bind:class="[isCopy!='true' ? 'iscopyTrue' : '']">此处可以快速切换图纸</p>
         <el-button
           size="medium"
@@ -27,7 +27,7 @@
           class="edit-btn"
           v-show="isCopy=='true'"
           @click="opEditStatus"
-        >启动编辑</el-button> -->
+        >启动编辑</el-button>
       </div>
     </div>
     <div class="top-right">
@@ -45,14 +45,14 @@
             <img class="lock" :src="require(`./../../assets/images/redo.png`)" alt />
             <span>重做</span>
           </li>
-          <!-- <li @click="copymsg">
+          <li @click="copymsg">
             <img class="lock" :src="require(`./../../assets/images/copy.png`)" alt />
             <span>复制</span>
           </li>
           <li @click="stickmsg">
             <img class="lock" :src="require(`./../../assets/images/past.png`)" alt />
             <span>粘贴</span>
-          </li> -->
+          </li>
           <li @click="selectSimilar">
             <img class="lock" :src="require(`./../../assets/images/selectSimilar.png`)" alt />
             <span>批量选中</span>

+ 14 - 1
src/components/mapClass/EditScence.ts

@@ -1212,6 +1212,7 @@ export class EditScence extends SGraphScene {
             const input = document.createElement('input');
             input.setAttribute('id', 'COPYINPUT')
             input.value = JSON.stringify(this.copyString)
+            sessionStorage.setItem("copyString", input.value);
             document.body.appendChild(input);
             input.select()
             document.execCommand('copy');
@@ -1240,6 +1241,7 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Nodes.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             // }
          // 加到node
@@ -1253,6 +1255,7 @@ export class EditScence extends SGraphScene {
             t.moveable = true;
             this.addItem(t)
             this.Nodes.push(t);
+            this.selectContainer.toggleItem(t);
             graphItemList.push(t)
         })
         parserData.imageMarkerList.forEach(t => {
@@ -1263,6 +1266,7 @@ export class EditScence extends SGraphScene {
             t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
+            this.selectContainer.toggleItem(t);
             graphItemList.push(t)
         })
         parserData.lineMarkerList.forEach(t => {
@@ -1273,6 +1277,7 @@ export class EditScence extends SGraphScene {
             t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
+            this.selectContainer.toggleItem(t);
             graphItemList.push(t)
         })
         parserData.textMarkerList.forEach(t => {
@@ -1283,6 +1288,7 @@ export class EditScence extends SGraphScene {
             t.moveable = true;
             this.addItem(t)
             this.Markers.push(t);
+            this.selectContainer.toggleItem(t);
             graphItemList.push(t)
         })
         parserData.relationList.forEach(t => {
@@ -1294,6 +1300,7 @@ export class EditScence extends SGraphScene {
             t.moveable = true;
             this.addItem(t)
             this.Relations.push(t);
+            this.selectContainer.toggleItem(t);
             graphItemList.push(t)
         })
         this.scenceUpdate(this);
@@ -1324,6 +1331,7 @@ export class EditScence extends SGraphScene {
                     t.moveable = true;
                     this.addItem(t)
                     this.Nodes.push(t);
+                    this.selectContainer.toggleItem(t);
                     graphItemList.push(t)
                 // }
              // 加到node
@@ -1337,6 +1345,7 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Nodes.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             })
             parserData.imageMarkerList.forEach(t => {
@@ -1347,6 +1356,7 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Markers.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             })
             parserData.lineMarkerList.forEach(t => {
@@ -1357,6 +1367,7 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Markers.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             })
             parserData.textMarkerList.forEach(t => {
@@ -1367,6 +1378,7 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Markers.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             })
             parserData.relationList.forEach(t => {
@@ -1378,11 +1390,12 @@ export class EditScence extends SGraphScene {
                 t.moveable = true;
                 this.addItem(t)
                 this.Relations.push(t);
+                this.selectContainer.toggleItem(t);
                 graphItemList.push(t)
             })
             this.scenceUpdate(this);
             if (graphItemList.length) {
-                this.AddListCommand(graphItemList)
+                this.AddListCommand(graphItemList)
             }
         } catch (e) {
             console.log(e);