add break line and stop generate

This commit is contained in:
AceDataCloud committed 2023-04-11 23:18:29 +08:00
1 parent 62ec02e6c9
commit 5400cc08de
9 files changed
+72 -23

No files matched your search

+9
View File
@@ -8,6 +8,10 @@
<font-awesome-icon icon="fa-regular fa-copy" class="icon-copy" />
{{ $t('common.button.copy') }}
</el-button>
<el-button v-if="author.type === 'bot' && content.value" class="operation" size="small" @click="onStop">
<font-awesome-icon icon="fa-regular fa-copy" class="icon-stop" />
{{ $t('common.button.stop') }}
</el-button>
</div>
</template>
@@ -56,6 +60,7 @@ export default defineComponent({
}
}
},
emits: ['stop'],
data(): IData {
return {
copied: false
@@ -75,6 +80,9 @@ export default defineComponent({
setTimeout(() => {
this.copied = false;
}, 3000);
},
onStop() {
this.$emit('stop');
}
}
});
@@ -99,6 +107,7 @@ export default defineComponent({
.operations {
width: fit-content;
margin: auto;
padding-top: 15px;
.fa-copy {
margin-right: 5px;
}
+26 -9
View File
@@ -2,16 +2,19 @@
<div class="new-message-box">
<el-input
v-model="value"
type="textarea"
resize="none"
:disabled="!application || answering"
class="new-message-input"
:placeholder="$t('conversation.message.newMessagePlaceholder')"
@keyup.enter="$emit('send')"
@keydown.enter.exact.prevent="$emit('send')"
>
<template #suffix>
<voice-recognition v-if="false" class="mr-1" @finished="value = $event" />
<font-awesome-icon icon="fa-regular fa-paper-plane" class="icon-send" @click="$emit('send')" />
</template>
</el-input>
<span class="new-message-info-input">{{ $t('conversation.message.howToBreakLine') }}</span>
<div class="new-message-operations">
<voice-recognition v-if="false" class="mr-1" @finished="value = $event" />
<font-awesome-icon icon="fa-regular fa-paper-plane" class="icon-send" @click="$emit('send')" />
</div>
<div v-if="!application" class="new-message-apply">
<div v-if="!initializing">
<span class="mr-2">{{ $t('conversation.message.apiInfo') }}</span>
@@ -38,7 +41,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { ElInput, ElButton } from 'element-plus';
import { ElInput, ElButton, ElText } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { IApi, IApplication } from '@/operators';
import { IApplicationType } from '@/operators';
@@ -114,12 +117,26 @@ export default defineComponent({
<style lang="scss" scoped>
.new-message-box {
position: relative;
margin-bottom: 30px;
margin-bottom: 40px;
.new-message-input {
height: 50px;
}
.icon-send {
cursor: pointer;
.new-message-operations {
position: absolute;
bottom: 12px;
right: 10px;
color: var(--el-text-color-regular);
.icon-send {
cursor: pointer;
}
}
.new-message-info-input {
position: absolute;
bottom: -25px;
left: 5px;
font-size: 12px;
color: var(--el-text-color-regular);
}
.new-message-apply {