| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- @startuml
- title selectBoxCom
- 'skinparam packageStyle rect/' 加入这行代码,样式纯矩形'/
- skinparam backgroundColor #EEEBDC
- skinparam roundcorner 20
- skinparam sequenceArrowThickness 2
- 'skinparam handwritten true
- namespace selectBox #purple{
- ' 这里是公共类
- class TreeNode <<节点属性>>{
- +public id
- +public pid
- +public ...defaultProps
- }
- TreeNode --> DefaultProps
- interface DefaultProps <<树组件属性配置>>{
- +public label <指定节点标签为节点对象的某个属性值>
- +public children <指定子树为节点对象的某个属性值>
- +public disabled <指定节点选择框是否禁用为节点对象的某个属性值>
- +public isLeaf <指定节点是否为叶子节点,仅在指定了 lazy 属性的情况下生效>
- }
- class ListConfig <<左侧数据配置>>{
- + public items
- + public default
- }
- ListConfig --|> Items
- ListConfig --|> Default
- class Items <<左侧多选所有数据>>{
- +Object[] TreeNode
- }
- Items "1" -- "n..*" TreeNode
- class Default <<左侧多选默认选中数据>>{
- +Object[] TreeNode
- }
- Default "1" -- "n..*" TreeNode
- class AllNode <<所有节点>>{
- +Object[] TreeNode
- }
- AllNode "1" -- "n..*" TreeNode
- class CheckedNode <<被选中节点>>{
- + Object[] TreeNode
- }
- CheckedNode "1" -- "n..*" TreeNode
- ' 整个组件暴露的方fa
- class SelectBox <<entry,export>>{
- +public export
- -private leftSelect
- +public rightSelect
- -private init(entry)
- + public Export:save()
- }
- SelectBox o-- Export
- SelectBox o-- leftSelect
- SelectBox --|> SelectBoxInsideFn.Init
- SelectBox o-- rightSelect
- SelectBox o-- Entry
- class leftSelect <<选人组件左侧选人控件>>{
- + Object leftList
- }
- leftSelect --|> ListConfig
- class rightSelect <<选人组件右侧选人控件>>{
- + Object rightList
- }
- rightSelect --|> ListConfig
- class Style <<选人组件自定义样式>>{
- + public listStyle String:'tree|list'
- + public inDep Boolean
- }
- ' 入参
- class Entry <<组件入参>>{
- ' 所有节点(一维数组)
- +public allNode Array<TreeNode>
- ' 被选中的节点
- +public checkedNode Array<TreeNode>
- ' 默认节点配置
- +public defaultProps
- ' 样式配置
- +public style
- }
- note left of Entry : 这是一个入参
- Entry o-- DefaultProps
- Entry o-- AllNode
- Entry o-- CheckedNode
- Entry o-- Style
- ' 出参
- interface Export <<组件出参>>{
- {abstract} addList&deleteList methods()
- {static} rightList callback()
- }
- note top of Export: 这是一个组件出参
- }
- namespace SelectBoxInsideFn #yellow {
- ' 右侧组件init方法
- interface Init extends InitData,InitleftData,InitrightData,disable {
- - private InitData()
- - void disable()
- - void initLeftData()
- - void InitrightData()
- }
- note top of InitData : 初始化数据
- Init ...> selectBox.Entry
- interface InitData{
- - void initData()
- }
- interface InitleftData extends InitTree,initList {
- - void JudgeStyle()
- - void InitTree()
- - void initList()
- }
- interface InitrightData {
- - void JudgeStyle()
- }
- interface disable {
- + void disable()
- }
- InitleftData --|> JudgeStyle
- interface JudgeStyle {
- - String<'tree'|'list'> judgeStyle
- }
- note left of JudgeStyle: 判断左侧选择框样式
- interface InitTree{
- - InitTree()
- }
- note right : 如果是树运行initTree
- interface initList{
- - initList()
- }
- note left : 如果是列运行initList
- }
- @enduml
|