0.6.6 • Published 4 years ago

yyuap-bpm v0.6.6

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

0.6.6 系列 多语版本 主数据专用

Bpm流程组件

npm version NPM downloads

1. 简介

基于 tinper-bee 组件库对iUap原有UUI流程业务组件进行封装成React应用组件 查看更多应用组件前往 https://github.com/tinper-acs

总共包含8种组件,分别是:

序号组件名称备注
1BpmFlowChart流程图
2BpmTable流程历史表格
3BpmTaskApproval流程审批面板
4BpmButtonSubmit流程提交按钮
5BpmButtonRecall流程收回按钮
6BpmWrap包含流程图和流程历史表格
7BpmTaskApprovalWrap流程整合审批面板
8BpmTestCheckTable测试任务中心表格组件

实际使用中不需要使用全部组件,按照自己的业务开发需求选择对应的应用组件即可

2. 安装

  • 前端工程内置 tinper-bee 组件库以及平台参照组件 yyuap-ref
  • 通过npm下载使用 npm install yyuap-bpm -S

3. 使用

如果使用流程图相关组件那么导入:

import { BpmButtonSubmit,BpmButtonRecall,BpmTaskApprovalWrap,BpmFlowChart,BpmTable } from 'yyuap-bpm';

然后在render使用的时候传入相应组件需要的参数即可:

//提交流程按钮使用

<BpmButtonSubmit
    className="ml5"
    checkedArray={[{"id":"02a128d65c47405494f8f2baf087117e"}]}
    funccode="react"
    nodekey="003"
    refCode="newuser"
    url={`/sany_order/submit`}
    urlAssignSubmit={`/sany_order/assignSubmit`}
    filterRefUrl="/wbalone/common/filterRef"
    onSuccess={() => console.log('success')}
    onError={(err) => console.log(err)}
    onStart={() => console.log('start loading')}
    onEnd={() => console.log('end loading')}
>
    <Button size='sm' shape="border">
        <Icon type='uf-arrow-c-o-up' />提交
    </Button>
</BpmButtonSubmit>

//收回流程按钮使用

<BpmButtonRecall
    className="ml5"
    checkedArray={[{"id":"02a128d65c47405494f8f2baf087117e"}]}
    url={`/sany_order/recall`}
    onSuccess={() => console.log('success')}
    onError={(err) => console.log(err)}
    onStart={() => console.log('start loading')}
    onEnd={() => console.log('end loading')}
>
    <Button size='sm' shape="border">
        <Icon type='uf-arrow-c-o-down' />收回
    </Button>
</BpmButtonRecall>

//流程审批面板使用

<BpmTaskApprovalWrap
    id={rowData.id}
    onBpmFlowClick={() => console.log('这里是流程图按钮的事件,用于跳转到流程图组件页面') }
    appType={"1"}
    onSuccess={() => console.log('success')}
    onError={(err) => console.log(err)}
    onStart={() => console.log('start loading')}
    onEnd={() => console.log('end loading')}
/>

//流程图组件

<BpmFlowChart
    processDefinitionId={"eiap350694:3:e2e70948-9559-11e8-b376-02420cbf1b08"}
    processInstanceId={"1352ad87-955e-11e8-b376-02420cbf1b08"}
/>

//流程图历史表格组件

<BpmTable
    processDefinitionId={"eiap350694:3:e2e70948-9559-11e8-b376-02420cbf1b08"}
    processInstanceId={"1352ad87-955e-11e8-b376-02420cbf1b08"}
/>

4. API

BpmFlowChart(流程图)
序号参数类型说明
1urlstring请求流程图的接口默认走平台eiap-plus服务
2processDefinitionIdstring流程图服务必备参数
3processInstanceIdstring流程图服务必备参数
4widthstring流程图宽度
5heightstring流程图高度
BpmTable(流程历史表格)
序号参数类型说明
1processDefinitionIdstring流程图服务必备参数
2processInstanceIdstring流程图服务必备参数
BpmTaskApproval(审批面板)
序号参数类型说明
1idstring审批的任务ID
2refCodestring参照组件需要的refCode
3appTypestring审批面板类型1=待审批、2=弃审
4onStartfunction调用异步服务回调,一般用于请求Loading处理
5onSuccessfunction调用后端服务成功后的回调
6onErrorfunction调用后端服务错误后的回调
7onEndfunction结束的回调Loading
BpmButtonSubmit(流程提交)
序号参数类型说明
1checkedArrayarray传入的选中状态数组(流程单据前面的选择框数据)
2funccodestring功能节点编码
3nodekeystringnodekey
4refCodestring参照组件需要的refCode
5urlstring提交流程所需要的地址,必须传入
6urlAssignSubmitstring流程指派最后提交的接口
7filterRefUrlstring参照组件需要的URL
8onSuccessfunction提交流程业务成功后回调
9onErrorfunction提交流程业务失败后回调{type:1,msg:"错误消息"}type=1代表逻辑错误,type=2代表服务器错误
10classNamestring传入class
11onStartfunction调用异步服务回调,一般用于请求Loading处理
12onEndfunction结束的回调Loading
13sizestring指派弹出modal的尺寸sm,lg,xlg
14scrollYnumber指派演出modal内的表格滚动高度
15isOnebool是否为一条单据提交默认是多条提交
BpmButtonRecall(流程收回)
序号参数类型说明
1checkedArrayarray传入的选中状态数组(流程单据前面的选择框数据)
2urlstring提交流程所需要的地址,必须传入
3onSuccessfunction提交流程业务成功后回调
4onErrorfunction提交流程业务失败后回调{type:1,msg:"错误消息"}type=1代表逻辑错误,type=2代表服务器错误
5classNamestring传入class
6onStartfunction调用异步服务回调,一般用于请求Loading处理
7onEndfunction结束的回调Loading
BpmWrap(流程图+历史表格)

基于BpmFlowChart和BpmTable组合使用的流程查看组件 当传入id(TaskID)、processDefinitionId、processInstanceId的时候不请求getbillid接口 当只传入id(单据ID)的时候,组件会从getbillid处请求所需要的参数

序号参数类型说明
1idstring传入的ID(注:只传ID的话,就是单据ID组件会去请求getbillid接口拿到流程需要的参数,如果传递3个参数的话ID就是TaskID,processDefinitionId,processInstanceId)
2processDefinitionIdstringprocessDefinitionId
3processInstanceIdstringprocessInstanceId
BpmTaskApprovalWrap(审批面板整合)
序号参数类型说明
1idstring传入的ID(注:只传ID的话,就是单据ID组件会去请求getbillid接口拿到流程需要的参数,如果传递3个参数的话ID就是TaskID,processDefinitionId,processInstanceId)
2refCodestring参照组件需要的refCode
3processDefinitionIdstringprocessDefinitionId
4processInstanceIdstringprocessInstanceId
5onBpmFlowClickfunction流程图按钮单击事件,一般用来给流程图页面跳转路由和参数使用
6appTypestring审批面板类型1=待审批、2=弃审、3=无显示
7onStartfunction调用异步服务回调,一般用于请求Loading处理
8onSuccessfunction调用后端服务成功后的回调
9onErrorfunction调用后端服务错误后的回调
10onEndfunction结束的回调Loading
BpmTestCheckTable(测试用不要使用在项目里)

用来开发的时候测试任务中心表格,禁止用于生产阶段切记!!!

5. 指南

  1. 审批面板内的流程图按钮事件如何编写? 首先使用审批面板组件
//导入流程审批面板整合组件
import { BpmTaskApprovalWrap } from 'yyuap-bpm';

导入组件后,使用我们的组件,传入对应的props,这里主要讲解流程图按钮的后续事件如何做onBpmFlowClick

<BpmTaskApprovalWrap
    id={rowData.id}
    onBpmFlowClick={() => { this.onClickToBPM(rowData) }}//拿到我们的行数据,主要用id
    appType={appType}
    onStart={this.onBpmStart}
    onEnd={this.onBpmEnd}
    onSuccess={this.onBpmSuccess}
    onError={this.onBpmError}
/>

这里面的onBpmFlowClick就是我们需要传入的事件,也就是点击流程图按钮,触发页面跳转带着相应的参数传给我们的流程图页面去使用

编写按钮内的事件

    // 跳转到流程图
    onClickToBPM = (rowData) => {
        actions.routing.push({
            pathname: 'example-chart',//跳转到我们写好的路由流程图那里 /#/templates/example-chart?id=46652dd9900a4f0ca6372eb42a890c83
            search: `?id=${rowData.id}`//构建我们需要的单据ID传入即可,组件内部会请求对应的参数
        })
    }

上面就设置好我们流程图按钮带着单据id跳转到流程图路由页面了,接下来去编写最终的流程图页面,一般来说脚手架工程里面已经写好了

//导入我们需要的流程图整合组件,包含流程图和历史审批面板表格
import { BpmWrap } from 'yyuap-bpm';
//以及我们需要使用的参数解析组件
import queryString from 'query-string';

然后在我们的render里就可以写组件的使用

注意这里,如果用户传入id那么processDefinitionId和processInstanceId就无需设置,它会发送请求查询该参数 如果三个参数都传递了,那么就不会发送请求,直接调用最终后台接口显示流程图和历史数据表格

    render() {
        let { id, processDefinitionId, processInstanceId } = queryString.parse(this.props.location.search);
        return (
            <div>
                <BpmWrap
                    id={id}
                    processDefinitionId={processDefinitionId}
                    processInstanceId={processInstanceId}
                />
            </div>
        );
    }



6. Change Log

Change Log

0.6.6

4 years ago

0.3.40

5 years ago

0.6.5

5 years ago

0.3.28-walsin

5 years ago

0.3.27-walsin

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.3.39

5 years ago

0.3.26-walsin

5 years ago

0.3.26-TW

5 years ago

0.3.38

5 years ago

0.3.37

5 years ago

0.3.36

5 years ago

0.3.35

5 years ago

0.6.2

5 years ago

0.3.34

5 years ago

0.6.1

5 years ago

0.5.4

5 years ago

0.3.33

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.3.32

5 years ago

0.5.1

5 years ago

0.3.31

5 years ago

0.3.30

5 years ago

0.3.29

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.3.28

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.3.27

5 years ago

0.3.26

5 years ago

0.3.25

5 years ago

0.3.24

5 years ago

0.3.23

5 years ago

0.3.22

6 years ago

0.3.21

6 years ago

0.3.20

6 years ago

0.2.14

6 years ago

0.3.19

6 years ago

0.3.18

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.2.11

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.2.10

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.14

6 years ago

0.0.19

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.0.18

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago