Procházet zdrojové kódy

fix: 修复报表合并的bug

1. 调整小数绘图store的组织方式
2. 修复报表合并的bug
zhupei před 1 rokem
rodič
revize
5eef619253

+ 13 - 5
README.md

@@ -1,13 +1,16 @@
-# business
+# 小数
 
-This template should help get you started developing with Vue 3 in Vite.
+大模型 AI 能力平台,为你的下一个创意助力
 
-## Recommended IDE Setup
+## 环境参考
 
-[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
+- node.js 20.13.1
+- npm 10.5.2
 
 ## 项目设置
 
+git 仓库地址:http://gitlab.smartai.com/qi/xiaoshu
+
 ```sh
 # 安装项目依赖
 $ npm install
@@ -27,10 +30,12 @@ $ npm run build
 3. 安装新依赖包需要使用`--legacy-peer-deps`参数,例如:`npm install --save --legacy-peer-deps md5`
 4. 配置文件`src/ajax/url-external-config.js`中的`REFFERENCE_ASSETS_FILE_URL`需要配置,当前值为`http://192.168.20.119:11080`。如果不配置,则会引起`文档引用`效果出错,图片和 PDF 文档将无法显示。
 5. 项目启动之前,可能需要做一些配置,详情请见下方`关于配置文件`章节
+6. 此项目中的组件库,主要使用 字节跳动出品的企业级设计系统 [arco.design](https://arco.design/vue/docs/start)
+7. 代码编辑器推荐使用`vscode`
 
 ## 关于配置文件
 
-项目里一有三个配置文件,如下:
+项目里一有三个配置文件,如下:
 
 - src/ajax/url-external-config.js
 - src/utils/config.js
@@ -54,6 +59,9 @@ $ npm run build
 
 ## 相关资源
 
+- [vuejs](https://cn.vuejs.org/)
+- [vue-router](https://router.vuejs.org/zh/)
+- [pinia](https://pinia.vuejs.org/zh/)
 - [Vite 配置参考](https://vitejs.dev/config/).
 - [字节跳动前端框架 arco design](https://arco.design/vue/docs/start)
 - [RAGFlow 开源大模型](https://infiniflow.cn/)

+ 24 - 9
src/components/DialogWrap.vue

@@ -32,6 +32,7 @@
 
           <div class="dialog-footer" v-if="item?.question">
             <Question 
+              v-once
               :question="item.question"                 
               :index="key" 
               :chat_id="dialogId" 
@@ -282,7 +283,7 @@ import formatDialogItem from './dialog-wrap/format-dialog-item';
 
 import DocRefItem from './dialog-wrap/DocRefItem.vue';
 
-import {useImageUploadStatus} from '../store/modules/xs-huitu-image-upload/index';
+import {useImageUploadStatus} from '../store/index';
 
 export default defineComponent({
   components: {
@@ -669,7 +670,16 @@ export default defineComponent({
           }
 
           if (files && files.length > 0) {
-            loadingData.value.file = files[0];
+            loadingData.value.file = {
+              file_name: files[0].file_name,
+              file_url: files[0].file_url,
+            };
+
+            answerFile.value = {
+              file_name: files[0].file_name,
+              file_url: files[0].file_url,
+            };
+
             addData(loadingData.value);
           } else {
             answerData.value += step_message ? getHTML(step_message) + "</br>" : message
@@ -786,10 +796,21 @@ export default defineComponent({
             stopWriting();
             answerData.value = "";
             isLoaded.value = false;
-          }else{
+          } else if(chat_type === 'excel'){
+            // 报表合并
+            answerLoaded();
+            answerData.value = getHTML(message);
+
+            addAnswer(loadingData.value);
+
+            answerData.value = getHTML(message);
+
+            stopWriting();
+          } else{
             if (!answerData.value) {
               answerLoaded();
               answerData.value = getHTML(message);
+
               addAnswer(loadingData.value);
             }
             stopWriting();
@@ -797,12 +818,6 @@ export default defineComponent({
             isLoaded.value = false;
           }
         }
-
-        // // 获取所有的临时历史记录
-        // const full_history = tempHistory.getHistory();
-        // applyRefferencePopover(full_history);
-        // const current_index = tempHistory.getChatIndex(cur_chat_id);
-        // applyImageDisplay(full_history, current_index);
       }
 
       helper.webSocket.onmessage = (event) => {

+ 5 - 1
src/components/DocumentCards.vue

@@ -9,7 +9,7 @@
         </div>
       </div>
     </section>
-    <footer v-if="hasUpload">
+    <footer v-if="hasUpload" class="excel-upload-container">
       <a-popover :popup-visible="showUpload" position="tl" @popup-visible-change="() => {
         showDeleteTooltip = false;
       }
@@ -297,6 +297,10 @@ export default defineComponent({
 });
 </script>
 <style lang="scss" scoped>
+.excel-upload-container{
+  margin-bottom: 20px;
+}
+
 .bottom-buttons {
   display: flex;
   justify-content: right;

+ 1 - 1
src/components/PictureUpload.vue

@@ -112,7 +112,7 @@ import FileListTable from './picture-upload/FileListTable.vue';
 
 import {huituSetTempImageFile} from './dialog-wrap/temp-image'
 
-import {useImageUploadStatus} from '../store/modules/xs-huitu-image-upload/index';
+import {useImageUploadStatus} from '../store/index';
 
 export default defineComponent({
   props: ["data", "uploadFile", "isQuestion", "agentId", "agengtName"],

+ 10 - 9
src/store/index.ts

@@ -1,15 +1,16 @@
-import { createPinia } from 'pinia';
-import useAppStore from './modules/app';
-import useUserStore from './modules/user';
-import usePinia from './modules/storeMsg';
-import useTabBarStore from './modules/tab-bar';
-import userModelState from './modules/shareModel';
+import { createPinia } from "pinia";
+import useAppStore from "./modules/app";
+import useUserStore from "./modules/user";
+import usePinia from "./modules/storeMsg";
+import useTabBarStore from "./modules/tab-bar";
+import userModelState from "./modules/shareModel";
+import useImageUploadStatus from "../store/modules/xs-huitu-image-upload/index";
 
-import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' //引入持久化插件
+import piniaPluginPersistedstate from "pinia-plugin-persistedstate"; //引入持久化插件
 
 const pinia = createPinia();
 
-pinia.use(piniaPluginPersistedstate) //将插件添加到 pinia 实例上
+pinia.use(piniaPluginPersistedstate); //将插件添加到 pinia 实例上
 
-export { useAppStore, useUserStore,usePinia, useTabBarStore,userModelState };
+export { useAppStore, useUserStore, usePinia, useTabBarStore, userModelState, useImageUploadStatus };
 export default pinia;

+ 3 - 1
src/store/modules/xs-huitu-image-upload/index.ts

@@ -15,7 +15,7 @@ import { defineStore } from "pinia";
  *
  * 在上传图片的位置,应检查 img_upload_status 和 msg_send_status 的值,如果 img_upload_status === 1 但是 msg_send_status === 0,则图片上传功能不可用
  */
-export const useImageUploadStatus = defineStore("imageUploadStatus", {
+const useImageUploadStatus = defineStore("imageUploadStatus", {
   state: () => ({
     img_upload_status: 0,
     msg_send_status: 0
@@ -56,3 +56,5 @@ export const useImageUploadStatus = defineStore("imageUploadStatus", {
     }
   }
 });
+
+export default useImageUploadStatus;

+ 1 - 1
src/views/Home.vue

@@ -58,7 +58,7 @@
               />
             </section>
 
-            <footer v-if="navId !== -2 && navId !== 0 && navId !== 3 && navId !== 6 && !historyMode">
+            <footer v-if="navId !== -2 && navId !== 0 && navId !== 3 && navId !== 6 && navId !== 1 && !historyMode">
               <BtnIframeChujuan v-if="navId==7"/>
               <message-input :readonly="readonly" eventName="open-dialog" />
             </footer>