From ce5d4a0d224aaab33b4d8ddd7b4af170882d406e Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期二, 04 三月 2025 14:30:28 +0800 Subject: [PATCH] 预览业务表格 --- src/components/chat/components/playBar/PlayBar.vue | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue index 104d981..f1874bd 100644 --- a/src/components/chat/components/playBar/PlayBar.vue +++ b/src/components/chat/components/playBar/PlayBar.vue @@ -25,12 +25,14 @@ </el-button> </div> - <div class="set-input "> + <div class="set-input"> <div v-if="attachList?.length > 0" class="flex gap-3.5 w-full overflow-x-auto px-2 pb-2"> <div v-for="(item, index) in attachList" :key="index" class="flex items-center gap-2 bg-[#f5f5f5] px-2 py-3 rounded-lg w-[220px] relative group" + :class="{ 'cursor-pointer': item.type === 'table' }" + @click="openAttachPreview(item)" > <template v-if="item.type === 'file'"> <el-image @@ -56,7 +58,7 @@ </template> <div class="group-hover:visible invisible absolute right-0.5 top-0.5 bg-red-500 flex-center rounded-full p-0.5 cursor-pointer" - @click="deleteAttachInIndex(index)" + @click.stop="deleteAttachInIndex(index)" > <span class="ywifont ywicon-guanbi text-white !text-[10px] font-bold"></span> </div> @@ -142,6 +144,7 @@ @updateInput="updateInputValue" /> <BusinessTable v-model="businessTableIsShow" @submit="submitBusinessTable" /> + <BusinessTablePreview :data="attachPreviewData" v-model="attachPreviewIsShow" @submit="submitBusinessTable" /> </div> </div> </template> @@ -149,15 +152,18 @@ <script setup lang="ts"> import type { InputInstance } from 'element-plus'; import { nextTick, ref } from 'vue'; +import BusinessTable from './businessTable/index.vue'; +import BusinessTablePreview from './businessTablePreview/index.vue'; +import type { Attach } from './hook/useAttach'; +import { useAttach } from './hook/useAttach'; import { useInputEvent } from './hook/useInputEvent'; +import { useUploadFile } from './hook/useUploadFile'; import InputTip from './inputTip/index.vue'; import CommonPhrases from './phrase/CommonPhrases.vue'; import SceneSwitch from './SceneSwitch.vue'; import VoicePage from './voicePage/VoicePage.vue'; import { useCompRef } from '/@/utils/types'; -import { useUploadFile } from './hook/useUploadFile'; -import BusinessTable from './businessTable/index.vue'; -import { useAttach } from './hook/useAttach'; + const emits = defineEmits(['sendClick', 'stopGenClick']); const props = defineProps({ isTalking: Boolean, @@ -269,6 +275,16 @@ businessTableIsShow.value = true; }; //#endregion + +//#region ====================== 闄勪欢棰勮 ====================== +const attachPreviewIsShow = ref(false); +const attachPreviewData = ref<Attach>(); +const openAttachPreview = (item: Attach) => { + if (item.type === 'file') return; + attachPreviewIsShow.value = true; + attachPreviewData.value = item; +}; +//#endregion defineExpose({ addPhrase, showSyncTip, -- Gitblit v1.9.3