diff --git a/resources/assets/js/pages/manage/components/ProjectList.vue b/resources/assets/js/pages/manage/components/ProjectList.vue
index 79dbe10d..8176a957 100644
--- a/resources/assets/js/pages/manage/components/ProjectList.vue
+++ b/resources/assets/js/pages/manage/components/ProjectList.vue
@@ -4,7 +4,7 @@
-
@@ -404,6 +404,7 @@ export default {
'dialogList',
'projectId',
+ 'projectLoad',
'tasks',
'columns',
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index 81790b4e..81754d71 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -1,5 +1,3 @@
-import state from "./state";
-
export default {
/**
* 访问接口
@@ -366,6 +364,7 @@ export default {
* @returns {Promise}
*/
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--;
+ }
});
},
diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js
index 9bd7bde0..6d175f8f 100644
--- a/resources/assets/js/store/state.js
+++ b/resources/assets/js/store/state.js
@@ -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