💄 分享界面加入提取码
This commit is contained in:
parent
a2abfa2dbd
commit
c96ea30787
@ -19,7 +19,8 @@
|
|||||||
<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">
|
||||||
<span v-if="index===0">当前位置:</span>
|
<span v-if="index===0">当前位置:</span>
|
||||||
<breadcrumb-file-path :pathList="pathList" :item="item" :index="index" @clickLink="handleLink"></breadcrumb-file-path>
|
<breadcrumb-file-path :pathList="pathList" :item="item" :index="index"
|
||||||
|
@clickLink="handleLink"></breadcrumb-file-path>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
<div class="search-content">
|
<div class="search-content">
|
||||||
@ -39,7 +40,9 @@
|
|||||||
<div class="popper-arrow"></div>
|
<div class="popper-arrow"></div>
|
||||||
<ul v-for="item in menus" :key="item.label">
|
<ul v-for="item in menus" :key="item.label">
|
||||||
<li class="menu-option" @click="menusOperations(item.operation)">
|
<li class="menu-option" @click="menusOperations(item.operation)">
|
||||||
<label class="menuitem"><svg-icon :icon-class="item.iconClass" /><span class="menuitem text">{{ item.label }}</span>
|
<label class="menuitem">
|
||||||
|
<svg-icon :icon-class="item.iconClass"/>
|
||||||
|
<span class="menuitem text">{{ item.label }}</span>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -47,7 +50,7 @@
|
|||||||
|
|
||||||
<!--list布局-->
|
<!--list布局-->
|
||||||
<el-table
|
<el-table
|
||||||
v-show="!grid && !linkFailed"
|
v-show="!grid && !linkFailed && !showShareCode"
|
||||||
ref="fileListTable"
|
ref="fileListTable"
|
||||||
v-loading="tableLoading"
|
v-loading="tableLoading"
|
||||||
style="width: 100%;margin: 20px 0 0 0;"
|
style="width: 100%;margin: 20px 0 0 0;"
|
||||||
@ -100,7 +103,8 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-col v-if="scope.row.index === editingIndex" :span="10">
|
<el-col v-if="scope.row.index === editingIndex" :span="10">
|
||||||
<el-input v-focus v-model="renameFileName" placeholder="" size="small" :clearable="true" @keyup.enter.native="rowRename(renameFileName, scope.row)">
|
<el-input v-focus v-model="renameFileName" placeholder="" size="small" :clearable="true"
|
||||||
|
@keyup.enter.native="rowRename(renameFileName, scope.row)">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button
|
<el-button
|
||||||
v-loading="renameLoading"
|
v-loading="renameLoading"
|
||||||
@ -122,16 +126,19 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column v-if="index === 3 && showUpdateDateItem" :key="index" width="50" :index="index" align="center" header-align="center">
|
<el-table-column v-if="index === 3 && showUpdateDateItem" :key="index" width="50" :index="index" align="center"
|
||||||
|
header-align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column v-if="index === 4 && showUpdateDateItem" :key="index" width="50" :prop="item.name" :label="item.label" :index="index" class="el-icon-more" align="center" header-align="center">
|
<el-table-column v-if="index === 4 && showUpdateDateItem" :key="index" width="50" :prop="item.name"
|
||||||
|
:label="item.label" :index="index" class="el-icon-more" align="center" header-align="center">
|
||||||
<!-- 使用组件, 并传值到组件中 -->
|
<!-- 使用组件, 并传值到组件中 -->
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<svg-icon v-if="item.name !== ''" class="button-class" icon-class="more" @click="moreOperation($event)"/>
|
<svg-icon v-if="item.name !== ''" class="button-class" icon-class="more" @click="moreOperation($event)"/>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<svg-icon v-if="scope.row.index === cellMouseIndex" class="button-class" icon-class="more" @click="moreClick(scope.row,$event)" />
|
<svg-icon v-if="scope.row.index === cellMouseIndex" class="button-class" icon-class="more"
|
||||||
|
@click="moreClick(scope.row,$event)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -172,12 +179,14 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!--grid布局-->
|
<!--grid布局-->
|
||||||
<div v-show="grid && !linkFailed" v-loading="tableLoading"
|
<div v-show="grid && !linkFailed && !showShareCode" v-loading="tableLoading"
|
||||||
element-loading-text="文件加载中"
|
element-loading-text="文件加载中"
|
||||||
element-loading-spinner="el-icon-loading"
|
element-loading-spinner="el-icon-loading"
|
||||||
element-loading-background="#f6f7fa88">
|
element-loading-background="#f6f7fa88">
|
||||||
<div class="checkbox-group-header">
|
<div class="checkbox-group-header">
|
||||||
<van-checkbox class="grid-all-checkbox" @click="clickGridAllCheckBox()" v-model="allChecked">{{indexList.length>0 ? '已选择 '+this.tableHead[2].label : "选择"}}</van-checkbox>
|
<van-checkbox class="grid-all-checkbox" @click="clickGridAllCheckBox()" v-model="allChecked">
|
||||||
|
{{ indexList.length > 0 ? '已选择 ' + this.tableHead[2].label : "选择" }}
|
||||||
|
</van-checkbox>
|
||||||
<el-divider></el-divider>
|
<el-divider></el-divider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -192,24 +201,47 @@
|
|||||||
@click="gridItemClick(item,$event)"
|
@click="gridItemClick(item,$event)"
|
||||||
@contextmenu.prevent="rowContextmenu(item)"
|
@contextmenu.prevent="rowContextmenu(item)"
|
||||||
>
|
>
|
||||||
<van-checkbox v-show="gridHoverItemIndex === index || indexList.includes(index)" class="grid-item-checkbox" :name="item" @click.stop="clickGridItemCheckBox(item,index)"/>
|
<van-checkbox v-show="gridHoverItemIndex === index || indexList.includes(index)"
|
||||||
<div class="grid-item-icon"><icon-file :item="item" :image-url="imageUrl" :grid="true" :grid-width="gridColumnWidth" :public="true"></icon-file></div>
|
class="grid-item-checkbox" :name="item" @click.stop="clickGridItemCheckBox(item,index)"/>
|
||||||
|
<div class="grid-item-icon">
|
||||||
|
<icon-file :item="item" :image-url="imageUrl" :grid="true" :grid-width="gridColumnWidth"
|
||||||
|
:public="true"></icon-file>
|
||||||
|
</div>
|
||||||
<span class="grid-item-text">{{ item.name }}</span>
|
<span class="grid-item-text">{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</van-grid-item>
|
</van-grid-item>
|
||||||
</van-grid>
|
</van-grid>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="linkFailed" class="share-header">
|
<div v-if="linkFailed && !showShareCode" class="share-header">
|
||||||
<p v-if="prompt !== ''">温馨提示:</p>
|
<p v-if="prompt !== ''">温馨提示:</p>
|
||||||
<p>{{ prompt }}</p>
|
<p>{{ prompt }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<sim-text-preview :file.sync="textPreviewRow" :shareId="shareId" :status.sync="textPreviewVisible"></sim-text-preview>
|
<div v-if="showShareCode" class="share-content">
|
||||||
<image-viewer :fileList="fileList" :shareId="shareId" :file="imagePreviewRow" :status.sync="imagePreviewVisible"></image-viewer>
|
<div class="share-icon">
|
||||||
|
<icon-file class="share-icon-font" :item="shareData" :grid="true" :details="true" :image-url="imageUrl"></icon-file>
|
||||||
|
</div>
|
||||||
|
<div class="share-filename">
|
||||||
|
<span>{{ shareData.fileName }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="share-code">
|
||||||
|
<el-input v-model="extractionCode" placeholder="请输入提取码" clearable></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="share-code-valid">
|
||||||
|
<el-button type="primary" :disabled="extractionCode.length === 0">查看文件</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<sim-text-preview :file.sync="textPreviewRow" :shareId="shareId"
|
||||||
|
:status.sync="textPreviewVisible"></sim-text-preview>
|
||||||
|
<image-viewer :fileList="fileList" :shareId="shareId" :file="imagePreviewRow"
|
||||||
|
:status.sync="imagePreviewVisible"></image-viewer>
|
||||||
<video-preview :file="videoPreviewRow" :shareId="shareId" :status.sync="videoPreviewVisible"></video-preview>
|
<video-preview :file="videoPreviewRow" :shareId="shareId" :status.sync="videoPreviewVisible"></video-preview>
|
||||||
<office-preview :file="officePreviewRow" :shareId="shareId" :status.sync="officePreviewVisible"></office-preview>
|
<office-preview :file="officePreviewRow" :shareId="shareId" :status.sync="officePreviewVisible"></office-preview>
|
||||||
<el-divider class="grid-divider" content-position="center"><i class="el-icon-folder-opened"></i> {{summaries}}</el-divider>
|
<el-divider v-if="!showShareCode" class="grid-divider" content-position="center"><i
|
||||||
|
class="el-icon-folder-opened"></i> {{ summaries }}
|
||||||
|
</el-divider>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
background
|
background
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
@ -244,6 +276,7 @@
|
|||||||
import Clipboard from "clipboard";
|
import Clipboard from "clipboard";
|
||||||
import OfficePreview from "@/components/preview/OfficePreview";
|
import OfficePreview from "@/components/preview/OfficePreview";
|
||||||
import Logo from "@/components/Logo";
|
import Logo from "@/components/Logo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Logo,
|
Logo,
|
||||||
@ -367,7 +400,10 @@
|
|||||||
sharer: {},//分享者信息
|
sharer: {},//分享者信息
|
||||||
sharerAvatarUrl: '',
|
sharerAvatarUrl: '',
|
||||||
netdiskName: 'JmalCloud',
|
netdiskName: 'JmalCloud',
|
||||||
netdiskLogo: ''
|
netdiskLogo: '',
|
||||||
|
showShareCode: false,
|
||||||
|
shareData: {},
|
||||||
|
extractionCode: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -426,6 +462,7 @@
|
|||||||
resize: { // 指令的名称
|
resize: { // 指令的名称
|
||||||
bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象
|
bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象
|
||||||
let width = '', height = '';
|
let width = '', height = '';
|
||||||
|
|
||||||
function isReize() {
|
function isReize() {
|
||||||
const style = document.defaultView.getComputedStyle(el);
|
const style = document.defaultView.getComputedStyle(el);
|
||||||
if (width !== style.width || height !== style.height) {
|
if (width !== style.width || height !== style.height) {
|
||||||
@ -434,6 +471,7 @@
|
|||||||
width = style.width;
|
width = style.width;
|
||||||
height = style.height;
|
height = style.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
el.__vueSetInterval__ = setInterval(isReize, 300);
|
el.__vueSetInterval__ = setInterval(isReize, 300);
|
||||||
},
|
},
|
||||||
unbind(el) {
|
unbind(el) {
|
||||||
@ -549,7 +587,8 @@
|
|||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
this.linkFailed = false
|
this.linkFailed = false
|
||||||
})
|
})
|
||||||
}).catch(e => {})
|
}).catch(e => {
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getFileList(pagination, overload) {
|
getFileList(pagination, overload) {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
@ -561,28 +600,40 @@
|
|||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
if (Object.getPrototypeOf(res.data) === String.prototype) {
|
if (Object.getPrototypeOf(res.data) === String.prototype) {
|
||||||
this.prompt = '该链接已失效'
|
this.prompt = '该链接已失效'
|
||||||
|
} else {
|
||||||
|
let userId = null
|
||||||
|
if (res.data.isPrivacy) {
|
||||||
|
this.showShareCode = true
|
||||||
|
userId = res.data.userId
|
||||||
|
this.shareData = res.data
|
||||||
|
console.log('shareData', this.shareData)
|
||||||
} else {
|
} else {
|
||||||
this.fileList = res.data
|
this.fileList = res.data
|
||||||
this.fileList.map((item, index) => {
|
this.fileList.map((item, index) => {
|
||||||
item.index = index
|
item.index = index
|
||||||
})
|
})
|
||||||
if (this.fileList.length > 0) {
|
if (this.fileList.length > 0) {
|
||||||
api.getSharer({userId: this.fileList[0].userId}).then(res => {
|
userId = this.fileList[0].userId
|
||||||
this.sharer = res.data
|
|
||||||
this.sharerAvatarUrl = window.location.origin + this.imageUrl + res.data.avatar
|
|
||||||
if (this.sharer.netdiskName) {
|
|
||||||
this.netdiskName = this.sharer.netdiskName
|
|
||||||
}
|
}
|
||||||
if (this.sharer.netdiskLogo) {
|
|
||||||
this.netdiskLogo = this.sharer.netdiskLogo
|
|
||||||
}
|
}
|
||||||
this.$store.dispatch('user/setLogo', {netdiskName: this.netdiskName, netdiskLogo: this.netdiskLogo})
|
if (userId !== null) {
|
||||||
|
this.getSharer(userId)
|
||||||
|
}
|
||||||
|
if (this.fileList.length > 0) {
|
||||||
|
this.loadShareFileList(pagination, overload, res.count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.tableLoading = false
|
||||||
|
this.linkFailed = true
|
||||||
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
loadShareFileList(pagination, overload, resCount) {
|
||||||
this.loadClientHeight()
|
this.loadClientHeight()
|
||||||
this.listModeSearch = false
|
this.listModeSearch = false
|
||||||
this.listModeSearchOpenDir = false
|
this.listModeSearchOpenDir = false
|
||||||
this.pagination['total'] = res.count
|
this.pagination['total'] = resCount
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.containerResize()
|
this.containerResize()
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
@ -606,10 +657,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getSharer(userId) {
|
||||||
|
api.getSharer({userId: userId}).then(res => {
|
||||||
|
this.sharer = res.data
|
||||||
|
console.log('this.sharer', this.sharer)
|
||||||
|
this.sharerAvatarUrl = window.location.origin + this.imageUrl + res.data.avatar
|
||||||
|
if (this.sharer.netdiskName) {
|
||||||
|
this.netdiskName = this.sharer.netdiskName
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
if (this.sharer.netdiskLogo) {
|
||||||
this.tableLoading = false
|
this.netdiskLogo = this.sharer.netdiskLogo
|
||||||
this.linkFailed = true
|
}
|
||||||
|
this.$store.dispatch('user/setLogo', {netdiskName: this.netdiskName, netdiskLogo: this.netdiskLogo})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
currentChange(pageIndex) {
|
currentChange(pageIndex) {
|
||||||
@ -977,6 +1037,7 @@
|
|||||||
min-width: 1024px;
|
min-width: 1024px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-location {
|
.header-location {
|
||||||
display: block;
|
display: block;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
@ -987,57 +1048,111 @@
|
|||||||
.search-class {
|
.search-class {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-h {
|
.share-h {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header {
|
.share-header {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header-content {
|
.share-header-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sharer {
|
.sharer {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
float: right;
|
float: right;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
margin-top: -34px;
|
margin-top: -34px;
|
||||||
|
|
||||||
> > > .el-avatar {
|
> > > .el-avatar {
|
||||||
margin: 0 0 0 10px;
|
margin: 0 0 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user {
|
.user {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> > > .el-table {
|
> > > .el-table {
|
||||||
&::before {
|
&::before {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table__footer-wrapper {
|
.el-table__footer-wrapper {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-divider {
|
.grid-divider {
|
||||||
height: 0;
|
height: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|
||||||
> > > .el-divider__text {
|
> > > .el-divider__text {
|
||||||
}
|
}
|
||||||
|
|
||||||
> > > .el-divider__text.is-center {
|
> > > .el-divider__text.is-center {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.newFileMenu li > .menuitem > .text {
|
.newFileMenu li > .menuitem > .text {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.share-content {
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-icon {
|
||||||
|
margin: 20px 0 20px 0;
|
||||||
|
>>> .icon-favorite {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
>>> .icon-share {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.share-icon-font >>> .svg-icon {
|
||||||
|
font-size: 8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-filename {
|
||||||
|
margin: 25px 0 50px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-code {
|
||||||
|
>>> .el-input {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-code-valid {
|
||||||
|
margin-top: 20px;
|
||||||
|
>>> .el-button {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user