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

@cniot/hooks-ftp

v0.1.7

Published

菜鸟ftp页面hooks,基于cnFilter cnTable。 仓库group:lemo project: hooks-ftp

Downloads

87

Readme

ftp hooks

通过hook快速构建 ftp 页面,基于 cnFilter, cnTable 组件

安装


[t]npm install @cniot/hooks-ftp

使用


import React from 'react'
import ReactDOM from 'react-dom'
import CNFilter from '@alife/cn-filter';
import CNTable from '@alife/cn-table';
import {Input} from 'cn-next';
import axios from 'axios';
import useTable from './useTable';
import useFilter from './useFilter';

const columns = [
  {
    title: '省份',
    dataIndex: 'itemId',
    align:"left",
    width: 500,
  },
  {
    title: '高考人数',
    dataIndex: 'itemName',
  },
  {
    title: '一本率',
    dataIndex: 'productionDate',
  },
  {
    title: '二本率',
    dataIndex: 'ownerName',
  },
  {
    title: '高中入学率',
    dataIndex: 'expireDate',
  },
  {

    title: 'ownerId',
    dataIndex: 'ownerId'
  }
];



// https://g.alicdn.com/code/npm/@alife/cn-filter/1.0.3/storybook-docs/index.html
// https://page.cainiao.com/new-developer/tabledocs/table-story.html

function getTableData(query, currentPage, pageSize){
  console.log("getTableData", query, currentPage, pageSize);
  return axios.get("https://mocks.alibaba-inc.com/mock/kzqmolxo/api/outbound/pick/asrs/rf/unPickedItemList", {
    params: {
      ...query, 
      pageSize, 
      currentPage
    }
  }).then((ret)=>{
    return Promise.resolve({
      total: 100,
      dataSource: ret.data.data.itemInfoList
    })
  })
}

export default function Table() {

  const table = useTable(getTableData)
  const filter = useFilter((filter)=>{
    return table.onSearch(filter);
  });

  React.useEffect(()=>{
    table.onSearch({}, 1, 20)
  }, [])

  return (
    <div className="App">
      <CNFilter
        {...filter}
      >
        <CNFilter.Item label="hello" name="abc">
          <Input />
        </CNFilter.Item>
        <CNFilter.Item label="hello" name="abc1">
          <Input />
        </CNFilter.Item>
        <CNFilter.Item label="hello" name="abc2">
          <Input />
        </CNFilter.Item>
        <CNFilter.Item label="hello" name="abc3">
          <Input />
        </CNFilter.Item>
        <CNFilter.Item label="hello" name="abc4">
          <Input />
        </CNFilter.Item>
      </CNFilter>
      <CNTable
        {...table}
        primaryKey={"barCode"}
        columns={columns}
        // 操作列配置
        // operateColumn={{
        //   width: 200,
        //   buttons: [
        //     {
        //       children: '点击',
        //       onClick(event, record, index) {
        //         console.log("点击", event, record, index);
        //         // 点击处理
        //       },
        //     }
        //   ],
        // }}
        
        // 多选打开下面2项
        // showSelect={true}
        // onSelectChange={console.log}

        // toolbar 操作区
        // toolbar={{
        //   left: [{
        //     children:"编辑",
        //     type:"primary",
        //     onClick: function(event, record, index){
        //       console.log(event, record, index);
        //     }
        //   }],
        //   right: [
        //     "size",
        //     'fullscreen',
        //     'columnSet',
        //   ]
        // }}
      ></CNTable>
    </div>
  )
}




ReactDOM.render(<Table></Table>, document.getElementById('root'))