多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 关联配置,当配置组件属性open_by时,其对应的组件的值为真时此组件显示,否则隐藏 ~~~ ->addWidgets([ ['has_config|switch','是否需要配置'], ['config|textarea','',['placeholder'=>'请输入配置内容','open_by'=>'has_config']], ]) ~~~ 关 ![](https://box.kancloud.cn/eb821f5840d80b645f6650f43fa4bc79_1053x110.png) 开 ![](https://box.kancloud.cn/d6b25d31bb8bb0c676e2c8935bac24a2_1179x199.png) ### open_by的属性可绑定到具体的值,只在关联记录的某个值被选中/录入时显示 ~~~ $dimension_score_show_type = [ 0 => ['id'=>0,'name'=>'展示全部'], 1 => ['id'=>1,'name'=>'展示得分最高的1个维度'], 3 => ['id'=>3,'name'=>'展示得分最高的N个维度'], 4 => ['id'=>4,'name'=>'按指定得分划分显隐分子'], ] ->addWidgets([ ['dimension_score_show_type|select','维度得分展示',['listdata'=>$dimension_score_show_type,'key_relevance'=>'id|name']], ['dimension_show_num|text','展示维度数量',['open_by'=>'dimension_score_show_type|3']], ['dimension_show_score|text','显性分子维度最低分',['open_by'=>'dimension_score_show_type|4']], ]) ~~~ ![](https://box.kancloud.cn/f34c9d41d37db367b611b1a197c7264c_1122x112.png) ### 配置多条件匹配,open_by中匹配条件用 , 进行分割 ~~~ ->addWidgets([ ['is_private|switch','是否私有|私有后只有邀请的用户凭借【邀请码】方能答题'], ['is_allow_reexamination|switch','允许重考',['open_by'=>'is_private']], ['reexamination_times|select','允许重考次数',['listdata'=>$reexamination_times_config,'key_relevance'=>'id|name','open_by'=>'is_allow_reexamination,进行分割is_private']], ['reexamination_time_interval|text','重考时间间隔|单位小时,0为不限时',['open_by'=>'is_allow_reexamination,is_private']], ]) ~~~ ### 在open_by切换时,清空文本区内容 `switch_clear` ~~~ ['resources_value|text','音频地址',['open_by'=>'resource_type','switch_clear'=>true]], ~~~ ### 在open_by切换时,禁用文本区 `disable_hide` ~~~ ['resources_value|text','音频地址',['open_by'=>'resource_type','disable_hide'=>true]], ~~~