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

ng-antd-super-form

v1.0.5

Published

1. Angular > npm i -S ng-antd-super-form

Downloads

19

Readme

SuperForm

  1. Angular

npm i -S ng-antd-super-form

  1. Vue

npm i -S vue-antd-super-form

  1. React

npm i -S react-antd-super-form

目前为止, 三大框架都可以使用的 super-form 基本已完成, 在保证同各版本的 antd api 属性要同的情况下, 格式基本一样, 可以相互参考各版本的文档, 有空我会再整理一个文档, 有兴趣的也可以一起参考进来

<ng-antd-super-form [search]="search" [table]="table"></ng-antd-super-form>
search:{
  layout: string;
  data: object[];
}

table:{
  columns: object[],
  action: Function,
  isInit: boolean;
}
data=[
    {
      label: '活动标题',
      type: 'input',
      key: 'activityName',
      placeholder: '请输入关键字查询',
      style: {
        width: '100px'
      }
    },
    {
      label: '活动类型',
      type: 'select',
      initialValue: '',
      options: [
        { label: '全部', value: '' },
        { label: '直播活动', value: 1 },
        { label: '普通活动', value: 2 },
        { label: '免单活动', value: 3 },
      ],
      key: 'activityType',
      style: {
        width: '100px'
      }
    },
    {
      label: '活动状态',
      type: 'select',
      initialValue: '',
      options: [
        { label: '全部', value: '' },
        { label: '未开始', value: 1 },
        { label: '进行中', value: 2 },
        { label: '已结束', value: 3 },
      ],
      key: 'activityStatus',
      style: {
        width: '100px'
      }
    },
    {
      label: '时间类型',
      type: 'select',
      options: [
        { label: '创建时间', value: 'gmtCreated' },
        { label: '开始时间', value: 'startTime' },
        { label: '结束时间', value: 'endTime' },
      ],
      key: 'activityTime',
      initialValue: 'startTime',
      style: {
        width: '100px'
      }
    },
    {
      type: 'rangepicker',
      key: ',releaseTime',
      dateFormat: 'YYYY-MM-DD',
      onChange: (date, form) => {
        form.controls['startTime'].setValue(_time(date[0], "YYYY-MM-DD"))
        form.controls['endTime'].setValue(_time(date[1], "YYYY-MM-DD"))
      },
    },
    {
      type: 'hidden',
      key: 'startTime'
    },
    {
      type: 'hidden',
      key: 'endTime'
    },
    {
      label: '搜索',
      key: 'submit',
      type: 'button',
      disabled: false,
      nzType: 'primary',
      icon: 'search',
      bindSearch: true,
      onClick: (e, form) => {
        console.log(e, form)
      }
    },
  ]
columns = [
    {
      title: '活动ID',
      dataIndex: 'activityId',
      key: 'activityId',
    },
    {
      title: '活动类型',
      dataIndex: 'activityType',
      key: 'activityType',
      render: text => {
        switch (text) {
          case 1:
            return '直播活动'
            break;
          case 2:
            return '普通活动'
            break;
          case 3:
            return '免单活动'
            break;

          default:
            return '--'
            break;
        }
      },
    },
    {
      title: '活动标题',
      dataIndex: 'activityName',
      key: 'activityName',
    },
    {
      title: '活动状态',
      dataIndex: 'activityStatus',
      key: 'activityStatus',
      render: text => {
        switch (text) {
          case 1:
            return '未开始'
            break;
          case 2:
            return '进行中'
            break;
          case 3:
            return '已结束'
            break;

          default:
            return '--'
            break;
        };
      },
    },
    {
      title: '上线状态',
      dataIndex: 'activeState',
      key: 'activeState',
      render: text => {
        return text ? '未上线' : '上线中';
      },
    },
    {
      title: '创建时间',
      dataIndex: 'gmtCreated',
      key: 'gmtCreated',
      sorter: true,
      render: text => (text ? _time(text) : '--'),
    },
    {
      title: '开始时间',
      dataIndex: 'startTime',
      key: 'startTime',
      sorter: true,
      render: text => (text ? _time(text) : '--'),
    },
    {
      title: '结束时间',
      dataIndex: 'endTime',
      key: 'endTime',
      sorter: true,
      render: text => (text ? _time(text) : '--'),
    },
    {
      title: 'Action',
      dataIndex: 'action',
      width: '150px',
      children: [
        {
          title: '详情',
          click(e, row) {
            console.log(e, row)
          }
        },
        {
          title: '删除',
          popconfirm: true,
          click(e, row) {
            console.log(e, row)
          }
        }
      ]
    },
  ]