wujingjing
2025-03-04 ce5d4a0d224aaab33b4d8ddd7b4af170882d406e
src/components/chat/components/playBar/PlayBar.vue
@@ -31,6 +31,8 @@
                  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,