zhangyu 4 rokov pred
rodič
commit
122bd5210b

BIN
src/assets/images/copy.png


BIN
src/assets/images/past.png


+ 8 - 0
src/components/baseEditer.vue

@@ -724,6 +724,14 @@ export default {
       // 更改item样式
       bus.$on('changeLengendItem',item=>{
         this.scene.changeLengendItem(item)
+      }),
+      //复制操作
+      bus.$on('copymsg',()=>{
+        this.scene.copy()
+      })
+      //粘贴操作
+      bus.$on('stickmsg',()=>{
+          this.scene.paste()
       })
     },
     // 获取图最大最小值

+ 66 - 41
src/components/edit/top_toolbar.vue

@@ -30,6 +30,14 @@
           <img class="lock" :src="require(`./../../assets/images/redo.png`)" alt />
           <span>重做</span>
         </li>
+        <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 class="zoom-window">
           <div>
             <img
@@ -58,8 +66,17 @@
               <a-icon type="caret-down" class="down-icon" />
             </div>
             <a-menu slot="overlay">
-              <a-menu-item :disabled='item.disable' v-for="item in orderOptions" :key="item.value" @click="changeOrderItem(item.value)">
-                <img style="width: 16px;margin-right: 5px;" :src="require(`./../../assets/images/`+item.img+`.png`)" alt />
+              <a-menu-item
+                :disabled="item.disable"
+                v-for="item in orderOptions"
+                :key="item.value"
+                @click="changeOrderItem(item.value)"
+              >
+                <img
+                  style="width: 16px;margin-right: 5px;"
+                  :src="require(`./../../assets/images/`+item.img+`.png`)"
+                  alt
+                />
                 <span>{{item.label}}</span>
               </a-menu-item>
             </a-menu>
@@ -104,19 +121,24 @@
           <span>打散</span>
         </li>-->
         <li @click="lockItem">
-          <Icon color="#646A73" :name="isLock?'lock':'unlock'"/>
+          <Icon color="#646A73" :name="isLock?'lock':'unlock'" />
           <span>{{!isLock?"解锁":"锁定"}}</span>
         </li>
         <li @click="deleteItem">
-          <img class="lock" :src="require(`./../../assets/images/delete.png`)" alt/>
+          <img class="lock" :src="require(`./../../assets/images/delete.png`)" alt />
           <span>删除</span>
         </li>
         <li @click="showDrawer" style="border-left: 1px solid #8d9399;">
-          <el-popover placement="top" trigger="click" width="900" popper-class="reset-popover"
-                      style=" margin-top: -4px;display: inline-block;">
-              <img style="width: 100%;" :src="require(`./../../assets/images/help_tips.png`)" alt/>
+          <el-popover
+            placement="top"
+            trigger="click"
+            width="900"
+            popper-class="reset-popover"
+            style=" margin-top: -4px;display: inline-block;"
+          >
+            <img style="width: 100%;" :src="require(`./../../assets/images/help_tips.png`)" alt />
             <span slot="reference">
-              <img class="lock" :src="require(`./../../assets/images/help.png`)" alt/>
+              <img class="lock" :src="require(`./../../assets/images/help.png`)" alt />
               <div>操作提示</div>
             </span>
           </el-popover>
@@ -148,10 +170,10 @@
 <script>
     import bus from "@/bus";
     import bus2 from "@/bus2";
-    import {SGraphLayoutType, SOrderSetType} from "@saga-web/graph/lib";
-    import {queryFullFloor} from "@/api/editer";
+    import { SGraphLayoutType, SOrderSetType } from "@saga-web/graph/lib";
+    import { queryFullFloor } from "@/api/editer";
     import systym from "./codeMapSystem.js";
-    import {MessageBox} from "element-ui";
+    import { MessageBox } from "element-ui";
 
     export default {
         data() {
@@ -252,16 +274,6 @@
                 dialogVisible: false
             };
         },
-        computed: {
-            // 缩放比例显示文本
-            scalePercent() {
-                const scalePercent =
-                    (this.scale * 100).toFixed(0) > 500
-                        ? 500
-                        : (this.scale * 100).toFixed(0);
-                return scalePercent + "%";
-            }
-        },
         methods: {
             getFullFloor() {
                 queryFullFloor({projectId: this.urlMsg.projectId}).then(res => {
@@ -391,6 +403,13 @@
                 // this.$message.success("保存成功!", 1);
                 bus.$emit("saveMsgItem");
             },
+            // 复制信息
+            copymsg(){
+              bus.$emit("copymsg");
+            },
+            stickmsg(){
+              bus.$emit("stickmsg");
+            },
             // 删除item
             deleteItem() {
                 bus.$emit("deleiteItem");
@@ -460,16 +479,6 @@
                 bus.$emit("changeRedo");
             },
         },
-        async mounted() {
-            bus2.$off('FocusItemChanged')
-            bus2.$on("FocusItemChanged", itemMsg => {
-                this.FocusItemChanged(itemMsg);
-            });
-            // 获取底图加载完成后的初始sacle
-            await this.getInitScale();
-            // 监听滚轮 底图缩放比例
-            this.getMouseScale();
-        },
         created() {
             const href = window.location.href;
             // 路由
@@ -493,8 +502,28 @@
             const FloorName = this.urlMsg.FloorName ? this.urlMsg.FloorName : "";
             this.urlMsg.floorName = systym[this.urlMsg.categoryId] + "-" + FloorName;
             this.getFullFloor();
-        }
-    };
+        },
+        computed: {
+          // 缩放比例显示文本
+          scalePercent() {
+            const scalePercent =
+              (this.scale * 100).toFixed(0) > 500
+                ? 500
+                : (this.scale * 100).toFixed(0);
+            return scalePercent + "%";
+          }
+        },
+        async mounted() {
+          bus2.$off("FocusItemChanged");
+          bus2.$on("FocusItemChanged", itemMsg => {
+            this.FocusItemChanged(itemMsg);
+          });
+          // 获取底图加载完成后的初始sacle
+          await this.getInitScale();
+          // 监听滚轮 底图缩放比例
+          this.getMouseScale();
+        },
+};
 </script>
 <style lang="less" scoped>
 ul,
@@ -584,21 +613,17 @@ li {
     background: #f5f6f7;
     border-radius: 2px;
   }
-
-
 }
 
 /deep/ .ant-dropdown-menu-item {
   display: flex;
   align-items: center;
 }
-
 </style>
 
 <style>
-  .reset-popover {
-    max-height: 570px;
-    overflow: auto;
-
-  }
+.reset-popover {
+  max-height: 570px;
+  overflow: auto;
+}
 </style>