fix: added name verification to avoid creating blank dashboard name (#171)

This commit is contained in:
WD 2022-10-17 21:25:59 +08:00 committed by GitHub
parent 9f57e35119
commit 77d189cdfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View File

@ -108,6 +108,7 @@ const msg = {
showXAxis: "Show X Axis",
showYAxis: "Show Y Axis",
nameError: "The dashboard name cannot be duplicate",
nameEmptyError: "The dashboard name cannot be empty",
showGroup: "Show Group",
noRoot: "Please set a root dashboard for",
noWidget: "Please add widgets.",

View File

@ -110,6 +110,7 @@ const msg = {
showXAxis: "Mostrar Eje X",
showYAxis: "Mostrar Eje Y",
nameError: "El nombre del panel no puede ser duplicado",
nameEmptyError: "El nombre del panel no puede estar vacío",
showGroup: "Mostrar Grupo",
noRoot: "Por favor ponga la raíz del panel",
noWidget: "Por favor añada widgets.",

View File

@ -106,6 +106,7 @@ const msg = {
showXAxis: "显示X轴",
showYAxis: "显示Y轴",
nameError: "仪表板名称不能重复",
nameEmptyError: "仪表板名称不能为空",
noRoot: "请设置根仪表板,为",
showGroup: "显示分组",
noWidget: "请添加组件",

View File

@ -81,6 +81,10 @@ const onCreate = () => {
states.entity === d.entity &&
states.selectedLayer === d.layer
);
if (!states.name) {
ElMessage.error(t("nameEmptyError"));
return;
}
if (index > -1) {
ElMessage.error(t("nameError"));
return;