select value

This commit is contained in:
jiangyong 2025-09-11 18:43:05 +08:00
parent 467fd8686c
commit 3294245595
1 changed files with 9 additions and 4 deletions

View File

@ -4,9 +4,10 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.u8t.cn/open/gosdk/util" "git.u8t.cn/open/gosdk/util"
log "github.com/sirupsen/logrus"
"git.u8t.cn/open/goutil" "git.u8t.cn/open/goutil"
log "github.com/sirupsen/logrus"
"github.com/spf13/cast" "github.com/spf13/cast"
"strings"
) )
type Applyer struct { type Applyer struct {
@ -148,10 +149,14 @@ func (d *ApproveDetail) GetData() map[string]string {
var value string var value string
if content.Control == "Selector" { if content.Control == "Selector" {
for _, v := range content.Value.Selector.Options[0].Value { if len(content.Value.Selector.Options) > 0 {
if v.Text != "" { values := make([]string, 0)
value = v.Text for _, v := range content.Value.Selector.Options[0].Value {
if v.Text != "" {
values = append(values, v.Text)
}
} }
value = strings.Join(values, ",")
} }
} else if content.Control == "Text" || content.Control == "Textarea" { } else if content.Control == "Text" || content.Control == "Textarea" {
value = content.Value.Text value = content.Value.Text