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

metaflow-js

v1.10.89

Published

EntityFramework for Metaflow

Downloads

203

Readme

InnerKen数据实体库(DataEntity JS-Vue)

此库已经弃用,请勿使用

因为本质上只有aaden-vue-admin在使用本库,所以本库的存在已经成为进一步更新的主要阻碍,因此弃用本库

一个示例实体类

import { hillo, IKDataEntity } from 'innerken-utils'  
  
export default {  
  entity: {  
    id: {  
      type: IKDataEntity.Types.Integer,  
      displayName: 'id',  
      tableConfig: {  
        align: 'start',  
      },  
      formConfig: {  
        disableNew: true,  
        disableEdit: true,  
        requiredNew: false,  
      },  
    },  
    photo: {  
      displayName: 'photo',  
      type: IKDataEntity.Types.Image,  
      formConfig: {  
        type: {  
          name: 'image',  
          root: () => store.getters.rootUrl + GlobalSettings.servantRoot,  
          fileStorage: 'file',  
        },  
        requiredEdit: false,  
        md: 12,  
      },  
    },  
    name: {  
      displayName: 'staffName',  
    },  
    password: {  
      displayName: 'password',  
    },  
    permission: {  
      type: IKDataEntity.Types.Boolean,  
      displayName: '权限',  
      formConfig: {  
        type: {  
          name: 'switch',  
        },  
      },  
    },  
    isPartTime: {  
      type: IKDataEntity.Types.Boolean,  
      displayName: '兼职',  
      formConfig: {  
        type: {  
          name: 'switch',  
        },  
      },  
    },  
  },  
  add: function (item) {  
    return hillo.postWithUploadFile('Servant.php?op=add', item, {  
      showLoading: true,  
    })  
  },  
  edit: function (item) {  
    if (item.file) {  
      item.imageExt = item.file.name.split('.').lastItem  
  }  
    return hillo.postWithUploadFile('Servant.php?op=update', item, {  
      showLoading: true,  
    })  
  },  
  delete: function (id) {  
    return hillo.post('Servant.php?op=delete', { id: id })  
  },  
  load: async function (filter) {  
    const _this = this  
 this.list = (await hillo.get('Servant.php', { lang: GlobalSettings.lang(), ...filter }))  
      .content.map(function (item) {  
        return IKDataEntity.parseDataForEntity(item, _this.entity)  
      })  
    return this.list  
  },  
  list: null,  
  getList: async function (force = false, ...filter) {  
    if (!this.list || force) {  
      await this.load(filter)  
    }  
    return this.list  
  }, // Lazy Load  
}

实体类应该具有的属性

Key 'entity':包含了实体内对象的定义

[
  "对象字段名": {
  "type": IKDataEntity.Types.String // [一个实体类型](#目前支持的DataEntity类型列表)
  "displayName": '显示名称'
  "tableConfig": {//对table的控制具体可以查看Vuetify的TableHeader
    align: 'start'
     
  },
  "formConfig": {//对表单的控制
    default: '',
    cols: 12,
    md: 6,
    sm: 12,
    type: { name: 'text' },
    // PossibleValue of types
    /*
    Text:{ name: 'text' }
    Select:
      {
        name:'select',
        selectItems:[],//options
        itemText:'',//bind-item-key
        itemValue:''//bind-item-key
       }
    Switch:{name:'switch'}
    File:
      {
        name:'file',
        root:'',//root of src images
        fileStorage:''//fileStorageItemKey will generate a key auto, default:file
       }
    * */
    disableNew: true,
    disableEdit: true,
    inNew: true,
    inEdit: true,
    rule: [],
    required: true,
    requiredEdit: true,
    requiredNew: true
  },
  form: true,//出现在表单中
  header: true//出现在表格中
},
]

目前支持的DataEntity类型列表

  • Integer: 默认一个输入框
  • Float: 默认一个输入框
  • String: 默认一个输入框
  • Boolean: 默认显示为CheckBox
  • Object:默认显示为输入框
  • Image: 默认显示为FileImage
  • Time: 默认显示为TimePicker
  • Option:默认显示为Select