Browse Source

[Fix][UI][V1.0.0-Beta] Replace the back-end interface for dependent task. (#9645)

* queryProjectCreatedAndAuthorizedByUser to queryAllProjectList
* queryAllByProjectCode to queryProcessDefinitionList
* getTasksByDefinitionCode to getTasksByDefinitionList
3.0.0/version-upgrade
Amy0104 3 years ago committed by GitHub
parent
commit
6966a70acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts
  2. 22
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts

15
dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts

@ -47,9 +47,9 @@ export function createProcessDefinition(
})
}
export function queryAllByProjectCode(code: number): any {
export function queryProcessDefinitionList(projectCode: number): any {
return axios({
url: `/projects/${code}/process-definition/all`,
url: `/projects/${projectCode}/process-definition/query-process-definition-list`,
method: 'get'
})
}
@ -186,13 +186,16 @@ export function release(
})
}
export function getTasksByDefinitionCode(
code: number,
export function getTasksByDefinitionList(
projectCode: number,
processCode: number
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/tasks`,
method: 'get'
url: `/projects/${projectCode}/process-definition/query-task-definition-list`,
method: 'get',
params: {
processDefinitionCode: processCode
}
})
}

22
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts

@ -18,10 +18,10 @@
import { ref, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRelationCustomParams, useDependentTimeout } from '.'
import { queryProjectCreatedAndAuthorizedByUser } from '@/service/modules/projects'
import { queryAllProjectList } from '@/service/modules/projects'
import {
queryAllByProjectCode,
getTasksByDefinitionCode
queryProcessDefinitionList,
getTasksByDefinitionList
} from '@/service/modules/process-definition'
import type { IJsonItem, IDependpendItem, IDependTask } from '../types'
@ -161,7 +161,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
}
const getProjectList = async () => {
const result = await queryProjectCreatedAndAuthorizedByUser()
const result = await queryAllProjectList()
projectList.value = result.map((item: { code: number; name: string }) => ({
value: item.code,
label: item.name
@ -172,13 +172,11 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
if (processCache[code]) {
return processCache[code]
}
const result = await queryAllByProjectCode(code)
const processList = result.map(
(item: { processDefinition: { code: number; name: string } }) => ({
value: item.processDefinition.code,
label: item.processDefinition.name
})
)
const result = await queryProcessDefinitionList(code)
const processList = result.map((item: { code: number; name: string }) => ({
value: item.code,
label: item.name
}))
processCache[code] = processList
return processList
@ -188,7 +186,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
if (taskCache[processCode]) {
return taskCache[processCode]
}
const result = await getTasksByDefinitionCode(code, processCode)
const result = await getTasksByDefinitionList(code, processCode)
const taskList = result.map((item: { code: number; name: string }) => ({
value: item.code,
label: item.name

Loading…
Cancel
Save