|
|
|
@ -129,12 +129,16 @@ async function handleSubMenuChange(index: number, item?: SubMenuItem) {
|
|
|
|
|
historyMessageParams.value.total = 0 |
|
|
|
|
messageStore.setConversationData(subMenuList.value[subMenuActiveIndex.value]) |
|
|
|
|
messageStore.setMessageClear() |
|
|
|
|
const modelIdx = modelOptions.findIndex(v => v.value === Number(subMenuList.value[subMenuActiveIndex.value].modelType)) |
|
|
|
|
if (subMenuActiveIndex.value !== -1) { |
|
|
|
|
const modelIdx = modelOptions.findIndex((v) => { |
|
|
|
|
return v.value === Number(subMenuList.value[subMenuActiveIndex.value].modelType) |
|
|
|
|
}) |
|
|
|
|
if (modelIdx === -1) { |
|
|
|
|
message.warn('未找到该对话下的模型信息') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
modelIndex.value = modelIdx |
|
|
|
|
} |
|
|
|
|
useMqtt().end() |
|
|
|
|
useMqtt().connect() |
|
|
|
|
|
|
|
|
@ -324,9 +328,9 @@ async function handleRole(item: RoleData) {
|
|
|
|
|
* @description: 选择应用 |
|
|
|
|
*/ |
|
|
|
|
async function handleApply(item: RoleInfoAppModel) { |
|
|
|
|
const obj = subMenuList.value.find(v => v.roleId === item.id) |
|
|
|
|
const obj = subMenuList.value.find(v => String(v.roleId) === item.id) |
|
|
|
|
if (obj) { |
|
|
|
|
const index = subMenuList.value.findIndex(v => v.roleId === item.id) |
|
|
|
|
const index = subMenuList.value.findIndex(v => String(v.roleId) === item.id) |
|
|
|
|
await handleSubMenuChange(index) |
|
|
|
|
getHistoryMessage() |
|
|
|
|
} |
|
|
|
@ -334,13 +338,13 @@ async function handleApply(item: RoleInfoAppModel) {
|
|
|
|
|
await addMessage({ |
|
|
|
|
type: MenuTypeEnum.ROLE, |
|
|
|
|
title: item.roleName, |
|
|
|
|
roleId: String(item.id), |
|
|
|
|
roleId: item.id, |
|
|
|
|
sort: subMenuList.value.length + 1, |
|
|
|
|
modelType: item.modelType ? item.modelType : ModelTypeEnum.GPT3, |
|
|
|
|
}) |
|
|
|
|
await getConversationList() |
|
|
|
|
await nextTick() |
|
|
|
|
const index = subMenuList.value.findIndex(v => v.roleId === item.id) |
|
|
|
|
const index = subMenuList.value.findIndex(v => String(v.roleId) === item.id) |
|
|
|
|
subMenuActiveIndex.value = index |
|
|
|
|
await handleSubMenuChange(index) |
|
|
|
|
getHistoryMessage() |
|
|
|
|