diff --git a/src/store/modules/log.ts b/src/store/modules/log.ts index c0a2a590..e5694992 100644 --- a/src/store/modules/log.ts +++ b/src/store/modules/log.ts @@ -64,16 +64,21 @@ export const logStore = defineStore({ showColumns(columnsLabel: string) { this.serviceLogColumn.forEach((col: any) => { if (columnsLabel === col.value) { - col.isVisible = true + col.isVisible = true; } - }) + }); }, hideColumns(columnsLabel: string) { this.serviceLogColumn.forEach((col: any) => { if (columnsLabel === col.value) { - col.isVisible = false + col.isVisible = false; } - }) + }); + }, + toggleAllColumns(status: boolean) { + this.serviceLogColumn.forEach((col: any) => { + col.isVisible = status; + }); }, setLogCondition(data: any) { this.conditions = { ...this.conditions, ...data }; diff --git a/src/views/dashboard/related/log/Header.vue b/src/views/dashboard/related/log/Header.vue index 99c2fc4e..f5a5ecc0 100644 --- a/src/views/dashboard/related/log/Header.vue +++ b/src/views/dashboard/related/log/Header.vue @@ -29,8 +29,9 @@ limitations under the License. --> style="width: 100%" class="flex-h items-center justify-between" > - - Show All + + Show All + showAllColumns.value, + (newVal, oldVal) => { + console.log("New:", newVal, "Old:", oldVal) + logStore.toggleAllColumns(newVal) +})