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