diff --git a/core/core-frontend/src/components/visualization/OuterParamsSet.vue b/core/core-frontend/src/components/visualization/OuterParamsSet.vue index 5a76a3a111..8e7ceecbe8 100644 --- a/core/core-frontend/src/components/visualization/OuterParamsSet.vue +++ b/core/core-frontend/src/components/visualization/OuterParamsSet.vue @@ -258,10 +258,20 @@ 默认值 + + + + 请使用JSON数组格式 示例: 单值 ["name1"], 多值 ["name1","name2"] + + + + + + { state.outerParamsSetVisible = false } +const jsonArrayCheck = params => { + try { + const result = JSON.parse(params) + return result instanceof Array + } catch (error) { + return false + } +} + const save = () => { const outerParamsCopy = deepCopy(state.outerParams) + let checkErrorNum = 0 + let checkMessage = '' outerParamsCopy.outerParamsInfoArray?.forEach(outerParamsInfo => { + if (outerParamsInfo.defaultValue && !jsonArrayCheck(outerParamsInfo.defaultValue)) { + checkErrorNum++ + checkMessage = checkMessage + `【${outerParamsInfo.paramName}】` + } outerParamsInfo.targetViewInfoList = [] outerParamsInfo.filterInfo?.forEach(baseFilterInfo => { // 存在过滤器选项被选 @@ -601,6 +628,14 @@ const save = () => { } }) }) + if (checkErrorNum > 0) { + ElMessage({ + message: `参数${checkMessage}默认值格式不正确!`, + type: 'warning', + showClose: true + }) + return + } updateOuterParamsSet(outerParamsCopy).then(() => { ElMessage({ message: t('commons.save_success'), @@ -1075,4 +1110,11 @@ defineExpose({ margin-bottom: 12px; margin-right: -80px; } + +.hint-icon { + cursor: pointer; + font-size: 14px; + color: #646a73; + margin: 10px 0 0 4px; +}