diff --git a/src/components/ShareDialog/index.vue b/src/components/ShareDialog/index.vue
index e6275ac..ad4be62 100644
--- a/src/components/ShareDialog/index.vue
+++ b/src/components/ShareDialog/index.vue
@@ -18,7 +18,7 @@
-
+
@@ -39,6 +39,7 @@
format="yyyy-MM-dd HH:mm"
value-format="timestamp"
@change="pickerChange"
+ :disabled="isSubShare"
:picker-options="pickerOptions">
@@ -47,7 +48,7 @@
分享形式
-
+
@@ -56,7 +57,7 @@
-
+
@@ -93,7 +94,7 @@
-
+
上传
编辑
删除
@@ -225,7 +226,8 @@ export default {
linkLabel: "选择有效期",
},
filename: '',
- shareId: ''
+ shareId: '',
+ isSubShare: false,
}
},
computed: {
@@ -234,11 +236,12 @@ export default {
},
customAddrPrefix() {
return `${window.location.origin}/s/`
- }
+ },
},
watch: {
status(visible) {
if (visible) {
+ this.isSubShare = this.file.subShare || (this.file.isShare && !this.file.shareBase) || this.file.fatherShareId
this.filename = this.file.name
this.shareDialogVisible = true
this.shareOption.customAddr = ''
@@ -250,7 +253,7 @@ export default {
})
this.showSharedPage(this.file)
} else {
- if (this.file.shareBase) {
+ if (this.file.shareBase || this.file.subShare) {
api.getShareByFileId({fileId: this.file.fileId}).then(res => {
const shareObject = res.data
shareObject.shareId = res.data.id
@@ -325,7 +328,7 @@ export default {
},
// 取消分享
cancelShare() {
- let title = '确定要取消分享 "' + this.filename + '" 吗?'
+ let title = '确定要取消分享 "' + this.file.name + '" 吗?'
this.$confirm(title, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -397,7 +400,7 @@ export default {
operationPermissionList: this.shareOption.operationPermissionList
}).then(res => {
if (res.data) {
- let {shareId, shortId, extractionCode, operationPermissionList} = res.data
+ let {shareId, shareBase, subShare, shortId, extractionCode, operationPermissionList} = res.data
this.setShareLink(this.getShareLink(shareId, shortId))
this.shareId = shareId
this.generateShareLinkLoading = false
@@ -406,7 +409,7 @@ export default {
this.shareOptionConfig.linkLabel = "分享链接"
this.extractionCode = extractionCode
this.shareOption.operationPermissionList = operationPermissionList || []
- this.$emit('onSuccess', shareId)
+ this.$emit('onSuccess', shareBase, subShare)
if (update === 'pickerChange') {
this.afterPickerChange(shareId, expireDate)
}
diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue
index cdef358..e4f47ea 100644
--- a/src/components/ShowFile/ShowFile.vue
+++ b/src/components/ShowFile/ShowFile.vue
@@ -3414,7 +3414,7 @@ export default {
if (!row.isFolder && this.queryFileType !== 'trash') {
this.menus.splice(-2, 0, fileOperations.duplicate)
}
- if ((row.isShare && !row.shareBase) || row.ossFolder) {
+ if (row.ossFolder) {
// 删除分享选项
let index = this.menus.findIndex(item => item.operation === 'share')
if (index > -1) {
@@ -4042,16 +4042,19 @@ export default {
this.shareDialogObject = row
this.shareDialogObject.fileId = row.id
this.shareDialogObject.shareBase = row.shareBase
+ this.shareDialogObject.subShare = row.subShare
this.shareDialogVisible = true
},
- shareSuccess(shareBase) {
+ shareSuccess(shareBase, subShare) {
this.updateRowContextData()
this.rowContextData.shareBase = shareBase
+ this.rowContextData.subShare = subShare
this.rowContextData.isShare = true
},
onCancelShare() {
this.updateRowContextData()
delete this.rowContextData.shareBase
+ delete this.rowContextData.subShare
delete this.rowContextData.isShare
},
updateRowContextData() {