24282 11 luni în urmă
părinte
comite
01671e8897

+ 1 - 2
jy-ui/src/components/flow/PropertySetting/index.vue

@@ -123,9 +123,9 @@ watch(
         const propertiesStr = JSON.stringify(n.properties)
         const permissionFlag = n.properties?.permissionFlag
         const listenerType = n.properties?.listenerType
+        const nodeRatioNumber = Number(n.properties.nodeRatio)
 
         n.properties.formCustom = propertiesStr === '{}' ? 'N' : n.properties.formCustom || ''
-        const nodeRatioNumber = Number(n.properties.nodeRatio)
         form.value = {
           nodeType: n.type,
           nodeCode: n.id,
@@ -175,7 +175,6 @@ watch(
   (n) => {
     // 监听节点属性变化并更新
     props.lf.setProperties(objId.value, {
-      nodeRatioNumber: n,
       nodeRatio: n ? n.toString() : undefined
     })
   }

+ 16 - 16
jy-ui/src/components/flow/PropertySetting/skip.vue

@@ -30,19 +30,6 @@ const computedModelValue = computed({
   }
 })
 
-watch(
-  computedModelValue.value,
-  (n) => {
-    let skipCondition = '@@' + n.conditionType + '@@|'
-    if (n.conditionType !== 'spel') {
-      skipCondition =
-        skipCondition + (n.condition ? n.condition : '') + '@@' + n.conditionType + '@@'
-    }
-    n.skipCondition = skipCondition + (n.conditionValue ? n.conditionValue : '')
-  },
-  { deep: true }
-)
-
 const config: FormConfigType[] = [
   {
     type: 'input',
@@ -69,7 +56,8 @@ const config: FormConfigType[] = [
     type: 'input',
     prop: 'condition',
     label: '跳转条件名',
-    if: () => props.skipConditionShow && computedModelValue.value.conditionType != 'spel'
+    if: () => props.skipConditionShow && computedModelValue.value.conditionType != 'spel',
+    change: () => updateSkipCondition()
   },
   {
     type: 'select',
@@ -113,13 +101,25 @@ const config: FormConfigType[] = [
         label: 'spel表达式'
       }
     ],
-    if: () => props.skipConditionShow
+    if: () => props.skipConditionShow,
+    change: () => updateSkipCondition()
   },
   {
     type: 'input',
     prop: 'conditionValue',
     label: '条件值',
-    if: () => props.skipConditionShow
+    if: () => props.skipConditionShow,
+    change: () => updateSkipCondition()
   }
 ]
+
+function updateSkipCondition() {
+  const value = computedModelValue.value
+
+  let skipCondition = '@@' + value.conditionType + '@@|'
+  if (value.conditionType !== 'spel') {
+    skipCondition += (value.condition ?? '') + '@@' + value.conditionType + '@@'
+  }
+  value.skipCondition = skipCondition + (value.conditionValue ?? '')
+}
 </script>