Browse Source

'确认切换弹窗优化'

zhangyu 4 years ago
parent
commit
625234234d
2 changed files with 24 additions and 18 deletions
  1. 2 16
      src/components/edit/top_toolbar.vue
  2. 22 2
      src/views/editer.vue

+ 2 - 16
src/components/edit/top_toolbar.vue

@@ -151,18 +151,6 @@
         <span>发布</span>
         <span>发布</span>
       </div>
       </div>
     </div>
     </div>
-    <el-dialog
-      title="操作提示"
-      :visible.sync="dialogVisible"
-      width="600px">
-      <div>您打开的是已发布的平面图,您可以进行如下操作:</div>
-      <p>1、直接选择平面图中的元素进行复制,然后贴到其他平面图;</p>
-      <p>2、点击“启动编辑”对当前平面图进行编辑;</p>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="handleOpenUrl">打 开</el-button>
-      </span>
-    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -268,8 +256,7 @@
                   children: 'Children',
                   children: 'Children',
                   label: 'Name'
                   label: 'Name'
                 },
                 },
-                treeQuery: "",
-                dialogVisible: false
+                treeQuery: ""
             };
             };
         },
         },
         methods: {
         methods: {
@@ -288,7 +275,7 @@
                         window.open(url, "_self");
                         window.open(url, "_self");
                     } else if (data.Type == "HasPub") {
                     } else if (data.Type == "HasPub") {
                         this.treeQuery = query;
                         this.treeQuery = query;
-                        this.dialogVisible = true;
+                        this.$emit("openConfirmDialog");
                     }
                     }
                 }
                 }
             },
             },
@@ -297,7 +284,6 @@
                 const query = `${this.treeQuery}&isCopy=true`;
                 const query = `${this.treeQuery}&isCopy=true`;
                 const url = window.location.origin + "/wandaEditer/editer?" + encodeURIComponent(query);
                 const url = window.location.origin + "/wandaEditer/editer?" + encodeURIComponent(query);
                 window.open(url, "_self");
                 window.open(url, "_self");
-                this.dialogVisible = false;
             },
             },
             /**
             /**
              * @name getInitScale
              * @name getInitScale

+ 22 - 2
src/views/editer.vue

@@ -2,7 +2,7 @@
   <div class="wandaEditer">
   <div class="wandaEditer">
     <!-- 顶部工具栏 -->
     <!-- 顶部工具栏 -->
     <div class="top_toolbar">
     <div class="top_toolbar">
-      <topToolbar></topToolbar>
+      <topToolbar ref="topToolbar" @openConfirmDialog="dialogVisible = true"></topToolbar>
     </div>
     </div>
     <div class="content">
     <div class="content">
       <!-- 左侧工具栏 -->
       <!-- 左侧工具栏 -->
@@ -25,6 +25,18 @@
         <rightToolbar :focusItemList="focusItemList"></rightToolbar>
         <rightToolbar :focusItemList="focusItemList"></rightToolbar>
       </div>
       </div>
     </div>
     </div>
+    <el-dialog
+      title="操作提示"
+      :visible.sync="dialogVisible"
+      width="600px">
+      <div style="margin-bottom: 15px;">您打开的是已发布的平面图,您可以进行如下操作:</div>
+      <p>1、直接选择平面图中的元素进行复制,然后贴到其他平面图;</p>
+      <p>2、点击“启动编辑”对当前平面图进行编辑;</p>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="small" type="primary" @click="handleOpenUrl">打 开</el-button>
+      </span>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -39,7 +51,8 @@ export default {
   data() {
   data() {
     return {
     return {
       cmdType: "choice",
       cmdType: "choice",
-      focusItemList: null
+      focusItemList: null,
+      dialogVisible: false
     };
     };
   },
   },
   components: {
   components: {
@@ -59,6 +72,10 @@ export default {
     },
     },
     changeFocusItem(item) {
     changeFocusItem(item) {
       this.focusItemList = item;
       this.focusItemList = item;
+    },
+    handleOpenUrl() {
+      this.$refs.topToolbar.handleOpenUrl();
+      this.dialogVisible = false;
     }
     }
   }
   }
 };
 };
@@ -96,4 +113,7 @@ export default {
     }
     }
   }
   }
 }
 }
+/deep/ .el-dialog__body {
+  padding: 10px 20px;
+}
 </style>
 </style>