项目介绍 项目中需要用到下拉树多选功能,找到两个相关组件moretop-layui-select-ext和wujiawei0926-treeselect,但是moretop-layui-select-ext不支持树结构,wujiawei0926-treeselect不支持多选,于是干脆仿照moretop-layui-select-ext动手写了一个组件,选择zTree而没有选择layuiTree的主要原因是layuiTree暂不支持父子关系取消. 渲染代码 var _zTreeSelec…
场景描述:某个公司有多个部门并且部门存在子部门,通过一个下拉框选取多个部门,但是如果某个部门的子部门被全部选择,则只取该部门,而忽略子部门.(叶子节点全被选中时,只取父节点) 知识点:ComboTree.一般处理程序.递归.Json 效果如图 数据库表设计:unit_main unit_id unit_name parent_id desc 部门ID 部门名称 父ID 说明 节点类设计: public class Unit { public decimal id { get; set; } pu…
1.原始需求,选择省份后,相应的城市会自动加载 2.思路 a.获取下拉框的所有元素个数 b.随机点击0-元素个数之间的某个值 3.代码实现 Random random = new Random(); Select slp = new Select(dr.findElement(By.id("province"))); int psize = slp.getOptions().size()-1; int p = random.nextInt(psize); slp.selectByInd…