优化报错

This commit is contained in:
kuaifan 2022-01-14 16:35:00 +08:00
parent 3602acd187
commit 08704e7f60
15 changed files with 136 additions and 141 deletions

View File

@ -196,7 +196,7 @@
openDialog() {
this.goForward({path: '/manage/messenger'});
this.$store.dispatch("openDialogUserid", this.userid);
this.$store.dispatch("openDialogUserid", this.userid).catch(() => {})
}
}
};

View File

@ -76,7 +76,7 @@ export default {
this.getDemoAccount();
//
if (this.$Electron) {
this.chackServerUrl();
this.chackServerUrl().catch(() => {});
} else {
this.clearServerUrl();
}

View File

@ -258,8 +258,8 @@ export default {
$A.messageSuccess("清除成功");
}
//
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getTaskPriority");
this.$store.dispatch("getUserInfo").catch(() => {})
this.$store.dispatch("getTaskPriority").catch(() => {})
//
this.notificationInit();
this.onVisibilityChange();
@ -613,7 +613,7 @@ export default {
this.notificationClass.replaceTitle(data.name);
this.notificationClass.userAgreed();
}
})
}).catch(() => {})
}
}
},

View File

@ -401,7 +401,7 @@ export default {
}
}
});
});
}).catch(() => {})
},
addDialogMsg() {

View File

@ -219,7 +219,7 @@ export default {
}).then(() => {
this.loadIng--;
this.getLists();
this.$store.dispatch("getProjectOne", row.id);
this.$store.dispatch("getProjectOne", row.id).catch(() => {});
}).catch(({msg}) => {
$A.modalError(msg);
this.loadIng--;

View File

@ -785,7 +785,7 @@ export default {
}).catch(({msg}) => {
$A.modalError(msg);
this.sortDisabled = false;
this.$store.dispatch("getTaskForProject", this.projectId)
this.$store.dispatch("getTaskForProject", this.projectId).catch(() => {})
});
},
@ -881,7 +881,7 @@ export default {
this.$store.dispatch("saveColumn", data);
}).catch(({msg}) => {
this.$set(this.columnLoad, column.id, false);
this.$store.dispatch("getColumns", this.projectId)
this.$store.dispatch("getColumns", this.projectId).catch(() => {})
$A.modalError(msg);
});
},
@ -945,8 +945,8 @@ export default {
$A.messageSuccess(msg);
this.userLoad--;
this.userShow = false;
this.$store.dispatch("getProjectOne", this.projectId);
this.$store.dispatch("getTaskForProject", this.projectId)
this.$store.dispatch("getProjectOne", this.projectId).catch(() => {});
this.$store.dispatch("getTaskForProject", this.projectId).catch(() => {})
}).catch(({msg}) => {
$A.modalError(msg);
this.userLoad--;
@ -965,8 +965,8 @@ export default {
$A.messageSuccess(msg);
this.transferLoad--;
this.transferShow = false;
this.$store.dispatch("getProjectOne", this.projectId);
this.$store.dispatch("getTaskForProject", this.projectId)
this.$store.dispatch("getProjectOne", this.projectId).catch(() => {});
this.$store.dispatch("getTaskForProject", this.projectId).catch(() => {})
}).catch(({msg}) => {
$A.modalError(msg);
this.transferLoad--;

View File

@ -270,7 +270,7 @@ export default {
},
methods: {
initLanguage() {
},
initCascaderData() {
@ -321,7 +321,7 @@ export default {
this.addData.project_id = column.project_id;
this.addData.column_id = column.id;
}
});
}).catch(() => {});
}
}
}

View File

@ -376,13 +376,14 @@
class="dialog-input"
v-model="msgText"
type="textarea"
:disabled="sendLoad > 0"
:rows="1"
:autosize="{ minRows: 1, maxRows: 3 }"
:maxlength="255"
:placeholder="$L('输入消息...')"
@on-keydown="msgKeydown"/>
<div class="no-send" @click="openSend">
<Loading v-if="sendLoad"/>
<Loading v-if="sendLoad > 0"/>
<Icon v-else type="md-send" />
</div>
</div>
@ -458,7 +459,7 @@ export default {
navActive: 'dialog',
logLoadIng: false,
sendLoad: false,
sendLoad: 0,
taskPlugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
@ -828,7 +829,7 @@ export default {
this.ownerLoad--;
this.ownerShow = false;
this.receiveShow = false;
this.$store.dispatch("getTaskOne", this.taskDetail.id);
this.$store.dispatch("getTaskOne", this.taskDetail.id).catch(() => {})
}).catch(({msg}) => {
$A.modalError(msg);
this.ownerLoad--;
@ -859,7 +860,7 @@ export default {
$A.messageSuccess(msg);
this.assistLoad--;
this.assistShow = false;
this.$store.dispatch("getTaskOne", this.taskDetail.id);
this.$store.dispatch("getTaskOne", this.taskDetail.id).catch(() => {})
}).catch(({msg}) => {
$A.modalError(msg);
this.assistLoad--;
@ -1007,6 +1008,11 @@ export default {
if (!this.msgText) {
return;
}
if (this.sendLoad > 0) {
return;
}
this.sendLoad++;
//
this.$store.dispatch("call", {
url: 'project/task/dialog',
data: {
@ -1014,56 +1020,60 @@ export default {
},
}).then(({data}) => {
this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id);
if ($A.isSubElectron) {
this.resizeDialog();
return;
}
this.$nextTick(() => {
if (this.$store.state.windowMax768) {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
$A.setStorage("messenger::dialogId", data.dialog_id)
this.$store.state.dialogOpenId = data.dialog_id;
this.$store.dispatch('openTask', 0);
this.msgText = "";
this.$store.dispatch("getDialogOne", data.dialog_id).then(() => {
this.sendLoad--;
if ($A.isSubElectron) {
this.resizeDialog();
} else {
this.$nextTick(() => {
this.$refs.dialog.sendMsg(this.msgText);
if (this.$store.state.windowMax768) {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
$A.setStorage("messenger::dialogId", data.dialog_id)
this.$store.state.dialogOpenId = data.dialog_id;
this.$store.dispatch('openTask', 0);
} else {
this.$refs.dialog.sendMsg(this.msgText);
}
this.msgText = "";
})
});
}
}).catch(({msg}) => {
this.sendLoad--;
$A.modalError(msg);
});
}).catch(({msg}) => {
this.sendLoad--;
$A.modalError(msg);
});
},
openSend() {
if (this.sendLoad) {
if (this.sendLoad > 0) {
return;
}
this.sendLoad = true;
this.sendLoad++;
//
this.$store.dispatch("call", {
url: 'project/task/dialog',
data: {
task_id: this.taskDetail.id,
},
}).then(({data}) => {
this.sendLoad = false;
this.sendLoad--;
this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id);
this.$store.dispatch("getDialogOne", data.dialog_id).catch(() => {})
if ($A.isSubElectron) {
this.resizeDialog();
return;
} else {
this.$nextTick(() => {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
$A.setStorage("messenger::dialogId", data.dialog_id)
this.$store.state.dialogOpenId = data.dialog_id;
this.$store.dispatch('openTask', 0);
});
}
this.$nextTick(() => {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
$A.setStorage("messenger::dialogId", data.dialog_id)
this.$store.state.dialogOpenId = data.dialog_id;
this.$store.dispatch('openTask', 0);
});
}).catch(({msg}) => {
this.sendLoad = false;
this.sendLoad--;
$A.modalError(msg);
});
},
@ -1128,10 +1138,8 @@ export default {
if (this.$refs.dialog || num > 20) {
clearInterval(interval);
if (this.$refs.dialog) {
this.$nextTick(() => {
this.$refs.dialog.sendMsg(this.msgText);
this.msgText = "";
})
this.$refs.dialog.sendMsg(this.msgText);
this.msgText = "";
}
}
}, 100);

View File

@ -57,7 +57,7 @@
</div>
</EDropdownItem>
<template v-if="colorShow">
<EDropdownItem v-for="(c, k) in taskColorList" :key="k" :divided="k==0" :command="c">
<EDropdownItem v-for="(c, k) in taskColorList" :key="'c_' + k" :divided="k==0" :command="c">
<div class="item">
<i class="taskfont" :style="{color:c.color||'#f9f9f9'}" v-html="c.color == task.color ? '&#xe61d;' : '&#xe61c;'"></i>{{$L(c.name)}}
</div>
@ -162,7 +162,7 @@ export default {
//
this.updateTask({
color: command.color
})
}).catch(() => {})
}
return;
}
@ -172,7 +172,7 @@ export default {
if (flow_item_id == this.task.flow_item_id) return;
this.updateTask({
flow_item_id
})
}).catch(() => {})
return;
}
const cacheTask = this.task;
@ -218,7 +218,7 @@ export default {
visibleChange(visible) {
if (visible) {
this.$store.dispatch("getTaskFlow", this.task.id);
this.$store.dispatch("getTaskFlow", this.task.id).catch(() => {})
}
},
@ -239,7 +239,7 @@ export default {
this.$emit("on-update", data)
}).catch(({msg}) => {
$A.modalError(msg);
this.$store.dispatch("getTaskOne", this.task.id);
this.$store.dispatch("getTaskOne", this.task.id).catch(() => {})
reject()
});
})

View File

@ -188,7 +188,7 @@ export default {
//
el[0].updateTask({
column_id: $A.leftDelete(command, 'column::')
})
}).catch(() => {})
return;
}
if ($A.leftExists(command, 'priority::')) {
@ -199,7 +199,7 @@ export default {
p_level: data.priority,
p_name: data.name,
p_color: data.color,
})
}).catch(() => {})
}
}
},

View File

@ -321,21 +321,20 @@ export default {
},
operationUser(data) {
let that = this;
return new Promise(function (resolve) {
that.loadIng++;
that.$store.dispatch("call", {
return new Promise((resolve) => {
this.loadIng++;
this.$store.dispatch("call", {
url: 'users/operation',
data,
}).then(({msg}) => {
$A.messageSuccess(msg);
that.loadIng--;
that.getLists();
this.loadIng--;
this.getLists();
resolve()
}).catch(({msg}) => {
$A.modalError(msg, 301);
that.loadIng--;
that.getLists();
this.loadIng--;
this.getLists();
resolve()
})
})

View File

@ -57,8 +57,8 @@ export default {
setTimeout(() => {
this.$store.state.projectId = $A.runNum(id);
this.$store.dispatch("getProjectOne", id).then(() => {
this.$store.dispatch("getColumns", id);
this.$store.dispatch("getTaskForProject", id);
this.$store.dispatch("getColumns", id).catch(() => {});
this.$store.dispatch("getTaskForProject", id).catch(() => {})
}).catch(({msg}) => {
$A.modalWarning({
content: msg,

View File

@ -82,7 +82,7 @@ export default {
}).then(() => {
$A.messageSuccess('修改成功');
this.loadIng--;
this.$store.dispatch('getUserInfo');
this.$store.dispatch('getUserInfo').catch(() => {});
}).catch(({msg}) => {
$A.modalError(msg);
this.loadIng--;

View File

@ -70,7 +70,7 @@ export default {
this.taskInfo = data;
this.$store.dispatch("getTaskContent", task_id);
this.$store.dispatch("getTaskFiles", task_id);
this.$store.dispatch("getTaskForParent", task_id);
this.$store.dispatch("getTaskForParent", task_id).catch(() => {})
}).catch(({msg}) => {
this.loadIng--;
$A.modalError({

View File

@ -171,7 +171,7 @@ export default {
* @param dispatch
*/
getBasicData({dispatch}) {
dispatch("getProjects");
dispatch("getProjects").catch(() => {});
dispatch("getDialogs");
dispatch("getTaskForDashboard");
},
@ -383,7 +383,7 @@ export default {
* @returns {Promise<unknown>}
*/
handleClearCache({state, dispatch}, userInfo) {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
try {
const cacheLoginEmail = $A.getStorageString("cacheLoginEmail");
//
@ -402,7 +402,7 @@ export default {
//
resolve()
} catch (e) {
reject(e)
resolve()
}
});
},
@ -651,7 +651,7 @@ export default {
resolve(result)
}).catch(e => {
console.warn(e);
dispatch("getProjectOne", project_id);
dispatch("getProjectOne", project_id).catch(() => {})
reject(e)
});
});
@ -679,7 +679,7 @@ export default {
resolve(result)
}).catch(e => {
console.warn(e);
dispatch("getProjectOne", project_id);
dispatch("getProjectOne", project_id).catch(() => {})
reject(e)
});
});
@ -707,7 +707,7 @@ export default {
resolve(result)
}).catch(e => {
console.warn(e);
dispatch("getProjectOne", project_id);
dispatch("getProjectOne", project_id).catch(() => {})
reject(e)
});
});
@ -758,11 +758,11 @@ export default {
let index = state.cacheColumns.findIndex(column => column.id == id);
if (index > -1) {
project_ids.push(state.cacheColumns[index].project_id)
dispatch('getProjectOne', state.cacheColumns[index].project_id)
dispatch('getProjectOne', state.cacheColumns[index].project_id).catch(() => {})
state.cacheColumns.splice(index, 1);
}
})
Array.from(new Set(project_ids)).some(id => dispatch("getProjectOne", id))
Array.from(new Set(project_ids)).some(id => dispatch("getProjectOne", id).catch(() => {}))
//
setTimeout(() => {
$A.setStorage("cacheColumns", state.cacheColumns);
@ -882,16 +882,16 @@ export default {
}
//
if (updateMarking.is_update_maintask === true || (data.parent_id > 0 && state.cacheTasks.findIndex(({id}) => id == data.parent_id) === -1)) {
dispatch("getTaskOne", data.parent_id);
dispatch("getTaskOne", data.parent_id).catch(() => {})
}
if (updateMarking.is_update_project === true) {
dispatch("getProjectOne", data.project_id);
dispatch("getProjectOne", data.project_id).catch(() => {})
}
if (updateMarking.is_update_content === true) {
dispatch("getTaskContent", data.id);
}
if (updateMarking.is_update_subtask === true) {
dispatch("getTaskForParent", data.id);
dispatch("getTaskForParent", data.id).catch(() => {})
}
//
setTimeout(() => {
@ -922,8 +922,8 @@ export default {
state.cacheTasks.splice(index, 1);
}
})
Array.from(new Set(parent_ids)).some(id => dispatch("getTaskOne", id))
Array.from(new Set(project_ids)).some(id => dispatch("getProjectOne", id))
Array.from(new Set(parent_ids)).some(id => dispatch("getTaskOne", id).catch(() => {}))
Array.from(new Set(project_ids)).some(id => dispatch("getProjectOne", id).catch(() => {}))
//
if (ids.includes(state.taskId)) {
state.taskId = 0;
@ -1158,7 +1158,7 @@ export default {
resolve(result)
}).catch(e => {
console.warn(e);
dispatch("getTaskOne", task_id);
dispatch("getTaskOne", task_id).catch(() => {})
dispatch("taskLoadEnd", task_id)
reject(e)
});
@ -1190,7 +1190,7 @@ export default {
resolve(result)
}).catch(e => {
console.warn(e);
dispatch("getTaskOne", task_id)
dispatch("getTaskOne", task_id).catch(() => {})
dispatch("taskLoadEnd", task_id)
reject(e)
});
@ -1202,31 +1202,25 @@ export default {
* @param state
* @param dispatch
* @param task_id
* @returns {Promise<unknown>}
*/
getTaskContent({state, dispatch}, task_id) {
return new Promise(function (resolve, reject) {
if ($A.runNum(task_id) === 0) {
reject({msg: 'Parameter error'});
return;
if ($A.runNum(task_id) === 0) {
return;
}
dispatch("call", {
url: 'project/task/content',
data: {
task_id,
},
}).then(result => {
let index = state.taskContents.findIndex(({id}) => id == result.data.id)
if (index > -1) {
state.taskContents.splice(index, 1, result.data)
} else {
state.taskContents.push(result.data)
}
dispatch("call", {
url: 'project/task/content',
data: {
task_id,
},
}).then(result => {
let index = state.taskContents.findIndex(({id}) => id == result.data.id)
if (index > -1) {
state.taskContents.splice(index, 1, result.data)
} else {
state.taskContents.push(result.data)
}
resolve(result)
}).catch(e => {
console.warn(e);
reject(e);
});
}).catch(e => {
console.warn(e);
});
},
@ -1235,37 +1229,31 @@ export default {
* @param state
* @param dispatch
* @param task_id
* @returns {Promise<unknown>}
*/
getTaskFiles({state, dispatch}, task_id) {
return new Promise(function (resolve, reject) {
if ($A.runNum(task_id) === 0) {
reject({msg: 'Parameter error'});
return;
}
dispatch("call", {
url: 'project/task/files',
data: {
task_id,
},
}).then(result => {
result.data.forEach((data) => {
let index = state.taskFiles.findIndex(({id}) => id == data.id)
if (index > -1) {
state.taskFiles.splice(index, 1, data)
} else {
state.taskFiles.push(data)
}
})
dispatch("saveTask", {
id: task_id,
file_num: result.data.length
});
resolve(result)
}).catch(e => {
console.warn(e);
reject(e);
if ($A.runNum(task_id) === 0) {
return;
}
dispatch("call", {
url: 'project/task/files',
data: {
task_id,
},
}).then(result => {
result.data.forEach((data) => {
let index = state.taskFiles.findIndex(({id}) => id == data.id)
if (index > -1) {
state.taskFiles.splice(index, 1, data)
} else {
state.taskFiles.push(data)
}
})
dispatch("saveTask", {
id: task_id,
file_num: result.data.length
});
}).catch(e => {
console.warn(e);
});
},
@ -1305,7 +1293,7 @@ export default {
dispatch("getTaskOne", task_id).then(() => {
dispatch("getTaskContent", task_id);
dispatch("getTaskFiles", task_id);
dispatch("getTaskForParent", task_id);
dispatch("getTaskForParent", task_id).catch(() => {})
}).catch(({msg}) => {
$A.modalWarning({
content: msg,
@ -1375,7 +1363,7 @@ export default {
delete task.new_column
}
dispatch("saveTask", task)
dispatch("getProjectOne", task.project_id);
dispatch("getProjectOne", task.project_id).catch(() => {})
},
/**
@ -1400,7 +1388,7 @@ export default {
}).catch(e => {
console.warn(e);
dispatch("taskLoadEnd", post.task_id)
dispatch("getTaskOne", post.task_id);
dispatch("getTaskOne", post.task_id).catch(() => {})
reject(e)
});
}).catch(reject)
@ -1679,7 +1667,7 @@ export default {
last_at: $A.formatDate("Y-m-d H:i:s")
});
} else {
dispatch("getDialogOne", data.dialog_id);
dispatch("getDialogOne", data.dialog_id).catch(() => {})
}
},
@ -2060,15 +2048,15 @@ export default {
dispatch("saveProject", data)
break;
case 'detail':
dispatch("getProjectOne", data.id);
dispatch("getTaskForProject", data.id)
dispatch("getProjectOne", data.id).catch(() => {})
dispatch("getTaskForProject", data.id).catch(() => {})
break;
case 'archived':
case 'delete':
dispatch("forgetProject", data.id);
break;
case 'sort':
dispatch("getTaskForProject", data.id)
dispatch("getTaskForProject", data.id).catch(() => {})
break;
}
})(msgDetail);
@ -2107,7 +2095,7 @@ export default {
break;
case 'dialog':
dispatch("saveTask", data)
dispatch("getDialogOne", data.dialog_id)
dispatch("getDialogOne", data.dialog_id).catch(() => {})
break;
case 'upload':
dispatch("getTaskFiles", data.task_id)