| | |
| | | <div class="w-full space-y-3"> |
| | | <template v-if="parsedData && parsedData.length > 0"> |
| | | <template v-for="(item, index) in parsedData" :key="item.id"> |
| | | <!-- <el-button v-if="showReportIndex.includes(index)" @click="showAgentReport(index)">报告</el-button> --> |
| | | <el-button v-if="showReportIndex.includes(index) && conclusion.length > 0" @click="showAgentReport(index)">报告</el-button> |
| | | <component |
| | | ref="componentRef" |
| | | :id="item.id" |
| | |
| | | ></component> |
| | | </template> |
| | | </template> |
| | | <!-- <AmisPageTest /> --> |
| | | <ReportDlg v-model="infoDlgIsShow" :report="report" :agentKey="agentKey"></ReportDlg> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { chatComProps } from '../common'; |
| | | import { SummaryAnswerType, summaryAnswerTypeMapCom } from './components/types'; |
| | | // import AmisPageTest from './components/amisPage/AmisPageTest.vue'; |
| | | |
| | | import ReportDlg from './ReportDlg.vue'; |
| | | const props = defineProps(chatComProps); |
| | | const tableLimitHeight = document.body.clientHeight * 0.7; |
| | | |
| | |
| | | }); |
| | | |
| | | // 需要展示 report 的 索引 |
| | | const showReportIndex = computed(()=>{ |
| | | const showReportIndex = computed(() => { |
| | | const agentKeySet = new Set(); |
| | | const indexList = []; |
| | | parsedData.value.forEach((value,index)=>{ |
| | | if(value?.agent_key ){ |
| | | if(!agentKeySet.has(value.agent_key)){ |
| | | parsedData.value.forEach((value, index) => { |
| | | if (value?.agent_key) { |
| | | if (!agentKeySet.has(value.agent_key)) { |
| | | agentKeySet.add(value.agent_key); |
| | | indexList.push(index) |
| | | indexList.push(index); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | return indexList; |
| | | }) |
| | | }); |
| | | |
| | | const componentRef = ref<any[]>(null); |
| | | |
| | |
| | | item?.updateAll(triggerIndex, res); |
| | | } |
| | | }; |
| | | const infoDlgIsShow = ref(false); |
| | | const report = ref(null); |
| | | |
| | | const agentKey = ref(''); |
| | | |
| | | const conclusion = computed(() => props.originData?.content?.origin?.conclusion ?? []); |
| | | const showAgentReport = (agentStartIndex) => { |
| | | const agent = parsedData.value[agentStartIndex]; |
| | | const agentKey = agent.agent_key; |
| | | |
| | | console.log("🚀 ~ showAgentReport:", props.originData) |
| | | agentKey.value = agent.agent_key; |
| | | const foundReport = conclusion.value.find((item) => item.agent_key === agentKey.value); |
| | | report.value = foundReport; |
| | | |
| | | infoDlgIsShow.value = true; |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"></style> |