mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 13:58:26 +08:00
refactor(数据大屏、仪表板): 外部参数名称禁止重复或未配置,修改跳转条件匹配外部参数问题
This commit is contained in:
@@ -596,8 +596,14 @@ const jsonArrayCheck = params => {
|
||||
const save = () => {
|
||||
const outerParamsCopy = deepCopy(state.outerParams)
|
||||
let checkErrorNum = 0
|
||||
let checkNullErrorNum = 0
|
||||
let checkMessage = ''
|
||||
const paramNameArray = []
|
||||
outerParamsCopy.outerParamsInfoArray?.forEach(outerParamsInfo => {
|
||||
if (!outerParamsInfo.paramName || paramNameArray.includes(outerParamsInfo.paramName)) {
|
||||
checkNullErrorNum++
|
||||
}
|
||||
paramNameArray.push(outerParamsInfo.paramName)
|
||||
if (outerParamsInfo.defaultValue && !jsonArrayCheck(outerParamsInfo.defaultValue)) {
|
||||
checkErrorNum++
|
||||
checkMessage = checkMessage + `【${outerParamsInfo.paramName}】`
|
||||
@@ -636,6 +642,14 @@ const save = () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (checkNullErrorNum > 0) {
|
||||
ElMessage({
|
||||
message: `存在未配置的参数名或者参数名称重复!`,
|
||||
type: 'warning',
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
updateOuterParamsSet(outerParamsCopy).then(() => {
|
||||
ElMessage({
|
||||
message: t('commons.save_success'),
|
||||
|
||||
Reference in New Issue
Block a user