scorpioyq 3 years ago
parent
commit
a69f05eca2
1 changed files with 85 additions and 75 deletions
  1. 85 75
      src/views/home/component/folder_list.vue

+ 85 - 75
src/views/home/component/folder_list.vue

@@ -9,9 +9,11 @@
         <span style="flex: 1.5">文件数量</span>
         <span style="flex: 3">操作</span>
       </div>
+
       <el-empty v-if="folder && folder.length === 0" description="暂无数据"/>
       <div v-for="item in folder" v-else class="flex flex-center border-bottom padding content-sp">
-        <img class="icon" src="../../../assets/svg/folder/see.svg">
+        <img v-if="item.isAccess === 3" class="icon" src="../../../assets/svg/folder/see.svg">
+        <img v-else class="icon" src="../../../assets/svg/folder/invisible.svg">
         <span style="flex:2">{{ item.folderName }}</span>
         <span style="flex: 1">{{ item.updateTime }}</span>
         <span style="flex: 1.5">{{ item.fileNumber }}</span>
@@ -37,62 +39,64 @@
                   @close='show = false'
                   @success='success'/>
     </el-dialog>
-<!--    授权操作-->
-    <el-dialog v-model='authorizeShow' append-to-body center :show-close='false' class='custom-dialog'>
+    <!--    授权操作-->
+    <el-dialog v-model='authorizeShow' :show-close='false' append-to-body center class='custom-dialog'>
       <template #header="{ close, titleId, titleClass }">
         <div class="flex flex-justify-between">
-          <h4 :id="titleId" :class="titleClass">{{currentRow.folderName}}</h4>
-          <el-button type="danger" text @click="close">
-            <el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
+          <h4 :id="titleId" :class="titleClass">{{ currentRow.folderName }}</h4>
+          <el-button text type="danger" @click="close">
+            <el-icon class="el-icon--left">
+              <CircleCloseFilled/>
+            </el-icon>
           </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="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 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"
-                type="daterange"
-                class='ml-20'
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="截止日期"
-                value-format='YYYY-MM-DD'
-            />
-          </div>
-          <div class='full-width flex flex-align-center mt-10'>
-            <span class='font-14 bold'>生成授权连接</span>
-            <el-button class='ml-20' type="danger" icon="Picture" circle  @click='initCode'/>
-            <el-button type="danger" icon="Paperclip" circle />
+      <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="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 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 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 :text='qrCodeText' size='340' :logoSrc='logoSrc' :currentLevel='3' :logoScale='0.25'
-                :logoCornerRadius='4'/>
+        <vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25' :logoSrc='logoSrc' :text='qrCodeText'
+                size='340'/>
         <span>复制二维码,通过微信进行分享</span>
       </div>
     </el-dialog>
@@ -107,7 +111,7 @@ import VueQr from 'vue-qr/src/packages/vue-qr.vue'
 
 export default {
   name: 'file_list',
-  components: { mainButton, uploadFile, item1, VueQr },
+  components: {mainButton, uploadFile, item1, VueQr},
   props: {
     folder: Array,
     total: String,
@@ -116,7 +120,7 @@ export default {
       default: 0
     }
   },
-  data () {
+  data() {
     return {
       show: false,
       authorizeShow: false,
@@ -135,41 +139,41 @@ 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
@@ -187,8 +191,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++
@@ -203,7 +207,7 @@ export default {
         }
       })
     },
-    addFile () {
+    addFile() {
       this.$api.project.fileAdd(this.fileList).then(res => {
         if (res.code === 200) {
           this.show = false
@@ -215,9 +219,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
@@ -231,7 +235,7 @@ export default {
         }
       })
     },
-    initCode () {
+    initCode() {
       if (this.authorizeDate.length === 0) {
         this.$message.error('请设置授权时间')
         return
@@ -239,11 +243,16 @@ export default {
       this.startTime = this.authorizeDate[0]
       this.endTime = this.authorizeDate[1]
       const tmps = this.fileData.records.map(sub => {
-        const item = { fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.type }
+        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.type }]
-      this.$api.project.initCode({ files: tmps, folders: folder }).then(res => {
+      const folder = [{
+        folderId: this.currentRow.fileFolderId,
+        startTime: this.startTime,
+        endTime: this.endTime,
+        status: this.type
+      }]
+      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
@@ -252,7 +261,7 @@ export default {
         }
       })
     },
-    change (res) {
+    change(res) {
       this.fileData[res.index] = res
     }
   }
@@ -277,8 +286,9 @@ export default {
   width: 50px;
   height: 46px;
 }
-.custom-dialog{
-  :deep(.el-dialog){
+
+.custom-dialog {
+  :deep(.el-dialog) {
     --el-dialog-padding-primary: 0;
   }
 }