完成文件上传管理

This commit is contained in:
augushong
2021-06-19 18:41:05 +08:00
parent ae9f2c6999
commit 1be98f85b6
30 changed files with 51988 additions and 163 deletions

View File

@@ -0,0 +1,29 @@
body {
background-color: #e2e2e2;
}
.file-list {
padding: 15px;
margin : 15px;
border : 3px dashed #bbb;
min-height: 200px;
}
.file-item {
display : flex;
align-items : center;
justify-content: space-between;
background-color: #ddd;
padding: 5px;
cursor: pointer;
}
.file-item:hover{
background-color: #ccc;
}
.file-size{
margin-left: 15px;
color: #999;
}

View File

@@ -26,7 +26,7 @@ function renderUpload(target, params) {
var type = params.type
}
if(typeof window.uploadAddressPrefix == 'undefined'){
if (typeof window.uploadAddressPrefix == 'undefined') {
window.uploadAddressPrefix = '/api/'
}
@@ -109,4 +109,18 @@ function renderUpload(target, params) {
layer.close(window.uploading)
}
})
}
function formatSize(filesize) {
var value = filesize
if (null == value || value == '') {
return "0 Bytes";
}
var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
var index = 0;
var srcsize = parseFloat(value);
index = Math.floor(Math.log(srcsize) / Math.log(1024));
var size = srcsize / Math.pow(1024, index);
size = size.toFixed(2);//保留的小数位数
return size + unitArr[index];
}

View File

@@ -0,0 +1,25 @@
目录说明
========================
```bash
├── Uploader.swf # SWF文件当使用Flash运行时需要引入。
├── webuploader.js # 完全版本。
├── webuploader.min.js # min版本
├── webuploader.flashonly.js # 只有Flash实现的版本。
├── webuploader.flashonly.min.js # min版本
├── webuploader.html5only.js # 只有Html5实现的版本。
├── webuploader.html5only.min.js # min版本
├── webuploader.noimage.js # 去除图片处理的版本包括HTML5和FLASH.
├── webuploader.noimage.min.js # min版本
├── webuploader.custom.js # 自定义打包方案,请查看 Gruntfile.js满足移动端使用。
└── webuploader.custom.min.js # min版本
```
## 示例
请把整个 Git 包下载下来放在 php 服务器下,因为默认提供的文件接受是用 php 编写的,打开 examples 页面便能查看示例效果。

Binary file not shown.

View File

@@ -0,0 +1,28 @@
.webuploader-container {
position: relative;
}
.webuploader-element-invisible {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px,1px,1px,1px);
}
.webuploader-pick {
position: relative;
display: inline-block;
cursor: pointer;
background: #00b7ee;
padding: 10px 15px;
color: #fff;
text-align: center;
border-radius: 3px;
overflow: hidden;
}
.webuploader-pick-hover {
background: #00a2d4;
}
.webuploader-pick-disable {
opacity: 0.6;
pointer-events:none;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long