Git Product home page Git Product logo

wax12181 / d2-crud-plus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from greper/d2-crud-plus

0.0 1.0 0.0 26.21 MB

基于d2-admin的d2-crud,简化d2-crud配置,快速开发crud功能;支持远程数据字典,国际手机号校验,alioss、腾讯云cos、七牛云文件上传、头像裁剪,省市区选择,权限管理,代码生成

Home Page: http://qiniu.veryreader.com/D2CrudPlusExample/index.html

License: MIT License

JavaScript 74.40% Vue 14.38% HTML 3.19% CSS 6.27% Raku 0.01% Java 0.01% Dockerfile 0.02% Stylus 0.02% Shell 0.03% SCSS 1.68%

d2-crud-plus's Introduction

【d2-crud-plus】面向配置的crud编程

基于d2-admin 的 d2-crud 的扩展,简化d2-crud配置,快速开发crud功能。

lerna

帮助文档

%%%%%%%%%%%%%%%%%%%%%%% 帮助文档 ↓%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GitHub Pages
https://greper.github.io/d2-crud-plus/

码云(国内访问推荐 )
http://greper.gitee.io/d2-crud-plus/

示例演示
http://qiniu.veryreader.com/D2CrudPlusExample/index.html

%%%%%%%%%%%%%%%%%%%%%%% 帮助文档 ↑%%%%%%%%%%%%%%%%%%%%%%%%%%%%

特性

  1. 简洁至上: 以最少的配置帮助你简化crud开发。
  2. 字段类型: 丰富的字段类型,大幅减少代码量。
  3. 快: 开发crud,快的不可思议!!!
  4. 自定义: 再困难的需求,也能实现。
  5. 权限管理: RBAC权限管理示例。
  6. 代码生成: 根据数据表生成前后端代码,一气呵成。

面向配置的crud编程

1. 简单的crud配置

开发过程中主要对crud.js进行代码编写

export const crudOptions = (vm)=>{ // vm即this
   return {
     columns: [
       {
         title: '日期',
         key: 'createDate',
         type: 'date', //字段类型为时间选择器datepicker,根据类型可自动生成默认配置
         search: {//查询配置,默认启用查询
           disabled: true //【可选】true禁止查询,默认为false
         },
         form: {//form表单的配置
           disabled: true, //禁止添加输入与修改输入【可选】默认false
         }
       },
       {
         title: '状态',
         key: 'status',
         search: {},//启用查询
         type: 'select', //字段类型为选择框
         form: { //配置添加和编辑,根据form的配置自动生成addTemplate和editTemplate
           rules: [//【可选】添加和修改时的校验规则,不配置则不校验
             { required: true, message: '请选择状态' }
           ]
         },
         dict: { //数据字典配置
           url: '/api/dicts/StatusEnum' //远程获取数据字典
         }
       },
       {
         title: '地区', 
         key: 'province', 
         search: {},//启用查询
         type: 'select', //字段类型为选择框
         form: {
           rules: [{ required: true, message: '请选择地区' }],
           component: { //添加和修改时form表单的组件,支持任何v-model组件
             props: { //配置自定义组件的属性
               filterable: true, //可过滤选择项
               multiple: true, //支持多选
               clearable: true //可清除
             }
           }
         },
         dict: {  //本地数据字典
           data: [
             { value: 'sz', label: '深圳' }, 
             { value: 'gz', label: '广州' }, 
             { value: 'wh', label: '武汉' }, 
             { value: 'sh', label: '上海' }
           ]
         }
       }
     ]
   }
}

2. 一个完全体crud就出来了

3. 现在就去开始吧

帮助文档

%%%%%%%%%%%%%%%%%%%%%%% 帮助文档 ↓%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GitHub Pages
https://greper.github.io/d2-crud-plus/

码云(国内访问推荐 )
http://greper.gitee.io/d2-crud-plus/

示例演示
http://qiniu.veryreader.com/D2CrudPlusExample/index.html

%%%%%%%%%%%%%%%%%%%%%%% 帮助文档 ↑%%%%%%%%%%%%%%%%%%%%%%%%%%%%

联系作者

欢迎bug反馈,需求建议,技术交流等(请备注d2-crud-plus)

d2-crud-plus's People

Contributors

dependabot[bot] avatar greper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.