diff --git a/admin/data/menu.json b/admin/data/menu.json
index 30eff4d..57ec7d4 100644
--- a/admin/data/menu.json
+++ b/admin/data/menu.json
@@ -5,7 +5,7 @@
"icon": "layui-icon layui-icon-console",
"href": "",
"children": [{
- "id": 0,
+ "id": 10,
"title": "控制后台",
"icon": "layui-icon layui-icon-console",
"type": 1,
@@ -217,7 +217,7 @@
{
"id": "error",
"title": "错误页面",
- "icon": "layui-icon layui-icon-auz",
+ "icon": "layui-icon layui-icon-face-cry",
"type": 0,
"href": "",
"children": [{
@@ -312,5 +312,20 @@
"openType": "_iframe",
"href": "view/system/space.html"
}]
+ },
+ {
+ "id": "code",
+ "title": "开发工具",
+ "icon": "layui-icon layui-icon-util",
+ "type": 0,
+ "href": "",
+ "children": [{
+ "id": 801,
+ "title": "表单构建",
+ "icon": "layui-icon layui-icon-util",
+ "type": 1,
+ "openType": "_iframe",
+ "href": "component/code/index.html"
+ }]
}
]
diff --git a/component/code/css/style.css b/component/code/css/style.css
new file mode 100644
index 0000000..ef2986e
--- /dev/null
+++ b/component/code/css/style.css
@@ -0,0 +1,9 @@
+html,body{background-color: whitesmoke}
+.layui-fluid{margin-top: 15px;}
+.content{min-height: 796px;}
+.nav{text-align: center;}
+.nav button{margin-bottom: 3px;width: 100%;margin-top: 3px;margin-bottom: 3px;}
+.layui-card-body .layui-btn+.layui-btn{margin-left: 0px;}
+.code-show{min-height: 454px;}
+.js-show{min-height: 200px;}
+.del-form{line-height: initial;position: absolute;right: 15px;top: 50%;margin-top: -15px;}
\ No newline at end of file
diff --git a/component/code/index.html b/component/code/index.html
new file mode 100644
index 0000000..169e0cd
--- /dev/null
+++ b/component/code/index.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+ layui表单生成器
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/component/pear/module/design.js b/component/pear/module/design.js
new file mode 100644
index 0000000..43fd0f8
--- /dev/null
+++ b/component/pear/module/design.js
@@ -0,0 +1,176 @@
+/**
+ * time: 2018年11月21日 15:25:32
+ * author: dbag
+ * blog: http://www.cnblogs.com/phper8/
+ */
+layui.define(['layer', 'form'], function(exports){
+ var layer = layui.layer,form = layui.form,$ = layui.$,key = '';
+ delHtml()
+ $('button').on('click',function(){
+ var _this = $(this),
+ size = _this.data('size'),
+ type = _this.data('type'),
+ html = '';
+ key = randStrName();
+ switch (type) {
+ case 'text':
+ html = input(type,size)
+ break;
+ case 'password':
+ html = input(type,size)
+ break;
+ case 'select':
+ html = select(size)
+ break;
+ case 'checkbox_a':
+ html = checkbox_a(size)
+ break;
+ case 'checkbox_b':
+ html = checkbox_b(size)
+ break;
+ case 'radio':
+ html = radio(size)
+ break;
+ case 'textarea':
+ html = textarea(size)
+ break;
+ case 'submit':
+ html = submits(size)
+ break;
+ case 'del':
+ $('form').html("\n")
+ delHtml()
+ $('.code-show').text('')
+ return false
+ break;
+ default:
+ layer.msg('类型错误',{icon:2})
+ }
+
+ $('form').append(html);
+ form.render();
+ setHtml(html)
+
+
+ })
+
+ function delHtml() {
+ layui.data('form_html', {
+ key: 'html'
+ ,remove: true
+ });
+ }
+
+ function setHtml(html) {
+ var h = layui.data('form_html');
+ if(h && h.html ){
+ var _d = h.html+html
+ }else{
+ var _d = html
+ }
+ layui.data('form_html',{
+ key:'html',
+ value:_d
+ })
+ $('.code-show').text('')
+
+ }
+
+ function input(type,size) {
+ var name = type==='text'?'输入框':(type==='password'?'密码框':'');
+ var html = ' \n';
+ return html;
+ }
+ function select(size) {
+ var html = ' \n';
+ return html;
+ }
+ function checkbox_a(size) {
+ var html = ' \n';
+ return html;
+ }
+ function checkbox_b(size) {
+ var html = ' \n';
+ return html;
+ }
+ function radio(size) {
+ var html = ' \n';
+ return html;
+ }
+ function textarea(size) {
+ var html = ' \n' +
+ '
\n' +
+ '
\n' +
+ ' \n' +
+ '
\n' +
+ '
\n';
+ return html;
+ }
+ function submits(size) {
+ var html = ' \n';
+ return html;
+ }
+ function jscode() {
+ var html = '';
+ return html;
+ }
+ function randStrName() {
+ return Math.random().toString(36).substr(8);
+ }
+ $('.click-but button').click()
+ var jscodehtml = jscode();
+ $('.js-show').text(jscodehtml)
+ form.on('submit(formDemo)', function(data){
+ layer.msg(JSON.stringify(data.field));
+ return false;
+ });
+ exports('design', {});
+});
\ No newline at end of file
diff --git a/component/pear/pear.js b/component/pear/pear.js
index e39a08e..e39f810 100644
--- a/component/pear/pear.js
+++ b/component/pear/pear.js
@@ -28,5 +28,6 @@ layui.config({
area:"area",
count:"count",
topBar: "topBar",
- button: "button"
+ button: "button",
+ design: "design"
});