@uyun/ec-argument-config
参数配置组件
Last updated 3 years ago by liupeng .
UNLICENSED · Repository · Bugs ·
$ cnpm install @uyun/ec-argument-config 
Private package

category: Components type: Automation title: ArgumentConfig subtitle: 参数配置 cols: 1

作者:夏显林

API

<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) -

参数类型:types

说明 类型
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 为出参专属,入参无法使用

参数数据结构:ArgumentModel

{
  id: "", // 参数ID
  name: "", // 参数名称
  originName: "", // 参数原名称
  type: ”“, // 参数类型
  value: "", // 参数值
  required: false, // 是否必填
  description: "", // 参数描述
  isTextTrans: false, // 是否由文本类型转换来的
  groupName: ”“, // 分组名称
  matchRule: "", // 检验规则,只有当参数为必填是可填
  ruleDescription: "" // 校验规则描述
}

文件参数值数据结构:FileModel

{
  id: "", // 文件id
  name: "", // 文件名称
  hubType: "", // 存储仓库
  storefs: "", // <服务端使用的字段>
  distributePath: "" // 下发路径
}

节点参数值数据结构:DeviceModel

{
  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地址
}

字典参数值数据结构:DictModel

{
  id: "", // 字典项ID
  code: "", //字典项code
  name: "", // 字典项名称
  value: "", // 字典项值
  description: "", // 字典项描述
  type: "", //字典类
  dictTypeCode: "", // 字典类code
  dictTypeName: "" // 字典类名称
}

用户参数值数据结构:UserModel

{
  id: "", // 用户id
  name: "" // 用户名称
}

配置项参数值数据结构:CIModel

 {
  title: "", // CI标题
  type: {}, // CI类
  fields: [], // CI字段
  item: [], // CI项
  multiplable: false // 是否多选
}
// type值数据结构
{
  id: "",
  code: "",
  name: ""
}
// fields值数据结构
{
  code: "",
  name: "",
  desrc: ""
}
// item值数据结构
{
  id: "",
  name: "",
  classCode: ""
}

监管代理参数值数据结构:ProxyModel

{
  id: "", // 代理ID
  name: "" // 代理名称
}

脚本参数值数据结构:ScriptModel

{
  id: "", // 脚本ID
  name: "", // 脚本名称
  status: 0, // 脚本状态
  title: "", // 脚本版本名称
  version: 0, // 脚本版本号
  distributePath: "" // 下发路径
}

表格参数值数据结构:TableModel

{
  column: [], // 列数据
  value: [] // 值数据
}
// column值数据结构
{
  name: "", // 列名
  type: "", // 列参数类型。只支持text,option
  default: "", // 列参数默认值
  description: "" // 列描述
}
// value值数据结构,对象的key为列数据的列名,值对应相应类型的数据结构
{
  [column.nane]:<value>
}

Current Tags

  • 1.0.0-dev.0                                ...           dev (3 years ago)
  • 0.1.14                                ...           latest (3 years ago)

15 Versions

  • 0.1.14                                ...           3 years ago
  • 1.0.0-dev.0                                ...           3 years ago
  • 0.1.13                                ...           3 years ago
  • 0.1.12                                ...           3 years ago
  • 0.1.10                                ...           4 years ago
  • 0.1.9                                ...           4 years ago
  • 0.1.9-alpha.1                                ...           4 years ago
  • 0.1.9-alpha.0                                ...           4 years ago
  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (5)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org