| | |
| | | return options || null; |
| | | }, getData: function () { |
| | | return options.data || null; |
| | | }, getHtmlData: function () { |
| | | return that.getHtmlData() || null; |
| | | }, geticeEditorObjects: function () { |
| | | return iceEditorObjects || null; |
| | | },getImages:function () { |
| | |
| | | $label.empty(); |
| | | $label.css("width",json.labelWidth); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | if (json.hideLabel) { |
| | |
| | | $label.empty(); |
| | | $label.css("width",json.labelWidth); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | if (json.hideLabel) { |
| | |
| | | $label.css({width: '{0}'.format(json.width)}); |
| | | $block.css({width: '{0}'.format(json.width)}); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | }, |
| | |
| | | $('#' + json.id + ' .layui-input-block').append(_html); |
| | | $label.css("width",json.labelWidth); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | form.render('select',json.id); |
| | |
| | | $block.css("margin-left",json.labelWidth); |
| | | } |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | form.render('checkbox'); |
| | |
| | | } |
| | | $label.css("width",json.labelWidth); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | var _html = '<input id="{0}" name="{0}" lay-verify="{3}" class="layui-input icon-date widget-date {1}" style="line-height: 40px;{2}"></input>'.format(json.tag + json.id,_disabledClass,_disabledStyle,_required); |
| | |
| | | } |
| | | $label.css("width",json.labelWidth); |
| | | if (json.required) { |
| | | $label.append('<span style="color:red;">*</span>'); |
| | | // $label.append('<span style="color:red;">*</span>'); |
| | | } |
| | | $label.append(json.label + ":"); |
| | | var _html = ''; |
| | |
| | | var _html = $('<div style="height:100%;width:100%;"></div>'); |
| | | var _script = $('<div style="height:100%;width:100%;"></div>');; |
| | | that.generateHtml(options.data, _html,_script); |
| | | console.log(_html.html()); |
| | | var _htmlCode = staticField.htmlCode.format(_html.html(),_script.html()); |
| | | document.getElementById('generate-code-view').value = style_html(_htmlCode, 4, ' ', 400); |
| | | layer.open({ |
| | |
| | | |
| | | }); |
| | | |
| | | $('.generateHtml').on('click', function () { |
| | | $('.generateHtmlData').on('click', function () { |
| | | var _html = $('<div style="height:100%;width:100%;"></div>'); |
| | | var _script = $('<div style="height:100%;width:100%;"></div>'); |
| | | that.generateHtml(options.data, _html,_script); |
| | | console.log(_html.html()); |
| | | return _html.html(); |
| | | }); |
| | | |
| | |
| | | json[key] = signObjects[key]; |
| | | } |
| | | return json; |
| | | } |
| | | |
| | | |
| | | //获取表单数据回调 |
| | | Class.prototype.getHtmlData = function () { |
| | | var that = this, |
| | | options = that.config; |
| | | var _html = $('<div style="height:100%;width:100%;"></div>'); |
| | | var _script = $('<div style="height:100%;width:100%;"></div>'); |
| | | that.generateHtml(options.data, _html,_script); |
| | | return _html.html(); |
| | | } |
| | | |
| | | //递归改变禁用属性 |
| | |
| | | |
| | | exports('formDesigner' |
| | | , formDesigner); |
| | | }); |
| | | }); |