|
@@ -47,8 +47,7 @@
|
|
|
<ScrollToBottom :target="scrollbar" ref="scrollToBottomRef" />
|
|
|
</div>
|
|
|
|
|
|
- <Tools :upload="type === FunctionList.File_Operation || !!formInfo" @read-click="readClick"
|
|
|
- @upload-file="(file) => createFileObj(file)" @handle-capture="handleCapture" @his-records="hisRecords"
|
|
|
+ <Tools :disHistory="sendLoading" :upload="type === FunctionList.File_Operation || !!formInfo" @read-click="readClick" @upload-file="(file) => createFileObj(file)" @handle-capture="handleCapture" @his-records="hisRecords"
|
|
|
@add-new-dialogue="addNewDialogue" @handle-current-change="handleCurrentChange"
|
|
|
@handel-intelligent-filling-click="handelIntelligentFillingClick" />
|
|
|
|
|
@@ -189,14 +188,15 @@ const inputMessage = ref('')
|
|
|
const pageInfo = ref('')
|
|
|
const summaryHtml = ref(false)
|
|
|
function handleStopAsk() {
|
|
|
- inputMessage.value = ''
|
|
|
- pageInfoList.value = []
|
|
|
- isShowPage.value = false
|
|
|
- taklToHtml.value = false
|
|
|
- type.value = FunctionList.File_Operation
|
|
|
- controllerList.value[0].abort()
|
|
|
+ inputMessage.value = ''
|
|
|
+ pageInfoList.value = []
|
|
|
+ isShowPage.value = false
|
|
|
+ taklToHtml.value = false
|
|
|
+ type.value = FunctionList.File_Operation
|
|
|
+ controllerList.value[0]?.abort()
|
|
|
controllerList.value = []
|
|
|
sendLoading.value = false
|
|
|
+ formInfo.value = null
|
|
|
}
|
|
|
|
|
|
function handleScroll(a) {
|
|
@@ -363,8 +363,11 @@ async function handleCurrentData(e) {
|
|
|
let SystemMsg = null
|
|
|
|
|
|
watchEffect(() => {
|
|
|
+ console.log(isShowPage.value);
|
|
|
+
|
|
|
if (!isShowPage.value) {
|
|
|
summaryHtml.value = false
|
|
|
+
|
|
|
type.value = FunctionList.File_Operation
|
|
|
SystemMsg = null
|
|
|
inputMessage.value = ''
|
|
@@ -401,10 +404,16 @@ async function readClick() {
|
|
|
function deletePageInfo(i) {
|
|
|
pageInfoList.value.splice(i, 1)
|
|
|
if (pageInfoList.value.length === 0) {
|
|
|
- isShowPage.value = false
|
|
|
- taklToHtml.value = false
|
|
|
- if (type.value === FunctionList.Intelligent_Form_filling) inputMessage.value = ''
|
|
|
- type.value = FunctionList.File_Operation
|
|
|
+ if (type.value === FunctionList.Intelligent_Form_filling) {
|
|
|
+ inputMessage.value = ''
|
|
|
+ SystemMsg.content = '智能填表流程中断'
|
|
|
+ SystemMsg.rawContent = '智能填表流程中断'
|
|
|
+ putChat({
|
|
|
+ ...SystemMsg,
|
|
|
+ content: '',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleStopAsk()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -429,9 +438,16 @@ const disabledBtn = computed(() => {
|
|
|
})
|
|
|
function closePageInfo() {
|
|
|
pageInfoList.value = []
|
|
|
- type.value = FunctionList.File_Operation
|
|
|
- isShowPage.value = false
|
|
|
- formInfo.value = null
|
|
|
+ if (type.value === FunctionList.Intelligent_Form_filling && SystemMsg ) {
|
|
|
+ SystemMsg.content = '智能填表流程中断'
|
|
|
+ SystemMsg.rawContent = '智能填表流程中断'
|
|
|
+ putChat({
|
|
|
+ ...SystemMsg,
|
|
|
+ content: '',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleStopAsk()
|
|
|
+
|
|
|
}
|
|
|
async function handleAsk(value) {
|
|
|
if (sendLoading.value) return
|
|
@@ -443,11 +459,11 @@ async function handleAsk(value) {
|
|
|
const [res, obj] = await fetchRes(str)
|
|
|
if (res.status === 'ok') {
|
|
|
console.log(obj);
|
|
|
-
|
|
|
formInfo.value = res.data
|
|
|
SystemMsg = obj
|
|
|
} else {
|
|
|
type.value = FunctionList.File_Operation
|
|
|
+ isShowPage.value = false
|
|
|
}
|
|
|
return
|
|
|
}
|
|
@@ -480,23 +496,25 @@ async function createWS(msg) {
|
|
|
conversationId: msgUuid.value,
|
|
|
})
|
|
|
try {
|
|
|
- messages.value.push(obj)
|
|
|
- nextTick(() => {
|
|
|
- if (scrollbar.value && scrollbar.value.wrapRef) {
|
|
|
- scrollbar.value.setScrollTop(scrollbar.value.wrapRef.scrollHeight)
|
|
|
- }
|
|
|
- })
|
|
|
- const wsUrl = `${import.meta.env.VITE_API_WS_URL}/webSocket/clue/${msgUuid.value}`;
|
|
|
+ messages.value.push(obj)
|
|
|
+ nextTick(() => {
|
|
|
+ if (scrollbar.value && scrollbar.value.wrapRef) {
|
|
|
+ scrollbar.value.setScrollTop(scrollbar.value.wrapRef.scrollHeight)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const websocketId= uuidv4()
|
|
|
+ const wsUrl = `${import.meta.env.VITE_API_WS_URL}/webSocket/clue/${websocketId}`;
|
|
|
const socket = new WebSocket(wsUrl);
|
|
|
- askQues({
|
|
|
- conversationId: msgUuid.value,
|
|
|
- modelName: '通义千问-Max',
|
|
|
- question: type.value === FunctionList.File_Operation ? msg.rawContent : buildObjPrompt(xlsxData.value, formInfo.value),
|
|
|
- id: '699637194561691650',
|
|
|
- redisKey: msg.redisKey
|
|
|
- }).catch(res => {
|
|
|
- obj.rawContent = '接口出错,请重试。'
|
|
|
- obj.content = '接口出错,请重试。'
|
|
|
+ askQues({
|
|
|
+ conversationId: msgUuid.value,
|
|
|
+ websocketId,
|
|
|
+ modelName: '通义千问-Max',
|
|
|
+ question: type.value === FunctionList.File_Operation ? msg.rawContent : buildObjPrompt(xlsxData.value,formInfo.value),
|
|
|
+ id: '699637194561691650',
|
|
|
+ redisKey:msg.redisKey
|
|
|
+ }).catch(res => {
|
|
|
+ obj.rawContent = '接口出错,请重试。'
|
|
|
+ obj.content = '接口出错,请重试。'
|
|
|
socket.close()
|
|
|
})
|
|
|
socket.onmessage = (event) => {
|
|
@@ -589,8 +607,8 @@ const createFileObj = async (file) => {
|
|
|
handleUpload(file)
|
|
|
}
|
|
|
const handleUpload = async (file) => {
|
|
|
- const obj = reactive({
|
|
|
- title: file.name,
|
|
|
+ const obj = reactive({
|
|
|
+ title: summaryHtml.value ? file.name.split('.')[0] : file.name,
|
|
|
state: '上传中...',
|
|
|
favIconUrl: fileLogo,
|
|
|
loading: true,
|