npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@qse/approve-core

v3.8.2

Published

edu common approve core

Downloads

396

Readme

@qse/approve-core

审批核心 - 用于自定义(pc,h5)审批页面,提供了一些定好的接口和数据

仅用于自定义审批页面,现成提供的 pc,h5 都是基于这个写的

使用@qse/approve-core的话,就不用下载@qse/approve-h5 @qse/approve-pc

安装

# 安装 更新
npm i @qse/approve-core@latest

使用

使用示例

import React from 'react'
import { withApprove, WithApproveProps } from '@qse/approve-core'
/**
 * 你自定义的审批页面/组件
 *
 * withApprove 会包裹你的组件,并向下传递审批相关的所有数据,具体可以看声明文件
 *
 * @extends {React.Component<WithApproveProps>}
 */
class CustomApprove extends React.Component {
  render() {
    // 数据源
    const { approveState, actions } = this.props
    const { record, canIApprove, canRevoke, element_list, dataSource, sprList } = approveState
    const { init, resolve, reject, revoke } = actions
    // 你的页面
    return <div />
  }
}

// 导出的时候用高阶组件包裹下
export default withApprove(CustomApprove)

// 使用
<CustomApprove userId="" sheet_id="" campusid="" onCreated={(approveState, actions)=> {}}/>

API

声明文件里有更详细的解释

| 属性 | 说明 | 类型 | 默认值 | | -------------- | ------------------------------------------ | ------------------------------------ | ------ | | sheet_id | 表单 id | string | | | userId | 当前登录人 id | string | | | campusid | 校区 id 影响编辑时 List 类型的数据 | string | | | onCreated | 当 init 调用后,会执行这个方法返回详情数据 | (approveState: ApproveState) => void | | | allowNextSheet | 允许审批完成后自动跳转下一条单据 | boolean | false |

ApproveState

| 属性 | 说明 | 类型 | | ------------- | --------------------------------------------------------------------- | -------------------------------------- | | sheet_id | 当前单据的 sheet_id,可能与 props 中的 sheet_id 不同 | string | | next_sheet_id | 下一条单据的 sheet_id 只有完成审批时才会填入 | string | | modifyStore | 修改表单数据存储 | any | | canIApprove | 当前人是否可以审批 | boolean | | record | 单据详情 | any | | element_list | 表单显示字段 | any[] | | dataSource | 请审提交时候的数据 | any | | sprList | 审批设置里面的审批人 处理过的数据 | any[] | | originSprList | 审批设置里面的审批人 原始数据 | any[] | | canRevoke | 能否撤回 | boolean | | is_sign | 是否需要签名 | boolean | | lastSignInfo | 最后一次签名的信息 | {sign_hash: string; base64: string } |

Actions

| 属性 | 说明 | 类型 | | -------------------------- | ------------------------ | ---------- | | init | 初始化数据 | 看声明文件 | | resolve | 审批同意 | 看声明文件 | | reject | 审批撤回 | 看声明文件 | | rejectAfterApproveComplete | 审批驳回(审批通过后) | 看声明文件 | | revoke | 审批撤回 | 看声明文件 | | urge | 催办 | 看声明文件 | | sign2hash | base4 签名转 hash | 看声明文件 | | hash2sign | hash 转 base64 签名 | 看声明文件 | | queryLastSignHash | 获取最后一次 hash | 看声明文件 | | modifyForm | 修改表单 | 看声明文件 | | queryElementValueList | 获取 form 里的 list 数据 | 看声明文件 | | setState | 更新 ApproveState 数据 | 看声明文件 | | canIGotoNextSheet | 是否可以前往下一条单据 | 看声明文件 | | gotoNextSheet | 前往下一条单据 | 看声明文件 | | deliver | 转交 | 看声明文件 |