22 <div className =" workflow-app" id =" container" ></div >
33 <!-- 辅助工具栏 -->
44 <Control class =" workflow-control" v-if =" lf" :lf =" lf" ></Control >
5- <TeleportContainer :flow-id =" flowId" />
5+ <TeleportContainer :flow-id =" flowId" />
66 <NodeSearch :lf =" lf" ref =" nodeSearchRef" ></NodeSearch >
77</template >
88<script setup lang="ts">
99import LogicFlow from ' @logicflow/core'
10- import { ref , onMounted , onUnmounted , inject , nextTick } from ' vue'
10+ import {ref , onMounted , onUnmounted , inject , nextTick } from ' vue'
1111import AppEdge from ' ./common/edge'
1212import loopEdge from ' ./common/loopEdge'
1313import Control from ' ./common/NodeControl.vue'
14- import { SelectionSelect } from ' @logicflow/extension'
14+ import {SelectionSelect } from ' @logicflow/extension'
1515import ' @logicflow/extension/lib/style/index.css'
1616import ' @logicflow/core/dist/style/index.css'
17- import { initDefaultShortcut } from ' @/workflow/common/shortcut'
17+ import {initDefaultShortcut } from ' @/workflow/common/shortcut'
1818import Dagre from ' @/workflow/plugins/dagre'
19- import { disconnectAll , getTeleport } from ' @/workflow/common/teleport'
20- import { WorkflowMode } from ' @/enums/application'
19+ import {disconnectAll , getTeleport } from ' @/workflow/common/teleport'
20+ import {WorkflowMode } from ' @/enums/application'
2121
2222import NodeSearch from ' @/workflow/common/NodeSearch.vue'
23- const nodes: any = import .meta .glob (' ./nodes/**/index.ts' , { eager: true })
23+
24+ const nodes: any = import .meta .glob (' ./nodes/**/index.ts' , {eager: true })
2425const workflow_mode = inject (' workflowMode' ) || WorkflowMode .Application
2526const loop_workflow_mode = inject (' loopWorkflowMode' ) || WorkflowMode .ApplicationLoop
2627const nodeSearchRef = ref <InstanceType <typeof NodeSearch >>()
27- defineOptions ({ name: ' WorkFlow' })
28+ defineOptions ({name: ' WorkFlow' })
2829const TeleportContainer = getTeleport ()
2930const flowId = ref (' ' )
3031type ShapeItem = {
@@ -149,7 +150,7 @@ const onmousedown = (shapeItem: ShapeItem) => {
149150 if (shapeItem .type ) {
150151 lf .value .dnd .startDrag ({
151152 type: shapeItem .type ,
152- properties: { ... shapeItem .properties },
153+ properties: {... shapeItem .properties },
153154 })
154155 }
155156
@@ -159,7 +160,7 @@ const onmousedown = (shapeItem: ShapeItem) => {
159160}
160161const addNode = (shapeItem : ShapeItem ) => {
161162 lf .value .clearSelectElements ()
162- const { virtualRectCenterPositionX, virtualRectCenterPositionY } =
163+ const {virtualRectCenterPositionX, virtualRectCenterPositionY} =
163164 lf .value .graphModel .getVirtualRectSize ()
164165 const newNode = lf .value .graphModel .addNode ({
165166 type: shapeItem .type ,
@@ -198,13 +199,31 @@ defineExpose({
198199 height : 100% ;
199200 position : relative ;
200201}
202+
201203.workflow-control {
202204 position : absolute ;
203205 bottom : 24px ;
204206 left : 24px ;
205207 z-index : 2 ;
206208}
209+
207210.lf-drag-able {
208211 cursor : pointer ;
209212}
213+
214+ /* 全局样式,用于覆盖 teleport 到 body 的 tooltip 弹层背景 */
215+ .white-tooltip ,
216+ .white-tooltip .el-popper ,
217+ .white-tooltip .el-tooltip__popper {
218+ background : #ffffff !important ;
219+ color : #222 !important ;
220+ border : 1px solid #e6e6e6 !important ;
221+ box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.06 ) !important ;
222+ padding : 8px 12px !important ;
223+ }
224+
225+ .white-tooltip .el-popper__arrow ::before {
226+ background : #ffffff !important ;
227+ border : 1px solid #e6e6e6 !important ;
228+ }
210229 </style >
0 commit comments