fix: list

This commit is contained in:
Fine 2024-01-16 18:07:53 +08:00
parent dd4e106c1c
commit b14f588254
2 changed files with 3 additions and 2 deletions

View File

@ -429,8 +429,7 @@ export const dashboardStore = defineStore({
d.layer === this.currentDashboard?.layer, d.layer === this.currentDashboard?.layer,
); );
if (index > -1) { if (index > -1) {
const { t } = useI18n(); ElMessage.error("The dashboard name cannot be duplicate");
ElMessage.error(t("nameError"));
return; return;
} }
res = await graphql.query("addNewTemplate").params({ setting: { configuration: JSON.stringify(c) } }); res = await graphql.query("addNewTemplate").params({ setting: { configuration: JSON.stringify(c) } });

View File

@ -336,6 +336,7 @@ limitations under the License. -->
dashboards.value = dashboardStore.dashboards; dashboards.value = dashboardStore.dashboards;
loading.value = false; loading.value = false;
dashboardFile.value = null; dashboardFile.value = null;
searchDashboards(currentPage.value);
} }
function exportTemplates() { function exportTemplates() {
if (!multipleSelection.value.length) { if (!multipleSelection.value.length) {
@ -597,6 +598,7 @@ limitations under the License. -->
loading.value = false; loading.value = false;
sessionStorage.setItem("dashboards", JSON.stringify(dashboards.value)); sessionStorage.setItem("dashboards", JSON.stringify(dashboards.value));
sessionStorage.removeItem(`${row.layer}_${row.entity}_${row.name}`); sessionStorage.removeItem(`${row.layer}_${row.entity}_${row.name}`);
searchDashboards(currentPage.value);
} }
function searchDashboards(pageIndex: number) { function searchDashboards(pageIndex: number) {
const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]"); const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]");