| | |
| | | </div> |
| | | <div class="set-input"> |
| | | <el-input |
| | | class="relative align-bottom set-inputAnswer" |
| | | type="textarea" |
| | | resize="none" |
| | | :autosize="{ minRows: 1, maxRows: 8 }" |
| | | v-elInputFocus |
| | | @keydown="enterInput" |
| | | v-model="inputValue" |
| | | placeholder="在这里输入您的问题开始和AI对话" |
| | | class="set-inputAnswer" |
| | | /> |
| | | </div> |
| | | <div class="h100 flex items-center"> |
| | | <div class="upload_img space-y"> |
| | | <div class="imgbox cursor-pointer flex items-center"> |
| | | <el-button title="AI看图" class="cursor-pointer" link style="margin-left: unset"> |
| | | <!-- <el-button title="AI看图" class="cursor-pointer" link style="margin-left: unset"> |
| | | <img src="/static/images/wave/LookImg.png" class="set-img-icon box-border" /> |
| | | </el-button> |
| | | <el-button title="AI语音对话" class="cursor-pointer" link style="margin-left: unset"> |
| | | </el-button> --> |
| | | <el-button title="AI语音对话" class="cursor-pointer" link style="margin-left: unset" @click="audioChangeWord"> |
| | | <img src="/static/images/wave/HeadImg.png" class="set-img-icon box-border" /> |
| | | </el-button> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <VoicePage |
| | | v-model:isShow="voicePageIsShow" |
| | | v-show="voicePageIsShow" |
| | | @submit="(cb) => emits('sendClick', cb)" |
| | | @updateInputValue="updateInputValue" |
| | | :isHome = "isHome" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { reactive } from 'vue'; |
| | | |
| | | import { ElMessage } from 'element-plus'; |
| | | import { ref } from 'vue'; |
| | | import VoicePage from './voicePage/VoicePage.vue'; |
| | | const emits = defineEmits(['sendClick']); |
| | | |
| | | const props = defineProps(['isTalking']); |
| | | const props = defineProps(['isTalking','isHome']); |
| | | |
| | | const voicePageIsShow = defineModel('voicePageIsShow', { |
| | | type: Boolean, |
| | | default: false, |
| | | }); |
| | | const inputValue = defineModel({ |
| | | type: String, |
| | | }); |
| | | |
| | | const updateInputValue = (val) => { |
| | | inputValue.value = val; |
| | | }; |
| | | |
| | | const enterInput = (e) => { |
| | | if (props.isTalking) return; |
| | |
| | | //以下处理发送消息代码 |
| | | emits('sendClick'); |
| | | } |
| | | }; |
| | | const audioChangeWord = () => { |
| | | navigator.getUserMedia( |
| | | { audio: true }, |
| | | function onSuccess(stream) { |
| | | voicePageIsShow.value = true; |
| | | }, |
| | | function onError(error) { |
| | | ElMessage.warning('请打开麦克风权限'); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |
| | |
| | | display: inline-block; |
| | | width: 100%; |
| | | .set-inputAnswer { |
| | | min-height: 36px; |
| | | height: 36px; |
| | | padding: 3px 0; |
| | | line-height: 20px; |
| | | border: none; |
| | | background-color: transparent; |
| | | color: #333; |
| | | font-size: 15px; |
| | | :deep(.el-textarea__inner) { |
| | | // 去除线 |
| | | box-shadow: none; |
| | | } |
| | | } |
| | | :deep(.el-input__wrapper) { |
| | | box-shadow: unset; |