diff --git a/core/core-frontend/src/components/visualization/OuterParamsSet.vue b/core/core-frontend/src/components/visualization/OuterParamsSet.vue index 439c146fab..a10a8ecbaa 100644 --- a/core/core-frontend/src/components/visualization/OuterParamsSet.vue +++ b/core/core-frontend/src/components/visualization/OuterParamsSet.vue @@ -50,7 +50,7 @@ style="width: 100%" v-model="data.paramName" :placeholder="$t('visualization.input_param_name')" - @blur="closeEdit" + @blur="closeEdit(data)" /> @@ -468,7 +468,18 @@ const viewSelectedField = computed(() => state.outerParamsInfo?.targetViewInfoList?.map(targetViewInfo => targetViewInfo.targetViewId) ) -const closeEdit = () => { +const closeEdit = params => { + if (!params.paramName || params.paramName.length < 2 || params.paramName.length > 25) { + ElMessage({ + message: t('commons.params_value') + t('common.input_limit', [2, 25]), + type: 'warning', + showClose: true + }) + if (params.paramName.length > 25) { + params.paramName = params.paramName.splice(0.25) + } + return + } curEditDataId.value = null }