Browse Source

[Fix][UI Next][V1.0.0-Alpha] Fix the connection line center bug for workflow dag (#9272)

* fix the connection line center bug for workflow dag

* delete unnecessary code
3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
11d9859c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-config.ts
  2. 7
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts

4
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-config.ts

@ -187,9 +187,7 @@ export const NODE = {
}, },
fo: { fo: {
refX: '46%', refX: '46%',
refY: -25, refY: -25
width: 18,
height: 18
} }
}, },
ports: { ports: {

7
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { Node } from '@antv/x6' import type { Markup, Node } from '@antv/x6'
import { ref, onMounted, Ref } from 'vue' import { ref, onMounted, Ref } from 'vue'
import { Graph } from '@antv/x6' import { Graph } from '@antv/x6'
import { NODE, EDGE, X6_NODE_NAME, X6_EDGE_NAME } from './dag-config' import { NODE, EDGE, X6_NODE_NAME, X6_EDGE_NAME } from './dag-config'
@ -156,6 +156,9 @@ export function useCanvasInit(options: Options) {
// Add a node tool when the mouse entering // Add a node tool when the mouse entering
graph.value.on('node:mouseenter', ({ node }) => { graph.value.on('node:mouseenter', ({ node }) => {
const nodeName = node.getData().taskName const nodeName = node.getData().taskName
const markup = node.getMarkup() as Markup.JSONMarkup[]
const fo = markup.filter((m) => m.tagName === 'foreignObject')[0]
node.addTools({ node.addTools({
name: 'button', name: 'button',
args: { args: {
@ -172,7 +175,7 @@ export function useCanvasInit(options: Options) {
], ],
x: 0, x: 0,
y: 0, y: 0,
offset: { x: 0, y: -10 } offset: { x: 0, y: fo ? -28 : -10 }
} }
}) })
}) })

Loading…
Cancel
Save