Răsfoiți Sursa

feat:修改知识库详情中,页面小屏时,无法滚动到底部

hanyang 1 an în urmă
părinte
comite
ea9bbf404b

+ 5 - 1
src/modules/knowledge/rgflow/knowledgeLib/index.vue

@@ -385,7 +385,7 @@ import tool from './tool.vue';
 import DeleteModal from '../../../../components/DeleteModal.vue';
 // import { Message } from '@arco-design/web-vue';
 import { Message } from '../../../../3rd-libs/arco-vue-libs';
-import { documentHeight, parseTime, getTableColumns } from './utils';
+import { parseTime, getTableColumns } from './utils';
 
 const props = defineProps({
   kb_id: {
@@ -399,6 +399,7 @@ const props = defineProps({
     }
   }
 });
+const documentHeight = ref(window.innerHeight - 185);
 
 const account = ref(null);
 const generateFormModel = () => {
@@ -818,6 +819,9 @@ watch(
   { deep: true, immediate: true }
 );
 onMounted(async () => {
+  window.addEventListener('resize', function () {
+    documentHeight.value = window.innerHeight - 185;
+  });
   await knowledgeData();
 });
 onBeforeUnmount(() => {

+ 27 - 9
src/modules/knowledge/rgflow/knowledgeLib/test.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="main-container">
+  <div class="main-container-1">
     <div class="main-container-lf">
       <div class="main-container-lf-top">
         <!-- 检索测试 -->
@@ -52,7 +52,6 @@
                   v-model="form.question"
                   style="height: 10rem; border: 1px solid var(--color-fill-3); border-radius: 4px"
                   placeholder=""
-                  allow-clear
                 />
               </div>
               <div class="main-container-form-item-extra-btn">
@@ -67,7 +66,7 @@
       </div>
     </div>
     <div class="main-container-rt">
-      <a-collapse style="width: 96%; margin-top: 1rem; margin-left: 2%" @change="handleCollapseChange">
+      <a-collapse style="width: 96%; margin-left: 2%" @change="handleCollapseChange">
         <!-- 选定的文件 -->
         <a-collapse-item :header="check_count + '/' + doc_total + $t('knowledgeLib.test_result_head')" key="3">
           <a-checkbox-group v-model="checked_list" @change="handleCheckedChange" :style="{ width: '100%' }">
@@ -96,7 +95,7 @@
         class="main-container-rt-down"
         :style="
           collapse_status
-            ? 'height: calc(100% - 350px);overflow-y: auto'
+            ? `height: calc(100% - ${top_height}px);overflow-y: auto`
             : 'height: calc(100% - 100px);overflow-y: auto'
         "
       >
@@ -160,6 +159,15 @@ const doc_pagination_props = reactive({
   defaultPageSize: 3,
   total: 0
 });
+const top_height = computed(() => {
+  if (docList.value.length <= 1) {
+    return 230;
+  } else if (docList.value.length <= 2) {
+    return 280;
+  } else {
+    return 350;
+  }
+});
 
 const formatter = (value) => {
   // return String(Math.round(value / 100))
@@ -266,16 +274,25 @@ export default {
 };
 </script>
 <style scoped lang="css">
-.main-container {
+.main-container-1 {
+  /* display: flex;
+  justify-content: space-between;
+  height: 100%; */
+  position: relative;
   display: flex;
   justify-content: space-between;
+  border-radius: 8px;
+  background: var(--color-bg-2);
+  /* padding-top: 80px; */
+  overflow-x: hidden;
   height: 100%;
+  overflow-y: auto;
   .main-container-lf {
     width: 30%;
-    height: 100%;
+    /* height: 100%; */
     background: var(--color-bg-2);
     border-radius: 10px;
-    overflow: hidden;
+    /* overflow: hidden; */
     .main-container-lf-top {
       width: 100%;
       height: 60px;
@@ -317,10 +334,11 @@ export default {
   .main-container-rt {
     position: relative;
     width: 69%;
-    height: 100%;
-    overflow: hidden;
+    /* height: 100%; */
+    /* overflow: hidden; */
     background: var(--color-bg-2);
     border-radius: 10px;
+    padding-top: 10px;
     .main-container-rt-down {
       padding: 25px;
       .main-container-rt-down-title {