Browse Source

[Feature][UI Next] Add style for dag runflag

3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
33b50bab72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-context-menu.tsx
  2. 3
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-cell-update.ts
  3. 21
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
  4. 3
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts

3
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-context-menu.tsx

@ -85,10 +85,11 @@ export default defineComponent({
const type = props.cell?.data.taskType const type = props.cell?.data.taskType
const taskName = uuid(props.cell?.data.taskName + '_') const taskName = uuid(props.cell?.data.taskName + '_')
const targetCode = Number(props.cell?.id) const targetCode = Number(props.cell?.id)
const flag = props.cell?.data.flag
genTaskCodeList(genNums, projectCode).then((res) => { genTaskCodeList(genNums, projectCode).then((res) => {
const [code] = res const [code] = res
ctx.emit('copyTask', taskName, code, targetCode, type, { ctx.emit('copyTask', taskName, code, targetCode, type, flag, {
x: props.left + 100, x: props.left + 100,
y: props.top + 100 y: props.top + 100
}) })

3
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-cell-update.ts

@ -60,13 +60,14 @@ export function useCellUpdate(options: Options) {
id: string, id: string,
type: string, type: string,
name: string, name: string,
flag: string,
coordinate: Coordinate = { x: 100, y: 100 } coordinate: Coordinate = { x: 100, y: 100 }
) { ) {
if (!TASK_TYPES_MAP[type as TaskType]) { if (!TASK_TYPES_MAP[type as TaskType]) {
console.warn(`taskType:${type} is invalid!`) console.warn(`taskType:${type} is invalid!`)
return return
} }
const node = buildNode(id, type, name, coordinate) const node = buildNode(id, type, name, flag, coordinate)
graph.value?.addNode(node) graph.value?.addNode(node)
} }

21
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts

@ -68,6 +68,7 @@ export function useCustomCellBuilder() {
id: string, id: string,
type: string, type: string,
taskName: string, taskName: string,
flag: string,
coordinate: Coordinate = { x: 100, y: 100 } coordinate: Coordinate = { x: 100, y: 100 }
): Node.Metadata { ): Node.Metadata {
const truncation = taskName ? utils.truncateText(taskName, 18) : id const truncation = taskName ? utils.truncateText(taskName, 18) : id
@ -78,7 +79,8 @@ export function useCustomCellBuilder() {
y: coordinate.y, y: coordinate.y,
data: { data: {
taskType: type, taskType: type,
taskName: taskName || id taskName: taskName || id,
flag: flag
}, },
attrs: { attrs: {
image: { image: {
@ -87,6 +89,9 @@ export function useCustomCellBuilder() {
}, },
title: { title: {
text: truncation text: truncation
},
rect: {
fill: flag === 'NO' ? '#f3f3f5' : '#ffffff'
} }
} }
} }
@ -108,10 +113,16 @@ export function useCustomCellBuilder() {
tasks.forEach((task) => { tasks.forEach((task) => {
const location = locations.find((l) => l.taskCode === task.code) || {} const location = locations.find((l) => l.taskCode === task.code) || {}
const node = buildNode(task.code + '', task.taskType, task.name, { const node = buildNode(
x: location.x, task.code + '',
y: location.y task.taskType,
}) task.name,
task.flag,
{
x: location.x,
y: location.y
}
)
nodes.push(node) nodes.push(node)
}) })

3
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts

@ -70,9 +70,10 @@ export function useTaskEdit(options: Options) {
code: number, code: number,
targetCode: number, targetCode: number,
type: TaskType, type: TaskType,
flag: string,
coordinate: Coordinate coordinate: Coordinate
) { ) {
addNode(code + '', type, name, coordinate) addNode(code + '', type, name, flag, coordinate)
const definition = taskDefinitions.value.find((t) => t.code === targetCode) const definition = taskDefinitions.value.find((t) => t.code === targetCode)
const newDefinition = { const newDefinition = {

Loading…
Cancel
Save