wujingjing
2025-01-02 9bfdf795ded956021d99ae5f6662934a71163d8b
src/components/chat/components/playBar/PlayBar.vue
@@ -85,17 +85,18 @@
<script setup lang="ts">
import type { InputInstance } from 'element-plus';
import getCaretCoordinates from 'textarea-caret';
import { nextTick, ref } from 'vue';
import { computed, nextTick, ref } from 'vue';
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';
const emits = defineEmits(['sendClick', 'showUpChatClick', 'showDownChatClick', 'stopGenClick']);
import { usePickHistory } from './hook/usePickHistory';
const emits = defineEmits(['sendClick', 'stopGenClick']);
const props = defineProps({
   isTalking: Boolean,
   isHome: Boolean,
   msgList: Array,
});
const voicePageIsShow = defineModel('voicePageIsShow', {
@@ -113,6 +114,11 @@
const updateInputValue = (val) => {
   inputValue.value = val;
};
const { setUpQuestion, setDownQuestion } = usePickHistory({
   msgList: computed(() => props.msgList),
   inputValue: inputValue,
});
const keydownInput = (e) => {
   if (props.isTalking) return;
   const isEnterInput = !e.shiftKey && e.key == 'Enter';
@@ -130,9 +136,9 @@
         const num = Number(e.code.replace('Digit', ''));
         inputTipRef.value.applyIndexItem(num - 1);
      } else if (arrowUp) {
         emits('showUpChatClick');
         setUpQuestion();
      } else if (arrowDown) {
         emits('showDownChatClick');
         setDownQuestion();
      }
   }
};