From 64f47654fe84b400e60d88357317a38eba9c5615 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Fri, 17 Nov 2023 14:19:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E7=A8=8B=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E6=9D=A1=E4=BB=B6=E5=8D=95=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taskplatform/taskflow/flowType.go | 1 + api/version1/taskplatform/taskflow/runflow.go | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/api/version1/taskplatform/taskflow/flowType.go b/api/version1/taskplatform/taskflow/flowType.go index 2f6c2f3..7325253 100644 --- a/api/version1/taskplatform/taskflow/flowType.go +++ b/api/version1/taskplatform/taskflow/flowType.go @@ -98,6 +98,7 @@ type ConditionListInfo struct { Isok bool `json:"isok"` //页面渲染使用 IsCheckbox bool `json:"isCheckbox"` //结果值多选 Options []OptionsInfo `json:"options"` //可选项(用于关联表单使用) + Oneanswer string `json:"oneanswer"` //可选项锚定值(用于关联表单使用) Answers []string `json:"answers"` //可选项锚定值(用于关联表单使用) CustomFields []CustomFieldsInfo `json:"customFields"` //自定义字段条件主体 NodeUserList []FlowPermissionInfo `json:"nodeUserList"` //人员、行政组织、角色为条件主体 diff --git a/api/version1/taskplatform/taskflow/runflow.go b/api/version1/taskplatform/taskflow/runflow.go index fc94e95..3573ee5 100644 --- a/api/version1/taskplatform/taskflow/runflow.go +++ b/api/version1/taskplatform/taskflow/runflow.go @@ -249,7 +249,7 @@ func (n *NodePublicInfoES) ResolveRouting(step int, creater modelshr.ManCont, or default: } } - // fmt.Printf("termAry:%v----->%v\n", len(n.ConditionList), termAry) + fmt.Printf("termAry:%v----->%v\n", len(n.ConditionList), termAry) // if len(termAry) == len(n.ConditionList) { if termAry == len(n.ConditionList) { if n.ChildNode != nil { @@ -401,7 +401,7 @@ func JudgingCustomConditions(customFields []CustomFieldsInfo, presetVal []Condit } } } - // fmt.Printf("处理自定义条件-->%v-->%v\n", isOk, len(customFields)) + fmt.Printf("处理自定义条件-->%v-->%v\n", isOk, len(customFields)) if isOk == len(customFields) { isTrue = true } @@ -435,6 +435,7 @@ func ProcessMultipleSelectionResults(judging ConditionListInfo, presetVal []Cond if v.Types == 3 && judging.Factorid == v.Factorid { if judging.IsCheckbox { + fmt.Printf("termAry:%v----->%v----->%v\n", v.Answers, judging.Answers, len(v.Answers) <= len(judging.Answers)) //多选 if len(v.Answers) <= len(judging.Answers) { //判断答案个数是否小于等于设定条件值个数 isTrue = true @@ -445,14 +446,18 @@ func ProcessMultipleSelectionResults(judging ConditionListInfo, presetVal []Cond } } } else { //单选 - if len(v.Answers) == len(judging.Answers) { + fmt.Printf("termAry:%v----->%v----->%v\n", v.Oneanswer, judging.Oneanswer, v.Oneanswer == judging.Oneanswer) + // if len(v.Answers) == len(judging.Answers) { + // isTrue = false + // for i := 0; i < len(v.Answers); i++ { + // if !publicmethod.IsInTrue[string](v.Answers[i], judging.Answers) { + // isTrue = false + // } + // } + if v.Oneanswer == judging.Oneanswer { isTrue = true - for i := 0; i < len(v.Answers); i++ { - if !publicmethod.IsInTrue[string](v.Answers[i], judging.Answers) { - isTrue = false - } - } } + // } } } }