Ver Fonte

fix修复文档智能

张涛 há 1 ano atrás
pai
commit
29c3f819ae
4 ficheiros alterados com 38 adições e 29 exclusões
  1. 13 4
      src/components/DialogWrap.vue
  2. 10 10
      src/components/DocumentCards.vue
  3. 14 14
      src/utils/config.js
  4. 1 1
      src/views/Home.vue

+ 13 - 4
src/components/DialogWrap.vue

@@ -65,7 +65,7 @@
                     <span>
                       <em v-for="(item, documentIndex) in document.list" :key="documentIndex">{{
                         item.title
-                      }}</em>
+                        }}</em>
                     </span>
                     <icon-caret-down size="12" v-if="documentKey === menuList[key].documentOpenIndex" />
                     <icon-caret-right size="12" v-else />
@@ -76,7 +76,7 @@
                       <a-typography-paragraph :ellipsis="{ rows: 3, css: true }" :style="{ flex: 1, margin: '0' }">
                         <span style="color: rgba(153, 153, 153, 1); font-size: 12px">{{
                           item.content
-                        }}</span>
+                          }}</span>
                       </a-typography-paragraph>
                     </p>
                   </div>
@@ -478,14 +478,23 @@ export default defineComponent({
         const question = props.type === "report" ? value.inputs.report_name : value;
         const data = addQuestion(question);
         loadingData.value = addLoading(data);
-        const sendData =
+        let sendData =
           props.type === "report" || props.type === "excel"
             ? value
             : {
               message: value
             };
+        console.log('sendData', sendData)
         if (props.type === 'doc') {
-          sendData.doc_ids = [helper.read('docId')];
+
+          // sendData.doc_ids = [helper.read('docId')];
+          // 以下为判断是毕生还是regflow
+          // TODO 判断是毕生还是regflow
+          // 以下为毕生
+
+          sendData = helper.read('sendData')
+          sendData.message = value
+          console.log('sendData', sendData)
         }
         helper.webSocket.send(JSON.stringify(sendData));
       });

+ 10 - 10
src/components/DocumentCards.vue

@@ -144,10 +144,14 @@ export default defineComponent({
             type
           };
           buttonLoading.value = false;
+          // if (result) {
+          //     helper.write('docId', result.doc_ids[0]);
+          // }
 
+          // 以下为判断是毕生还是regflow
           // TODO 判断是毕生还是regflow
           // 以下为毕生
-          inputData.push({
+          inputData.value.push({
             name: result.file_name,
             file_path: result.file_path,
             value: ""
@@ -158,18 +162,14 @@ export default defineComponent({
             name: "文档智能",
             description: "文档智能",
             inputs: {
-              report_name: inputData.map(item => item.name).join(', '),
+              report_name: inputData.value.map(item => item.name).join(', '),
               id: "Report-PRcYL",
-              data: inputData
+              data: inputData.value
             }
           };
-          setTimeout(() => {
-            helper.$bus.emit("send-message", sendData);
-          }, 500);
-
-          // if (result) {
-          //     helper.write('docId', result.doc_ids[0]);
-          // }
+          if (sendData) {
+            helper.write('sendData', sendData);
+          }
 
         } else {
           fileList.value.forEach(file => {

+ 14 - 14
src/utils/config.js

@@ -2,20 +2,20 @@ export default {
     defaultTitle: "河南电力",
     defaultDesc: "大模型AI能力平台,为你的下一个创意助力",
     slider: [
-        // {
-        //     title: "报告生成",
-        //     icon: "2",
-        //     img: "/src/assets/index/2.png",
-        //     desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
-        //     dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
-        // },
-        // {
-        //     title: "报表合并",
-        //     icon: "6",
-        //     img: "/src/assets/index/6.png",
-        //     desc: "基于您上传的报表进行合并,助您快速完成报表整合与分析",
-        //     dialog: "基于您上传的报表进行合并,助您快速完成报表整合与分析"
-        // },
+        {
+            title: "报告生成",
+            icon: "2",
+            img: "/src/assets/index/2.png",
+            desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
+            dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
+        },
+        {
+            title: "报表合并",
+            icon: "6",
+            img: "/src/assets/index/6.png",
+            desc: "基于您上传的报表进行合并,助您快速完成报表整合与分析",
+            dialog: "基于您上传的报表进行合并,助您快速完成报表整合与分析"
+        },
         {
             title: "知识问答",
             icon: "5",

+ 1 - 1
src/views/Home.vue

@@ -236,7 +236,7 @@ export default defineComponent({
             initDialog.value = true;
             const sendData = {
                 chatHistory: [],
-                value: textValue.value,
+                message: textValue.value,
                 name: "报告生成",
                 description: "报告生成",
                 inputs: {