u
This commit is contained in:
1 parent
2fb19021ae
commit
742ca27f2e
4 files changed
+94
-27
No files matched your search
@@ -3,8 +3,6 @@
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
overflow: hidden;
|
||||
border: 1px solid #eef0f2;
|
||||
border-radius: 8px;
|
||||
--g3-z-dropdown: 100;
|
||||
|
||||
--g3-z-toast: 300;
|
||||
@@ -21,7 +19,7 @@
|
||||
width: 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid #eef0f2;
|
||||
border-right: 1px solid #d1d5db;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
@@ -31,7 +29,7 @@
|
||||
height: 50px;
|
||||
padding: 0px 14px;
|
||||
background: #fafbfc;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
border-bottom: 1px solid #d1d5db;
|
||||
}
|
||||
|
||||
.g3-main {
|
||||
@@ -64,7 +62,7 @@
|
||||
justify-content: space-between;
|
||||
padding: 10px 14px;
|
||||
background: #fafbfc;
|
||||
border-top: 1px solid #eee;
|
||||
border-top: 1px solid #d1d5db;
|
||||
}
|
||||
|
||||
.g3-header,
|
||||
@@ -95,17 +93,19 @@
|
||||
}
|
||||
|
||||
.g3-check-all input {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.g3-check-all span {
|
||||
margin-left: 4px;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.g3-btn {
|
||||
font-size: 13px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
background: #165dff;
|
||||
color: #fff;
|
||||
@@ -113,16 +113,20 @@
|
||||
transition: all 0.2s ease;
|
||||
border: none;
|
||||
width: auto;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
padding: 0 15px;
|
||||
padding: 8px 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.g3-btn svg {
|
||||
margin-right: 4px;
|
||||
flex-shrink: 0;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.g3-btn + .g3-btn {
|
||||
@@ -152,7 +156,7 @@
|
||||
min-width: 0;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
border: 1px solid #eef0f2;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
||||
@@ -427,7 +431,7 @@
|
||||
align-items: center;
|
||||
padding: 0 16px;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
border-bottom: 1px solid #d1d5db;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -766,7 +770,7 @@
|
||||
right: 20px;
|
||||
width: 340px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #eef0f2;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
z-index: var(--g3-z-task);
|
||||
@@ -795,7 +799,7 @@
|
||||
justify-content: space-between;
|
||||
padding: 12px 16px;
|
||||
background: #fafbfc;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
border-bottom: 1px solid #d1d5db;
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -547,9 +547,7 @@
|
||||
<label class="g3-checkbox-label"></label>
|
||||
<div class="g3-file-preview">${content}</div>
|
||||
${statusBadge}
|
||||
<div class="g3-file-delete-btn ${deleteDisabled ? "is-disabled" : ""}">
|
||||
${G3FileIcons.action.delete}
|
||||
</div>
|
||||
${deleteDisabled ? "" : `<div class="g3-file-delete-btn">${G3FileIcons.action.delete}</div>`}
|
||||
|
||||
<div class="g3-file-info">
|
||||
<span class="g3-file-name">${file.name}</span>
|
||||
@@ -647,9 +645,6 @@
|
||||
.find(".g3-action-download")
|
||||
.toggleClass("is-disabled", !canDownload);
|
||||
$item.find(".g3-action-preview").toggleClass("is-disabled", !canView);
|
||||
$item
|
||||
.find(".g3-file-delete-btn")
|
||||
.toggleClass("is-disabled", !canDelete);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -684,12 +679,10 @@
|
||||
|
||||
var canDownload = this.hasPermission(file, "download");
|
||||
var canView = this.hasPermission(file, "view");
|
||||
var canDelete = this.hasPermission(file, "delete");
|
||||
$item
|
||||
.find(".g3-action-download")
|
||||
.toggleClass("is-disabled", !canDownload);
|
||||
$item.find(".g3-action-preview").toggleClass("is-disabled", !canView);
|
||||
$item.find(".g3-file-delete-btn").toggleClass("is-disabled", !canDelete);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1005,12 +998,16 @@
|
||||
.on("dragenter", function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$container.addClass("drag-over");
|
||||
if (self.hasPermission(null, "upload")) {
|
||||
$container.addClass("drag-over");
|
||||
}
|
||||
})
|
||||
.on("dragover", function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$container.addClass("drag-over");
|
||||
if (self.hasPermission(null, "upload")) {
|
||||
$container.addClass("drag-over");
|
||||
}
|
||||
})
|
||||
.on("dragleave", function (e) {
|
||||
e.preventDefault();
|
||||
@@ -1024,6 +1021,8 @@
|
||||
e.stopPropagation();
|
||||
$container.removeClass("drag-over");
|
||||
|
||||
if (!self.hasPermission(null, "upload")) return;
|
||||
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
if (files && files.length > 0) {
|
||||
self.handleFileSelect(files);
|
||||
@@ -1037,6 +1036,7 @@
|
||||
var clipboardData = e.originalEvent.clipboardData;
|
||||
var files = clipboardData.files;
|
||||
if (files && files.length > 0) {
|
||||
if (!self.hasPermission(null, "upload")) return;
|
||||
e.preventDefault();
|
||||
self.handleFileSelect(files);
|
||||
}
|
||||
@@ -1640,7 +1640,7 @@
|
||||
self.updateFileStatus(file._id, "uploading");
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
function handleResult(error, uploadedFile) {
|
||||
async function handleResult(error, uploadedFile) {
|
||||
completedCount++;
|
||||
|
||||
if (error) {
|
||||
@@ -1653,7 +1653,10 @@
|
||||
successCount++;
|
||||
self.updateFileStatus(file._id, "uploaded", uploadedFile);
|
||||
if (typeof self.options.onUploadSuccess === "function") {
|
||||
self.options.onUploadSuccess(uploadedFile);
|
||||
var result = self.options.onUploadSuccess(uploadedFile);
|
||||
if (result && typeof result.then === "function") {
|
||||
await result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user