var page = 0,
    gro = "",
    model_watch, model_watchData, modelData_edit, modelData_update, model_watchForm, closeModal; //分页所需全局变量
var $td;
var GetToJson;
var paramCode, paramName, modelData_get, xqws, wde;
var boxNameArr = [];
var editing = true;
var rooturl = "../../jsonHttpServlet?channelNo=1";
var fbOptions, outHtml;
var LLid, sqaz;
var obj = ""
var formData2;
console.log(localStorage.ModelId)
$.post(rooturl, {
    "transCode": "T000004",
    "modelId": localStorage.ModelId
//    "modelId": "e6c06e28-0bd0-4c37-8107-918e35015b39",
}, function(result) {
    console.log(result)
    skt();
    fbOptions.onSave(obj,JSON.parse(result.struData));
    if (result.returnMsg == "OK") {
        var getHtml = document.getElementsByClassName("render-wrap")[0].innerHTML
        document.getElementById('subFrameHTML').innerHTML = getHtml
    }
}, 'json');

//查询列表

var form_id;
var forma_id;
var data_Width;

    
function skt() {
    fbOptions = {
        onSave: function(e, formData) {
            $('.render-wrap').formRender({
                formData: formData
            });
            console.log()
           
           $(".form-group  .form-control").each(function() {
               if($(this).attr('name')!="guaranteeWay[]"){
                   form_id = $(this).attr('name');
                   data_Width=$(this).attr('data-width');
                  var fomrid_a=$("#field-"+ form_id);
//                  if(fomrid_a!='field-guaranteeWay'){
                      if (typeof(fomrid_a) != ''||typeof(fomrid_a) != 'undefined') {
                             if (data_Width == 'full') {
                                 $(fomrid_a).addClass('width100');
                             } else if (data_Width == 'half') {
                                 $(fomrid_a).addClass('width50');
                             } else if (data_Width == 'third') {
                                 $(fomrid_a).addClass('width30');
                             } else if (data_Width == 'twenty') {
                                 $(fomrid_a).addClass('width20');
                             }
                         }
                     
//                 }
               }
                   
                   // var widthName;
//                    for (var i = 0; i < formWidth.length; i++) {
//                        widthName = .dataWidth;
//                        console.log(widthName)
//                        if (widthName == 'full') {
//                            $("#field-" + form_id).addClass('width100');
//                        } else if (widthName == 'half') {
//                            $("#field-"+ form_id).addClass('width50');
//                        } else if (widthName == 'third') {
//                            $("#field-" + form_id).addClass('width30');
//                        } else if (widthName == 'twenty') {
//                            $("#field-"+ form_id).addClass('width20');
//                        }
//                    }  
            })
                    
           
           
        },
    };
}