Browse Source

功能优化

songxy 3 months ago
parent
commit
f487d53036

+ 1 - 2
ais_search_zj/web/src/components/pdf/PDFViewerSearch.vue

@@ -1,12 +1,11 @@
 <template>
   <div style="width: 100%; height: 100%; position: relative; overflow: hidden">
     <iframe
-      v-if="type === 'pdf'"
       :src="src"
       width="100%"
       scrolling="no"
       height="100%"
-      style="position: relative; border: medium none"
+      style="position: relative; border: medium none;"
       ref="iframeRef"
       @load="onLoad"
     >

+ 32 - 25
ais_search_zj/web/src/views/zcdb/components/aiAssistant.vue

@@ -2,7 +2,6 @@
   <div class="ai-assistant">
     <div class="title">
       <div class="name"><img src="/images/zczk/icon-ai-g.gif" /> AI智能助手</div>
-      <div class="icon" @click="toggleZoom"><img src="/images/zczk/icon-scale.png" /></div>
     </div>
     <div class="question">
       <div class="item">
@@ -23,29 +22,27 @@
         </div>
       </div>
       <div class="chat">
-        <div class="item" v-for="(item, index) in form.chatDesc" :key="index">
-          <div class="user-panel">
-            <div class="name">{{ item.name }}</div>
-            <img src="/images/zczk/user.png" />
-          </div>
-          <div class="ai-panel">
-            <img src="/images/zczk/icon-ai-title.png" />
-            <div class="desc" v-if="item.content" id="scrollArea">
-              <vue-markdown-it
-                :source="item.content"
-                :options="{
-                  html: true,
-                  linkify: true
-                }"
-              />
+        <div class="item_box">
+          <div class="item" v-for="(item, index) in form.chatDesc" :key="index">
+            <div class="user-panel">
+              <div class="name">{{ item.name }}</div>
+              <img src="/images/zczk/user.png" />
+            </div>
+            <div class="ai-panel">
+              <img src="/images/zczk/icon-ai-title.png" />
+              <div class="desc" v-if="item.content" id="scrollArea">
+                <vue-markdown-it
+                  :source="item.content"
+                  :options="{
+                    html: true,
+                    linkify: true
+                  }"
+                />
+              </div>
+              <div class="desc animation" v-else>正在思考中<span class="dots"></span></div>
             </div>
-            <div class="desc animation" v-else>正在思考中<span class="dots"></span></div>
           </div>
         </div>
-        <div class="scale-panel" @click="toggleZoom" v-if="!zoom">
-          视窗太小,点击<span>放大</span>
-        </div>
-        <div class="scale-panel" @click="toggleZoom" v-else><span> 返回小视窗</span></div>
 
         <div class="input-panel">
           <a-textarea
@@ -266,6 +263,8 @@ const scrollToBottom = async () => {
   width: 100%;
   height: 100%;
   padding: 0px;
+  display: flex;
+  flex-direction: column;
   .title {
     height: 60px;
     margin-bottom: 0px;
@@ -305,9 +304,10 @@ const scrollToBottom = async () => {
     }
   }
   .question {
-    height: calc(100% - 60px);
-    padding: 8px 20px 15px 20px;
+    flex: 1;
     position: relative;
+    padding: 10px;
+    height: calc(100% - 60px);
     .item {
       // display: flex;
       // width: 521px;
@@ -357,7 +357,7 @@ const scrollToBottom = async () => {
       }
     }
     .chat {
-      height: calc(100% - 400px);
+      height: calc(100% - 170px);
 
       font-family: PingFang SC;
       font-weight: 500;
@@ -366,6 +366,13 @@ const scrollToBottom = async () => {
       line-height: 28px;
       font-size: 16px;
       color: #333333;
+      display: flex;
+      flex-direction: column;
+      .item_box {
+        flex: 1;
+        flex-grow: 1;
+        overflow-y: auto;
+      }
       .item {
         display: flex;
         flex-direction: column;
@@ -406,7 +413,7 @@ const scrollToBottom = async () => {
             border-radius: 6px 6px 6px 6px;
             padding: 10px 18px 10px 13px;
             font-weight: 500;
-            max-height: 200px;
+            max-height: 300px;
             overflow-y: auto;
             font-size: 14px;
             color: #333333;

+ 14 - 7
ais_search_zj/web/src/views/zcdb/smartComparison.vue

@@ -73,11 +73,11 @@
             <PDFViewer :src="current.url" ref="ifRef" v-if="current.url"> </PDFViewer>
           </div>
         </div>
-        <a-affix :offsetTop="20">
+        <div class="affix_box">
           <div class="right" :class="{ zm: zoomFlag }">
             <AiAssistant :data="fileList" />
           </div>
-        </a-affix>
+        </div>
       </div>
     </div>
   </div>
@@ -148,8 +148,9 @@ const handleChange = (info, type) => {
       fileList2.value = [item]
     }
     fileList.value.push(item)
+    current.value = item;
     if (fileList.value.length > 1) {
-      current.value = fileList.value[0];
+      // current.value = fileList.value[0];
       queryFilesName();
     }
   } else if (status === 'error') {
@@ -318,18 +319,17 @@ const handleMouseLeave = () => {
       }
     }
     .content {
-      width: 1280px;
+      width: calc(100% - 300px);
       height: auto;
       display: flex;
       margin-top: 20px;
       margin-bottom: 20px;
       .left {
-        flex: 1;
         min-height: calc(100vh - 270px);
         background: #ffffff;
         box-shadow: 0px 1px 8px 0px #e4e4e4;
         border-radius: 10px;
-        max-width: 940px;
+        width: calc(100% - 500px);
         >.upload-box {
           display: flex;
           align-items: center;
@@ -425,13 +425,20 @@ const handleMouseLeave = () => {
           height: 100%;
         }
       }
+      .affix_box {
+        position: fixed;
+        right: 150px;
+        top: 75px;
+        bottom: 20px;
+      }
       .right {
-        width: 320px;
+        width: 480px;
         margin-left: 20px;
         background: #ffffff;
         box-shadow: 0px 1px 8px 0px #e4e4e4;
         border-radius: 10px;
         position: relative;
+        height: 100%;
         .title {
           font-weight: 600;
           font-size: 20px;

+ 11 - 7
ais_search_zj/web/src/views/zjjd/index.vue

@@ -30,12 +30,12 @@
           <div class="file-preview">
             <!-- <img :src="fileDetail?.content" alt="" v-if="fileDetail?.content" /> -->
 
-            <div class="spin" v-if="loading"><a-spin></a-spin></div>
-            <PDFViewer :src="fileUrl" v-else ref="ifRef"></PDFViewer>
+            <!-- <div class="spin" v-if="loading"><a-spin></a-spin></div> -->
+            <PDFViewer :src="fileUrl" ref="ifRef"></PDFViewer>
           </div>
         </div>
       </div>
-      <a-affix :offsetTop="20">
+      <div class="affix_box" :offsetTop="20">
         <div class="right-panel" :class="{ zm: zoomFlag }">
           <div class="ai-interpretation">
             <div class="check-type">
@@ -45,7 +45,6 @@
                   <a-radio-button value="question">AI问答</a-radio-button>
                 </a-radio-group>
               </div>
-              <div class="icon" @click="toggleZoom"><img src="/images/zczk/icon-scale.png" /></div>
             </div>
             <div class="result">
               <div class="content" v-if="checkType == 'interpretation'">
@@ -122,7 +121,7 @@
             </div>
           </div>
         </div>
-      </a-affix>
+      </div>
     </div>
   </div>
 </template>
@@ -459,7 +458,12 @@ const query = async () => {
       border-radius: 6px;
       padding: 10px 0px 0px 0px;
       background-color: #fff;
-      flex: 1;
+      width: calc(100% - 500px);
+    }
+    .affix_box {
+      position: fixed;
+      right: 150px;
+      top: 75px;
     }
     .right-panel {
       width: 480px;
@@ -646,7 +650,7 @@ const query = async () => {
                     border-radius: 6px 6px 6px 6px;
                     padding: 10px 18px 10px 13px;
                     font-weight: 500;
-                    max-height: 300px;
+                    max-height: 460px;
                     overflow-y: auto;
                     font-size: 14px;
                     color: #333333;