//所有删除操作str
function delete_c(info,iname){
	
	//单个删除
	layer.confirm('确认删除?',{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].delete_id(info);//到页面接收
			layer.close(index);
		}
	);		
}

function delete_ids(info,iname){
	//批量删除
	layer.confirm('确认删除?',{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].delete_er(info);//到页面接收,涉及到3层。
			layer.close(index);
		}
	);		
}

function back_id(info,iname){
	//单个删除
	layer.confirm('确认恢复?',{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].back_id(info);//到页面接收
			layer.close(index);
		}
	);		
}

function back_ids(info,iname){
	//批量恢复
	layer.confirm('确认恢复?',{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].back_recycle(info);//到页面接收,涉及到3层。
			layer.close(index);
		}
	);		
}
//删除所有删除操作end

//日志清空
function delete_all(iname){
	//批量恢复
	layer.confirm('确认清空?',{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].delete_all();//到页面接收
			layer.close(index);
		}
	);		
}


//新建iframe窗口str
function openiframe(title,url,area,iname,table){
	var table=table?table:'';//后加用于添加字段是刷新列表带表名

	var index = layer.open({
		type: 2,
		area:area,
		fixed: false,
		maxmin: false,
		content:url,
		end: function(index,layero){
			layer.close(index);
			var is_bian=$('#open_iframe').val();
			if(is_bian!=0){
				if(iname=='66f966ee835148b7b1d771f743e7675d'){
					window.frames[iname].window.location.reload();//后台栏目管理页面刷新
				}else{
					window.frames[iname].table_reload(table);//刷新页面
				}
				$('#open_iframe').val(0);
			}
		  	return false; 
		}  
	});
	layer.title(title,index);

}
//有改动刷新页面
function table_reload(t){
	layui.use('table', function(){
		var table = layui.table;
		table.reload('list', { where: { table:t } });
	});
}
//iframe内部关闭按钮
function open_iframe_close(){
	var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
	parent.layer.close(index);
}
//新建iframe窗口end


//全部共用警告框,提示框str
function tq_alert(info,type,icon){
	
	layer.alert(info, {icon:icon});
	
}
//全部共用警告框,提示框end

//article 模块 str
//add exit页面打开
function article_open(title,url){
	tag_add(title,url,1);//参数1用于页面存在加载新页面
}
//add exit页面关闭1层生效
function article_close(iname){
	$('#app-'+iname+' .layui-icon-close').click();
}

//添加修改页返回操作
function article_submit(type,iname){
	
	layer.confirm(''+type+'成功。是否继续'+type+'?',{
		btn:['继续'+type+'','关闭标签']
		,cancel:function(index){//右上角关闭
			$('#app-'+iname+' .layui-icon-close').click();//关闭当前标签
		},
		btn2: function(){//取消按钮,按钮2
			$('#app-'+iname+' .layui-icon-close').click();//关闭当前标签
		},
		yes: function(index, layero){//按钮1
			layer.close(index);
        	window.frames[iname].location.reload();//不关闭刷新当前标签
        }}
	);

}
//article 模块 end

//组合字段继续添加还是返回
function article_field_submit(type,iname,url){
	layer.confirm(''+type+'成功。是否继续'+type+'?',{
		btn:['继续'+type+'','返回列表']
		,cancel:function(index){//右上角关闭
			if(iname!='tree_content'){
				window.frames[iname].article_field_reload(iname,url);
			}else{
				window.frames['a74f0dfd27be485d812ff61ee99a9b1b'].article_field_reload(iname,url);
			}
		},
		btn2: function(){//取消按钮,按钮2
			if(iname!='tree_content'){
				window.frames[iname].article_field_reload(iname,url);
			}else{
				window.frames['a74f0dfd27be485d812ff61ee99a9b1b'].article_field_reload(iname,url);
			}
		},
		yes: function(index, layero){//按钮1
			layer.close(index);
			if(iname!='tree_content'){
				window.frames[iname].article_field_reload(iname,'');
			}else{
				window.frames['a74f0dfd27be485d812ff61ee99a9b1b'].article_field_reload(iname,'');
			}
        }}
	);

}

//组合字段单个删除操作str
function delete_c_field(info,iname){

	//单个删除
	layer.confirm('确认删除?',{
		btn:['确认','取消']
		}
		,function(index){
			if(iname!='tree_content'){
				window.frames[iname].delete_id_field(iname,info);//admin/Article/edit
			}else{
				window.frames['a74f0dfd27be485d812ff61ee99a9b1b'].delete_id_field(iname,info);//到admin/article/index.html页面接收
			}
			layer.close(index);
		}
	);		
}
//组合字段批量删除操作str
function delete_ids_field(info,iname){
	//批量删除
	layer.confirm('确认删除?',{
		btn:['确认','取消']
		}
		,function(index){
			if(iname!='tree_content'){
				window.frames[iname].delete_ids_field(iname,info);//到admin/Article/edit.html页面接收
			}else{
				window.frames['a74f0dfd27be485d812ff61ee99a9b1b'].delete_ids_field(iname,info);//到admin/article/index.html页面接收
			}
			//window.frames[iname].delete_er(info);//到页面接收,涉及到3层。
			layer.close(index);
		}
	);		
}

//mysql str
function mysql_ck(info,msg,type,iname){
	//新建备份
	layer.confirm(msg,{
		btn:['确认','取消']
		}
		,function(index){
			window.frames[iname].mysql_back(info,type);//到页面接收,涉及到3层。
			layer.close(index);
		}
	);		
}
//mysql end
