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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nbpi-commoncomponent

v0.2.18

Published

选择器和流程

Downloads

122

Readme

nbpi-commoncomponent

demo地址

使用方式

选择器组件


// 引入组件
import { Pubselector } from 'nbpi-commoncomponent'

// 示例 使用组件
<template>
	<div class="explame">
		<a-card title="选择器演示">
      <button @click="showModal">显示选择器</button>
      <Pubselector v-model="show" :config="config" :data="data" @ok="getData" @cancel="cancel" />
    </a-card>
	</div>
</template>

<script>
import { Pubselector } from 'nbpi-commoncomponent'

export default {
	components: {
		Pubselector
	},
	data () {
		return {
			show: false,
			// 基本配置
			config: {
				// 接口地址域名
				baseURL: '',
				// 组织code
				organizationCode: '',
				// 应用的唯一标识key
				appKey: '',
				// 应用的密钥
				appSecret: '',
			},
			// 传入默认选中的值
			data: {
				
			}
		}
	},
	methods: {
		getData (e) {
			console.log('选中的值', e)
		},
		cancel () {
			console.log('关闭弹窗')
		},
		showModal() {
			this.data = {
			// 已选部门
				"departList": [
						{
							// 组织code
							"organizationCode": "",
							// 组织名
							"organizationName": "宁波市纪委市监委机关",
							// 组织下的人员总数
							"count": "200"
						}
				],
				// 已选职员
				"userList": [
						{
							// 人员code
							"employeeCode": "",
							// 姓名
							"employeeName": "李军",
							// 职位
							"govEmpPosJob": null
						}
				]
		}
			this.show = true;
		}
	},
	created() {
		
	}
}
</script>
<style scoped>
  .explame {
    padding: 12px;
    box-sizing: border-box;
  }
</style>

自定义流程组件

<!-- 编流程辑页面 -->
<template>
  <AuditProcess ref="AuditProcess" :templateID="templateID" :isEdit="true" :config="config" @success="success"></AuditProcess>
</template>

<script>
import { AuditProcess } from 'nbpi-commoncomponent'

export default {
  name: 'Edit',
  inject: ['goPage'],
  components: {
    AuditProcess
  },
  props: {
    config: {
      type: Object,
      default: () => {
        return {
          
        }
      }
    },
  },
  data() {
    return {
      templateID: ''
    }
  },
  created() {
    this.templateID = this.$PUBSS.get('templateId')
  },
  methods: {
    success() {
			console.log('保存成功')
      // 返回上一页
      this.goPage(1)
		},
    refresh() {
			this.$refs.AuditProcess.refresh();
    }
  }
}
</script>

<!-- 预览页面 --> 
<template>
  <AuditProcess ref="AuditProcess" :isEdit="false" :config="config" @getTemplateId="getTemplateId">
    <a-button slot="button" type="primary" style="margin-left: 12px" @click="toEdit(2)">修改流程</a-button>
  </AuditProcess>
</template>

<script>
import { AuditProcess } from './../../../packages/index'

export default {
  name: 'Preview',
  inject: ['goPage'],
  components: {
    AuditProcess
  },
  props: {
    config: {
      type: Object,
      default: () => {
        return {
          
        }
      }
    },
    templateID: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      templateId: ''
    }
  },
  methods: {
    success() {
			console.log('保存成功')
		},
    getTemplateId(id) {
			this.templateId = id;
      this.$PUBSS.set('templateId', id);
			console.log('获取模板ID', id);
		},
    toEdit(page) {
      this.goPage(page)
    },
    refresh() {
			this.$refs.AuditProcess.refresh();
    }
  }
}
</script>