Skip to content

Commit 5930307

Browse files
committed
1
1 parent 65f4677 commit 5930307

File tree

8 files changed

+83
-43
lines changed

8 files changed

+83
-43
lines changed

src/assets/ChatGPT.png

31 KB
Loading

src/assets/t5.png

362 KB
Loading

src/components/Bot/BotBattle.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +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"
4+
import { ThumbsUp, CloseOne, CommentOne, Comments } from "@icon-park/vue-next"
55
import { fetchBotList, fetchChatAPIProcess } from "@/api"
66
import Compare from "@/components/Bot/Compare.vue"
77
import MessageBox from "@/components/Bot/MessageBox.vue"
@@ -27,6 +27,7 @@ const prompt = ref<string>("")
2727
const botList = ref<any>([])
2828
const showName = ref<boolean>(false)
2929
const showBtn = ref<boolean>(false)
30+
const isContext = ref<boolean>(false)
3031
3132
let controllerList = []
3233
let prePrompt = ""
@@ -292,13 +293,35 @@ onMounted(() => {
292293
<el-tooltip effect="dark" content="清除历史记录" placement="top">
293294
<el-button
294295
size="large"
295-
type="danger"
296296
circle
297297
:icon="Delete"
298298
:disabled="loading"
299299
@click="handleDelete"
300300
></el-button>
301301
</el-tooltip>
302+
<el-tooltip
303+
v-if="isContext"
304+
effect="dark"
305+
content="当前是多轮对话,点击切换单轮对话"
306+
placement="top"
307+
>
308+
<el-button
309+
size="large"
310+
circle
311+
:icon="Comments"
312+
:disabled="loading"
313+
@click="isContext = !isContext"
314+
></el-button>
315+
</el-tooltip>
316+
<el-tooltip v-else effect="dark" content="当前是单轮对话,点击切换多轮对话" placement="top">
317+
<el-button
318+
size="large"
319+
circle
320+
:icon="CommentOne"
321+
:disabled="loading"
322+
@click="isContext = !isContext"
323+
></el-button>
324+
</el-tooltip>
302325

303326
<el-input
304327
class="my-box"
@@ -329,4 +352,7 @@ onMounted(() => {
329352
.el-input__wrapper:hover {
330353
/* box-shadow: 0 0 2px #dcdfe6, 0 2px 6px #dcdfe6; */
331354
}
355+
.el-icon {
356+
font-size: 18px;
357+
}
332358
</style>

src/components/Bot/Compare.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { valueEquals } from 'element-plus'; import { log } from 'console';
22
<script setup lang="ts">
3-
import { ref, computed, nextTick } from "vue"
3+
import { ref, computed, onUnmounted } from "vue"
44
import { useCompareStore, useChatStore } from "@/store"
55
import { onClickOutside } from "@vueuse/core"
6+
import { useRoute } from "vue-router"
67
78
const compareStore = useCompareStore()
89
const chatStore = useChatStore()
910
const compareList = computed(() => compareStore.CompareList)
1011
1112
const inputref = ref()
12-
const activeName = ref("first")
1313
const isSearch = ref(false)
14-
const allList = ref(["ChatGPT-3.5", "ChatGPT-4", "vicuna-7b-v1.5", "chatGLM"])
15-
const searchList2 = ref(["ChatGPT-3.5", "ChatGPT-4", "vicuna-7b-v1.5", "chatGLM"])
14+
const allList = ref(["ChatGPT-3.5", "T5-3b", "vicuna-7b-v1.5", "chatGLM"])
15+
const searchList2 = ref(["ChatGPT-3.5", "T5-3b", "vicuna-7b-v1.5", "chatGLM"])
1616
1717
const target = ref(null)
1818
onClickOutside(target, (event) => (isSearch.value = false))
@@ -31,6 +31,16 @@ const deleteCompare = (name) => {
3131
compareStore.deleteCompareItem({ name })
3232
chatStore.deleteSources(name)
3333
}
34+
35+
const route = useRoute()
36+
addCompare(route?.query.name || "ChatGPT")
37+
38+
onUnmounted(() => {
39+
compareStore.clearCompareList()
40+
// compareList.value.forEach((item) => {
41+
// deleteCompare(item.name)
42+
// })
43+
})
3444
</script>
3545

3646
<template>

src/store/modules/compare/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface CompareStore {
77
export const useCompareStore = defineStore("compare-store", {
88
state: () => {
99
return {
10-
CompareList: [{ name: "ChatGPT-3.5" }],
10+
CompareList: [],
1111
}
1212
},
1313

@@ -27,5 +27,8 @@ export const useCompareStore = defineStore("compare-store", {
2727
getCompareList() {
2828
return this.$state.CompareList
2929
},
30+
clearCompareList() {
31+
this.CompareList = []
32+
},
3033
},
3134
})

src/views/Evaluate.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { ref } from "vue"
33
import type { TabsPaneContext } from "element-plus"
44
import Battle from "./Battle.vue"
55
import BotBattle from "@/components/Bot/BotBattle.vue"
6+
import { useRoute } from "vue-router"
67
8+
const route = useRoute()
9+
console.log(route.query.name)
710
defineProps<{ msg: string }>()
811
912
const activeName = ref("first")

src/views/Model.vue

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ import { ref } from "vue"
33
import Header from "@/components/Header/index.vue"
44
import Footer from "@/components/Footer/index.vue"
55
import { useRouter } from "vue-router"
6+
import ChatGPT from "@/assets/ChatGPT.png"
7+
import T5 from "@/assets/t5.png"
68
79
const router = useRouter()
810
const input = ref("")
9-
const imgList = ref<any>(["图像识别", "语音识别", "自然语言处理", "推荐系统", "人脸识别"])
10-
const activeName = ref("图像识别")
11+
const imgList = ref<any>(["基础大模型", "行业大模型", "领域大模型"])
12+
const modelList = ref<any>(["ChatGPT", "T5-3b", "ChatGLM", "Other", "Other", "Other"])
13+
const activeName = ref("基础大模型")
1114
const img2List = ref<any>([
12-
"https://img.jsdesign2.com/assets/img/6455ebf47e26e5aacb2ab830.png#2310fb77ad1762404ab25101fd5ce24b",
15+
ChatGPT,
16+
T5,
1317
"https://img.jsdesign2.com/assets/img/6475a9536be6533b8a7441f0.png#ebade77ad960ea0306274202cbfdb640",
1418
"https://img.jsdesign2.com/assets/img/652ca2e6454393a7d697adb0.png#c349e97700e81fe55284332a6d77cd93",
19+
"https://img.jsdesign2.com/assets/img/652ca2e6454393a7d697adb0.png#c349e97700e81fe55284332a6d77cd93",
20+
"https://img.jsdesign2.com/assets/img/652ca2e6454393a7d697adb0.png#c349e97700e81fe55284332a6d77cd93",
1521
])
1622
</script>
1723

@@ -48,37 +54,18 @@ const img2List = ref<any>([
4854
<div class="flex-1 ml-10 grid grid-cols-3 gap-6">
4955
<div
5056
class="py-2 items-center cursor-pointer"
51-
@click="router.push('/modelDetail')"
52-
v-for="item in img2List"
57+
@click="
58+
router.push({
59+
path: '/modelDetail',
60+
query: {
61+
name: modelList[index],
62+
},
63+
})
64+
"
65+
v-for="(item, index) in img2List"
5366
>
5467
<div class="rounded-xl overflow-hidden"><img :src="item" /></div>
55-
<div class="mt-3 font-bold">智能助手</div>
56-
<div class="mt-2 text-sm text-ellipsis whitespace-nowrap overflow-hidden">
57-
人工智能助手可以帮助您完成各种任务,提高工作效率
58-
</div>
59-
<div class="mt-2 text-sm flex">
60-
<img
61-
class="w-5 h-5 mr-2"
62-
src="https://img.jsdesign2.com/assets/element/ai_AheJcMcjCpO/image/c55515821e36c495c64b891645a48b0039c951d6.png"
63-
/>
64-
<img
65-
class="w-5 h-5 mr-2"
66-
src="https://img.jsdesign2.com/assets/element/ai_AheJcMcjCpO/image/c55515821e36c495c64b891645a48b0039c951d6.png"
67-
/>
68-
<img
69-
class="w-5 h-5 mr-2"
70-
src="https://img.jsdesign2.com/assets/element/ai_AheJcMcjCpO/image/c55515821e36c495c64b891645a48b0039c951d6.png"
71-
/>
72-
<img
73-
class="w-5 h-5 mr-2"
74-
src="https://img.jsdesign2.com/assets/element/ai_AheJcMcjCpO/image/c55515821e36c495c64b891645a48b0039c951d6.png"
75-
/>
76-
<div class="ml-4">4星</div>
77-
</div>
78-
</div>
79-
<div class="py-2 items-center cursor-pointer" v-for="item in img2List">
80-
<div class="rounded-xl overflow-hidden"><img :src="item" /></div>
81-
<div class="mt-3 font-bold">智能助手</div>
68+
<div class="mt-3 font-bold">{{ modelList[index] }}</div>
8269
<div class="mt-2 text-sm text-ellipsis whitespace-nowrap overflow-hidden">
8370
人工智能助手可以帮助您完成各种任务,提高工作效率
8471
</div>

src/views/ModelDetail.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<script setup lang="ts">
22
import { ref } from "vue"
33
import { ThumbsUp } from "@icon-park/vue-next"
4-
import { useRouter } from "vue-router"
4+
import { useRoute, useRouter } from "vue-router"
55
import Header from "@/components/Header/index.vue"
66
import Footer from "@/components/Footer/index.vue"
77
8+
const route = useRoute()
89
const router = useRouter()
10+
911
const activeName = ref("first")
1012
const input = ref("")
13+
console.log(route.query.name)
14+
const model = route.query?.name || "ChatGPT"
1115
</script>
1216

1317
<template>
@@ -17,7 +21,7 @@ const input = ref("")
1721
<div class="flex">
1822
<div class="mt-40 flex-1">
1923
<div class="h-30">
20-
<div class="text-4xl font-bold mb-10">AI模型详情</div>
24+
<div class="text-4xl font-bold mb-10">{{ model }}</div>
2125
<div>
2226
这是一个AI模型点评页面,提供模型介绍、参数、相关产品、用户评价和模型试用等功能模块。
2327
</div>
@@ -81,9 +85,16 @@ const input = ref("")
8185
</div>
8286
<div
8387
class="bg-[#333] rounded-md w-full mt-10 py-2 text-[#fff] text-center cursor-pointer"
84-
@click="router.push('/evaluate')"
88+
@click="
89+
router.push({
90+
path: '/evaluate',
91+
query: {
92+
name: model,
93+
},
94+
})
95+
"
8596
>
86-
申请试用
97+
立即试用
8798
</div>
8899
</div>
89100
</div>

0 commit comments

Comments
 (0)