|
|
|
@ -308,17 +308,24 @@ async function handleRole(item: RoleData) {
|
|
|
|
|
getHistoryMessage() |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
await addMessage({ |
|
|
|
|
const conversationId = await addMessage({ |
|
|
|
|
type: MenuTypeEnum.ROLE, |
|
|
|
|
title: item.roleName, |
|
|
|
|
roleId: item.id, |
|
|
|
|
sort: subMenuList.value.length + 1, |
|
|
|
|
modelType: item.modelType ? item.modelType : ModelTypeEnum.GPT3, |
|
|
|
|
contextCount: item.contextCount, |
|
|
|
|
}) |
|
|
|
|
await getConversationList() |
|
|
|
|
await nextTick() |
|
|
|
|
const index = subMenuList.value.findIndex(v => String(v.roleId) === item.id) |
|
|
|
|
subMenuActiveIndex.value = index |
|
|
|
|
if (index === -1) { |
|
|
|
|
subMenuActiveIndex.value = subMenuList.value.findIndex(v => v.id === conversationId) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
subMenuActiveIndex.value = index |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await handleSubMenuChange(index) |
|
|
|
|
getHistoryMessage() |
|
|
|
|
} |
|
|
|
@ -335,17 +342,23 @@ async function handleApply(item: RoleInfoAppModel) {
|
|
|
|
|
getHistoryMessage() |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
await addMessage({ |
|
|
|
|
const conversationId = await addMessage({ |
|
|
|
|
type: MenuTypeEnum.ROLE, |
|
|
|
|
title: item.roleName, |
|
|
|
|
roleId: item.id, |
|
|
|
|
sort: subMenuList.value.length + 1, |
|
|
|
|
modelType: item.modelType ? item.modelType : ModelTypeEnum.GPT3, |
|
|
|
|
contextCount: item.contextCount, |
|
|
|
|
}) |
|
|
|
|
await getConversationList() |
|
|
|
|
await nextTick() |
|
|
|
|
const index = subMenuList.value.findIndex(v => String(v.roleId) === item.id) |
|
|
|
|
subMenuActiveIndex.value = index |
|
|
|
|
if (index === -1) { |
|
|
|
|
subMenuActiveIndex.value = subMenuList.value.findIndex(v => v.id === conversationId) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
subMenuActiveIndex.value = index |
|
|
|
|
} |
|
|
|
|
await handleSubMenuChange(index) |
|
|
|
|
getHistoryMessage() |
|
|
|
|
} |
|
|
|
|