Skip to content

Commit 65f4677

Browse files
committed
feat: bot compare
1 parent f3ed26f commit 65f4677

File tree

4 files changed

+44
-28
lines changed

4 files changed

+44
-28
lines changed

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ declare module 'vue' {
1919
ElSelect: typeof import('element-plus/es')['ElSelect']
2020
ElTabPane: typeof import('element-plus/es')['ElTabPane']
2121
ElTabs: typeof import('element-plus/es')['ElTabs']
22+
ElTooltip: typeof import('element-plus/es')['ElTooltip']
2223
Footer: typeof import('./src/components/Footer/index.vue')['default']
2324
Header: typeof import('./src/components/Header/index.vue')['default']
2425
Message: typeof import('./src/components/Message/index.vue')['default']

src/components/Bot/BotBattle.vue

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { ref, created, onMounted, computed } from "vue"
33
import { Refresh, CircleClose, Delete } from "@element-plus/icons-vue"
4+
import { ThumbsUp, CloseOne } from "@icon-park/vue-next"
45
import { fetchBotList, fetchChatAPIProcess } from "@/api"
56
import Compare from "@/components/Bot/Compare.vue"
67
import MessageBox from "@/components/Bot/MessageBox.vue"
@@ -273,27 +274,39 @@ onMounted(() => {
273274
<el-button class="!ml-0" @click="handleShowName" type="primary">Tie</el-button>
274275
<el-button class="!ml-0" @click="handleShowName" type="primary">Both are bad</el-button>
275276
</div>
276-
<div class="mt-8 flex items-center justify-between space-x-2">
277-
<el-button size="large" circle :icon="CircleClose" :disabled="!loading" @click="handleStop">
278-
</el-button>
279-
<el-button
280-
size="large"
281-
circle
282-
:icon="Refresh"
283-
:disabled="loading"
284-
@click="handleRegenerate"
285-
></el-button>
286-
<el-button
287-
size="large"
288-
type="danger"
289-
circle
290-
class=""
291-
:icon="Delete"
292-
:disabled="loading"
293-
@click="handleDelete"
294-
></el-button>
277+
<div class="mt-8 flex items-center justify-between space-x-4">
278+
<el-tooltip effect="dark" content="停止生成" placement="top">
279+
<el-button size="large" circle :icon="CloseOne" :disabled="!loading" @click="handleStop">
280+
</el-button>
281+
</el-tooltip>
295282

296-
<el-input size="large" v-model="prompt" placeholder="" @keypress="handleEnter" />
283+
<el-tooltip effect="dark" content="重新生成" placement="top">
284+
<el-button
285+
size="large"
286+
circle
287+
:icon="Refresh"
288+
:disabled="loading"
289+
@click="handleRegenerate"
290+
></el-button>
291+
</el-tooltip>
292+
<el-tooltip effect="dark" content="清除历史记录" placement="top">
293+
<el-button
294+
size="large"
295+
type="danger"
296+
circle
297+
:icon="Delete"
298+
:disabled="loading"
299+
@click="handleDelete"
300+
></el-button>
301+
</el-tooltip>
302+
303+
<el-input
304+
class="my-box"
305+
size="large"
306+
v-model="prompt"
307+
placeholder=""
308+
@keypress="handleEnter"
309+
/>
297310
<el-button
298311
size="large"
299312
class="ml-4"
@@ -306,8 +319,14 @@ onMounted(() => {
306319
</div>
307320
</template>
308321

309-
<style scoped>
322+
<style>
310323
.my-box {
311324
box-shadow: 0 0 2px #919eab33, 0 4px 24px #919eab24;
312325
}
326+
.el-input__wrapper {
327+
/* box-shadow: 0 0 2px #dcdfe6, 0 2px 6px #dcdfe6; */
328+
}
329+
.el-input__wrapper:hover {
330+
/* box-shadow: 0 0 2px #dcdfe6, 0 2px 6px #dcdfe6; */
331+
}
313332
</style>

src/components/Bot/MessageBox.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
3737
</div>
3838
</template>
3939

40-
<style>
41-
.el-tabs__item.is-active {
42-
/* color: black; */
43-
}
44-
.el-tabs__item {
45-
/* color: rgba(0, 0, 0, 0.6); */
40+
<style scoped>
41+
.my-box {
42+
box-shadow: 0 0 2px #919eab33, 0 4px 24px #919eab24;
4643
}
4744
</style>

src/views/Evaluate.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { ref } from "vue"
33
import type { TabsPaneContext } from "element-plus"
44
import Battle from "./Battle.vue"
5-
import Side from "./Side.vue"
65
import BotBattle from "@/components/Bot/BotBattle.vue"
76
87
defineProps<{ msg: string }>()

0 commit comments

Comments
 (0)