<?php /*a:3:{s:59:"/www/wwwroot/btn.millet-mirth.com/view/admin/rule/edit.html";i:1645090132;s:60:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/top.html";i:1625466448;s:63:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/bottom.html";i:1629163316;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo config('common.CMS_NAME'); ?></title>
<link rel="stylesheet" href="/static/tqcms/css/common.css">
<link rel="stylesheet" href="/static/tqcms/layui/css/layui.css"><!--layui css-->
<link rel="stylesheet" href="/static/tqcms/css/skin.css">
<script src="/static/tqcms/js/jquery.js"></script>
</head>
<body>

<div class="iframe_content">
	<div class="iframe_add">
    	<form action="" class="layui-form" name="rule" id="rule" method="post" onsubmit="return TQsubmit();">
        <input name="id" type="hidden" value="<?php echo htmlentities($info['id']); ?>" />
    	<ul>
            <li>
            	<label class="layui-form-label">父　　级</label>
                <div class="layui-input-block layui-pid">
                    <select name="pid" lay-filter="pid" lay-search>
                        <option value="">顶级模块</option>
                    	<?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                        <option value="<?php echo htmlentities($v['id']); ?>" data-lv="<?php echo htmlentities($v['level']); ?>" <?php if($info['pid']==$v['id']): ?>selected<?php endif; ?>><?php echo htmlentities($v['name']); ?></option>
                      	<?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <div class="layui-unselect layui-form-select">
                    	<div class="layui-select-title"><input type="text" placeholder="顶级模块" value="" readonly="" class="layui-input layui-unselect"><i class="layui-edge"></i></div>
                            <dl class="layui-anim layui-anim-upbit"></dl>
                        </div>
                  </div>
            </li>
            <li><label class="layui-form-label">名　　称</label><input type="text" name="name" value="<?php echo htmlentities($info['name']); ?>" placeholder="" autocomplete="off" class="layui-input"></li>
            <li><label class="layui-form-label">模　　板</label><input type="text" name="url" value="<?php echo htmlentities($info['url']); ?>" placeholder="" autocomplete="off" class="layui-input"></li>
            <li><label class="layui-form-label">参　　数</label><input type="text" name="url_parameter" value="<?php echo htmlentities($info['url_parameter']); ?>" placeholder="" autocomplete="off" class="layui-input"></li>
            <li>
                <label class="layui-form-label">是否显示</label>
                <div>
                    <input type="radio" name="is_effect" value="1" title="启用" <?php if($info['is_effect']==1 or $info['is_effect']==''): ?>checked<?php endif; ?>>
                    <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>启用</div></div>
                    <input type="radio" name="is_effect" value="2" title="停用" <?php if($info['is_effect']==2): ?>checked<?php endif; ?>>
                    <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>停用</div></div>
                </div>
            </li>
        </ul>
        </form>
    </div>
</div>

<div class="iframe_foot">
<input name="" type="submit" onclick="TQsubmit();" class="layui-btn" />　　
<input name="" type="button" value="关闭" onclick="open_iframe_close();" class="layui-btn layui-btn-danger" />
</div>
<script src="/static/tqcms/layui/layui.js"></script><!--layui js-->
<script src="/static/tqcms/layui/laytq.js"></script><!--layui js-->
<script src="/static/tqcms/js/common.js"></script>
<script src="/static/tqcms/js/md5.js"></script>
<script src="/static/tqcms/js/url.js"></script>
</body>
</html>
<script>
function TQsubmit(){
	$.post('save',$("#rule").serialize(),function(data){
		layer.msg(data['msg'], {icon:1,time:1000});
		$("body",parent.document).find('#open_iframe').val(1);
		if(data['type']==1){
			setTimeout(function(){ $("#rule")[0].reset(); },1500);
		}
    });
	return false;
}

layui.use('form', function(){
	var form = layui.form;
	form.on('select(pid)', function(data){
		var lv=$(data.elem).find("option:selected").attr('data-lv');
		var text=$.trim($('.layui-pid .layui-input').val());
		$('.layui-pid .layui-input').val(text);
		$(data.elem).find("option:selected").text(text);
	});  
});

</script>
