@@ -624,8 +651,9 @@ export default {
flowInfo: {},
flowList: [],
- columnVisibility: {},
- taskVisibility: {},
+ columnVisibilitys: {},
+ taskVisibilitys: {},
+ taskRowVisibilitys: {},
}
},
@@ -971,6 +999,21 @@ export default {
},
watch: {
+ projectId: {
+ handler(id) {
+ if (id > 0) {
+ this.getFlowData();
+ this.handleColumnDebounce();
+ }
+ },
+ immediate: true,
+ },
+ 'allTask.length'() {
+ this.handleColumnDebounce();
+ },
+ windowWidth() {
+ this.handleColumnDebounce();
+ },
projectData() {
this.sortData = this.getSort();
},
@@ -984,24 +1027,6 @@ export default {
this.loading = false;
}
},
- projectId: {
- handler(val) {
- if (val > 0) {
- this.getFlowData();
- this.handleColumnDebounce();
- }
- },
- immediate: true,
- },
- 'allTask.length'() {
- this.handleColumnDebounce();
- },
- 'projectData.cacheParameter.completedTask'() {
- this.handleColumnDebounce();
- },
- windowWidth() {
- this.handleColumnDebounce();
- }
},
methods: {
@@ -1507,8 +1532,9 @@ export default {
});
},
- flowChange(value, data) {
+ flowChange(_, data) {
this.flowInfo = data.pop() || {};
+ this.handleColumnDebounce();
},
inviteCopy() {
@@ -1525,10 +1551,6 @@ export default {
});
},
- toggleCompleted() {
- this.toggleParameter('completedTask');
- },
-
workflowBeforeClose() {
return new Promise(resolve => {
if (!this.$refs.workflow) {
@@ -1629,15 +1651,16 @@ export default {
},
toggleParameter(data) {
- if (data === 'completedTask') {
- this.$store.dispatch("forgetTaskCompleteTemp", true);
- } else if (data === 'chat') {
+ if (data === 'chat') {
if (this.windowPortrait) {
this.$store.dispatch('openDialog', this.projectData.dialog_id)
return;
}
+ } else if (data === 'completedTask') {
+ this.$store.dispatch("forgetTaskCompleteTemp", true);
}
this.$store.dispatch('toggleProjectParameter', data);
+ this.handleColumnDebounce();
},
onBack() {
@@ -1654,7 +1677,7 @@ export default {
},
taskItemVisible({id, column_id}) {
- return this.columnVisibility[column_id] && this.taskVisibility[id]?.visible
+ return this.columnVisibilitys[column_id] && this.taskVisibilitys[id]?.visible
},
taskItemStyle({id, column_id, color}) {
@@ -1663,7 +1686,7 @@ export default {
style.backgroundColor = color;
}
if (!this.taskItemVisible({id, column_id})) {
- style.height = (this.taskVisibility[id]?.height || 146) + 'px';
+ style.height = (this.taskVisibilitys[id]?.height || 146) + 'px';
}
return style;
},
@@ -1671,9 +1694,16 @@ export default {
handleColumnDebounce() {
if (!this.columnDebounceInvoke) {
this.columnDebounceInvoke = debounce(_ => {
- if (this.tabTypeActive === 'column') {
- this.$nextTick(this.handleColumnScroll)
- }
+ this.$nextTick(_ => {
+ switch (this.tabTypeActive) {
+ case 'column':
+ this.handleColumnScroll()
+ break;
+ case 'table':
+ this.handleTaskScroll({target: this.$refs.projectTableScroll?.$el})
+ break;
+ }
+ })
}, 10);
}
this.columnDebounceInvoke();
@@ -1690,8 +1720,8 @@ export default {
if (!columnContainer) {
return
}
- const columnId = parseInt(columnContainer.getAttribute('data-id'))
- if (!columnId) {
+ const dataId = columnContainer.getAttribute('data-id')
+ if (!dataId) {
return
}
const mainContainer = this.$refs.projectColumn;
@@ -1711,11 +1741,9 @@ export default {
columnRect.bottom > mainRect.top
)
if (visible) {
- this.handleTaskScroll({
- target: columnContainer.querySelector('.task-scrollbar')
- })
+ this.handleTaskScroll({target: columnContainer.querySelector('.task-scrollbar')})
}
- this.$set(this.columnVisibility, columnId, visible)
+ this.$set(this.columnVisibilitys, dataId, visible)
},
async handleTaskScroll({target}) {
@@ -1726,14 +1754,25 @@ export default {
if (!targetItem.length) {
return
}
+ let visibleType = null;
+ switch (this.tabTypeActive) {
+ case 'column':
+ visibleType = 'taskVisibilitys'
+ break;
+ case 'table':
+ visibleType = 'taskRowVisibilitys'
+ break;
+ default:
+ return
+ }
const targetRect = target.getBoundingClientRect();
for (const item of targetItem) {
- const taskId = parseInt(item.getAttribute('data-id'));
- if (!taskId) {
+ const dataId = item.getAttribute('data-id');
+ if (!dataId) {
continue;
}
const taskRect = item.getBoundingClientRect();
- const originalVisible = this.taskVisibility[taskId]?.visible || false;
+ const originalVisible = this[visibleType][dataId]?.visible || false;
const currentVisible = (
taskRect.top >= targetRect.top - taskRect.height &&
taskRect.bottom <= targetRect.bottom + taskRect.height
@@ -1741,8 +1780,8 @@ export default {
if (currentVisible === originalVisible) {
continue;
}
- const firstVisible = this.taskVisibility[taskId] === undefined && currentVisible;
- this.$set(this.taskVisibility, taskId, {
+ const firstVisible = this[visibleType][dataId] === undefined && currentVisible;
+ this.$set(this[visibleType], dataId, {
visible: currentVisible,
height: taskRect.height
});
@@ -1750,7 +1789,7 @@ export default {
await this.$nextTick();
}
}
- }
+ },
}
}
diff --git a/resources/assets/js/pages/manage/components/TaskRow.vue b/resources/assets/js/pages/manage/components/TaskRow.vue
index c01f64979..afbf02c94 100644
--- a/resources/assets/js/pages/manage/components/TaskRow.vue
+++ b/resources/assets/js/pages/manage/components/TaskRow.vue
@@ -1,98 +1,107 @@
-
-
-
-
-
-
-
-
- {{item.flow_item_name}}
-
- {{$L('子任务')}}
-
- +{{item.sub_my.length}}
-
- {{item.name}}
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{item.flow_item_name}}
+
+ {{$L('子任务')}}
+
+ +{{item.sub_my.length}}
+
+ {{item.name}}
-
-
-
{{item.file_num}}
+
+
+
+
+
+
+ {{item.file_num}}
+
+
+
+ {{item.msg_num}}
+
+
+
+ {{item.sub_complete}}/{{item.sub_num}}
+
-
-
- {{item.msg_num}}
-
-
-
- {{item.sub_complete}}/{{item.sub_num}}
-
-
-
-
-
- {{columnName(item.column_id)}}
-
-
- {{column.name}}
-
-
-
-
-
-
- {{item.p_name || $L('未设置')}}
-
-
-
- {{item.name}}
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
- {{expiresFormat(item.end_at)}}
-
- {{completeAtFormat(item.complete_at)}}
-
+
+
+
+ {{columnName(item.column_id)}}
+
+
+ {{column.name}}
+
+
+
+
+
+
+ {{item.p_name || $L('未设置')}}
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+ {{expiresFormat(item.end_at)}}
+
+ {{completeAtFormat(item.complete_at)}}
+
+
({})
+ }
},
data() {
return {
@@ -279,6 +292,23 @@ export default {
} else {
return time.format('YYYY-MM-DD')
}
+ },
+
+ taskItemVisible(key) {
+ return this.parentId > 0 || this.taskVisibilitys[key]?.visible
+ },
+
+ taskItemStyle({id, color}) {
+ const style = {}
+ if (color) {
+ style.backgroundColor = color;
+ style.borderBottomColor = color;
+ }
+ const key = `${this.openKey}_${id}`;
+ if (!this.taskItemVisible(key)) {
+ style.height = (this.taskVisibilitys[key]?.height || 49) + 'px';
+ }
+ return style;
}
}
}