Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
{ immediate: true }
|
||||
)
|
||||
const menus = ref([
|
||||
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node', clickTaskId.value) },
|
||||
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node') },
|
||||
{
|
||||
label: 'Delete',
|
||||
tip: 'Del',
|
||||
@@ -228,6 +228,7 @@
|
||||
...options,
|
||||
}
|
||||
depthCanvasWorkbench(workbenchData)
|
||||
depthCanvasClose()
|
||||
},
|
||||
onClose:depthCanvasClose
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
:data="node.data.data"
|
||||
v-bind="node.data"
|
||||
@delete-node="deleteNode(node.id)"
|
||||
@copy-node="copyNode($event, node.id)"
|
||||
@copy-node="copyNode(node.id)"
|
||||
@update-data="(v) => (node.data.data = v)"
|
||||
@bring-to-font="bringToFont(node.id)"
|
||||
@send-to-back="sendToBack(node.id)"
|
||||
@@ -179,8 +179,8 @@
|
||||
nodeManager.deleteNode(id)
|
||||
}
|
||||
/** 复制节点 */
|
||||
const copyNode = (clickTaskId, id) => {
|
||||
nodeManager.copyNodeById(clickTaskId, id)
|
||||
const copyNode = (id) => {
|
||||
nodeManager.copyNodeById(id)
|
||||
}
|
||||
/** 节点zIndex设置最大 */
|
||||
const bringToFont = (id) => {
|
||||
|
||||
@@ -139,10 +139,9 @@ export class NodeManager {
|
||||
return this.createNode(options_)
|
||||
}
|
||||
|
||||
copyNodeById(clickTaskId:string, id: string) {
|
||||
copyNodeById(id: string) {
|
||||
const node = this.stateManager.getNodeById(id)
|
||||
let copyNode = JSON.parse(JSON.stringify(node))
|
||||
copyNode.data.data.imageProcessTasks = copyNode.data.data.imageProcessTasks.filter((item:any)=>item.taskId == clickTaskId)
|
||||
const flowNode = this.stateManager.flowManager.getNodeById(id)
|
||||
if (!node) return console.warn(`${id}找不到对应节点`)
|
||||
if (node.data?.disableCopy) return console.warn(`${id}节点已禁用复制`)
|
||||
@@ -156,6 +155,9 @@ export class NodeManager {
|
||||
}
|
||||
delete node_.data?.superiorID
|
||||
delete node_.data?.disableDelete
|
||||
node_.data.data.imageProcessTasks.forEach((item) => {
|
||||
item.canvasId = null
|
||||
})
|
||||
this.stateManager.addNode(node_)
|
||||
}
|
||||
dispose() {}
|
||||
|
||||
@@ -323,10 +323,6 @@
|
||||
params.versionID = versionID
|
||||
projectStore.setProject({ nodeId: versionID })
|
||||
}
|
||||
// if (eventName === 'webAddress') {
|
||||
// console.log('webAddress111111111111111', eventName, dataLines)
|
||||
// debugger
|
||||
// }
|
||||
|
||||
if (eventName === 'tool') {
|
||||
MyEvent.emit('loading-sketch', sketchList.value.length)
|
||||
@@ -357,6 +353,9 @@
|
||||
MyEvent.emit('OpenSketch')
|
||||
// contentBody += `<slot slot-name="sketch"></slot>`
|
||||
}
|
||||
if (eventName === 'reportName' || eventName === 'reportTitle') {
|
||||
aiMessage.reportName = jsonData.reportName || jsonData.reportTitle
|
||||
}
|
||||
if (eventName === 'report') {
|
||||
reportsContent.value += jsonData.report
|
||||
} else {
|
||||
@@ -495,9 +494,11 @@
|
||||
i++
|
||||
} else if (item.role === 'assistant') {
|
||||
// assistant 角色,拼接直到下一个 user
|
||||
|
||||
let combinedContent = item.content || ''
|
||||
let combinedThinkingText = item.reasoning || ''
|
||||
let combinedImageUrl = item.image_url || null
|
||||
let reportName = item.reportName || null
|
||||
let webAddress = item.webAddress || null
|
||||
// 继续往后找连续的 assistant 消息
|
||||
let j = i + 1
|
||||
@@ -508,6 +509,9 @@
|
||||
if (dialogue[j].image_url) {
|
||||
combinedImageUrl = dialogue[j].image_url
|
||||
}
|
||||
if (dialogue[j].reportName) {
|
||||
reportName = dialogue[j].reportName
|
||||
}
|
||||
if (dialogue[j].webAddress) {
|
||||
combinedContent += `<slot slot-name="url"></slot>`
|
||||
webAddress = dialogue[j].webAddress
|
||||
@@ -524,6 +528,7 @@
|
||||
|
||||
result.push({
|
||||
...item,
|
||||
reportName,
|
||||
content: combinedContent,
|
||||
thinkingText: combinedThinkingText,
|
||||
text: combinedContent,
|
||||
@@ -629,7 +634,6 @@
|
||||
item.text += `<slot slot-name="sketch"></slot>`
|
||||
}
|
||||
})
|
||||
|
||||
messageList.value = [...ancestorsList]
|
||||
params.versionID = current?.id
|
||||
sketchList.value = imgList
|
||||
|
||||
@@ -56,7 +56,10 @@
|
||||
:rehype-plugins="[rehypeRaw]"
|
||||
>
|
||||
<template v-slot:s-card="{ children: children, ...attrs }">
|
||||
<Card :title="attrs.title" @click.native="handleClickReport" />
|
||||
<Card
|
||||
:title="content.reportName ?? attrs.title"
|
||||
@click.native="handleClickReport"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:s-url="{ children: children }">
|
||||
<Url :list="content.webAddress" @click.native="handleClickUrls" />
|
||||
@@ -269,7 +272,7 @@
|
||||
}
|
||||
|
||||
const handleClickReport = () => {
|
||||
MyEvent.emit('openReport', props.content.sessionId)
|
||||
MyEvent.emit('openReport', props.content)
|
||||
// 点击显示报告
|
||||
}
|
||||
const handleClickUrls = (data) => {
|
||||
|
||||
@@ -163,10 +163,17 @@
|
||||
const markdownContent = ref('')
|
||||
const urlList = ref([])
|
||||
const reportType = ref<'report' | 'urls'>('report')
|
||||
const reportTitle = ref('')
|
||||
|
||||
const setSessionId = (id: string) => {
|
||||
reportType.value = 'report'
|
||||
sessionId.value = id
|
||||
}
|
||||
|
||||
const setReportTitle = (title: string) => {
|
||||
reportTitle.value = title
|
||||
}
|
||||
|
||||
const setUrls = async (list: string[]) => {
|
||||
reportType.value = 'urls'
|
||||
const res = await fetchUrlTitle(list)
|
||||
@@ -246,7 +253,7 @@
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `report-${Date.now()}.md`
|
||||
link.download = reportTitle.value ?? `report-${Date.now()}.md`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
@@ -299,7 +306,8 @@
|
||||
|
||||
defineExpose({
|
||||
setSessionId,
|
||||
setUrls
|
||||
setUrls,
|
||||
setReportTitle
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -112,8 +112,9 @@
|
||||
|
||||
const proJectId = computed(() => route.params.id)
|
||||
|
||||
const handleOpenReport = (data, isUrls = false) => {
|
||||
previewRef.value.setSessionId(data)
|
||||
const handleOpenReport = (data) => {
|
||||
previewRef.value.setSessionId(data.sessionId)
|
||||
previewRef.value.setReportTitle(data.reportName)
|
||||
previewType.value = 'report'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user