Browse Source

Merge remote-tracking branch 'origin/v3' into v3

# Conflicts:
#	index.html
wukai 2 years ago
parent
commit
a04344adce

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "@vueup/vue-quill": "1.1.0",
     "@vueuse/core": "9.5.0",
     "axios": "0.27.2",
+    "clipboard": "^2.0.11",
     "echarts": "5.4.0",
     "element-plus": "2.2.27",
     "file-saver": "2.0.5",

+ 8 - 0
src/api/chat/msg.js

@@ -128,4 +128,12 @@ export function fileDownload(data){
       url:`/biz/info/download/${data}`,
       method:"get"
   })
+}
+//测试
+export function uploadFileMany(data) {
+  return request({
+      url: `/biz/info/uploadFiles`,
+      method: "post",
+      data,
+  })
 }

+ 18 - 0
src/api/common/common.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+export function ocrRemark(data) {
+    return request({
+        url: `/api/ocr/${data}`,
+        method: "get",
+    })
+}
+export function preview(data) {
+    return request({
+        url: `/api/access/${data}`,
+        method: "get",
+        headers: {
+            'Content-Type': 'application/json'
+        },
+        responseType: 'blob' //这个最重要,一定不要忘记
+    })
+}

+ 18 - 4
src/api/document/document.js

@@ -1,4 +1,10 @@
 import request from '../../utils/request'
+function getTop(data){
+    return request({
+        url:`/biz/dir/top-dir/${data}`,
+        method:"get",
+    })
+}
 // 获取所有文件夹列表
 function getALLdocument(data) {
     return request({
@@ -18,9 +24,9 @@ function addDocument(data) {
 // 修改
 function editDocument(data) {
     return request({
-        url: `/biz/dir`,
-        method: "put",
-        data,
+        url: `/biz/dir/rename`,
+        method: "get",
+        params:data,
     })
 }
 // 删除
@@ -30,9 +36,17 @@ function delDocument(data) {
         method: "delete",
     })
 }
+function fileTree(data){
+    return request({
+        url:`/biz/dir/file-tree/${data}`,
+        method:"get"
+    })
+}
 export default {
     getALLdocument,
     addDocument,
     delDocument,
-    editDocument
+    editDocument,
+    getTop,
+    fileTree,
 }

+ 20 - 13
src/api/search/search.js

@@ -1,16 +1,23 @@
 import request from '@/utils/request'
 
 export function search(query) {
-    return request({
-      url: '/es/query',
-      method: 'get',
-      params: query
-    })
-  }
-  export function flieSearch(query) {
-    return request({
-      url: '/biz/info/search',
-      method: 'get',
-      params: query
-    })
-  }
+  return request({
+    url: '/es/query',
+    method: 'get',
+    params: query
+  })
+}
+export function flieSearch(query) {
+  return request({
+    url: '/biz/info/search',
+    method: 'get',
+    params: query
+  })
+}
+export function picTree(query) {
+  return request({
+    url: '/biz/dir/pic-tree',
+    method: 'get',
+    params: query
+  })
+}

BIN
src/assets/images/light.png


+ 1 - 1
src/components/FileTreeChoice/index.vue

@@ -11,7 +11,7 @@
           ref="treeRef"
           :data="treeData.data"
           :show-checkbox="false"
-          :height="280"
+          :height="320"
           :props="defaultProps"
           @node-click="handleNodeClick"
         >

+ 194 - 13
src/components/IdentifyFont/IdentifyFont.vue

@@ -1,12 +1,13 @@
 <template>
   <div>
-    <el-dialog v-model="show" title="重命名" width="70%">
+    <el-dialog v-model="isOpen" title="文字识别" width="55%">
       <div class="container">
-        <div v-if="!showImg" class="up_box">
+        <div v-if="thisStep === 'start'" class="up_box">
           <div class="left_box">
             <div class="upimg_box">
-              <!-- TODO 拖拽设置不生效问题 -->
+              <!-- TODO 拖拽设置不生效问题 ,但是测试那里可以实现拖拽,离大谱-->
               <el-upload
+                v-if="!showImg"
                 class="avatar-uploader"
                 :drag="true"
                 action="http://192.168.1.28:8080/api/upload"
@@ -17,6 +18,9 @@
                 <img src="@/assets/images/add.png" class="avatar" />
                 <span>将图片拖入框内/点击按钮上传图片</span>
               </el-upload>
+              <div v-else class="img_show">
+                <img :src="toRaw(showImg)" class="avatar" />
+              </div>
             </div>
             <div class="sunmit_btn">
               <el-upload
@@ -33,6 +37,7 @@
           <div class="right_box">
             <div class="upimg_box">
               <el-upload
+                disabled
                 class="avatar-uploader"
                 action="http://192.168.1.28:8080/api/upload"
                 :show-file-list="false"
@@ -42,34 +47,146 @@
                 <span>点击按钮上传图片</span>
               </el-upload>
             </div>
-            <div class="sunmit_btn">添加文库图片</div>
+            <div class="sunmit_btn" @click="addlibraryImg">添加文库图片</div>
           </div>
         </div>
-        <div v-else>
-          <img :src="toRaw(showImg)" class="avatar" />
+        <div v-if="thisStep === 'loading'" class="load-box">
+          <div class="light_box">
+            <img :src="toRaw(showImg)" class="avatar" />
+            <div class="light"></div>
+          </div>
+        </div>
+        <div v-if="thisStep === 'end'" class="end_box">
+          <div class="left_box">
+            <div class="upimg_box">
+              <div class="img_show">
+                <img :src="toRaw(showImg)" class="avatar" />
+              </div>
+            </div>
+            <div class="sunmit_btn">
+              <!-- <el-upload
+                class="avatar-uploader"
+                action="http://192.168.1.28:8080/api/upload"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeUp"
+              > -->
+              <span @click="reClick">重新选择</span>
+              <!-- </el-upload> -->
+            </div>
+          </div>
+          <div class="right_box">
+            <div class="upimg_box">
+              <el-scrollbar>
+                <div class="text_box">
+                  {{ textData }}
+                </div>
+              </el-scrollbar>
+            </div>
+            <div class="sunmit_btn copy-qb" @click="copyQbUrl()">全部复制</div>
+          </div>
         </div>
       </div>
     </el-dialog>
+    <PicTree
+      :openFile="openFile"
+      @close="openFile = false"
+      :fileUserTreeData="treeData"
+      @fileChangeMsg="fileChangeMsg"
+    ></PicTree>
   </div>
 </template>
 
 <script setup>
-import { onMounted, ref, toRaw } from "vue";
+import { onMounted, ref, toRaw ,watch} from "vue";
+import { ElMessage } from "element-plus";
+import Clipboard from "clipboard";
+import PicTree from "@/components/PicTree/PicTree.vue"; //选择文件发送的列表
+import { picTree } from "@/api/search/search.js";
+import { ocrRemark, preview } from "@/api/common/common.js";
 const textData = ref(""); //解析出来的文字
 const showImg = ref(); //上传的图片
-const show = ref(true);
+const isOpen = ref(props.openFile);
+const thisStep = ref("start"); //解析进度 start,loading,end,
+const openFile = ref(false); //控制tree显示
+const treeData = ref(); //树节点数据
+
+const props = defineProps({
+  openFile: {
+    type: Boolean,
+    default: false,
+  },
+});
+watch(
+  () => props.openFile,
+  (newValue) => {
+    // console.log(111);
+    isOpen.value = newValue;
+  }
+);
 const handleAvatarSuccess = (msg, file) => {
-  console.log("re", msg);
+  // console.log("re", msg);
   const flieData = toRaw(file);
-  console.log("file", flieData);
-  showImg.value = URL.createObjectURL(flieData.raw);
+  // console.log("file", flieData);
+  // showImg.value = URL.createObjectURL(flieData.raw);
   if (msg.code === 200) {
     textData.value = msg.msg;
+    thisStep.value = "end";
+  } else {
+    thisStep.value = "start";
+    textData.value = null;
+    showImg.value = null;
+    ElMessage({ message: '识别失败', type: 'error' })
   }
   console.log("textData", textData.value);
 };
-const beforeUp = () => {
-  console.log(2);
+//文件上传前的钩子
+const beforeUp = (raw) => {
+  // console.log('raw',raw);
+  showImg.value = URL.createObjectURL(raw);
+  thisStep.value = "loading";
+};
+// 复制功能调用的方法
+const copyQbUrl = () => {
+  let clipboard = new Clipboard(".copy-qb", {
+    text: () => {
+      return textData.value;
+    },
+  });
+  clipboard.on("success", () => {
+    // console.log('success');
+    ElMessage({ message: '复制成功', type: 'success' })
+    clipboard.destroy();
+  });
+  clipboard.on("error", () => {
+    // console.log('err');
+    clipboard.destroy();
+  });
+};
+// 选取文库图片
+const addlibraryImg = async () => {
+  const res = await picTree();
+  console.log("res", res);
+  treeData.value = res;
+  openFile.value = true;
+};
+//确定选中图片
+const fileChangeMsg = async (val) => {
+  console.log("val", toRaw(val));
+  const data = toRaw(val);
+  const imgRes = await preview(data.remark);
+  thisStep.value = "loading";
+  showImg.value = URL.createObjectURL(imgRes);
+  const res = await ocrRemark(data.remark);
+  thisStep.value = "end";
+  textData.value = res.msg;
+  // console.log("res", res);
+  // console.log("imgRes", imgRes);
+};
+const reClick = () => {
+  thisStep.value = "start";
+  textData.value = null;
+  showImg.value = null;
 };
 </script>
 
@@ -88,6 +205,18 @@ const beforeUp = () => {
     flex-direction: column;
     align-items: center;
     margin-right: 48px;
+    .img_show {
+      width: 100%;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      img {
+        width: 100%;
+        // max-height: 100%;
+        // object-fit:cover; // 保持原比例缩小
+      }
+    }
     .upimg_box {
       width: 100%;
       height: 300px;
@@ -134,6 +263,58 @@ const beforeUp = () => {
       font-weight: 400;
       text-align: center;
     }
+    .text_box {
+      font-size: 14px;
+      font-weight: 500;
+      color: #000000;
+      line-height: 22px;
+    }
+  }
+  .load-box {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    .light_box {
+      width: 320px;
+      height: 320px;
+      background-image: url("@/assets/images/light.png");
+      background-repeat: no-repeat;
+      background-size: contain;
+      position: relative;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      img {
+        width: 100%;
+        // height: 100%;
+      }
+      .light {
+        width: 100%;
+        height: 1px;
+        position: absolute;
+        top: 0;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        background-color: rgba(0, 255, 255, 0.7);
+        box-shadow: 0px 2px 10px 5px rgba(0, 255, 255, 0.3);
+        animation: move 2s infinite linear;
+      }
+      @keyframes move {
+        from {
+          top: 0px;
+        }
+
+        /*网格移动到显示区域的外面*/
+        to {
+          top: 100%;
+        }
+      }
+    }
+  }
+  .end_box {
+    display: flex;
+    justify-content: center;
   }
 }
 :deep(.el-dialog__header) {

+ 65 - 22
src/components/ImgPreview/ImgPreview.vue

@@ -1,31 +1,74 @@
 <template>
-  <div class="img-viewer-box">
+  <div class="demo-image__preview">
     <el-image-viewer
-      v-if="state.visible"
-      :url-list="props.imgs"
-      @close="close"
+      v-if="showImageViewer"
+      :url-list="[previewData]"
+      @close="closeImgPreview"
     />
   </div>
 </template>
 
-
-<script  setup>
-import { ref, reactive } from "vue";
-import { useVModel } from "@vueuse/core";
-const props = defineProps();
-const emits = defineEmits();
-const state = reactive({
-  imgList: [],
-  // 相当于是set 与 get
-  visible: useVModel(props, "modelValue", emits),
+<script setup>
+import {
+  ref,
+  computed,
+  reactive,
+  defineComponent,
+  watch,
+  onMounted,
+  defineExpose,
+} from "vue";
+const props = defineProps({
+  showPreview: {
+    type: Boolean,
+    default: false,
+  },
+  previewData: {
+    type: Object,
+    default: () => {},
+  },
 });
-
-// 点击关闭的时候,连同小图一起关闭
-function close() {
-  state.visible = false;
-}
+watch(
+  () => props.showPreview,
+  (newValue) => {
+    // console.log(111);
+    showImageViewer.value = newValue;
+  }
+);
+const url =
+  "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg";
+const srcList = [
+  "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
+  "https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg",
+  "https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg",
+  "https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg",
+  "https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg",
+  "https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg",
+  "https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg",
+];
+const previewImg = ref(null);
+const showImageViewer = ref(false); //组件是否显示
+const emit = defineEmits(["closeImgPreview"]);
+const showImg = () => {
+  //预览大图
+  showImageViewer.value = true;
+};
+const closeImgPreview = () => {
+  //必须要这个事件 不然点击右上角关闭按钮没有反应
+  // console.log('sonClose');
+  emit("closeImgPreview");
+};
 </script>
 
-
-<style lang="scss" scoped>
-</style>
+<style scoped>
+.demo-image__error .image-slot {
+  font-size: 30px;
+}
+.demo-image__error .image-slot .el-icon {
+  font-size: 30px;
+}
+.demo-image__error .el-image {
+  width: 100%;
+  height: 200px;
+}
+</style>

+ 1 - 2
src/components/OnlyOffice/index.vue

@@ -94,7 +94,7 @@
 							},
 						},
 						user: {
-							id: option.user.id,
+							id: option.user.id+'',
 							name: option.user.name
 						},
 						mode: option.model ? option.model : 'edit',
@@ -108,7 +108,6 @@
 					height: document.body.clientHeight - 150,
 					token: option.token || ''
 				}
-
 				// eslint-disable-next-line no-undef,no-unused-vars
 				this.docEditor = new DocsAPI.DocEditor('jjtOnlyOffice', config)
 

+ 95 - 0
src/components/PicTree/PicTree.vue

@@ -0,0 +1,95 @@
+<template>
+  <el-dialog v-model="isOpen" append-to-body width="700">
+    <template #header>
+      <div class="my-header">
+        <div class="title">选择图片</div>
+      </div>
+    </template>
+    <div class="main-cont">
+      <div class="main-cont-left">
+        <el-tree-v2
+          ref="treeRef"
+          :data="treeData.data"
+          :show-checkbox="false"
+          :height="280"
+          :props="defaultProps"
+          @node-click="handleNodeClick"
+        >
+          <template #default="{ node }">
+            <span style="display: flex;align-items: center;">
+              <!-- <img :src="fileImg" alt="" style="width: 20px;height: 20px;margin-right: 5px;"/> -->
+              <!-- 放置图片 -->
+              <span>{{ node.label }}</span>
+              <!-- 显示节点标签 -->
+            </span>
+          </template>
+        </el-tree-v2>
+      </div>
+    </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="isOpen = false" class="cancel-button"
+          >取消</el-button
+        >
+        <el-button type="primary" @click="confirm" class="sure-button">
+          确认
+        </el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+  <script setup>
+import { reactive, ref, toRaw, toRefs, watch } from "vue";
+import { ElMessage } from "element-plus";
+import useUserStore from "@/store/modules/user";
+import { defineEmits } from "vue";
+const opent = ref(true);
+const props = defineProps({
+  openFile: {
+    type: Boolean,
+    default: false,
+  },
+  fileUserTreeData: {
+    type: Object,
+    default: () => {},
+  },
+});
+const defaultProps = {
+  children: "children",
+  label: "label",
+  value: "id",
+};
+const isOpen = ref(props.openFile);
+watch(
+  () => props.openFile,
+  (newValue) => {
+    // console.log(111);
+    isOpen.value = newValue;
+  }
+);
+const treeData = reactive({ data: [] });
+watchEffect(() => {
+  treeData.data[0]=props.fileUserTreeData
+  toRaw(treeData.data);
+  console.log('toRaw(treeData.data);', toRaw(treeData.data))
+});
+
+//树
+const clickData = ref({});
+const handleNodeClick = (data) => {
+  clickData.value = data;
+};
+//确定按钮
+  const emit = defineEmits(["fileChangeMsg"]);
+const confirm = () => {
+  const {disabled,label}=toRefs(clickData.value)
+  if(disabled.value){
+    return ElMessage({ message: '当前选中为目录,请重新选择文件', type: 'error' })
+  }
+    emit("fileChangeMsg", clickData.value);
+    isOpen.value  = false
+};
+</script>
+<style lang="scss" scoped>
+@import "@/assets/styles/tree-common.scss";
+</style>

+ 1 - 1
src/layout/indexCommon.vue

@@ -252,7 +252,7 @@ const menuList = reactive({
     },
     {
       label: "传输列表",
-      path: "/ws",
+      path: "/transFile",
       imgs: chuanshu,
       beimgs: bechuanshu,
     },

+ 9 - 0
src/router/index.js

@@ -137,6 +137,15 @@ export const constantRoutes = [{
 				}
 			},
 			{
+				path: "/transFile",
+				component: () => import("@/views/transFile/index.vue"),
+				name: "transFile",
+				meta: {
+					title: "聊天",
+					icon: "department"
+				}
+			},
+			{
 				path: "/highsearch",
 				component: () => import("@/views/highSearch/HighSearch.vue"),
 				name: "highsearch",

+ 9 - 0
src/store/modules/process.js

@@ -0,0 +1,9 @@
+
+const uploadStore = defineStore('uploadsss', {
+    state: () => ({
+        multiFileList: [],
+        processNumber: 3,
+        promise: []
+    })
+})
+export default uploadStore

+ 15 - 1
src/store/modules/user.js

@@ -3,6 +3,7 @@ import {
 	logout,
 	getInfo
 } from '@/api/login'
+import {spaceInfo} from "@/api/chat/msg";
 import {
 	getToken,
 	setToken,
@@ -19,7 +20,8 @@ const useUserStore = defineStore(
 			uname: '',
 			avatar: '',
 			roles: [],
-			permissions: []
+			permissions: [],
+			spaceIdCommon:''
 		}),
 		actions: {
 			// 登录
@@ -56,6 +58,7 @@ const useUserStore = defineStore(
 						this.avatar = avatar;
 						const websoctStore = useWebsoctStore()
 						websoctStore.connect()
+						this.getSpaceInfo()
 						resolve(res)
 					}).catch(error => {
 						reject(error)
@@ -75,6 +78,17 @@ const useUserStore = defineStore(
 						reject(error)
 					})
 				})
+			},
+			//获取空间id
+			getSpaceInfo(){
+				return new Promise((resolve, reject) => {
+					spaceInfo(3).then((topSpaceid) => {
+						this.spaceIdCommon= topSpaceid.data.spaceId.toString();
+						resolve()
+					}).catch(error => {
+						reject(error)
+					})
+				})
 			}
 		}
 	})

+ 165 - 0
src/utils/progress.js

@@ -0,0 +1,165 @@
+import uploadStore from '@/store/modules/process'
+import { ElMessage } from 'element-plus'
+import { uploadFileMany } from "@/api/chat/msg";
+import useUserStore from "@/store/modules/user";
+const useUserStoreId = useUserStore();
+export function addUploadFile(raw) {
+  const upload = uploadStore()
+  const uploadProgress = {
+    progress: 0,
+    file_id: '',
+    file_name: raw.name,
+    percent: [],
+    speed: '0 MB',
+    file_size: raw.size,
+    upload_size: 0,
+    upload_time: new Date()
+  }
+  // status上传状态 0 队列,1 上传中,2 上传成功 , 3 取消上传
+  // failTryCount 失败上传次数, 没上传一次,自动减去已,当为0的时候,停止上传
+  upload.multiFileList.push({file: raw, progress: uploadProgress, status: 0, failTryCount: 3})
+  multiUpload()
+}
+
+export function multiUpload() {
+  const upload = uploadStore()
+  const readFileList = []
+  upload.multiFileList.forEach(res => {
+    if (res.status === 0) {
+      readFileList.push(res)
+    }
+  })
+  if (readFileList.length > 0) {
+    multiRun(upload, readFileList.slice(0, upload.processNumber), uploadAsync)
+  }
+}
+
+function multiRun(upload, keyList, func) {
+  const processNumber = upload.processNumber
+  const promise = upload.promise
+  for (let i = 0; i < processNumber - promise.length; i++) {
+    promise.push(Promise.resolve())
+  }
+  let reduceNumber = promise.length - processNumber
+  if (reduceNumber > 0) {
+    upload.promise = promise.slice(0, reduceNumber)
+  }
+  for (let j = 0; j < keyList.length; j += processNumber) {
+    for (let i = 0; i < processNumber; i++) {
+      if (i + j < keyList.length) {
+        promise[(j + i) % processNumber] = promise[(j + i) % processNumber].then(() => func(keyList[i + j]))
+        // .catch(({fileInfo,err}) => {
+        //   if (fileInfo?.status === 3) {
+        //     console.log(fileInfo.file.name, '取消上传')
+        //   } else {
+        //     fileInfo.status = 0
+        //     fileInfo.failTryCount -= 1
+        //     if (fileInfo.failTryCount < 1) {
+        //       ElMessage.error(`${fileInfo.file.name} 超过最大重试次数,停止上传`)
+        //     } else {
+        //       ElMessage.error(`${fileInfo.file.name} 上传失败,正在重试`)
+        //       console.log(fileInfo.file.name, err)
+        //       multiUpload()
+        //     }
+        //   }
+        // })
+      }
+    }
+  }
+}
+
+function uploadAsync(fileInfo) {
+  const progress = fileInfo.progress
+  const file = fileInfo.file
+  return new Promise((resolve, reject) => {
+    progress.file_name = file.name
+    progress.file_size = file.size
+    if (fileInfo.status === 0) {
+      fileInfo.status = 1
+    } else {
+      return resolve()
+    }
+    progress.progress = 10
+    // getUploadSid().then(async res => {
+    //   progress.speed = '文件读取中'
+    //   let hash = await PreHash(file, progress)
+    //   let fileHashInfo = {
+    //     sid: res.data.sid,
+    //     file_name: progress.file_name,
+    //     file_size: progress.file_size,
+    //     pre_hash: hash
+    //   }
+    //   progress.progress = 20
+    //   checkPreHash(fileHashInfo).then(async pRes => {
+    //     if (pRes.data.check_status === true) {
+    //       progress.progress = 30
+    //       const md5Code = pRes.data.md5_token
+    //       progress.speed = '文件校验中'
+    //       let hash = await ContentHash(file, md5Code, progress)
+    //       fileHashInfo.proof_code = hash.proofCode
+    //       fileHashInfo.content_hash = hash.conHash
+    //       checkContentHash(fileHashInfo).then(async cRes => {
+    //         if (cRes.data.check_status === true) {
+    //           progress.progress = 100
+    //           progress.upload_size = progress.file_size
+    //           progress.speed = '秒传成功'
+    //           fileInfo.status = 2
+    //           fileInfo.upload_time = new Date()
+    //           multiUpload()
+    //           resolve()
+    //         } else {
+    //           return await ChunkedUpload(fileInfo, fileHashInfo, cRes.data.upload_extra, cRes.data.part_info_list, () => {
+    //             fileInfo.status = 2
+    //             fileInfo.upload_time = new Date()
+    //             multiUpload()
+    //             resolve()
+    //           }, (err) => {
+    //             reject({fileInfo, err})
+    //           })
+    //         }
+    //       }).catch((err) => {
+    //         reject({fileInfo, err})
+    //       })
+    //     } else {
+    //       return await ChunkedUpload(fileInfo, fileHashInfo, pRes.data.upload_extra, pRes.data.part_info_list, () => {
+    //         fileInfo.status = 2
+    //         fileInfo.upload_time = new Date()
+    //         multiUpload()
+    //         resolve()
+    //       }, (err) => {
+    //         reject({fileInfo, err})
+    //       })
+    //     }
+    //   }).catch((err) => {
+    //     reject({fileInfo, err})
+    //   })
+    // }).catch((err) => {
+    //   reject({fileInfo, err})
+    // })
+
+    // Update this part of the code based on your project's API for uploading files
+    console.log('file=========', file,)
+    uploadFileMany({spaceId:useUserStoreId.spaceIdCommon,dirId:17,files:''}).then((res) => {
+      progress.progress = 100
+      progress.upload_size = progress.file_size
+      progress.speed = '上传成功'
+      fileInfo.status = 2
+      fileInfo.upload_time = new Date()
+      console.log('res===', res)
+      multiUpload()
+
+      resolve()
+    }).catch((err) => {
+      fileInfo.status = 0
+      fileInfo.failTryCount -= 1
+      if (fileInfo.failTryCount < 1) {
+        ElMessage.error(`${fileInfo.file.name} 超过最大重试次数,停止上传`)
+      } else {
+        ElMessage.error(`${fileInfo.file.name} 上传失败,正在重试`)
+        console.log(fileInfo.file.name, err)
+        multiUpload()
+      }
+      reject({fileInfo, err})
+    })
+  })
+}

+ 2 - 2
src/views/highSearch/HighSearch.vue

@@ -76,7 +76,7 @@
         <span>没有关于“{{ noFound }}”的结果 </span>
       </div>
     </div>
-    <IdentifyFont :showIdentify="showIdentify"></IdentifyFont>
+    <IdentifyFont :openFile="openFile"></IdentifyFont>
   </div>
 
 </template>
@@ -101,7 +101,7 @@ const selectOptions = [
 ];
 
 // ----------------------------
-const showIdentify = ref(true)
+const openFile = ref(true)
 // ----------------------------
 
 onMounted(async () => {});

+ 1 - 0
src/views/liveChat/index.vue

@@ -491,6 +491,7 @@ onMounted(() => {
               clearable
               size="small"
               placeholder="请输入聊天内容"
+              maxlength="450"
               @keydown.enter="msgSendClick"
             />
             <!-- 发送按钮 -->

+ 176 - 92
src/views/myfile/MyFile.vue

@@ -1,5 +1,5 @@
 <template>
-    <div>
+    <div style="overflow: hidden;">
         <div class="bigBox">
             <div class="settingBox">
                 <!-- 设置盒子顶部搜索 -->
@@ -11,9 +11,10 @@
                         </el-icon>
                     </div>
                     <div>
-                        <el-icon style="font-size: 24px;" @click="createNewFile">
+                        <el-icon style="font-size: 24px;" @click="createNewMenu">
                             <Plus />
                         </el-icon>
+                        <!-- @click="createNewFile" -->
                     </div>
                 </div>
                 <!-- 方块点击盒子 -->
@@ -34,16 +35,15 @@
                                 </template>
                             </el-dropdown>
                             <img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;">
-                            <p class="ellipsis-text" v-if="selectedBox !== index">{{ item.dirName }}</p>
-                            <el-input v-else v-model="newName" @blur="nameChange(item, index)"></el-input>
+                            <p class="ellipsis-text">{{ item.dirName }}</p>
                         </div>
                     </template>
                 </div>
                 <div>
                     <p>
-                        <span style="margin-left: 5px;">{{ useSpace ? useSpace + 'G' : '未能找到已使用空间' }}/{{ allSpace ?
+                        <span style="margin-left: 5px;">{{ useSpace ? useSpace + 'G' : '0' }}/{{ allSpace ?
                             allSpace
-                            * 1024 + 'G' : '未能找到总空间' }}</span>
+                            * 1024 + 'G' : '0' }}</span>
                         <span style="margin-left: 5px;font-size: 12px;color: blue;cursor: pointer;"
                             @click="askApply">申请扩容</span>
                     </p>
@@ -72,7 +72,8 @@
                             style="display: flex;width: 82px;height: 32px;justify-content: flex-start;align-items: center;">
                             <div style="margin-left: 5px;">
                                 <el-icon
-                                    style="background-color: #7084B4;width: 24px;height: 24px;border-radius: 50%;color: white;">
+                                    style="background-color: #7084B4;width: 24px;height: 24px;border-radius: 50%;color: white;"
+                                    @click="createNewMenu">
                                     <Plus />
                                 </el-icon>
                             </div>
@@ -108,7 +109,7 @@
                         <div style="display: flex;justify-content: space-around;align-items: center;">
                             <!-- 前进后退 -->
                             <div style="display: flex;justify-content: space-around;align-items: center;">
-                                <img style="display:block;width: 11px;height: 11px;" :src="blueLeft" alt="">
+                                <img style="display:block;width: 11px;height: 11px;" :src="blueLeft" alt="" @click="getAllTop()">
                                 <img style="display:block;width: 16px;height: 16px;" :src="grayRight" alt="">
                             </div>
                             <!-- 面包屑 -->
@@ -122,6 +123,9 @@
                             <img :src="squre" alt="">
                         </div>
                     </div>
+                    <div v-else>
+                        <el-button @click="editOnline = true">返回</el-button>
+                    </div>
                 </div>
                 <!-- 展示文件夹盒子 -->
                 <div v-if="editOnline">
@@ -249,7 +253,7 @@
                         </el-dialog>
                     </div>
                 </div>
-                <FileEdit v-else></FileEdit>
+                <FileEdit v-else :docId="clickRowId" :copyRow="copyRow"></FileEdit>
             </div>
             <!-- 扩容弹窗 -->
             <div>
@@ -275,7 +279,7 @@
             </div>
             <!-- 新增文件夹弹窗 -->
             <div>
-                <el-dialog v-model="addBoser" title="Tips" width="30%">
+                <el-dialog v-model="addBoser" title="新建文件夹" width="30%">
                     <el-form :model="boserForm" label-width="120px">
                         <!-- <el-form-item label="空间id">
                             <el-input v-model="boserForm.spaceId" />
@@ -306,24 +310,19 @@
                     </template>
                 </el-dialog>
             </div>
+            <!-- 废弃的顶层目录新增 -->
             <div>
                 <el-dialog v-model="addFile" title="Tips" width="30%">
                     <el-form :model="fileForm" label-width="120px">
                         <el-form-item label="空间类型">
-                            <el-input v-model="fileForm.spaceType" />
+                            <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.spaceCap" />
-                        </el-form-item>
-                        <el-form-item label="已使用空间">
-                            <el-input v-model="fileForm.usedCap" />
-                        </el-form-item>
-                        <el-form-item label="剩余空间">
-                            <el-input v-model="fileForm.freeCap" />
-                        </el-form-item>
                         <el-form-item label="备注">
                             <el-input v-model="fileForm.remark" />
                         </el-form-item>
@@ -409,14 +408,26 @@
                     </template>
                 </el-dialog>
             </div>
+            <!-- 中栏重命名 -->
+            <div>
+                <el-dialog v-model="folderName" title="重命名" width="30%">
+                    <el-input v-model="newName"></el-input>
+                    <template #footer>
+                        <span class="dialog-footer">
+                            <el-button @click="folderName = false">取消</el-button>
+                            <el-button type="primary" @click="sureFolderName">确认</el-button>
+                        </span>
+                    </template>
+                </el-dialog>
+            </div>
+    <ImgPreview  :previewData="previewData" :showPreview="showPreview" @closeImgPreview="closeImgPreview"></ImgPreview>
         </div>
     </div>
     <!-- 图片预览 -->
-    <!-- <ImgPreview ></ImgPreview> -->
 </template>
 
 <script>
-import { ref } from 'vue'
+import { ref, toRaw } from 'vue'
 import myfile from '../../api/myfile/myfile'
 import space from '../../api/space/space'
 import documents from '../../api/document/document'
@@ -434,6 +445,8 @@ 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 ImgPreview from '@/components/ImgPreview/ImgPreview.vue'
+import { preview } from "@/api/common/common.js";
 export default {
     setup() {
         let editOnline = ref(true)
@@ -443,6 +456,7 @@ export default {
         let files = ref(['2'])
         let folderList = ref([])
         let askTo = ref(false)
+        let folderName = ref(false)
         let askNum = ref(1)
         let askTalk = ref('')
         let newTag = ref('')
@@ -488,9 +502,6 @@ export default {
         let fileForm = ref({
             spaceType: '',
             spaceName: "",
-            spaceCap: "",
-            usedCap: "",
-            freeCap: "",
             remark: "",
         })
         let fileList = ref([
@@ -611,6 +622,29 @@ export default {
         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
+            },
+
+        ])
+        const showPreview = ref(false)//控制图片预览组件显示
+        const previewData = ref()//需要预览的文件的数据
         // 获取所有文件
         function getAll() {
             myfile.getAllFileMenu({ dirId: folderId.value }).then(res => {
@@ -652,33 +686,39 @@ 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 => {
+        // 获取文件夹,中栏,文件
+        function getAllTop() {
+            documents.getTop(3).then(res => {
+                let userMe = [res]
+                documents.getALLdocument({ dirId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId }).then(res => {
+                    fileMenu.value = res.data
                     folderList.value = res.data
                 })
-            } else {
-                documents.getALLdocument({ parentId: copyParentId.value - 0 }).then(res => {
-                    folderList.value = res.data
+                myfile.getAllFileMenu({ dirId: userMe[0].dirId - 0 }).then(res => {
+                    if (res.code === 200) {
+                        fileList.value = res.rows
+                    }
                 })
-            }
+            })
         }
         function changeFile(row, num) {
             copyParentId.value = row.parentId
-            getAllFolder()
+            newDirId.value = row.dirId
+            newSpaceId.value = row.spaceId
+            documents.getALLdocument({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 }).then(res => {
+                folderList.value = res.data
+                if (res.code === 200) {
+                    myfile.getAllFileMenu({ dirId: res.data[0].dirId - 0 }).then(res => {
+                        if (res.code === 200) {
+                            fileList.value = res.rows
+                        }
+                    })
+                }
+            })
             this.selectedIndex = num
             const newItem = {
-                name: row.spaceName,
-                choose: row.spaceId
+                name: row.dirName,
+                choose: row.dirName
             };
             // 检查 newItem 是否已存在于 menuList 中
             const isItemExist = menuList.value.some(item => item.choose === newItem.choose);
@@ -700,6 +740,8 @@ export default {
         }
         // 文件名表格每一行点击事件
         function handleRowClick(row) {
+            copyRow.value = row
+            console.log('row = ',toRaw(row));
             clickRowId.value = row.docId
             copyDirId.value = row.dirId
             copySpaceId.value = row.spaceId
@@ -726,7 +768,7 @@ export default {
             this.askTo = false
         }
         //mouse弹框
-        function chooseSet(row, num) {
+      async function chooseSet(row, num) {
             if (row.name == '在线编辑' || row.name == '协作') {
                 cliCC.value = true
             } else {
@@ -749,7 +791,7 @@ export default {
                             type: "success",
                             message: "删除成功"
                         })
-                        getAll()
+                        getAllTop()
                     }
                 })
             }
@@ -785,6 +827,15 @@ export default {
             }
             if (row.name === '在线编辑') {
                 editOnline.value = false
+                cliCC.value = false
+            }
+            if (row.name === '历史版本') {
+                console.log('row=', toRaw(row));
+                console.log('copyFileId',copyFileId.value);//文件id
+                showPreview.value = true
+                const res = await preview(copyFileId.value)
+                previewData.value = URL.createObjectURL(res)
+                console.log('res',res);
             }
         }
         function chooseSet1() {
@@ -798,16 +849,19 @@ export default {
         function createNewMenu() {
             addBoser.value = true
         }
-        // 新文件夹
+        // 新文件夹
         function sureAddBoser() {
-            documents.addDocument({
-                "dirName": boserForm.value.dirName,
-                // "dirRole": boserForm.value.dirPower,
-                // "dirType": boserForm.value.dirType,
-                "parentId": copyParentId.value-0,
-                // "remark": boserForm.value.remark,
-                "spaceId": directoryId.value,
-            }).then(res => {
+            if (newDirId.value === '' || newSpaceId.value === "") {
+                newDirId.value = fileMenu.value[0].dirId
+                newSpaceId.value = fileMenu.value[0].spaceId
+            }
+            documents.addDocument(
+                {
+                    "dirName": boserForm.value.dirName,
+                    "parentId": newDirId.value - 0,
+                    "spaceId": newSpaceId.value - 0,
+                }
+            ).then(res => {
                 if (res.code === 200) {
                     ElMessage({
                         message: '添加成功',
@@ -815,7 +869,7 @@ export default {
                     })
                 }
                 addBoser.value = false
-                getAllText()
+                getAllTop()
             })
         }
 
@@ -828,9 +882,6 @@ export default {
                 {
                     "spaceName": fileForm.value.spaceName,
                     "spaceType": fileForm.value.spaceType,
-                    "spaceCap": fileForm.value.spaceCap - 0,//空间容量
-                    "usedCap": fileForm.value.usedCap - 0,//已用空间
-                    "freeCap": fileForm.value.freeCap - 0,//剩余空间
                     "remark": fileForm.value.remark,//备注
                 }
             ).then(res => {
@@ -839,7 +890,7 @@ export default {
                         message: "新增成功",
                         type: "success"
                     })
-                    getAllMiddle()
+                    getAllTop()
                     addFile.value = false
                 } else {
                     ElMessage({
@@ -859,10 +910,14 @@ export default {
         // 确认上传
         function sureUpload() {
             if (fileArr.value.length > 0) {
+                if (newDirId.value === '' || newSpaceId.value === "") {
+                    newDirId.value = fileMenu.value[0].dirId
+                    newSpaceId.value = fileMenu.value[0].spaceId
+                }
                 for (var i = 0; i <= fileArr.value.length; i++) {
                     myfile.uploadFile({
-                        spaceId: 1,
-                        dirId: 1,
+                        spaceId: newSpaceId.value - 0,
+                        dirId: newDirId.value - 0,
                         file: fileArr.value[i]
                     }).then(res => {
                         if (res.code === 200) {
@@ -870,7 +925,7 @@ export default {
                                 message: "上传文件成功",
                                 type: "success"
                             })
-                            getAll()
+                            getAllTop()
                             uploadModal.value = false
                             fileArr.value = []
                         }
@@ -918,23 +973,12 @@ export default {
         // 重命名
         function restName(row, index) {
             newName.value = row.dirName
-            selectedBox.value = index
+            folderName.value = true
+            selectedBox.value = row.dirId
         }
         // 重命名失焦事件
         function nameChange(row, index) {
-            document.editDocument({
-                "spaceId": row.spaceId,
-                "spaceName": newName.value,
-            }).then(res => {
-                if (res.code === 200) {
-                    getAllFolder()
-                    selectedBox.value = -1
-                    ElMessage({
-                        message: '重命名成功',
-                        type: "success"
-                    })
-                }
-            })
+
         }
         function getMenu(row, num) {
             if (row.name === '删除') {
@@ -945,7 +989,7 @@ export default {
                             message: "删除成功",
                             type: "success"
                         })
-                        getAllText()
+                        getAllTop()
                     } else {
                         ElMessage({
                             message: "删除失败,目录应不为空",
@@ -959,7 +1003,7 @@ export default {
                             message: "删除成功",
                             type: "success"
                         })
-                        getAll()
+                        getAllTop()
                     }
                 })
             }
@@ -985,8 +1029,17 @@ export default {
         }
         // 文件夹每行点击事件
         function folderClick(row, list) {
-            folderId.value = row.dirId
-            getAll()
+            // 上一级dirId就是下一级的parentId
+            newDirId.value = row.dirId
+            newSpaceId.value = row.spaceId
+            documents.getALLdocument({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 }).then(res => {
+                folderList.value = res.data
+                myfile.getAllFileMenu({ dirId: res.data[0].dirId - 0 }).then(res => {
+                    if (res.code === 200) {
+                        fileList.value = res.rows
+                    }
+                })
+            })
         }
         // 确认文件重命名
         function sureChangeName() {
@@ -1006,7 +1059,7 @@ export default {
                         type: "success"
                     })
                     fileNameChange.value = false
-                    getAll()
+                    getAllTop()
                 }
             })
         }
@@ -1082,18 +1135,38 @@ export default {
         function isId() {
             if (this.directoryId === '') {
                 this.directoryId = 0
-                this.getAllText()
+                this.getAllTop()
             }
             if (this.folderId === '') {
                 this.folderId = 0
-                this.getAll()
+                this.getAllTop()
             }
         }
+        // 中栏重命名
+        function sureFolderName() {
+            documents.editDocument({
+                dirId: selectedBox.value - 0,
+                name: newName.value,
+            }).then(res => {
+                if (res.code === 200) {
+                    getAllTop()
+                    folderName.value = false
+                    ElMessage({
+                        message: '重命名成功',
+                        type: "success"
+                    })
+                }
+            })
+        }
+        //关闭图片预览事件
+        const closeImgPreview = ()=>{
+            // console.log('close');
+            showPreview.value = false
+        }
         return {
             allBag,
             folderList,//文件夹的数据
             fileList,//文件夹的数据
-            getAll,//拿到数据的方法
             searchFire,//搜索文件的model
             changeFile,//切换右侧视图的file
             menuList,//右侧切换
@@ -1129,7 +1202,6 @@ export default {
             createNewMenu,
             sureAddBoser,
             // delBoser,
-            getAllText,
             clickRowId,
             addFile,
             createNewFile,
@@ -1192,24 +1264,34 @@ export default {
             isId,
             editOnline,//在线编辑
             copyParentId,
+            folderName,
+            sureFolderName,
+            copyRow,
+            getAllTop,
+            spaceValue,
+            spaceSelect,
+            newDirId,
+            newSpaceId,
             getAllFolder,
+            showPreview,//控制图片预览
+            closeImgPreview,//关闭预览事件
+            previewData,//预览文件数据
         }
     },
     created() {
-        this.getAll();
+        this.getAllTop()
         this.getSpace()
-        this.getAllText()
-        // this.getAllMiddle()
         this.getAllUser()
         this.getAllCollect()
         this.isId()
-        this.getAllFolder()
+
     },
     watch: {
     },
     components: {
         BreadMenu,
         FileEdit,
+        ImgPreview
     },
 }
 </script>
@@ -1370,7 +1452,7 @@ p {
 
 .setCli {
     width: 156px;
-    height: auto;
+    height: 400px;
     position: absolute;
     top: -70px;
     left: 300px;
@@ -1378,11 +1460,12 @@ p {
     border: 1px solid gray;
     border-radius: 4px;
     z-index: 2;
+    overflow-y: auto;
 }
 
 .setCli1 {
     width: 156px;
-    height: auto;
+    height: 400px;
     position: absolute;
     top: 185px;
     left: 155px;
@@ -1390,6 +1473,7 @@ p {
     border: 1px solid gray;
     border-radius: 4px;
     z-index: 2;
+    overflow-y: auto;
 }
 
 .chooseSet {

+ 78 - 27
src/views/myfile/components/FileEdit.vue

@@ -1,41 +1,92 @@
 <template>
     <div>
-        <div>
-            <!-- 工具栏 -->
-            <!-- <div class="settingBox">
-
-            </div> -->
-            <div>
-                <ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
-            </div>
+        <div class='qualityManual-container-office'>
+            <jjtOnlyOffice :option='option' />
         </div>
     </div>
 </template>
 
 <script>
-import { ref } from 'vue'
-import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
+import { ref, onMounted, } from 'vue'
+import jjtOnlyOffice from '@/components/OnlyOffice/index.vue'
+import useUserStore from '@/store/modules/user'
+// import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
+import {
+    listInfo,
+    getInfo,
+    delInfo,
+    addInfo,
+    updateInfo
+} from "@/api/biz/info";
 export default {
-    setup() {
-        let editor = ref(ClassicEditor)
-        let editorData = ref("<p>Content of the editor.</p>")
-        let editorConfig = ref({
-
+    props: {
+        docId: {
+            type: Number, // 这里的类型应该匹配你要传递的数据类型
+            required: true, // 如果这个属性是必须的,请添加此项
+        },
+        copyRow: {
+            type: Object,
+            required: true
+        }
+    },
+    setup(props) {
+        let docId = props.docId;
+        let copyRow = props.copyRow
+        let option = ref({
+            key: '',
+            url: '', //在线文档地址
+            isEdit: '', //是否允许编辑
+            fileType: '', //文件扩展名
+            title: '', //文件标题
+            user: {
+                id: null, //用户ID
+                name: '' //用户姓名
+            },
+            userdata: "",
+            editUrl: '' //回调地址
+        })
+        let show = ref(true)
+        let newObj = ref({})
+        function oo(docId, isEdit) {
+            getInfo(docId).then(response => {
+                const obj = response.data;
+                obj.isEdit = isEdit;
+                newObj.value = obj
+                option.value.isEdit = obj.isEdit
+                option.value.url = `${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/api/access/${obj.fileId}`;
+                option.value.title = obj.fileName;
+                option.value.key = obj.fileId;
+                option.value.fileType = obj.fileType.replace(".", "");
+                option.value.editUrl = `${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/only-office/callback/${obj.docId}?name=${useUserStore().uname}`;
+                option.value.user = {
+                    id: useUserStore().uid, //用户ID
+                    name: useUserStore().uname //用户姓名
+                };
+            });
+            console.log(option.value,'option');
+        }
+        /** 修改按钮操作 */
+        function edit() {
+            oo(docId, true);
+        }
+        onMounted(() => {
+            // console.log(docId, 'doc');
+            // console.log(copyRow, 'row');
+            edit()
+            // let row = JSON.parse(newObj.value)
+            // console.log(row, '852');
         })
         return {
-            editor,
-            editorData,
-            editorConfig,
+            option,
+            show,
+            newObj,
         }
-    }
+
+    },
+    components: {
+        jjtOnlyOffice,
+    },
 }
 </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>
+<style scoped></style>

+ 3 - 3
src/views/search/index.vue

@@ -94,9 +94,9 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="dir.dirName" label="所属空间" width="100" />
+            <el-table-column prop="space.spaceName" label="所属空间" width="180" />
             <el-table-column prop="createTime" label="时间" width="200" />
-            <el-table-column prop="fileType" label="类型" width="180" />
+            <el-table-column prop="fileType" label="类型" width="80" />
             <el-table-column prop="fileSize" label="大小" width="160">
               <template #default="scope">
                 <div>{{ scope.row.fileSize }}KB</div>
@@ -105,7 +105,7 @@
             <el-table-column prop="dir.dirPath" label="文件夹" width="180">
               <template #default="scope">
                 <div class="folder">
-                  {{ scope.row.dir.dirPath }}
+                  {{ scope.row.dir?scope.row.dir.dirPath:'' }}
                 </div>
               </template>
             </el-table-column>

+ 40 - 0
src/views/transFile/index.vue

@@ -0,0 +1,40 @@
+<script>
+export default {
+  name: "ttansFile",
+};
+</script>
+<script setup>
+import { ref, reactive } from "vue";
+import { addUploadFile } from "@/utils/progress";
+const beforeUpload=(raw)=>{
+    addUploadFile(raw)
+  return false
+}
+</script>
+
+<template>
+  <div>
+    <!-- before-upload限制上传的格式和大小  action请求url  drag拖拽上传 multiple多文件-->
+    <el-upload
+      :before-upload="beforeUpload"
+      action="#"
+      class="upload"
+      drag
+      multiple
+    >
+      <el-icon class="el-icon--upload">
+        <upload-filled />
+      </el-icon>
+      <div class="el-upload__text">拖拽或 <em>点击上传</em></div>
+      <!-- 提示说明文字 -->
+      <template #tip>
+        <div class="el-upload__tip">
+          请上传文件,仅支持上传文件,不支持文件夹
+        </div>
+      </template>
+    </el-upload>
+  </div>
+</template>
+
+<style scoped>
+</style>