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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@antu-toolkit/netoffice

v0.0.2

Published

工作流组件库

Downloads

27

Readme

@antu-toolkit/netoffice

工作流组件库,基于 Vue 2.7 + Element UI 开发,提供完整的业务办理流程弹窗功能。

功能特性

  • 📋 表单资源管理 - 支持制式表单、自定义组件、外部链接
  • 📎 附件管理 - 支持附件上传、下载、预览、删除
  • 🔄 流程办理 - 支持提交、回退、流转记录查看
  • 👥 用户选择 - 支持单流向/多流向提交,岗位内提交
  • 🔐 权限控制 - 细粒度的操作权限控制

安装

NPM 安装

npm install @antu-toolkit/netoffice
# 或
yarn add @antu-toolkit/netoffice
# 或
pnpm add @antu-toolkit/netoffice

依赖要求

  1. 引用 netovue.cssnetovue.umd.js
  2. 引用 jQuery
  3. 依赖
{
    "vue": "^2.7.16",
    "element-ui": "^2.15.14"
}

使用方式

方式一:完整引入(推荐)

import Vue from 'vue'
import ElementUI from 'element-ui'
import NetOffice from '@antu-toolkit/netoffice'
import '@antu-toolkit/netoffice/lib/netoffice.css'

Vue.use(ElementUI)
Vue.use(NetOffice)

方式二:按需引入

import {WorkflowDialog} from '@antu-toolkit/netoffice'
import '@antu-toolkit/netoffice/lib/netoffice.css'

export default {
    components: {
        WorkflowDialog
    }
}

方式三:浏览器直接引入

<!DOCTYPE html>
<html>
<head>
    <!-- 引入 Element UI 样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入 netovue.css -->
    <link rel="stylesheet" href="./netoffice/netovue.css">
    <!-- 引入组件库样式 -->
    <link rel="stylesheet" href="./lib/netoffice.css">
</head>
<body>
    <div id="app">
        <workflow-dialog
                :visible.sync="visible"
                :iid="iid"
                :wid="wid"
                :wiid="wiid"
        />
    </div>

    <!-- 引入 Vue -->
    <script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
    <!-- 引入 Element UI -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <!-- 引入 jQuery -->
    <script src="https://unpkg.com/jquery/dist/jquery.js"></script>
    <!-- 引入 netovue.umd.js -->
    <script src="./netoffice/netovue.umd.js"></script>
    <!-- 引入组件库 -->
    <script src="./lib/netoffice.umd.js"></script>

    <script>
        new Vue({
            el: '#app',
            data: {
                visible: true,
                iid: 'your-iid',
                wid: 'your-wid',
                wiid: 'your-wiid'
            }
        })
    </script>
</body>
</html>

组件 API

WorkflowDialog 工作流弹窗

工作流办理的核心组件,集成表单资源、附件管理、流程办理等功能。

Attributes

| 参数 | 说明 | 类型 | 可选值 | 默认值 | 必填 | |------------|---------|---------|-----|--------|----| | visible | 是否显示弹窗 | Boolean | — | false | 是 | | title | 弹窗标题 | String | — | "业务办理" | 否 | | iid | 流程实例ID | String | — | — | 是 | | wid | 工作流定义ID | String | — | — | 是 | | wiid | 工作项实例ID | String | — | '' | 否 | | stepCtrlId | 步骤控制ID | String | — | '' | 否 |

Events

| 事件名 | 说明 | 回调参数 | |---------------|---------------|----------------------------------------| | before-submit | 提交前触发,可用于表单校验 | (iid, wiid, params, {resolve, reject}) | | after-submit | 提交后触发 | (iid, wiid, params) | | close | 弹窗关闭时触发 | — |

方法

通过 ref 可以调用组件内部方法:


<template>
    <workflow-dialog ref="workflowRef" .../>
</template>

<script>
    export default {
        methods: {
            // 保存当前打开的资源
            handleSave() {
                this.$refs.workflowRef.saveOpenedResourceData()
            }
        }
    }
</script>

使用示例

基础用法


<template>
    <div>
        <el-button @click="openDialog">打开工作流</el-button>

        <workflow-dialog
            :visible.sync="dialogVisible"
            :iid="instanceId"
            :wid="workflowId"
            :wiid="workItemId"
            title="业务办理"
            @before-submit="handleBeforeSubmit"
            @after-submit="handleAfterSubmit"
            @close="handleClose"
        />
    </div>
</template>

<script>
    export default {
        data() {
            return {
                dialogVisible: false,
                instanceId: 'xxx',
                workflowId: 'xxx',
                workItemId: 'xxx'
            }
        },
        methods: {
            openDialog() {
                this.dialogVisible = true
            },
            handleBeforeSubmit(iid, wiid, params, {resolve, reject}) {
                // 执行表单校验
                const valid = this.validateForm()
                if (valid) {
                    resolve() // 继续提交
                } else {
                    reject() // 阻止提交
                }
            },
            handleAfterSubmit(iid, wiid, params) {
                // 提交成功后的回调
                this.$message.success('提交成功')
            },
            handleClose() {
                console.log('弹窗已关闭')
            },
            validateForm() {
                // 自定义校验逻辑
                return true
            }
        }
    }
</script>

环境变量配置

组件库依赖以下环境变量:

| 变量名 | 说明 | 示例 | |----------------------------------|-----------------|----------------------------| | VUE_APP_BASE_API | 接口基础路径 | ./ | | VUE_APP_FILE_GATEWAY_KEY | 文件网关业务类型 | default | | VUE_APP_FILE_GATEWAY_ZONE_CODE | 文件网关区域代码 | zone | | VUE_APP_FastDFS | FastDFS 文件服务器地址 | http://file.example.com/ |

注意事项

  1. 必须引入 Element UI:组件库基于 Element UI 开发,使用前需确保已正确引入
  2. Cookie 依赖:组件内部通过 tokenuserId Cookie 进行身份认证
  3. 样式覆盖:组件使用 /deep/ 深度选择器,如需自定义样式请注意优先级
  4. 表单组件约定
    • 制式表单组件需实现 submitData(callback, isSave) 方法
    • 自定义组件需实现 saveData(callback) 方法
    • Iframe 页面通过 postMessage 接收 saveData 命令

更新日志

0.0.1

  • 初始版本发布
  • 实现工作流弹窗基础功能
  • 支持表单资源、附件管理、流程办理

License

Apache-2.0