field_add.html
8.2 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
<style>.form-input{ display: none;}</style>
<input id="assign-data-mid" type="hidden" value="{$mid}">
<form id="field_add-form" class="field_add-form form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<input id="c-mid" data-rule="required" class="form-control form-control" name="row[mid]" type="hidden" value="{$mid}">
<div class="panel-heading"><div class="panel-lead text-red"><b>温馨提示:</b>无需添加id字段,系统已经自动创建;增加字段后,需要重新生成CRUD,不然新增加的字段不会生效!</div></div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">类型:</label>
<div class="col-xs-12 col-sm-5">
<div class="radio">
<label for="row[category]-1"><input id="row[category]-1" class="field-category" data-required="title,name,suffix,length,default,desc" name="row[category]" type="radio" value="1" checked/> 标准字段</label>
<label for="row[category]-2"><input id="row[category]-2" class="field-category" data-required="title,name,type,length,default,desc" name="row[category]" type="radio" value="2" /> 自定义字段</label>
<label for="row[category]-3"><input id="row[category]-3" class="field-category" data-required="title,special,desc" name="row[category]" type="radio" value="3" /> 特殊字段</label>
</div>
</div>
</div>
<div class="form-group form-input form-input-title">
<label class="control-label col-xs-12 col-sm-2">字段标题:</label>
<div class="col-xs-12 col-sm-5">
<input id="c-title" data-rule="required" class="form-control form-control" placeholder="字段标题,不可重复" name="row[title]" type="text" value="">
</div>
</div>
<div class="form-group form-input form-input-name">
<label class="control-label col-xs-12 col-sm-2">字段名称:</label>
<div class="col-xs-12 col-sm-5">
<input id="c-name" data-rule="required" class="form-control form-control" placeholder="字段名称,不可重复" name="row[name]" type="text" value="">
</div>
</div>
<div class="form-group form-input form-input-special">
<label class="control-label col-xs-12 col-sm-2">特殊字段:</label>
<div class="col-xs-12 col-sm-5">
<input type="hidden" class="operate" data-name="row[special]" value="in"/>
<!--给select一个固定的高度-->
<select id="c-special" class="form-control " name="row[special]" style="height:31px;">
<option value="">----请选择----</option>
<option value="user_id">[user_id]--会员ID/关联fa_user表,后台CRUD时会自动生成selectpage组件</option>
<option value="category_id">[category_id]--分类ID/选择分类的下拉框-单选</option>
<option value="category_ids">[category_ids]--多选分类ID/选择分类的下拉框-多选</option>
<option value="weigh">[weigh]--权重/后台的排序字段,可上下拖动排序</option>
<option value="status">[status]--状态标识/如果存在此字段将启用TAB选项卡展示列表</option>
<option value="createtime">[createtime]--创建时间/记录添加时间字段,不需要手动维护</option>
<option value="updatetime">[updatetime]--更新时间/记录更新时间的字段,不需要手动维护</option>
<option value="deletetime">[deletetime]--删除时间/不需要手动维护,存在此字段会生成回收站功能</option>
</select>
</div>
</div>
<div class="form-group form-input form-input-suffix">
<label class="control-label col-xs-12 col-sm-2">字段后缀:</label>
<div class="col-xs-12 col-sm-5">
<input type="hidden" class="operate" data-name="row[suffix]" value=""/>
<!--给select一个固定的高度-->
<select id="field-suffix" class="form-control form-selection" name="row[suffix]" style="height:31px;">
<option value="">----请选择----</option>
<option value="text">[text]--文本输入框</option>
<option value="number">[number]--数字输入框</option>
<option value="time">[time]--日期时间</option>
<option value="image">[image]--图片文件-单图</option>
<option value="images">[images]--图片文件-多图</option>
<option value="file">[file]--文件上传-单文件</option>
<option value="files">[files]--文件上传-多文件</option>
<option value="avatar">[avatar]--头像上传-单图</option>
<option value="avatars">[avatars]--头像上传-多图</option>
<option value="content">[content]--富文本编辑器</option>
<option value="_id">[_id]--关联字段-单选</option>
<option value="_ids">[_ids]--关联字段-多选</option>
<option value="list-enum">[list]--单选下拉列表</option>
<option value="list-set">[list]--多选下拉列表</option>
<option value="data-enum">[data]--单选框</option>
<option value="data-set">[data]--复选框</option>
<option value="json">[json]--键值组件</option>
<option value="switch">[switch]--开关组件</option>
</select>
</div>
</div>
<div class="form-group form-input form-input-type">
<label class="control-label col-xs-12 col-sm-2">字段类型:</label>
<div class="col-xs-12 col-sm-5">
<input type="hidden" class="operate" data-name="row[type]" value=""/>
<!--给select一个固定的高度-->
<select id="field-type" class="form-control form-selection" name="row[type]" style="height:31px;">
<option value="">----请选择----</option>
<option value="varchar">[varchar]--文本输入框</option>
<option value="int">[int]--整形,type为number的文本框</option>
<option value="enum">[enum]--枚举型,单选下拉列表框</option>
<option value="set">[set]--set型,多选下拉列表框</option>
<option value="float">[float]--浮点型,type为number的文本框,步长根据小数点位数生成</option>
<option value="text">[text]--文本型,textarea文本框</option>
<option value="datetime">[datetime]--日期时间,日期时间的组件</option>
<option value="date">[date]--日期型,日期型的组件</option>
<option value="year">[year]--年类型,年份选择的组件</option>
<option value="timestamp">[timestamp]--时间戳,日期时间的组件</option>
</select>
</div>
</div>
<div class="form-group form-input form-input-comment">
<label class="control-label col-xs-12 col-sm-2">选项:</label>
<div class="col-xs-12 col-sm-5">
<dl class="fieldlist" data-name="row[comment]" >
<dd>
<ins>键名</ins>
<ins>键值</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>{:__('Append')}</a></dd>
<textarea name="row[comment]" class="form-control hide" cols="30" rows="5">{"option_01":"选项一","option_02":"选项2"}</textarea>
</dl>
</div>
</div>
<div class="form-group form-input form-input-length">
<label class="control-label col-xs-12 col-sm-2">字段长度:</label>
<div class="col-xs-12 col-sm-5">
<input id="row-length" data-rule="" class="form-control form-control" placeholder="字段长度,浮点类型可用“10,2”方式表示" name="row[length]" type="text" value="">
</div>
</div>
<div class="form-group form-input form-input-default">
<label class="control-label col-xs-12 col-sm-2">默认值:</label>
<div class="col-xs-12 col-sm-5">
<input id="row-default" data-rule="" class="form-control form-control" placeholder="字段默认值,错误的默认值会保存失败" name="row[default]" type="text" value="">
</div>
</div>
<div class="form-group form-input form-input-desc">
<label class="control-label col-xs-12 col-sm-2">字段说明:</label>
<div class="col-xs-12 col-sm-5">
<textarea id="row-desc" data-rule="" maxlength="200" rows="4" class="form-control form-control" placeholder="字段说明,可以在数据字典查看" name="row[desc]"></textarea>
<!-- <input id="row-default" data-rule="" class="form-control form-control" placeholder="字段默认值,错误的默认值会保存失败" name="row[default]" type="text" value="">-->
</div>
</div>
<div class="form-group layer-footer" style=" display: none">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-5">
<button type="submit" class="btn btn-success btn-embossed ">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>