inParamsForm

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockString = []string{"string", "integer", "float", "boolean", "upper", "lower", "mobile", "digital_letters", "letters", "character", "timestamp",
	"timestamp_hour", "timestamp_ns", "timestamp_ns_hour", "date", "date_day", "datetime", "datetime_hour"}

Functions

func RenderCreator

func RenderCreator() protocol.CompRender

Types

type CommonInParamsForm

type CommonInParamsForm struct {
	Version    string                 `json:"version,omitempty"`
	Name       string                 `json:"name,omitempty"`
	Type       string                 `json:"type,omitempty"`
	Props      map[string]interface{} `json:"props,omitempty"`
	State      State                  `json:"state,omitempty"`
	Operations map[string]interface{} `json:"operations,omitempty"`
	Data       Data                   `json:"data,omitempty"`
	InParams   InParams               `json:"inParams,omitempty"`
}

type ComponentInParamsForm

type ComponentInParamsForm struct {
	CommonInParamsForm
	// contains filtered or unexported fields
}

func (*ComponentInParamsForm) Filter

func (i *ComponentInParamsForm) Filter() []ParamData

func (*ComponentInParamsForm) GenComponentState

func (i *ComponentInParamsForm) GenComponentState(c *apistructs.Component) error

GenComponentState 获取state

func (*ComponentInParamsForm) GetInParams

func (i *ComponentInParamsForm) GetInParams() error

func (*ComponentInParamsForm) GetInparams

func (i *ComponentInParamsForm) GetInparams() error

func (*ComponentInParamsForm) GetSceneOutPutValue

func (i *ComponentInParamsForm) GetSceneOutPutValue(sceneName uint64, name string) (string, error)

func (*ComponentInParamsForm) RenderListInParamsForm

func (i *ComponentInParamsForm) RenderListInParamsForm() error

func (*ComponentInParamsForm) RenderOnSelect

func (i *ComponentInParamsForm) RenderOnSelect(opsData interface{}) error

func (*ComponentInParamsForm) RenderProtocol

func (*ComponentInParamsForm) RenderUpdateInParamsForm

func (i *ComponentInParamsForm) RenderUpdateInParamsForm() error

func (*ComponentInParamsForm) SetCtxBundle

SetCtxBundle 设置bundle

func (*ComponentInParamsForm) SetProps

func (i *ComponentInParamsForm) SetProps()

type Data

type Data struct {
	List []ParamData `json:"list"`
}

type DeleteOperation

type DeleteOperation OperationInfo

type InParams

type InParams struct {
	SceneSetID uint64 `json:"sceneSetId__urlQuery"`
	SpaceId    uint64 `json:"spaceId"`
}

type OnSelectOperation

type OnSelectOperation OperationInfo

type OpMetaInfo

type OpMetaInfo struct {
	apistructs.AutotestSceneRequest
	SelectOption []PropChangeOption `json:"selectOption"`
}

func GetOpsInfo

func GetOpsInfo(opsData interface{}) (*OpMetaInfo, error)

type OperationBaseInfo

type OperationBaseInfo struct {
	Key string `json:"key"`
	// 操作展示名称
	Text string `json:"text,omitempty"`
	// 确认提示
	Confirm string `json:"confirm,omitempty"`
	// 前端操作是否需要触发后端
	Reload      bool   `json:"reload"`
	Disabled    bool   `json:"disabled"`
	DisabledTip string `json:"disabledTip"`

	FillMeta string `json:"fillMeta"`
}

type OperationInfo

type OperationInfo struct {
	OperationBaseInfo
	Meta OpMetaInfo `json:"meta"`
}

type OptionValue

type OptionValue string
const (
	BeforeSceneOutPutOptionValue OptionValue = "beforeSceneOutPut" // 前置场景出参
	SceneOptionValue             OptionValue = "scene"             // 场景 X

	SceneOutPutOptionValue  OptionValue = "sceneOutPut"  // 场景出参 X
	MockOptionValue         OptionValue = "mock"         // MOCK
	MockValueOptionValue    OptionValue = "mockValue"    // MOCK值
	GlobalOptionValue       OptionValue = "global"       // 全局参数
	GlobalValueOptionValue  OptionValue = "globalValue"  // 全局参数环境
	GlobalGlobalOptionValue OptionValue = "globalGlobal" // 全局参数环境Global
)

func (OptionValue) String

func (ov OptionValue) String() string

type ParamData

type ParamData struct {
	ParamsName   string                 `json:"name"`
	Desc         string                 `json:"description"`
	DefaultValue string                 `json:"value"`
	Value        string                 `json:"temp"`
	ID           uint64                 `json:"id"`
	Operations   map[string]interface{} `json:"operations"`
}

type PropChangeOption

type PropChangeOption struct {
	Label    string             `json:"label"`
	Value    string             `json:"value"`
	IsLeaf   bool               `json:"isLeaf"`
	Children []PropChangeOption `json:"children"`
}

func (*PropChangeOption) FindValue

func (pct *PropChangeOption) FindValue(v string) *PropChangeOption

type PropColumn

type PropColumn struct {
	Title    string     `json:"title"`
	Key      PropsKey   `json:"key"`
	Width    int64      `json:"width"`
	Flex     int64      `json:"flex"`
	Render   PropRender `json:"render"`
	TitleTip string     `json:"titleTip,omitempty"`
}

type PropRender

type PropRender struct {
	Type             string                 `json:"type,omitempty"`
	ValueConvertType string                 `json:"valueConvertType,omitempty"`
	Options          []PropChangeOption     `json:"options,omitempty"`
	Required         bool                   `json:"required,omitempty"`
	UniqueValue      bool                   `json:"uniqueValue,omitempty"`
	Operations       map[string]interface{} `json:"operations,omitempty"`
	Rules            []PropRenderRule       `json:"rules,omitempty"`
	Props            PropRenderProp         `json:"props,omitempty"`
}

type PropRenderProp

type PropRenderProp struct {
	MaxLength   int64              `json:"maxLength,omitempty"`
	Placeholder string             `json:"placeholder,omitempty"`
	Options     []PropChangeOption `json:"options,omitempty"`
}

type PropRenderRule

type PropRenderRule struct {
	Pattern string `json:"pattern,omitempty"`
	Msg     string `json:"msg,omitempty"`
}

type PropsKey

type PropsKey string
const (
	PropsKeyParamsName   PropsKey = "name"
	PropsKeyDesc         PropsKey = "description"
	PropsKeyDefaultValue PropsKey = "value"
	PropsKeyValue        PropsKey = "temp"
)

type State

type State struct {
	AutotestSceneRequest apistructs.AutotestSceneRequest `json:"autotestSceneRequest"`
	List                 []apistructs.AutoTestSceneInput `json:"list"`
	SceneId              uint64                          `json:"sceneId"`
	SetId                uint64                          `json:"setId"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL