fix: 修复修改名称 数据也跟随修改

This commit is contained in:
shaohuzhang1 2024-06-27 16:53:08 +08:00
parent a8927a055e
commit 85ac7002d9
2 changed files with 17 additions and 11 deletions

View File

@ -38,9 +38,9 @@
<div>
<slot></slot>
<template v-if="props.nodeModel.properties.fields?.length > 0">
<template v-if="paramsFileds?.length > 0">
<h5 class="title-decoration-1 mb-8 mt-8">参数输出</h5>
<template v-for="(item, index) in props.nodeModel.properties.fields" :key="index">
<template v-for="(item, index) in paramsFileds" :key="index">
<div
class="flex-between border-r-4 p-8-12 mb-8 layout-bg lighter"
@mouseenter="showicon = index"
@ -66,7 +66,7 @@
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import { set } from 'lodash'
import { iconComponent } from '../icons/utils'
import { copyClick } from '@/utils/clipboard'
@ -84,7 +84,19 @@ const height = ref<{
})
const showEditIcon = ref(false)
const paramsFileds = computed(() => {
if (props.nodeModel.properties.fields) {
return props.nodeModel.properties.fields?.map((field: any) => {
return {
label: field.label,
value: field.value,
globeLabel: `{{${props.nodeModel.properties.stepName}.${field.value}}}`,
globeValue: `{{context['${props.nodeModel.id}'].${field.value}}}`
}
})
}
return []
})
function editName(val: string) {
if (val.trim() && val.trim() !== props.nodeModel.properties.stepName) {
if (

View File

@ -43,12 +43,6 @@ class AppNode extends HtmlResize.view {
props.model.properties.stepName = props.model.properties.stepName + (filterNodes.length - 1)
}
}
if (props.model.properties?.fields?.length > 0) {
props.model.properties.fields.map((item: any) => {
item['globeLabel'] = `{{${props.model.properties.stepName}.${item.value}}}`
item['globeValue'] = `{{context['${props.model.id}'].${item.value}}}`
})
}
}
getAnchorShape(anchorData: any) {
@ -140,7 +134,7 @@ class AppNodeModel extends HtmlResize.model {
getControlPointStyle() {
const style = super.getControlPointStyle()
style.stroke = 'none'
style.fill= 'none'
style.fill = 'none'
return style
}
getNodeStyle() {