Jelajahi Sumber

流程图导出截图去掉操作栏

dengyu 4 bulan lalu
induk
melakukan
318b5f7d8a
1 mengubah file dengan 13 tambahan dan 4 penghapusan
  1. 13 4
      src/views/base/craftManagement/route/bindProcess.vue

+ 13 - 4
src/views/base/craftManagement/route/bindProcess.vue

@@ -75,7 +75,7 @@
             @node-drag-stop="nodeDragStop"
             @node-drag-start="nodeDragStart"
           >
-            <MiniMap style="background-color: grey" />
+            <MiniMap style="background-color: grey" v-show="!printStauts" />
             <template #edge-custom="props">
               <CustomConnectionLine v-bind="props" />
             </template>
@@ -94,7 +94,11 @@
               <p v-if="isDragOver">拖拽中</p>
             </DropzoneBackground>
 
-            <Panel class="process-panel" position="top-right">
+            <Panel
+              class="process-panel"
+              position="top-right"
+              v-show="!printStauts"
+            >
               <div class="layout-panel">
                 <button title="蛇形排列" @click="convertToSnakeLayout">
                   <PannelIcon name="liucheng" />
@@ -386,13 +390,18 @@ const handleKeydown = () => {
     selectLine.value = null;
   }
 };
-
-const getPng = () => {
+const printStauts = ref(false);
+const getPng = async () => {
   if (!vueFlowRef.value) {
     console.warn("VueFlow element not found");
     return;
   }
+  printStauts.value = true;
+  await nextTick();
   capture(vueFlowRef.value, { shouldDownload: true });
+  setTimeout(() => {
+    printStauts.value = false;
+  }, 0);
 };
 const nodeType = ref("custom");
 const editStatus = ref(false);