浏览代码

补充修改

Renxy 2 年之前
父节点
当前提交
57b52c08ec
共有 2 个文件被更改,包括 17 次插入4 次删除
  1. 6 2
      src/components/Flow/components/judgeComponent/index.tsx
  2. 11 2
      src/components/Flow/node/judgeNode/index.tsx

+ 6 - 2
src/components/Flow/components/judgeComponent/index.tsx

@@ -33,6 +33,10 @@ export const SiginOptions = [
   { label: '<', value: 1 },
   { label: '≤', value: 3 },
 ];
+export const SiginSmallOptions = [
+  { label: '<', value: 2 },
+  { label: '≤', value: 5 },
+];
 
 const RenderJudge = (props: any) => {
   const { formItems = '', onChange, depUserTree } = props;
@@ -160,7 +164,7 @@ const RenderJudge = (props: any) => {
                   }}
                 />
                 <Select
-                  defaultValue={judge?.condition?.smallSign}
+                  value={judge?.condition?.smallSign == 2 ? 1 : 3}
                   onChange={(value: number) => {
                     const newValue = Number(value) == 1 ? 2 : 5;
                     handleChange([], item, { ...judge?.condition, smallSign: newValue });
@@ -172,7 +176,7 @@ const RenderJudge = (props: any) => {
                 </Select>
                 <span>N</span>
                 <Select
-                  defaultValue={judge?.condition?.bigSign}
+                  value={judge?.condition?.bigSign}
                   onChange={(value: number) => {
                     handleChange([], item, { ...judge?.condition, bigSign: Number(value) });
                   }}

+ 11 - 2
src/components/Flow/node/judgeNode/index.tsx

@@ -1,7 +1,12 @@
 import React, { useEffect, useMemo } from 'react';
 judgeServe;
 import judgeServe, { ComponentName, FormItem } from './mapServe';
-import { JudgeType, JudgeOptions, SiginOptions } from '../../components/judgeComponent';
+import {
+  JudgeType,
+  JudgeOptions,
+  SiginOptions,
+  SiginSmallOptions,
+} from '../../components/judgeComponent';
 import { connect } from 'dva';
 export { judgeServe };
 
@@ -53,9 +58,13 @@ const JudgeRect = props => {
               if (!smallSign || !smallValue || !bigSign || !bigValue) break;
               const getSigin = (sigin: Number) =>
                 SiginOptions.find(item => item.value == sigin)?.label;
+              const getSmallSigin = (sigin: Number) =>
+                SiginSmallOptions.find(item => item.value == sigin)?.label;
 
               text.push(
-                `${smallValue} ${getSigin(smallSign)} ${label} ${getSigin(bigSign)} ${bigValue} `
+                `${smallValue} ${getSmallSigin(smallSign)} ${label} ${getSigin(
+                  bigSign
+                )} ${bigValue} `
               );
             }
             break;