mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 21:02:49 +00:00
feat: 支持使用%发送工作报告
This commit is contained in:
parent
f162617765
commit
75db81f2f9
@ -380,6 +380,7 @@ export default {
|
|||||||
userCache: null,
|
userCache: null,
|
||||||
taskList: null,
|
taskList: null,
|
||||||
fileList: {},
|
fileList: {},
|
||||||
|
reportList: {},
|
||||||
|
|
||||||
showMenu: false,
|
showMenu: false,
|
||||||
showMore: false,
|
showMore: false,
|
||||||
@ -420,6 +421,7 @@ export default {
|
|||||||
scrollTimer: null,
|
scrollTimer: null,
|
||||||
textTimer: null,
|
textTimer: null,
|
||||||
fileTimer: null,
|
fileTimer: null,
|
||||||
|
reportTimer: null,
|
||||||
moreTimer: null,
|
moreTimer: null,
|
||||||
selectTimer: null,
|
selectTimer: null,
|
||||||
selectRange: null,
|
selectRange: null,
|
||||||
@ -734,6 +736,7 @@ export default {
|
|||||||
this.userCache = null;
|
this.userCache = null;
|
||||||
this.taskList = null;
|
this.taskList = null;
|
||||||
this.fileList = {};
|
this.fileList = {};
|
||||||
|
this.reportList = {};
|
||||||
this.loadInputDraft()
|
this.loadInputDraft()
|
||||||
inputLoadAdd(id1, this._uid)
|
inputLoadAdd(id1, this._uid)
|
||||||
inputLoadRemove(id2, this._uid)
|
inputLoadRemove(id2, this._uid)
|
||||||
@ -743,6 +746,7 @@ export default {
|
|||||||
this.userCache = null;
|
this.userCache = null;
|
||||||
this.taskList = null;
|
this.taskList = null;
|
||||||
this.fileList = {};
|
this.fileList = {};
|
||||||
|
this.reportList = {};
|
||||||
this.loadInputDraft()
|
this.loadInputDraft()
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1069,7 +1073,7 @@ export default {
|
|||||||
quillMention() {
|
quillMention() {
|
||||||
return {
|
return {
|
||||||
allowedChars: /^\S*$/,
|
allowedChars: /^\S*$/,
|
||||||
mentionDenotationChars: ["@", "#", "~"],
|
mentionDenotationChars: ["@", "#", "~", "%"],
|
||||||
defaultMenuOrientation: this.defaultMenuOrientation,
|
defaultMenuOrientation: this.defaultMenuOrientation,
|
||||||
isolateCharacter: true,
|
isolateCharacter: true,
|
||||||
positioningStrategy: 'fixed',
|
positioningStrategy: 'fixed',
|
||||||
@ -2057,9 +2061,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.fileTimer && clearTimeout(this.fileTimer)
|
this.fileTimer && clearTimeout(this.fileTimer)
|
||||||
this.fileTimer = setTimeout(_ => {
|
this.fileTimer = setTimeout(async _ => {
|
||||||
this.$store.dispatch("searchFiles", searchTerm).then(({data}) => {
|
const lists = [];
|
||||||
this.fileList[searchTerm] = [{
|
const data = (await this.$store.dispatch("searchFiles", searchTerm).catch(_ => {}))?.data;
|
||||||
|
if (data) {
|
||||||
|
lists.push({
|
||||||
label: [{id: 0, value: this.$L('文件分享查看'), disabled: true}],
|
label: [{id: 0, value: this.$L('文件分享查看'), disabled: true}],
|
||||||
list: data.filter(item => item.type !== "folder").map(item => {
|
list: data.filter(item => item.type !== "folder").map(item => {
|
||||||
return {
|
return {
|
||||||
@ -2067,11 +2073,67 @@ export default {
|
|||||||
value: item.ext ? `${item.name}.${item.ext}` : item.name
|
value: item.ext ? `${item.name}.${item.ext}` : item.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}];
|
})
|
||||||
resultCallback(this.fileList[searchTerm])
|
this.fileList[searchTerm] = lists
|
||||||
}).catch(() => {
|
}
|
||||||
resultCallback([])
|
resultCallback(lists)
|
||||||
})
|
}, 300)
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "%": // %报告
|
||||||
|
this.mentionMode = "report-mention";
|
||||||
|
if ($A.isArray(this.reportList[searchTerm])) {
|
||||||
|
resultCallback(this.reportList[searchTerm])
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.reportTimer && clearTimeout(this.reportTimer)
|
||||||
|
this.reportTimer = setTimeout(async _ => {
|
||||||
|
const lists = [];
|
||||||
|
let wait = 2;
|
||||||
|
const myData = (await this.$store.dispatch("call", {
|
||||||
|
url: 'report/my',
|
||||||
|
data: {
|
||||||
|
keys: {
|
||||||
|
key: searchTerm,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).catch(_ => {}))?.data;
|
||||||
|
if (myData) {
|
||||||
|
lists.push({
|
||||||
|
label: [{id: 0, value: this.$L('我的报告'), disabled: true}],
|
||||||
|
list: myData.data.map(item => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
value: item.title
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
wait--
|
||||||
|
}
|
||||||
|
const receiveData = (await this.$store.dispatch("call", {
|
||||||
|
url: 'report/receive',
|
||||||
|
data: {
|
||||||
|
keys: {
|
||||||
|
key: searchTerm,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).catch(_ => {}))?.data;
|
||||||
|
if (receiveData) {
|
||||||
|
lists.push({
|
||||||
|
label: [{id: 0, value: this.$L('收到的报告'), disabled: true}],
|
||||||
|
list: receiveData.data.map(item => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
value: item.title
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
wait--
|
||||||
|
}
|
||||||
|
if (wait === 0) {
|
||||||
|
this.reportList[searchTerm] = lists
|
||||||
|
}
|
||||||
|
resultCallback(lists)
|
||||||
}, 300)
|
}, 300)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user