Browse Source

Merge branch 'v3' of ssh://94.191.59.107:10222/houwenfeng/cloudfile-ui into v3

wukai 2 years ago
parent
commit
53154673f0

+ 9 - 9
src/api/fileCount/fileCount.js

@@ -11,20 +11,20 @@ function getActor(data){
 // 归档
 function lockActor(data){
     return request({
-        url:`/biz/actor${data}`,
+        url:`/biz/actor/${data}`,
         method:"put",
-        data,
     })
 }
 // 添加协作人员
-function delActor(data){
+function addActor(num,data){
     return request({
-        url:`/biz/actor/${data}`,
-        method:"post"
+        url:`/biz/actor/${num}`,
+        method:"post",
+        data
     })
 }
 // 我发起的
-function addActor(data){
+function myCount(data){
     return request({
         url:`/biz/actor/initiation`,
         method:"get",
@@ -32,7 +32,7 @@ function addActor(data){
     })
 }
 // 我参与的
-function getActorById(data){
+function myJoin(data){
     return request({
         url:`/biz/actor/participation`,
         method:"get",
@@ -41,8 +41,8 @@ function getActorById(data){
 }
 export default{
     getActor,
-    getActorById,
     addActor,
-    delActor,
     lockActor,
+    myCount,
+    myJoin,
 }

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

@@ -7,10 +7,11 @@ function getAllFileMenu(data) {
         params: data
     })
 }
-function getById(data) {
+function getById(num,data) {
     return request({
-        url: `/biz/info/list/${data}`,
+        url: `/biz/info/list/${num}`,
         method: "get",
+        params:data
     })
 }
 // 新增

+ 22 - 6
src/layout/indexCommon.vue

@@ -7,7 +7,9 @@
       >
         <div class="nav-top">
           <div>
-            <img src="@/assets/images/logos.png" /><span>聚合智慧文档管理系统</span>
+            <img src="@/assets/images/logos.png" /><span
+              >聚合智慧文档管理系统</span
+            >
           </div>
           <!-- TODO 搜索触发事件优化,跳转页面优化 -->
           <div class="search">
@@ -31,12 +33,19 @@
             >
               <div class="avatar-wrapper">
                 <img
-                  src="@/assets/images/profile.png"
+                  :src="
+                    userStore.avatar
+                      ? userStore.avatar
+                      : '@/assets/images/profile.png'
+                  "
                   class="head-img"
                 /><span>{{ logingName }}</span>
               </div>
               <template #dropdown>
                 <el-dropdown-menu>
+                  <router-link to="/user/profile">
+                    <el-dropdown-item>个人中心</el-dropdown-item>
+                  </router-link>
                   <el-dropdown-item divided command="logout">
                     <span>退出登录</span>
                   </el-dropdown-item>
@@ -53,9 +62,9 @@
               :to="item.path"
               v-for="(item, index) in menuList.data"
               :key="index"
-              @click="clickPath(index,item)"
+              @click="clickPath(index, item)"
               ><div
-              style="position: relative;"
+                style="position: relative"
                 :class="
                   $route.path == item.path
                     ? 'acitve-img-style img-style'
@@ -68,7 +77,14 @@
                 <div class="text-style" v-if="$route.path != item.path">
                   {{ item.label }}
                 </div>
-                <span class="yuandian" v-if="websoctStore.messOne?.fromId&&item.path == '/index'&& $route.path != item.path"></span>
+                <span
+                  class="yuandian"
+                  v-if="
+                    websoctStore.messOne?.fromId &&
+                    item.path == '/index' &&
+                    $route.path != item.path
+                  "
+                ></span>
               </div> </router-link
             ><br />
           </div>
@@ -268,7 +284,7 @@ const menuList = reactive({
     },
   ],
 });
-const clickPath = (index,items) => {
+const clickPath = (index, items) => {
   clickId.value = index;
 };
 </script>

+ 58 - 49
src/views/liveChat/index.vue

@@ -4,7 +4,7 @@ export default {
 };
 </script>
 <script setup>
-import { ref, reactive, toRaw, toRefs, nextTick } from "vue";
+import { ref, reactive, toRaw, toRefs, nextTick, computed } from "vue";
 import { useRouter, useRoute } from "vue-router";
 import useUserStore from "@/store/modules/user";
 import word from "@/assets/images/word2.png";
@@ -96,6 +96,16 @@ const getMsgList = async () => {
   }
 };
 const noMes = ref(false);
+const boottmScroll=()=>{
+//发送消息后滚动到最底部显示最新消息
+const chatContainer = document.querySelector(".right-container");
+  // 计算滚动的目标位置
+  const targetScrollTop = chatContainer.scrollHeight;
+  // 设置滚动位置
+  nextTick(() => {
+    chatContainer.scrollTop = targetScrollTop;
+  });
+}
 //获取用户的聊天记录
 const msgRecordEvent = async (toIdValue) => {
   const queryParams = {
@@ -107,23 +117,16 @@ const msgRecordEvent = async (toIdValue) => {
   chatRecords.data = resMsgData.rows.reverse();
   const PageNum = Math.ceil(chatRecords.data.length / 10) + 1;
   if (PageNum * 10 >= resMsgData.total && !noMes.value) {
-      loading.value = false;
-      noMes.value = true;
-    }
+    loading.value = false;
+    noMes.value = true;
+  }
   const nowtime = parseTime(new Date().getTime(), "{y}-{m}-{d}");
   chatRecords.data.map((i) => {
     if (nowtime == i.createTime.substr(0, 10))
       i.createTime = i.createTime.substring(11);
   });
   total.value = resMsgData.total;
-  //发送消息后滚动到最底部显示最新消息
-  const chatContainer = document.querySelector(".right-container");
-  // 计算滚动的目标位置
-  const targetScrollTop = chatContainer.scrollHeight;
-  // 设置滚动位置
-  nextTick(() => {
-    chatContainer.scrollTop = targetScrollTop;
-  });
+  boottmScroll()
 };
 //点击左侧新建聊天
 const open = ref(false);
@@ -230,12 +233,7 @@ const msgSendClick = (event) => {
       toId: sendCont.data.toId,
     };
     websoctStore.sendMessage(message);
-    //发送消息后滚动到最底部显示最新消息
-    const chatContainer = document.querySelector(".right-container");
-    // 计算滚动的目标位置
-    const targetScrollTop = chatContainer.scrollHeight;
-    // 设置滚动位置
-    chatContainer.scrollTop = targetScrollTop;
+    boottmScroll()
     event.preventDefault();
     messageText.value = "";
     //  将光标设置到输入框第一行
@@ -275,12 +273,17 @@ watchEffect(() => {
   }
 });
 // 滚动翻页========
-const mainContainer=ref(null)
+const mainContainer = ref(null);
 
 const handleScroll = (event) => {
   // 在滚动到顶部时,加载上一页的聊天记录
   const mainContainer2 = document.querySelector(".right-container");
-  console.log(' event.deltaY', mainContainer2.scrollTop,noMes.value,loading.value)
+  console.log(
+    " event.deltaY",
+    mainContainer2.scrollTop,
+    noMes.value,
+    loading.value
+  );
   if (
     event.deltaY < 0 &&
     mainContainer2.scrollTop <= 1 &&
@@ -298,29 +301,30 @@ const loadPreviousPage = async () => {
     pageSize: 10,
   };
   // setTimeout(async () => {
-    const resMsgData = await msgRecord(sendCont.data.toId, queryParams);
-    const previousPageData = resMsgData.rows.reverse();
-    chatRecords.data = [...previousPageData, ...chatRecords.data];
-    const nowtime2 = parseTime(new Date().getTime(), "{y}-{m}-{d}");
-    chatRecords.data.map((i) => {
-      if (nowtime2 == i.createTime.substr(0, 10))
-        i.createTime = i.createTime.substring(11);
-    });
-    noMes.value = false;
-    if (currentPageNum * 10 >= resMsgData.total && !noMes.value) {
-      loading.value = false;
-      noMes.value = true;
-      return;
-    }
-    // await nextTick();
-    // const mainContainer = document.querySelector(".right-container");
-    // const newMessages = document.querySelectorAll(".message-container");
-    // const firstNewMessage = newMessages[previousPageData.length];
-  // const firstNewMessageTop = mainContainer.offsetHeight;
-  // console.log('firstNewMessageTop', firstNewMessageTop)
-  // mainContainer.scrollTop = firstNewMessageTop;
-    // 将加载的上一页聊天记录插入到 chatRecords.data 的前面
+  const resMsgData = await msgRecord(sendCont.data.toId, queryParams);
+  const previousPageData = resMsgData.rows.reverse();
+  chatRecords.data = [...previousPageData, ...chatRecords.data];
+  const nowtime2 = parseTime(new Date().getTime(), "{y}-{m}-{d}");
+  chatRecords.data.map((i) => {
+    if (nowtime2 == i.createTime.substr(0, 10))
+      i.createTime = i.createTime.substring(11);
+  });
+  noMes.value = false;
+  if (currentPageNum * 10 >= resMsgData.total && !noMes.value) {
     loading.value = false;
+    noMes.value = true;
+    return;
+  }
+  //获取数据后滚动到获得新消息的最后一条,而不是第一条=========
+  await nextTick();
+  const mainContainer = document.querySelector(".right-container");
+  const newMessages = document.querySelectorAll(".message-container");
+  const firstNewMessage = newMessages[previousPageData.length];
+  const firstNewMessageTop = mainContainer.offsetHeight + 100;
+  mainContainer.scrollTop = firstNewMessageTop;chatRecords.data
+  //===========
+  // 将加载的上一页聊天记录插入到 chatRecords.data 的前面
+  loading.value = false;
   // }, 50);
 };
 const transferFiles = (forwardVal, msgIds, indexs) => {
@@ -366,7 +370,11 @@ const formatText = (text) => {
   const formattedText = text.replace(/\n/g, "<br>");
   return formattedText;
 };
+//获得个人头像转换
 
+const getMyThoto=computed(() => item => {
+    return item.toId == userIds.uid?item.fromAvatar:item.toAvatar
+})
 // 滚动翻页========
 onMounted(() => {
   getMsgList();
@@ -426,15 +434,13 @@ onMounted(() => {
           删除聊天
         </button> -->
         <div>
-          <img :src="item.avatar ? item.avatar : chat" class="head-sculpture" />
+          <!-- <img :src="item.avatar?item.avatar : chat" class="head-sculpture" /> -->
+          <img :src="getMyThoto(item)" class="head-sculpture" v-if="getMyThoto(item)"/>
+          <span style="background-color: #7a89ba;display: inline-block;color: #fff;font-weight: 600;text-align: center;line-height: 40px;" class="head-sculpture" v-else>{{item.toId == userIds.uid?item.fromName?.slice(0,1):item.toName?.slice(0,1)}}</span>
         </div>
         <div class="spill">
           <span class="person-name">{{
-            item.nickName
-              ? item.nickName
-              : item.toId == userIds.uid
-              ? item.fromName
-              : item.toName
+            item.nickName? item.nickName: (item.toId == userIds.uid? item.fromName: item.toName)
           }}</span
           ><span class="person-cont spill">
             {{ item.file?.fileName ? item.file?.fileName : item.content }}</span
@@ -508,7 +514,10 @@ onMounted(() => {
                   ></span>
                 </div>
               </div>
-              <img :src="chat" class="head-sculpture" />
+              <!-- 头像 -->
+              <!-- <img :src="chat" class="head-sculpture" /> -->
+              <img :src="getMyThoto(record)" class="head-sculpture" v-if="getMyThoto(record)"/>
+              <span style="background-color: #7a89ba;display: inline-block;color: #fff;font-weight: 600;text-align: center;line-height: 40px;" class="head-sculpture" v-else>{{ record.fromName.slice(0,1) }}</span>
               <div style="display: flex; align-items: center">
                 <div
                   v-if="useUserStore().uid == record.toId"

+ 111 - 260
src/views/myfile/MyFile.vue

@@ -70,6 +70,16 @@
                     <!-- 众多功能 -->
                     <div class="manyUse">
                         <div
+                            style="display: flex;width: 92px;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;">
+                            <div style="margin-left: 5px;">
+                                <img src="../../assets/images/upload.png" style="width: 24px;height: 24px;" alt="">
+                            </div>
+                            <div style="margin-left: 5px;">
+                                <span style="color: black;cursor: pointer;" @click="uploadModal = true">上传
+                                </span>
+                            </div>
+                        </div>
+                        <div
                             style="display: flex;width: 82px;height: 32px;justify-content: flex-start;align-items: center;">
                             <div style="margin-left: 5px;">
                                 <el-icon
@@ -93,16 +103,6 @@
                                 </div>
                             </div>
                         </template>
-                        <div
-                            style="display: flex;width: 92px;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;">
-                            <div style="margin-left: 5px;">
-                                <img src="../../assets/images/upload.png" style="width: 24px;height: 24px;" alt="">
-                            </div>
-                            <div style="margin-left: 5px;">
-                                <span style="color: black;cursor: pointer;" @click="uploadModal = true">上传
-                                </span>
-                            </div>
-                        </div>
                     </div>
                     <!-- 面包屑功能栏 -->
                     <div class="breadBox">
@@ -177,8 +177,8 @@
                 <div class="fileTable">
                     <el-collapse v-model="files" accordion class="collapse" style="height: 200px;">
                         <el-collapse-item title="文件" name="2" class="">
-                            <el-table :data="fileList" style="width: 100%"  @row-contextmenu="handleRowClick"
-                                @selection-change="handleSelectionChange" @row-click="mouseClick">
+                            <el-table :data="fileList" style="width: 100%" @row-contextmenu="handleRowClick"
+                                @selection-change="handleSelectionChange" @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
                                 <el-table-column type="selection" width="55" />
                                 <el-table-column label="名称" width="200">
                                     <template #default="scope">
@@ -192,7 +192,7 @@
                                         </span>
                                     </template>
                                 </el-table-column>
-                                <el-table-column prop="createTime" label="时间" width="180" />
+                                <el-table-column prop="createTime" label="时间" sortable width="180" />
                                 <el-table-column prop="fileType" label="类型" />
                                 <el-table-column label="大小">
                                     <template #default="scope">
@@ -201,39 +201,38 @@
                                         </span>
                                     </template>
                                 </el-table-column>
-
                             </el-table>
-                            <div class="setCli" v-if="cliCC">
-                                <template v-for="(item, index) in filterMouseCli()">
-                                    <p @click="chooseSet(item, index)" class="chooseSet">
-                                        <img :src="item.img" alt="">
-                                        {{ item.name }}
-                                        <span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
-                                            style="color: #7084B4;float: right;position: relative;" class="arrow">></span>
-                                    </p>
-                                </template>
-                            </div>
-                            <div class="setCli1" v-if="anyP">
-                                <p @click="chooseSet1(0)" class="">
-                                    <img src="../../assets/images/user.png" alt="">
-                                    选择人员
-                                </p>
-                                <p class="chooseSet">
-                                    <img src="../../assets/images/archiveTray.png" alt="">
-                                    归档
-                                </p>
-                            </div>
                         </el-collapse-item>
                     </el-collapse>
+                    <div class="setCli" v-if="cliCC">
+                        <template v-for="(item, index) in filterMouseCli()">
+                            <p @click="chooseSet(item, index)" class="chooseSet">
+                                <img :src="item.img" alt="">
+                                {{ item.name }}
+                                <span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
+                                    style="color: #7084B4;float: right;position: relative;" class="arrow">></span>
+                            </p>
+                        </template>
+                    </div>
+                    <div class="setCli1" v-if="anyP">
+                        <p @click="chooseSet1(0)" class="chooseSet">
+                            <img src="../../assets/images/user.png" alt="">
+                            选择人员
+                        </p>
+                        <p class="chooseSet" @click="goLock">
+                            <img src="../../assets/images/archiveTray.png" alt="">
+                            归档
+                        </p>
+                    </div>
                 </div>
 
             </div>
             <div v-else>
                 <div>
-                    <el-button @click="editOnline = true">返回</el-button>
+                    <el-button @click="editOnline = true;historyPrew=false">返回</el-button>
                 </div>
                 <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
-                    :historycopyRow="historycopyRow" :onlyView="onlyView"></FileEdit>
+                    :historycopyRow="historycopyRow" :onlyView="onlyView" @cancleHistoryPrew="cancleHistoryPrew"></FileEdit>
             </div>
             <!-- 扩容弹窗 -->
             <div>
@@ -260,61 +259,24 @@
             <!-- 新增文件夹弹窗 -->
             <div>
                 <CreateFloder v-if="folderCase" :folderCase="folderCase" @getChildrenC="getChildrenC" :oneOrTwo="oneOrTwo"
-                    :impDirId="impDirId"
-                    :impSpaceId="impSpaceId"
-                    :newDirId="newDirId"
-                    :newSpaceId="newSpaceId"
-                    :getAllTop="getAllTop"
-                    >
+                    :impDirId="impDirId" :impSpaceId="impSpaceId" :newDirId="newDirId" :newSpaceId="newSpaceId"
+                    :getAllTop="getAllTop">
                 </CreateFloder>
             </div>
-            <!-- 废弃的顶层目录新增 -->
-            <div>
-                <el-dialog v-model="addFile" title="Tips" width="30%">
-                    <el-form :model="fileForm" label-width="120px">
-                        <el-form-item label="空间类型">
-                            <el-select v-model="spaceValue" placeholder="请选择空间类型">
-                                <el-option v-for="(item, index) in spaceSelect" :key="item.value" :label="item.label"
-                                    :value="item.value" :disabled="item.disabled" />
-                            </el-select>
-                        </el-form-item>
-                        <el-form-item label="空间名称">
-                            <el-input v-model="fileForm.spaceName" />
-                        </el-form-item>
-                        <el-form-item label="备注">
-                            <el-input v-model="fileForm.remark" />
-                        </el-form-item>
-                    </el-form>
-                    <template #footer>
-                        <span class="dialog-footer">
-                            <el-button @click="addFile = false">取消</el-button>
-                            <el-button type="primary" @click="sureAddFile">
-                                确认
-                            </el-button>
-                        </span>
-                    </template>
-                </el-dialog>
-            </div>
             <!-- 文件上传 -->
             <div>
                 <el-dialog v-model="uploadModal" title="文件上传" width="30%">
                     <el-upload class="upload-demo" drag :http-request="onSuccess" multiple>
                         <el-icon class="el-icon--upload"><upload-filled /></el-icon>
-                        <div class="el-upload__text">
-                            拖入或<em>点击上传</em>
-                        </div>
+                        <div class="el-upload__text">拖入或<em>点击上传</em></div>
                         <template #tip>
-                            <div class="el-upload__tip">
-                                请选择或拖入文件
-                            </div>
+                            <div class="el-upload__tip">请选择或拖入文件</div>
                         </template>
                     </el-upload>
                     <template #footer>
                         <span class="dialog-footer">
                             <el-button @click="uploadModal = false">取消</el-button>
-                            <el-button type="primary" @click="sureUpload">
-                                确认
-                            </el-button>
+                            <el-button type="primary" @click="sureUpload">确认</el-button>
                         </span>
                     </template>
                 </el-dialog>
@@ -339,32 +301,8 @@
             </div>
             <!-- 文件收藏 -->
             <div>
-                <el-dialog v-model="fileCollect" title="重命名" width="30%">
-                    <el-form :model="collectForm" label-width="120px">
-                        <el-form-item label="名称">
-                            <el-input v-model="collectForm.name" />
-                        </el-form-item>
-                        <el-form-item label="收藏标签">
-                            <div class="newTag" v-if="tagCollect">
-                                <el-input v-model="newTag" placeholder="请输入新标签" @blur="tagBlur"></el-input>
-                            </div>
-                            <el-select v-model="collectForm.folders" class="m-2" placeholder="请选择" size="large"
-                                @change="collectChange">
-                                <el-option v-for="(item, index) in collectList" :key="item.labelId" :label="item.label"
-                                    :value="item.labelId" />
-                            </el-select>
-                        </el-form-item>
-                    </el-form>
-                    <el-button @click="createTag">新建标签</el-button>
-                    <template #footer>
-                        <span class="dialog-footer">
-                            <el-button @click="fileCollect = false">取消</el-button>
-                            <el-button type="primary" @click="sureCollect">
-                                确认
-                            </el-button>
-                        </span>
-                    </template>
-                </el-dialog>
+                <FileCollect v-if="collects" :collects="collects" @getCollects="getCollects" :copyFileName="copyFileName"
+                    :copyFileId="copyFileId"></FileCollect>
             </div>
             <!-- 中栏重命名 -->
             <div>
@@ -404,13 +342,13 @@ import { ref, toRaw, onMounted } from 'vue'
 import myfile from '../../api/myfile/myfile'
 import documents from '../../api/document/document'
 import fileSpace from '../../api/filespace/fileSpace'
-import fileShare from '../../api/fileShare/fileShare'
-import collect from '../../api/collect/collect'
+import fileCount from '../../api/fileCount/fileCount'
 import FileTree from './components/FileTree.vue'
 import BreadMenu from './components/BreadMenu.vue'
 import FileEdit from './components/FileEdit.vue'
 import TransferModal from './modalComponebts/Transfer.vue'
 import CreateFloder from './modalComponebts/CreateFloder.vue'
+import FileCollect from './modalComponebts/FileCollect.vue'
 import ImgFile from "./jsComponents/ImgFile"
 import { Search } from '@element-plus/icons-vue'
 import blueLeft from '../../assets/images/blueLeft.png'
@@ -429,6 +367,7 @@ export default {
     setup() {
         let fileTrees = ref(false)//filetree父传子
         let thanks = ref(false)//transfer父传子
+        let collects = ref(false)//文件收藏父传子
         let folderCase = ref(false)
         let editOnline = ref(true)
         let searchFire = ref('')
@@ -440,14 +379,10 @@ export default {
         let folderName = ref(false)
         let askNum = ref(1)
         let askTalk = ref('')
-        let newTag = ref('')
         let cliCC = ref(false)
-        let addFile = ref(false)
         let anyP = ref(false)
         let uploadModal = ref(false)
         let collectImg = ref(true)
-        let fileCollect = ref(false)
-        let tagCollect = ref(false)//添加收藏标签时显示
         let selectedBox = ref(-1)
         let newName = ref('')
         let clickRowId = ref(0)
@@ -474,27 +409,24 @@ export default {
         let copyOrMove = ref(0)//0代表复制,1代表移动
         let oneOrTwo = ref(0)//0代表二级,1代表一级
         let sortNum = ref(0)
+        let folderTotal = ref(0)//文件夹total
+        let fileTotal = ref(0)//文件total
         const openForwardFile = ref(false)   //历史版本展示
         const historyPrew = ref(false)
         const fileUserTreeData = reactive({ data: {} });
-        let fileForm = ref({
-            spaceType: '',
-            spaceName: "",
-            remark: "",
-        })
         let fileList = ref([
         ])
         let menuList = ref([
         ])
         let useMenu = ref([
-            {
-                img: ImgFile.copy,
-                name: "复制"
-            },
-            {
-                img: ImgFile.clipboard,
-                name: "粘贴"
-            },
+            // {
+            //     img: ImgFile.copy,
+            //     name: "复制"
+            // },
+            // {
+            //     img: ImgFile.clipboard,
+            //     name: "粘贴"
+            // },
             {
                 img: ImgFile.share,
                 name: "分享给"
@@ -533,11 +465,11 @@ export default {
             },
             {
                 img: ImgFile.addolder,
-                name: "移动",
+                name: "移动到...",
             },
             {
                 img: ImgFile.copy,
-                name: "复制",
+                name: "复制到...",
             },
             // {
             //     img: ImgFile.clipboard,
@@ -587,34 +519,11 @@ export default {
         let nameForm = ref({
             name: ""
         })
-        let collectForm = ref({
-            name: "",
-            folders: "",
-        })
         let fileNameChange = ref(false)
         let fileMenu = ref([])
-        let collectList = ref([])
         let copyRow = ref({})
-        let spaceValue = ref("")
         let newDirId = ref('')
         let newSpaceId = ref('')
-        let spaceSelect = ref([
-            {
-                label: "个人空间",
-                value: 3,
-            },
-            {
-                label: "部门空间",
-                value: 2,
-                disabled: true
-            },
-            {
-                label: "公共空间",
-                value: 1,
-                disabled: true
-            },
-
-        ])
         let workOrEdit = ref(0)
         const showPreview = ref(false)//控制图片预览组件显示
         const previewData = ref()//需要预览的文件的数据
@@ -627,19 +536,6 @@ export default {
         const fileCheckout = ref(false)//是否有勾选
         const haveCheck = ref(false)//是否有勾选
         const onlyView = ref(false) //预览
-        function getAllCollect() {
-            collect.getCollect({}).then(res => {
-                const maxAge = res.rows.reduce((max, obj) => (obj.orderNum > max ? obj.orderNum : max), res.rows[0].orderNum)
-                sortNum.value = maxAge
-                collectList.value = res.rows.map(item => {
-                    return {
-                        label: item.labelName,
-                        labelId: item.labelId,
-                        order: item.orderNum
-                    }
-                })
-            })
-        }
         // 获取文件夹,中栏,文件
         function getAllTop() {
             documents.getTop(3).then(res => {
@@ -648,13 +544,27 @@ export default {
                 impSpaceId.value = userMe[0].spaceId//固定
                 newSpaceId.value = userMe[0].spaceId//变化
                 newDirId.value = userMe[0].dirId//变化
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId }).then(res => {
+                let obj = {
+                    pageNum: 1,
+                    pageSize: 10
+                }
+                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId,pageNum:obj.pageNum,pageSize:obj.pageSize }).then(res => {
                     fileMenu.value = res.data
                     folderList.value = res.data
                 })
-                myfile.getById(userMe[0].dirId - 0).then(res => {
+                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
                     if (res.code === 200) {
                         fileList.value = res.rows
+                        fileTotal.value = res.total
+                        if (fileTotal.value / 10 != 1) {
+                            let x = Math.trunc(fileTotal.value / 10) + 1
+                            for (var i = 1; i < x; i++) {
+                                obj.pageNum = i
+                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                                    fileList.value = fileList.value.concat(res.rows); // 合并数组并更新 fileList.value
+                                })
+                            }
+                        }
                     }
                 })
             })
@@ -716,6 +626,7 @@ export default {
         function handleRowClick(row, col, e) {
             e.preventDefault();
             e.stopPropagation();
+            console.log(e, 'xxyy');
             copyRow.value = row
             clickRowId.value = row.docId
             copyDirId.value = row.dirId
@@ -724,6 +635,7 @@ export default {
             copyFileSize.value = row.fileSize
             copyFileType.value = row.fileType
             nameForm.value.name = row.fileName
+            copyFileName.value = row.fileName
             if (cliCC.value === true) {
                 cliCC.value = false
             } else {
@@ -770,11 +682,11 @@ export default {
                     }
                 })
             }
-            if (row.name === '复制') {
+            if (row.name === '复制到...') {
                 copyOrMove.value = 0
                 fileTrees.value = true
             }
-            if (row.name === '移动') {
+            if (row.name === '移动到...') {
                 copyOrMove.value = 1
                 fileTrees.value = true
             }
@@ -785,8 +697,7 @@ export default {
                 location.href = `${import.meta.env.VITE_APP_BASE_API}/api/download/${copyFileId.value}`;
             }
             if (row.name === '收藏') {
-                collectForm.value.name = nameForm.value.name
-                fileCollect.value = true
+                collects.value = true
             }
             if (row.name === '在线编辑') {
                 editOnline.value = false
@@ -802,14 +713,6 @@ export default {
                 })
             }
             if (row.name === '预览') {
-                // console.log('row=', toRaw(row));
-                // console.log('copyFileId',copyFileId.value);//文件id
-                // console.log('copyFileType',copyFileType.value);//文件type
-                //---------------------------
-                // showPreview.value = true
-                // const res = await preview(copyFileId.value)
-                // previewData.value = URL.createObjectURL(res)
-                //--------------------------------------
                 const filePreview = canPreviewFile(copyFileType.value)
                 if(filePreview){
                     onlyView.value = true
@@ -823,6 +726,9 @@ export default {
                 console.log('filePreview',filePreview);
 
                 // console.log('res',res);
+                showPreview.value = true
+                const res = await preview(copyFileId.value)
+                previewData.value = URL.createObjectURL(res)
             } else if (row.name === "历史版本") {
                 const resHistory = await listVersion({ docId: clickRowId.value })
                 fileUserTreeData.data = resHistory.rows;
@@ -838,34 +744,12 @@ export default {
             oneOrTwo.value = num
             folderCase.value = true
         }
-
+        function cancleHistoryPrew(val){
+            historyPrew.value=false
+        }
         function createNewFile() {
             addFile.value = true
         }
-        // 确定新增中栏
-        function sureAddFile() {
-            fileSpace.addFileSpace(
-                {
-                    "spaceName": fileForm.value.spaceName,
-                    "spaceType": fileForm.value.spaceType,
-                    "remark": fileForm.value.remark,//备注
-                }
-            ).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        message: "新增成功",
-                        type: "success"
-                    })
-                    getAllTop()
-                    addFile.value = false
-                } else {
-                    ElMessage({
-                        message: "请检查错误",
-                        type: "warning"
-                    })
-                }
-            })
-        }
         function arrowClick(row, num) {
             if (row.name === '文件') {
                 uploadModal.value = true
@@ -1011,7 +895,6 @@ export default {
             // 上一级dirId就是下一级的parentId
             // 判断是点击打开还是右键菜单打开
             row = row ? row : thisFolder.value
-            console.log('row', row);
             newDirId.value = row.dirId
             newSpaceId.value = row.spaceId
             documents.getALLdocument({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 }).then(res => {
@@ -1053,43 +936,6 @@ export default {
                 }
             })
         }
-        // 确认收藏
-        function sureCollect() {
-            collect.addCollect({
-                "docInfo": {
-                    "fileId": copyFileId.value - 0,
-                    "labelId": collectForm.value.folders - 0,
-                },
-            }).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        message: "收藏成功",
-                        type: "success"
-                    })
-                }
-            })
-            fileCollect.value = false
-        }
-        function collectChange(e) {
-            collectForm.value.folders = e
-        }
-        // 新建收藏标签
-        function createTag() {
-            newTag.value = ''
-            tagCollect.value = true
-        }
-        function tagBlur() {
-            collect.addNewTag({ labelName: newTag.value, orderNum: sortNum.value + 1 }).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        message: "新建标签成功",
-                        type: "success"
-                    })
-                    getAllCollect()
-                }
-            })
-            tagCollect.value = false
-        }
         // 判断id
         function isId() {
             if (directoryId.value === '') {
@@ -1131,6 +977,9 @@ export default {
         function getChildrenC(data) {
             folderCase.value = data
         }
+        function getCollects(data) {
+            collects.value = data
+        }
         //历史版本
         const forwardTreeData = reactive({ data: {} });
         const historycopyRow = ref({})
@@ -1176,10 +1025,6 @@ export default {
             e.preventDefault();
             e.stopPropagation();
             let thisRow = toRaw(row)
-            // console.log("row", thisRow);
-            // console.log("col", toRaw(col));
-            // console.log("e", e);
-            // console.log("item", toRaw(item));
             thisFolder.value = thisRow;
             //  唤出右键菜单,思路:获取鼠标位置来定位菜单
             folderVisible.value = true;
@@ -1191,9 +1036,21 @@ export default {
             // console.log("close");
             folderVisible.value = false;
         };
+        // 归档
+        function goLock() {
+            fileCount.lockActor(clickRowId.value).then(res => {
+                if (res.code === 200) {
+                    ElMessage({
+                        type: "success",
+                        message: "归档成功"
+                    })
+                    cliCC.value = false
+                    anyP.value = false
+                }
+            })
+        }
         onMounted(() => {
             getAllTop()
-            getAllCollect()
             // 添加监听,点击其他地方关闭文件夹右键菜单
             window.addEventListener("click", closeRMenu, true);
         })
@@ -1231,10 +1088,7 @@ export default {
             createNewMenu,
             // delBoser,
             clickRowId,
-            addFile,
             createNewFile,
-            fileForm,
-            sureAddFile,
             // fileUpload,
             getImage,//筛选文件类型
             handleSelectionChange,
@@ -1268,16 +1122,6 @@ export default {
             fileNameChange,//文件重命名模态框
             nameForm,
             collectImg,//收藏小星星
-            fileCollect,
-            collectForm,
-            sureCollect,
-            getAllCollect,//获取所有收藏文件夹
-            collectList,//文件收藏表
-            createTag,
-            tagCollect,
-            tagBlur,
-            newTag,
-            collectChange,
             sortNum,
             needBag,
             isId,
@@ -1287,8 +1131,6 @@ export default {
             sureFolderName,
             copyRow,
             getAllTop,
-            spaceValue,
-            spaceSelect,
             newDirId,
             newSpaceId,
             showPreview,//控制图片预览
@@ -1318,6 +1160,7 @@ export default {
             thisFolder,
             folderRClick,
             closeRMenu,
+            cancleHistoryPrew,
             //历史版本=========
             fileUserTreeData,
             thanks,
@@ -1330,9 +1173,13 @@ export default {
             folderCheckout,
             fileCheckout,
             haveCheck,
-            onlyView
+            onlyView,
+            goLock,
+            collects,//收藏父传子
+            getCollects,//收藏子传父
+            folderTotal,
+            fileTotal,
         }
-
     },
     watch: {
     },
@@ -1344,6 +1191,7 @@ export default {
         historyList,
         TransferModal,
         CreateFloder,
+        FileCollect,
     },
 }
 
@@ -1517,6 +1365,7 @@ p {
     border-radius: 4px;
     z-index: 10;
     overflow-y: auto;
+    // font-size: 16px;
 }
 
 .setCli1 {
@@ -1537,6 +1386,7 @@ p {
     height: 30px;
     line-height: 30px;
     margin: 5px auto;
+    font-size: 13px;
 
     // display: flex;
     // align-items: center;
@@ -1552,6 +1402,7 @@ p {
     height: 30px;
     line-height: 30px;
     margin: 5px auto;
+    font-size: 13px;
     background-color: #F5F7F9;
     /* color: white; */
 }

+ 5 - 2
src/views/myfile/components/FileEdit.vue

@@ -7,7 +7,7 @@
 </template>
 
 <script>
-import { ref, onMounted, } from 'vue'
+import { ref, onMounted,defineEmits  } from 'vue'
 import jjtOnlyOffice from '@/components/OnlyOffice/index.vue'
 import useUserStore from '@/store/modules/user'
 // import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
@@ -87,7 +87,10 @@ export default {
                     id: useUserStore().uid, //用户ID
                     name: useUserStore().uname //用户姓名
                 };
-                console.log(option.value,'option3===');
+                console.log('333333')
+                // const emit = defineEmits(["cancleHistoryPrew"]);
+                // emit("cancleHistoryPrew",false);
+                // console.log(option.value,'option3===');
             }
             
         }

+ 147 - 0
src/views/myfile/modalComponebts/FileCollect.vue

@@ -0,0 +1,147 @@
+<template>
+    <div>
+        <div>
+            <el-dialog v-model="fileCollect" title="重命名" width="30%">
+                <el-form :model="collectForm" label-width="120px">
+                    <el-form-item label="名称">
+                        <el-input v-model="collectForm.name" />
+                    </el-form-item>
+                    <el-form-item label="收藏标签">
+                        <div class="newTag" v-if="tagCollect">
+                            <el-input v-model="newTag" placeholder="请输入新标签" @blur="tagBlur"></el-input>
+                        </div>
+                        <el-select v-model="collectForm.folders" class="m-2" placeholder="请选择" size="large"
+                            @change="collectChange">
+                            <el-option v-for="(item, index) in collectList" :key="item.labelId" :label="item.label"
+                                :value="item.labelId" />
+                        </el-select>
+                    </el-form-item>
+                </el-form>
+                <el-button @click="createTag">新建标签</el-button>
+                <template #footer>
+                    <span class="dialog-footer">
+                        <el-button @click="backColl">取消</el-button>
+                        <el-button type="primary" @click="getSureC">
+                            确认
+                        </el-button>
+                    </span>
+                </template>
+            </el-dialog>
+        </div>
+    </div>
+</template>
+
+<script>
+import { ref, onMounted, toRef } from "vue"
+import { ElMessage } from "element-plus"
+import collect from "../../../api/collect/collect"
+export default {
+    props: {
+        collects: {
+            type: Boolean,
+            required: true
+        },
+        copyFileName: {
+            type: String,
+            required: true
+        },
+        copyFileId:{
+            type:Number,
+            required:true
+        }
+    },
+    setup(props, { emit }) {
+        let { backColl, getSureC } = toRef(props)
+        let result = props.collects
+        let fname = props.copyFileName
+        let fid = props.copyFileId
+        let fileCollect = ref(false)
+        let collectForm = ref({
+            name: "",
+            folders: "",
+        })
+        let tagCollect = ref(false)//添加收藏标签时显示
+        let newTag = ref('')
+        let sortNum = ref(0)
+        let collectList = ref([])
+        function inlineList() {
+            fileCollect.value = result
+            collectForm.value.name = fname
+        }
+        function tagBlur() {
+            collect.addNewTag({ labelName: newTag.value, orderNum: sortNum.value + 1 }).then(res => {
+                if (res.code === 200) {
+                    ElMessage({
+                        message: "新建标签成功",
+                        type: "success"
+                    })
+                    getAllCollect()
+                }
+            })
+            tagCollect.value = false
+        }
+        function collectChange(e) {
+            collectForm.value.folders = e
+        }
+        function getAllCollect() {
+            collect.getCollect({}).then(res => {
+                const maxAge = res.rows.reduce((max, obj) => (obj.orderNum > max ? obj.orderNum : max), res.rows[0].orderNum)
+                sortNum.value = maxAge
+                collectList.value = res.rows.map(item => {
+                    return {
+                        label: item.labelName,
+                        labelId: item.labelId,
+                        order: item.orderNum
+                    }
+                })
+            })
+        }
+        function createTag() {
+            newTag.value = ''
+            tagCollect.value = true
+        }
+        // 确认收藏
+        function sureCollect() {
+            collect.addCollect({
+                "docInfo": {
+                    "fileId": fid - 0,
+                    "labelId": collectForm.value.folders - 0,
+                },
+            }).then(res => {
+                if (res.code === 200) {
+                    ElMessage({
+                        message: "收藏成功",
+                        type: "success"
+                    })
+                }
+            })
+            fileCollect.value = false
+            emit("getCollects", fileCollect.value)
+        }
+        function tobacks() {
+            fileCollect.value = false
+            emit("getCollects", fileCollect.value)
+        }
+        onMounted(() => {
+            inlineList()
+            getAllCollect()
+        })
+        return {
+            fileCollect,
+            collectForm,
+            tagCollect,
+            newTag,
+            inlineList,
+            tagBlur,
+            collectChange,
+            getAllCollect,
+            createTag,
+            getSureC: sureCollect,
+            backColl: tobacks,
+            collectList,
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>

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

@@ -129,7 +129,27 @@ export default {
                     })
                 }
             } else {
-                return
+                if (chooseTagData.value.length === 0) {
+                    ElMessage({
+                        type: "error",
+                        message: "你还未选择人员!"
+                    })
+                } else {
+                    let arr = []
+                    arr = chooseTagData.value.map(item => {
+                        return item.userId
+                    })
+                    fileCount.addActor(dees, arr).then(res => {
+                        if (res.code === 200) {
+                            ElMessage({
+                                message: "提醒人员成功",
+                                type: "success"
+                            })
+                            transferModals.value = false
+                            emit("getCback", transferModals.value)
+                        }
+                    })
+                }
             }
 
         }