Merge branch 'master' of https://github.com/jamebal/jmal-cloud-view
This commit is contained in:
commit
6241adfa73
@ -14,7 +14,7 @@ import store from './store'
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
// import WeVue from 'we-vue'
|
// import WeVue from 'we-vue'
|
||||||
// import 'we-vue/lib/style.css'
|
// import 'we-vue/lib/style.css'
|
||||||
import { Button, Cell, CellGroup, Image, List, PullRefresh, SwipeCell, Col, Row, Divider } from 'vant';
|
import { Button, Cell, CellGroup, Image, List, PullRefresh, SwipeCell, Col, Row, Divider, Sticky } from 'vant';
|
||||||
|
|
||||||
import '@/icons' // icon
|
import '@/icons' // icon
|
||||||
import '@/permission' // permission control
|
import '@/permission' // permission control
|
||||||
@ -49,6 +49,7 @@ Vue.use(SwipeCell);
|
|||||||
Vue.use(Col);
|
Vue.use(Col);
|
||||||
Vue.use(Row);
|
Vue.use(Row);
|
||||||
Vue.use(Divider);
|
Vue.use(Divider);
|
||||||
|
Vue.use(Sticky);
|
||||||
|
|
||||||
Vue.use(uploader)
|
Vue.use(uploader)
|
||||||
Vue.use(EVueContextmenu)
|
Vue.use(EVueContextmenu)
|
||||||
|
|||||||
@ -102,7 +102,9 @@ export function formatTime(agoTime) {
|
|||||||
* @param {*} size
|
* @param {*} size
|
||||||
*/
|
*/
|
||||||
export function formatSize(size) {
|
export function formatSize(size) {
|
||||||
if (size < 1024) {
|
if (size === 0) {
|
||||||
|
return ''
|
||||||
|
} else if (size < 1024) {
|
||||||
return size + 'B'
|
return size + 'B'
|
||||||
} else if (size < 1024 * 1024) {
|
} else if (size < 1024 * 1024) {
|
||||||
return (size/1024).toFixed(2) + 'k'
|
return (size/1024).toFixed(2) + 'k'
|
||||||
|
|||||||
@ -4,16 +4,29 @@
|
|||||||
<transition-group name="breadcrumb">
|
<transition-group name="breadcrumb">
|
||||||
<el-breadcrumb-item v-for="(item,index) in pathList" :key="item.index">
|
<el-breadcrumb-item v-for="(item,index) in pathList" :key="item.index">
|
||||||
<a v-if="index===0" @click.prevent="handleLink(item,index)"><svg-icon icon-class="home" style="font-size: 24px;"/></a>
|
<a v-if="index===0" @click.prevent="handleLink(item,index)"><svg-icon icon-class="home" style="font-size: 24px;"/></a>
|
||||||
|
<a v-if="pathList.length >= 7">
|
||||||
|
<span v-if="index === pathList.length-6" class="redirect" > </span>
|
||||||
|
<a v-if="index === pathList.length-6" class="redirect" @click.prevent="handleLink(item,index)">...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
||||||
|
<a v-if="index >= pathList.length-6 && index < pathList.length-2 && strLength(item.folder) <= 10" class="redirect" @click.prevent="handleLink(item,index)">{{ item.folder }}<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
||||||
|
<el-tooltip class="item" effect="dark" :content="item.folder" placement="top">
|
||||||
|
<a v-if="index >= pathList.length-6 && index < pathList.length-2 && strLength(item.folder) > 10" class="redirect" @click.prevent="handleLink(item,index)">{{ substring10(item.folder) }}...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
||||||
|
</el-tooltip>
|
||||||
|
</a>
|
||||||
|
<a v-if="pathList.length < 7">
|
||||||
|
<a v-if="index < pathList.length-2 && strLength(item.folder) <= 10" class="redirect" @click.prevent="handleLink(item,index)">{{ item.folder }}<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
||||||
|
<el-tooltip class="item" effect="dark" :content="item.folder" placement="top">
|
||||||
|
<a v-if="index < pathList.length-2 && strLength(item.folder) > 10" class="redirect" @click.prevent="handleLink(item,index)">{{ substring10(item.folder) }}...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
||||||
|
</el-tooltip>
|
||||||
|
</a>
|
||||||
|
<a v-if="index===pathList.length-2">
|
||||||
|
<span v-if="strLength(item.folder) <= 10" class="no-redirect">{{ item.folder }}</span>
|
||||||
|
<el-tooltip class="item" effect="dark" :content="item.folder" placement="top">
|
||||||
|
<span :title="item.folder" v-if="strLength(item.folder) > 10 && strLength(item.folder) <= 50 && item.searchKey" class="no-redirect">{{ item.folder }}</span>
|
||||||
|
<span :title="item.folder" v-if="strLength(item.folder) > 50 && item.searchKey" class="no-redirect">{{ substring10(item.folder) }}...</span>
|
||||||
|
<span :title="item.folder" v-if="strLength(item.folder) > 10 && !item.searchKey" class="no-redirect">{{ substring10(item.folder) }}...</span>
|
||||||
|
</el-tooltip>
|
||||||
|
</a>
|
||||||
|
|
||||||
<span v-if="pathList.length >= 7 && index === pathList.length-6" class="redirect" > </span>
|
|
||||||
<a v-if="pathList.length >= 7 && index === pathList.length-6" class="redirect" @click.prevent="handleLink(item,index)">...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
|
||||||
<a v-if="pathList.length >= 7 && index >= pathList.length-6 && index < pathList.length-2 && strLength(item.folder) <= 10" class="redirect" @click.prevent="handleLink(item,index)">{{ item.folder }}<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
|
||||||
<a v-if="pathList.length >= 7 && index >= pathList.length-6 && index < pathList.length-2 && strLength(item.folder) > 10" class="redirect" @click.prevent="handleLink(item,index)">{{ substring10(item.folder) }}...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
|
||||||
<a v-if="pathList.length < 7 && index < pathList.length-2 && strLength(item.folder) <= 10" class="redirect" @click.prevent="handleLink(item,index)">{{ item.folder }}<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
|
||||||
<a v-if="pathList.length < 7 && index < pathList.length-2 && strLength(item.folder) > 10" class="redirect" @click.prevent="handleLink(item,index)">{{ substring10(item.folder) }}...<svg-icon style="font-size: 1rem;" icon-class="breadcrumb-right" /></a>
|
|
||||||
|
|
||||||
<span v-if="index===pathList.length-2 && strLength(item.folder) <= 10" class="no-redirect">{{ item.folder }}</span>
|
|
||||||
<span v-if="index===pathList.length-2 && strLength(item.folder) > 10" class="no-redirect">{{ substring10(item.folder) }}...</span>
|
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="index===pathList.length-1"
|
v-if="index===pathList.length-1"
|
||||||
v-model="isShowNewFolder"
|
v-model="isShowNewFolder"
|
||||||
@ -224,9 +237,18 @@
|
|||||||
<span v-if="scope.row.agoTime >= 1000*60*60*24*30*12"> {{ (scope.row.agoTime/(1000*60*60*24*30*12)).toFixed(0) }} 年前</span>
|
<span v-if="scope.row.agoTime >= 1000*60*60*24*30*12"> {{ (scope.row.agoTime/(1000*60*60*24*30*12)).toFixed(0) }} 年前</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:hide-on-single-page="true"
|
||||||
|
:current-page.sync="pagination.pageIndex"
|
||||||
|
:page-sizes="pagination.pageSizes"
|
||||||
|
:page-size="pagination.pageSize"
|
||||||
|
:total="pagination.total"
|
||||||
|
@current-change="currentChange">
|
||||||
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -260,6 +282,12 @@ export default {
|
|||||||
{ 'folder': '+', index: 1 }
|
{ 'folder': '+', index: 1 }
|
||||||
],
|
],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
pagination: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 25,
|
||||||
|
total: 0,
|
||||||
|
pageSizes: [10,20,30,40,50]
|
||||||
|
},
|
||||||
indexList: [],
|
indexList: [],
|
||||||
clientHeight: 500,
|
clientHeight: 500,
|
||||||
// 表头数据
|
// 表头数据
|
||||||
@ -352,7 +380,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const that = this
|
const that = this
|
||||||
window.onresize = function temp() {
|
window.onresize = function temp() {
|
||||||
that.clientHeight = document.documentElement.clientHeight - 150
|
that.clientHeight = document.documentElement.clientHeight - 165
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
@ -427,6 +455,7 @@ export default {
|
|||||||
setPath(this.path, this.pathList)
|
setPath(this.path, this.pathList)
|
||||||
this.getFileList()
|
this.getFileList()
|
||||||
}
|
}
|
||||||
|
console.log("this.pathList:", this.pathList)
|
||||||
},
|
},
|
||||||
newFolder() {
|
newFolder() {
|
||||||
this.newFolderName = '新建文件夹'
|
this.newFolderName = '新建文件夹'
|
||||||
@ -515,14 +544,15 @@ export default {
|
|||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
keyword: key,
|
keyword: key,
|
||||||
currentDirectory: getPath(),
|
currentDirectory: getPath(),
|
||||||
pageIndex: 1,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: 30
|
pageSize: this.pagination.pageSize
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.fileList = res.data
|
this.fileList = res.data
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
this.clientHeight = document.documentElement.clientHeight - 150
|
this.clientHeight = document.documentElement.clientHeight - 165
|
||||||
this.listModeSearch = true
|
this.listModeSearch = true
|
||||||
this.path = ''
|
this.path = ''
|
||||||
|
this.pagination['total'] = res.count
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
}else{
|
}else{
|
||||||
this.handleLink('',0)
|
this.handleLink('',0)
|
||||||
@ -534,13 +564,14 @@ export default {
|
|||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
currentDirectory: getPath(),
|
currentDirectory: getPath(),
|
||||||
pageIndex: 1,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: 30
|
pageSize: this.pagination.pageSize
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.fileList = res.data
|
this.fileList = res.data
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
this.clientHeight = document.documentElement.clientHeight - 150
|
this.clientHeight = document.documentElement.clientHeight - 165
|
||||||
this.listModeSearch = true
|
this.listModeSearch = true
|
||||||
|
this.pagination['total'] = res.count
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
this.path = row.path + row.name
|
this.path = row.path + row.name
|
||||||
},
|
},
|
||||||
@ -549,13 +580,14 @@ export default {
|
|||||||
api.fileList({
|
api.fileList({
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
currentDirectory: getPath(),
|
currentDirectory: getPath(),
|
||||||
pageIndex: 1,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: 30
|
pageSize: this.pagination.pageSize
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.fileList = res.data
|
this.fileList = res.data
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
this.clientHeight = document.documentElement.clientHeight - 150
|
this.clientHeight = document.documentElement.clientHeight - 165
|
||||||
this.listModeSearch = false
|
this.listModeSearch = false
|
||||||
|
this.pagination['total'] = res.count
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
},
|
},
|
||||||
getFileListBySearchMode() {
|
getFileListBySearchMode() {
|
||||||
@ -563,15 +595,24 @@ export default {
|
|||||||
api.fileList({
|
api.fileList({
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
currentDirectory: this.path,
|
currentDirectory: this.path,
|
||||||
pageIndex: 1,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: 30
|
pageSize: 30
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.fileList = res.data
|
this.fileList = res.data
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
this.clientHeight = document.documentElement.clientHeight - 150
|
this.clientHeight = document.documentElement.clientHeight - 165
|
||||||
this.listModeSearch = true
|
this.listModeSearch = true
|
||||||
|
this.pagination['total'] = res.count
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
},
|
},
|
||||||
|
currentChange(pageIndex) {
|
||||||
|
this.pagination.pageIndex = pageIndex
|
||||||
|
if (this.listModeSearch) {
|
||||||
|
this.searchFile(this.searchFileName)
|
||||||
|
} else {
|
||||||
|
this.getFileList()
|
||||||
|
}
|
||||||
|
},
|
||||||
getSummaries(param) {
|
getSummaries(param) {
|
||||||
// 合计
|
// 合计
|
||||||
const { columns, data } = param
|
const { columns, data } = param
|
||||||
@ -1226,5 +1267,10 @@ export default {
|
|||||||
width: 30%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-pagination {
|
||||||
|
float: right;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user