Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@tntd/mm-flow

Package Overview
Dependencies
Maintainers
10
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tntd/mm-flow

审批流

latest
npmnpm
Version
0.1.7
Version published
Maintainers
10
Created
Source

基于mm-flow的封装的工作流,暴露组件如下

组件作用
ItemPanel左侧栏目
Item左侧栏目子项
ToolBar头部bar
Command头部操作项,撤销、回退、放大、缩小等
Flow中间面板

Command参数

参数作用
redo重做
undo撤销
zoom-in放大
zoom-out缩小
fullscreen适应画布
fullscreen-exit实际尺寸
自定义 {type:"",click:void 0}其他按钮需要定义,注意type为antd中的Icon type
<Command 
    types={
        [
            "redo","undo","zoom-in","zoom-out","fullscreen","fullscreen-exit",
            {
                type:"eye",
                click:this.preview
            }
        ]
    }
/>

Item参数

参数参考值作用
typeflow-start节点类型
name开始节点名称
size[50, 50]大小
componentaudit节点详情加载的组件, 在Flow组件中传入具体的Component后续在Flow中会提及
isRoottrue是否为跟节点
nodeTypestart节点类型,例如排他的场景type一样,所以需要通过nodeType区分排他开始、排他结束
config{}节点相关的属性,即节点详情中右侧的表单内容相关的值

Flow参数

参数参考值作用
checkNewLinevoid 0判断节点之间是否可以链接,例如开始节点只能有输出节点
data{}面板中节点线条的初始化数据
initvoid 0初始化flow的函数
lineNeedConfig({line, fromNode})=>{}判断线条是否需要展示配置面板
lineRed({line, fromNode})=>{}线条是否需要飘红
onNodeClick({ node, fromNodes})=>{}节点点击事件
onLineClick({line,fromNode,rightbarLine})=>{}线条点击事件
onLineAdd({line})=>{}连接线条之间的回调
clickvoid 0点击面板空白事件
changeNode({node})=>{console.log(node)}监听节点详情中变化事件
changeLine({line, fromNode}) => {}监听线条详情中变化事件
nodeComponents{ "audit": Audit,"base": Base}将节点详情的表单组件传入,与Item中component对应
lineComponents{"line": Line}将线条详情的表单组件传入,与Item中component对应
auditedNodes{...node,"status":2}一般用于审批流查看模式。节点信息基础上加上节点状态是审核中,已成功,异常
animatevoid 0自定义动画

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts