inParamsForm

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 {
	base.DefaultProvider

	CommonInParamsForm
	// contains filtered or unexported fields
}

func (*ComponentInParamsForm) Filter

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

func (*ComponentInParamsForm) GenComponentState

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

GenComponentState 获取state

func (*ComponentInParamsForm) GetInParams

func (i *ComponentInParamsForm) GetInParams(ctx context.Context) error

func (*ComponentInParamsForm) GetSceneOutPutValue

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

func (*ComponentInParamsForm) Render

func (*ComponentInParamsForm) RenderListInParamsForm

func (i *ComponentInParamsForm) RenderListInParamsForm() error

func (*ComponentInParamsForm) RenderOnSelect

func (i *ComponentInParamsForm) RenderOnSelect(ctx context.Context, opsData interface{}) error

func (*ComponentInParamsForm) RenderProtocol

func (i *ComponentInParamsForm) RenderProtocol(c *cptype.Component, g *cptype.GlobalStateData)

func (*ComponentInParamsForm) RenderUpdateInParamsForm

func (i *ComponentInParamsForm) RenderUpdateInParamsForm() error

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"`
	ToolTip  string             `json:"tooltip"`
	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"`
}

Jump to

Keyboard shortcuts

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