@@ -407,8 +407,6 @@ export default {
'projectLoad',
'tasks',
'columns',
-
- 'showCompletedTask',
]),
...mapGetters(['projectData', 'tablePanel']),
@@ -420,9 +418,9 @@ export default {
},
panelTask() {
- const {searchText, showCompletedTask} = this;
+ const {searchText} = this;
return function (list) {
- if (!showCompletedTask) {
+ if (!this.tablePanel('completedTask')) {
list = list.filter(({complete_at}) => {
return !complete_at;
});
@@ -437,12 +435,12 @@ export default {
},
myList() {
- const {projectId, tasks, searchText, showCompletedTask, userId} = this;
+ const {projectId, tasks, searchText, userId} = this;
const array = tasks.filter((task) => {
if (task.project_id != projectId) {
return false;
}
- if (!showCompletedTask) {
+ if (!this.tablePanel('completedTask')) {
if (task.complete_at) {
return false;
}
@@ -466,12 +464,12 @@ export default {
},
undoneList() {
- const {projectId, tasks, searchText, showCompletedTask} = this;
+ const {projectId, tasks, searchText} = this;
const array = tasks.filter((task) => {
if (task.project_id != projectId) {
return false;
}
- if (!showCompletedTask) {
+ if (!this.tablePanel('completedTask')) {
if (task.complete_at) {
return false;
}
@@ -935,8 +933,8 @@ export default {
taskIsHidden(task) {
const {name, desc, complete_at} = task;
- const {searchText, showCompletedTask} = this;
- if (!showCompletedTask) {
+ const {searchText} = this;
+ if (!this.tablePanel('completedTask')) {
if (complete_at) {
return true;
}
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index 7f6ccf2b..58121436 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -122,16 +122,6 @@ export default {
})
},
- /**
- * 切换Boolean变量
- * @param state
- * @param key
- */
- toggleBoolean({state}, key) {
- state[key] = !state[key]
- state.method.setStorage("boolean:" + key, state[key]);
- },
-
/**
* 切换面板变量
* @param state
diff --git a/resources/assets/js/store/getters.js b/resources/assets/js/store/getters.js
index fb83b439..b38ef0a6 100644
--- a/resources/assets/js/store/getters.js
+++ b/resources/assets/js/store/getters.js
@@ -64,6 +64,7 @@ export default {
showMy: true,
showUndone: true,
showCompleted: false,
+ completedTask: false,
}
state.cacheTablePanel.push(cache);
}
diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js
index 4c88f5d6..93e477d0 100644
--- a/resources/assets/js/store/state.js
+++ b/resources/assets/js/store/state.js
@@ -233,7 +233,6 @@ state.cacheColumns = state.method.getStorageArray("cacheColumns");
state.cacheTasks = state.method.getStorageArray("cacheTasks");
state.cacheTaskSubs = state.method.getStorageArray("cacheTaskSubs");
state.cacheTablePanel = state.method.getStorageArray("cacheTablePanel");
-state.showCompletedTask = state.method.getStorageBoolean("showCompletedTask")
// Ajax
state.ajaxLoadNum = 0;