fix: 客户端任务窗口首次聊天失败的问题

This commit is contained in:
kuaifan 2022-01-27 23:44:06 +08:00
parent f61d79d53e
commit 569164ed56

View File

@ -38,18 +38,25 @@
</style>
<script>
import TaskDetail from "../manage/components/TaskDetail";
import {mapState} from "vuex";
export default {
components: {TaskDetail},
data() {
return {
loadIng: 0,
taskInfo: {},
taskId: 0,
}
},
mounted() {
//
},
computed: {
...mapState(['cacheTasks']),
taskInfo() {
return this.cacheTasks.find(({id}) => id === this.taskId) || {}
}
},
watch: {
'$route': {
handler() {
@ -60,20 +67,19 @@ export default {
},
methods: {
getInfo() {
let task_id = $A.runNum(this.$route.params.id);
if (task_id <= 0) {
this.taskId = $A.runNum(this.$route.params.id);
if (this.taskId <= 0) {
return;
}
this.loadIng++;
this.$store.dispatch("getTaskOne", {
task_id,
task_id: this.taskId,
archived: 'all'
}).then(({data}) => {
}).then(() => {
this.loadIng--;
this.taskInfo = data;
this.$store.dispatch("getTaskContent", task_id);
this.$store.dispatch("getTaskFiles", task_id);
this.$store.dispatch("getTaskForParent", task_id).catch(() => {})
this.$store.dispatch("getTaskContent", this.taskId);
this.$store.dispatch("getTaskFiles", this.taskId);
this.$store.dispatch("getTaskForParent", this.taskId).catch(() => {})
}).catch(({msg}) => {
this.loadIng--;
$A.modalError({