look.html 5.11 KB
<!DOCTYPE html>
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">

<link rel="stylesheet" type="text/css" href="__PUB__style/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="__PUB__style/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="__PUB__style/pp.css">
<style type="text/css">
.input-xxlarge{ margin-bottom: 0px;}
.long{ width: 530px;}
.input-xxlarge1 {margin-bottom: 0px;}
td span{padding-left:8px; color:#999;}
.d_value table td{border:none; padding:0;}
.d_value table td a{padding:0 6px; font-size:23px; font-weight:bold; text-decoration:none; cursor:pointer;}
</style>
<script type="text/javascript" src="__PUB__js/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUB__js/jquery.min.js"></script>
</head>
<body style="margin: 10px 0px;">
<div style="margin:0 auto; width:98%;">
	<form action="__URL__/do_config" name="configadd" method="post">
	<table class="table table-condensed table-bordered table-hover">
	<tbody>
			<tr>
				<th colspan="4" class="pp_1">查看字段信息<span><a href="<{:U('index')}>">返回</a></span></th>
			</tr>
		
			<tr>
				<td class="w_p_10 text_right"><span class='red'>*</span>字段名</td>
				<td colspan="3"><{$data.name}></td> 
			</tr>
			<tr>   
				<td class="text_right"><span class='red'>*</span>字段说明</td>
				<td colspan="3"><{$data.description}></td>
			</tr>
			<tr>
				<td class="text_right">备注说明</td>
				<td colspan="3"><{$data.note}></td>
			</tr>
			<tr id="ftype">
				<td class="text_right"><span class='red'>*</span>字段类型</td>
				<td class="w_p_39">
					<?php 
					switch($data['type']){
						case 'string':
							echo '文本';
							break;
						case 'bstring':
							echo '多文本';
							break;
						case 'bool':
							echo '布尔(Y/N)';
							break;
						case 'number':
							echo '数字';
							break;
						case 't_extarea':
							echo '文本域';
							break;
						case 's_elect':
							echo '下拉列表';
							break;
						case 'c_heckbox':
							echo '多选框';
							break;
						case 'r_adio':
							echo '单选框';
							break;
					}
					?>
				</td>
				<td id="rowcol" colspan="2"><eq name="data['type']" value="bstring">行数:<{$data.rownum}> 列数:<{$data.colnum}></eq></td>
			</tr>
			<in name='data.type' value="s_elect,c_heckbox,r_adio">
			<tr>
				<td class="text_right">默认值</td>
				<td colspan="3">
				<?php 
					$val=explode('#',$data['d_value']);
					foreach($val as $v){
						echo $v,' ';
					}
				?>
				</td>
			</tr>
			</in>
			<tr>
				<td class="text_right">是否必填</td>
				<td colspan="3">
				<eq name="data.required" value="1">必填<else />非必填</eq>
				</td>
			</tr>
			<tr>
				<td class="text_right">状态</td>
				<td colspan="3">
				<eq name="data.isshow" value="1">开启<else />关闭</eq>
				</td>
			</tr>
			<tr>
				<td colspan="4" class="text_center">
				<input type="button" value="返回" onclick="location.href='<{:U('index')}>'" />
				</td>
			</tr>
	</tbody>
	</table>
	</form>
</div>

</body>
</html>
<script>
	function checkType(){
		var t_val=$(':input[name=type]:checked').val();
		switch(t_val){
			case 'bstring':
				$('#rowcol').html('行数:<input type="text" name="rownum" value="" class="width_60" /> 列数:<input type="text" name="colnum" value="" class="width_60" />');	//添加行数列数
				$('#ftype + tr.d_value').remove();	//移除默认值
				break;
			case 's_elect':
			case 'c_heckbox':
			case 'r_adio':
				$('#rowcol').html('');	//行数列数清空
				if($('.d_value').length<=0) $('#ftype').after("<tr class='d_value'><td class=\"text_right\">默认值</td><td colspan='3'><table><tr><td><input type=\"text\" at_pp=\"d_value\" name=\"d_value[]\" value=\"\" /></td><td><a class=\"dv1\">+</a></td></tr></table></td></tr>");	//默认值
				break;
			// case 'string':
			case 'bool':
			case 'number':
				$('#rowcol').html('');	//行数列数清空
				$('#ftype + tr.d_value').remove();	//移除默认值
				break;
			/*default:
				$('#rowcol').html('');	//行数列数清空
				$('#ftype + tr.d_value').remove();	//移除默认值*/
		}
		/*if(t_val == 'bstring'){	//多文本
			$('#rowcol').html('行数:<input type="text" name="rownum" value="" class="width_60" /> 列数:<input type="text" name="colnum" value="" class="width_60" />');
		}else{
			$('#rowcol').html('');
		}*/
	}
	$(function(){
		checkType();
		$(':input[name=type]').click(function(){
			checkType();
		});
		$('.table').delegate('a.dv1','click',function(){
			// var dv=$(':input[at_pp="d_value"]').length + 1;
			$(this).parent().parent().parent().append('<tr><td><input type=\"text\" at_pp=\"d_value\" name=\"d_value[]\" value=\"\" /></td><td><a onclick=\"javascript:void(0);\" class=\"dv2\">-</a></td></tr>');
		});
		$('.table').delegate('a.dv2','click',function(){
			$(this).parent().parent().remove();
		});
	});
</script>