/**
 * [OElove] (C)2010-2099 oelove.com Inc.biz
 * Email: service@phpcoo.com ,phpcoo@qq.com
 * $ Last update 2020/11/30 by OE $
*/
$(function(){
    //公用submit
    
    layui.use('form', function(){
        $form = layui.form;
        
        //搜索...
        $form.on('submit(searchform2)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //提交...
                $("#mysearch").submit();
            }
            return false;
        });
        
        //添加保存...
        $form.on('submit(addform2)', function(data){
            $obj_id = data.elem.getAttribute("id");
            
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //提交...
                $("#myform").submit();
            }
            return false;
        });
        
        
        //编辑保存...
        $form.on('submit(editform2)', function(data){
            $obj_id = data.elem.getAttribute("id");
            
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //提交...
                $("#myform").submit();
            }
            return false;
        });
        
        
    });
});