Преглед изворни кода

feat: 更新小数系统内容

zhupei пре 1 година
родитељ
комит
8e34e07675

+ 0 - 29
.gitlab-ci.yml

@@ -1,29 +0,0 @@
-image: node:20.13.1
-
-stages:
-  - build
-  - deploy
-
-cache:
-  paths:
-    - node_modules/
-
-build_job:
-  stage: build
-  script:
-    - npm config set registry https://registry.npmmirror.com
-    - npm install --legacy-peer-deps
-    - npm run build
-  artifacts:
-    paths:
-      - dist
-
-deploy_job:
-  stage: deploy
-  dependencies:
-    - build_job
-  script:
-    - rsync -e "ssh -p 22" -av --delete --no-o --no-g --progress dist/ basic@192.168.20.119:/data/disk3/rag/xiaoshu
-
-  environment:
-    name: production

+ 88 - 7
src/components/DialogWrap.vue

@@ -146,8 +146,9 @@
                         </header>
 
                         <section>
-                            <DocRefItem v-for="(knowledge, knowledgeIndex) in item.reference.slice(0,3)" :key="knowledgeIndex"
-                                :knowledge="knowledge" :knowledgeIndex="knowledgeIndex" @go-document="goKnowledge($event,item)"/>
+                            <DocRefItem v-for="(knowledge, knowledgeIndex) in item.reference.slice(0,3)"
+                                :key="knowledgeIndex" :knowledge="knowledge" :knowledgeIndex="knowledgeIndex"
+                                @go-document="goKnowledge($event,item)" />
                         </section>
                     </div>
 
@@ -177,11 +178,21 @@
                                     <img src="@/assets/icons/refresh.png" width="15" />
                                 </p>
                             </a-tooltip>
+
+                            <!-- 文档报告:复制纯文本,到报告生成 -->
+                            <!-- <a-tooltip content="复制" v-if="type === 'document_report'">
+                                <p @click="copyReportAnswer(item.answer)" :class="[readonly ? 'disabled' : '']">
+                                    <img src="@/assets/icons/copy.png" width="15" />
+                                </p>
+                            </a-tooltip> -->
+                            <!-- 非文档报告 -->
                             <a-tooltip content="复制">
                                 <p @click="copyAnswer(item.answer)" :class="[readonly ? 'disabled' : '']">
                                     <img src="@/assets/icons/copy.png" width="15" />
                                 </p>
                             </a-tooltip>
+
+
                             <a-tooltip content="收藏">
                                 <p @click="saveAnswer(key)" :class="[readonly ? 'disabled' : '']" v-if="!isSetting">
                                     <img src="@/assets/icons/star-full.png" width="15" v-if="menuList[key]?.save" />
@@ -245,6 +256,7 @@ import { formatCodePython, formatCodeSql } from './dialog-wrap/format-code-strin
 
 import formatFieldDownloadUrl from './dialog-wrap/format-field-download-url';
 
+import { copyMarkdown, copyPureText } from '../utils/copy-text'
 
 export default defineComponent({
     components: {
@@ -380,9 +392,24 @@ export default defineComponent({
 
         const copyAnswer = (text) => {
             if (!props.readonly) {
-                helper.copyText(text, "复制成功");
+                if (props.type !== 'document_report') {
+                    // copyPureText(text, "复制成功");
+                    copyMarkdown(text, "复制成功", 1);
+                } else {
+                    copyMarkdown(text, "复制成功", 3);
+                }
             }
         };
+        // /**
+        //  * 复制 文档报告 的结果
+        //  * @param text
+        //  */
+        // const copyReportAnswer = (text) => {
+        //     if (!props.readonly) {
+        //         // helper.copyText(text, "复制成功");
+        //         copyMarkdown(text, "复制成功", 3);
+        //     }
+        // };
 
         const reQuestion = (text) => {
             if (!props.readonly) {
@@ -935,12 +962,65 @@ export default defineComponent({
                     if (docReport) {
                         const upload_files = docReport.upload_files;
 
-                        sendData = {
-                            title: value,
-                            upload_files: docReport.upload_files,
-                            workflow: docReport.workflow
+                        const workflow = docReport.workflow / 1;
+
+                        if (workflow === 1) {
+                            sendData = {
+                                workflow: workflow,
+                                title: value,
+                                upload_files: docReport.upload_files,
+
+
+                                /**
+                                 * 当workflow值为2或者3时,存在此参数
+                                 */
+                                sub_titles: '',
+                            }
+                        }
+
+                        if (workflow === 2) {
+                            sendData = {
+                                workflow: workflow,
+                                title: value,
+                                upload_files: docReport.upload_files,
+
+
+                                /**
+                                 * 当workflow值为2或者3时,存在此参数
+                                 */
+                                sub_titles: docReport.sub_titles,
+                            }
                         }
 
+                        if (workflow === 3) {
+                            // 第一次参数
+                            const is_first = docReport.is_first / 1;
+
+                            if (is_first === 1) {
+                                sendData = {
+                                    workflow: workflow,
+                                    title: value,
+                                    upload_files: docReport.upload_files,
+
+                                    "title_number": docReport.title_number/1,
+                                    "title_style": docReport.title_style,
+                                    "title_query": docReport.title_query,
+                                }
+                            } else {
+                                // 后续连续问答参数
+                                sendData = {
+                                    workflow: workflow,
+
+                                    "title_query": docReport.title_query,
+                                }
+                            }
+                        }
+
+                        // workflow
+                        // 1 文档清洗
+                        // 2 文档报告
+                        // 3 小标题生成
+
                         setTimeout(() => {
                             // // 文字消息上传成功
                             // imageUploadStatus.messageFinish();
@@ -1000,6 +1080,7 @@ export default defineComponent({
 
             showFeedback,
             copyAnswer,
+            // copyReportAnswer,
             dialogList,
             getHTML,
             // selectSuggestion,

+ 46 - 0
src/components/DocumentReportFooter.md

@@ -0,0 +1,46 @@
+# 参数
+
+## 文档清洗
+
+```json
+{
+	"workflow": 1,
+	"title": "标题",
+	"upload_files": ["f7cbc22e-26cb-4120-8455-4f60b7d5288c"]
+}
+```
+
+## 报告生成
+
+```json
+{
+	"workflow": 2,
+	"title": "标题",
+	"sub_titles": "小标题",
+	"upload_files": ["f7cbc22e-26cb-4120-8455-4f60b7d5288c"]
+}
+```
+
+## 小标题生成
+
+### 第一次上传
+
+```json
+{
+	"workflow": 3,
+	"title": "标题,可以为空字符串",
+	"upload_files": ["f7cbc22e-26cb-4120-8455-4f60b7d5288c"],
+	"title_number": 8,
+	"title_style": "小标题示例",
+	"title_query": "连续问答问题",
+}
+```
+
+### 连续对话
+
+```json
+{
+	"workflow": 3,
+	"title_query": "连续问答问题",
+}
+```

+ 127 - 17
src/components/DocumentReportFooter.vue

@@ -1,17 +1,17 @@
 <template>
-    <footer class="wendangbaogaoshengcheng-footer" v-if="start_status !== 3">
+    <footer class="wendangbaogaoshengcheng-footer" v-if="show_doc_rpt_footer">
         <div class="upload-footer" v-show="doc_form_show">
             <div v-if="act_type === 3" class="form-fold-btn" @click="handleFormFold">
                 <icon-menu-fold :size="20" />
             </div>
 
-            <ActionTypeRadio @change="handleRadioChange"/>
+            <ActionTypeRadio @change="handleRadioChange" />
 
             <div class="vertical-placeholder"></div>
 
-            <TextInputType1 v-if="act_type === 1" @change="handleTextChange"/>
-            <TextInputType2 v-if="act_type === 2" @change="handleTextChange"/>
-            <TextInputType3 v-if="act_type === 3" @change="handleTextChange"/>
+            <TextInputType1 v-if="act_type === 1" @change="handleTextChange" />
+            <TextInputType2 v-if="act_type === 2" @change="handleTextChange" />
+            <TextInputType3 v-if="act_type === 3" @change="handleTextChange" />
 
             <div class="vertical-placeholder"></div>
 
@@ -61,7 +61,7 @@
                     <icon-menu-fold :size="20" />
                 </div>
 
-                <message-input :readonly="readonly" eventName="open-dialog" />
+                <MessageInputV2 :readonly="readonly" @message="handleChatMessageUpdate" />
             </div>
         </template>
     </footer>
@@ -70,13 +70,17 @@
 import { ref, inject, computed } from "vue";
 import { Message } from '@arco-design/web-vue';
 
-import MessageInput from "./MessageInput.vue";
+import MessageInputV2 from "./MessageInputV2.vue";
 
 import ActionTypeRadio from './document-report/ActionTypeRadio.vue'
 import TextInputType1 from './document-report/TextInputType1.vue'
 import TextInputType2 from './document-report/TextInputType2.vue'
 import TextInputType3 from './document-report/TextInputType3.vue'
 
+/**
+ * 与此组件有关的对话参数的文档可查看此文件同目录下的 DocumentReportFooter.md 文件
+ */
+
 const props = defineProps({
     agentId: String,
 
@@ -94,6 +98,30 @@ const { config, helper, ajax } = inject("$global");
 const act_type = ref(1);
 const text_title = ref(""); // 单行文本:标题
 const text_description = ref(""); // 多行文本:描述
+const chat_message = ref(''); // 对话输入框的消息
+
+/**
+ * 是否是第一次 小标题生成
+ */
+const is_first_generate = ref(true);
+
+const show_doc_rpt_footer = computed(() => {
+    /**
+     * 当文档报告功能为 小标题生成 时,底部一只存在,表单区域可以折叠
+     */
+    if (act_type.value === 3) {
+        return true;
+    }
+
+    /**
+     * 当文档报告功能为 1 或者 2 时,依据api调用状态判断是否显示
+     */
+    if (start_status.value !== 3) {
+        return true;
+    }
+
+    return false;
+});
 
 /**
  * 文本输入区域变化事件
@@ -153,6 +181,17 @@ const handleInputChange = (value) => {
 
 }
 
+/**
+ * 对话消息
+ * 当此事件触发,意味着新一轮对话的开始
+ * @param msg
+ */
+const handleChatMessageUpdate = (msg) => {
+    chat_message.value = msg;
+
+    handleStart();
+}
+
 /**
  * 文件数据变化
  * @param fileList
@@ -189,28 +228,24 @@ const showMsg = (msg) => {
  */
 const handleStart = async () => {
     const action_type = act_type.value; // 操作类型
-    const title = text_title.value; // 标题
+    let title = text_title.value; // 标题
     const f_list = file_list.value;
 
     if (!action_type) {
-        // Message.error({ content: '请选择类型', position: 'bottom' });
         showMsg('请选择类型');
         return;
     }
 
     if (!title) {
-        // Message.error({ content: '请填写标题', position: 'bottom' });
         showMsg('请填写标题');
         return;
     }
 
     if (f_list.length === 0) {
-        // Message.error({ content: '请选择文件', position: 'bottom' });
         showMsg('请选择文件');
         return;
     }
 
-
     const agent_id = props.agentId;
 
     try {
@@ -244,17 +279,93 @@ const handleStart = async () => {
         const file_id_list = files_info.map(item => item.id);
         // console.log(file_id_list, '文件ID值');
 
-        // 保存小数绘图数据
-        helper.write('sendData', {
+        let tempLocalStoreData = {
             name: '文档报告生成',
 
             agent_id: agent_id,
             // chat_id: chat_id,
 
+            workflow: action_type,
+
             upload_files: file_id_list,
             title: title,
-            workflow: action_type,
-        });
+            /**
+             * 当workflow值为2或者3时,存在sub_title参数值
+             */
+            sub_titles: text_description.value,
+        };
+
+        if (action_type === 1) {
+            // 文档清洗
+            tempLocalStoreData = {
+                name: '文档报告生成',
+
+                agent_id: agent_id,
+                // chat_id: chat_id,
+
+                workflow: action_type,
+
+                upload_files: file_id_list,
+                title: title,
+            };
+        }
+
+        if (action_type === 2) {
+            // 报告生成
+            tempLocalStoreData = {
+                name: '文档报告生成',
+
+                agent_id: agent_id,
+                // chat_id: chat_id,
+
+                workflow: action_type,
+
+                upload_files: file_id_list,
+                title: title,
+                /**
+                 * 当workflow值为2或者3时,存在sub_title参数值
+                 */
+                sub_titles: text_description.value,
+            };
+        }
+
+        if (action_type === 3) {
+            title = chat_message.value;
+
+            // 判断是第一次还是后续多轮文化
+            // 小标题生成
+            tempLocalStoreData = {
+                name: '文档报告生成',
+
+                agent_id: agent_id,
+                // chat_id: chat_id,
+
+                workflow: action_type,
+
+                upload_files: file_id_list,
+                title: title, // 此参数可以为空
+                title_number: text_title.value, // 小标题数量,默认值
+                title_style: text_description.value,
+                title_query: chat_message.value,
+
+                // // 增加一个is_first参数,如果值为1,表示第一次
+                // // 如果值为0,表示后续多轮对话
+                // is_first: 1,
+            };
+
+            if (is_first_generate.value) {
+                // 小标题生成
+                tempLocalStoreData.is_first = 1;
+
+                is_first_generate.value = false;
+            } else {
+                tempLocalStoreData.is_first = 0;
+            }
+
+        }
+
+        // 保存小数绘图数据
+        helper.write('sendData', tempLocalStoreData);
 
         // helper.$bus.emit('send-message', {
         //     upload_files: file_id_list,
@@ -265,7 +376,6 @@ const handleStart = async () => {
         // helper.$bus.emit('send-message', title);
         helper.$bus.emit('open-dialog', title);
 
-
         // 上传成功
         start_status.value = 3;
         start_message.value = 'success';

+ 157 - 0
src/components/MessageInputV2.vue

@@ -0,0 +1,157 @@
+<template>
+    <div class="message-input-wrap">
+        <div class="message-input-border">
+            <div class="message-input-clear" @click="clearMessage">
+                <div :class="[readonly ? 'disabled' : '']">
+                    <img src="@/assets/icons/iconPark-clear.svg" width="15" />
+                </div>
+            </div>
+            <a-textarea
+                @keydown.enter="handleEnter"
+                :max-length="maxLength"
+                v-model="value"
+                :show-word-limit="value.length > maxLength / 2"
+                :auto-size="{ maxRows: 6 }"
+                :disabled="readonly"
+                placeholder="输入您想了解的内容,Shift+Enter换行"
+                :style="{
+                    flex: 1,
+                    borderRadius: '12px',
+                    marginTop: '20px',
+                    padding: '0px 30px 0 16px',
+                    background: 'transparent',
+                    border: '1px solid #e3e3e3',
+                    minHeight: '120px',
+                    paddingBottom: `${value.length > maxLength / 2 ? '20px' : ''}`
+                }">
+            </a-textarea>
+        </div>
+        <div :class="['message-button', 'message-button-send', value.length > 0 && !readonly ? '' : 'disabled']"
+            @click="sendMessage">
+            <icon-send size="30" />
+        </div>
+    </div>
+</template>
+<script>
+import { defineComponent, ref, inject, onMounted, onBeforeUnmount, defineEmits, defineExpose} from "vue";
+
+/**
+ * 此版本的组件,仅用 props 和 emit 通过父子组件进行通信
+ * 而非使用 事件总线
+ * 使用场景1:文档报告,小标题生成
+ */
+export default defineComponent({
+    components: {},
+    props: ["readonly", "eventName"],
+    setup(props, context) {
+        const value = ref("");
+        const maxLength = ref(6000);
+
+        const sendMessage = () => {
+            if (value.value.length > 0 && !props.readonly) {
+                context.emit('message', value.value);
+
+                value.value = "";
+            }
+        };
+        const clearMessage = () => {
+            if (!props.readonly) {
+                value.value = "";
+                context.emit('message', value.value);
+            }
+        };
+        const handleEnter = (e) => {
+            if (!e.shiftKey) {
+                e.preventDefault();
+                sendMessage();
+            }
+        };
+
+
+        const setInput = (data) => {
+            value.value = data;
+        }
+
+        defineExpose({
+            setInput,
+        });
+
+        return {
+            value,
+            maxLength,
+            readonly: props.readonly,
+            sendMessage,
+            clearMessage,
+            handleEnter
+        };
+    }
+});
+</script>
+<style scoped>
+.message-input-border {
+    display: flex;
+}
+
+.message-input-clear {
+    width: 30px;
+    height: 100%;
+    margin-right: 8px;
+    display: none;
+
+    div {
+        width: 30px;
+        height: 30px;
+        border-radius: 15px;
+        background-color: rgba(64, 95, 234, 0.05);
+        position: absolute;
+        bottom: 0;
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+        &.disabled {
+            cursor: not-allowed;
+        }
+
+        &:hover {
+            background-color: rgba(64, 95, 234, 0.1);
+        }
+    }
+}
+
+.message-input-wrap {
+    position: relative;
+    margin-bottom: 20px;
+}
+
+.message-button {
+    position: absolute;
+    width: 30px;
+    height: 40px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    cursor: pointer;
+    bottom: 5px;
+    right: 5px;
+    z-index: 2;
+
+    &.disabled {
+        opacity: 0.5;
+        cursor: not-allowed;
+    }
+}
+
+.message-button-upload {
+    left: 38px;
+}
+
+.message-button-send {
+    color: rgb(64, 95, 234, 0.8);
+
+    &:hover {
+        color: rgb(64, 95, 234);
+    }
+}
+</style>

+ 5 - 4
src/components/answer-effect/format-anwser-string.js

@@ -1,5 +1,6 @@
 // import { marked } from "marked";
-import marked from './marked-lib'
+// import marked from './marked-lib'
+import marked from '../../utils/marked-lib';
 
 /**
  * 引用标记
@@ -8,8 +9,8 @@ export const REFFERENCE_FLAG = 'refference-flag';
 
 /**
  * 转换AI的anwser数据
- * @param {string} string - 待转换数据 
- * @returns 
+ * @param {string} string - 待转换数据
+ * @returns
  */
 export default function formatAnwserString(string) {
     if (!string) {
@@ -78,4 +79,4 @@ export default function formatAnwserString(string) {
     });
 
     return formated;
-};
+};

+ 1 - 1
src/components/document-report/TextInputType2.vue

@@ -1,6 +1,6 @@
 <template>
     <a-typography-text>
-        标题<span class="attention-requred">*</span>
+        报告标题<span class="attention-requred">*</span>
     </a-typography-text>
     <a-input :style="{ flex: '1' }" v-model="text_title" :placeholder="`请输入标题`" allow-clear
         @input="handleInputChange" />

+ 8 - 3
src/components/document-report/TextInputType3.vue

@@ -1,6 +1,6 @@
 <template>
     <a-typography-text>
-        标题<span class="attention-requred">*</span>
+        标题数量<span class="attention-requred">*</span>
     </a-typography-text>
     <a-input :style="{ flex: '1' }" v-model="text_title" :placeholder="`请输入标题`" allow-clear
         @input="handleInputChange" />
@@ -22,8 +22,14 @@ import { ref, inject, computed, nextTick } from "vue";
 
 const emit = defineEmits(['change']);
 
+const str = `
+坚持现场优先,在检测中锻炼队伍
+立足本质安全,在应急中彰显水平
+`
+
+
 // 标题
-const text_title = ref(""); // 单行文本:标题
+const text_title = ref("8"); // 单行文本:标题
 const text_description = ref(""); // 多行文本:描述
 
 const maxLength = ref(120); // 允许输入的最大长度
@@ -41,7 +47,6 @@ const text_area_style = {
     paddingBottom: `${text_title.value.length > maxLength.value / 2 ? '20px' : ''}`
 };
 
-
 const handleChange = () => {
     nextTick(() => {
         emit('change', {

+ 82 - 0
src/utils/copy-text.js

@@ -0,0 +1,82 @@
+import ArcoVue from "@arco-design/web-vue";
+import * as clipboard from "clipboard-polyfill";
+
+import marked from './marked-lib';
+
+
+/**
+ * 将markdown转换为html字符串
+ */
+export const markdown2html = (mkd) => {
+    const html = marked.parse(mkd);
+    return html
+}
+
+/**
+ * 将markdown转换为纯文本
+ * @param {string} markdown
+ */
+export const markdown2text = (markdown) => {
+    const html = markdown2html(markdown);
+
+    const div = document.createElement('div');
+    div.innerHTML = html;
+    const inner_text = div.innerText;
+    return inner_text;
+}
+
+/**
+ * 复制一个文本数据
+ * @param {string} text - 将文本数据复制到剪贴板
+ * @param {string} content - 复制成功后的提示消息
+ */
+export const copyPureText = (text, content) => {
+    clipboard.writeText(text).then(() => {
+        ArcoVue.Message["success"]({ content, duration: 1500 });
+    });
+}
+
+/**
+ * 复制markdown文本
+ * 默认复制markdown原文
+ * result_type 的值不同,最终复制到剪贴板的结果内容也不同
+ * result_type 为 1,复制到剪贴板的为markdown原文
+ * result_type 为 2,复制到剪贴板的为markdown转换为html后的html字符串
+ * result_type 为 3,复制到剪贴板的为markdown转换后的纯文本
+ * @param {string} markown_string - markdown原文
+ * @param {string} message - 复制成功后的消息
+ * @param {boolean} result_type - 复制的内容类型 1 原文 2 html字符串 3 纯文本
+ */
+export const copyMarkdown = (markown_string, message, result_type = 1) => {
+    if (result_type === 1) {
+        // 原文复制
+        copyPureText(markown_string, message);
+    } else if (result_type === 2) {
+        // 转换为html字符串后复制
+        const html_str = markdown2html(markown_string);
+
+        copyPureText(html_str, message);
+    } else {
+        // 转换为纯文本复制
+        const pure_text = markdown2text(markown_string);
+
+        copyPureText(pure_text, message);
+    }
+}
+
+
+// import { markdown2text } from './utils/copy-text'
+
+// // 示例Markdown内容
+// const markdownText = `
+// # 标题
+
+// 这是一段文本,**加粗** 和 *斜体*。
+
+// - 列表项一
+// - 列表项二
+
+// > 这是一个引用。
+// `;
+// console.log(markdownText)
+// console.log(markdown2text(markdownText));

+ 0 - 0
src/components/answer-effect/marked-lib.js → src/utils/marked-lib.js


+ 44 - 3
src/views/Home.vue

@@ -12,7 +12,7 @@
                 <Index v-if="navId === -1" :number="swiperNumber" @select-nav="selectNav" />
 
                 <div :class="{ 'border-wrap': true, 'border-no-wrap': navId === -2 }" v-else>
-                    <div>
+                    <div :key="dialog_uniq_key">
                         <!-- 项目与功能特色介绍 -->
                         <ProjectIntro v-if="!showDialog" :navId="navId" />
 
@@ -138,7 +138,7 @@
                         <PictureFooter v-if="navId === 6 && !historyMode" :agentId="selectId" />
 
                         <!-- 文档报告 -->
-                        <DocumentReportFooter v-if="navId === 9 && !showDialog" :agentId="selectId" />
+                        <DocumentReportFooter v-if="navId === 9" :agentId="selectId" />
 
                         <!-- 侧边栏切换按钮 -->
                         <ToggleBtn v-if="navId !== -2" :closeOthers="closeOthers" @toggle="openAll" />
@@ -181,7 +181,7 @@ import DocumentReportFooter from '../components/DocumentReportFooter.vue'
 
 import BtnIframeChujuan from '../components/btn-iframe-chujuan/BtnIframeChujuan.vue'
 
-import { defineComponent, ref, onMounted, inject, onBeforeUnmount } from "vue";
+import { defineComponent, ref, onMounted, inject, onBeforeUnmount, computed } from "vue";
 
 import { wendangzhinengSetTempDocFile, wendangzhinengClearDocFile } from '../components/dialog-wrap/temp-wendangzhineng-docs';
 
@@ -233,6 +233,41 @@ const maxLength = ref(6000); // 允许输入的最大长度
 const targetDocument = ref(null); // 当前查看详情的文档
 const transNavId = ref() //查看详情时记录之前的navId
 
+/**
+ * 记录各按钮点击时的次数
+ * 侧边栏,菜单点击
+ * 历史记录每一项被点击
+ * 新建对话按钮被点击
+ * 对应按钮,每点击一下,此处对应数据新增1
+ * 以此可以维护一个唯一的key
+ */
+const count_menu_nav_click = ref(0);
+const count_his_item_click = ref(0);
+const count_btn_create_click = ref(0);
+/**
+ * 会话区域唯一的key
+ */
+const dialog_uniq_key = computed(() => {
+    return count_menu_nav_click.value + count_his_item_click.value + count_btn_create_click.value;
+});
+/**
+ * 更新按钮点击的次数
+ * @param {String} type - menu/create/history
+ */
+const updateClickCount = (type) => {
+    if (type === 'ct_menu') {
+        count_menu_nav_click.value = count_menu_nav_click.value + 1;
+    }
+
+    if (type === 'ct_create') {
+        count_btn_create_click.value = count_btn_create_click.value + 1;
+    }
+
+    if (type === 'ct_history') {
+        count_his_item_click.value = count_his_item_click.value + 1;
+    }
+}
+
 
 
 let reportData = {};
@@ -318,6 +353,8 @@ const selectNav = async (node) => {
     // 每次切换功能板块时,清空sendData数据
     // helper.write('sendData', {});
     clearLocalStorageSendData();
+
+    updateClickCount('ct_menu');
 };
 
 /**
@@ -348,6 +385,8 @@ const selectHistory = async (id) => {
 
     initDialog.value = true;
     helper.$bus.emit("set-loading", false);
+
+    updateClickCount('ct_history');
 };
 
 const beginCombine = async () => {
@@ -522,6 +561,8 @@ const handelSetNewChat = () => {
 
     // 每次新建对话时,清空sendData数据
     clearLocalStorageSendData();
+
+    updateClickCount('ct_create');
 };
 
 function clearLocalStorageSendData() {