1.0.2 • Published 1 year ago

@riil-frontend/component-manage-metric-select v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

监控指标选择 ManageMetrics

manage-metrics

ManageMetrics

主资源或者主资源组件的指标选择

ManageMetrics

value 字段的结构

const value = {
	metricList: [
		{
			code: 'A', //指标行的id(指标)
			resType: 'switch', //资产类型
			resId: '000000001a8f4818', //主资产实例id
			metricCode: 'ping_status/network.interface-COM-operate_status', //指标code
			comId: '000000001a8f4875', //组件资产实例id
			color: '$color-data3-2', //指标折线颜色
			isDisabled: true / false, //是否隐藏
		},
	],
	funcList: [
		{
			code: 'FN-0', //函数行的id(统计值)
			func: 'SUM/AVG', //函数类型
			formula: 'A,B', //函数计算的指标行id
			displayName: '求和', //函数统计后折线名
			color: '$color-data3-2', //指标折线颜色
			isDisabled: true / false, //是否隐藏
		},
	],
};

API

参数名说明必填类型默认值备注
request请求any--
comClassName组件类名stringmanage-metric-select-
onChange组件指标改变时的回调函数签名:Function(value: mixed, error: mixed) => void参数:value: {mixed} 指标行记录error: {mixed} 表单返回的校验结果function--
value组件的值(受控字段)object-value={{metricList:[],funcList:[]}}
maxMetricNum添加指标最大值number5-
maxFunNum添加函数最大值number3-
colorComProps颜色组件属性objectcolorComProps={dataSource: 'rgba(0,214,225,1)','rgba(0,161,255,1)','rgba(45,222,152,1)','rgba(131,188,9,1)','rgba(0,180,65,1)','rgba(0,180,154,1)','rgba(88,66,255,1)','rgba(142,67,231,1)','rgba(255,174,58,1)','rgba(255,76,127,1)','rgba(220,15,45,1)','rgba(116,142,166,1)',}-
chartType趋势图显示类型可选值'line':线形图'bar':柱状图'area':面积图'scatter':散点图string'line'-
mode趋势图内部选择显示可选值'single':单个组件形式'combine':组合时序图string'single'值为'combine'时显示可定义元素
theme主题包string'theme-19926'-
isShowMsg控制添加指标数和函数数的显示booleantrue-
onDeleteItem指标删除事件签名:Function(record: mixed) => void参数:record: {mixed} 行记录消息Function-可自定义删除事件
hasLoading控制组件的 loadingbooleanfalse-
renderDom自定义元素(mode 为'combine'时使用)ReactDOM--
validatorMsg自定义校验函数function--
onChangeFormula组件函数改变时的回调函数签名:Function(value: mixed, record: mixed,name:string) => boolean参数:value: {mixed} 函数表单值record: {mixed} 函数行记录name: {string} 校验名function-返回值为 true 即有非法输入
formulaText函数表达式输入框提示信息string--
setLoading外层整体 loading 控制function-setState
1.0.2

1 year ago

1.0.0

1 year ago