feat: 聊天室操作完成

main
许宏杰 1 month ago
parent a916fe01d6
commit 7492ddbaf7

@ -215,19 +215,21 @@ const handleSend = async () => {
//
updataMessageItem({
from: 'ai',
text: '',
text: res.data,
time: moment().format('YYYY/MM/DD HH:mm:ss'),
loading: false, //ai
chartInstanceItem: null,
chartInstanceActiveIndex: 0,
type: res.type,
xData: [],
data: [],
xData: res.xData,
data: res.data,
title: res.title,
unit: res.unit
})
nextTick(() => {
const itemData = messageList[lastIndex.value]
//
if (res.type === 'pie') {
@ -250,16 +252,6 @@ const handleSend = async () => {
xData: res.xData,
data: res.data
})
} else {
//
updataMessageItem({
from: 'ai',
title: res.title,
type: res.type,
text: res.data,
time: moment().format('YYYY/MM/DD HH:mm:ss'),
loading: false
})
}
})
} catch {
@ -290,14 +282,14 @@ const initEcharts = (item, index) => {
title: item.title,
unit: item.unit,
xData: item.xData,
data: item.yData
data: item.data
})
} else if (item.type === 'line') {
item.chartInstanceItem = new LineChart(`${item.type}${index}`, {
title: item.title,
unit: item.unit,
xData: item.xData,
data: item.yData
data: item.data
})
}
})

@ -66,7 +66,7 @@ const saveMessage = async path => {
let res
try {
if (useMessageRoom.messageRoom.id) {
res = await historyMessageRoomUpdata({ content: jsonData, createUserId: useMessageRoom.messageRoom.id })
res = await historyMessageRoomUpdata({ content: jsonData, id: useMessageRoom.messageRoom.id })
} else {
res = await historyMessageRoom({ content: jsonData, createUserId: systemStore.userInfo.userId || 1 })
}

Loading…
Cancel
Save