add.html
10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!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:#ff0000;}
.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__/add" 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_15 text_right"><span class='red'>*</span>字段名</td>
<td colspan="3"><input type="text" name="name" style='width:30%' /><span>例如:name</span></td>
</tr>
<tr>
<td class="text_right"><span class='red'>*</span>字段说明</td>
<td colspan="3"><input type="text" name="description" style='width:30%' /><span>例如:姓名</span></td>
</tr>
<tr>
<td class="text_right">备注说明</td>
<td colspan="3">
<input type="text" name="note" style='width:30%' />
</td>
</tr>
<tr id="ftype">
<td class="text_right"><span class='red'>*</span>字段类型</td>
<td colspan="3">
<input type="radio" name="type" value='string' id='string' checked/> <label for="string">文本</label>
<input type="radio" name="type" value='bstring'id='bstring'/> <label for="bstring">多行文本</label>
<input type="radio" name="type" value='bool' id='bool'/> <label for="bool">布尔(Y/N) </label>
<input type="radio" name="type" value='number' id='number'/> <label for="number">数字</label>
<input type="radio" name="type" value='t_extarea' id='t_extarea'/> <label for="t_extarea">文本域</label>
<input type="radio" name="type" value='s_elect' id='s_elect'/> <label for="s_elect">下拉列表</label>
<input type="radio" name="type" value='c_heckbox' id='c_heckbox'/> <label for="c_heckbox">多选框</label>
<input type="radio" name="type" value='r_adio' id='r_adio'/> <label for="r_adio">单选框</label>
</td>
</tr>
<tr class="isdate">
<td class="text_right">调用日期组件</td>
<td colspan="3">
<input type="radio" name="isdate" value="0" checked />否 <input type="radio" name="isdate" value="1" />是
</td>
</tr>
<tr class="isupfile">
<td class="text_right">调用上传组件</td>
<td colspan="3">
<input type="radio" name="upfile" value="0" checked />否 <input type="radio" name="upfile" value="1" />图片 <input type="radio" name="upfile" value="2" />文件
</td>
</tr>
<tr class="text_right">
<td class="text_right">调用JS组件</td>
<td colspan="3">
<select id="isjs" name="isjs">
<option value="" selected>无JS组件</option>
<volist name="jsarr" id='cv' key='ck'>
<option value='<{$ck}>'><{$cv}></option>
</volist>
</select>
</td>
</tr>
<tr class="istags">
<td class="text_right">调用标签组件</td>
<td colspan="3">
<input type="radio" name="istags" value="0" checked />否 <input type="radio" name="istags" value="1" />是
</td>
</tr>
<tr>
<td class="text_right">前台整行显示</td>
<td colspan="3">
<input type="radio" name="fline" value="2" checked />是 <input type="radio" name="fline" value="1" />否
</td>
</tr>
<tr>
<td class="text_right">是否在检索中显示</td>
<td colspan="3"><input type="radio" name="issearch" value="1" />是 <input type="radio" name="issearch" value="2" checked />否</td>
</tr>
<tr>
<td class="text_right">是否在导航中显示</td>
<td colspan="3"><input type="radio" name="isheader" value="1" />是 <input type="radio" name="isheader" value="2" checked />否</td>
</tr>
<tr>
<td class="text_right">是否必填</td>
<td colspan="3"><input type="radio" name="required" value="1" checked />必填 <input type="radio" name="required" value="2" />非必填</td>
</tr>
<tr>
<td class="text_right">资料填报列表是否显示</td>
<td class="w_p_25"><input type="radio" name="isshow1" value="1" checked />显示 <input type="radio" name="isshow1" value="0" />不显示</td>
<td class="text_right w_p_15">资料填报列表显示宽度</td>
<td ><input type="text" name="width1" style='width:15%' /><span style="color:#000">px</span></td>
</tr>
<tr>
<td class="text_right">资料审核列表是否显示</td>
<td ><input type="radio" name="isshow2" value="1" checked />显示 <input type="radio" name="isshow2" value="0" />不显示</td>
<td class="text_right w_p_15">资料审核列表显示宽度</td>
<td ><input type="text" name="width2" style='width:15%' /><span style="color:#000">px</span></td>
</tr>
<tr>
<td class="text_right">资料检索列表是否显示</td>
<td ><input type="radio" name="isshow3" value="1" checked />显示 <input type="radio" name="isshow3" value="0" />不显示</td>
<td class="text_right w_p_15">资料检索列表显示宽度</td>
<td ><input type="text" name="width3" style='width:15%' /><span style="color:#000">px</span></td>
</tr>
<tr>
<td colspan='4' style="padding-left:30%">
<input type="submit" name="submit" value=" 保存字段 " class="coolbg np" />
</td>
</tr>
</tbody>
</table>
</form>
</div>
</body>
</html>
<script>
function checkType(){
var t_val=$(':input[name=type]:checked').val();
if($('span.datenote').length>0) $('span.datenote').remove(); //去掉 多行调用日期控件添加备注
if($('span.upfilenote').length>0) $('span.upfilenote').remove(); //去掉 多行调用上传控件添加备注
switch(t_val){
case 'bstring':
//行数:<input type="text" name="rownum" value="" class="width_60" />
if($('#rowcol').length<=0) $('#ftype').after('<tr id="rowcol"><td class="w_p_10 text_right">行/列数</td><td class="w_p_39">列数:<input type="text" name="colnum" value="" class="width_60" /></td><td class="w_p_10 text_right">列标题</td><td><input type="text" name="ctitle" value="" style="width:60%" /><span>多列,使用“#”分隔</span></td></tr>'); //行数列数
$('tr.d_value').remove(); //移除默认值
$('tr.isdate').css('display','table-row'); //调用日期制作
$('tr.isupfile').css('display','table-row'); //调用上传控件
if($('span.datenote').length<=0)$('tr.isdate td:eq(1)').append('<span class="datenote">(根据列标题匹配关键词"时间"、"日期"来调用控件)</span>'); //多行时 调用日期控件添加备注
if($('span.upfilenote').length<=0)$('tr.isupfile td:eq(1)').append('<span class="upfilenote">(根据列标题匹配关键词"上传"来调用控件)</span>'); //多行时 调用上传控件添加备注
$('tr.istags').css('display','none').children('td').children(':input[name="istags"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用标签控件
break;
case 's_elect':
case 'c_heckbox':
case 'r_adio':
$('#rowcol').remove(); //移除行数列数
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>"); //默认值
$('tr.isdate').css('display','none').children('td').children(':input[name="isdate"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用日期制作
$('tr.isupfile').css('display','none').children('td').children(':input[name="upfile"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用上传控件
// $(':input[name="isdate"][value="0"]').prop('checked','checked'); //隐藏调用日期控件,并默认选中不是按钮
// $(':input[name="upfile"][value="0"]').prop('checked','checked'); //隐藏调用上传控件,并默认选中不是按钮
$('tr.istags').css('display','none').children('td').children(':input[name="istags"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用标签控件
break;
case 'string':
$('#rowcol').remove(); //移除行数列数
$('tr.d_value').remove(); //移除默认值
$('tr.isdate').css('display','table-row'); //调用日期制作
$('tr.isupfile').css('display','table-row'); //调用上传控件
$('tr.istags').css('display','table-row'); //调用上传控件
break;
case 'bool':
case 'number':
case 't_extarea':
$('#rowcol').remove(); //移除行数列数
$('tr.d_value').remove(); //移除默认值
$('tr.isdate').css('display','none').children('td').children(':input[name="isdate"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用日期制作
$('tr.isupfile').css('display','none').children('td').children(':input[name="upfile"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用上传控件
// $(':input[name="isdate"][value="0"]').prop('checked','checked');//隐藏调用日期控件,并默认选中不是按钮
// $(':input[name="upfile"][value="0"]').prop('checked','checked');//隐藏调用上传控件,并默认选中不是按钮
$('tr.istags').css('display','none').children('td').children(':input[name="istags"]').removeAttr('checked').eq(0).prop('checked','checked'); //调用标签控件
break;
/*default:
$('#rowcol').html(''); //行数列数清空
$('#ftype + tr.d_value').remove(); //移除默认值*/
}
}
$(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>