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({