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

@beisen/meta-parser

v1.0.18

Published

>原则是一个TableList元数据对应一个TableList解析器。解析器也会对外暴露一个interface来规范初始化输入

Downloads

12

Readme

目标:封装元数据结构的和请求的细节,暴露一个面向业务的数据对象。

原则是一个TableList元数据对应一个TableList解析器。解析器也会对外暴露一个interface来规范初始化输入

git 地址:http://gitlab.beisencorp.com/ux-share-platform/meta-parser

初始化接受参数

| name | description | type | 是否必须 | | ---------- | ---------------------------------------- | -------- | ------- | | app | 元数据所属的app名称 | string | 是| | viewName | 元数据所属的Page名称 | string | 是 | | metaObjName | 元数据的名称 | string | 是 | | searchView | 元数据所属的筛选View名称 | string | 是 | | searchType| 发起请求时筛选字段的控制类型,1:外部管理搜索字段,2:内部管理搜索字段| number|是| | id| 表格数据id| string |否| | host| 请求tablelist的域名,不指定就走线上cloud.italent.cn| string|否| | searchItems| 在内部管理搜索字段时必须提供格式请看,examples例子| object|否| | sortFields|用于排序的数组格式请看examples| array|否| | tableRowSchema| 对列字段处理使用详细见examples例子| object|否,不指定时不处理行字段| | tableColumnSchema| 对行字段处理使用详细见examples例子| object|否,不指定时不处理列字段|

暴露的可用属性

| name | description | | ---------- | ---------------------------------------- | | | |

暴露的可用方法

| name | description | | ---------- | ---------------------------------------- | | fetchData| 用来拉取数据 | | updateSearchItems| 更新内部筛选项目 | | updateSchema | TODO |

fetchData函数:

所需参数 searchType等于1时 只需要传page(当前页数),capacity(每页能显示的数量)

{
	"paging": {
		page: 0,
		capacity: 15
	}
}

所需参数 searchType等于2时 除了searchType等于2时需要传筛选条件

{
	"searchData": {
    	items:
        	[{
            	"name": "Learning.Course.Title",//搜索字段名称
            	"text": "课程", //搜索字段文本
            	"value": "课程",//搜索字段值
        	}],
	},
	"paging": {
		page: 0,
		capacity: 15
	},
	"sortFields": [
        {
            sort_column: "Title", sort_dir: "desc"
        }
    ]
}

fetchData返回值格式:

{
    //返回码,200为请求成功
    code: 200,
	//返回数据业务需要用到的
    data: {
		//列表列数据配置信息,字段含义见下
        simpleTableColumn: array,
		//列表行数据配置信息,字段含义见下
        simpleTableRow: array,
		//与分页相关信息
        paging: object,
		//解析前元数据(兼容已经使用原始元数据的组件)
        originalData: object
    },
    message: "请求成功"
};

simpleTableRow 返回的数据格式解释

{
	[	
		Title:{//字段名称
			name: "Title",//字段名称与前面Key值一样
			num: "", //字段在列表中的索引顺序(一般不用)
			text: "课程122", //字段显示的值
			value: "课程122"	//字段实际的值
		}
	]


}

simpleTableColumn 返回的数据格式解释:

[{
    "cmp_id": "c9c9da19-4fc2-4147-ae04-210d88b250b3",
    "cmp_name": "_id",
    "cmp_type": "MetaColumn", // 普通列
    "cmp_data": {
        "canShow": true, // 是否显示
        "canEdit": true, // 是否可以编辑
        "isTreeNodeColumn": false, // 是否是可树形展开列
        "columnType": "MetaColumn", // 普通列
        "title": "_id", // 标题
        "width": null, // 宽度
        "alignment": null, // 对齐方式
        "name": "_id", // 编码
        "isLink": false, // 是否连接
        "editable": false, // 是否编辑
        "frozen": false, // 是否冻结列
        "showIndex": 0, // 列索引
        "visible": false, // 是否显示
        "sortable": false, // 是否排序
        "precision": 0, // 精度
        "metaFieldPrecision": 0, // 精度(不清楚区别)
        "dataType": 0, // 数据类型
        "controlPack": "", // 组件类型
        "isDownload": false // 是否是下载链接
    }
}]

paging格式

{
	capacity: 10, //每页所展示的数量
	page: 0 //当前页面
	capacityList: [10,20,40]//给分页使用的。每页所能展示的数量选择配置
	total: 300 //数据总数
}

updateSearchItems函数

参数格式: 与fetchData 中 search_data格式一致

[{
    "name": "Learning.Course.Title",
    "text": "课程",
    "value": "课程",


}]