<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 當前平臺已停止維護,請盡快遷移至[云靜Admin TP6](https://gitee.com/worklz/yunj-admin-tp6) [https://gitee.com/worklz/yunj-admin-tp6](https://gitee.com/worklz/yunj-admin-tp6) ***** ## 表格構建器渲染輸出 * **方法一:頁面內只有單一表格時** > 注意!此方法僅支持渲染一個表格構建器,不需要寫視圖文件 控制器代碼示例如下: ```php namespace app\demo\controller; use yunj\Controller; class FormDemo extends Controller { public function demo(){ $builder=YT('demo') ->state([11=>'正常',22=>"回收站"]) ->filter([ 'name'=>['title'=>'姓名'] ]) ->toolbar(function($state){ $toolbar=['add'=>['type'=>'openPopup','title'=>'添加','icon'=>'layui-icon layui-icon-add-circle','url'=>url('add')]]; switch ($state){ case 11: $toolbar+=[ 22=>['type'=>'asyncEvent','title'=>'移入回收站','dropdown'=>true], ]; break; case 22: $toolbar+=[ 11=>['type'=>'asyncEvent','title'=>'還原','dropdown'=>true], 33=>['type'=>'asyncEvent','title'=>'永久刪除','dropdown'=>true], ]; break; } return $toolbar; }) ->defaultToolbar('filter','export','print') ->import(url("demo/importDemo/index")) ->cols(function($state){ $cols=[ 'id'=>['type'=>'checkbox'], 'name'=>['title'=>'姓名'], 'create_time'=>['title'=>'添加時間', 'align'=>'center', 'hide'=>'mobile_hide_hide','templet'=>'datetime'], 'action'=>[ 'title'=>'操作', 'templet'=>'action', 'options'=>[ 'edit'=>['type'=>'openPopup','title'=>'詳情','icon'=>'layui-icon layui-icon-survey','url'=>url('edit')] ] ] ]; switch ($state){ case 11: $cols['action']['options']+=[ 22=>['type'=>'asyncEvent','title'=>'移入回收站','dropdown'=>true], ]; break; case 22: $cols['action']['options']+=[ 11=>['type'=>'asyncEvent','title'=>'還原','dropdown'=>true], 33=>['type'=>'asyncEvent','title'=>'永久刪除','dropdown'=>true] ]; break; } return $cols; }) ->count(function($filter){ // 固定參數 $state=$filter['state']; $ids=$filter['ids']; // 篩選表單參數 $name=$filter['name']; $whereArr=[]; $whereArr[]=$state?['state','eq',$state]:['state','neq',33]; if($ids) $whereArr[]=['id','in',$ids]; if($name) $whereArr[]=['name_cn','like','%'.$name.'%']; $count = $this->model->getOwnCount($whereArr); return $count; }) ->items(function ($limit_start,$limit_length,$filter,$sort){ // 固定參數 $state=$filter['state']; $ids=$filter['ids']; // 篩選表單參數 $name=$filter['name']; $whereArr=[]; $whereArr[]=$state?['state','eq',$state]:['state','neq',33]; if($ids) $whereArr[]=['id','in',$ids]; if($name) $whereArr[]=['name_cn','like','%'.$name.'%']; $orderArr=$sort+['id'=>'desc']; $items = $this->model->getOwnRows(["*"],$whereArr,$orderArr,$limit_start,$limit_length); return $items; }) ->event(function ($event,$ids){ foreach ($ids as $id){ $whereArr=[['id','eq',$id]]; switch ($event){ case 11: $updateData=['state'=>11]; $whereArr[]=['state','eq',22]; break; case 22: $updateData=['state'=>22]; $whereArr[]=['state','eq',11]; break; case 33: $updateData=['state'=>33]; $whereArr[]=['state','eq',22]; break; default: return error_json(); } if($updateData) $this->model->change($updateData,$whereArr); } return success_json(); }); return view_table($builder); } } ``` 不需要視圖文件! * **方法二:自定義頁面內容時** > 注意!此方法支持一個頁面渲染多個表格構建器,需要寫視圖文件 控制器代碼示例如下: ```php namespace app\demo\controller; use yunj\Controller; class FormDemo extends Controller { public function demo(){ // 表格構建器配置參考方法一 $builder=YT('demo'); // 多個構建器可反復調用此方法 $builder->assign($this); $builder->assign($this); return $this->fetch(); } } ``` 視圖代碼示例如下: ```html {extend name="$adminPage"} {block name="content"} <table type="yunj" id="demo"></table> {/block} ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看