<?php

/* ========================================================================
 * $Id: page.php 1949 2020-05-19 17:12:57Z onez $
 * 
 * Email: www@onez.cn
 * QQ: 6200103
 * HomePage: http://www.onez.cn
 * ========================================================================
 * Copyright 2016-2017 佳蓝科技.
 * 
 * ======================================================================== */

!defined('IN_ONEZ') && exit('Access Denied');
# edit
#请求数据
if($MODE=='$post'){
  $id=onez()->gp('id');
  $action=onez()->gp('action');
  if($action=='data'){
    $key=$file=onez()->gp('key');
    unset($_POST['action']);
    $plugin=$G['this'];
    if(strpos($key,':')!==false){
      list($token,$file)=explode(':',$key);
      $token=str_replace('$bp.','bs.plugins.',$token);
      $plugin=onez($token);
    }
    $r=array('title'=>'系统提示','html'=>'接口不存在'.$key,);
    if(strpos($file,'./')===false){
      if(strpos($file,'.php')!==false){
        $file=str_replace('.php','',$file);
      }
      if(file_exists($plugin->path.'/api'.$file.'.php')){
        $r=include($plugin->path.'/api'.$file.'.php');
      }
    }
    if(onez()->gp('ac')){
      return $r;
    }
    $A['html']=$r;
  }
  return;
}
$this->add(array(
  'type'=>'breadcrumb',
  'name'=>'面包屑导航',
  'data'=>'html',
));
?>
<section :class="html.classname">
  <div class="nav-tabs-custom" v-if="html.categorys">
    <ul class="nav nav-tabs ui-sortable-handle">
      <li :class="item.active?'active':''" v-for="(item,index) in html.categorys">
        <a data-toggle="tab" :href="'#cat'+index" aria-expanded="false" v-html="item.name"></a>
      </li>
    </ul>
    <div class="tab-content">
      <div class="tab-pane" :id="'cat'+index" :class="item.active?'active':''" v-for="(item,index) in html.categorys">
        <template v-if="item.type=='record'">
          <component v-for="item2 in item.record" :is="item2.type||'onez-html'" :data="item2"></component>
        </template>
        <component v-else :is="item.type||'onez-html'" :data="item"></component>
      </div>
    </div>
  </div>
  <template v-else-if="html.type=='record'">
    <component v-for="item in html.record" :is="item.type||'onez-html'" :data="item"></component>
  </template>
  <component v-else :is="html.type||'onez-html'" :data="html"></component>
</section>
