💄 优化分享对话框
This commit is contained in:
parent
8021e1413b
commit
fd292bcb54
@ -62,8 +62,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="small" v-if="!shareOptionConfig.shared" type="primary" @click="submitShare" v-loading="generateShareLinkLoading">创建分享</el-button>
|
<el-button size="small" v-if="!shareOptionConfig.shared" type="primary" @click="submitShare" v-loading="generateShareLinkLoading">创建分享</el-button>
|
||||||
<el-button size="small" class="tag-share-link" v-if="shareOptionConfig.shared && shareOption.isPrivacy" @click="copyShareLink" :data-clipboard-text="shareLink + '&code=' + extractionCode">复制链接和提取码</el-button>
|
<el-button size="small" class="tag-share-link" v-if="shareOptionConfig.shared && shareOption.isPrivacy" @click="copyShareLink('口令复制成功')" :data-clipboard-text="file.name + ' ' + shareLink + ' 提取码:' + extractionCode">复制口令</el-button>
|
||||||
<el-button size="small" class="tag-share-link" v-if="shareOptionConfig.shared" type="primary" @click="copyShareLink" :data-clipboard-text="shareLink">复制链接</el-button>
|
<el-button size="small" class="tag-share-link" v-if="shareOptionConfig.shared" type="primary" @click="copyShareLink('链接复制成功')" :data-clipboard-text="shareLink">复制链接</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</di>
|
</di>
|
||||||
@ -165,14 +165,12 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
file(file) {
|
file(file) {
|
||||||
if (file.fileId) {
|
if (file.fileId) {
|
||||||
console.log('file', file)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
status(visible) {
|
status(visible) {
|
||||||
if(visible){
|
if(visible){
|
||||||
this.shareDialogVisible = true
|
this.shareDialogVisible = true
|
||||||
if (this.file.shareId) {
|
if (this.file.shareId) {
|
||||||
console.log('share', this.file)
|
|
||||||
this.shareOptionConfig.shared = true
|
this.shareOptionConfig.shared = true
|
||||||
this.shareOptionConfig.linkLabel = '分享链接'
|
this.shareOptionConfig.linkLabel = '分享链接'
|
||||||
this.shareLink = this.getShareLink(this.file.shareId)
|
this.shareLink = this.getShareLink(this.file.shareId)
|
||||||
@ -194,7 +192,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
shareDialogClose() {
|
shareDialogClose() {
|
||||||
console.log('shareDialogClose')
|
|
||||||
this.shareOptionConfig.shared = false
|
this.shareOptionConfig.shared = false
|
||||||
this.$emit('update:status', this.shareDialogVisible)
|
this.$emit('update:status', this.shareDialogVisible)
|
||||||
},
|
},
|
||||||
@ -251,7 +248,6 @@ export default {
|
|||||||
isPrivacy: this.shareOption.isPrivacy
|
isPrivacy: this.shareOption.isPrivacy
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
console.log(res.data)
|
|
||||||
let {shareId, extractionCode} = res.data
|
let {shareId, extractionCode} = res.data
|
||||||
this.shareLink = this.getShareLink(shareId)
|
this.shareLink = this.getShareLink(shareId)
|
||||||
this.generateShareLinkLoading = false
|
this.generateShareLinkLoading = false
|
||||||
@ -278,13 +274,13 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 复制分享链接
|
// 复制分享链接
|
||||||
copyShareLink() {
|
copyShareLink(msg) {
|
||||||
let clipboard = new Clipboard('.tag-share-link')
|
let clipboard = new Clipboard('.tag-share-link')
|
||||||
clipboard.on('success', e => {
|
clipboard.on('success', e => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '复制成功',
|
message: msg,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1000
|
duration: 3000
|
||||||
});
|
});
|
||||||
// 释放内存
|
// 释放内存
|
||||||
clipboard.destroy()
|
clipboard.destroy()
|
||||||
|
|||||||
@ -825,7 +825,8 @@ export default {
|
|||||||
if (abb.length + 1 >= filename.length) {
|
if (abb.length + 1 >= filename.length) {
|
||||||
return filename
|
return filename
|
||||||
}
|
}
|
||||||
return prev + "…" + next
|
// return prev + "…" + next
|
||||||
|
return filename
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSummaries2() {
|
getSummaries2() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user