|
|
@@ -2,7 +2,7 @@
|
|
|
<div class="full-width full-height mb-10">
|
|
|
<div class="flex flex-col">
|
|
|
<div class="flex flex-align-center padding border-bottom bold title-sp">
|
|
|
- <span v-if="type === 0" class="flex-1"></span>
|
|
|
+ <span v-if="type === 0" class="flex-1">谋划阶段</span>
|
|
|
<span v-else class="flex-1"></span>
|
|
|
<span style="flex: 2">文件/文件夹名称</span>
|
|
|
<span style="flex: 1">更新(上传)时间</span>
|
|
|
@@ -11,7 +11,7 @@
|
|
|
</div>
|
|
|
|
|
|
<el-empty v-if="folder && folder.length === 0" description="暂无数据"/>
|
|
|
- <div v-for="item in folder" v-else :key='item.id' class="flex flex-center border-bottom padding content-sp">
|
|
|
+ <div v-for="item in folder" :key='item.id' v-else class="flex flex-center border-bottom padding content-sp">
|
|
|
<img v-if="item.isAccess === 1" class="icon" src="../../../assets/svg/folder/see.svg">
|
|
|
<img v-else-if="item.isAccess === 2" class="icon" src="../../../assets/svg/folder/edit.svg">
|
|
|
<img v-else class="icon" src="../../../assets/svg/folder/invisible.svg">
|
|
|
@@ -52,63 +52,7 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div class='flex flex-justify-between flex-col full-width '>
|
|
|
- <div class='flex full-width full-height border-bottom padding-bottom bold '>
|
|
|
- <span class='flex-child-average text-center'>文件/文件夹名称</span>
|
|
|
- <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">
|
|
|
- <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 v-for='(item,index) in fileData.records' :key='item'>
|
|
|
- <item1 :check='check' :data='item' :index='index' @change='change'/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <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'
|
|
|
- />
|
|
|
- </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'/>
|
|
|
- <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='authorizeShow = false'>取消</el-button>
|
|
|
- <el-button type='primary' @click='authorizeShow = false'>关闭</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog v-model='qrCodeShow' top='20%' width='400px'>
|
|
|
- <div class='flex flex-col flex-center light-purple-bg' style='height: 400rpx;width: 400rpx'>
|
|
|
- <vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25' :logoSrc='logoSrc' :text='qrCodeText'
|
|
|
- size='340'/>
|
|
|
- <span>复制二维码,通过微信进行分享</span>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog v-model='sendMsg' top='20%' width='400px'>
|
|
|
- <div class="flex flex-col flex-center">
|
|
|
- <span class="font-15">是否给业主发送提醒消息?</span>
|
|
|
- <div class="flex flex-center mt-20">
|
|
|
- <main-button class="mr-15" title="取消" type="0" @click="sendMsg = false"/>
|
|
|
- <main-button title="发送" type="0" @click="SendMsg"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <authorize :list='fileData.records' :folder-id='currentRow.id' :project-id='projectId' @close='authorizeShow = false'/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -116,21 +60,21 @@
|
|
|
<script>
|
|
|
import mainButton from '../../../components/main-button.vue'
|
|
|
import uploadFile from '../../../components/upload-file.vue'
|
|
|
-import item1 from '@/views/home/component/item1.vue'
|
|
|
-import VueQr from 'vue-qr/src/packages/vue-qr.vue'
|
|
|
+import authorize from '@/views/home/component/authorize.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'file_list',
|
|
|
- components: {mainButton, uploadFile, item1, VueQr},
|
|
|
+ components: { mainButton, uploadFile, authorize },
|
|
|
props: {
|
|
|
folder: Array,
|
|
|
total: String,
|
|
|
+ projectId: String,
|
|
|
type: {
|
|
|
type: Number,
|
|
|
default: 0
|
|
|
}
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
show: false,
|
|
|
sendMsg: false,
|
|
|
@@ -154,47 +98,48 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- fileView(item) {
|
|
|
+ fileView (item) {
|
|
|
if (this.type === 0) {
|
|
|
this.$router.push({
|
|
|
path: '/home/files',
|
|
|
- query: {id: item.fileFolderId}
|
|
|
+ query: { id: item.fileFolderId }
|
|
|
})
|
|
|
} else {
|
|
|
this.$router.push({
|
|
|
path: '/home/his_files',
|
|
|
- query: {id: item.id}
|
|
|
+ query: { id: item.id }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- uploadFiles(item) {
|
|
|
+ uploadFiles (item) {
|
|
|
this.currentRow = item
|
|
|
this.show = true
|
|
|
},
|
|
|
- folderRemove(item) {
|
|
|
+ folderRemove (item) {
|
|
|
this.$confirm('确认是否删除该文件夹及所包含的文件?', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- this.$api.project.folderRemove({ids: item.fileFolderId}).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.$emit('delFolder')
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ .then(() => {
|
|
|
+ this.$api.project.folderRemove({ ids: item.fileFolderId }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.$emit('delFolder')
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
})
|
|
|
+ })
|
|
|
},
|
|
|
- success(res) {
|
|
|
+ success (res) {
|
|
|
this.fileList = res.fileList.map(res => {
|
|
|
const item = {}
|
|
|
item.title = res.response.data.originalFileName
|
|
|
item.suffix = res.response.data.suffix
|
|
|
item.volume = res.response.data.volume
|
|
|
item.fileId = res.response.data.id
|
|
|
+ item.projectId = this.projectId
|
|
|
if (this.type === 0) {
|
|
|
item.fileFolderId = this.currentRow.fileFolderId
|
|
|
} else {
|
|
|
@@ -206,8 +151,8 @@ export default {
|
|
|
this.saveLibrary(sub)
|
|
|
})
|
|
|
},
|
|
|
- saveLibrary(sub) {
|
|
|
- const data = {category: 4, content: ''}
|
|
|
+ saveLibrary (sub) {
|
|
|
+ const data = { category: 4, content: '' }
|
|
|
this.$api.common.submit(Object.assign(sub, data)).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.saveCount++
|
|
|
@@ -221,12 +166,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- addFile() {
|
|
|
+ addFile () {
|
|
|
this.$api.project.fileAdd(this.fileList).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.show = false
|
|
|
+ this.$bus.emit('reFolder')
|
|
|
this.$message.success(res.msg)
|
|
|
- this.sendMsg = true
|
|
|
} else {
|
|
|
this.show = false
|
|
|
this.$message.error(res.msg)
|
|
|
@@ -246,9 +191,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getFileList(item) {
|
|
|
+ getFileList (item) {
|
|
|
this.currentRow = item
|
|
|
- this.$api.project.fileList({folderId: item.fileFolderId}).then(res => {
|
|
|
+ this.$api.project.fileList({ folderId: item.fileFolderId }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.authorizeShow = true
|
|
|
this.fileData = res.data
|
|
|
@@ -262,34 +207,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- initCode() {
|
|
|
- if (this.authorizeDate.length === 0) {
|
|
|
- this.$message.error('请设置授权时间')
|
|
|
- return
|
|
|
- }
|
|
|
- this.startTime = this.authorizeDate[0]
|
|
|
- this.endTime = this.authorizeDate[1]
|
|
|
- console.log(this.fileData.records)
|
|
|
- const tmps = this.fileData.records.map(sub => {
|
|
|
- const item = {fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.type}
|
|
|
- return item
|
|
|
- })
|
|
|
- const folder = [{
|
|
|
- folderId: this.currentRow.fileFolderId,
|
|
|
- startTime: this.startTime,
|
|
|
- endTime: this.endTime,
|
|
|
- status: this.check
|
|
|
- }]
|
|
|
- this.$api.project.initCode({files: tmps, folders: folder}).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.qrCodeText = 'https://dev.wutongresearch.club/apply?id=' + res.data.qrcode.qrcodeId
|
|
|
- this.qrCodeShow = true
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- change(res) {
|
|
|
+
|
|
|
+ change (res) {
|
|
|
this.fileData[res.index] = res
|
|
|
}
|
|
|
}
|