|
@@ -180,6 +180,8 @@ function handleScroll({ scrollTop }) {
|
|
|
* @param {string} type 发送的类型 document 、text
|
|
|
* **/
|
|
|
async function addMessage(msg, raw, type) {
|
|
|
+ console.log(msg);
|
|
|
+
|
|
|
// 添加indexDB Store配置
|
|
|
if (msgUuid.value === '') {
|
|
|
msgUuid.value = 'D' + Date.now().toString()
|
|
@@ -341,14 +343,14 @@ async function handleAsk() {
|
|
|
const str = inputMessage.value.trim()
|
|
|
inputMessage.value = ''
|
|
|
if (sendLoading.value) return
|
|
|
- addMessage(inputMessage.value.trim())
|
|
|
+ addMessage(str)
|
|
|
if (type.value === FunctionList.Intelligent_Form_filling) {
|
|
|
const res = await fetchRes(str)
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.status === 'ok') {
|
|
|
formInfo.value = res.data
|
|
|
- console.log(res)
|
|
|
+ console.log(res,55558)
|
|
|
} else {
|
|
|
type.value = FunctionList.File_Operation
|
|
|
isShowPage.value = false
|
|
@@ -406,7 +408,12 @@ const handleUpload = async (file) => {
|
|
|
const res2 = await getFormKeyAndValue(data, formInfo.value)
|
|
|
xlsxData.value = res2.data
|
|
|
msg.rawContent = buildObjPrompt(res2.data, formInfo.value)
|
|
|
- const { rawContent,status } = await streamRes()
|
|
|
+ console.log(msg.rawContent);
|
|
|
+ console.log(messages);
|
|
|
+
|
|
|
+ const { rawContent, status } = await streamRes()
|
|
|
+ console.log(22555);
|
|
|
+
|
|
|
if (status === 'ok') {
|
|
|
let form = []
|
|
|
if (rawContent.includes('json')) form = JSON.parse(rawContent.split('json')[1].split('```')[0])
|
|
@@ -442,13 +449,19 @@ const handleUpload = async (file) => {
|
|
|
}
|
|
|
|
|
|
async function getFileValue(file) {
|
|
|
- const msg = addMessage(`文件上传中`)
|
|
|
+ const msg = await addMessage(`文件上传中`)
|
|
|
+ console.log(msg,messages);
|
|
|
+
|
|
|
sendLoading.value = true
|
|
|
let formData = new FormData()
|
|
|
formData.append('file', file)
|
|
|
const res = await getFileContent(formData)
|
|
|
+ console.log(res,5555);
|
|
|
+
|
|
|
sendLoading.value = false
|
|
|
msg.content = `已上传文件:${file.name}`
|
|
|
+ console.log(msg.content);
|
|
|
+
|
|
|
msg.rawContent = res.data
|
|
|
return {
|
|
|
data: res.data,
|