积木快速开发平台

技术团队文档示例


下拉框及级联

<h2>下拉框</h2> <p>典型的下拉框控件如下: <img src="http://resh.bblocks.cn/doc/widget/select/select1.png" alt="下拉框控件" /> <br> 以及联动下拉: <img src="http://resh.bblocks.cn/doc/widget/select/select1_2.png" alt="联动下拉框控件" /></p> <p>想使用此控件,方式如下:</p> <ol> <li>定义表字段的时候,备注项填写为:&quot;xx说明:/:1=/-/——上架,/,2=/-/——售罄,3=下架 ,4=/-/——过期&quot;,如字段:sexy 说明项为:“性别:1=男,0=女”</li> <li>正常的“导入元数据”,元对象此字段系统会默认设置为:下拉框,且表达式为:select value ID,name CN from dicts where object = 'demo2_test' and field = '此字段名 如sexy' 同时字典表将写入 相应的字典数据 本次表单控件说明的元对象为:demo2_test,后面如无说明均以此对象来讲解</li> <li>如果不是正常1,2两步操作,也可以手工操作: <blockquote> <ul> <li>控件类型选择为“下拉框”</li> <li>表达式填入 select value ID,name CN from dicts where object = 'demo2_test' and field = '此字段名'</li> <li>检测字典数据 表名:demo2_test,字段名:此字段名 的字典数据是否完整,如无则添加之 <img src="http://resh.bblocks.cn/doc/widget/select/select3.png" alt="字段字典数据" /></li> <li>下拉框的独立属性,<strong>限制值</strong>:limit,如:1,2 ,则只允许选择 1和2,其他值只读</li> </ul> </blockquote></li> <li>如此下拉框以及数据源已经配置好,其次就是配置一些通用属性,提醒下下拉框支持多选,其他属性就不特别介绍了。</li> </ol> <p>如此就完成了下拉框的使用 PS:<strong>文件的1个独立属性只有在表单设计模式下,手工修改配置json给此字段添加如上字段(暂时未做配置ui)</strong></p> <h4>表单设计模式:</h4> <p>在此模式下属性全部从 元对象=&gt;拓展配置(当然得有此表单排版配置以及此字段配置) 读取,属性如下: <img src="http://resh.bblocks.cn/doc/widget/select/select_attr.png" alt="表单下拉框设计" /></p> <h2>级联下拉框</h2> <ol> <li>正常如下拉框配置</li> <li>“表达式” 部分做部分微调 <blockquote> <ul> <li>先确认我们有这样的父子结构的表比如:bb_.area 就是满足有父子结构的表</li> <li>select areaId ID,areaName CN,parentid p_id from area where level=2;ds=eova</li> <li>parentid p_id即为告知系统我们父节点的ID(p_id 为父节点:省的ID) 比如:我们配置的省市区,字段分别为:p_id,c_id,a_id,分别配置的表达式依次为: <ol> <li>select areaId ID,areaName CN from area where level=1;ds=eova</li> <li>select areaId ID,areaName CN,parentid p_id from area where level=2;ds=eova</li> <li>select areaId ID,areaName CN,parentid c_id from area where level=3;ds=eova</li> </ol></li> </ul> </blockquote></li> </ol> <p>PS:<strong>&quot;;ds=eova&quot;的语法为指定数据源,系统默认为我们准备主库(默认库),和从库(eova),不指定的情况在主库查询,如果表在配置库可以在sql后指定数据库</strong></p> <h3>高级使用开发</h3> <p>待续。。。</p>

页面列表

ITEM_HTML