0.2.37 • Published 11 months ago

june-ui v0.2.37

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

公用组件库

安装

npm

$ npm i june-ui -S 

yarn

$ yarn add june-ui 

更新

npm

$ npm update june-ui@latest 

yarn

$ yarn upgrade june-ui@latest 

组件列表

  • FlowList <流程列表>
  • FlowDetail <流程详情>
  • FlowRecord <审批日志>
  • FlowViewer <流程图>
  • FlowActionButtons <转办、同意、驳回组合按钮>
  • FlowTransferModal <转办弹出框>
  • FlowFullScreen <全屏按钮>

示例

FlowList

Image text

import React from 'react';
import { config } from 'ice';
import { appHistory } from '@ice/stark';
import { FlowList } from 'june-ui';
import { get, post } from '@/api/request';

export default function FlowListPage(props) {

  /**
  * 传入的请求方法
  *
  */
  const request = (req) => {
    switch (req.method) {
      case 'GET':
        return get(req.url, req.data, true);
      case 'POST':
        return post(req.url, { data: req.data }, true);
      default:
        break;
    }
  };

  /**
  * 列表 查看按钮点击事件 
  * record 点击行数据
  */
  const onLinkClick = (_, record, index) => {
    // 路由跳转
  };

  return <FlowList request={request} onLinkClick={onLinkClick} />;
}

FlowList props

参数说明类型默认值
request请求方法function/
onLinkClick列表查看点击function/

FlowDetail

Image text

import React, { useEffect, useState } from 'react';
import { FlowDetail } from 'june-ui';
import { useParams } from 'ice';
import { get, post } from '@/api/request';

export default FlowDetailPage function () {

  const [id, setId] = useState()
  const params = useParams()

  const request = (config) => {
    switch (config.method) {
      case 'GET':
        return get(config.url, config.data, true);
      case 'POST':
        return post(config.url, { data: config.data }, true);
      default:
        break;
    }
  };

  useEffect(() => {
    setId(params.id)
    return () => {};
  }, []);

  return <FlowDetail id={id} request={request} />;
};

FlowDetail props

参数说明类型默认值
id流程实例IDstring/
request请求方法function/
renderInfo基本信息渲染方法function/
renderApprove审批表单渲染方法function/
onTransfer转办回调function/
onAgree同意回调function/
onReject驳回回调function/
0.2.37

11 months ago

0.2.22

2 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago