|
@@ -35,10 +35,14 @@ const props = defineProps({
|
|
|
loadingText: {
|
|
|
type: String,
|
|
|
default: '内容生成中...'
|
|
|
+ },
|
|
|
+ isVisibleStopBtn: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const emit = defineEmits(['on-click-icon']);
|
|
|
+const emit = defineEmits(['on-click-icon', 'on-click-stop']);
|
|
|
|
|
|
const message = useMessage();
|
|
|
|
|
@@ -53,7 +57,11 @@ const handlLeToggleLike = async (state) => {
|
|
|
|
|
|
isSatisfied < 2 ? message.success('感谢您的反馈') : message.success('已取消反馈');
|
|
|
|
|
|
- emit('on-click-icon', params)
|
|
|
+ emit('on-click-icon', params);
|
|
|
+}
|
|
|
+
|
|
|
+const handleChatStop = () => {
|
|
|
+ emit('on-click-stop');
|
|
|
}
|
|
|
|
|
|
const handleCopy = () => {
|
|
@@ -72,21 +80,26 @@ const handleCopy = () => {
|
|
|
<ChatText :content="content"></ChatText>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<template #button>
|
|
|
- <ul class="answer-btn-group" v-if="!loading && toggleVisibleIcons">
|
|
|
- <li class="btn" @click="handleCopy">
|
|
|
- <SvgIcon name="chat-icon-copy" size="16" />
|
|
|
- </li>
|
|
|
- <li class="line"></li>
|
|
|
- <li :class="['btn', { btn_active: isSatisfied == 1 }]">
|
|
|
- <SvgIcon name="chat-icon-yes" size="16" @click="handlLeToggleLike(1)" />
|
|
|
- </li>
|
|
|
- <li class="line"></li>
|
|
|
- <li :class="['btn', { btn_active: isSatisfied == 0 }]">
|
|
|
- <SvgIcon name="chat-icon-no" size="16" @click="handlLeToggleLike(0)" />
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <div class="footer-wrap">
|
|
|
+ <div class="chat-stop-btn">
|
|
|
+ <span @click="handleChatStop" v-if="!delayLoading && loading && isVisibleStopBtn">停止生成</span>
|
|
|
+ </div>
|
|
|
+ <ul class="answer-btn-group" v-if="!loading && toggleVisibleIcons">
|
|
|
+ <li class="btn" @click="handleCopy">
|
|
|
+ <SvgIcon name="chat-icon-copy" size="16" />
|
|
|
+ </li>
|
|
|
+ <li class="line"></li>
|
|
|
+ <li :class="['btn', { btn_active: isSatisfied == 1 }]">
|
|
|
+ <SvgIcon name="chat-icon-yes" size="16" @click="handlLeToggleLike(1)" />
|
|
|
+ </li>
|
|
|
+ <li class="line"></li>
|
|
|
+ <li :class="['btn', { btn_active: isSatisfied == 0 }]">
|
|
|
+ <SvgIcon name="chat-icon-no" size="16" @click="handlLeToggleLike(0)" />
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
</ChatBaseCard>
|
|
@@ -118,34 +131,50 @@ const handleCopy = () => {
|
|
|
|
|
|
.answer-card {
|
|
|
@include flex(x, start, start);
|
|
|
- // padding: 20px 20px 4px 20px;
|
|
|
border-radius: 8px;
|
|
|
background: #fff;
|
|
|
}
|
|
|
|
|
|
- .answer-btn-group {
|
|
|
- @include flex(x, center, end);
|
|
|
- padding-top: 6px;
|
|
|
+ .footer-wrap {
|
|
|
+ @include flex(x, cetner, between);
|
|
|
+ padding: 6px 0 0 5px;
|
|
|
+ color: #2454FF;
|
|
|
+
|
|
|
+ .chat-stop-btn {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 34px;
|
|
|
+ span {
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ color: #1D43CC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .answer-btn-group {
|
|
|
+ @include flex(x, center, end);
|
|
|
|
|
|
- .btn {
|
|
|
- @include flex(x, center, center);
|
|
|
- @include layout(28px, 28px, 4px);
|
|
|
- color: #89909B;
|
|
|
- cursor: pointer;
|
|
|
+ .btn {
|
|
|
+ @include flex(x, center, center);
|
|
|
+ @include layout(28px, 28px, 4px);
|
|
|
+ color: #89909B;
|
|
|
+ cursor: pointer;
|
|
|
|
|
|
- &:hover,
|
|
|
- &_active {
|
|
|
- background: #DBEFFF;
|
|
|
- color: #2454FF;
|
|
|
- }
|
|
|
+ &:hover,
|
|
|
+ &_active {
|
|
|
+ background: #DBEFFF;
|
|
|
+ color: #2454FF;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- .line {
|
|
|
- @include layout(1px, 12px, 0);
|
|
|
- margin: 0 5px;
|
|
|
- background: #D3D0E1;
|
|
|
+ .line {
|
|
|
+ @include layout(1px, 12px, 0);
|
|
|
+ margin: 0 5px;
|
|
|
+ background: #D3D0E1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
</style>
|