Compare commits

...

2 Commits

Author SHA1 Message Date
lzp
bb868422b7 Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front 2026-03-04 15:48:20 +08:00
lzp
7ae7f5406a 画布调整 2026-03-04 15:46:44 +08:00
3 changed files with 26 additions and 9 deletions

View File

@@ -24,7 +24,7 @@
<div
v-for="(v, i) in menus"
:key="i"
:class="[v.isDivide ? 'divide' : 'item']"
:class="[v.isDivide ? 'divide' : 'item', { disabled: v.disabled }]"
@click="onMenuItem(v)"
>
<template v-if="!v.isDivide">
@@ -39,6 +39,10 @@
<script setup lang="ts">
import { reactive, ref, onBeforeUnmount, useAttrs, inject, watch } from 'vue'
const props = defineProps({
config: {
type: Object,
default: () => ({})
},
data: {
type: Object,
default: () => ({})
@@ -59,17 +63,21 @@
)
const menus = ref([
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node') },
// { label: 'Paste', tip: 'Ctrl+V', on: () => {} },
// { label: 'Duplicate', tip: 'Ctrl+D', on: () => {} },
{ label: 'Delete', tip: 'Del', on: () => emit('delete-node') },
{
label: 'Delete',
tip: 'Del',
on: () => emit('delete-node'),
disabled: !!props.config?.disableDelete
},
{ isDivide: true },
{ label: 'Bring to font', tip: '', on: () => {emit('bring-to-font')} },
{ label: 'Send to back', tip: '', on: () => {emit('send-to-back')} },
{ label: 'Bring to font', tip: '', on: () => {} },
{ label: 'Send to back', tip: '', on: () => {} },
{ isDivide: true },
{ label: 'Flip horizontal', tip: '', on: () => {emit('flip-horizontal')} },
{ label: 'Flip vertical', tip: '', on: () => {emit('flip-vertical')} }
])
const onMenuItem = (v) => {
if (v.disabled) return
v.on && v.on()
hideMenu()
}
@@ -181,7 +189,14 @@
border-radius: 8px;
cursor: pointer;
font-size: 14px;
&:hover {
&.disabled {
cursor: not-allowed;
> .tip,
> .label {
color: rgba(0, 0, 0, 0.2);
}
}
&:not(.disabled):hover {
background: #f3f3f3;
}
> .label {

View File

@@ -11,7 +11,7 @@
tabindex="0"
class="input"
ref="inputRef"
contenteditable="true"
:contenteditable="edit"
@input="onInput"
@blur="onBlur"
@paste.prevent
@@ -66,6 +66,7 @@
<style lang="less" scoped>
.text {
user-select: none;
&.edit {
> .input {
cursor: text;

View File

@@ -28,6 +28,7 @@
<component
:is="components[node.data.component]"
:node="node"
:config="node.data"
:data="node.data.data"
v-bind="node.data"
@delete-node="deleteNode(node.id)"
@@ -188,9 +189,9 @@
onMounted(() => {
// window['vueFlow'] = vueFlow
// window['nodes'] = nodes
console.log(props.config)
nodeManager.createResultNode({
data: {
disableDelete: true,
isHeader: false,
data: {
url: props.config.url