perf: 领取任务流程

This commit is contained in:
kuaifan 2021-12-25 11:42:04 +08:00
parent ccf4c4bbb3
commit f7fc379e56
6 changed files with 45 additions and 18 deletions

View File

@ -182,7 +182,7 @@
<UserAvatar :userid="user.userid" size="32" :borderWitdh="2" :borderColor="item.color"/>
</li>
<li v-if="ownerUser(item.task_user).length === 0" class="no-owner">
<Button type="primary" size="small" ghost>{{$L('领取任务')}}</Button>
<Button type="primary" size="small" ghost @click.stop="openTask(item, true)">{{$L('领取任务')}}</Button>
</li>
</ul>
<div v-if="item.file_num > 0" class="task-icon">{{item.file_num}}<Icon type="ios-link-outline" /></div>
@ -458,7 +458,7 @@ export default {
logShow: false,
archivedTaskShow: false,
projectDialogsubscribe: null,
projectDialogSubscribe: null,
}
},
@ -467,7 +467,7 @@ export default {
this.nowTime = $A.Time();
}, 1000);
//
this.projectDialogsubscribe = Store.subscribe('onProjectDialogBack', () => {
this.projectDialogSubscribe = Store.subscribe('onProjectDialogBack', () => {
this.$store.dispatch('toggleTablePanel', 'chat');
});
},
@ -475,9 +475,9 @@ export default {
destroyed() {
clearInterval(this.nowInterval);
//
if (this.projectDialogsubscribe) {
this.projectDialogsubscribe.unsubscribe();
this.projectDialogsubscribe = null;
if (this.projectDialogSubscribe) {
this.projectDialogSubscribe.unsubscribe();
this.projectDialogSubscribe = null;
}
},
@ -1117,12 +1117,18 @@ export default {
}
},
openTask(task) {
openTask(task, receive) {
if (task.parent_id > 0) {
this.$store.dispatch("openTask", task.parent_id)
} else {
this.$store.dispatch("openTask", task.id)
}
if (receive === true) {
//
setTimeout(() => {
Store.set('receiveTask', true);
}, 300)
}
},
taskIsHidden(task) {

View File

@ -103,7 +103,7 @@
<Poptip
v-if="getOwner.length === 0"
confirm
ref="owner"
ref="receive"
class="pick"
:title="$L('你确认领取任务吗?')"
placement="bottom"
@ -407,6 +407,7 @@ import UserInput from "../../../components/UserInput";
import TaskUpload from "./TaskUpload";
import DialogWrapper from "./DialogWrapper";
import ProjectLog from "./ProjectLog";
import {Store} from "le5le-store";
export default {
name: "TaskDetail",
@ -477,6 +478,8 @@ export default {
valid_elements : 'a[href|target=_blank],em,strong/b,div[align],span[style],a,br,p,img[src|alt|witdh|height],pre[class],code',
toolbar: 'uploadImages | uploadFiles | bold italic underline forecolor backcolor | codesample | preview screenload'
},
receiveTaskSubscribe: null,
}
},
@ -485,11 +488,20 @@ export default {
this.nowTime = $A.Time();
}, 1000);
window.addEventListener('resize', this.innerHeightListener);
//
this.receiveTaskSubscribe = Store.subscribe('receiveTask', () => {
this.$refs.receive && this.$refs.receive.handleClick();
});
},
destroyed() {
clearInterval(this.nowInterval);
window.removeEventListener('resize', this.innerHeightListener);
//
if (this.receiveTaskSubscribe) {
this.receiveTaskSubscribe.unsubscribe();
this.receiveTaskSubscribe = null;
}
},
computed: {

View File

@ -109,7 +109,7 @@
<UserAvatar :userid="user.userid" size="32" :borderWitdh="2" :borderColor="item.color"/>
</li>
<li v-if="ownerUser(item.task_user).length === 0" class="no-owner">
<Button type="primary" size="small" @click="openTask(item)">{{$L('领取任务')}}</Button>
<Button type="primary" size="small" @click.stop="openTask(item, true)">{{$L('领取任务')}}</Button>
</li>
</ul>
</Col>
@ -139,6 +139,7 @@
import TaskPriority from "./TaskPriority";
import TaskAddSimple from "./TaskAddSimple";
import {mapState} from "vuex";
import {Store} from "le5le-store";
export default {
name: "TaskRow",
@ -247,12 +248,18 @@ export default {
return this.columns.filter(({project_id}) => project_id == id);
},
openTask(task) {
openTask(task, receive) {
if (task.parent_id > 0) {
this.$store.dispatch("openTask", task.parent_id)
} else {
this.$store.dispatch("openTask", task.id)
}
if (receive === true) {
//
setTimeout(() => {
Store.set('receiveTask', true);
}, 300)
}
},
ownerUser(list) {

View File

@ -1,5 +1,4 @@
import {Store} from 'le5le-store';
import state from "./state";
export default {
/**

View File

@ -679,13 +679,7 @@
}
}
}
&.row-column {
.task-column {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
&.row-column,
&.row-priority {
.el-dropdown {
display: flex;
@ -693,6 +687,13 @@
overflow: hidden;
}
}
&.row-column {
.task-column {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
&.row-user {
padding: 8px;
> ul {

View File

@ -161,6 +161,8 @@
margin-top: 1px;
cursor: pointer;
.user-list {
display: flex;
align-items: center;
> div {
display: inline-block;
margin-right: 6px;