Эх сурвалжийг харах

修改默认样式及搜索

yangg 5 сар өмнө
parent
commit
02ae849c8f

+ 6 - 4
src/components/CanvasEditor/index.vue

@@ -24,9 +24,12 @@
             <div class="menu-divider"></div>
             <div class="menu-item">
               <div class="menu-item__font">
-                <span class="select" title="字体">微软雅黑</span>
+                <span class="select" title="字体">Arial</span>
                 <div class="options">
                   <ul>
+                     <li data-family="Arial" style="font-family: 'Arial'">
+                      Arial
+                    </li>
                     <li
                       data-family="Microsoft YaHei"
                       style="font-family: 'Microsoft YaHei'"
@@ -45,9 +48,7 @@
                 <li data-family="华文行楷" style="font-family:'华文行楷';">华文行楷</li>
                 <li data-family="华文中宋" style="font-family:'华文中宋';">华文中宋</li>
                 <li data-family="华文彩云" style="font-family:'华文彩云';">华文彩云</li> -->
-                    <li data-family="Arial" style="font-family: 'Arial'">
-                      Arial
-                    </li>
+                   
                     <li data-family="Segoe UI" style="font-family: 'Segoe UI'">
                       Segoe UI
                     </li>
@@ -589,6 +590,7 @@ export default {
         header: this.header,
         main: this.main,
         footer: this.footer,
+        defaultFont: 'Arial', // 添加默认字体配置
       },
       this.options
     );

+ 1 - 0
src/components/CanvasEditor/option.js

@@ -1,6 +1,7 @@
 const IEditorOption = {
   width: 794,  // A4 纸张宽度
   height: 1123,  // A4 纸张高度
+  defaultFont: 'Arial', // 在这里也添加默认字体配置
     /* mode: undefined,
     defaultType: undefined,
     defaultFont: undefined,

+ 44 - 9
src/views/project/ProjectInput.vue

@@ -460,7 +460,8 @@ import {
   delete_items,
   update_items,
   rateScope,
-  sequence
+  sequence,
+  projectList
 } from '@/api/knowledge'
 import {
   searchProject,
@@ -612,7 +613,7 @@ export default {
       previewLoading: false,
       previewContent: '',
       currentPage: 1,
-      pageSize: 10
+      pageSize: 30
     }
   },
   mounted() {
@@ -1507,6 +1508,7 @@ export default {
 
     // 修改获取数据的方法
     async fetchGsprData() {
+      this.gsprTableData=[]
       if (!this.selectedProjectId) {
         this.$message.warning('请先选择项目')
         return
@@ -1522,7 +1524,7 @@ export default {
       try {
         const params = {
           project_id: this.selectedProjectId,
-          page: this.currentPage,
+          current_page: this.currentPage,
           page_size: this.pageSize
         }
 
@@ -1535,7 +1537,7 @@ export default {
         const responseData = response.data
 
         // 过滤掉 tech_report_locations 为空的数据
-        const filteredItems = responseData.items
+        /* const filteredItems = responseData.items
           .filter(item => item.tech_report_locations)
           .map(item => ({
             id: item.id,
@@ -1551,9 +1553,8 @@ export default {
             create_time: item.create_time || '',
             update_time: item.update_time || '',
             score: item.score || 0
-          }))
-
-        this.gsprTableData = filteredItems
+          })) */
+        this.gsprTableData = responseData.items//filteredItems
         this.gsprTotal = responseData.total // 使用API返回的总数
         this.hasExistingData = this.gsprTableData.length > 0
       } catch (error) {
@@ -1576,9 +1577,43 @@ export default {
 
     handleGsprSearch() {
       this.currentPage = 1 // 搜索时重置到第一页
-      this.fetchGsprData()
+      this.searchList()
+    },
+    /* 搜索 */
+   async searchList(){
+    this.gsprTableData=[]
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      try {
+      const params = {
+          project_id: this.selectedProjectId,
+          page: this.currentPage,
+          page_size: this.pageSize,
+          sort_field: this.sort_field,
+          sort_order: this.sort_order,
+          ...this.gsprPageForm,
+          ...this.gsprSearchForm,
+          start_date: this.gsprSearchForm.dateRange?.[0] || null,
+          end_date: this.gsprSearchForm.dateRange?.[1] || null,
+        }
+        const response =  await projectList(params)
+        response.data.list.map(el=>{
+          if(el.score==null){
+            el.score=0
+          }
+        })
+        this.gsprTableData = response.data.list//filteredItems
+        this.gsprTotal = response.data.total // 使用API返回的总数
+        this.hasExistingData = this.gsprTableData.length > 0
+        console.log(response);
+      } finally {
+        loading.close()
+      }
     },
-
     handleGsprReset() {
       this.gsprSearchForm = {
         keyword: '',