From a89feae0739453304738e74330ff59da1a8762aa Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 06 十一月 2024 15:03:00 +0800 Subject: [PATCH] ms 展开/收起 --- src/components/chat/chatComponents/summaryCom/SummaryCom.vue | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/SummaryCom.vue b/src/components/chat/chatComponents/summaryCom/SummaryCom.vue index c4ccf4d..338912c 100644 --- a/src/components/chat/chatComponents/summaryCom/SummaryCom.vue +++ b/src/components/chat/chatComponents/summaryCom/SummaryCom.vue @@ -14,7 +14,24 @@ :tableLimitHeight="tableLimitHeight" @updateQuery="(res) => updateRecordSet(index, res)" ></component> - <div class="max-h-[2/3vh] markdown-it" v-if="showReportIndex.includes(index) && conclusion?.length > 0" v-html="md.render(getReport(index))"></div> + + <div class="flex flex-col" v-if="showReportIndex.includes(index) && conclusion?.length > 0"> + <div class="flex items-center mb-3"> + <span class="mr-2">璇勪及锛�</span> + <div + @click="toggleReport(item)" + class="cursor-pointer border border-gray-300 border-solid w-fit px-2 flex items-center space-x-2 rounded-lg hover:bg-gray-100 active:bg-gray-200" + > + <span> + {{ toggleReportLabel(item) }} + </span> + <span class="ywifont" :class="{ 'ywicon-unfold': !item.stepIsShow, 'ywicon-fold': item.stepIsShow }"></span> + </div> + </div> + + <!-- 杩囩▼杈撳嚭 --> + <div v-show="item.reportIsShow" class="max-h-[2/3vh] markdown-it" v-html="md.render(getReport(index))"></div> + </div> </template> </template> <!-- <ReportDlg v-model="infoDlgIsShow" :report="report" :agentKey="agentKey"></ReportDlg> --> @@ -72,8 +89,13 @@ const agentKey = agent.agent_key; // debugger; const foundReport = props.conclusion.find((item) => item.agent_key === agentKey); - const report = foundReport?.report ??''; - return report + const report = foundReport?.report ?? ''; + return report; +}; + +const toggleReportLabel = (item) => (item.reportIsShow ? '鏀惰捣' : '灞曞紑'); +const toggleReport = (item) => { + item.reportIsShow = !item.reportIsShow; }; // const infoDlgIsShow = ref(false); // const report = ref(null); -- Gitblit v1.9.3