Browse Source

合并冲突解决

liyangzheng 2 years ago
parent
commit
4ccad92605

+ 17 - 15
src/api/fileCount/fileCount.js

@@ -1,40 +1,42 @@
 import request from '../../utils/request'
-// 查询文档协作列表
+// 查询文档协作人员
+// data为docid
 function getActor(data){
     return request({
-        url:`/biz/actor/list`,
+        url:`/biz/actor/${data}`,
         method:"get",
         params:data
     })
 }
-// 修改文档协作列表
-function editActor(data){
+// 归档
+function lockActor(data){
     return request({
-        url:`/biz/actor`,
+        url:`/biz/actor${data}`,
         method:"put",
         data,
     })
 }
-// 删除文档协作列表
+// 添加协作人员
 function delActor(data){
     return request({
         url:`/biz/actor/${data}`,
-        method:"delete"
+        method:"post"
     })
 }
-// 新增文档协作列表
+// 我发起的
 function addActor(data){
     return request({
-        url:`/biz/actor`,
-        method:"post",
-        data,
+        url:`/biz/actor/initiation`,
+        method:"get",
+        params:data,
     })
 }
-// 获取详细信息
+// 我参与的
 function getActorById(data){
     return request({
-        url:`/biz/actor/${data}`,
-        method:"get"
+        url:`/biz/actor/participation`,
+        method:"get",
+        params:data,
     })
 }
 export default{
@@ -42,5 +44,5 @@ export default{
     getActorById,
     addActor,
     delActor,
-    editActor,
+    lockActor,
 }

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

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

+ 46 - 34
src/views/myfile/MyFile.vue

@@ -217,7 +217,7 @@
                                 </template>
                             </div>
                             <div class="setCli1" v-if="anyP">
-                                <p @click="chooseSet1()" class="">
+                                <p @click="chooseSet1(0)" class="">
                                     <img src="../../assets/images/user.png" alt="">
                                     选择人员
                                 </p>
@@ -235,7 +235,8 @@
                 <div>
                     <el-button @click="editOnline = true">返回</el-button>
                 </div>
-                <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew" :historycopyRow="historycopyRow"></FileEdit>
+                <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
+                    :historycopyRow="historycopyRow"></FileEdit>
             </div>
             <!-- 扩容弹窗 -->
             <div>
@@ -395,22 +396,17 @@
             </div>
             <!-- 穿梭框 -->
             <div>
-                <TransferModal v-if="thanks" :thanks="thanks" :clickRowId="clickRowId" @getCback="getCback"></TransferModal>
+                <TransferModal v-if="thanks" :thanks="thanks" :clickRowId="clickRowId" :workOrEdit="workOrEdit"
+                    @getCback="getCback"></TransferModal>
             </div>
         </div>
     </div>
     <!-- 图片预览 -->
     <!-- 历史版本 -->
-    <historyList
-    :openFile="openForwardFile"
-    :docId="clickRowId"
-    :name="nameForm.name"
-    :copyRow="copyRow"
-    @close="openForwardFile = false"
-    :fileUserTreeData="fileUserTreeData.data"
-    @changeMsgClose="changeMsgClose"
-  ></historyList>
-  <!-- 历史版本 -->
+    <historyList :openFile="openForwardFile" :docId="clickRowId" :name="nameForm.name" :copyRow="copyRow"
+        @close="openForwardFile = false" :fileUserTreeData="fileUserTreeData.data" @changeMsgClose="changeMsgClose">
+    </historyList>
+    <!-- 历史版本 -->
 </template>
 
 <script>
@@ -486,7 +482,7 @@ export default {
         let copyOrMove = ref(0)//0代表复制,1代表移动
         let sortNum = ref(0)
         const openForwardFile = ref(false)   //历史版本展示
-        const historyPrew=ref(false)
+        const historyPrew = ref(false)
         const fileUserTreeData = reactive({ data: {} });
         let boserForm = ref({
             spaceId: "",//空间id
@@ -634,6 +630,7 @@ export default {
             },
 
         ])
+        let workOrEdit = ref(0)
         const showPreview = ref(false)//控制图片预览组件显示
         const previewData = ref()//需要预览的文件的数据
         const router = useRouter(); //注册路由
@@ -755,13 +752,14 @@ export default {
             this.askTo = false
         }
         //mouse弹框
-        async function chooseSet(row, num) {
+        async function chooseSet(row, index, num) {
             if (row.name == '在线编辑' || row.name == '协作') {
                 cliCC.value = true
             } else {
                 cliCC.value = false
             }
             if (row.name == '分享') {
+                workOrEdit.value = num
                 thanks.value = true
             } else {
                 thanks.value = false
@@ -811,9 +809,9 @@ export default {
             if (row.name === '文字识别') {
                 router.push({
                     path: '/identifyFont',
-                    query:{
-                        fileId:copyFileId.value,
-                        fileType:copyFileType.value
+                    query: {
+                        fileId: copyFileId.value,
+                        fileType: copyFileType.value
                     }
                 })
             }
@@ -831,7 +829,8 @@ export default {
                 openForwardFile.value = true
             }
         }
-        function chooseSet1() {
+        function chooseSet1(num) {
+            workOrEdit.value = num
             thanks.value = true
             anyP.value = false
         }
@@ -1150,15 +1149,15 @@ export default {
         }
         //历史版本
         const forwardTreeData = reactive({ data: {} });
-        const historycopyRow=ref({})
-        function changeMsgClose(val,item) { 
-            if(val){              
-                historycopyRow.value=item
+        const historycopyRow = ref({})
+        function changeMsgClose(val, item) {
+            if (val) {
+                historycopyRow.value = item
                 editOnline.value = false
                 cliCC.value = false
-                historyPrew.value=true
+                historyPrew.value = true
             }
-            openForwardFile.value=val
+            openForwardFile.value = val
         }
 
         //对mouseCli数组进行筛选,实现菜单的区分显示
@@ -1166,10 +1165,10 @@ export default {
             const typeArr = ['.png','.jpg','.jpeg','.JPG','.mp3','.mp4','.pdf']
             const imgTypeArr = ['.png','.jpg','.jpeg','.JPG']
             let arr = []
-            if(!typeArr.includes(copyFileType.value)){
-                arr = mouseCli.value.filter(item=>item.name !== "预览")
-            }else{
-                arr = mouseCli.value.filter(item=>item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
+            if (!typeArr.includes(copyFileType.value)) {
+                arr = mouseCli.value.filter(item => item.name !== "预览")
+            } else {
+                arr = mouseCli.value.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
             }
             if(!imgTypeArr.includes(copyFileType.value)){
                 arr = arr.filter(item=>item.name !== "文字识别")
@@ -1180,6 +1179,9 @@ export default {
             if (cliCC.value) {
                 cliCC.value = false
             }
+            if (anyP) {
+                anyP.value = false
+            }
         } 
         // 文件夹右键事件
         const folderRClick = (row,col,e) => {
@@ -1330,7 +1332,13 @@ export default {
             folderleft,
             thisFolder,
             folderRClick,
-            closeRMenu
+            closeRMenu,
+            //历史版本=========
+            fileUserTreeData,
+            thanks,
+            getCback,
+            mouseClick,
+            workOrEdit,
         }
 
     },
@@ -1390,7 +1398,7 @@ p {
     width: 88px;
     height: 112px;
     text-align: center;
-    margin-left: 12px;
+    margin-left: 5px;
     margin-top: 5px;
     position: relative;
 }
@@ -1508,7 +1516,7 @@ p {
     width: 156px;
     max-height: 380px;
     position: absolute;
-    top: 20px;
+    top: -70px;
     left: 300px;
     flex-wrap: 400;
     background-color: white;
@@ -1540,7 +1548,7 @@ p {
     // display: flex;
     // align-items: center;
     // position: relative;
-    img{
+    img {
         margin-right: 4px;
         vertical-align: middle;
     }
@@ -1560,7 +1568,7 @@ p {
 }
 
 :deep(.el-collapse-item__content) {
-    height: 235px;
+    // height: 235px;
     overflow-y: auto;
 }
 
@@ -1607,4 +1615,8 @@ p {
     height: 100%;
     border-bottom: none;
 }
+
+:deep(.el-collapse-item__wrap) {
+    height: 300px;
+}
 </style>

+ 45 - 21
src/views/myfile/modalComponebts/Transfer.vue

@@ -19,8 +19,8 @@
                             <span style="color: red;font-size: 14px;float: right;">清空</span>
                         </div>
                         <div class="needLog">
-                            <el-tag v-for="(item, index) in chooseTagData" :key="index" class="tagtag" 
-                                @close="handleClose(item)">
+                            <el-tag v-for="(item, index) in chooseTagData" :key="index" class="tagtag"
+                                :closable="lastPeople" @close="handleClose(item)">
                                 {{ item.userName }}
                             </el-tag>
                         </div>
@@ -54,12 +54,17 @@ export default {
         clickRowId: {
             type: Number,
             required: true
+        },
+        workOrEdit: {
+            type: Number,
+            required: true
         }
     },
     setup(props, { emit }) {
         let { backToFather, sureBackFather } = toRefs(props)
         let result = props.thanks
         let dees = props.clickRowId
+        let feeh = props.workOrEdit
         let transferModals = ref(false)
         let allTreeData = ref([])
         let allTreeProps = {
@@ -73,6 +78,7 @@ export default {
         let allBag = ref('')
         let needTagData = ref([])
         let backScreen = ref([])
+        let lastPeople = ref(false)
         function allTeam() {
             if (result) {
                 transferModals.value = result
@@ -91,27 +97,41 @@ export default {
                 // 选择操作,将数据添加到 needTagData 中
                 chooseTagData.value.push({ userId: id, userName: label });
             }
+            if (chooseTagData.value.length === 1) {
+                lastPeople.value = true
+            } else {
+                lastPeople.value = false
+            }
         }
         // 确认分享
         function sureShare() {
-            // console.log(clickRowId);
-            if (chooseTagData.value.length === 0) {
-                ElMessage({
-                    type: "error",
-                    message: "你还未选择人员!"
-                })
-            } else {
-                fileShare.addSharePeople(dees, chooseTagData.value).then(res => {
-                    if (res.code === 200) {
-                        ElMessage({
-                            message: "分享成功",
-                            type: "success"
-                        })
-                        transferModals.value = false
-                        emit("getCback", transferModals.value)
-                    }
-                })
+            if (feeh === 1) {
+                if (chooseTagData.value.length === 0) {
+                    ElMessage({
+                        type: "error",
+                        message: "你还未选择人员!"
+                    })
+                } else {
+                    console.log(chooseTagData.value, 'value');
+                    let arr = []
+                    arr = chooseTagData.value.map(item => {
+                        return item.userId
+                    })
+                    fileShare.addSharePeople(dees, arr).then(res => {
+                        if (res.code === 200) {
+                            ElMessage({
+                                message: "分享成功",
+                                type: "success"
+                            })
+                            transferModals.value = false
+                            emit("getCback", transferModals.value)
+                        }
+                    })
+                }
+            }else{
+               return
             }
+
         }
         // 获取用户树
         function getAllUser() {
@@ -149,11 +169,13 @@ export default {
         function handleClose(tag) {
             chooseTagData.value.splice(chooseTagData.value.indexOf(tag), 1);
             // 从标签中获取 userId
-            const userId = tag.userId;
+            // const userId = tag.userId;
             // 从 chooseTagData 中筛选出不包含当前 userId 的标签
-            chooseTagData.value = chooseTagData.value.filter(item => item.userId !== userId)
+            // chooseTagData.value = chooseTagData.value.filter(item => item.userId !== userId)
+
         }
         onMounted(() => {
+            console.log(feeh, 'eeh');
             allTeam()
             getAllUser()
         })
@@ -173,6 +195,8 @@ export default {
             needTagData,
             handleClose,
             backScreen,
+            lastPeople,
+            feeh,
             backToFather: getBack,
         }
     }