修改移动端index
This commit is contained in:
parent
6241adfa73
commit
d9e7b3ce44
@ -336,7 +336,7 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
$(`<p class="myStatus_${id}"></p>`).appendTo(`.file_${id} .uploader-file-status`).css({
|
$(`<p class="myStatus_${id}"></p>`).appendTo(`.file_${id} .uploader-file-status`).css({
|
||||||
'position': 'absolute',
|
'position': 'absolute',
|
||||||
// 'top': '-14px',
|
'top': '-14px',
|
||||||
'font-size': '13px',
|
'font-size': '13px',
|
||||||
'left': '0',
|
'left': '0',
|
||||||
'right': '0',
|
'right': '0',
|
||||||
@ -398,11 +398,12 @@ export default {
|
|||||||
.file-title {
|
.file-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 3.5rem;
|
height: 3.5rem;
|
||||||
line-height: 3.5rem;
|
// line-height: 3.5rem;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
.files-title {
|
.files-title {
|
||||||
margin-left: 3%;
|
margin-left: 3%;
|
||||||
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
.operate {
|
.operate {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -63,7 +63,7 @@ new Vue({
|
|||||||
render: h => h(App)
|
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
|
Vue.prototype.$pc = false
|
||||||
} else {
|
} else {
|
||||||
Vue.prototype.$pc = true
|
Vue.prototype.$pc = true
|
||||||
|
|||||||
@ -1103,9 +1103,6 @@ export default {
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #C0C4CC;
|
color: #C0C4CC;
|
||||||
}
|
}
|
||||||
/deep/ .breadcrumb-svg {
|
|
||||||
/*font-size: 20px;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-breadcrumb {
|
.el-breadcrumb {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
|||||||
@ -4,11 +4,10 @@
|
|||||||
<van-list
|
<van-list
|
||||||
v-model="loading"
|
v-model="loading"
|
||||||
:finished="finished"
|
:finished="finished"
|
||||||
finished-text="没有更多了"
|
:finished-text="statistics()"
|
||||||
@load="getFileList"
|
@load="getFileList(true)"
|
||||||
>
|
>
|
||||||
<van-sticky :offset-top="0">
|
<!-- <van-sticky :offset-top="0">
|
||||||
<!--<van-button type="info">吸顶距离</van-button>-->
|
|
||||||
<van-row class="classification">
|
<van-row class="classification">
|
||||||
<van-col span="6" align="center">
|
<van-col span="6" align="center">
|
||||||
<svg-icon icon-class="image" />
|
<svg-icon icon-class="image" />
|
||||||
@ -27,7 +26,7 @@
|
|||||||
<div>音乐</div>
|
<div>音乐</div>
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
</van-sticky>
|
</van-sticky> -->
|
||||||
|
|
||||||
<!--<van-cell v-for="item in fileList" :key="item.id" :title="item.name"></van-cell>-->
|
<!--<van-cell v-for="item in fileList" :key="item.id" :title="item.name"></van-cell>-->
|
||||||
<!--<van-cell v-for="item in fileList" :key="item.id" :title="item.name" :label="item.updateDate"></van-cell>-->
|
<!--<van-cell v-for="item in fileList" :key="item.id" :title="item.name" :label="item.updateDate"></van-cell>-->
|
||||||
@ -57,12 +56,12 @@
|
|||||||
{{item.name}}
|
{{item.name}}
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="16" class="file-description" justify="space-between">
|
<van-col span="16" class="file-description" justify="space-between">
|
||||||
<van-col span="8">
|
<van-col span="12">
|
||||||
{{formatTime(item.agoTime)}}
|
{{formatTime(item.agoTime)}} {{formatSize(item.size)}}
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="8">
|
<!-- <van-col span="8">
|
||||||
{{formatSize(item.size)}}
|
{{formatSize(item.size)}}
|
||||||
</van-col>
|
</van-col> -->
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="4"></van-col>
|
<van-col span="4"></van-col>
|
||||||
@ -101,6 +100,7 @@
|
|||||||
return {
|
return {
|
||||||
path: this.$route.query.path,
|
path: this.$route.query.path,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
totalSize: 0,
|
||||||
pathList: [
|
pathList: [
|
||||||
{ 'folder': '', index: 0 },
|
{ 'folder': '', index: 0 },
|
||||||
{ 'folder': '+', index: 1 }
|
{ 'folder': '+', index: 1 }
|
||||||
@ -153,17 +153,24 @@
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.getFileList();
|
this.getFileList();
|
||||||
},
|
},
|
||||||
getFileList() {
|
getFileList(onLoad) {
|
||||||
this.loading = true
|
console.log('onLoad', onLoad)
|
||||||
api.fileList({
|
api.fileList({
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
currentDirectory: this.$route.query.path,
|
currentDirectory: this.$route.query.path,
|
||||||
pageIndex: this.pagination.pageIndex,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: this.pagination.pageSize,
|
pageSize: this.pagination.pageSize,
|
||||||
}).then(res => {
|
}).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;
|
this.refreshing = false;
|
||||||
// 数据全部加载完成
|
// 数据全部加载完成
|
||||||
if (this.fileList.length >= res.count) {
|
if (this.fileList.length >= res.count) {
|
||||||
@ -171,6 +178,48 @@
|
|||||||
}
|
}
|
||||||
}).catch(e => {})
|
}).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) {
|
fileClick(row) {
|
||||||
console.log('fileClick', row)
|
console.log('fileClick', row)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user