Explorar o código

Merge branch 'liyangzheng' into v3

liyangzheng %!s(int64=2) %!d(string=hai) anos
pai
achega
261daa6959
Modificáronse 3 ficheiros con 39 adicións e 29 borrados
  1. 3 3
      src/api/fileShare/fileShare.js
  2. 0 3
      src/api/myfile/myfile.js
  3. 36 23
      src/views/myfile/MyFile.vue

+ 3 - 3
src/api/fileShare/fileShare.js

@@ -3,13 +3,13 @@ import request from '../../utils/request'
 function getSharePeople(data) {
     return request({
         url: `/biz/info/share/${data}`,
-        method: 'get'
+        method: 'get',
     })
 }
 // 新增分享人员
-function addSharePeople(data) {
+function addSharePeople(num,data) {
     return request({
-        url: `/biz/info/share`,
+        url: `/biz/info/share/${num}`,
         method: "post",
         data
     })

+ 0 - 3
src/api/myfile/myfile.js

@@ -46,9 +46,6 @@ function uploadFileMany(data) {
         url: `/biz/info/uploadFiles`,
         method: "post",
         data,
-        headers: {
-            'Content-Type': 'multipart/form-data'
-        },
     })
 }
 // 复制

+ 36 - 23
src/views/myfile/MyFile.vue

@@ -188,8 +188,8 @@
                                                     <Star />
                                                 </el-icon>
                                                 <img v-else src="../../assets/images/yellowstar.png" alt="">
-                                                {{ scope.row.fileName }}
                                                 <img :src="getImage(scope.row.fileType)" alt="">
+                                                {{ scope.row.fileName }}
                                             </span>
                                         </template>
                                     </el-table-column>
@@ -697,6 +697,7 @@ export default {
         }
         // 文件名表格每一行点击事件
         function handleRowClick(row) {
+            console.log(row, '888');
             clickRowId.value = row.docId
             copyDirId.value = row.dirId
             copySpaceId.value = row.spaceId
@@ -709,6 +710,11 @@ export default {
             } else {
                 cliCC.value = true
             }
+            fileShare.getSharePeople(row.docId).then(res => {
+                console.log(res, 'res');
+            }).catch(err => {
+                console.log(err, 'err');
+            })
         }
         // 申请扩容
         function askApply() {
@@ -859,23 +865,26 @@ export default {
         }
         // 确认上传
         function sureUpload() {
-            myfile.uploadFile({
-                spaceId: 1,
-                dirId: 1,
-                file: fileArr.value
-            }).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        message: "上传文件成功",
-                        type: "success"
-                    })
-                    getAll()
-                    uploadModal.value = false
-                }
-            })
+            for (var i = 0; i <= fileArr.value.length; i++) {
+                myfile.uploadFile({
+                    spaceId: 1,
+                    dirId: 1,
+                    file: fileArr.value[i]
+                }).then(res => {
+                    if (res.code === 200) {
+                        ElMessage({
+                            message: "上传文件成功",
+                            type: "success"
+                        })
+                        getAll()
+                        uploadModal.value = false
+                        fileArr.value = []
+                    }
+                })
+            }
         }
-        function onSuccess(file, val) {
-            fileArr.value = file.file
+        function onSuccess(files, val) {
+            fileArr.value.push(files.file)
         }
         // 筛选后缀图片
         function getImage(file) {
@@ -1019,16 +1028,21 @@ export default {
                 console.log(`数据已存在: ${existingData.userName}`);
             } else {
                 // 选择操作,将数据添加到 needTagData 中
-                needTagData.value.push({ userId: id, userName: label, docId: copyDocId.value });
+                needTagData.value.push({ userId: id, userName: label });
             }
             chooseTagData.value = needTagData.value
         }
 
         // 确认分享
         function sureShare() {
-
-            fileShare.addSharePeople({ docId: needTagData.value }).then(res => {
-                console.log(res, 'sss');
+            fileShare.addSharePeople(clickRowId.value, needTagData.value).then(res => {
+                if (res.code === 200) {
+                    ElMessage({
+                        message:"分享成功",
+                        type:"success"
+                    })
+                    transferModal.value = false
+                }
             })
 
         }
@@ -1053,7 +1067,6 @@ export default {
             fileCollect.value = false
         }
         function collectChange(e) {
-            console.log(e, 'eee');
             collectForm.value.folders = e
         }
         // 新建收藏标签
@@ -1062,7 +1075,7 @@ export default {
             tagCollect.value = true
         }
         function tagBlur() {
-            collect.addNewTag({ labelName: newTag.value, orderNum: sortNum.value+1 }).then(res => {
+            collect.addNewTag({ labelName: newTag.value, orderNum: sortNum.value + 1 }).then(res => {
                 if (res.code === 200) {
                     ElMessage({
                         message: "新建标签成功",