mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: 修复节点名称修改后数据未修改
This commit is contained in:
parent
8600ad6a8f
commit
e7d4fed7f8
|
|
@ -38,9 +38,9 @@
|
|||
|
||||
<div>
|
||||
<slot></slot>
|
||||
<template v-if="paramsFields?.length > 0">
|
||||
<template v-if="nodeModel.properties.fields?.length > 0">
|
||||
<h5 class="title-decoration-1 mb-8 mt-8">参数输出</h5>
|
||||
<template v-for="(item, index) in paramsFields" :key="index">
|
||||
<template v-for="(item, index) in nodeModel.properties.fields" :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, computed } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { set } from 'lodash'
|
||||
import { iconComponent } from '../icons/utils'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
|
|
@ -84,19 +84,7 @@ const height = ref<{
|
|||
})
|
||||
|
||||
const showEditIcon = ref(false)
|
||||
const paramsFields = 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 (
|
||||
|
|
@ -143,7 +131,23 @@ const resizeStepContainer = (wh: any) => {
|
|||
const props = defineProps<{
|
||||
nodeModel: any
|
||||
}>()
|
||||
|
||||
watch(
|
||||
() => props.nodeModel.properties?.stepName,
|
||||
() => {
|
||||
if (props.nodeModel.properties.fields) {
|
||||
const fields = 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}}}`
|
||||
}
|
||||
})
|
||||
set(props.nodeModel.properties, 'fields', fields)
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
function showOperate(type: string) {
|
||||
return type !== WorkflowType.Base && type !== WorkflowType.Start
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue