$ cnpm install @uyun/ec-argument-config
作者:夏显林
<ArgumentConfig />
参数配置组件主要分为两大类:输入参数和输出参数,分三种模式:编辑、详情,执行,但是出参没有执行模式
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
category | 类别,输入参数、输出参数,可选值为 input、output | string | input |
mode | 模式,编辑、详情、执行,可选值为 edit、info、exec | string | edit |
value | 值,参数集合 | ArgumentModel[] | [] |
types | 参数类型集合,指定当前可使用的参数类型,编辑模式专属 | string[] | [] |
format | 入参的使用格式,可选值为 keyword、position,如果不传入则不可编辑该值,默认为 keyword,编辑模式专属 | string | '' |
copy | 判断是否出现复制按钮,可复制部分参数值,详情模式专属 | boolean | false |
showGroup | 是否对入参进行分组,入参专属 | boolean | false |
getValidFn | 获取校验函数,入参执行模式专属 | Function(cb:(errors, values)->void) | - |
onChange | 值变化回调函数,编辑模式下使用,其中第二个参数 format 为入参特有 | Function(value:string, format:string) | - |
值 | 说明 | 类型 |
---|---|---|
text | 文本 | string |
number | 数值 | number |
file | 文件 | FileModel[] |
host | 节点 | DeviceModel |
option | 字典 | DictModel[] |
passwd | 密码 | string |
dycText | 动态文本 | string |
user | 用户 | UserModel[] |
ci | 配置项 | CIModel |
proxy | 监管代理 | ProxyModel[] |
table | 表格 | TableModel[] |
script | 脚本 | ScriptModel[] |
hyperlink | 超链接 | string |
其中 hyperlink 为出参专属,入参无法使用
{
id: "", // 参数ID
name: "", // 参数名称
originName: "", // 参数原名称
type: ”“, // 参数类型
value: "", // 参数值
required: false, // 是否必填
description: "", // 参数描述
isTextTrans: false, // 是否由文本类型转换来的
groupName: ”“, // 分组名称
matchRule: "", // 检验规则,只有当参数为必填是可填
ruleDescription: "" // 校验规则描述
}
{
id: "", // 文件id
name: "", // 文件名称
hubType: "", // 存储仓库
storefs: "", // <服务端使用的字段>
distributePath: "" // 下发路径
}
{
select: "", // 当前选中类型,有hosts, tags, ips
hosts: [], // 节点列表,值结构为{id: '', name:''}
tags: [], // 标签列表
ips: [], // ip列表
execHost: "", // 执行环境
objType: 0 // 执行目标
}
// hosts值数据结构
{
id: "", // 主机ID
name: "" // 主机名称
}
// tags值数据结构
{
zone: { id: "", name: "" }, // 域信息
value: [], // tag列表,类型为string[]
rel: "" // 交集或并集,值为or/and
}
// ips值数据结构
{
zone: { id: "", name: "" }, // 域信息
value: "" // ip地址
}
{
id: "", // 字典项ID
code: "", //字典项code
name: "", // 字典项名称
value: "", // 字典项值
description: "", // 字典项描述
type: "", //字典类
dictTypeCode: "", // 字典类code
dictTypeName: "" // 字典类名称
}
{
id: "", // 用户id
name: "" // 用户名称
}
{
title: "", // CI标题
type: {}, // CI类
fields: [], // CI字段
item: [], // CI项
multiplable: false // 是否多选
}
// type值数据结构
{
id: "",
code: "",
name: ""
}
// fields值数据结构
{
code: "",
name: "",
desrc: ""
}
// item值数据结构
{
id: "",
name: "",
classCode: ""
}
{
id: "", // 代理ID
name: "" // 代理名称
}
{
id: "", // 脚本ID
name: "", // 脚本名称
status: 0, // 脚本状态
title: "", // 脚本版本名称
version: 0, // 脚本版本号
distributePath: "" // 下发路径
}
{
column: [], // 列数据
value: [] // 值数据
}
// column值数据结构
{
name: "", // 列名
type: "", // 列参数类型。只支持text,option
default: "", // 列参数默认值
description: "" // 列描述
}
// value值数据结构,对象的key为列数据的列名,值对应相应类型的数据结构
{
[column.nane]:<value>
}
Copyright 2013 - present © cnpmjs.org