liuQiang 1 жил өмнө
parent
commit
054ddb2934

BIN
src/assets/images/newIndex/OCR.png


BIN
src/assets/images/newIndex/bot.png


BIN
src/assets/images/newIndex/p2w.png


+ 2 - 2
src/layout/components/DefaultPage/DefaultPage.vue

@@ -5,7 +5,7 @@
         <el-upload
           class="upload-show"
           :file-list="fileArr"
-          :limit="10"
+          :limit="1"
           :on-change="upBefore"
           :show-file-list="false"
           drag
@@ -93,7 +93,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            prop="space.spaceName"
+            prop="dir.dirPath"
             label="所属空间"
             width="210"
           />

+ 197 - 39
src/layout/components/TopMenu/TopMenu.vue

@@ -3,12 +3,12 @@
     <div class="logo" @click="toIndex"></div>
     <div class="menu">
       <div class="menuList">
-        <div class="oneMenu finger" @click="openTab('我的文件','/myfile')">
+        <div class="oneMenu finger" @click="openTab('我的文件', '/myfile')">
           <img src="@/assets/images/newIndex/users.png" alt="" />
           <span>我的文件</span>
         </div>
-        <div class="oneMenu finger" @click="openTab('收藏文件','/collect')">
-          <img src="@/assets/images/newIndex/collect.png"  alt="" />
+        <div class="oneMenu finger" @click="openTab('收藏文件', '/collect')">
+          <img src="@/assets/images/newIndex/collect.png" alt="" />
           <span>收藏文件</span>
         </div>
         <div class="oneMenu finger" @click="showMoreMenu">
@@ -17,32 +17,104 @@
         </div>
       </div>
       <div v-if="showMore" class="moreMenu">
-        <div v-for="item in menuList" class="oneBox" :key="item.name" @click="openTab(item.name,item.path)">
+        <div
+          v-for="item in menuList"
+          class="oneBox"
+          :key="item.name"
+          @click="openTab(item.name, item.path)"
+        >
           <img :src="item.imgs" alt="" />
           <span>{{ item.name }}</span>
         </div>
       </div>
     </div>
     <div class="user">
-      <img src="@/assets/images/newIndex/clock.png" @click="openTab('会话消息','/chat')" alt="" />
-      <img v-if="hasRole" src="@/assets/images/newIndex/setting.png" @click="openTab('系统管理',systemPath.path)" alt="" />
+      <div class="AIBot" v-if="false">
+        <img src="@/assets/images/newIndex/bot.png"  alt="">
+        <span>智聚AI</span>
+      </div>
+      <img
+        src="@/assets/images/newIndex/p2w.png"
+        @click="openTab('会话消息', '/chat')"
+        alt=""
+      />
+      <img
+        src="@/assets/images/newIndex/OCR.png"
+        @click="scannerFile"
+        alt=""
+      />
+      <img
+        src="@/assets/images/newIndex/clock.png"
+        @click="openTab('会话消息', '/chat')"
+        alt=""
+      />
+      <img
+        v-if="hasRole"
+        src="@/assets/images/newIndex/setting.png"
+        @click="openTab('系统管理', systemPath.path)"
+        alt=""
+      />
       <div class="userInfo" @click="changeShowMenu">
-        <span>{{userStore.name}}</span>
+        <span>{{ userStore.name }}</span>
         <img v-if="!showMenu" src="@/assets/images/newIndex/arrow.png" alt="" />
-        <img v-else class="upArrow" src="@/assets/images/newIndex/arrow.png" alt="" />
+        <img
+          v-else
+          class="upArrow"
+          src="@/assets/images/newIndex/arrow.png"
+          alt=""
+        />
       </div>
       <div class="menu" v-if="showMenu">
-        <div class="oneBox" @click="openTab('个人中心','/user/profile')">
-          <img src="@/assets/images/newIndex/userInfo.png"  alt="">
+        <div class="oneBox" @click="openTab('个人中心', '/user/profile')">
+          <img src="@/assets/images/newIndex/userInfo.png" alt="" />
           <span>个人中心</span>
         </div>
         <div class="oneBox" @click="logout">
-          <img src="@/assets/images/newIndex/edit.png"  alt="">
+          <img src="@/assets/images/newIndex/edit.png" alt="" />
           <span>退出登录</span>
         </div>
       </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>
@@ -59,41 +131,54 @@ import bebumen from "@/assets/images/bebumen.png";
 import common from "@/assets/images/becommon.png";
 import manyBody from "@/assets/images/manyBodyFalse.png";
 import useUserStore from "@/store/modules/user";
-import { ElMessageBox } from "element-plus";
+import { ElMessage, ElLoading, ElMessageBox } from "element-plus";
+import ImgPreview from "@/components/ImgPreview/ImgPreview.vue";
+import { getConfigKey } from "@/api/system/config.js";
+import ScanFile from "@/components/ScanFile/ScanFile.vue";
+import MoveTo from "@/components/MoveTo/MoveTo.vue";
+import myfile from "@/api/myfile/myfile";
+import { listInfo, selectInfo, getFileByScanerId } from "@/api/scanner/info.js";
 const menuList = ref([
   {
     name: "部门文件",
     icon: "@/assets/images/newIndex/users.png",
-    path:'/department',
+    path: "/department",
     imgs: bebumen,
   },
   {
     name: "公共文件",
     icon: "@/assets/images/newIndex/collect.png",
-    path:'/publicment',
+    path: "/publicment",
     imgs: common,
   },
   {
     name: "协作",
     icon: "@/assets/images/newIndex/more.png",
-    path:'/myjoin',
+    path: "/myjoin",
     imgs: manyBody,
   },
 ]);
 const props = defineProps({
   systemPath: {
     type: Object,
-    default: ()=>{},
+    default: () => {},
   },
-  hasRole:{
+  hasRole: {
     type: Boolean,
     default: false,
-  }
+  },
 });
 const userStore = useUserStore();
 const showMore = ref(false); // 是否显示更多菜单
 const showMenu = ref(false); // 是否显示用户菜单
-const emit = defineEmits(["openMaxmin",'goIndex']);
+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 emit = defineEmits(["openMaxmin", "goIndex"]);
 // 鼠标移入 显示更多菜单
 const showMoreMenu = () => {
   if (!showMore.value) {
@@ -111,9 +196,9 @@ const hideMoreMenu = () => {
 };
 //
 const changeShowMenu = () => {
-  showMenu.value = true
+  showMenu.value = true;
 };
-const hideShowMenu= () => {
+const hideShowMenu = () => {
   if (showMenu.value) {
     setTimeout(() => {
       showMenu.value = false;
@@ -121,12 +206,12 @@ const hideShowMenu= () => {
   }
 };
 //打开/新建标签
-const openTab = (title,path) => {
-  emit("openMaxmin",title,path);
+const openTab = (title, path) => {
+  emit("openMaxmin", title, path);
 };
 //logo点击事件 回到首页
 const toIndex = () => {
-  emit('goIndex')
+  emit("goIndex");
 };
 
 //退出
@@ -137,14 +222,54 @@ function logout() {
     type: "warning",
   })
     .then(() => {
-      sessionStorage.clear()
-      localStorage.setItem('passArr','')
+      sessionStorage.clear();
+      localStorage.setItem("passArr", "");
       userStore.logOut().then(() => {
         location.href = "/index";
       });
     })
-    .catch(() => { });
+    .catch(() => {});
 }
+//获取扫描仪列表
+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(() => {
   document.addEventListener("click", (e) => {
     if (e.target.className !== "oneMenu finger") {
@@ -228,11 +353,34 @@ onMounted(() => {
   }
 }
 .user {
-  width: 220px;
+  // width: 220px;
   height: 44px;
   position: relative;
   display: flex;
   justify-content: space-around;
+  .AIBot{
+    width: 105px;
+    height: 44px;
+    margin-right: 12px;
+    padding: 10px;
+    background: linear-gradient( 96deg, #BDDCFF 0%, #D2F7FF 100%);
+    border-radius: 8px 8px 8px 8px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    img{
+      width: 24px;
+      height: 24px;
+    }
+    span{
+      font-size: 16px;
+      font-weight: 500;
+      color: #464DF8; 
+    }
+  }
+  img{
+    margin-right: 12px;
+  }
   .userInfo {
     width: 104px;
     height: 44px;
@@ -245,11 +393,11 @@ onMounted(() => {
     display: flex;
     align-items: center;
     justify-content: space-around;
-    .upArrow{
+    .upArrow {
       transform: rotate(180deg);
     }
   }
-  .menu{
+  .menu {
     position: absolute;
     top: 120%;
     right: 0;
@@ -260,27 +408,28 @@ onMounted(() => {
     flex-direction: column;
     align-items: center;
     justify-content: space-between;
-    background: #FFFFFF;
+    background: #ffffff;
     border-radius: 8px 8px 8px 8px;
-    box-shadow: 0px 3px 26px 1px rgba(191,191,191,0.25), 0px 2px 3px 0px rgba(210,210,210,0.25);
-    .oneBox{
+    box-shadow: 0px 3px 26px 1px rgba(191, 191, 191, 0.25),
+      0px 2px 3px 0px rgba(210, 210, 210, 0.25);
+    .oneBox {
       width: 96px;
       height: 36px;
       display: flex;
       padding: 0 8px;
       align-items: center;
       justify-content: space-between;
-      .img{
+      .img {
         width: 20px;
         height: 20px;
       }
-      span{
+      span {
         font-weight: 500;
         font-size: 14px;
-        color: #0D0F39;
+        color: #0d0f39;
       }
-      &:hover{
-        background: #F5F7F9;
+      &:hover {
+        background: #f5f7f9;
       }
     }
   }
@@ -288,6 +437,15 @@ onMounted(() => {
 .finger {
   cursor: pointer;
 }
+.checkScan {
+  background-color: #f5f7f9;
+}
+#Onescan {
+  height: 48px;
+  line-height: 48px;
+  font-size: 14px;
+  display: flex;
+  align-items: center;
+}
 // 底部标签样式
-
 </style>