独立显示完成项目
This commit is contained in:
parent
24345ef6c6
commit
dd509d8140
@ -46,7 +46,7 @@
|
||||
<div v-if="projectData.desc" class="project-subtitle">{{projectData.desc}}</div>
|
||||
<div class="project-switch">
|
||||
<div v-if="completedCount > 0" class="project-checkbox">
|
||||
<Checkbox :value="showCompletedTask" @on-change="$store.dispatch('toggleBoolean', 'showCompletedTask')">{{$L('显示已完成')}}</Checkbox>
|
||||
<Checkbox :value="tablePanel('completedTask')" @on-change="$store.dispatch('toggleTablePanel', 'completedTask')">{{$L('显示已完成')}}</Checkbox>
|
||||
</div>
|
||||
<div :class="['project-switch-button', !tablePanel('card') ? 'menu' : '']" @click="$store.dispatch('toggleTablePanel', 'card')">
|
||||
<div><i class="iconfont"></i></div>
|
||||
@ -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;
|
||||
}
|
||||
|
10
resources/assets/js/store/actions.js
vendored
10
resources/assets/js/store/actions.js
vendored
@ -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
|
||||
|
1
resources/assets/js/store/getters.js
vendored
1
resources/assets/js/store/getters.js
vendored
@ -64,6 +64,7 @@ export default {
|
||||
showMy: true,
|
||||
showUndone: true,
|
||||
showCompleted: false,
|
||||
completedTask: false,
|
||||
}
|
||||
state.cacheTablePanel.push(cache);
|
||||
}
|
||||
|
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user