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

teld-approval-flow

v0.2.5

Published

build a npm pack for teld-approval-flow

Downloads

89

Readme

teld-approval-flow

TELD 审批流设计器组件包,主要包含设计器和查看器两大功能。
另外对于旧有流程图转换新版流程图,提供了从.bpmn文件转换的功能。

|Runtime|Designer| |:---:|:---:| |runtime|designer|

Usage

用于 TELD 内部 ToC 框架中

  1. 组件准备

/plugins/components/pc.js文件中注册项目中用到的组件
确保如下注册组件:

// import Vue from 'vue';
import { install }  from '@teld/component-proxy/export/pc.js'
import {
  Button,
  Popover,
  Tooltip,
  Drawer,
  Input,
  Link,
  RadioGroup,
  RadioButton,
  Radio,
  Switch,
  // ...
} from '@teld/component-proxy/pc.js'

const components = [
  Button,
  Popover,
  Tooltip,
  Drawer,
  Input,
  Link,
  RadioGroup,
  RadioButton,
  Radio,
  Switch,
  // ...
]

// El-xx 组件注册为 Tp-xx
install(components)

// El-xx 组件
// components.forEach(c => {
//   Vue.component(c.name, c);
// })
// 2023.07.13 ↑ 这里不需要了

关于注册组件:
作为NPM包开发中本地 Demo 开发无法安装引入@teld/component-proxy的组件,
因为 ToC 框架中对引入路径做了特殊处理,组件代理的这个包只能在 ToC 框架下使用
@teld/component-proxy/pc.js这个引入解析为每个组件对应的element-ui引入路径,
所以实际注册的还是element-ui的组件。
所以包开发中无法使用tp-而使用el-导致这里注册组件需要修改;
为了方便,将来考虑包中直接使用tp-标签,避免该处引入要修改的麻烦

2023.07.13 已去除el-,全部替换为tp-

另外,关于上面用到的组件,应在/assets/custom-pc.scss文件中引入其样式:

@import "~@teld/component-proxy/style/pc/drawer.scss";
@import "~@teld/component-proxy/style/pc/radio.scss";
@import "~@teld/component-proxy/style/pc/radio-button.scss";
@import "~@teld/component-proxy/style/pc/radio-group.scss";
@import "~@teld/component-proxy/style/pc/icon.scss";

(如果还有其它组件,缺少样式的话,按照上面的方式进行引入即可)

  1. plugins下新建approval-flow.js文件
import Vue form 'vue'
import * as TAF from 'teld-approval-flow'
import 'teld-approval-flow/lib/approval-flow.css'
Vue.use(TAF, {
  scaleButtons: {
    visible: true,
    position: 'bottom right',
    spaceX: '10px',
    spaceY: '20px',
  },
  designer: {
    useButtonToggleAll: true, // 【全展开|全收起】
    legendDefaultOpen: true, // 默认展开图例--废弃
    legend: {
      open: true, // 默认展开图例(新)
    },
  }
})
// v0.1.2 起支持传入配置控制缩放按钮组,上面示例等同于默认值
  1. nuxt.config.js中引入approval-flow.jsssr: false即可

  2. 引入flow数据管理模块

store/下新建flow.js文件

注:nuxtjs 会按文件名做子模块引入,无需手动在store/index.js中引入子模块

// import { flowStore } from 'teld-approval-flow'
// export default flowStore
// 用 ES6 的解构会导致后面使用 Store 时有问题,暂时使用 require 或者
// import * as TAF
// export default TAF.flowStore

// 或
const { flowStore } = require('teld-approval-flow').default || require('teld-approval-flow');
export default flowStore;
  1. 引入完成,使用组件
  • ApprovalFlowRuntime
  • ~~ApprovalFlowDesigner~~
  • 以上两个基于组件ApprovalFlow,可以直接引入该组件使用更灵活

运行时:查看流程实例带流转状态的流程图

<approval-flow-runtime :flow-info="flowInfo">

设计时:设计器及静态流程图查看都属于设计时

<!--
<approval-flow-designer :design-data="designData" :editable="editable" />
-->

<!-- 设计时-编辑 -->
<approval-flow :design-data="designData" mode="edit" />
<!-- 设计时-查看 -->
<approval-flow :design-data="designData" mode="view" />

Changelog

changelog

Development

pnpm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Deploy (publish to NMP)

pnpm build
pnpm publish

注:2023-12后 NPM 问题(nodejs14 build 后,切 nodejs18 publish,否则发布不上文件,但由于老旧又无法直接使用 18 build)

Customize configuration

See Configuration Reference.