<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 生成表格 ###變量聲明 ~~~ private $meta_title; private $topbtns = array(); //表格頭部操作按鈕 全局 private $rightbtns = array(); //表格數據右側操作 按鈕 只操作該行 private $caption; //數據表格標題 private $thead = array(); //表格頭部 private $tbody = array(); //數據 private $main_key = 'id'; //主鍵數組 private $search = array(); //搜索 private $page_list; //分頁數據 private $is_ajax = true; //判斷ajax提交 private $extra_html; //可能使用額外html private $template; ~~~ ###初始化模板 ~~~ protected function _initialize(){ $this->template = APP_PATH.'JankzMaker/View/Admin/jankztable.html'; } ~~~ ###ajax提交 ~~~ public function setAjax($is_ajax){ $this->is_ajax = $is_ajax; return $this; } ~~~ ###設置表頭 ~~~ public function setThead($thead){ $this->thead = $thead; return $this; } ~~~ ###設置表格數據實體 ~~~ public function setTbodyData($tbody){//數據庫讀取的數據 $this->tbody=$tbody; return $this; } ~~~ ###設置數據列 ~~~ public function setTbodyList($tbody_list){//循環列表 $this->tbody_list = $tbody_list; return $this; } ~~~ ###設置主鍵 ~~~ public function setKey($main_key){ $this->main_key = $main_key; return $this; } ~~~ ###添加表格頂部操作按鈕 ~~~ public function addTopBtn($type){ $alltop =array('add','resume','forbid','delete'); if ($type =='default'){ $type =$alltop; }else{ $type = $type == is_array($type)?$type:explode(',',$type);//c處理頭部按鈕輸入數據 這里支持三種 數組 字符串 } foreach ($type as $key => $value) { switch ($value) { case 'add': $btn['name'] = '新增'; $btn['href'] =U(MODULE_NAME.'/'.CONTROLLER_NAME.'/add'); $btn['btn_class'] = 'teal'; $btn['i_class'] = 'plus'; $btns['second'] =$btn; break; case 'resume': $btn['name'] = '啟用'; $btn['select'] ='ids'; $btn['href'] =U(MODULE_NAME.'/'.CONTROLLER_NAME.'/resume'); $btn['btn_class'] = 'gray'; $btn['i_class'] = 'check'; $btns['second'] =$btn; break; case 'forbid': $btn['name'] = '禁用'; $btn['select'] ='ids'; $btn['href'] =U(MODULE_NAME.'/'.CONTROLLER_NAME.'/forbid'); $btn['btn_class'] = 'yellow'; $btn['i_class'] = 'ban'; $btns['second'] =$btn; break; case 'delete': $btn['name'] = '刪除'; $btn['select'] ='ids'; $btn['href'] =U(MODULE_NAME.'/'.CONTROLLER_NAME.'/delete'); $btn['btn_class'] = 'red'; $btn['i_class'] = 'trash'; $btns['second'] =$btn; break; } $this->topbtns[] =$btns; } return $this; } ~~~ ###添加表格右側操作按鈕 ~~~ public function addRightBtn($type){ switch ($type) { case 'edit': $r_btn['name'] = '編輯'; $r_btn['href']=U(MODULE_NAME.'/'.CONTROLLER_NAME.'/edit',array($this->main_key=>'__value__id_')); $r_btn['btn_class']=''; $r_btn['i_class']='teal large edit'; $this->rightbtns[] = $r_btn; break; case 'resume': $r_btn['name'] = '啟用'; $r_btn['href']=U(MODULE_NAME.'/'.CONTROLLER_NAME.'/resume',array($this->main_key=>'__value__id_','status'=>1)); $r_btn['btn_class']='is_ajax'; $r_btn['i_class']='teal large unlock'; $this->rightbtns[] = $r_btn; break; case 'forbid': $r_btn['name'] = '禁用'; $r_btn['href']=U(MODULE_NAME.'/'.CONTROLLER_NAME.'/forbid',array($this->main_key=>'__value__id_','status'=>0)); $r_btn['btn_class']=' is_ajax'; $r_btn['i_class']='yellow large lock'; $this->rightbtns[] = $r_btn; break; case 'delete': $r_btn['name'] = '刪除'; $r_btn['href']=U(MODULE_NAME.'/'.CONTROLLER_NAME.'/delete',array($this->main_key=>'__value__id_','status'=>1)); $r_btn['btn_class']=' is_ajax'; $r_btn['i_class']='red large trash'; $this->rightbtns[] = $r_btn; break; case 'info': $r_btn['name'] = '查看'; $r_btn['href']=U(MODULE_NAME.'/'.CONTROLLER_NAME.'/info',array($this->main_key=>'__value__id_','status'=>1)); $r_btn['btn_class']=' is_ajax'; $r_btn['i_class']='teal large eye'; $this->rightbtns[] = $r_btn; break; } return $this; } ~~~ ### 設置模板 ~~~ public function setTemplate($template){ $this->template = $template; return $this; } ~~~ ### 設置分頁 ~~~ public function setPage($page_list){ $this->page_list= $page_list; return $this; } ~~~ ### 打印頁面 ~~~ public function display(){ foreach ($this->tbody as $key => &$value) { if(count($this->rightbtns)!=0){ $value['rightbtns'] = $this->rightbtns; foreach ($value['rightbtns'] as $key => &$btn) { $btn['href']=preg_replace('/__value__id_/',$value[$this->main_key],$btn['href']); } } } foreach ($this->tbody as $key => &$value) { foreach ($this->tbody_list as $key => $list) { switch ($list['name']) { case 'c_time': $value[$list['name']] = dateFormat($value[$list['name']]); break; case 'u_time': $value[$list['name']] = dateFormat($value[$list['name']]); break; case 'status': if($value[$list['name']]==1){ $value[$list['name']]='<i class="checkmark icon teal"></i>'; }else{ $value[$list['name']]='<i class="red ban icon"></i>'; } break; case 'icon': $value[$list['name']]='<i class="icon teal '.$value[$list['name']].'"></i>'; break; case 'url': $value[$list['name']]= U($value[$list['name']]); break; } } } $this->assign('meta_title',$this->meta_title); $this->assign('is_ajax',$this->is_ajax); $this->assign('tbody',$this->tbody); $this->assign('tbody_list',$this->tbody_list); $this->assign('thead',$this->thead); $this->assign('rightbtns',$this->rightbtns); $this->assign('topbtns',$this->topbtns); $this->assign('page_list',$this->page_list); parent::display($this->template); } } ~~~
                  <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>

                              哎呀哎呀视频在线观看