mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: [Application] User input component types support multi line text boxes, single line tabs, and single line multi select card components (#4566)
This commit is contained in:
parent
c0f63e9e3d
commit
c362b4ed4e
|
|
@ -1,10 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="
|
:title="isEdit ? $t('common.param.editParam') : $t('common.param.addParam')"
|
||||||
isEdit
|
|
||||||
? $t('common.param.editParam')
|
|
||||||
: $t('common.param.addParam')
|
|
||||||
"
|
|
||||||
v-model="dialogVisible"
|
v-model="dialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
|
|
@ -59,13 +55,13 @@ const currentRow = computed(() => {
|
||||||
input_type: 'TextInput',
|
input_type: 'TextInput',
|
||||||
label: row.label || row.name,
|
label: row.label || row.name,
|
||||||
default_value: row.default_value,
|
default_value: row.default_value,
|
||||||
required: row.required != undefined ? row.required : row.is_required
|
required: row.required != undefined ? row.required : row.is_required,
|
||||||
}
|
}
|
||||||
case 'select':
|
case 'select':
|
||||||
if (
|
if (
|
||||||
check_field(
|
check_field(
|
||||||
['field', 'input_type', 'label', 'required', 'option_list'],
|
['field', 'input_type', 'label', 'required', 'option_list'],
|
||||||
currentItem.value
|
currentItem.value,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return currentItem.value
|
return currentItem.value
|
||||||
|
|
@ -81,7 +77,7 @@ const currentRow = computed(() => {
|
||||||
? row.option_list
|
? row.option_list
|
||||||
: row.optionList.map((o: any) => {
|
: row.optionList.map((o: any) => {
|
||||||
return { key: o, value: o }
|
return { key: o, value: o }
|
||||||
})
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'date':
|
case 'date':
|
||||||
|
|
@ -94,9 +90,9 @@ const currentRow = computed(() => {
|
||||||
'required',
|
'required',
|
||||||
'attrs.format',
|
'attrs.format',
|
||||||
'attrs.value-format',
|
'attrs.value-format',
|
||||||
'attrs.type'
|
'attrs.type',
|
||||||
],
|
],
|
||||||
currentItem.value
|
currentItem.value,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return currentItem.value
|
return currentItem.value
|
||||||
|
|
@ -110,14 +106,19 @@ const currentRow = computed(() => {
|
||||||
attrs: {
|
attrs: {
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
'value-format': 'YYYY-MM-DD HH:mm:ss',
|
'value-format': 'YYYY-MM-DD HH:mm:ss',
|
||||||
type: 'datetime'
|
type: 'datetime',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return currentItem.value
|
return currentItem.value
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return { input_type: 'TextInput', required: false, attrs: { maxlength: 200, minlength: 0 }, show_default_value: true }
|
return {
|
||||||
|
input_type: 'TextInput',
|
||||||
|
required: false,
|
||||||
|
attrs: { maxlength: 200, minlength: 0 },
|
||||||
|
show_default_value: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const currentIndex = ref(null)
|
const currentIndex = ref(null)
|
||||||
|
|
@ -129,6 +130,9 @@ const inputTypeList = ref([
|
||||||
{ label: t('dynamicsForm.input_type_list.RadioCard'), value: 'RadioCardConstructor' },
|
{ label: t('dynamicsForm.input_type_list.RadioCard'), value: 'RadioCardConstructor' },
|
||||||
{ label: t('dynamicsForm.input_type_list.DatePicker'), value: 'DatePickerConstructor' },
|
{ label: t('dynamicsForm.input_type_list.DatePicker'), value: 'DatePickerConstructor' },
|
||||||
{ label: t('dynamicsForm.input_type_list.SwitchInput'), value: 'SwitchInputConstructor' },
|
{ label: t('dynamicsForm.input_type_list.SwitchInput'), value: 'SwitchInputConstructor' },
|
||||||
|
{ label: t('dynamicsForm.input_type_list.RadioRow'), value: 'RadioRowConstructor' },
|
||||||
|
{ label: t('dynamicsForm.input_type_list.TextareaInput'), value: 'TextareaInputConstructor' },
|
||||||
|
{ label: t('dynamicsForm.input_type_list.MultiRow'), value: 'MultiRowConstructor' },
|
||||||
])
|
])
|
||||||
|
|
||||||
const dialogVisible = ref<boolean>(false)
|
const dialogVisible = ref<boolean>(false)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue