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

rapid-spreadjs

v1.0.10

Published

SpreadJS常用公用处理函数,包括设计器、工作簿和工作表的相关处理函数。

Downloads

486

Readme

1、组件介绍

该组件是基于葡萄城的 SpreadJS封装的公用处理函数组件。

该组件主要包含了对设计器的操作、工作簿的操作以及工作表的操作等。

SpreadJS 官网地址:https://www.grapecity.com.cn/developer/spreadjs

SpreadJS 帮助中心:https://www.grapecity.com.cn/developer/spreadjs/help

SpreadJS 文档地址:https://demo.grapecity.com.cn/spreadjs/help/docs/overview

SpreadJS 演示地址:https://demo.grapecity.com.cn/spreadjs/SpreadJSTutorial/#/samples

SpreadJS 论坛地址:https://gcdn.grapecity.com.cn/

SpreadJS 在线地址:https://demo.grapecity.com.cn/SpreadJS/WebDesigner/index.html

SpreadJS API 地址:https://demo.grapecity.com.cn/spreadjs/help/docs/API_documentation


2、依赖组件

具体依赖组件如下所示:

  • file-saver:导出 Excel 文件所需的组件;
  • @types/file-saver:导出 Excel 文件所需的类型组件;

3、拉取组件

可使用如下命令拉取组件:

  • pnpm install rapid-spreadjs
  • npm i rapid-spreadjs
  • yarn add rapid-spreadjs

4、使用说明

在组件拉取下来后,我们便可使用该组件中的属性以及函数方法了。

该组件包含的类型如下:

  • CellModel:单元格实体;
  • CellWatermarkModel:单元格水印和数据绑定实体;
  • CellDateModel:单元格日期控件实体;
  • ……

该组件包含的属性如下:

  • CommonUtils:公用工具函数属性;
  • SheetUtils:SpreadJS 工作表工具函数属性;
  • WorkbookUtils:SpreadJS 工作簿工具函数属性;
  • ……

该组件包含的函数如下:

  • ……

4.1、类型说明

4.1.1、CellModel

CellModel 为单元格实体类型,如用于定义某个单元格的行、列、行数量和列数量等相关属性。

具体属性如下所示:

/**
 * 单元格实体
 */
export type CellModel = {
    /** 行索引 */
    row?: number;

    /** 列索引 */
    col?: number;

    /** 行数量 */
    rowCount?: number;

    /** 列数量 */
    colCount?: number;
};

4.2、属性说明

4.2.1、CommonUtils

CommonUtils 为公用工具函数属性,该属性下包含以下函数:

  • getColLetterName:获取列的英文字母;

4.2.2、SheetUtils

SheetUtils 为 SpreadJS 工作表工具函数属性,该属性下包含以下函数:

  • getActiveSheetSelectCells:获取当前活动工作表选中的单元格集合;
  • setActiveSheetSelectCells:设置当前活动工作表某个单元格范围为选中状态;
  • getAllCellObjsByRanges:获取某工作表中某范围集合中所有的单元格坐标对象集合;
  • getSheetAllCellObjs:获取某工作表中所有的单元格坐标对象集合;
  • getActiveSheetSelectCellObjs:获取某工作表中选中的所有单元格坐标对象集合;
  • getCellType:获取单元格类型名称;
  • setSheetZoom:设置工作簿中所有工作表的缩放比例;
  • setActiveSheetBgColor:设置当前激活的工作表中选中的单元格背景颜色;
  • setSheetShowPrintPageLine:设置工作簿中所有工作表是否显示分页线;
  • ignoreSheetShowStrs:忽略工作工作表元格中指定字符串不显示,如:#DIV/0!、#VALUE!等;
  • setSheetAuxiliaryLine:设置工作表显示辅助线(底部和右侧的辅助线);
  • setActiveSheetWatermark:设置当前激活工作表的水印和数据绑定是否显示;
  • setSheetCellDate:设置某工作表中单元格为日期选择控件;
  • ……

4.2.3、WorkbookUtils

WorkbookUtils 为 SpreadJS 工作簿工具函数属性,该属性下包含以下函数:

  • print:打印所有工作表;
  • exportToExcel:导出为 Excel 文件;
  • ……