|
|
@@ -1,87 +1,135 @@
|
|
|
<template>
|
|
|
- <div class='flex flex-justify-between flex-col full-width '>
|
|
|
- <div v-if='folderName' class='bold'>授权当前文件夹 ({{folderName}})</div>
|
|
|
- <div class='flex flex-justify-start flex-align-center full-width' v-if='authorType'>
|
|
|
- <span class='bold'>授权模式:</span>
|
|
|
- <el-radio-group v-model='grantType'>
|
|
|
+ <div class="flex flex-justify-between flex-col full-width">
|
|
|
+ <div v-if="folderName" class="bold">授权当前文件夹 ({{ folderName }})</div>
|
|
|
+ <div
|
|
|
+ class="flex flex-justify-start flex-align-center full-width"
|
|
|
+ v-if="authorType"
|
|
|
+ >
|
|
|
+ <span class="bold">授权模式:</span>
|
|
|
+ <el-radio-group v-model="grantType">
|
|
|
<el-radio :label="1">项目全托管</el-radio>
|
|
|
<el-radio :label="0">按文件授权</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
- <el-tabs v-if='grantType === 0' class='mt-20' type='border-card' v-model='initType'>
|
|
|
- <el-tab-pane label='授权子文件夹'>
|
|
|
- <div class='flex full-width full-height flex-justify-around border-bottom padding-bottom bold '>
|
|
|
- <span class='text-center'>文件夹名称</span>
|
|
|
- <span class='text-center'>权限设置</span>
|
|
|
+ <el-tabs
|
|
|
+ v-if="grantType === 0"
|
|
|
+ class="mt-20"
|
|
|
+ type="border-card"
|
|
|
+ v-model="initType"
|
|
|
+ >
|
|
|
+ <el-tab-pane label="授权子文件夹">
|
|
|
+ <div
|
|
|
+ class="flex full-width full-height flex-justify-around border-bottom padding-bottom bold"
|
|
|
+ >
|
|
|
+ <span class="text-center">文件夹名称</span>
|
|
|
+ <span class="text-center">权限设置</span>
|
|
|
</div>
|
|
|
- <div class='border-bottom padding-right padding-left mt-10' style='height: 500px'>
|
|
|
- <div class='flex flex-align-center mb-10 flex-justify-between border-bottom'>
|
|
|
- <div class='bold'>文件夹相关权限</div>
|
|
|
- <el-radio-group v-model="check" @change='allChange($event,1)'>
|
|
|
+ <div
|
|
|
+ class="border-bottom padding-right padding-left mt-10"
|
|
|
+ style="height: 500px"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="flex flex-align-center mb-10 flex-justify-between border-bottom"
|
|
|
+ >
|
|
|
+ <div class="bold">文件夹相关权限</div>
|
|
|
+ <el-radio-group v-model="check" @change="allChange($event, 1)">
|
|
|
<el-radio label="1" size="large">可见</el-radio>
|
|
|
<el-radio label="2" size="large">可编辑</el-radio>
|
|
|
<el-radio label="3" size="large">不可操作</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
- <div style='overflow-y: scroll; height: 450px' v-loading='loading'>
|
|
|
- <div v-for='(item,index) in folderList' :key='item.id'>
|
|
|
- <item1 :check='item.check' :data='item' :index='index' @change='change($event,1)'/>
|
|
|
+ <div style="overflow-y: scroll; height: 450px" v-loading="loading">
|
|
|
+ <div v-for="(item, index) in folderList" :key="item.id">
|
|
|
+ <item1
|
|
|
+ :check="item.check"
|
|
|
+ :data="item"
|
|
|
+ :index="index"
|
|
|
+ @change="change($event, 1)"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label='授权子文件'>
|
|
|
- <div class='flex full-width full-height flex-justify-around border-bottom padding-bottom bold '>
|
|
|
- <span class='flex-child-average text-center'>文件名称</span>
|
|
|
- <span class='flex-child-average text-center'>权限设置</span>
|
|
|
+ <el-tab-pane label="授权子文件">
|
|
|
+ <div
|
|
|
+ class="flex full-width full-height flex-justify-around border-bottom padding-bottom bold"
|
|
|
+ >
|
|
|
+ <span class="flex-child-average text-center">文件名称</span>
|
|
|
+ <span class="flex-child-average text-center">权限设置</span>
|
|
|
</div>
|
|
|
- <div class='border-bottom padding-right padding-left mt-10' style='height: 500px'>
|
|
|
- <div class='flex flex-align-center mb-10 flex-justify-between border-bottom'>
|
|
|
- <div class='bold'>文件相关权限</div>
|
|
|
- <el-radio-group v-model="check" @change='allChange($event,2)'>
|
|
|
+ <div
|
|
|
+ class="border-bottom padding-right padding-left mt-10"
|
|
|
+ style="height: 500px"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="flex flex-align-center mb-10 flex-justify-between border-bottom"
|
|
|
+ >
|
|
|
+ <div class="bold">文件相关权限</div>
|
|
|
+ <el-radio-group v-model="check" @change="allChange($event, 2)">
|
|
|
<el-radio label="3" size="large">不可查看</el-radio>
|
|
|
<el-radio label="1" size="large">可见</el-radio>
|
|
|
<el-radio label="2" size="large">可编辑</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
- <div style='overflow-y: scroll; height: 450px'>
|
|
|
- <div v-for='(item,index) in fileList' :key='item.id'>
|
|
|
- <item1 :check='item.check' :data='item' :index='index' @change='change($event,2)'/>
|
|
|
+ <div style="overflow-y: scroll; height: 450px">
|
|
|
+ <div v-for="(item, index) in fileList" :key="item.id">
|
|
|
+ <item1
|
|
|
+ :check="item.check"
|
|
|
+ :data="item"
|
|
|
+ :index="index"
|
|
|
+ @change="change($event, 2)"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<div>
|
|
|
- <div class='full-width flex flex-align-center mt-10'>
|
|
|
- <span class='font-14 bold'>授权时长</span>
|
|
|
+ <div class="full-width flex flex-align-center mt-10">
|
|
|
+ <span class="font-14 bold">授权时长</span>
|
|
|
<el-date-picker
|
|
|
- v-model="authorizeDate"
|
|
|
- class='ml-20'
|
|
|
- end-placeholder="截止日期"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- type="daterange"
|
|
|
- value-format='YYYY-MM-DD'
|
|
|
- format='YYYY-MM-DD'
|
|
|
+ v-model="authorizeDate"
|
|
|
+ class="ml-20"
|
|
|
+ end-placeholder="截止日期"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ type="daterange"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class='full-width flex flex-align-center mt-10'>
|
|
|
- <span class='font-14 bold'>生成授权连接</span>
|
|
|
- <el-button circle class='ml-20' icon="Picture" type="danger" @click='initCode(2)'/>
|
|
|
+ <div class="full-width flex flex-align-center mt-10">
|
|
|
+ <span class="font-14 bold">生成授权连接</span>
|
|
|
+ <el-button
|
|
|
+ circle
|
|
|
+ class="ml-20"
|
|
|
+ icon="Picture"
|
|
|
+ type="danger"
|
|
|
+ @click="initCode(2)"
|
|
|
+ />
|
|
|
<!-- <el-button circle icon="Paperclip" type="danger"/>-->
|
|
|
</div>
|
|
|
- <div class='full-width mt-20 border-top padding-top flex flex-justify-end'>
|
|
|
- <el-button @click='close'>取消</el-button>
|
|
|
- <el-button type='primary' @click='close'>关闭</el-button>
|
|
|
+ <div
|
|
|
+ class="full-width mt-20 border-top padding-top flex flex-justify-end"
|
|
|
+ >
|
|
|
+ <el-button @click="close">取消</el-button>
|
|
|
+ <el-button type="primary" @click="close">关闭</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog v-model='qrCodeShow' top='20%' width='400px'>
|
|
|
- <div class='flex flex-col flex-center' style='height: 400rpx;width: 400rpx'>
|
|
|
- <vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25' :text='qrCodeText'
|
|
|
- size='340'/>
|
|
|
+ <el-dialog v-model="qrCodeShow" top="20%" width="400px">
|
|
|
+ <div
|
|
|
+ class="flex flex-col flex-center"
|
|
|
+ style="height: 400rpx; width: 400rpx"
|
|
|
+ >
|
|
|
+ <vue-qr
|
|
|
+ :currentLevel="3"
|
|
|
+ :logoCornerRadius="4"
|
|
|
+ :logoScale="0.25"
|
|
|
+ :text="qrCodeText"
|
|
|
+ size="340"
|
|
|
+ />
|
|
|
<span>右键复制二维码,通过微信进行分享</span>
|
|
|
- {{qrCodeText}}
|
|
|
+ {{ qrCodeText }}
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -124,7 +172,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
list: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
val = val.map(sub => {
|
|
|
sub.check = this.check
|
|
|
return sub
|
|
|
@@ -135,7 +183,7 @@ export default {
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
check: '2',
|
|
|
@@ -153,10 +201,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- close () {
|
|
|
+ close() {
|
|
|
this.$emit('close')
|
|
|
},
|
|
|
- initCode () {
|
|
|
+ initCode() {
|
|
|
this.loading = true
|
|
|
let list = this.folderList
|
|
|
if (this.initType === '1') {
|
|
|
@@ -170,19 +218,28 @@ export default {
|
|
|
this.startTime = this.authorizeDate[0]
|
|
|
this.endTime = this.authorizeDate[1]
|
|
|
const fileTmps = list.map(sub => {
|
|
|
- const item = { fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.check }
|
|
|
+ const item = {
|
|
|
+ fileId: sub.id,
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ status: sub.check
|
|
|
+ }
|
|
|
return item
|
|
|
})
|
|
|
- const folder = [{
|
|
|
- folderId: this.folderId,
|
|
|
- startTime: this.startTime,
|
|
|
- endTime: this.endTime,
|
|
|
- status: this.check
|
|
|
- }]
|
|
|
+ const folder = [
|
|
|
+ {
|
|
|
+ folderId: this.folderId,
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ status: this.check
|
|
|
+ }
|
|
|
+ ]
|
|
|
|
|
|
const folderTmp = list.map(sub => {
|
|
|
const item = {
|
|
|
- folderId: sub.hasOwnProperty('fileFolderId') ? sub.fileFolderId : sub.id,
|
|
|
+ folderId: sub.hasOwnProperty('fileFolderId')
|
|
|
+ ? sub.fileFolderId
|
|
|
+ : sub.id,
|
|
|
startTime: this.startTime,
|
|
|
endTime: this.endTime,
|
|
|
status: sub.check,
|
|
|
@@ -196,7 +253,8 @@ export default {
|
|
|
}
|
|
|
const data = {
|
|
|
files: this.initType === '0' ? [] : fileTmps,
|
|
|
- folders: this.folderId.length === 0 ? folderTmp : folder.concat(folderTmp),
|
|
|
+ folders:
|
|
|
+ this.folderId.length === 0 ? folderTmp : folder.concat(folderTmp),
|
|
|
projectId: this.projectId,
|
|
|
grantType: this.grantType,
|
|
|
startTime: this.startTime,
|
|
|
@@ -205,14 +263,17 @@ export default {
|
|
|
this.$api.project.initCode(Object.assign(data, this.extra)).then(res => {
|
|
|
this.loading = false
|
|
|
if (res.code === 200) {
|
|
|
- this.qrCodeText = 'https://dev.wutongresearch.club/apply?id=' + res.data + (query.length > 0 ? '&' + query.join('&') : '')
|
|
|
+ this.qrCodeText =
|
|
|
+ 'https://prod.wutongshucloud.com/apply?id=' +
|
|
|
+ res.data +
|
|
|
+ (query.length > 0 ? '&' + query.join('&') : '')
|
|
|
this.qrCodeShow = true
|
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- allChange (res, type) {
|
|
|
+ allChange(res, type) {
|
|
|
console.log(res)
|
|
|
if (type === 1) {
|
|
|
this.folderList.forEach(sub => {
|
|
|
@@ -227,7 +288,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- change (res, type) {
|
|
|
+ change(res, type) {
|
|
|
if (type === 1) {
|
|
|
this.folderList[res.index] = res
|
|
|
let seeCount = 0
|
|
|
@@ -276,6 +337,4 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped></style>
|