Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
@@ -122,7 +122,8 @@
|
||||
|
||||
const onGenerateClick = async () => {
|
||||
const data = componentRef.value?.getApiData?.() || {}
|
||||
const subordNode = stateManager.getSubordNodeByID(attrs.node.id)
|
||||
const subordNode = stateManager.getSubordNodeById(attrs.node.id)
|
||||
const subordNodes = stateManager.getSubordNodes(attrs.node.id)
|
||||
emit('update-data', componentRef.value?.data)
|
||||
if(!attrs.node?.data?.originalImage)console.log('originalImage 找不到原始图片')
|
||||
|
||||
@@ -131,32 +132,32 @@
|
||||
imageUrl: attrs.node?.data?.originalImage,
|
||||
...data,
|
||||
}
|
||||
console.log(subordNode)
|
||||
const taskList = await currentComponent.value.api(apiData).then((rv)=>{
|
||||
return rv
|
||||
}) || []
|
||||
// const taskList = [{taskId:'123'}]
|
||||
console.log(taskList)
|
||||
if (!subordNode) {
|
||||
taskList.forEach((item,index) => {
|
||||
nodeManager.createResultNode({
|
||||
positionY: index * (50 + 250),
|
||||
// if (!subordNode) {
|
||||
taskList.forEach((item,index) => {
|
||||
nodeManager.createResultNode({
|
||||
positionY: (index + subordNodes.length) * (50 + 250),
|
||||
data: {
|
||||
superiorID: attrs.node.id,
|
||||
createIndexPosition: index,
|
||||
tier: currentComponent.value.tier,
|
||||
isActive: index == 0 && subordNodes.length == 0,
|
||||
data: {
|
||||
superiorID: attrs.node.id,
|
||||
createIndexPosition: index,
|
||||
tier: currentComponent.value.tier,
|
||||
isActive: index == 0,
|
||||
data: {
|
||||
imageProcessTasks:[item],
|
||||
selectTaskId:item.taskId,
|
||||
}
|
||||
imageProcessTasks:[item],
|
||||
selectTaskId:item.taskId,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
subordNode.data.data.url =
|
||||
'https://s3-alpha-sig.figma.com/img/8ce2/f1a4/12b93da90e5f17109e7430f14837fd14?Expires=1773619200&Key-Pair-Id=APKAQ4GOSFWCW27IBOMQ&Signature=kmLsTFtXJqfvuxj6husWlDkRDMOIRDjzUUjb7zh79GkBKihUHc0f59k5OAImHTPdaiEREUCCpn~8sQ-si5lenuauJpApCmAU~NsxjfQhuh9m5O~GiHenr2fKu0DIJ75-oCE3859fyxoSFXQgZ9PRmeb98kikMR6uRX9nI5TPUHgKO8ZgkhDBTW~iyaDT~1ybnoK7elPa6T2VzfO-bpIyY-MZ71VRq3RxwmZRxduqHEb3Dh-jjrHyh2SoQsHmUjSJOf-uYilfvpGUResZAjAq8ZVLEjvhzKC2bmCNZIp3RmhYO8ctU7pd5t91J6Xaa6jBLtGfMxbqIm652EC79K0RoA__'
|
||||
setTimeout(() => stateManager.recordState())
|
||||
}
|
||||
})
|
||||
// } else {
|
||||
// subordNode.data.data.url =
|
||||
// 'https://s3-alpha-sig.figma.com/img/8ce2/f1a4/12b93da90e5f17109e7430f14837fd14?Expires=1773619200&Key-Pair-Id=APKAQ4GOSFWCW27IBOMQ&Signature=kmLsTFtXJqfvuxj6husWlDkRDMOIRDjzUUjb7zh79GkBKihUHc0f59k5OAImHTPdaiEREUCCpn~8sQ-si5lenuauJpApCmAU~NsxjfQhuh9m5O~GiHenr2fKu0DIJ75-oCE3859fyxoSFXQgZ9PRmeb98kikMR6uRX9nI5TPUHgKO8ZgkhDBTW~iyaDT~1ybnoK7elPa6T2VzfO-bpIyY-MZ71VRq3RxwmZRxduqHEb3Dh-jjrHyh2SoQsHmUjSJOf-uYilfvpGUResZAjAq8ZVLEjvhzKC2bmCNZIp3RmhYO8ctU7pd5t91J6Xaa6jBLtGfMxbqIm652EC79K0RoA__'
|
||||
// setTimeout(() => stateManager.recordState())
|
||||
// }
|
||||
}
|
||||
//删除功能卡片
|
||||
const onDeleteClick = ()=>{
|
||||
|
||||
@@ -271,6 +271,8 @@
|
||||
> .image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 200px;
|
||||
object-fit: contain;
|
||||
}
|
||||
> .status{
|
||||
width: 100%;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getTaskidResult } from '@/api/flow-canvas'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
// interface NodeOptions {
|
||||
// }
|
||||
export class GenerateManager {
|
||||
|
||||
@@ -135,7 +135,7 @@ export class StateManager {
|
||||
/** 获取节点 */
|
||||
getNodeById(id: string) { return this.nodes.value.find((node: NodesItem) => node.id === id) }
|
||||
/** 获取下级节点 */
|
||||
getSubordNodeByID(id: string) { return this.nodes.value.find((node: NodesItem) => node.data.superiorID === id) }
|
||||
getSubordNodeById(id: string) { return this.nodes.value.find((node: NodesItem) => node.data.superiorID === id) }
|
||||
getLastNode() { console.log(this.nodes.value); return this.nodes.value[this.nodes.value.length - 1] }
|
||||
/** 设置工具 */
|
||||
setTool(tool: string) { this.tool.value = tool }
|
||||
@@ -145,6 +145,8 @@ export class StateManager {
|
||||
setNodesDraggable(v: boolean) { this.nodesDraggable.value = v }
|
||||
/** 设置是否可以平移画布 */
|
||||
setPanOnDrag(v: boolean) { this.panOnDrag.value = v }
|
||||
/** 获取所有下级节点 */
|
||||
getSubordNodes(id: string) { return this.nodes.value.filter((node: NodesItem) => node.data.superiorID === id) }
|
||||
/** 设置节点层级至最顶部 */
|
||||
bringToFont(id) {
|
||||
const fromIndex = this.nodes.value.findIndex(item => item.id === id)
|
||||
|
||||
Reference in New Issue
Block a user