|
|
|
@ -12,6 +12,8 @@ import type { SubMenuItem } from '@/components/AppSubMenuList/index.d'
|
|
|
|
|
|
|
|
|
|
import { AppTextarea } from '@/components/AppTextarea' |
|
|
|
|
import { AppMessage } from '@/components/AppMessage' |
|
|
|
|
import { AppModelSelect } from '@/components/AppModelSelect' |
|
|
|
|
import type { ModelSelect } from '@/components/AppModelSelect/index.d' |
|
|
|
|
import type { MessageItem } from '@/components/AppMessage/index.d' |
|
|
|
|
import type { TopPickItem } from '@/components/AppTopPicks/index.d' |
|
|
|
|
import { useMessageStore } from '@/store/moules/messageStore/index' |
|
|
|
@ -60,6 +62,14 @@ const topPickList = ref([
|
|
|
|
|
}, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
const modelOptions: ModelSelect[] = [ |
|
|
|
|
{ |
|
|
|
|
label: 'DALL-E 3', |
|
|
|
|
value: ModelTypeEnum.DALL_E3, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
const modelIndex = ref(0) |
|
|
|
|
|
|
|
|
|
const conversationDefaultShow = ref(false) |
|
|
|
|
const appMessageShow = ref(true) |
|
|
|
|
const spinning = ref(true) |
|
|
|
@ -150,7 +160,7 @@ async function handleSend(value: string) {
|
|
|
|
|
try { |
|
|
|
|
spinning.value = true |
|
|
|
|
messageStore.setMessageClear() |
|
|
|
|
await addMessage({ type: MenuTypeEnum.TEXT_TO_IMAGE, title: '新的对话', sort: subMenuList.value.length + 1, modelType: ModelTypeEnum.DALL_E3 }) |
|
|
|
|
await addMessage({ type: MenuTypeEnum.TEXT_TO_IMAGE, title: '新的对话', sort: subMenuList.value.length + 1, modelType: modelOptions[modelIndex.value].value }) |
|
|
|
|
await nextTick() |
|
|
|
|
await getConversationList() |
|
|
|
|
subMenuActiveIndex.value = subMenuList.value.length - 1 |
|
|
|
@ -304,6 +314,13 @@ function handlePick(_index: number, item: TopPickItem) {
|
|
|
|
|
handleSend(item.label) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: gpt模型切换 |
|
|
|
|
*/ |
|
|
|
|
function handleModel(index: number) { |
|
|
|
|
modelIndex.value = index |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 下面是子菜单操作项 |
|
|
|
|
function handleSubMenuInputAffirm(index: number, item: SubMenuItem, inputValue: string) { |
|
|
|
|
updateMessage({ ...item, title: inputValue }).then(() => { |
|
|
|
@ -366,6 +383,14 @@ onUnmounted(() => {
|
|
|
|
|
</template> |
|
|
|
|
<template #content> |
|
|
|
|
<Spin :spinning="spinning" wrapper-class-name="app-content-spin"> |
|
|
|
|
<AppModelSelect |
|
|
|
|
v-if="conversationDefaultShow" |
|
|
|
|
:active-index="modelIndex" |
|
|
|
|
:options="modelOptions" |
|
|
|
|
@change="handleModel" |
|
|
|
|
> |
|
|
|
|
</AppModelSelect> |
|
|
|
|
|
|
|
|
|
<!-- 默认导语 --> |
|
|
|
|
<AppConversationDefault |
|
|
|
|
v-if="conversationDefaultShow" |
|
|
|
|