Browse Source

[Feature][UI Next] Support readonly model for dag

3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
b92f6d876d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx
  2. 5
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
  3. 20
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx

1
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/index.tsx

@ -219,6 +219,7 @@ export default defineComponent({
definition={props.definition}
/>
<TaskModal
readonly={props.readonly}
show={taskModalVisible.value}
projectCode={props.projectCode}
data={currTask.value as any}

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

@ -37,10 +37,11 @@ interface Options {
*/
export function useTaskEdit(options: Options) {
const { graph, definition } = options
const { addNode, setNodeName } = useCellUpdate({ graph })
const taskDefinitions = ref<NodeData[]>([])
const taskDefinitions = ref<NodeData[]>(
definition.value?.taskDefinitionList || []
)
const currTask = ref<NodeData>({
taskType: 'SHELL',
code: 0,

20
dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx

@ -53,10 +53,15 @@ export default defineComponent({
const code = Number(route.params.code)
const definition = ref<WorkflowDefinition>()
const readonly = ref(false)
const isLoading = ref(true)
const refresh = () => {
isLoading.value = true
queryProcessDefinitionByCode(code, projectCode).then((res: any) => {
readonly.value = res.processDefinition.releaseState === 'ONLINE'
definition.value = res
isLoading.value = false
})
}
@ -107,12 +112,15 @@ export default defineComponent({
theme.darkTheme ? Styles['dark'] : Styles['light']
]}
>
<Dag
definition={definition.value}
onRefresh={refresh}
projectCode={projectCode}
onSave={save}
/>
{!isLoading.value && (
<Dag
definition={definition.value}
onRefresh={refresh}
projectCode={projectCode}
onSave={save}
readonly={readonly.value}
/>
)}
</div>
)
}

Loading…
Cancel
Save