优化渲染速度

This commit is contained in:
aipaw 2021-06-25 09:09:33 +08:00
parent 57c1e09fc4
commit c94cc11ef8
2 changed files with 17 additions and 15 deletions

View File

@ -32,21 +32,23 @@ export default {
},
project_id(id) {
if (id > 0) {
this.$store.state.projectId = $A.runNum(id);
this.$store.dispatch("getProjectOne", id).then(() => {
this.$store.dispatch("getColumns", id);
this.$store.dispatch("getTasks", {project_id: id});
}).catch(({msg}) => {
$A.modalWarning({
content: msg,
onOk: () => {
const project = this.$store.state.projects.find(({id}) => id);
if (project) {
$A.goForward({path: '/manage/project/' + project.id});
} else {
$A.goForward({path: '/manage/dashboard'});
setTimeout(() => {
this.$store.state.projectId = $A.runNum(id);
this.$store.dispatch("getProjectOne", id).then(() => {
this.$store.dispatch("getColumns", id);
this.$store.dispatch("getTasks", {project_id: id});
}).catch(({msg}) => {
$A.modalWarning({
content: msg,
onOk: () => {
const project = this.$store.state.projects.find(({id}) => id);
if (project) {
$A.goForward({path: '/manage/project/' + project.id});
} else {
$A.goForward({path: '/manage/dashboard'});
}
}
}
});
});
});
}

View File

@ -26,7 +26,7 @@ export default {
return a.id - b.id;
});
})
return project;
return Object.freeze(project);
}
}
return {