style: 分享界面显示到期时间

This commit is contained in:
jmal 2023-03-12 17:56:01 +08:00
parent 2defab122d
commit 26403481a9
3 changed files with 27 additions and 18 deletions

View File

@ -163,10 +163,6 @@ export default {
} }
}, },
watch: { watch: {
file(file) {
if (file.fileId) {
}
},
status(visible) { status(visible) {
if(visible){ if(visible){
this.shareDialogVisible = true this.shareDialogVisible = true

View File

@ -2921,7 +2921,6 @@ export default {
this.shareDialogVisible = true this.shareDialogVisible = true
}, },
shareSuccess(shareBase) { shareSuccess(shareBase) {
console.log('shareSuccess', shareBase)
// 这3行代码是为了让vue刷新数据 // 这3行代码是为了让vue刷新数据
const isFavorite = this.rowContextData.isFavorite const isFavorite = this.rowContextData.isFavorite
this.rowContextData.isFavorite = !isFavorite this.rowContextData.isFavorite = !isFavorite

View File

@ -235,6 +235,9 @@
查看文件 查看文件
</el-button> </el-button>
</div> </div>
<div class="share-expire-date">
<span>{{shareData.expireDate ? "到期时间:" + shareData.expireDate : "永久有效"}}</span>
</div>
</div> </div>
<sim-text-preview :file.sync="textPreviewRow" :shareId="shareId" <sim-text-preview :file.sync="textPreviewRow" :shareId="shareId"
@ -243,7 +246,7 @@
:status.sync="imagePreviewVisible"></image-viewer> :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 v-if="!showShareCode" class="grid-divider" content-position="center"><i <el-divider v-if="!linkFailed && !showShareCode" class="grid-divider" content-position="center"><i
class="el-icon-folder-opened"></i>&nbsp;{{ summaries }} class="el-icon-folder-opened"></i>&nbsp;{{ summaries }}
</el-divider> </el-divider>
<el-pagination <el-pagination
@ -422,7 +425,6 @@ export default {
return '' return ''
}, },
imageUrl() { imageUrl() {
console.log('this.$store.getters.shareToken', this.$store.getters.shareToken)
return this.$store.getters.shareToken === undefined ? return this.$store.getters.shareToken === undefined ?
`${process.env.VUE_APP_BASE_API}/public/s/view/thumbnail?id=` : `${process.env.VUE_APP_BASE_API}/public/s/view/thumbnail?id=` :
`${process.env.VUE_APP_BASE_API}/public/s/view/thumbnail?share-token=${this.$store.getters.shareToken}&id=` `${process.env.VUE_APP_BASE_API}/public/s/view/thumbnail?share-token=${this.$store.getters.shareToken}&id=`
@ -430,6 +432,7 @@ export default {
}, },
created() { created() {
this.getFileList() this.getFileList()
this.getSharer();
}, },
mounted() { mounted() {
Bus.$on('fileSuccess', () => { Bus.$on('fileSuccess', () => {
@ -612,22 +615,14 @@ export default {
if (Object.getPrototypeOf(res.data) === String.prototype) { if (Object.getPrototypeOf(res.data) === String.prototype) {
this.prompt = '该链接已失效' this.prompt = '该链接已失效'
} else { } else {
let userId = null
if (res.data.isPrivacy) { if (res.data.isPrivacy) {
this.showShareCode = true this.showShareCode = true
userId = res.data.userId
this.shareData = res.data this.shareData = res.data
} 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) {
userId = this.fileList[0].userId
}
}
if (userId !== null) {
this.getSharer(userId)
} }
if (this.fileList.length > 0 && !this.fileList[0].isPrivacy) { if (this.fileList.length > 0 && !this.fileList[0].isPrivacy) {
store.dispatch('user/resetShareToken').then(() => { store.dispatch('user/resetShareToken').then(() => {
@ -672,8 +667,8 @@ export default {
} }
}) })
}, },
getSharer(userId) { getSharer() {
api.getSharer({userId: userId}).then(res => { api.getSharer({shareId: this.shareId}).then(res => {
this.sharer = res.data this.sharer = res.data
this.sharerAvatarUrl = window.location.origin + this.imageUrl + res.data.avatar this.sharerAvatarUrl = window.location.origin + this.imageUrl + res.data.avatar
if (this.sharer.netdiskName) { if (this.sharer.netdiskName) {
@ -989,7 +984,6 @@ export default {
this.$message({message: '该浏览器不支持自动复制', type: 'warning', duration: 1000}); this.$message({message: '该浏览器不支持自动复制', type: 'warning', duration: 1000});
clipboard.destroy() clipboard.destroy()
}) })
console.log('url', url)
}, },
// 点击文件或文件夹 // 点击文件或文件夹
fileClick(row) { fileClick(row) {
@ -1079,6 +1073,10 @@ export default {
} }
.share-header { .share-header {
text-align: center;
font-size: 18px;
font-weight: 500;
margin-top: 20px;
height: 45px; height: 45px;
.logo { .logo {
@ -1172,7 +1170,17 @@ export default {
.share-code { .share-code {
> > > .el-input { > > > .el-input {
width: 200px; width: 200px;
::placeholder {
text-align: center;
}
input:-moz-placeholder {
text-align: center;
}
input::-webkit-input-placeholder {
text-align: center;
}
} }
} }
.share-code-valid { .share-code-valid {
@ -1183,5 +1191,11 @@ export default {
} }
} }
.share-expire-date {
color: #25262b5c;
font-size: 12px;
margin-top: 10px;
}
</style> </style>