>获取后台创建的字段信息 ~~~[api] get:/index.php/field/Apifield/get_fields string:type=add#获取表单字段的模式。add:添加模式,edit:编辑模式,show:显示模式 int:isGroup=0#是否以分组模式返回字段,0:不分组,1:分组 *table#获取那个数据表的字段 <<< 不分组success { "err": 0, "data": [{ "id": 7, "field": "username", "title": "用户名", "table": "field_ceshi", "order_num": 0, "form_type": "text", "group": "user", "describe": "请输入用户名", "property": { "css": "", "form_property": "", "default": "", "decimal_num": "0", "min": "0", "max": "0", "min_len": "0", "max_len": "0", "reg": [{ "reg": "[0-9]", "errMsg": "必须为数字" }, { "reg": "[a-z]", "errMsg": "必须为字母" }], "is_num": 0, "only": 0 } }, { "id": 10, "field": "aihao", "title": "用户爱好", "table": "field_ceshi", "order_num": 0, "form_type": "checkbox", "group": "info", "describe": "请选择用户爱好", "property": { "css": "", "form_property": "lay-skin=primary", "default": "", "min_len": "3", "max_len": "10", "options": [{ "text": "篮球", "value": "1" }, { "text": "足球", "value": "2" }, { "text": "看书", "value": "3" }], "is_num": 0, "only": 0 } }] } <<< 分组success { "err": 0, "data": { "user": [{ "id": 7, "field": "username", "title": "用户名", "table": "field_ceshi", "order_num": 0, "form_type": "text", "group": "user", "describe": "请输入用户名", "property": { "css": "", "form_property": "", "default": "", "decimal_num": "0", "min": "0", "max": "0", "min_len": "0", "max_len": "0", "reg": [{ "reg": "[0-9]", "errMsg": "必须输入数字" }, { "reg": "[a-z]", "errMsg": "必须输入字母" }], "is_num": 0, "only": 0 } }], "info": [{ "id": 10, "field": "aihao", "title": "用户爱好", "table": "field_ceshi", "order_num": 0, "form_type": "checkbox", "group": "info", "describe": "请选择用户爱好", "property": { "css": "", "form_property": "lay-skin=primary", "default": "", "min_len": "3", "max_len": "10", "options": [{ "text": "篮球", "value": "1" }, { "text": "足球", "value": "2" }, { "text": "看书", "value": "3" }], "is_num": 0, "only": 0 } }] } } <<< error { "err": 1, "code": 1000, "content": "table参数必传" } ~~~ | 字段 | 描述 | | --- | --- | | id | 字段id | | field | 字段名称,在数据表中保存的字段名称,如name,title | | title | 字段别名,如:用户名,性别等文本 | | table | 字段所在的数据表名称,和请求参数table值一致 | | order_num | 字段显示排序,越小越在前边 | | form_type | 字段显示的form表单类型,text:单行文本,textarea:多行文本,select:选项-下拉,checkbox:选项-复选,radio:选项-单选,slider:选项-滑块,colorpicker:颜色选择器,rate:星级评分,datetime:日期时间,file:上传-单文件,editor:编辑器 | | group | 字段分组值 , | | describe | 字段描述 | | property | 字段属性,不同的字段类型属性值也不相同 | >不同类型的属性值property ~~~ text property属性值 css------------------------表单样式 form_property--------------其它属性 default--------------------默认值 only-----------------------唯一性,字段在数据表中的值是否唯一 is_num-------------------是否为数字,字段在数据表中是否为数字 decimal_num--------------如果为数字,显示的小数位数,0表示整数 min-----------------------如果为数字,允许输入的最小值 max-------------------------如果为数字,允许输入的最大值 min_len---------------------如果不为数字,允许输入字符的最小长度,如果大于0,表示必填 max_len---------------------如果不为数字,允许输入字符的最大长度,0表示不限制 reg-------------------------对输入的这则匹配 ~~~ ``` { "id": 7, "field": "username", "title": "用户名", "table": "field_ceshi", "order_num": 0, "form_type": "text", "group": "user", "describe": "请输入用户名", "property": { "css": "", "form_property": "", "default": "", "decimal_num": "0", "min": "0", "max": "0", "min_len": "0", "max_len": "0", "reg": [{ "reg": "[0-9]", "errMsg": "必须为数字" }, { "reg": "[a-z]", "errMsg": "必须为字母" }], "is_num": 0, "only": 0 } } ``` ~~~ textarea property属性值 css------------------------表单样式 form_property--------------其它属性 default--------------------默认值 min_len---------------------如果不为数字,允许输入字符的最小长度,如果大于0,表示必填 max_len---------------------如果不为数字,允许输入字符的最大长度,0表示不限制 reg-------------------------对输入的这则匹配 ~~~ ``` { "id": 9, "field": "describe", "title": "用户简介", "table": "field_ceshi", "order_num": 0, "form_type": "textarea", "group": "info", "describe": "请输入用户介绍", "property": { "css": "", "form_property": "", "min_len": "1", "max_len": "100", "default": "", "reg": "", "is_num": 0, "only": 0 } } ``` ~~~ select property属性值 css------------------------表单样式 form_property--------------其它属性 default--------------------默认值 is_num-------------------是否为数字,字段在数据表中是否为数字 decimal_num--------------如果为数字,显示的小数位数,0表示整数 min-----------------------如果为数字,允许输入的最小值 max-------------------------如果为数字,允许输入的最大值 min_len---------------------是否必选,1表示必填 options---------------------选项值格式:text=value,每行一个,分组格式:分组起始 G=组名称,分组结束 G ~~~ ``` { "id": 8, "field": "sex", "title": "性别", "table": "field_ceshi", "order_num": 0, "form_type": "select", "group": "user", "describe": "请选择性别", "property": { "css": "", "form_property": "", "default": "", "decimal_num": "0", "min": "0", "max": "0", "options": [{ "text": "男", "value": "1" }, { "text": "女", "value": "2" }, { "text": "未知", "value": "3" }], "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` checkbox property属性值 css------------------------表单样式 form_property--------------其它属性 default--------------------默认值 min_len---------------------复选框最少选择个数 max_len---------------------复选框最多选择个数 options---------------------选项值格式:text=value,每行一个 ``` ``` { "id": 10, "field": "aihao", "title": "用户爱好", "table": "field_ceshi", "order_num": 0, "form_type": "checkbox", "group": "info", "describe": "请选择用户爱好", "property": { "css": "", "form_property": "lay-skin=primary", "default": "", "min_len": "3", "max_len": "10", "options": [{ "text": "篮球", "value": "1" }, { "text": "足球", "value": "2" }, { "text": "看书", "value": "3" }], "is_num": 0, "only": 0 } } ``` ``` radio property属性值 css------------------------表单样式 form_property--------------其它属性 default--------------------默认值 is_num-------------------是否为数字,字段在数据表中是否为数字 decimal_num--------------如果为数字,显示的小数位数,0表示整数 min-----------------------如果为数字,允许输入的最小值 max-------------------------如果为数字,允许输入的最大值 options---------------------选项值格式:text=value,每行一个 ``` ``` { "id": 12, "field": "class", "title": "班级", "table": "field_ceshi", "order_num": 0, "form_type": "radio", "group": "base", "describe": "", "property": { "css": "", "form_property": "", "default": "", "decimal_num": "0", "min": "0", "max": "0", "options": [{ "text": "一班", "value": "1" }, { "text": "二班", "value": "2" }, { "text": "三班", "value": "3" }], "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` slider property属性值 input-------------------输入框,是否显示输入框,开启范围选择,该选择不生效 show_type------------------------显示方式,横向显示还是纵向显示 range--------------范围选择,开启:选择数字的范围格式为(1,10) default--------------------默认值 showstep-------------------间隔点,显示滑块拖动的预计位置 step--------------滑块步长,滑块每次拖动的距离 min-----------------------最小值,滑块可拖拽的最小值 max-------------------------最大值,滑块可拖拽的最大值 color---------------------滑块颜色,滑块的主题颜色 ``` ``` { "id": 13, "field": "age", "title": "年龄", "table": "field_ceshi", "order_num": 0, "form_type": "slider", "group": "base", "describe": "", "property": { "input": "1", "show_type": "0", "range": "1", "showstep": "1", "step": "1", "min": "1", "max": "100", "default": "20", "color": "#cd2424", "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` colorpicker property属性值 alpha-------------------透明度,是否启用颜色透明度 show_type------------------------显示方式,横向显示还是纵向显示 predefine--------------预设颜色,打开选择器时预设的颜色块 colors--------------预设颜色值,如果开启预设颜色后,保存预设颜色的具体颜色值 default--------------------默认值 color_size-------------------选框大小,选框大小尺寸 ``` ``` { "id": 14, "field": "clor", "title": "喜欢的颜色", "table": "field_ceshi", "order_num": 0, "form_type": "colorpicker", "group": "base", "describe": "", "property": { "alpha": "0", "predefine": "0", "colors": "", "default": "#f80f0f", "color_size": "sm", "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` rate property属性值 show_text-------------------透明度,是否启用颜色透明度 show_type------------------------文本显示,启用:显示你选择的星级数字 half--------------开启半星,启用:可以选择半个星星,否则选择整个星星,不可以选择-.5 length--------------星星个数,显示星星的个数 default--------------------默认值 color-------------------星星颜色,星星在表单中显示的颜色 ``` ``` { "id": 15, "field": "point", "title": "自我评价", "table": "field_ceshi", "order_num": 0, "form_type": "rate", "group": "base", "describe": "", "property": { "show_text": "1", "half": "1", "length": "5", "default": "2", "color": "#f50c0c", "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` datetime property属性值 lang-------------------显示语言,选择时间日期选项卡的语言 calendar------------------------开启公历,时间日期选项卡是否开启显示开启公历功能 range--------------日期区间,日期时间选项卡是单个日期选择还是区间选择 type--------------日期类型,日期时间选项卡显示的日期类型 format--------------日期格式,时间日期格式:yyyy-年,MM-月,dd-日,HH-时,mm-分,ss-秒 min--------------最小日期,选择日期时间,可选最小的日期 max--------------最大日期,选择日期时间,可选最大的日期 default--------------------默认值 color-------------------主题颜色,选项卡的主题颜色 ``` ``` { "id": 16, "field": "times", "title": "出生年月", "table": "field_ceshi", "order_num": 0, "form_type": "datetime", "group": "base", "describe": "", "property": { "lang": "0", "calendar": "0", "range": "0", "type": "date", "default": "2018-3-17", "format": "yyyy-MM-dd", "min": "", "max": "", "color": "#d20303", "is_num": 0, "only": 0, "min_len": 0 } } ``` ``` file property属性值 exts-------------------文件后缀,允许上传的后缀文件,留空表示不限制,多个用英文逗号(,)隔开 size------------------------文件大小,允许上传的单个文件的大小,单位为:KB,0或空表示不限制 auto--------------自动上传,是否开启自动上传 domain--------------显示域名,显示图片时,是否显示图片连接的域名 server--------------图库,是否开启本地上传,开启可以直接从已上传的图库中选择图片,需安装[upload]插件 min_len--------------是否必选,是否必须上传图片 ``` ``` { "id": 17, "field": "img", "title": "头像", "table": "field_ceshi", "order_num": 0, "form_type": "file", "group": "base", "describe": "", "property": { "exts": "jpg|png", "size": "0", "auto": "1", "domain": "1", "server": "1", "min_len": "1", "is_num": 0, "only": 0 } } ``` ``` editor property属性值 height-------------------编辑器高度 ```