feat: chat

This commit is contained in:
wangdan-fit2cloud 2025-06-15 15:21:36 +08:00
parent afada6fa72
commit 1b98e352b6
3 changed files with 49 additions and 49 deletions

View File

@ -156,35 +156,48 @@
</el-space> </el-space>
</div> </div>
</el-scrollbar> </el-scrollbar>
<div class="flex" :style="{ alignItems: isMicrophone ? 'center' : 'end' }">
<TouchChat
v-if="isMicrophone"
@TouchStart="startRecording"
@TouchEnd="TouchEnd"
:time="recorderTime"
:start="recorderStatus === 'START'"
:disabled="loading"
/>
<el-input
v-else
ref="quickInputRef"
v-model="inputValue"
:placeholder="
recorderStatus === 'START'
? `${$t('chat.inputPlaceholder.speaking')}...`
: recorderStatus === 'TRANSCRIBING'
? `${$t('chat.inputPlaceholder.recorderLoading')}...`
: $t('chat.inputPlaceholder.default')
"
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }"
type="textarea"
:maxlength="100000"
@keydown.enter="sendChatHandle($event)"
@paste="handlePaste"
@drop="handleDrop"
/>
<div class="operate flex align-center"> <TouchChat
v-if="isMicrophone"
@TouchStart="startRecording"
@TouchEnd="TouchEnd"
:time="recorderTime"
:start="recorderStatus === 'START'"
:disabled="loading"
/>
<el-input
v-else
ref="quickInputRef"
v-model="inputValue"
:placeholder="
recorderStatus === 'START'
? `${$t('chat.inputPlaceholder.speaking')}...`
: recorderStatus === 'TRANSCRIBING'
? `${$t('chat.inputPlaceholder.recorderLoading')}...`
: $t('chat.inputPlaceholder.default')
"
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }"
type="textarea"
:maxlength="100000"
@keydown.enter="sendChatHandle($event)"
@paste="handlePaste"
@drop="handleDrop"
/>
<div class="operate flex-between">
<div>
<!-- <el-button
v-if="isUserInput || isAPIInput"
class="user-input-button mb-8"
type="primary"
text
@click="toggleUserInput"
>
<AppIcon iconName="app-user-input"></AppIcon>
</el-button> -->
</div>
<div>
<template v-if="props.applicationDetails.stt_model_enable"> <template v-if="props.applicationDetails.stt_model_enable">
<span v-if="mode === 'mobile'"> <span v-if="mode === 'mobile'">
<el-button text @click="switchMicrophone(!isMicrophone)"> <el-button text @click="switchMicrophone(!isMicrophone)">
@ -277,6 +290,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="text-center" v-if="applicationDetails.disclaimer" style="margin-top: 8px"> <div class="text-center" v-if="applicationDetails.disclaimer" style="margin-top: 8px">
<el-text type="info" v-if="applicationDetails.disclaimer" style="font-size: 12px"> <el-text type="info" v-if="applicationDetails.disclaimer" style="font-size: 12px">
<auto-tooltip :content="applicationDetails.disclaimer_value"> <auto-tooltip :content="applicationDetails.disclaimer_value">

View File

@ -74,21 +74,9 @@
v-if="type !== 'log'" v-if="type !== 'log'"
> >
<template #operateBefore> <template #operateBefore>
<div class="flex-between"> <slot name="operateBefore">
<slot name="operateBefore"> <span></span>
<span></span> </slot>
</slot>
<el-button
v-if="isUserInput || isAPIInput"
class="user-input-button mb-8"
type="primary"
text
@click="toggleUserInput"
>
<AppIcon iconName="app-user-input"></AppIcon>
</el-button>
</div>
</template> </template>
</ChatInputOperate> </ChatInputOperate>

View File

@ -26,9 +26,7 @@
<h4>{{ applicationDetail?.name }}</h4> <h4>{{ applicationDetail?.name }}</h4>
</div> </div>
<el-button class="add-button w-full primary" @click="newChat"> <el-button class="add-button w-full primary" @click="newChat">
<el-icon> <AppIcon iconName="app-create-chat"></AppIcon>
<Plus />
</el-icon>
<span class="ml-4">{{ $t('chat.createChat') }}</span> <span class="ml-4">{{ $t('chat.createChat') }}</span>
</el-button> </el-button>
<p class="mt-20 mb-8">{{ $t('chat.history') }}</p> <p class="mt-20 mb-8">{{ $t('chat.history') }}</p>
@ -420,7 +418,7 @@ onMounted(() => {
} }
.left-height { .left-height {
height: calc(100vh - var(--app-header-height) - 85px); height: calc(100vh - 140px);
} }
} }
@ -431,7 +429,7 @@ onMounted(() => {
box-sizing: border-box; box-sizing: border-box;
.right-height { .right-height {
height: calc(100vh - var(--app-header-height) * 2 - 24px); height: calc(100vh - 85px);
} }
} }
@ -489,7 +487,7 @@ onMounted(() => {
position: fixed; position: fixed;
width: 100%; width: 100%;
z-index: 99; z-index: 99;
height: calc(100vh - var(--app-header-height) + 6px); height: calc(100vh);
} }
} }
.collapse { .collapse {