0.2.4 • Published 6 years ago

gz_modules v0.2.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

大数据平台模块库

将模块enum{组件、筛选器、组}拆开单独维护
模块负责接受配置、数据渲染,提供暴露用户行为的接口。从业务逻辑中解耦

组件

筛选器

module.common

属性属性说明属性类型
requestDelete请求删除func
requestCopy请求复制func
requestChangeZindex请求改变层级func
requestLocationChange请求位置改变func
requestSizeChange请求大小改变func
kind模块种类enum{component,filter,group}
type模块类型*
moduleId模块idstring
title标题{ value, show, style:{color,fontSize,fontFamily,textAlign,background} }
style模块样式{background,border,borderRadius}
size模块大小{width,height}
location模块位置{top,left}
isEdit模块是否被选中bool
zIndex模块层级number
activeGroup是否激活组bool

chart.common

属性属性说明属性类型
chartConfig图表配置{axis,legend,draw,textStyle}
chartType图表类型string
data图表数据any
border边框string
borderRadius边框弧度number
onClick点击图标接口func

chart.line

无特异性配置

chart.bar

无特异性配置

chart.area

属性属性说明属性类型
series.areaStyle面积图样式object

chart.bar_stack

属性属性说明属性类型
series.stack数据堆叠string

chart.bar_row

无特异性配置

chart.bar_row_stack

属性属性说明属性类型
series.stack数据堆叠string

chart.rose

属性属性说明属性类型
series.radius半径array
series.roseType是否展示成南丁格尔图object
series.center中心(圆心)坐标array
series.symbolSize标记的大小object

chart.rose_ring

属性属性说明属性类型
series.radius半径array
series.roseType是否展示成南丁格尔图object
series.center中心(圆心)坐标array
series.symbolSize标记的大小object

chart.scatter

 无特异性配置

chart.nested_ring

 无特异性配置
属性属性说明属性类型
series.radius半径array
series.roseType是否展示成南丁格尔图object
series.center中心(圆心)坐标array
series.symbolSize标记的大小object

chart.funnel

属性属性说明属性类型
series.minSize数据最小值 min 映射的宽度string
series.maxSize数据最大值 max 映射的宽度string
series.sort数据排序string

chart.gauge

 无特异性配置

chart.heatmap

属性属性说明属性类型
yAxis.splitArea坐标轴在 grid 区域中的分隔区域Object
visualMap视觉映射组件Object

textbox

属性属性说明属性类型
width宽度string
height高度string

chart.line_bar

 无特异性配置

chart.wordCloud

 无特异性配置

chart.rect_tree

 无特异性配置rect_tree

textarea

属性属性说明属性类型
value文本内容string
onTextChange文本改变接口func

image

属性属性说明属性类型
imgUri图片地址string
width宽度string
height高度string

shape.rect

无差异性配置

shape.circle

属性属性说明属性类型
width宽度string
height高度string

shape.line

属性属性说明属性类型
width宽度string
height高度string
lineBackgroud线条颜色string

shape.arrow

属性属性说明属性类型
width宽度string
height高度string
lineBackgroud线条颜色string

table

属性属性说明属性类型
data数据[]
columnsToRow行列转换bool
otherStyle.tabletable:otherStyle.tableobject
order是否添加序号bool
pageSize每页条数number

table:otherStyle.table

属性属性说明属性类型
columnsToRow行列转换bool
pageSize每页条数num
tableHeader表头{visible,color,fontSize,fontFamily,fontWeight,textAlign,background}
tableBody表主体{wordBreak,color,fontSize,fontFamily,fontWeight,textAlign,background:{main,odd,even}},grid:{xVisivle,yVisible,color}

filter.list

属性属性说明属性类型
operationType操作方式enum{list,dropdown,nav}
isMultiple是否多选bool
otherStyle.option选项区样式{color,fontSize,fontFamily}
onConditionChange条件改变接口func

filter.date

属性属性说明属性类型
otherStyle.option选项区样式{color,fontSize,fontFamily}
onConditionChange条件改变接口func

filter.text

属性属性说明属性类型
otherStyle.option选项区样式{color,fontSize,fontFamily}
onConditionChange条件改变接口func

调试

调试指的是本地调试 React 组件,只需要:

npm start

然后在弹出的页面中点击 demo 文件夹即可!

打包

打包指的是将 React 组件编译打包成 js 和 css 文件,方便其他组件调用,只需要:

npm run build

发布

发布指的是将 React 组件发布到 npm 仓库中,首先执行此命令重新指定你的 npm 包的 name 和 version 等信息:

npm init

然后,登录 npm:

npm login

最后,发布:

npm publish

调用 React 组件

发布完成后,就可以在调用了。

首先,安装你发布的 React 组件

npm i gz_modules --save

然后,在代码中调用:

import modules from 'gz_modules';

就可以使用了!