diff --git a/src/components/SimpleUploader/globalUploader.vue b/src/components/SimpleUploader/globalUploader.vue
index c32f260..41a4f15 100755
--- a/src/components/SimpleUploader/globalUploader.vue
+++ b/src/components/SimpleUploader/globalUploader.vue
@@ -336,7 +336,7 @@ export default {
this.$nextTick(() => {
$(`
`).appendTo(`.file_${id} .uploader-file-status`).css({
'position': 'absolute',
- // 'top': '-14px',
+ 'top': '-14px',
'font-size': '13px',
'left': '0',
'right': '0',
@@ -398,11 +398,12 @@ export default {
.file-title {
display: flex;
height: 3.5rem;
- line-height: 3.5rem;
+ // line-height: 3.5rem;
padding: 0 10px;
border-bottom: 1px solid #ddd;
.files-title {
margin-left: 3%;
+ font-size: 20px;
}
.operate {
flex: 1;
diff --git a/src/main.js b/src/main.js
index e53b667..f87c5c7 100644
--- a/src/main.js
+++ b/src/main.js
@@ -63,7 +63,7 @@ new Vue({
render: h => h(App)
})
-if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
+if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
Vue.prototype.$pc = false
} else {
Vue.prototype.$pc = true
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 62ed1c4..994beb7 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -1103,9 +1103,6 @@ export default {
font-weight: 700;
color: #C0C4CC;
}
- /deep/ .breadcrumb-svg {
- /*font-size: 20px;*/
- }
.el-breadcrumb {
font-size: 1rem;
diff --git a/src/views/home/mobile/index.vue b/src/views/home/mobile/index.vue
index ee76a08..4525f78 100644
--- a/src/views/home/mobile/index.vue
+++ b/src/views/home/mobile/index.vue
@@ -4,11 +4,10 @@
-
-
+
@@ -57,12 +56,12 @@
{{item.name}}
-
- {{formatTime(item.agoTime)}}
+
+ {{formatTime(item.agoTime)}} {{formatSize(item.size)}}
-
+
@@ -101,6 +100,7 @@
return {
path: this.$route.query.path,
fileList: [],
+ totalSize: 0,
pathList: [
{ 'folder': '', index: 0 },
{ 'folder': '+', index: 1 }
@@ -153,17 +153,24 @@
this.loading = true;
this.getFileList();
},
- getFileList() {
- this.loading = true
+ getFileList(onLoad) {
+ console.log('onLoad', onLoad)
api.fileList({
userId: this.$store.state.user.userId,
currentDirectory: this.$route.query.path,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
}).then(res => {
- this.fileList = res.data
+ if(onLoad){
+ res.data.forEach(file => {
+ this.totalSize += file.size
+ this.fileList.push(file)
+ });
+ }else{
+ this.fileList = res.data
+ }
// 加载状态结束
- this.loading = true;
+ this.loading = false;
this.refreshing = false;
// 数据全部加载完成
if (this.fileList.length >= res.count) {
@@ -171,6 +178,48 @@
}
}).catch(e => {})
},
+ // 统计
+ statistics() {
+ return this.getShowSumFileAndFolder() + ' ' + this.getShowSumSize(this.totalSize)
+ },
+ // 统计文件和文件夹
+ getShowSumFileAndFolder() {
+ let folderSize = 0
+ let fileSize = 0
+ this.fileList.forEach((fileInfo) => {
+ if (fileInfo.isFolder) {
+ folderSize += 1
+ } else {
+ fileSize += 1
+ }
+ })
+ let folderSum = ''
+ if (folderSize > 0) {
+ folderSum = folderSize + '个文件夹'
+ }
+ let fileSum = ''
+ if (fileSize > 0) {
+ fileSum = fileSize + '个文件'
+ }
+ return folderSum + ' ' + fileSum
+ },
+ // 计算总大小
+ getShowSumSize(totalSize) {
+ let sizeSum = ''
+ if (totalSize > 0) {
+ sizeSum = ' 共'
+ }
+ if (totalSize < 1024) {
+ sizeSum += totalSize + 'B'
+ } else if (totalSize >= 1024 && totalSize < 1024 * 1024) {
+ sizeSum += (totalSize / 1024).toFixed(2) + 'K'
+ } else if (totalSize >= 1024 * 1024 && totalSize < 1024 * 1024 * 1024) {
+ sizeSum += (totalSize / (1024 * 1024)).toFixed(2) + 'M'
+ } else {
+ sizeSum += (totalSize / (1024 * 1024 * 1024)).toFixed(2) + 'G'
+ }
+ return sizeSum
+ },
// 点击文件或文件夹
fileClick(row) {
console.log('fileClick', row)