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

pps-formula-edit

v0.9.57

Published

组件介绍:公式编辑器为假勤,薪酬,继任,平台等业务线统一规范,进行业务公式编写的前端组件。

Downloads

5

Readme

平台公式编辑器

组件介绍:公式编辑器为假勤,薪酬,继任,平台等业务线统一规范,进行业务公式编写的前端组件。

API

| 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | |configKey | 编辑器内小键盘数据 | Array | 内置于编辑器内部 | |editComputingFormula| 编辑器内默认回填数据| Object {Text(必填)} ||

编辑器方法

|名称 | 描述 | | --- | --- | |checkOutFun() | 编辑器公式检查函数 | |emptyContent()| 编辑器内容清空| |saveAllData()| 公式内容提交|

// configKey格式 因业务需要,暂封装于组件内部,也可外部传入
// key 表示键盘显示内容  special 表示是否两侧有空格  equal 是否为比较操作  numberSign 是否为数字
const configObject ={};
// 左半按钮区
configObject.defaultSignKeys= [
	{key:'if',special:true},
	{key:'then',special:true},
	{key:'else',special:true},
	{key:'and',special:true},
	{key:'or',special:true},
	{key:'\"'},
	{key:'('},
	{key:')'},
	{key:'=',equal:true},
	{key:'<>',equal:true},
	{key:'>',equal:true},
	{key:'<',equal:true},
	{key:'<=',equal:true},
	{key:'>=',equal:true},
	{key:','}
]
// 右半按钮区
configObject.defaultNumberKeys= [
	{key:'1',numberSign:true},
	{key:'2',numberSign:true},
	{key:'3',numberSign:true},
	{key:'+'},
	{key:'-'},
	{key:'4',numberSign:true},
	{key:'5',numberSign:true},
	{key:'6',numberSign:true},
	{key:'*'},
	{key:'/'},
	{key:'7',numberSign:true},
	{key:'8',numberSign:true},
	{key:'9',numberSign:true},
	{key:'0',numberSign:true},
	{key:'.',numberSign:true}
]
代码演示
import React, {Component} from 'react';
import ComputationTable from 'pps-formula-edit';

export default class Index extends Component {
	//检查公式
	checkOutFun() {
		const { getCheckOut } = this.refs;
		getCheckOut.checkOutFun();
	}

   //置空
	emptyFun() {
		this.refs.getCheckOut.emptyContent()
	}

    //提交
	async submit(e) {
		let saveData = await this.refs.getCheckOut.saveAllData();
		if (saveData) {
			let saveParame = saveData.allParams;
			// 公式保存操作,调用平台SDK
		    window.iTalentSDK.sendMessage({
		          publishEvent:this.props.cmp_data.field_name,
		          data:{
		              text:saveParame ? saveData.Text2 : '',
		              value:saveParame
		          }
			});
		}
	}

	

	render() {
		return (
			<ComputationTable ref='getCheckOut' editComputingFormula={EditComputingFormula} />
		)
	}
}