Git Product home page Git Product logo

generate-form-by-table-structure's Introduction

generate-form-by-table-structure

According to the table structure to automatically generate the form

根据表结构自动生成表单,支持数据库有mysqloracle

在开发复杂的业务系统经常遇到几十,上百个字段的表,或者一个模块涉及十多张表的时候, 可以借助自动生成表单的方式,加快表单搭建速度!

Usage

  • npm install,如果oracledb不能正常安装,请参考>>nodejs链接oracle

  • 修改oracle/dbconfig.js配置

  • 运行node oracle/builder.js

生成表单在builder目录下,如mainForm.html文件是自动生成的angular表单模板

	<table class="dataTables" width="100%" id="main_form">
	    <thead>
	        <tr>
	            <th class="head center">ID</th>
	            <th class="head center">NAME</th>
	            <th class="head center">COUNTRYCODE</th>
	            <th class="head center">DISTRICT</th>
	            <th class="head center">POPULATION</th>
	        </tr>
	    </thead>
	    <tbody>
	        <tr ng-repeat=" curRow  in formObject.list">
	            <td>
	                <a ng-click="" class="text-tips" title="{{curRow.ID}}">
	                    <label ng-bind="curRow.ID"></label>
	                </a>
	            </td>
	            <td>
	                <a ng-click="" class="text-tips" title="{{curRow.NAME}}">
	                    <label ng-bind="curRow.NAME"></label>
	                </a>
	            </td>
	            <td>
	                <a ng-click="" class="text-tips" title="{{curRow.COUNTRYCODE}}">
	                    <label ng-bind="curRow.COUNTRYCODE"></label>
	                </a>
	            </td>
	            <td>
	                <a ng-click="" class="text-tips" title="{{curRow.DISTRICT}}">
	                    <label ng-bind="curRow.DISTRICT"></label>
	                </a>
	            </td>
	            <td>
	                <a ng-click="" class="text-tips" title="{{curRow.POPULATION}}">
	                    <label ng-bind="curRow.POPULATION"></label>
	                </a>
	            </td>
	        </tr>
	    </tbody>
	</table>

同样可生成弹窗表单popForm.htmlinfoForm.html

License


giscafer.com  ·  GitHub @giscafer  ·  Weibo @Nickbing Lao

generate-form-by-table-structure's People

Contributors

giscafer avatar

Watchers

James Cloos avatar yangdengxian 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.