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

d3j-commonop

v2.0.28

Published

d3j commonop for private

Downloads

166

Readme

d3j-commonop

d3j-commonop 是一个多tab的通用后台。 使用前请先阅读:通用多tab后台

how to use

  1. first install create-react-app, create a project
npm install -g create-react-app
create-react-app my-app
cd my-app/
  1. install d3j-commmonop
npm install d3j-commonop --save
  1. 执行: "fibjs ./node_modules/d3j-commonop/generateCode.js"

  2. give a appConfig.json at src

npm run codeInit
npm start

appConfig

like this:

{
  "name": "Hello World",
  "logo":"http://lorempixel.com/200/80/",
  "defaultRoot": true,
  "menu":[
    {
      "icon": "mail",
      "label": "基本信息",
      "children": [
        {
          "icon": "setting",
          "label": "用户管理",
          "url": "/userlist",
          "data": {
            "title": "用户",
            "dataSource": "userlist",
            "pagination": {
              "size": 2,
              "pages": 7
            },
            "columns": [{
              "title": "用户名",
              "dataIndex": "username",
              "key": "username",
              "search": true
            }, {
              "title": "年龄",
              "dataIndex": "age",
              "key": "age",
              "search": true
            }, {
              "title": "密码",
              "dataIndex": "password",
              "key": "password"
            }, {
              "title": "操作",
              "key": "__op",
              "opList": " edit"
            }]
          }
        }
      ]
    },
    {
      "icon": "setting",
      "label": "学生管理",
      "url": "/student",
      "data": {
        "title": "学生",
        "dataSource": "student",
        "columns": [{
          "title": "用户名",
          "dataIndex": "username",
          "key": "username"
        }, {
          "title": "年龄",
          "dataIndex": "age",
          "key": "age"
        }, {
          "title": "操作",
          "key": "__op",
          "opList": "edit"
        }]
      }
    },
    {
      "icon": "mail",
      "label": "关于",
      "url": "/about"
    }
  ]
}

logo can also be :

"logo":{
  "url":"http://lorempixel.com/200/80/",
  "width":"200",
  "height":"80"
}

rooter

参考 history 的使用方法

import { history } from 'd3j-commonop'
history.push('/hello')

额外的支持

history.push({
    pathname: '/hello',
    search: {
        a: '1',
        b: '2'
    }
})

获取参数的时候:

const { urlSearch } = this.props

另外 提供一个Link组件

import { RouterLib } from 'd3j-commonop'
const Link = RouterLib.Link

diy

override reducer

// you can handle before default by case first
// ./component/userlist/module/reducer.js
export default function reducer(state = {}, action) {
    switch (action.type) {
        case 'USERLIST_inputChange': {
            // 你自己的逻辑
            return {
                ...
            }
        }
       
        default: {
            // 否则默认处理
            return baseReducer(prefix, state, action)
        }
    }
}

auth

权限组件 SimpleAuth

<SimpleAuth power="编辑"><ComponentA/></SimpleAuth>

加强版BaseForm

新增下拉选择框,日期框(分为单个日期框以及包含开始日期和结束日期的日期框),级联选择框 参数格式(和配置文件的columns类似,多了一个type属性) [{ title: '用户', dateIndex; 'userlist', key: 'userlist', type: 'select', //select表示类型是下拉选择框 oplist: ['Jone', 'Effy', 'Dongyang'] }, { title: '起始时间', dateIndex; 'startDate', key: 'startDate', type: 'date' //date表示类型是单个日期的选择框 }, { title: '活动期限', dateIndex; 'period', key: 'period', type: 'rangeDate' //rangeDate表示类型是包含起止日期的选择框 }, { title: '省市', dateIndex; 'address', key: 'address', type: 'cascader', //cascader表示类型是级联选择器 oplist: [{ //oplist表示级联的内容,如果没有则默认是省市级联 value: 'LPL', label: 'LPL', children: [{ value: 'EDG', label: 'EDG' }, { value: 'WE', label: 'WE' }] }, { value: 'LCK', label: 'LCK', children: [{ value: 'SKT', label: 'SKT', children: [{ value: 'KT', label: 'KT' }] }] }] }]