feat: 分享文件添加的操作权限
This commit is contained in:
parent
dd0b321f49
commit
515f8d2a27
@ -16,9 +16,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-form ref="form" class="share-option" :model="shareOption" label-width="82px" size="mini">
|
<el-form ref="form" class="share-option" :model="shareOption" label-width="82px" size="mini">
|
||||||
<el-form-item :label="shareOptionConfig.linkLabel">
|
<el-form-item :label="shareOptionConfig.linkLabel">
|
||||||
<el-col :span="9" class="share-expires-data" v-if="!shareOptionConfig.shared">
|
<el-col :span="shareOptionConfig.shared ? 9 : 20" class="share-expires-data" v-if="!shareOptionConfig.shared">
|
||||||
<el-form-item prop="expiresDateOption">
|
<el-form-item prop="expiresDateOption">
|
||||||
<el-select size="small" v-model="shareOption.expiresDateOption" @change="expiresDateOptionChange">
|
<el-select size="small" v-model="shareOption.expiresDateOption" @change="expiresDateOptionChange" style="width: 100%">
|
||||||
<el-option label="30天有效" :value="0"></el-option>
|
<el-option label="30天有效" :value="0"></el-option>
|
||||||
<el-option label="永久有效" :value="1"></el-option>
|
<el-option label="永久有效" :value="1"></el-option>
|
||||||
<el-option label="自定义" :value="2"></el-option>
|
<el-option label="自定义" :value="2"></el-option>
|
||||||
@ -46,8 +46,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="!shareOptionConfig.shared" class="share-option-form" label="分享形式" width="100">
|
<el-form-item v-if="!shareOptionConfig.shared" class="share-option-form" label="分享形式" width="100">
|
||||||
<el-col :span="9">
|
<el-col :span="20">
|
||||||
<el-select size="small" v-model="shareOption.isPrivacy">
|
<el-select size="small" v-model="shareOption.isPrivacy" style="width: 100%">
|
||||||
<el-option label="公开链接" :value="false"></el-option>
|
<el-option label="公开链接" :value="false"></el-option>
|
||||||
<el-option label="私密链接" :value="true"></el-option>
|
<el-option label="私密链接" :value="true"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -72,6 +72,17 @@
|
|||||||
readonly="readonly" v-model="extractionCode">
|
readonly="readonly" v-model="extractionCode">
|
||||||
<template slot="prepend">提取码</template>
|
<template slot="prepend">提取码</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
|
<el-collapse accordion v-if="shareOptionConfig.shared && shareOption.isPrivacy">
|
||||||
|
<el-collapse-item title="操作权限">
|
||||||
|
<el-checkbox-group v-model="shareOption.operationPermissionList" @change="permissionActionChange">
|
||||||
|
<el-checkbox label="UPLOAD">上传</el-checkbox>
|
||||||
|
<el-checkbox label="PUT">修改</el-checkbox>
|
||||||
|
<el-checkbox label="DELETE">删除</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -181,6 +192,7 @@ export default {
|
|||||||
expiresDateOption: 1,
|
expiresDateOption: 1,
|
||||||
isPrivacy: false,
|
isPrivacy: false,
|
||||||
expiresDate: '',
|
expiresDate: '',
|
||||||
|
operationPermissionList: []
|
||||||
},
|
},
|
||||||
shareLink: "",
|
shareLink: "",
|
||||||
qrCodeshareLink: "",
|
qrCodeshareLink: "",
|
||||||
@ -213,6 +225,7 @@ export default {
|
|||||||
this.shareOptionConfig.linkLabel = '分享链接'
|
this.shareOptionConfig.linkLabel = '分享链接'
|
||||||
this.setShareLink(this.getShareLink(this.file.shareId))
|
this.setShareLink(this.getShareLink(this.file.shareId))
|
||||||
this.shareOption.isPrivacy = this.file.isPrivacy
|
this.shareOption.isPrivacy = this.file.isPrivacy
|
||||||
|
this.shareOption.operationPermissionList = this.file.operationPermissionList
|
||||||
if (this.file.expireDate) {
|
if (this.file.expireDate) {
|
||||||
this.shareOption.expiresDate = moment(this.file.expireDate).format('x')
|
this.shareOption.expiresDate = moment(this.file.expireDate).format('x')
|
||||||
}
|
}
|
||||||
@ -229,9 +242,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setShareLink(sahreLink) {
|
permissionActionChange() {
|
||||||
this.shareLink = sahreLink
|
console.log(this.shareOption.operationPermissionList)
|
||||||
QRCode.toDataURL(sahreLink)
|
this.createShare()
|
||||||
|
},
|
||||||
|
setShareLink(shareLink) {
|
||||||
|
this.shareLink = shareLink
|
||||||
|
QRCode.toDataURL(shareLink)
|
||||||
.then(url => {
|
.then(url => {
|
||||||
this.qrCodeshareLink = url
|
this.qrCodeshareLink = url
|
||||||
})
|
})
|
||||||
@ -293,16 +310,18 @@ export default {
|
|||||||
fileId: this.file.fileId,
|
fileId: this.file.fileId,
|
||||||
isFolder: this.file.isFolder,
|
isFolder: this.file.isFolder,
|
||||||
expireDate: expireDate,
|
expireDate: expireDate,
|
||||||
isPrivacy: this.shareOption.isPrivacy
|
isPrivacy: this.shareOption.isPrivacy,
|
||||||
|
operationPermissionList: this.shareOption.operationPermissionList
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
let {shareId, extractionCode} = res.data
|
let {shareId, extractionCode, operationPermissionList} = res.data
|
||||||
this.setShareLink(this.getShareLink(shareId))
|
this.setShareLink(this.getShareLink(shareId))
|
||||||
this.generateShareLinkLoading = false
|
this.generateShareLinkLoading = false
|
||||||
this.shareOptionConfig.shared = true
|
this.shareOptionConfig.shared = true
|
||||||
this.shareOption.expiresDateOption = 2
|
this.shareOption.expiresDateOption = 2
|
||||||
this.shareOptionConfig.linkLabel = "分享链接"
|
this.shareOptionConfig.linkLabel = "分享链接"
|
||||||
this.extractionCode = extractionCode
|
this.extractionCode = extractionCode
|
||||||
|
this.shareOption.operationPermissionList = operationPermissionList
|
||||||
this.$emit('onSuccess', shareId)
|
this.$emit('onSuccess', shareId)
|
||||||
if (update) {
|
if (update) {
|
||||||
if (!expireDate) {
|
if (!expireDate) {
|
||||||
@ -399,6 +418,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
> > > .el-form-item__label {
|
> > > .el-form-item__label {
|
||||||
|
text-align: left;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,5 +462,9 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
>>> .el-collapse {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user