liyangzheng il y a 2 ans
Parent
commit
8b3ae6c643

+ 2 - 0
package.json

@@ -15,6 +15,8 @@
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
   },
   "dependencies": {
+    "@ckeditor/ckeditor5-build-classic": "^39.0.2",
+    "@ckeditor/ckeditor5-vue": "^5.1.0",
     "@element-plus/icons-vue": "2.0.10",
     "@vueup/vue-quill": "1.1.0",
     "@vueuse/core": "9.5.0",

+ 46 - 0
src/api/fileCount/fileCount.js

@@ -0,0 +1,46 @@
+import request from '../../utils/request'
+// 查询文档协作列表
+function getActor(data){
+    return request({
+        url:`/biz/actor/list`,
+        method:"get",
+        params:data
+    })
+}
+// 修改文档协作列表
+function editActor(data){
+    return request({
+        url:`/biz/actor`,
+        method:"put",
+        data,
+    })
+}
+// 删除文档协作列表
+function delActor(data){
+    return request({
+        url:`/biz/actor/${data}`,
+        method:"delete"
+    })
+}
+// 新增文档协作列表
+function addActor(data){
+    return request({
+        url:`/biz/actor`,
+        method:"post",
+        data,
+    })
+}
+// 获取详细信息
+function getActorById(data){
+    return request({
+        url:`/biz/actor/${data}`,
+        method:"get"
+    })
+}
+export default{
+    getActor,
+    getActorById,
+    addActor,
+    delActor,
+    editActor,
+}

BIN
src/assets/images/alltwosize.png


BIN
src/assets/images/backfo.png


BIN
src/assets/images/delline.png


BIN
src/assets/images/fontadd.png


BIN
src/assets/images/fontbloon.png


BIN
src/assets/images/fontboder.png


BIN
src/assets/images/fontdel.png


BIN
src/assets/images/fontlike.png


BIN
src/assets/images/idown.png


BIN
src/assets/images/leftline.png


BIN
src/assets/images/middleline.png


BIN
src/assets/images/rightline.png


BIN
src/assets/images/savefile.png


BIN
src/assets/images/towhere.png


+ 2 - 2
src/main.js

@@ -11,7 +11,7 @@ import App from './App'
 import store from './store'//pinia
 import router from './router'
 import directive from './directive' // directive
-
+import CKEditor from '@ckeditor/ckeditor5-vue';
 // 注册指令
 import plugins from './plugins' // plugins
 import { download } from '@/utils/request'
@@ -47,7 +47,7 @@ import TreeSelect from '@/components/TreeSelect'
 // 字典标签组件
 import DictTag from '@/components/DictTag'
 
-const app = createApp(App)
+const app = createApp(App).use( CKEditor )
 // for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
 //   app.component(key, component)
 // }

+ 81 - 79
src/views/myfile/MyFile.vue

@@ -18,7 +18,7 @@
                 </div>
                 <!-- 方块点击盒子 -->
                 <div
-                    style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;height: 80vh;align-content: flex-start;">
+                    style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;height: 80vh;align-content: flex-start;overflow-y: auto;">
                     <!-- v-for盒子 -->
                     <template v-for="(item, index) in fileMenu">
                         <div class="setBox" @click="changeFile(item, index)">
@@ -34,7 +34,7 @@
                                 </template>
                             </el-dropdown>
                             <img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;">
-                            <p class="ellipsis-text" v-if="selectedBox !== index">{{ item.spaceName }}</p>
+                            <p class="ellipsis-text" v-if="selectedBox !== index">{{ item.dirName }}</p>
                             <el-input v-else v-model="newName" @blur="nameChange(item, index)"></el-input>
                         </div>
                     </template>
@@ -103,7 +103,7 @@
                         </div>
                     </div>
                     <!-- 面包屑功能栏 -->
-                    <div class="breadBox">
+                    <div class="breadBox" v-if="editOnline">
                         <!-- 左侧 -->
                         <div style="display: flex;justify-content: space-around;align-items: center;">
                             <!-- 前进后退 -->
@@ -124,7 +124,7 @@
                     </div>
                 </div>
                 <!-- 展示文件夹盒子 -->
-                <div>
+                <div v-if="editOnline">
                     <!-- 文件夹 -->
                     <div class="detailBox">
                         <el-collapse v-model="folder" accordion class="collapseSell">
@@ -200,11 +200,11 @@
                                     </template>
                                     <div class="setCli1" v-if="anyP">
                                         <p @click="chooseSet1()" class="chooseSet">
-                                            <img :src="user" alt="">
+                                            <img src="../../assets/images/user.png" alt="">
                                             选择人员
                                         </p>
                                         <p class="chooseSet">
-                                            <img :src="archiveTray" alt="">
+                                            <img src="../../assets/images/archiveTray.png" alt="">
                                             归档
                                         </p>
                                     </div>
@@ -249,6 +249,7 @@
                         </el-dialog>
                     </div>
                 </div>
+                <FileEdit v-else></FileEdit>
             </div>
             <!-- 扩容弹窗 -->
             <div>
@@ -423,7 +424,9 @@ import fileSpace from '../../api/filespace/fileSpace'
 import userTree from '../../api/user/userTree'
 import fileShare from '../../api/fileShare/fileShare'
 import collect from '../../api/collect/collect'
+import fileCount from '../../api/fileCount/fileCount'
 import BreadMenu from './components/BreadMenu.vue'
+import FileEdit from './components/FileEdit.vue'
 import ImgFile from "./jsComponents/ImgFile"
 import { Search } from '@element-plus/icons-vue'
 import blueLeft from '../../assets/images/blueLeft.png'
@@ -431,14 +434,9 @@ import grayRight from "../../assets/images/grayRight.png"
 import sort from '../../assets/images/sort.png'
 import squre from '../../assets/images/squre.png'
 import { ElMessage } from 'element-plus'
-import txt from '../../assets/images/txt.png'
-import pptx from '../../assets/images/pptx.png'
-import word from '../../assets/images/word.png'
-import pdf from '../../assets/images/pdf.png'
-import xlxs from '../../assets/images/xlxs.png'
-import ImgPreview from "@/components/ImgPreview/ImgPreview.vue"
 export default {
     setup() {
+        let editOnline = ref(true)
         let searchFire = ref('')
         let selectedIndex = ref(0)
         let folder = ref(['1'])
@@ -475,6 +473,7 @@ export default {
         let copyFileType = ref('')//需要操作的文件类型
         let copyFileName = ref("")//需要操作的文件名
         let directoryId = ref('')
+        let copyParentId = ref("")//文件夹
         let allBag = ref("")//穿梭狂内搜索
         let needBag = ref("")
         let sortNum = ref(0)
@@ -612,7 +611,7 @@ export default {
         let fileNameChange = ref(false)
         let fileMenu = ref([])
         let collectList = ref([])
-        // 获取所有文件
+        // 获取所有文件
         function getAll() {
             myfile.getAllFileMenu({ dirId: folderId.value }).then(res => {
                 if (res.code === 200) {
@@ -620,16 +619,6 @@ export default {
                 }
             })
         }
-        // 获取所有中栏
-        function getAllMiddle() {
-            // fileSpace.getFileSpace({spaceId:directoryId.value}).then(res => {
-            //     fileMenu.value = res.rows
-            // })
-            myfile.fileType(3).then(res => {
-                fileMenu.value = [res.data]
-                directoryId.value = res.data.spaceId
-            })
-        }
         // 获取用户树
         function getAllUser() {
             userTree.getUserTree({}).then(res => {
@@ -663,9 +652,29 @@ export default {
                 })
             })
         }
+        // 中栏
+        function getAllText() {
+            documents.getALLdocument({ spaceId: directoryId.value }).then(res => {
+                folderList.value = res.data
+                fileMenu.value = res.data
+            })
+        }
+        // 获取所有文件夹
+        function getAllFolder() {
+            if (copyParentId.value === '') {
+                copyParentId.value = 0
+                documents.getALLdocument({ parentId: copyParentId.value - 0 }).then(res => {
+                    folderList.value = res.data
+                })
+            } else {
+                documents.getALLdocument({ parentId: copyParentId.value - 0 }).then(res => {
+                    folderList.value = res.data
+                })
+            }
+        }
         function changeFile(row, num) {
-            directoryId.value = row.spaceId
-            getAllText()
+            copyParentId.value = row.parentId
+            getAllFolder()
             this.selectedIndex = num
             const newItem = {
                 name: row.spaceName,
@@ -768,20 +777,15 @@ export default {
                 fileNameChange.value = true
             }
             if (row.name === "下载") {
-                myfile.fileDown(copyFileId.value).then(res => {
-                    if (res) {
-                        ElMessage({
-                            message: "正在下载",
-                            type: "info"
-                        })
-                    }
-                })
-                // location.href = `${import.meta.env.VITE_APP_BASE_API}/biz/info/download/${copyFileId.value}`;
+                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
             }
+            if (row.name === '在线编辑') {
+                editOnline.value = false
+            }
         }
         function chooseSet1() {
             transferModal.value = true
@@ -794,13 +798,13 @@ export default {
         function createNewMenu() {
             addBoser.value = true
         }
-        // 新增中栏下方数据
+        // 新增文件夹
         function sureAddBoser() {
             documents.addDocument({
                 "dirName": boserForm.value.dirName,
                 // "dirRole": boserForm.value.dirPower,
                 // "dirType": boserForm.value.dirType,
-                // "parentId": boserForm.value.parentId,
+                "parentId": copyParentId.value-0,
                 // "remark": boserForm.value.remark,
                 "spaceId": directoryId.value,
             }).then(res => {
@@ -814,12 +818,7 @@ export default {
                 getAllText()
             })
         }
-        // 所有文件夹
-        function getAllText() {
-            documents.getALLdocument({ spaceId: directoryId.value }).then(res => {
-                folderList.value = res.data
-            })
-        }
+
         function createNewFile() {
             addFile.value = true
         }
@@ -859,22 +858,24 @@ export default {
         }
         // 确认上传
         function sureUpload() {
-            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 = []
-                    }
-                })
+            if (fileArr.value.length > 0) {
+                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(files, val) {
@@ -883,15 +884,15 @@ export default {
         // 筛选后缀图片
         function getImage(file) {
             if (file === '.txt') {
-                return txt
+                return ImgFile.txt
             } else if (file === '.xlxs' || file === '.docx') {
-                return xlxs
+                return ImgFile.xlxs
             } else if (file === '.pptx') {
-                return pptx
+                return ImgFile.pptx
             } else if (file === '.word') {
-                return word
+                return ImgFile.word
             } else if (file === '.pdf') {
-                return pdf
+                return ImgFile.pdf
             }
         }
         // 表格多选框
@@ -916,17 +917,17 @@ export default {
         }
         // 重命名
         function restName(row, index) {
-            newName.value = row.spaceName
+            newName.value = row.dirName
             selectedBox.value = index
         }
         // 重命名失焦事件
         function nameChange(row, index) {
-            fileSpace.editFileSpace({
+            document.editDocument({
                 "spaceId": row.spaceId,
                 "spaceName": newName.value,
             }).then(res => {
                 if (res.code === 200) {
-                    getAllMiddle()
+                    getAllFolder()
                     selectedBox.value = -1
                     ElMessage({
                         message: '重命名成功',
@@ -999,7 +1000,6 @@ export default {
                 remark: '',
                 spaceId: copySpaceId.value - 0,
             }).then(res => {
-                console.log(res, '852');
                 if (res.code === 200) {
                     ElMessage({
                         message: "重命名成功",
@@ -1136,11 +1136,6 @@ export default {
             fileForm,
             sureAddFile,
             // fileUpload,
-            txt,
-            pptx,
-            xlxs,
-            pdf,
-            word,
             getImage,//筛选文件类型
             handleSelectionChange,
             handleSelectionChange1,
@@ -1151,7 +1146,7 @@ export default {
             getMenu,
             folderId,
             fileId,
-            getAllMiddle,//拿到所有空间信息
+            // getAllMiddle,//拿到所有空间信息
             delName,//删除空间信息
             useSpace,//使用空间
             allSpace,//总空间
@@ -1195,21 +1190,26 @@ export default {
             sortNum,
             needBag,
             isId,
+            editOnline,//在线编辑
+            copyParentId,
+            getAllFolder,
         }
     },
     created() {
         this.getAll();
         this.getSpace()
         this.getAllText()
-        this.getAllMiddle()
+        // this.getAllMiddle()
         this.getAllUser()
         this.getAllCollect()
         this.isId()
+        this.getAllFolder()
     },
     watch: {
     },
     components: {
         BreadMenu,
+        FileEdit,
     },
 }
 </script>
@@ -1281,7 +1281,7 @@ p {
 
 .mesBox {
     width: 70vw;
-    height: 100%;
+    height: 43rem;
     /* margin: 5px 5px; */
     border-radius: 4px;
     background-color: white;
@@ -1393,17 +1393,19 @@ p {
 }
 
 .chooseSet {
-    width: 100%;
+    width: 140px;
     height: 30px;
     line-height: 30px;
+    margin: 5px auto;
 }
 
 .chooseSet:hover {
-    width: 100%;
+    width: 140px;
     height: 30px;
     line-height: 30px;
-    background-color: #8693b2;
-    color: white;
+    margin: 5px auto;
+    background-color: #F5F7F9;
+    /* color: white; */
 }
 
 :deep([data-v-69cdaa40] .el-collapse-item__header) {

+ 41 - 0
src/views/myfile/components/FileEdit.vue

@@ -0,0 +1,41 @@
+<template>
+    <div>
+        <div>
+            <!-- 工具栏 -->
+            <!-- <div class="settingBox">
+
+            </div> -->
+            <div>
+                <ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import { ref } from 'vue'
+import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
+export default {
+    setup() {
+        let editor = ref(ClassicEditor)
+        let editorData = ref("<p>Content of the editor.</p>")
+        let editorConfig = ref({
+
+        })
+        return {
+            editor,
+            editorData,
+            editorConfig,
+        }
+    }
+}
+</script>
+
+<style scoped>
+:deep(.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable, .ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners){
+    height: 34.5rem;
+}
+:deep(.ck.ck-toolbar>.ck-toolbar__items){
+    background-color: #F5F7F9;
+}
+</style>