liuQiang 2 лет назад
Родитель
Сommit
99e4abbc2a

BIN
src/assets/images/listShow/arrow_right.png


BIN
src/assets/images/listShow/eFile.png


BIN
src/assets/images/listShow/eFile_1.png


BIN
src/assets/images/listShow/eFile_2.png


BIN
src/assets/images/listShow/eFile_3.png


BIN
src/assets/images/listShow/eFile_4.png


BIN
src/assets/images/listShow/file.png


BIN
src/assets/images/listShow/file_1.png


BIN
src/assets/images/listShow/file_2.png


BIN
src/assets/images/listShow/file_3.png


BIN
src/assets/images/listShow/file_4.png


BIN
src/assets/images/listShow/row_btm.png


+ 4 - 4
src/components/IdentifyFont/IdentifyFont.vue

@@ -158,14 +158,14 @@ onMounted(async () => {
   const JparData = history.state.clickRowId;
   const parData = JSON.parse(JparData);
   console.log("parData", parData);
-  if (JparData) {
+  if (parData && JparData != "N") {
     docId = parData.docId;
     fileId = parData.fileId;
     fileType = parData.fileType;
   }
-  console.log("fileId", fileId);
-  console.log("fileType", fileType);
-  console.log("textData", textData.value);
+  // console.log("fileId", fileId);
+  // console.log("fileType", fileType);
+  // console.log("textData", textData.value);
   if(textData.value){
     thisStep.value = "end";
   }else if (fileType === ".png" || fileType === ".jpg"|| fileType === ".JPG"|| fileType === ".PNG") {

+ 169 - 0
src/components/LeftList/LeftList.vue

@@ -0,0 +1,169 @@
+<template>
+  <div>
+    <el-tree
+      class="treebox"
+      :data="treeData"
+      :props="defaultProps"
+      :default-expand-all="true"
+      @node-click="handleNodeClick"
+    >
+      <template #default="{ node, data }">
+        <span class="custom-tree-node" @click="checkoutNode(node, data)">
+          <img :src="setImg(data.remark)" alt="" />
+          <span class="node_title">{{ node.label }}</span>
+          <span class="fileNum">{{
+            data.remark.fileNum > 99 ? "99+" : data.remark.fileNum
+          }}</span>
+        </span>
+      </template>
+    </el-tree>
+  </div>
+</template>
+
+<script setup>
+import {
+  ref,
+  computed,
+  reactive,
+  defineComponent,
+  watch,
+  toRaw,
+  onMounted,
+  defineExpose,
+  onDeactivated,
+} from "vue";
+import { ElMessage } from "element-plus";
+import documents from "@/api/document/document";
+import { setListImg } from "@/utils/index.js";
+const props = defineProps({
+  spaceType: {
+    type: Number,
+    default: 0,
+  },
+});
+const treeData = ref();
+const defaultProps = ref({
+  label: "label",
+  value: "id",
+  remark: "remark",
+  disable: false,
+});
+//获取文件树
+function getFileTree() {
+  documents.fileTree(props.spaceType).then((res) => {
+    res.disabled = true;
+    treeData.value = [res];
+    function getAllNodeIds(nodes) {
+      nodes.forEach((node) => {
+        if (node.remark) {
+          node.remark = JSON.parse(node.remark);
+        }
+        if (node.children && node.children.length > 0) {
+          getAllNodeIds(node.children);
+        }
+      });
+      return nodes;
+    }
+    // 调用递归函数获取所有节点的 id
+    const arr = getAllNodeIds(treeData.value);
+    console.log("treedataarr", arr);
+    console.log("treeData", treeData.value);
+  });
+}
+const checkoutNode = (node, data) => {
+  console.log("treeData", treeData.value);
+  console.log("data", data);
+};
+const setImg = (remark) => {
+  return setListImg(remark);
+};
+onMounted(() => {
+  getFileTree();
+});
+</script>
+
+<style lang="scss" scoped>
+.treebox {
+  width: 100%;
+  overflow-y: auto;
+  position: relative;
+}
+.custom-tree-node {
+  width: 100%;
+  height: 36px;
+  display: flex;
+  align-items: center;
+
+  padding: 16px 0;
+  img {
+    width: 26px;
+    height: 26px;
+    object-fit: cover;
+  }
+  .node_title {
+    font-size: 14px;
+    line-height: 22px;
+    margin-left: 5px;
+    max-width: 300px;
+    /*第一步: 溢出隐藏 */
+    overflow: hidden;
+    /* 第二步:让文本不会换行, 在同一行继续 */
+    white-space: nowrap;
+    /* 第三步:用省略号来代表未显示完的文本 */
+    text-overflow: ellipsis;
+    font-family: Inter-Medium;
+  }
+  .fileNum {
+    position: absolute;
+    right: 10%;
+    font-size: 14px;
+    line-height: 22px;
+    font-weight: 500;
+    color: #06286c;
+  }
+}
+:deep(.el-tree-node__content) {
+  height: 36px;
+}
+// 箭头
+
+:deep(.el-tree .el-icon svg){   //原有的箭头 去掉
+  display: none !important;
+  height: 0;
+  width: 0;
+}
+:deep(.el-tree-node__expand-icon){ //引入的图标(图片)size大小 => 树节点前的预留空间大小
+  font-size:16px;
+}
+ 
+//图标是否旋转,如果是箭头类型的,可以设置旋转90度。如果是两张图片,则设为0
+:deep(.el-tree .el-tree-node__expand-icon.expanded)  {
+  -webkit-transform: rotate(0deg);
+  transform: rotate(0deg);
+}
+ 
+:deep(.el-tree .el-tree-node__expand-icon:before) { // 未展开的节点
+  background: url("@/assets/images/listShow/arrow_right.png") no-repeat 0 1px !important;
+  content: '';
+  display: block;
+  width: 18px;
+  height: 18px;
+}
+ 
+:deep(.el-tree .el-tree-node__expand-icon.expanded:before) { //展开的节点
+  background: url("@/assets/images/listShow/row_btm.png") no-repeat 0 0 !important;
+  content: '';
+  display: block;
+  width: 18px;
+  height: 18px;
+  margin-top:4px;
+}
+ 
+:deep(.el-tree .is-leaf.el-tree-node__expand-icon::before) { //叶子节点(不显示图标)
+  display: block;
+  background: none !important;
+  content: '';
+  width: 18px;
+  height: 18px;
+}
+</style>

+ 52 - 0
src/components/ListShow/ListShow.vue

@@ -0,0 +1,52 @@
+<template>
+  <div>
+    <div class="topMenu">
+      <div class="search_box">
+        <el-input
+          v-model="searchFire"
+          @keyup.enter="fileBlur"
+          class="searchFire"
+          size="large"
+          placeholder="搜索文件"
+        />
+        <el-icon class="SearchIcon" @click="fileBlur">
+          <Search />
+        </el-icon>
+      </div>
+      <div class="line">|</div>
+      <div></div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+</script>
+
+<style lang="scss" scoped>
+.topMenu {
+  width: 100%;
+  height: 48px;
+  border: 1px solid #c1cce3;
+  background: #f5f7f9;
+  padding: 0 16px;
+//   box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  .search_box{
+    width: 320px;
+    height: 32px;
+    display: flex;
+    align-items: center;
+    position: relative;
+    .SearchIcon{
+        color: gray;
+        position: absolute;
+        right: 22px;
+    }
+  }
+  .line{
+    margin-left: 16px;
+    color:#C1CCE3;
+  }
+}
+</style>

+ 21 - 9
src/components/MoveTo/MoveTo.vue

@@ -88,6 +88,10 @@ const props = defineProps({
     type: Number,
     default: 0,
   },
+  spaceId: {
+    type: Number,
+    default: 0,
+  },
 });
 const treeData = ref();
 const dirIds = ref();
@@ -109,12 +113,18 @@ function handleNodeClick(data) {
   dirIds.value = data.id;
 }
 const onSubmit = async () => {
+  if (!thisNode.value.value) {
+    return ElMessage({
+      type: "error",
+      message: "请选择目标文件夹",
+    });
+  }
   const query = {
     dirId: thisNode.value.value,
     merge: form.value.merge,
     name: form.value.fileName,
     q: toRaw(props.scanFileArr),
-    spaceId: props.thisFolder.spaceId,
+    spaceId: props.thisFolder?props.thisFolder.spaceId:props.spaceId,
   };
   // console.log("query", query);
   const res = await claimFile(query);
@@ -131,7 +141,7 @@ const onSubmit = async () => {
 const checkoutNode = (node, data) => {
   // console.log('node',node);
   // console.log("data", data);
-  if(data.disabled) return
+  if (data.disabled) return;
   thisNode.value = {
     label: data.label,
     value: data.id,
@@ -141,9 +151,9 @@ const checkoutNode = (node, data) => {
 //获取文件树
 function getFileTree() {
   documents.fileTree(props.spaceType).then((res) => {
-    res.disabled = true
+    res.disabled = true;
     treeData.value = [res];
-    console.log("treedata", res);
+    // console.log("treedata", res);
   });
 }
 const setImg = (type) => {
@@ -153,11 +163,13 @@ onMounted(() => {
   getFileTree();
   // console.log("thisFolder", props.thisFolder);
   // console.log("scanFileArr", props.scanFileArr);
-  thisNode.value = {
-    label: props.thisFolder.dirName,
-    value: props.thisFolder.dirId,
-    disable: false,
-  };
+  if (props.thisFolder) {
+    thisNode.value = {
+      label: props.thisFolder.dirName,
+      value: props.thisFolder.dirId,
+      disable: false,
+    };
+  }
 });
 </script>
 

+ 458 - 0
src/components/Pdf2Word/Pdf2Word.vue

@@ -0,0 +1,458 @@
+<template>
+  <!-- <el-dialog v-model="isOpen" title="文字识别" width="55%"> -->
+  <div class="container">
+    <div v-if="thisStep === 'start'" class="up_box">
+      <div class="left_box">
+        <div class="upimg_box boder_box">
+          <el-upload
+            v-if="!showImg"
+            class="avatar-uploader"
+            :drag="true"
+            :action="actionUrl"
+            :headers="headersObj"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeUp"
+          >
+            <img src="@/assets/images/Frame427319159.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
+            class="avatar-uploader"
+            :action="actionUrl"
+            :headers="headersObj"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeUp"
+          >
+            <span>选择本地文件</span>
+          </el-upload>
+        </div>
+      </div>
+      <div class="right_box">
+        <div class="upimg_box boder_box">
+          <el-upload
+            disabled
+            class="avatar-uploader"
+            :action="actionUrl"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+          >
+            <img src="@/assets/images/FrameYun.png" class="avatar" />
+            <span>点击按钮上传文件</span>
+          </el-upload>
+        </div>
+        <div class="sunmit_btn" @click="addlibraryImg">添加文库文件</div>
+      </div>
+    </div>
+    <div v-if="thisStep === 'loading'" class="load-box">
+      <div class="light_box">
+        <img :src="toRaw(showImg)" class="avatar" />
+        <div class="light"></div>
+      </div>
+      <div class="text_box">
+        <span>请耐心等待扫描完成</span>
+        <Loading :small="true"></Loading>
+      </div>
+    </div>
+    <div v-if="thisStep === 'end'" class="end_box">
+      <div class="left_box">
+        <div class="boder_box">
+          <div class="title">原始图片</div>
+          <div class="upimg_box">
+            <div class="img_show">
+              <img :src="toRaw(showImg)" class="avatar" />
+            </div>
+          </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="boder_box">
+          <div class="title">识别结果</div>
+          <div class="upimg_box">
+            <el-scrollbar>
+              <div class="text_box">
+                {{ textData }}
+              </div>
+            </el-scrollbar>
+          </div>
+        </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
+    v-loading.fullscreen="loadingPreview"
+    v-if="loadingPreview"
+    class="lodingBox"
+  ></div>
+</template>
+  
+  <script setup>
+import { onMounted, ref, toRaw, watch, inject } from "vue";
+import { ElMessage } from "element-plus";
+import Clipboard from "clipboard";
+import Loading from "@/components/Loading/Loading.vue";
+import PicTree from "@/components/PicTree/PicTree.vue"; //选择文件发送的列表
+import { picTree } from "@/api/search/search.js";
+import { ocrRemark, preview } from "@/api/common/common.js";
+import Cookies from "js-cookie";
+const textData = ref(""); //解析出来的文字
+const showImg = ref(); //上传的图片
+const isOpen = ref(props.openFile);
+const thisStep = ref("start"); //解析进度 start,loading,end,
+const openFile = ref(false); //控制tree显示
+const treeData = ref(); //树节点数据
+const actionUrl = ref(
+  `${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/api/upload`
+);
+const headersObj = ref({
+   Authorization:Cookies.get("Admin-Token")
+})
+// const actionUrl = ref(`${window.location.origin}/upload`);
+const loadingPreview = ref(false);
+const addFolderAdd = inject("addFolderAdd");
+
+const props = defineProps({
+  openFile: {
+    type: Boolean,
+    default: false,
+  },
+});
+watch(
+  () => props.openFile,
+  (newValue) => {
+    // console.log(111);
+    isOpen.value = newValue;
+  }
+);
+onMounted(async () => {
+ 
+});
+const handleAvatarSuccess = (msg, file) => {
+  // console.log("re", msg);
+  const flieData = toRaw(file);
+  // 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 = (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.id);
+  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>
+  
+  <style lang="scss" scoped>
+.lodingBox {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100vh;
+  height: 100vh;
+  z-index: 10000000;
+}
+.container {
+  width: 100%;
+  height: 87vh;
+  background-color: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+
+  .up_box {
+    display: flex;
+    width: 100%;
+    justify-content: center;
+  }
+  .left_box {
+    width: 45%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    margin-right: 48px;
+    .boder_box {
+      width: 100%;
+      border: 1px solid #c1cce3;
+    }
+    .title {
+      width: 100%;
+      height: 40px;
+      background: #ebeff6;
+      line-height: 40px;
+      font-size: 16px;
+      font-weight: 400;
+      text-align: center;
+    }
+    .img_show {
+      width: 100%;
+      height: calc(100% - 40px);
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      img {
+        width: 100%;
+        max-height: 100%;
+        // opacity: 0;
+        // object-fit:cover; // 保持原比例缩小
+        object-fit: contain; // 保持原比例缩小
+      }
+    }
+    .upimg_box {
+      width: 100%;
+      height: 500px;
+
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .sunmit_btn {
+      margin-top: 24px;
+      width: 120px;
+      height: 32px;
+      background: #2e6bc8;
+      border-radius: 4px 4px 4px 4px;
+      color: #fff;
+      font-size: 14px;
+      line-height: 32px;
+      font-weight: 400;
+      text-align: center;
+    }
+  }
+  .right_box {
+    width: 45%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .boder_box {
+      width: 100%;
+      border: 1px solid #c1cce3;
+    }
+    .title {
+      width: 100%;
+      height: 40px;
+      background: #ebeff6;
+      line-height: 40px;
+      font-size: 16px;
+      font-weight: 400;
+      text-align: center;
+    }
+    .upimg_box {
+      width: 100%;
+      height: 500px;
+      // border: 1px solid #c1cce3;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .sunmit_btn {
+      margin-top: 24px;
+      width: 120px;
+      height: 32px;
+      background: #2e6bc8;
+      border-radius: 4px 4px 4px 4px;
+      color: #fff;
+      font-size: 14px;
+      line-height: 32px;
+      font-weight: 400;
+      text-align: center;
+    }
+    .text_box {
+      padding: 16px;
+      font-size: 14px;
+      font-weight: 500;
+      color: #000000;
+      line-height: 22px;
+    }
+  }
+  .load-box {
+    display: flex;
+    align-items: center;
+    // justify-content: center;
+    flex-direction: column;
+    .text_box {
+      width: 100%;
+      margin-top: 20px;
+      color: #06286c;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      span {
+        margin-right: 15px;
+      }
+    }
+    .light_box {
+      width: 500px;
+      height: 500px;
+      background-image: url("@/assets/images/light_boder.png");
+      background-repeat: no-repeat;
+      background-size: contain;
+      position: relative;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding: 0 15px;
+      img {
+        width: 100%;
+        height: 100%;
+        object-fit: contain; // 保持原比例缩小
+      }
+      .light {
+        width: calc(100% - 30px);
+        height: 1px;
+        position: absolute;
+        top: 0;
+        left: 15px;
+        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;
+    width: 100%;
+  }
+}
+:deep(.el-dialog__header) {
+  background-color: #eceff7;
+  margin-right: 0px;
+}
+.avatar-uploader .el-upload {
+  border: 1px dashed var(--el-border-color);
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  transition: var(--el-transition-duration-fast);
+}
+::v-deep .avatar-uploader .el-upload {
+  display: flex;
+  flex-direction: column;
+  img {
+    width: 220;
+    height: 220px;
+    margin-bottom: 16px;
+  }
+  span {
+    font-size: 12px;
+    font-weight: 400;
+    color: #06286c;
+  }
+}
+::v-deep .sunmit_btn .avatar-uploader .el-upload {
+  span {
+    font-size: 14px;
+    font-weight: 400;
+    color: #fff;
+  }
+}
+::v-deep .avatar-uploader .el-upload .el-upload-dragger {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  border: none;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: var(--el-color-primary);
+}
+
+.el-icon.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  text-align: center;
+}
+</style>
+  

+ 8 - 0
src/router/index.js

@@ -267,6 +267,14 @@ export const constantRoutes = [{
 			icon: "department"
 		}
 	}, {
+		path: "/pdf2word",
+		component: () => import("@/components/Pdf2Word/Pdf2Word.vue"),
+		name: "pdf2word",
+		meta: {
+			title: "pdf2word",
+			icon: "department"
+		}
+	}, {
 		path: "/iframe/*",
 		component: () => import("@/layout/iframe.vue"),
 		name: "iframe",

+ 50 - 1
src/utils/index.js

@@ -10,7 +10,19 @@ import file_audio from "@/assets/images/fileType/file_audio.png";
 import file_video from "@/assets/images/fileType/file_video.png";
 import file_zip from "@/assets/images/fileType/file_zip.png";
 import file_noOne from "@/assets/images/unkownFile.png";
-
+//-------------------------------------------------------------
+//---------------导入图片--------------------------
+import eFile from "@/assets/images/listShow/eFile.png";
+import eFile_1 from "@/assets/images/listShow/eFile_1.png";
+import eFile_2 from "@/assets/images/listShow/eFile_2.png";
+import eFile_3 from "@/assets/images/listShow/eFile_4.png";
+import eFile_4 from "@/assets/images/listShow/eFile_4.png";
+import file from "@/assets/images/listShow/file.png";
+import file_1 from "@/assets/images/listShow/file_1.png";
+import file_2 from "@/assets/images/listShow/file_2.png";
+import file_3 from "@/assets/images/listShow/file_3.png";
+import file_4 from "@/assets/images/listShow/file_4.png";
+//-------------------------------------------------------------
 // 设置图标
 export const setIcon = (fileType) => {
   switch (fileType) {
@@ -58,6 +70,43 @@ export const setIcon = (fileType) => {
       break;
   }
 };
+
+
+// 设置图标
+export const setListImg = (remark) => {
+  const dirType = remark.dirType
+  const isEncrypt = remark.isEncrypt
+  const encryptLevel = remark.encryptLevel
+  if(dirType === '1'){ //普通
+    if(isEncrypt === "Y" && encryptLevel === "L1"){
+      return file_1
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L2"){
+      return file_2
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L3"){
+      return file_3
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L4"){
+      return file_4
+    }
+    return file
+  }else{ //组织
+    if(isEncrypt === "Y" && encryptLevel === "L1"){
+      return eFile_1
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L2"){
+      return eFile_2
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L3"){
+      return eFile_3
+    }
+    if(isEncrypt === "Y" && encryptLevel === "L4"){
+      return eFile_4
+    }
+    return eFile
+  }
+};
 /**
  * 表格时间格式化
  */

+ 160 - 19
src/views/HomePage/HomePage.vue

@@ -10,17 +10,17 @@
         <div class="bigImg_box">
           <img src="@/assets/images/home/bigC.jpg" class="bigC" alt="" />
           <div class="bidCText">
-            <span class="percentage">72.1%</span>
-            <span>存储空间</span>
+            <span class="percentage">{{ percent() }}%</span>
+            <span>已使用空间</span>
           </div>
         </div>
-        <div class="ORC_box">
+        <div class="ORC_box" @click="toidentifyFont">
           <span class="text">ORC工具</span>
         </div>
-        <div class="sacn_box">
+        <div class="sacn_box" @click="scannerFile">
           <span class="text">扫描工具</span>
         </div>
-        <div class="p2w_box">
+        <div class="p2w_box" @click="pdf2word">
           <span class="text">PDF转Word</span>
         </div>
       </div>
@@ -29,7 +29,7 @@
       <div class="left_box">
         <div class="title">快捷访问</div>
         <div class="big_box">
-          <div class="one_box" v-for="item in 14" :key="item">
+          <div class="one_box" v-for="item in 20" :key="item">
             <div class="left">
               <img src="@/assets/images/fileBox.png" alt="" />
             </div>
@@ -47,8 +47,8 @@
           <el-table
             :data="tableFileData"
             style="width: 100%"
-            height="30vh"
-            :scrollbar-always-on="true"
+            height="29vh"
+            :scrollbar-always-on="false"
           >
             <el-table-column fixed prop="date" label="名称" width="500">
               <template #default="scope">
@@ -81,22 +81,76 @@
       </div>
     </div>
   </div>
+  <!-- 扫描文档 -->
+  <ScanFile
+    v-if="openScan"
+    :openScan="openScan"
+    :scannerFiles="scannerFiles"
+    @saveScanFile="saveScanFile"
+    @closeOpen="closeOpen"
+  ></ScanFile>
+  <!-- 可用扫描仪信息 -->
+  <div>
+    <el-dialog v-model="checkScanner" title="扫描仪" width="30%">
+      <div
+        v-for="item in scannerList"
+        :key="item.scannerId"
+        @click="checkScanFn(item)"
+        id="Onescan"
+        :class="{ checkScan: item.scannerId == checkScanId }"
+      >
+        <img src="@/assets/images/scanImg.png" alt="" />
+        {{ item.scannerName }}
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="closeCheckScanner">取消</el-button>
+          <el-button type="primary" @click="sureScaner">确认</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+  <!-- 扫描文件移动到 -->
+  <MoveTo
+    v-if="openScanMove"
+    :spaceType="3"
+    :scanFileArr="scanFileArr"
+    :thisFolder="thisFolder"
+    :openScanMove="openScanMove"
+    :spaceId="spaceId"
+    @closeOpenScanMove="closeOpenScanMove"
+  ></MoveTo>
 </template>
 
 <script setup>
 import { onMounted, ref, toRaw, inject } from "vue";
 import { listRecent, getRecent } from "@/api/biz/recent";
 import { getInfo, getInfoByDirId } from "@/api/biz/info";
-import { canPreviewFile, rightMenuRole ,setIcon} from "@/utils/index.js";
+import { canPreviewFile, rightMenuRole, setIcon } from "@/utils/index.js";
 import { getDir } from "@/api/biz/dir";
+import myfile from "@/api/myfile/myfile";
+import ScanFile from "@/components/ScanFile/ScanFile.vue";
+import MoveTo from "@/components/MoveTo/MoveTo.vue";
+import { listInfo, selectInfo, getFileByScanerId } from "@/api/scanner/info.js";
 const tableFileData = ref([]);
 const tableFolderData = ref([]);
+const useSpace = ref();
+const allSpace = ref();
+const spaceId = ref();
+const addFolderAdd = inject("addFolderAdd");
+const scannerList = ref(); // 扫描仪数据
+const checkScanId = ref(); // 选中的scan的id
+const checkScanner = ref(false); //显示扫描仪选择框
+const scannerFiles = ref([]); //选择的扫描仪的文件
+const openScanMove = ref(false);
+const openScan = ref(false); //控制扫描文档显示
+const scanFileArr = ref([]); //认领的扫描文件数组
 
 const getList = async () => {
   const resY = await listRecent({ isFolder: "Y" });
   const resN = await listRecent({ isFolder: "N" });
-  console.log('resY',resY);
-  console.log('resN',resN);
+  // console.log("resY", resY);
+  // console.log("resN", resN);
   if (resY.code === 200) {
     var arr = [];
     resY.rows.map(async (item) => {
@@ -113,11 +167,87 @@ const getList = async () => {
     });
   }
 };
-const setImg = (type)=>{
-    return setIcon(type)
+const setImg = (type) => {
+  return setIcon(type);
+};
+// 计算百分比
+function percent() {
+  let numP = 0;
+  if (useSpace.value && allSpace.value) {
+    numP = (useSpace.value / allSpace.value) * 100;
+  }
+  // console.log("numP", numP);
+  return numP.toFixed(2) - 0; // 将结果保留两位小数
+}
+function getSpaceList() {
+  myfile.fileType(3).then((res) => {
+    // console.log('Spaceres',res);
+    useSpace.value = res.data.usedCap;
+    allSpace.value = res.data.spaceCap;
+    spaceId.value = res.data.spaceId;
+  });
 }
+//去文字识别
+const toidentifyFont = () => {
+  const itemData = {
+    name: "文字识别",
+    path: "identifyFont",
+    clickRowId: "N",
+  };
+  addFolderAdd(itemData);
+};
+//去pdf2word
+const pdf2word = () => {
+  const itemData = {
+    name: "Pdf转Word",
+    path: "pdf2word",
+    clickRowId: "N",
+  };
+  addFolderAdd(itemData);
+};
+//获取扫描仪列表
+const scannerFile = async () => {
+  const res = await selectInfo();
+  scannerList.value = res.rows;
+  checkScanner.value = true;
+  checkScanId.value = null;
+  // console.log('scanner',res);
+};
+// 选择扫描仪
+const checkScanFn = (item) => {
+  checkScanId.value = item.scannerId;
+};
+// 确认选择扫描仪 获取扫描仪下文件列表
+const sureScaner = async () => {
+  if (!checkScanId.value) return;
+  const res = await getFileByScanerId(checkScanId.value);
+  // console.log("sureScanerres", res);
+  scannerFiles.value = res.data;
+  checkScanner.value = false;
+  openScan.value = true;
+};
+// 关闭窗口
+const closeCheckScanner = () => {
+  checkScanner.value = false;
+};
+const closeOpen = () => {
+  openScan.value = false;
+};
+// 移动到事件
+const saveScanFile = (arr) => {
+  // console.log("arr", arr);
+  openScan.value = false;
+  scanFileArr.value = arr;
+  openScanMove.value = true;
+};
+// 关闭窗口
+const closeOpenScanMove = () => {
+  openScanMove.value = false;
+  // refreshFile();
+};
 onMounted(() => {
   getList();
+  getSpaceList();
 });
 </script>
 
@@ -256,7 +386,8 @@ onMounted(() => {
   display: flex;
   .left_box {
     width: 50%;
-    height: 100%;
+    // height: 100%;
+    // overflow-y: auto;
     // border-right: 1px solid #000;
     .title {
       width: 100%;
@@ -268,7 +399,7 @@ onMounted(() => {
     }
     .big_box {
       width: 100%;
-      // height: 100%;
+      height: 29vh;
       display: flex;
       flex-wrap: wrap;
       overflow-y: auto;
@@ -323,7 +454,7 @@ onMounted(() => {
   }
   .right_box {
     width: 50%;
-    height: 100%;
+    // height: 100%;
     .title {
       width: 100%;
       height: 40px;
@@ -332,20 +463,30 @@ onMounted(() => {
       // border-bottom: 1px solid #000;
       font-size: 16px;
     }
-    .title_row{
+    .title_row {
       display: flex;
       align-items: center;
       // vertical-align: middle;
     }
-    .table_icon{
+    .table_icon {
       width: 32px;
       height: 32px;
     }
-    .shouzhi{
+    .shouzhi {
       cursor: pointer;
     }
   }
 }
+.checkScan {
+  background-color: #f5f7f9;
+}
+#Onescan {
+  height: 48px;
+  line-height: 48px;
+  font-size: 14px;
+  display: flex;
+  align-items: center;
+}
 :deep(.el-table td.el-table__cell) {
   border: none;
   font-size: 14px !important;

+ 33 - 13
src/views/myfile/MyFile.vue

@@ -21,9 +21,13 @@
                         <el-icon class="SearchIcon" @click="fileBlur">
                             <Search />
                         </el-icon>
+                        <div class="left_changeShow">
+                            <img v-if="leftShowList" src="@/assets/images/squre.png" @click="changeLeftShow" alt="">
+                            <img v-else src="@/assets/images/Frame_187.png" @click="changeLeftShow" alt="">
+                        </div>
                     </div>
                     <!-- v-for盒子 -->
-                    <div
+                    <div v-if="leftShowList"
                         style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;align-content: flex-start;overflow-y: auto;">
                         <template v-for="(item, index) in fileMenu" :key="index">
                             <div class="setBox">
@@ -58,7 +62,7 @@
                             </div>
                         </template>
                     </div>
-
+                    <LeftList v-else :spaceType="3"></LeftList>
                 </div>
                 <div class="expansion">
                     <div class="top_box">
@@ -188,6 +192,7 @@
                             <span>使用右键进行文件操作</span>
                        </div>
                     </div>
+                    <div v-if="leftShowList">
                     <!-- 面包屑功能栏 -->
                     <div class="breadBox">
                         <!-- 左侧 -->
@@ -367,16 +372,10 @@
                             </div>
                         </div>
                     </div>
+                    </div>
+                    <ListShow v-else></ListShow>
 
                 </div>
-                <!-- <div v-else>
-                    <div>
-                        <el-button @click="editOnline = true; historyPrew = false">返回</el-button>
-                    </div>
-                    <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
-                        :historycopyRow="historycopyRow" :onlyView="onlyView" @cancleHistoryPrew="cancleHistoryPrew">
-                    </FileEdit>
-                </div> -->
             </div>
 
             <!-- 扩容弹窗 -->
@@ -509,6 +508,8 @@ import SpaceBig from './modalComponebts/SpaceBig.vue'
 import PlaceGridFolder from './components/PlaceGridFolder.vue'
 import PalaceGridFile from './components/PalaceGridFile.vue'
 import ImgFile from "./jsComponents/ImgFile"
+import LeftList from "@/components/LeftList/LeftList.vue"
+import ListShow from "@/components/ListShow/ListShow.vue"
 import { Refresh, Search } from '@element-plus/icons-vue'
 import blueLeft from '../../assets/images/blueLeft.png'
 import grayRight from "../../assets/images/grayRight.png"
@@ -757,6 +758,7 @@ export default {
         const inputTitle = ref()//验证框标题
         const isCode = ref(false)// 验证的类型
         const isAsc = ref("desc");
+        const leftShowList = ref(false)
         const changeSort = async () => {
             isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc");
             refreshFile()
@@ -1279,6 +1281,7 @@ export default {
                 return
             } else {
                 if (fileArr.value.length > 0) {
+                    console.log('fileArr',fileArr.value);
 					let form=new FormData();
 					for (var i = 0; i < fileArr.value.length; i++) {
 						form.append("files",fileArr.value[i]);
@@ -2097,6 +2100,9 @@ export default {
                 pageSize.value = 20
             }
         }
+        const changeLeftShow = ()=>{
+            leftShowList.value = leftShowList.value?false:true
+        }
         watch(() => folder.value, async(newValue, oldValue) => {
             // console.log('iFrameData 发生改变了', newValue, oldValue);
             console.log('files',newValue);
@@ -2444,7 +2450,9 @@ export default {
             sureCode,
             upFileData,
             isAsc,
-            changeSort
+            changeSort,
+            leftShowList,
+            changeLeftShow
         }
     },
     watch: {
@@ -2466,7 +2474,9 @@ export default {
         inputPassword,
         PathLabel,
         ScanFile,
-        MoveTo
+        MoveTo,
+        LeftList,
+        ListShow
     },
 }
 
@@ -2526,16 +2536,26 @@ p {
 .searchBox {
     display: flex;
     justify-content: space-between;
+    align-items: center;
     position: relative;
     padding: 8px 16px;
 
     .SearchIcon {
         color: gray;
         position: absolute;
-        right: 5%;
+        right: calc(5% + 34px);
         top: 35%;
 
     }
+    .left_changeShow{
+        margin-left: 10px;
+        width: 24px;
+        height: 24px;
+        img{
+            width: 24px;
+            height: 24px;
+        }
+    }
 }
 
 .setBox {