mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 优化拖拽文件夹上传提示
This commit is contained in:
parent
bbdf4932e3
commit
829ed0a575
@ -1277,3 +1277,8 @@ AI机器人
|
||||
支持 http 或 socks 代理
|
||||
例如:http://proxy.com 或 socks5://proxy.com
|
||||
查看 Cookie 中的 sessionKey 便是
|
||||
|
||||
暂不支持拖拽文件夹。
|
||||
暂不支持粘贴文件夹。
|
||||
暂不支持拖拽文件夹,请手动上传文件夹。
|
||||
暂不支持粘贴文件夹,请手动上传文件夹。
|
||||
|
||||
17
resources/assets/js/functions/web.js
vendored
17
resources/assets/js/functions/web.js
vendored
@ -869,6 +869,23 @@
|
||||
url = $A.rightDelete(url, '_thumb.jpg')
|
||||
url = $A.rightDelete(url, '_thumb.png')
|
||||
return url
|
||||
},
|
||||
|
||||
/**
|
||||
* 拖拽或粘贴的数据是否包含文件夹
|
||||
* @param data
|
||||
* @returns {boolean}
|
||||
*/
|
||||
dataHasFolder(data) {
|
||||
const {items} = data;
|
||||
if (items) {
|
||||
for (const item of items) {
|
||||
if (!(item.kind === "file" && item.webkitGetAsEntry().isFile)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1582,6 +1582,11 @@ export default {
|
||||
|
||||
chatPasteDrag(e, type) {
|
||||
this.dialogDrag = false;
|
||||
if ($A.dataHasFolder(type === 'drag' ? e.dataTransfer : e.clipboardData)) {
|
||||
e.preventDefault();
|
||||
$A.modalWarning(`暂不支持${type === 'drag' ? '拖拽' : '粘贴'}文件夹。`)
|
||||
return;
|
||||
}
|
||||
const files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
|
||||
const postFiles = Array.prototype.slice.call(files);
|
||||
if (postFiles.length > 0) {
|
||||
|
||||
@ -1421,6 +1421,11 @@ export default {
|
||||
|
||||
taskPasteDrag(e, type) {
|
||||
this.dialogDrag = false;
|
||||
if ($A.dataHasFolder(type === 'drag' ? e.dataTransfer : e.clipboardData)) {
|
||||
e.preventDefault();
|
||||
$A.modalWarning(`暂不支持${type === 'drag' ? '拖拽' : '粘贴'}文件夹。`)
|
||||
return;
|
||||
}
|
||||
const files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
|
||||
this.msgFile = Array.prototype.slice.call(files);
|
||||
if (this.msgFile.length > 0) {
|
||||
|
||||
@ -1686,6 +1686,11 @@ export default {
|
||||
|
||||
filePasteDrag(e, type) {
|
||||
this.dialogDrag = false;
|
||||
if ($A.dataHasFolder(type === 'drag' ? e.dataTransfer : e.clipboardData)) {
|
||||
e.preventDefault();
|
||||
$A.modalWarning(`暂不支持${type === 'drag' ? '拖拽' : '粘贴'}文件夹,请手动上传文件夹。`)
|
||||
return;
|
||||
}
|
||||
this.pasteDragNext(e, type);
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user