Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
before="W"
|
||||
type="number"
|
||||
v-model="data.width"
|
||||
:disabled="whDisabled"
|
||||
@input="onInpot"
|
||||
@change="onChange"
|
||||
/>
|
||||
@@ -37,6 +38,7 @@
|
||||
before="H"
|
||||
type="number"
|
||||
v-model="data.height"
|
||||
:disabled="whDisabled"
|
||||
@input="onInpot"
|
||||
@change="onChange"
|
||||
/>
|
||||
@@ -97,6 +99,7 @@
|
||||
}
|
||||
})
|
||||
const id = computed(() => props.object.info.id)
|
||||
const whDisabled = computed(() => ['path', 'line'].includes(props.object.type))
|
||||
|
||||
const data = reactive({
|
||||
top: 0,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="depth-input" :class="{ color: isColor }">
|
||||
<div class="depth-input" :class="{ color: isColor, disabled: attrs.disabled }">
|
||||
<span class="decorate"></span>
|
||||
<span v-show="icon" class="icon">
|
||||
<svg-icon :name="icon" :size="iconSize" />
|
||||
@@ -28,6 +28,7 @@
|
||||
<input readonly :value="colorObj.color" @copy.stop @keydown.stop />
|
||||
<span class="decorate marginl"></span>
|
||||
<input
|
||||
v-bind="attrs"
|
||||
class="alpha"
|
||||
type="number"
|
||||
:value="Math.round(colorObj.alpha * 100)"
|
||||
@@ -230,11 +231,15 @@
|
||||
height: var(--depth-input-height, 2rem);
|
||||
background-color: var(--depth-input-bg-color, #fff);
|
||||
padding: 0 0.4rem 0 0.2rem;
|
||||
&.disabled,
|
||||
&.disabled * {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
&.color {
|
||||
--depth-input-decorate-margin-right: 1rem;
|
||||
--depth-input-input-margin-right: 1rem;
|
||||
--depth-input-input-font-align: left;
|
||||
--depth-input-after-color: rgba(181, 181, 181, 1);
|
||||
// --depth-input-after-color: rgba(181, 181, 181, 1);
|
||||
}
|
||||
> .decorate {
|
||||
width: 0.2rem;
|
||||
|
||||
@@ -348,6 +348,7 @@ export class LayerManager {
|
||||
const height = options?.height || 100
|
||||
delete options.points
|
||||
const starObject = new fabric.Polygon(getStarArr(width, height), {
|
||||
type: "star",
|
||||
fill: '#000',
|
||||
strokeWidth: 0,
|
||||
...(options || {}),
|
||||
|
||||
@@ -3,6 +3,7 @@ import { fabric } from 'fabric-with-all'
|
||||
import { createId } from '../../tools/tools'
|
||||
import { exportObjectsToImage, exportObjectToThumbnail } from '../tools/exportMethod'
|
||||
import { OperationType } from '../tools/layerHelper'
|
||||
import { getArrowPath, getLinePath, cloneObjects, getStarArr } from '../tools/canvasMethod'
|
||||
|
||||
export const FillSourceToBase64 = (source) => {
|
||||
if (source?.toDataURL) {
|
||||
@@ -215,6 +216,21 @@ export class ObjectManager {
|
||||
async updateProperty(id: string, options: any, isRecord: boolean) {
|
||||
const object = this.canvasManager.getObjectById(id)
|
||||
if (!object) return null
|
||||
const type = object.type
|
||||
const isWidth = object.hasOwnProperty('width')
|
||||
const isHeight = object.hasOwnProperty('height')
|
||||
if (isWidth || isHeight) {
|
||||
let width = isWidth ? options.width : object.width
|
||||
let height = isHeight ? options.height : object.height
|
||||
if (type === "polygon") {
|
||||
if (object.points.length === 10) {// 五角星
|
||||
options.points = getStarArr(width, height)
|
||||
}
|
||||
} else if (type === "ellipse") {// 椭圆
|
||||
options.rx = width / 2
|
||||
options.ry = height / 2
|
||||
}
|
||||
}
|
||||
object.set(options);
|
||||
this.canvasManager.renderAll()
|
||||
if (isRecord) {
|
||||
|
||||
@@ -175,26 +175,43 @@
|
||||
NODE_DATATIER.COLOR_PALETTE,
|
||||
]
|
||||
let tier = (tritList.includes(currentComponent.value.tier) && typeList.includes(currentComponent.value.type))?currentComponent.value.tier - 1:currentComponent.value.tier
|
||||
taskList.forEach((item,index) => {
|
||||
if(NODE_DATATYPE.TO_REAL_STYLE == currentComponent.value.type && false){
|
||||
let imageProcessTasks = taskList
|
||||
nodeManager.createResultNode({
|
||||
data: {
|
||||
superiorID: attrs.node.id,
|
||||
superiorNodeType: attrs.node?.data?.type,
|
||||
createIndexPosition: index + subordNodes.length,
|
||||
createIndexPosition: subordNodes.length,
|
||||
tier: tier,
|
||||
isActive: index == 0 && subordNodes.length == 0,
|
||||
isActive: subordNodes.length == 0,
|
||||
data: {
|
||||
imageProcessTasks:[item],
|
||||
selectTaskId:item.taskId,
|
||||
imageProcessTasks,
|
||||
selectTaskId:imageProcessTasks[0].taskId,
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
taskList.forEach((item,index) => {
|
||||
nodeManager.createResultNode({
|
||||
data: {
|
||||
superiorID: attrs.node.id,
|
||||
superiorNodeType: attrs.node?.data?.type,
|
||||
createIndexPosition: index + subordNodes.length,
|
||||
tier: tier,
|
||||
isActive: index == 0 && subordNodes.length == 0,
|
||||
data: {
|
||||
imageProcessTasks:[item],
|
||||
selectTaskId:item.taskId,
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
//删除功能卡片
|
||||
const onDeleteClick = async ()=>{
|
||||
console.log(stateManager.nodes)
|
||||
stateManager.getSubordinateAllNodes(attrs.node.id,{ isElMessageBox: true })
|
||||
stateManager.deleteSubordinateAllNodes(attrs.node.id,{ isElMessageBox: true })
|
||||
}
|
||||
const setDate = () => {
|
||||
for (const key in props.data) {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<div class="result-image"
|
||||
v-for="(item, i) in data.imageProcessTasks"
|
||||
:key="item.taskId"
|
||||
:class="{'active': node.id == stateManager.activeNodeID.value}"
|
||||
:class="{'active': node.id == stateManager.activeNodeID.value && item.taskId == data.selectTaskId}"
|
||||
@click="setSelectTaskId(item.taskId)"
|
||||
>
|
||||
<div class="header" v-if="item.status == 'RETURNED'" v-show="showHeader && node.id == stateManager.activeNodeID.value" @mousedown.stop>
|
||||
<div class="header" v-if="item.status == 'RETURNED'" v-show="showHeader && node.id == stateManager.activeNodeID.value && item.taskId == data.selectTaskId" @mousedown.stop>
|
||||
<span class="icon">
|
||||
<svg-icon name="chat-compose" size="20" size-unit="px" />
|
||||
</span>
|
||||
@@ -114,10 +114,12 @@
|
||||
watch(
|
||||
() => props.data.status,
|
||||
(newVal) => {
|
||||
let selectNode = data.imageProcessTasks.find((item) => item.taskId === data.selectTaskId)
|
||||
if(selectNode.status !== 'RETURNED'){
|
||||
generateManager.addTaskId(selectNode,props.node.id)
|
||||
}
|
||||
data.imageProcessTasks.forEach((item) => {
|
||||
if(item.status !== 'RETURNED'){
|
||||
generateManager.addTaskId(item,props.node.id)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
@@ -127,14 +129,7 @@
|
||||
label: 'Delete',
|
||||
tip: 'Del',
|
||||
on: () => {
|
||||
if(data.imageProcessTasks.length > 1){
|
||||
if(clickTaskId.value){
|
||||
data.imageProcessTasks = data.imageProcessTasks.filter((item) => item.taskId !== clickTaskId.value)
|
||||
clickTaskId.value = ''
|
||||
}
|
||||
}else{
|
||||
emit('delete-node', props.node.id)
|
||||
}
|
||||
emit('delete-node', props.node.id)
|
||||
},
|
||||
disabled: !!props.config?.disableDelete
|
||||
},
|
||||
@@ -159,10 +154,12 @@
|
||||
tip: '',
|
||||
on: () => {
|
||||
data.imageProcessTasks.forEach((item) => {
|
||||
if(!item.scale){
|
||||
item.scale = { x: 1, y: 1 }
|
||||
if(item.taskId == data.selectTaskId){
|
||||
if(!item.scale){
|
||||
item.scale = { x: 1, y: 1 }
|
||||
}
|
||||
item.scale.x = -item.scale.x
|
||||
}
|
||||
item.scale.x = -item.scale.x
|
||||
})
|
||||
stateManager.recordState()
|
||||
stateManager.exportFlow(stateManager.saveCanvasTimeInterval)
|
||||
@@ -173,10 +170,12 @@
|
||||
tip: '',
|
||||
on: () => {
|
||||
data.imageProcessTasks.forEach((item) => {
|
||||
if(!item.scale){
|
||||
item.scale = { x: 1, y: 1 }
|
||||
if(item.taskId == data.selectTaskId){
|
||||
if(!item.scale){
|
||||
item.scale = { x: 1, y: 1 }
|
||||
}
|
||||
item.scale.y = -item.scale.y
|
||||
}
|
||||
item.scale.y = -item.scale.y
|
||||
})
|
||||
stateManager.recordState()
|
||||
stateManager.exportFlow(stateManager.saveCanvasTimeInterval)
|
||||
|
||||
@@ -94,7 +94,7 @@ export class EventManager {
|
||||
handleDelete(event: any, activeNodeID: string) {
|
||||
event.preventDefault()
|
||||
if (!activeNodeID) return console.warn('没有选中节点')
|
||||
this.stateManager.getSubordinateAllNodes(activeNodeID, { isElMessageBox: true })
|
||||
this.stateManager.deleteSubordinateAllNodes(activeNodeID, { isElMessageBox: true })
|
||||
}
|
||||
/** 处理键盘事件 */
|
||||
_handleKeyDown: any
|
||||
|
||||
@@ -34,7 +34,7 @@ export class NodeManager {
|
||||
|
||||
/** 删除节点 */
|
||||
deleteNode(id: string) {
|
||||
this.stateManager.getSubordinateAllNodes(id, { isElMessageBox: true })
|
||||
this.stateManager.deleteSubordinateAllNodes(id, { isElMessageBox: true })
|
||||
}
|
||||
/** 添加节点 */
|
||||
addNode(node: any) {
|
||||
@@ -146,6 +146,7 @@ export class NodeManager {
|
||||
const flowNode = this.stateManager.flowManager.getNodeById(id)
|
||||
if (!node) return console.warn(`${id}找不到对应节点`)
|
||||
if (node.data?.disableCopy) return console.warn(`${id}节点已禁用复制`)
|
||||
copyNode.data.data.imageProcessTasks = copyNode.data.data.imageProcessTasks.filter((item) => item.taskId === copyNode.data.data.selectTaskId)
|
||||
const node_ = {
|
||||
...copyNode,
|
||||
id: createId(),
|
||||
|
||||
@@ -176,7 +176,7 @@ export class StateManager {
|
||||
return superiorNodeUrl
|
||||
}
|
||||
/** 获取下级所有子级节点 */
|
||||
async getSubordinateAllNodes(id: string,{ isElMessageBox } = { isElMessageBox: false }) {
|
||||
async deleteSubordinateAllNodes(id: string,{ isElMessageBox } = { isElMessageBox: false }) {
|
||||
const node = this.getNodeById(id)
|
||||
if (!node) return console.warn(`没有找到指定id:${id}`)
|
||||
if (node.data.disableDelete) return ElMessage.error(t('flowCanvas.initialNodeProhibited'))
|
||||
@@ -210,6 +210,11 @@ export class StateManager {
|
||||
})
|
||||
}
|
||||
if(!deletePromise) return console.log('删除操作被取消')
|
||||
|
||||
if(node.data.data.imageProcessTasks.length > 1){
|
||||
node.data.data.imageProcessTasks = node.data.data.imageProcessTasks.filter((item) => item.taskId !== node.data.data.selectTaskId)
|
||||
return
|
||||
}
|
||||
|
||||
this.deleteNode(id)
|
||||
result.forEach(item => {
|
||||
|
||||
@@ -166,7 +166,7 @@ export default {
|
||||
delete: 'Delete',
|
||||
edit: 'Edit',
|
||||
generatingReport:
|
||||
'We are generating your report. This may take a few minutes, but you can continue with other tasks while it’s being generated.',
|
||||
'We’re generating your report. This may take a few minutes.',
|
||||
deleteSketchTip:
|
||||
'Are you sure you want to delete this sketch? This action cannot be undone.',
|
||||
confirm: 'Confirm',
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<span class="title" v-show="!isCollapse">{{ $t('Home.home') }}</span>
|
||||
</div> -->
|
||||
<div class="menu-item" @click="onHistory" :class="{ active: showHistory }">
|
||||
<span class="icon"><svg-icon name="history" size="16" /></span>
|
||||
<span class="icon"><svg-icon name="history" size="18" /></span>
|
||||
<span class="title" v-show="!isCollapse">{{ $t('Home.history') }}</span>
|
||||
<span class="icon jiantou" v-show="!isCollapse"
|
||||
><svg-icon name="arrow-right" size="14" />
|
||||
|
||||
Reference in New Issue
Block a user