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

nc-bcs-report

v1.0.4

Published

a jquery component for nc web report

Downloads

1

Readme

NC 报表组:表格控件

Build Status

简介

Demo示例

该组件源自于用友自由报表组的表格:SemReport

  • SemReport为不包含交互效果,仅展示报表的库

后因多维合并组业务需求,在SemReport的基础上添加各种交互特性,包括但不限于:

  • [x] 拖拽(即选中效果)
  • [x] 右键菜单
  • [x] 关联页签
  • [x] 冻结单元格
  • [x] 编辑以及可编辑性(表、具体单元格)
  • [x] 复制和粘贴(支持表格和excel)
  • [x] 其他:全屏、放大缩小、打印、追踪具体单元格等...

用法

前置:因被强制使用Jquery,同时也只能通过分析SemReportd的DOM结构来完成交互功能。 使用前请确保Jquery已被正确引入。

此为示例文档,更多功能可查看文档

安装

npm install nc-bcs-report --save

yarn add nc-bcs-report

HTML:

<div class="r-container">
    <div id="sheet" class="r-sheet"></div>
    <div id="table" class="r-table"></div>
</div>

CSS:

.r-container{
    width: 800px;
    height: 550px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #eee;
}

JavaScript:

import { rendererSheet, rendererTable } from 'nc-bcs-report'
import data from './data'
import data2 from './data2'

// 初始化页签
let sheet = rendererSheet({
    selector: "#sheet"
})
sheet.addSheet({
    value: '利润表',
    view: {
        isOpen: true
    },
    callback: {
        afterClick: function () {
           resetTable(data, true)
        },
        beforeClose: function () {
            console.log('sheet will be close')
        }
    }
})
sheet.addSheet({
    value: '资产负债表',
    view: {
        hasCloseBtn: true,
    },
    callback: {
        afterClick: function () {
            resetTable(data2, false)
        }
    }
})
sheet.init() // 为了计算宽和高,需要在最后调用init方法


function resetTable(data, isEditable) {
    // 初始化报表
    let table = rendererTable({
        id: "table",
        data: data
    })
    // 右键菜单
    let menuBar = table.getMenuBar()
    menuBar.addButton('自定义按钮', function () {
        console.log('test')
    })
    menuBar.addButtonGroup('froze')
    // 表是否可编辑
    if(isEditable) {
        table.setEditable(true, function (data) {
            // 单元格是否可编辑(以下逻辑表示:不为空的单元格可编辑)
            return data && data.value !== ""
        })
    }
    // 右上角小图标,图标由iconfont定义
    let toolBar = table.getToolBar()
    toolBar.addToolBtn('fa fa-save', '保存', function () {
        console.log(table.getChangedData())
    })
    // 允许从剪切版中复制数据置于单元格(一般来源于excel)
    table.setExcelCopy(true)
}