no message

This commit is contained in:
kuaifan 2021-06-22 14:26:57 +08:00
parent 551c835988
commit b8d06fcd36
3 changed files with 36 additions and 17 deletions

View File

@ -4,7 +4,7 @@
<div class="project-titbox">
<div class="project-title">
<h1>{{projectData.name}}</h1>
<!--<div class="project-load"><Loading/></div>-->
<div v-if="projectLoad > 0" class="project-load"><Loading/></div>
</div>
<ul class="project-icons">
<li>
@ -404,6 +404,7 @@ export default {
'dialogList',
'projectId',
'projectLoad',
'tasks',
'columns',

View File

@ -1,5 +1,3 @@
import state from "./state";
export default {
/**
* 访问接口
@ -366,6 +364,7 @@ export default {
* @returns {Promise<unknown>}
*/
getProjectOne({state, dispatch}, project_id) {
state.projectLoad++;
return new Promise(function (resolve, reject) {
dispatch("call", {
url: 'project/one',
@ -373,10 +372,12 @@ export default {
project_id,
},
}).then(result => {
state.projectLoad--;
dispatch("saveProject", result.data);
resolve(result)
}).catch(e => {
console.error(e);
state.projectLoad--;
reject(e)
});
});
@ -500,12 +501,14 @@ export default {
if (state.cacheColumns.length > 0) {
state.columns = state.cacheColumns;
}
state.projectLoad++;
dispatch("call", {
url: 'project/column/lists',
data: {
project_id
}
}).then(result => {
state.projectLoad--;
const ids = result.data.data.map(({id}) => id)
if (ids.length == 0) {
return;
@ -514,6 +517,7 @@ export default {
dispatch("saveColumn", result.data.data);
}).catch(e => {
console.error(e);
state.projectLoad--;
});
},
@ -619,10 +623,16 @@ export default {
if (state.cacheTasks.length > 0) {
state.tasks = state.cacheTasks;
}
if (data.project_id) {
state.projectLoad++;
}
dispatch("call", {
url: 'project/task/lists',
data: data
}).then(result => {
if (data.project_id) {
state.projectLoad--;
}
const resData = result.data;
const ids = resData.data.map(({id}) => id)
if (ids.length == 0) {
@ -653,6 +663,9 @@ export default {
}
}).catch(e => {
console.error(e);
if (data.project_id) {
state.projectLoad--;
}
});
},

View File

@ -260,6 +260,7 @@ state.wsReadWaitList = [];
// 项目任务
state.projects = [];
state.projectLoad = 0;
state.projectStatistics = {};
state.columns = [];
state.tasks = [];
@ -270,6 +271,22 @@ state.taskLogs = [];
state.projectId = 0;
state.taskId = 0;
// 会话聊天
state.dialogId = 0;
state.dialogList = [];
state.dialogDetail = {};
state.dialogMsgUnread = 0;
state.dialogMsgLoad = 0;
state.dialogMsgPush = {};
state.dialogMsgList = [];
state.dialogMsgCurrentPage = 1;
state.dialogMsgHasMorePages = false;
// 任务优先级
state.taskPriority = [];
// 列表背景色
state.columnColorList = [
{name: '默认', color: ''},
{name: '灰色', color: '#444444'},
@ -282,6 +299,8 @@ state.columnColorList = [
{name: '粉色', color: '#ff819c'},
{name: '红色', color: '#ff7070'},
];
// 任务背景色
state.taskColorList = [
{name: '默认', color: ''},
{name: '黄色', color: '#fffae6'},
@ -292,18 +311,4 @@ state.taskColorList = [
{name: '灰色', color: '#f3f3f3'},
];
// 会话聊天
state.dialogId = 0;
state.dialogList = [];
state.dialogDetail = {};
state.dialogMsgUnread = 0;
state.dialogMsgLoad = 0;
state.dialogMsgPush = {};
state.dialogMsgList = [];
state.dialogMsgCurrentPage = 1;
state.dialogMsgHasMorePages = false;
// 任务优先级
state.taskPriority = [];
export default state