Bläddra i källkod

Merge branch 'liuqiang' into v3

liuQiang 1 år sedan
förälder
incheckning
38c0f1ce27

+ 14 - 1
src/api/upload/upload.js

@@ -32,8 +32,21 @@ function uploadFileMany(data) {
 		},
     })
 }
+// pdf2word
+function pdf2word(data) {
+    return request({
+        url: `/biz/info/pdf2word`,
+        method: "post",
+        data,
+        responseType:'blob',
+        headers: {
+		    'Content-Type': 'multipart/form-data'
+		},
+    })
+}
 export default {
     uploadFile,
     uploadFileMany,
-    uploadImg
+    uploadImg,
+    pdf2word
 }

+ 26 - 16
src/components/LeftList/LeftList.vue

@@ -34,6 +34,7 @@ import {
 } from "vue";
 import { ElMessage } from "element-plus";
 import documents from "@/api/document/document";
+import { getDir } from "@/api/biz/dir.js";
 import { setListImg } from "@/utils/index.js";
 const props = defineProps({
   spaceType: {
@@ -41,6 +42,7 @@ const props = defineProps({
     default: 0,
   },
 });
+const emit = defineEmits(["folderClick"]);
 const treeData = ref();
 const defaultProps = ref({
   label: "label",
@@ -70,9 +72,12 @@ function getFileTree() {
     console.log("treeData", treeData.value);
   });
 }
-const checkoutNode = (node, data) => {
+const checkoutNode =async  (node, data) => {
   console.log("treeData", treeData.value);
   console.log("data", data);
+  const res = await getDir(data.id)
+  emit('folderClick',res.data)
+  console.log('res',res);
 };
 const setImg = (remark) => {
   return setListImg(remark);
@@ -127,42 +132,47 @@ onMounted(() => {
 }
 // 箭头
 
-:deep(.el-tree .el-icon svg){   //原有的箭头 去掉
+:deep(.el-tree .el-icon svg) {
+  //原有的箭头 去掉
   display: none !important;
   height: 0;
   width: 0;
 }
-:deep(.el-tree-node__expand-icon){ //引入的图标(图片)size大小 => 树节点前的预留空间大小
-  font-size:16px;
+:deep(.el-tree-node__expand-icon) {
+  //引入的图标(图片)size大小 => 树节点前的预留空间大小
+  font-size: 16px;
 }
- 
+
 //图标是否旋转,如果是箭头类型的,可以设置旋转90度。如果是两张图片,则设为0
-:deep(.el-tree .el-tree-node__expand-icon.expanded)  {
+: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) { // 未展开的节点
+
+:deep(.el-tree .el-tree-node__expand-icon:before) {
+  // 未展开的节点
   background: url("@/assets/images/listShow/arrow_right.png") no-repeat 0 1px !important;
-  content: '';
+  content: "";
   display: block;
   width: 18px;
   height: 18px;
 }
- 
-:deep(.el-tree .el-tree-node__expand-icon.expanded:before) { //展开的节点
+
+:deep(.el-tree .el-tree-node__expand-icon.expanded:before) {
+  //展开的节点
   background: url("@/assets/images/listShow/row_btm.png") no-repeat 0 0 !important;
-  content: '';
+  content: "";
   display: block;
   width: 18px;
   height: 18px;
-  margin-top:4px;
+  margin-top: 4px;
 }
- 
-:deep(.el-tree .is-leaf.el-tree-node__expand-icon::before) { //叶子节点(不显示图标)
+
+:deep(.el-tree .is-leaf.el-tree-node__expand-icon::before) {
+  //叶子节点(不显示图标)
   display: block;
   background: none !important;
-  content: '';
+  content: "";
   width: 18px;
   height: 18px;
 }

+ 261 - 11
src/components/ListShow/ListShow.vue

@@ -14,12 +14,172 @@
         </el-icon>
       </div>
       <div class="line">|</div>
-      <div></div>
+      <div class="searchFor">
+        <div class="search_title">筛选:</div>
+        <el-tabs
+          v-model="searchType"
+          class="demo-tabs"
+          @tab-change="changeSearchType"
+        >
+          <el-tab-pane label="全部" name="all"></el-tab-pane>
+          <el-tab-pane label="文档" name="doc"></el-tab-pane>
+          <el-tab-pane label="图片" name="img"></el-tab-pane>
+          <el-tab-pane label="音频" name="audio"></el-tab-pane>
+          <el-tab-pane label="视频" name="video"></el-tab-pane>
+          <el-tab-pane label="压缩包" name="zip"></el-tab-pane>
+        </el-tabs>
+      </div>
+    </div>
+    <div class="table_box">
+      <el-table
+        :data="tableData"
+        style="width: 100%; height: calc(88vh - 48px)"
+        ref="container"
+        @row-click="clickRow"
+      >
+        <el-table-column label="名称">
+          <template #default="scope">
+            <div class="flie_name">
+              <img
+                class="table_icon"
+                :src="setIcon(scope.row.fileType)"
+                alt=""
+                style=""
+              />
+              {{ scope.row.fileName }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="createTime" label="时间" width="200" />
+        <el-table-column prop="fileType" label="类型" width="200" />
+        <el-table-column prop="fileSize" label="大小" width="200">
+          <template #default="scope">
+            <div>{{ formatFileSize(scope.row.fileSize) }}</div>
+          </template>
+        </el-table-column>
+      </el-table>
     </div>
   </div>
 </template>
 
 <script setup>
+import { onMounted, ref, watch, nextTick, inject } from "vue";
+const searchType = ref("all");
+const baseData = ref();
+const tableData = ref()
+
+// 切换搜索分类
+const changeSearchType = (name) => {
+  // let baseDataObj = toRaw(baseData.value);
+  // console.log("baseDataObj", baseDataObj);
+  // if (name == "all") {
+  //   tableData.value = baseDataObj;
+  // } else {
+  //   // 获取分类具体数据
+  //   console.log(name, "name");
+  //   console.log(searchFor.value, "searchFor");
+  //   const typeArr = setType(name);
+  //   console.log(typeArr, "类型");
+  //   tableData.value = toRaw(baseDataObj).filter((item) => {
+  //     console.log(item, "遍历");
+  //     return (
+  //       typeArr.includes(item.fileType) &&
+  //       (item.space.spaceType == searchFor.value || searchFor.value == "")
+  //     );
+  //   });
+  //   console.log(tableData.value, "数组");
+  // }
+};
+
+//工具函数
+// 设置图标
+const setIcon = (fileType) => {
+  switch (fileType) {
+    case ".docx":
+      return file_DOC;
+      break;
+    case ".pdf":
+      return file_pdf;
+      break;
+    case ".ppt":
+      return file_PPT;
+      break;
+    case ".txt":
+      return file_TXT;
+      break;
+    case ".xlsx":
+      return file_XLSX;
+      break;
+    case ".csv":
+      return file_XLSX;
+      break;
+    case ".png":
+      return file_pic;
+      break;
+    case ".mp3":
+      return file_audio;
+      break;
+    case ".mp4":
+      return file_video;
+      break;
+    case ".zip":
+      return file_zip;
+      break;
+    default:
+      return file_DOC;
+      break;
+  }
+};
+// 设置分类
+const setType = (fileType) => {
+  switch (fileType) {
+    case "doc":
+      return [
+        ".txt",
+        ".ppt",
+        ".pdf",
+        ".docx",
+        ".csv",
+        ".wps",
+        ".xls",
+        ".pptxs",
+        ".dll",
+        ".pptx",
+        ".doc",
+      ];
+      break;
+    case "img":
+      return [".png", ".PNG", ".jpg", ".jpeg"];
+      break;
+    case "audio":
+      return [".mp3"];
+      break;
+    case "video":
+      return [".mp4", ".qlv"];
+      break;
+    case "zip":
+      return [".zip", ".rar", ".7z"];
+      break;
+    default:
+      return [""];
+      break;
+  }
+};
+function formatFileSize(fileSize) {
+  if (fileSize >= 1024 * 1024 * 1024) {
+    // 大于等于1GB,显示GB
+    return (fileSize / (1024 * 1024 * 1024)).toFixed(2) + "GB";
+  } else if (fileSize >= 1024 * 1024) {
+    // 大于等于1MB,显示MB
+    return (fileSize / (1024 * 1024)).toFixed(2) + "MB";
+  } else if (fileSize >= 1024) {
+    // 大于等于1KB,显示KB
+    return (fileSize / 1024).toFixed(2) + "KB";
+  } else {
+    // 小于1KB,显示字节
+    return fileSize + "B";
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -29,24 +189,114 @@
   border: 1px solid #c1cce3;
   background: #f5f7f9;
   padding: 0 16px;
-//   box-sizing: border-box;
+  //   box-sizing: border-box;
   display: flex;
   align-items: center;
-  .search_box{
+  .search_box {
     width: 320px;
-    height: 32px;
+    height: 48px;
     display: flex;
     align-items: center;
     position: relative;
-    .SearchIcon{
-        color: gray;
-        position: absolute;
-        right: 22px;
+    .SearchIcon {
+      color: gray;
+      position: absolute;
+      right: 22px;
     }
   }
-  .line{
-    margin-left: 16px;
-    color:#C1CCE3;
+  .line {
+    margin: 0 16px;
+    color: #c1cce3;
+  }
+  .searchFor {
+    height: 100%;
+    display: flex;
+
+    // align-items: center;
+    .search_title {
+      height: 100%;
+      line-height: 48px;
+      font-size: 14px;
+      font-weight: 500;
+      font-family: Inter-Medium;
+    }
   }
 }
+
+.table_box {
+  height: calc(88vh - 48px);
+  // border: 1px solid #000;
+}
+// tag间距
+:deep(.el-tabs) {
+  --el-tabs-header-height: 48px !important;
+}
+:deep(.el-tabs__item) {
+  padding: 0 16px !important;
+  color: #505870 !important;
+  font-weight: 400 !important;
+}
+
+// tag选中颜色
+:deep(.el-tabs__item.is-active) {
+  color: #2e6bc8 !important;
+  font-weight: normal;
+  font-family: Inter-SemiBold;
+}
+
+:deep(.el-tabs__active-bar) {
+  background-color: #2e6bc8;
+}
+
+
+
+:deep(.el-table__inner-wrapper::before) {
+  background-color: #fff !important;
+}
+
+:deep(.el-collapse,
+.el-collapse-item__wrap) {
+  border: none;
+}
+
+.table_icon {
+  height: 27px;
+  width: 27px;
+  vertical-align: middle;
+}
+
+:deep(.el-collapse-item__content) {
+  padding-bottom: 0;
+}
+
+:deep(.el-collapse-item__header) {
+  background-color: #ebeff6 !important;
+  width: 100% !important;
+  height: 24px !important;
+}
+
+:deep(.el-collapse-item__arrow ){
+  position: relative;
+  color: #2e6bc8;
+  right: 97%;
+}
+
+:deep(.el-table td.el-table__cell ){
+  border: none;
+  font-size: 14px !important;
+  font-weight: 400 !important;
+  color: #000 !important;
+}
+
+:deep(.el-table__row) {
+  height: 35px !important;
+}
+
+:deep(.el-table .el-table__header-wrapper th) {
+  border-bottom: none;
+  border-right: 1px solid #c1cce3;
+  background-color: #fff !important;
+  color: #505870;
+  font-size: 14px;
+}
 </style>

+ 1 - 1
src/layout/indexCommon.vue

@@ -971,7 +971,7 @@ watch(() => editableTabsValue.value, (newValue, oldValue) => {
   // console.log('editableTabsValue 发生改变了', newValue, oldValue);
   setEditableTabsValue(toRaw(newValue))
   let regExp = new RegExp(/^\//);
-  if (!regExp.test(editableTabsValue.value) && editableTabsValue.value != "identifyFont" && editableTabsValue.value != "search") {
+  if (!regExp.test(editableTabsValue.value) && editableTabsValue.value != "identifyFont" && editableTabsValue.value != "search"&& editableTabsValue.value != "pdf2word") {
     isAlive.value = false;
   }
   // console.log('first  editableTabsValue.value', editableTabsValue.value)

+ 1 - 1
src/views/myfile/MyFile.vue

@@ -62,7 +62,7 @@
                             </div>
                         </template>
                     </div>
-                    <LeftList v-else :spaceType="3"></LeftList>
+                    <LeftList v-else :spaceType="3" @folderClick="folderClick"></LeftList>
                 </div>
                 <div class="expansion">
                     <div class="top_box">

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

@@ -637,29 +637,29 @@ onMounted(() => {
 }
 
 // tag间距
-::v-deep .el-tabs__item {
+:deep(.el-tabs__item) {
   padding: 0 16px !important;
   color: #505870 !important;
   font-weight: 400 !important;
 }
 
 // tag选中颜色
-::v-deep .el-tabs__item.is-active {
+:deep(.el-tabs__item.is-active)  {
   color: #2e6bc8 !important;
   font-weight: normal;
   font-family: Inter-SemiBold;
 }
 
-::v-deep .el-tabs__active-bar {
+:deep(.el-tabs__active-bar) {
   background-color: #2e6bc8;
 }
 
-::v-deep .el-table__inner-wrapper::before {
+:deep(.el-table__inner-wrapper::before) {
   background-color: #fff !important;
 }
 
-::v-deep .el-collapse,
-.el-collapse-item__wrap {
+:deep(.el-collapse,
+.el-collapse-item__wrap) {
   border: none;
 }
 
@@ -669,34 +669,34 @@ onMounted(() => {
   vertical-align: middle;
 }
 
-::v-deep .el-collapse-item__content {
+:deep(.el-collapse-item__content) {
   padding-bottom: 0;
 }
 
-::v-deep .el-collapse-item__header {
+:deep(.el-collapse-item__header) {
   background-color: #ebeff6 !important;
   width: 100% !important;
   height: 24px !important;
 }
 
-::v-deep .el-collapse-item__arrow {
+:deep(.el-collapse-item__arrow ){
   position: relative;
   color: #2e6bc8;
   right: 97%;
 }
 
-::v-deep .el-table td.el-table__cell {
+:deep(.el-table td.el-table__cell ){
   border: none;
   font-size: 14px !important;
   font-weight: 400 !important;
   color: #000 !important;
 }
 
-::v-deep .el-table__row {
+:deep(.el-table__row) {
   height: 35px !important;
 }
 
-::v-deep .el-table .el-table__header-wrapper th {
+:deep(.el-table .el-table__header-wrapper th) {
   border-bottom: none;
   border-right: 1px solid #c1cce3;
   background-color: #fff !important;