Browse Source

[Improvement][UI] Unified local parameters UI (#11190)

3.1.0-release
Chris Ho 2 years ago committed by GitHub
parent
commit
d85ea8f62f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 62
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-custom-params.ts

62
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-custom-params.ts

@ -33,56 +33,6 @@ export function useCustomParams({
}): IJsonItem[] {
const { t } = useI18n()
if (isSimple) {
return [
{
type: 'custom-parameters',
field: field,
name: t(`project.node.${name}`),
class: 'btn-custom-parameters',
span,
children: [
{
type: 'input',
field: 'prop',
span: 10,
class: 'input-param-key',
props: {
placeholder: t('project.node.prop_tips'),
maxLength: 256
},
validate: {
trigger: ['input', 'blur'],
required: true,
validator(validate: any, value: string) {
if (!value) {
return new Error(t('project.node.prop_tips'))
}
const sameItems = model[field].filter(
(item: { prop: string }) => item.prop === value
)
if (sameItems.length > 1) {
return new Error(t('project.node.prop_repeat'))
}
}
}
},
{
type: 'input',
field: 'value',
span: 10,
class: 'input-param-value',
props: {
placeholder: t('project.node.value_tips'),
maxLength: 256
}
}
]
}
]
} else {
return [
{
type: 'custom-parameters',
@ -123,14 +73,20 @@ export function useCustomParams({
field: 'direct',
span: 4,
options: DIRECT_LIST,
value: 'IN'
value: 'IN',
props: {
disabled: isSimple
}
},
{
type: 'select',
field: 'type',
span: 6,
options: TYPE_LIST,
value: 'VARCHAR'
value: 'VARCHAR',
props: {
disabled: isSimple
}
},
{
type: 'input',
@ -145,8 +101,8 @@ export function useCustomParams({
]
}
]
}
}
export const TYPE_LIST = [
{
value: 'VARCHAR',

Loading…
Cancel
Save