企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
#Admin GUI ------ 后台页面可以通过Gui直接生成 ### 1.tab 页面 ```php public function config(){ //选项值 $option = array('1'=>'值1','2'=>'值2','3'=>'值3','4'=>'值4'); //表单原值 $data = array('name'=>'name','name1'=>'name1','name2'=>3,'name3'=>3,'name4'=>'name4',); //$gui = new ConfigGui(); ui('Config')->title('Gui测试页面(title)') ->tab('测试1',U('config')) ->tab('测试2',U('config'),true) ->tab('测试3',U('config')) ->tips('测试') ->keyManyImage('pictues','多图上传','keyManyInmages') ->key('name','标题title','子标题subtitle','text') ->keyReadOnly('name1','标题','keyReadOnly') ->keyUpdateTime() ->keyCreateTime() ->keySelect('name2','select需要option参数','keySelect',$option) ->keyRadio('name3','readio需要option','keyRadio',$option) ->keyCheckBox('name4','option','keyCheckBox',$option) ->keyTextArea('name5','option','keyTextArea') ->keyUid('name6','用户uid','keyUid') ->data($data) ->buttonBack() ->buttonSubmit() ->display(); } ``` ### 2.列表页 ```php public function lists(){ $nickname = I('nickname'); $map['status'] = array('egt',0); if(is_numeric($nickname)){ $map['uid|nickname']= array(intval($nickname),array('like','%'.$nickname.'%'),'_multi'=>true); }else{ $map['nickname'] = array('like', '%'.(string)$nickname.'%'); } $list = parent::lists('Member', $map); ui('List') ->title('Gui List测试,下面使用列表生成Gui生成 用户列表') ->buttonNew(U('User/add')) ->buttonEnable(U('User/change')) ->buttonDisable(U('User/change')) ->buttonDelete(U('User/change')) ->buttonRestore(U('User/change')) ->search('用户名','key','text','多个关键词用空格分开') ->search('用户分组','key','text','选择分组') //表格key开始 ->keyId('uid','Uid') ->keyText('nickname','用户名') ->keyText('score','积分') ->keyText('login','登录次数') ->keyCreateTime('last_login_time','最后登录时间') ->keyDoAction('url','操作1') ->keyDoAction('url','操作2') ->data($list) ->display(); } ``` ### 3.树形列表 ```php public function tree(){ $tree = D('Category')->getTree(0,'id,name,title,sort,pid,allow_publish,status'); ui('Tree') ->title('使用树形省成式生成系统的分类tree结构') ->buttonNew(U('Category/add')) ->data($tree) ->display(); } ``` ### 4.排序列表页 ```php public function sorts(){ $data = array( array('id'=>1,'title'=>'world'), array('id'=>8,'title'=>'hello'), array('id'=>3,'title'=>'!'), ); ui('Sort') ->title('排序测试') ->buttonSubmit('submit') ->data($data) ->buttonBack() ->display(); } ```