From bfdab9e2837d839854f6fe8a911175c02681c1e0 Mon Sep 17 00:00:00 2001 From: chen <2280784283@qq.com> Date: Thu, 25 Jul 2024 09:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B1=87=E6=80=BB=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../departmentWeekly/DepartmentWeeklyList.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/kehui-oa-front/src/pages/projectManagements/departmentWeekly/DepartmentWeeklyList.vue b/kehui-oa-front/src/pages/projectManagements/departmentWeekly/DepartmentWeeklyList.vue index c077241..265a03e 100644 --- a/kehui-oa-front/src/pages/projectManagements/departmentWeekly/DepartmentWeeklyList.vue +++ b/kehui-oa-front/src/pages/projectManagements/departmentWeekly/DepartmentWeeklyList.vue @@ -53,9 +53,8 @@ @@ -141,6 +140,7 @@ total: null, tableTotalPage: 1, tableColumnsData: [], + disabledButtons: [], // 存储已禁用按钮的 ID tableRowsData: [], isSuper: false } @@ -149,6 +149,13 @@ this.initTableColumns(); this.init(); }, + mounted () { + // 页面加载时从本地存储中恢复已禁用按钮的状态 + const disabledButtons = JSON.parse(localStorage.getItem('disabledButtons')); + if (disabledButtons) { + this.disabledButtons = disabledButtons; + } + }, methods: { init () { let userId = getItem('userId'); @@ -291,7 +298,11 @@ this.$router.push({name: 'DepartmentWeeklyList'}) } }) - row.summarized = true; + this.disabledButtons.push(row.id); + localStorage.setItem('disabledButtons', JSON.stringify(this.disabledButtons)); + }, + isButtonDisabled (id) { + return this.disabledButtons.includes(id); }, updateWorkload (id) { this.$router.push({