| | |
| | | import { ElMessage } from 'element-plus'; |
| | | import _ from 'lodash'; |
| | | import getCaretCoordinates from 'textarea-caret'; |
| | | import { computed, nextTick, ref } from 'vue'; |
| | | import { computed, nextTick, ref, toRefs, watch } from 'vue'; |
| | | import InfoDetail from './InfoDetail.vue'; |
| | | import CommonPhrases from './phrase/CommonPhrases.vue'; |
| | | import VoicePage from './voicePage/VoicePage.vue'; |
| | | import { getMetricsNames, querySimilarityHistory } from '/@/api/ai/chat'; |
| | | import { activeGroupType, groupTypeList, groupTypeMapIcon } from '/@/stores/chatRoom'; |
| | | const emits = defineEmits(['sendClick', 'showUpChatClick', 'showDownChatClick']); |
| | | const props = defineProps(['isTalking', 'isHome']); |
| | | const props = defineProps({ |
| | | isTalking: Boolean, |
| | | isHome: Boolean, |
| | | setCommonQuestionInfo: { |
| | | type: Object, |
| | | default: {}, |
| | | }, |
| | | }); |
| | | |
| | | const { setCommonQuestionInfo } = toRefs(props); |
| | | const voicePageIsShow = defineModel('voicePageIsShow', { |
| | | type: Boolean, |
| | | default: false, |
| | |
| | | onClickOutside(tipEleRef, () => { |
| | | triggerShow.value = false; |
| | | }); |
| | | |
| | | const inputText = (text) => { |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | |
| | | |
| | | //#region ====================== 当前应用场景 ====================== |
| | | const currentGroupTypeIsShow = computed(() => !!activeGroupType.value); |
| | | |
| | | const groupTypeClick = (item) => { |
| | | activeGroupType.value = item; |
| | | |
| | | inputRef.value.focus(); |
| | | commonPhrasesRef.value.getCommonPhrases(); |
| | | }; |
| | | |
| | | // 关闭当前 groupType 面板 |
| | |
| | | const commonPhrasesClick = () => { |
| | | isShowPhrase.value = true; |
| | | }; |
| | | onClickOutside(commonPhrasesRef, () => { |
| | | isShowPhrase.value = false; |
| | | }); |
| | | const updateCommonChatInput = (val) => { |
| | | inputValue.value = val; |
| | | isShowPhrase.value = false; |
| | | }; |
| | | watch(setCommonQuestionInfo, (val) => { |
| | | if (!props.isHome) { |
| | | let obj = { |
| | | id: val?.historyId, |
| | | question: val?.content.values, |
| | | }; |
| | | commonPhrasesRef.value.commonChatByUser(obj); |
| | | isShowPhrase.value = true; |
| | | } |
| | | }); |
| | | //#endregion |
| | | </script> |
| | | <style scoped lang="scss"> |