未验证 提交 099bde0f 编写于 作者: A Amy0104 提交者: GitHub

[Fix][Next-UI] Add LIST type to the custom parameter types of task node. (#9468)

上级 04d4e4e0
......@@ -183,6 +183,10 @@ export const TYPE_LIST = [
{
value: 'BOOLEAN',
label: 'BOOLEAN'
},
{
value: 'LIST',
label: 'LIST'
}
]
......
......@@ -15,6 +15,7 @@
* limitations under the License.
*/
import { useI18n } from 'vue-i18n'
import { useCustomParams } from '.'
import type { IJsonItem } from '../types'
export function useEmr(model: { [field: string]: any }): IJsonItem[] {
......@@ -34,111 +35,6 @@ export function useEmr(model: { [field: string]: any }): IJsonItem[] {
message: t('project.node.emr_flow_define_json_tips')
}
},
{
type: 'custom-parameters',
field: 'localParams',
name: t('project.node.custom_parameters'),
children: [
{
type: 'input',
field: 'prop',
span: 6,
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.localParams.filter(
(item: { prop: string }) => item.prop === value
)
if (sameItems.length > 1) {
return new Error(t('project.node.prop_repeat'))
}
}
}
},
{
type: 'select',
field: 'direct',
span: 4,
options: DIRECT_LIST,
value: 'IN'
},
{
type: 'select',
field: 'type',
span: 6,
options: TYPE_LIST,
value: 'VARCHAR'
},
{
type: 'input',
field: 'value',
span: 6,
props: {
placeholder: t('project.node.value_tips'),
maxLength: 256
}
}
]
}
...useCustomParams({ model, field: 'localParams', isSimple: false })
]
}
export const TYPE_LIST = [
{
value: 'VARCHAR',
label: 'VARCHAR'
},
{
value: 'INTEGER',
label: 'INTEGER'
},
{
value: 'LONG',
label: 'LONG'
},
{
value: 'FLOAT',
label: 'FLOAT'
},
{
value: 'DOUBLE',
label: 'DOUBLE'
},
{
value: 'DATE',
label: 'DATE'
},
{
value: 'TIME',
label: 'TIME'
},
{
value: 'TIMESTAMP',
label: 'TIMESTAMP'
},
{
value: 'BOOLEAN',
label: 'BOOLEAN'
}
]
export const DIRECT_LIST = [
{
value: 'IN',
label: 'IN'
},
{
value: 'OUT',
label: 'OUT'
}
]
......@@ -15,6 +15,7 @@
* limitations under the License.
*/
import { useI18n } from 'vue-i18n'
import { useCustomParams } from '.'
import type { IJsonItem } from '../types'
export function useProcedure(model: { [field: string]: any }): IJsonItem[] {
......@@ -38,111 +39,6 @@ export function useProcedure(model: { [field: string]: any }): IJsonItem[] {
message: t('project.node.procedure_method_tips')
}
},
{
type: 'custom-parameters',
field: 'localParams',
name: t('project.node.custom_parameters'),
children: [
{
type: 'input',
field: 'prop',
span: 6,
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.localParams.filter(
(item: { prop: string }) => item.prop === value
)
if (sameItems.length > 1) {
return new Error(t('project.node.prop_repeat'))
}
}
}
},
{
type: 'select',
field: 'direct',
span: 4,
options: DIRECT_LIST,
value: 'IN'
},
{
type: 'select',
field: 'type',
span: 6,
options: TYPE_LIST,
value: 'VARCHAR'
},
{
type: 'input',
field: 'value',
span: 6,
props: {
placeholder: t('project.node.value_tips'),
maxLength: 256
}
}
]
}
...useCustomParams({ model, field: 'localParams', isSimple: false })
]
}
export const TYPE_LIST = [
{
value: 'VARCHAR',
label: 'VARCHAR'
},
{
value: 'INTEGER',
label: 'INTEGER'
},
{
value: 'LONG',
label: 'LONG'
},
{
value: 'FLOAT',
label: 'FLOAT'
},
{
value: 'DOUBLE',
label: 'DOUBLE'
},
{
value: 'DATE',
label: 'DATE'
},
{
value: 'TIME',
label: 'TIME'
},
{
value: 'TIMESTAMP',
label: 'TIMESTAMP'
},
{
value: 'BOOLEAN',
label: 'BOOLEAN'
}
]
export const DIRECT_LIST = [
{
value: 'IN',
label: 'IN'
},
{
value: 'OUT',
label: 'OUT'
}
]
......@@ -115,7 +115,7 @@ export default defineComponent({
validator() {
const props = new Set()
const keys = formValue.value.globalParams.map(item => item.key)
const keys = formValue.value.globalParams.map((item) => item.key)
const keysSet = new Set(keys)
if (keysSet.size !== keys.length) {
return new Error(t('project.dag.prop_repeat'))
......
......@@ -481,7 +481,9 @@ export default defineComponent({
type='info'
secondary
round
disabled={props.definition?.processDefinition?.releaseState === 'ONLINE'}
disabled={
props.definition?.processDefinition?.releaseState === 'ONLINE'
}
onClick={() => {
context.emit('saveModelToggle', true)
}}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册