| | |
| | | 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 |
| | |
| | | </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> |
| | |
| | | @updateInput="updateInputValue" |
| | | /> |
| | | <BusinessTable v-model="businessTableIsShow" @submit="submitBusinessTable" /> |
| | | <BusinessTablePreview :data="attachPreviewData" v-model="attachPreviewIsShow" @submit="submitBusinessTable" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <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, |
| | |
| | | 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, |