Browse Source

文字识别区域变大

liuQiang 2 years ago
parent
commit
38e9dce485

+ 9 - 0
src/api/biz/favorite.js

@@ -8,6 +8,15 @@ export function listFavorite(query) {
     params: query
   })
 }
+// 查询文件收藏列表
+export function listFavoriteById(query) {
+  return request({
+    url: '/biz/favorite/listByLabelId',
+    method: 'get',
+    params: query
+  })
+}
+
 
 // 查询文件收藏详细
 export function getFavorite(favoriteId) {

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

@@ -1,5 +1,4 @@
 <template>
-  <!-- TODO 从我的文件过来默认进入第二形态loading,传参实现 -->
   <!-- <el-dialog v-model="isOpen" title="文字识别" width="55%"> -->
   <div class="container">
     <div v-if="thisStep === 'start'" class="up_box">
@@ -134,6 +133,11 @@ onMounted(async () => {
     thisStep.value = "loading";
     showImg.value = URL.createObjectURL(imgRes);
     const res = await ocrRemark(fileId);
+    // ocrRemark(fileId).then((res)=>{
+    //   console.log('thenews',res);
+    // }).catch(err=>{
+    //   console.log('err',err);
+    // })
     thisStep.value = "end";
     textData.value = res.msg;
   }
@@ -206,6 +210,7 @@ const reClick = () => {
   
   <style lang="scss" scoped>
 .container {
+  width: 100%;
   height: 100%;
   background-color: #fff;
   display: flex;
@@ -214,10 +219,11 @@ const reClick = () => {
 
   .up_box {
     display: flex;
+    width: 100%;
     justify-content: center;
   }
   .left_box {
-    width: 300px;
+    width: 30%;
     display: flex;
     flex-direction: column;
     align-items: center;
@@ -236,7 +242,7 @@ const reClick = () => {
     }
     .upimg_box {
       width: 100%;
-      height: 300px;
+      height: 500px;
       border: 1px solid #c1cce3;
       display: flex;
       align-items: center;
@@ -256,13 +262,13 @@ const reClick = () => {
     }
   }
   .right_box {
-    width: 300px;
+    width: 30%;
     display: flex;
     flex-direction: column;
     align-items: center;
     .upimg_box {
       width: 100%;
-      height: 300px;
+      height: 500px;
       border: 1px solid #c1cce3;
       display: flex;
       align-items: center;
@@ -292,8 +298,8 @@ const reClick = () => {
     align-items: center;
     justify-content: center;
     .light_box {
-      width: 320px;
-      height: 320px;
+      width: 500px;
+      height: 500px;
       background-image: url("@/assets/images/light.png");
       background-repeat: no-repeat;
       background-size: contain;

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

@@ -213,7 +213,7 @@ import {
   updateLabel,
   sortLabel,
 } from "@/api/biz/label.js";
-import { listFavorite } from "@/api/biz/favorite.js";
+import { listFavorite ,listFavoriteById} from "@/api/biz/favorite.js";
 const activeNames = ref(["folder", "file"]);
 const clickCollect = ref("first"); //当前标签
 const isAddCollect = ref(false); //是否在添加标签
@@ -354,7 +354,7 @@ const delTabs = async () => {
 };
 //获取收藏数据
 const getCollectList = async () => {
-  const res = await listFavorite({page:2});
+  const res = await listFavoriteById({labelId :18});
     console.log("collectres = ", res);
   if (res.code === 200 && res.rows.length > 0) {
     tableData.value = res.rows;
@@ -388,7 +388,7 @@ const rowDrop = () => {
     preventOnFilter: true,
     onChoose: function (/**Event*/ evt) {
       evt.oldIndex;
-      console.log("evt", evt);
+      // console.log("evt", evt);
     },
     //结束拖拽事件
     async onEnd({ newIndex, oldIndex, to }) {

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

@@ -1230,13 +1230,17 @@ export default {
 
         //对mouseCli数组进行筛选,实现菜单的区分显示
         const filterMouseCli = ()=>{
-            const typeArr = ['.png','.jpg','.jpeg','.JPG','.mp3','.mp4']
+            const typeArr = ['.png','.jpg','.jpeg','.JPG','.mp3','.mp4','.pdf']
+            const imgTypeArr = ['.png','.jpg','.jpeg','.JPG']
             let arr = []
             if(!typeArr.includes(copyFileType.value)){
                 arr = mouseCli.value.filter(item=>item.name !== "预览")
             }else{
                 arr = mouseCli.value.filter(item=>item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
             }
+            if(!imgTypeArr.includes(copyFileType.value)){
+                arr = arr.filter(item=>item.name !== "文字识别")
+            }
             return arr
         }        
         onMounted(() => {