mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-03 12:48:46 +08:00
done (#15724)
This commit is contained in:
parent
e97f6a41ed
commit
832826ea52
@ -54,6 +54,7 @@ import {
|
||||
} from '@vicons/antd'
|
||||
import { IDefinitionData } from '../types'
|
||||
import styles from '../index.module.scss'
|
||||
import { queryProjectPreferenceByProjectCode } from '@/service/modules/projects-preference'
|
||||
|
||||
const props = {
|
||||
row: {
|
||||
@ -172,6 +173,75 @@ export default defineComponent({
|
||||
]
|
||||
}
|
||||
|
||||
const projectPreferences = ref({} as any)
|
||||
|
||||
const initProjectPreferences = async (projectCode: number) => {
|
||||
if (projectCode) {
|
||||
await queryProjectPreferenceByProjectCode(projectCode).then(
|
||||
(result: any) => {
|
||||
if (result?.preferences && result.state === 1) {
|
||||
projectPreferences.value = JSON.parse(result.preferences)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const containValueInOptions = (
|
||||
options: Array<any>,
|
||||
findingValue: string
|
||||
): boolean => {
|
||||
for (let { value } of options) {
|
||||
if (findingValue === value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const restructureForm = async (form: any) => {
|
||||
await initProjectPreferences(props.row.projectCode)
|
||||
if (projectPreferences.value?.taskPriority) {
|
||||
form.processInstancePriority = projectPreferences.value.taskPriority
|
||||
}
|
||||
if (projectPreferences.value?.warningType) {
|
||||
form.warningType = projectPreferences.value.warningType
|
||||
}
|
||||
if (projectPreferences.value?.workerGroup) {
|
||||
if (
|
||||
containValueInOptions(
|
||||
variables.workerGroups,
|
||||
projectPreferences.value.workerGroup
|
||||
)
|
||||
) {
|
||||
form.workerGroup = projectPreferences.value.workerGroup
|
||||
}
|
||||
}
|
||||
if (projectPreferences.value?.tenant) {
|
||||
if (
|
||||
containValueInOptions(
|
||||
variables.tenantList,
|
||||
projectPreferences.value.tenant
|
||||
)
|
||||
) {
|
||||
form.tenantCode = projectPreferences.value.tenant
|
||||
}
|
||||
}
|
||||
if (
|
||||
projectPreferences.value?.environmentCode &&
|
||||
variables?.environmentList
|
||||
) {
|
||||
if (
|
||||
containValueInOptions(
|
||||
variables.environmentList,
|
||||
projectPreferences.value.environmentCode
|
||||
)
|
||||
) {
|
||||
form.environmentCode = projectPreferences.value.environmentCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const updateWorkerGroup = () => {
|
||||
startState.startForm.environmentCode = null
|
||||
}
|
||||
@ -206,6 +276,7 @@ export default defineComponent({
|
||||
() => {
|
||||
if (props.show) {
|
||||
getStartParamsList(props.row.code)
|
||||
restructureForm(startState.startForm)
|
||||
if (props.taskCode)
|
||||
startState.startForm.startNodeList = props.taskCode
|
||||
}
|
||||
@ -438,8 +509,8 @@ export default defineComponent({
|
||||
</NFormItem>
|
||||
)}
|
||||
<NFormItem
|
||||
label={t('project.workflow.order_of_execution')}
|
||||
path='executionOrder'
|
||||
label={t('project.workflow.order_of_execution')}
|
||||
path='executionOrder'
|
||||
>
|
||||
<NRadioGroup v-model:value={this.startForm.executionOrder}>
|
||||
<NSpace>
|
||||
|
Loading…
Reference in New Issue
Block a user