Selaa lähdekoodia

修改分类问题,实现卷功能

Xiahai 9 kuukautta sitten
vanhempi
commit
43ef7a8802

+ 5 - 5
application/admin/controller/cms/Channel.php

@@ -49,6 +49,7 @@ class Channel extends Backend
         $config = get_addon_config('cms');
         $this->assignconfig('spiderRecord', intval($config['spiderrecord']?? 0));
 
+        $this->view->assign('channelTypeList', ChannelModel::getChannelTypeList());
         $this->view->assign("modelList", $this->modelList);
         $this->view->assign("channelList", $this->channelList);
         $this->view->assign("typeList", ChannelModel::getTypeList());
@@ -69,7 +70,7 @@ class Channel extends Backend
         $this->request->filter(['strip_tags']);
         if ($this->request->isAjax()) {
             $search = $this->request->request("search");
-            $model_id = $this->request->request("model_id");
+            $type = $this->request->request("type", 'channel');
             //构造父类select列表选项数据
             $list = [];
             if ($search) {
@@ -82,17 +83,16 @@ class Channel extends Backend
                 $list = $this->channelList;
             }
             foreach ($list as $index => $item) {
-                if ($model_id && $model_id != $item['model_id']) {
+                if ($type && $type != $item['type']) {
                     unset($list[$index]);
                 }
             }
             $list = array_values($list);
             $modelNameArr = [];
-            foreach ($this->modelList as $k => $v) {
+            foreach ($this->modelList as $v) {
                 $modelNameArr[$v['id']] = $v['name'];
             }
-            foreach ($list as $k => &$v) {
-                $v['type'] = $v['type_text'];
+            foreach ($list as &$v) {
                 $v['pid'] = $v['parent_id'];
                 $v['model_name'] = $v['model_id'] && isset($modelNameArr[$v['model_id']]) ? $modelNameArr[$v['model_id']] : __('None');
             }

+ 1 - 0
application/admin/lang/zh-cn.php

@@ -67,6 +67,7 @@ return [
     'Last'                                                  => '末页',
     'None'                                                  => '无',
     'Home'                                                  => '主页',
+    'Footer'                                                => '底部',
     'Online'                                                => '在线',
     'Login'                                                 => '登录',
     'Logout'                                                => '退出',

+ 6 - 2
application/admin/lang/zh-cn/cms/channel.php

@@ -44,10 +44,14 @@ return [
     'List'                                       => '列表栏目',
     'Link'                                       => '跳转链接',
     'Issecondary'                                => '是否二级导航',
-    'Footer Button'                              => '首页底部按钮',
-    'Home Button'                                => '首页按钮',
+    'Home'                                       => '首页按钮',
+    'Footer'                                     => '首页底部按钮',
     'Hover Image'                                => '选中图片',
     'Cycle'                                      => '周期',
     'Assign editors'                             => '指派主编',
     'Chief'                                      => '主编',
+    'Superior column'                            => '上级栏目',
+    'Channel Type'                               => '栏目类型',
+    'Journal'                                    => '期刊',
+    'Issues'                                     => '卷',
 ];

+ 11 - 1
application/admin/model/cms/Channel.php

@@ -168,9 +168,14 @@ class Channel extends Model
         });
     }
 
+    public static function getChannelTypeList()
+    {
+        return ['journal' => __('Journal'), 'issues' => __('Issues')];
+    }
+
     public static function getTypeList()
     {
-        return ['channel' => __('Channel'), 'list' => __('List'), 'link' => __('Link'), 'home_button' => __('Home Button'), 'footer_button' => __('Footer Button')];
+        return ['channel' => __('Channel'), 'list' => __('List'), 'link' => __('Link'), 'home' => __('Home'), 'footer' => __('Footer')];
     }
 
     public function getFlagList()
@@ -194,6 +199,11 @@ class Channel extends Model
         return ['0' => __('自已和所有子级'), '1' => __('自己和一级子级'), '2' => __('仅自己'), '3' => __('仅包含一级子级(不含自己)'), '4' => __('仅包含所有子级(不含自己)')];
     }
 
+    public static function typeList()
+    {
+        return ['journal' => __('Journal'), 'product' => __('Product'), 'article' => __('Article'), 'special' => __('Special'), 'new' => __('New')];
+    }
+
     public function getTypeTextAttr($value, $data)
     {
         $value = $value ? $value : $data['type'];

+ 40 - 30
application/admin/view/cms/channel/add.html

@@ -5,7 +5,17 @@
         <div class="col-xs-12 col-sm-8">
             <div class="radio">
                 {foreach name="typeList" item="vo"}
-                <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="" {if input('type')==$key }checked {/if}/> {$vo}</label>
+                <label for="row[type]"><input id="row[type]" name="row[type]" type="radio" value="{$key}"/>{$vo}</label>
+                {/foreach}
+            </div>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Channel Type')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="radio">
+                {foreach name="channelTypeList" item="vo"}
+                <label for="row[channel_type]"><input id="row[channel_type]" name="row[channel_type]" type="radio" value="{$key}"/>{$vo}</label>
                 {/foreach}
             </div>
         </div>
@@ -21,7 +31,7 @@
         </div>
     </div>
     <div class="form-group">
-        <label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('上级栏目')}:</label>
+        <label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('Superior column')}:</label>
         <div class="col-xs-12 col-sm-8">
             <!--@formatter:off-->
             <select name="row[parent_id]" data-rule="required" id="parent_id" class="form-control">
@@ -45,7 +55,7 @@
             <textarea id="c-name" data-rule="required; channelname" class="form-control" name="row[name]" placeholder="支持批量录入,一行一条记录,格式:名称|自定义URL名称" data-toggle="tooltip" data-html="true" title="如需一次录入多个栏目请换行输入,批量录入时将忽略自定义名称<br>格式:名称|自定义URL名称"></textarea>
         </div>
     </div>
-    <div class="form-group tf tf-home_button">
+    <div class="form-group tf tf-home">
         <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-content" class="form-control" name="row[content]" placeholder="请输入内容" title="请输入内容">
@@ -75,10 +85,10 @@
                 <span class="msg-box n-right" for="c-image"></span>
             </div>
             <ul class="row list-inline plupload-preview" id="p-image"></ul>
-            <span class="msg-box tf tf-home_button" style="color: #f00;line-height: 25px">Home menu image size:88*88px</span>
+            <span class="msg-box tf tf-home" style="color: #f00;line-height: 25px">Home menu image size:88*88px</span>
             <span class="msg-box tf tf-list" style="color: #f00;line-height: 25px">Home menu image size:18*18px</span>
             <p>
-                <span class="msg-box tf tf-home_button tf-list" style="color: #f00;line-height: 25px">File size:Not greater than 2M</span>
+                <span class="msg-box tf tf-home tf-list" style="color: #f00;line-height: 25px">File size:Not greater than 2M</span>
             </p>
         </div>
     </div>
@@ -120,7 +130,7 @@
             <input id="c-diyname" data-rule="required(single); diyname" class="form-control" name="row[diyname]" type="text" data-tip="用于伪静态规则中[:diyname]替换">
         </div>
     </div>
-    <div class="form-group tf tf-link tf-home_button tf-footer_button hidden">
+    <div class="form-group tf tf-link tf-home tf-footer hidden">
         <label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -169,30 +179,30 @@
             </select>
         </div>
     </div>
-    <div class="form-group tf tf-channel tf-list">
-        <label for="c-vip" class="control-label col-xs-12 col-sm-2">{:__('VIP Limit')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            {if $vipList}
-            <select name="row[vip]" id="c-vip" class="form-control" data-tip="高于或等于该VIP等级的用户可查看">
-                <option value="0">不限制</option>
-                {foreach name="vipList" id="item"}
-                <option value="{$item.level}">{$item.name} Lv:{$item.level}</option>
-                {/foreach}
-            </select>
-            {else/}
-            <div class="alert alert-primary-light" style="margin-bottom:0;">未安装或未配置VIP会员组</div>
-            {/if}
-        </div>
-    </div>
-    <div class="form-group tf tf-channel tf-list">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Iscontribute')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-iscontribute" name="row[iscontribute]" type="hidden" value="0">
-            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-iscontribute" data-yes="1" data-no="0">
-                <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
-            </a>
-        </div>
-    </div>
+<!--    <div class="form-group tf tf-channel tf-list">-->
+<!--        <label for="c-vip" class="control-label col-xs-12 col-sm-2">{:__('VIP Limit')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-4">-->
+<!--            {if $vipList}-->
+<!--            <select name="row[vip]" id="c-vip" class="form-control" data-tip="高于或等于该VIP等级的用户可查看">-->
+<!--                <option value="0">不限制</option>-->
+<!--                {foreach name="vipList" id="item"}-->
+<!--                <option value="{$item.level}">{$item.name} Lv:{$item.level}</option>-->
+<!--                {/foreach}-->
+<!--            </select>-->
+<!--            {else/}-->
+<!--            <div class="alert alert-primary-light" style="margin-bottom:0;">未安装或未配置VIP会员组</div>-->
+<!--            {/if}-->
+<!--        </div>-->
+<!--    </div>-->
+<!--    <div class="form-group tf tf-channel tf-list">-->
+<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Iscontribute')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-8">-->
+<!--            <input id="c-iscontribute" name="row[iscontribute]" type="hidden" value="0">-->
+<!--            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-iscontribute" data-yes="1" data-no="0">-->
+<!--                <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>-->
+<!--            </a>-->
+<!--        </div>-->
+<!--    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Isnav')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 36 - 26
application/admin/view/cms/channel/edit.html

@@ -10,6 +10,16 @@
             </div>
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Channel Type')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="radio">
+                {foreach name="channelTypeList" item="vo"}
+                <label for="row[channel_type]-{$key}"><input id="row[channel_type]-{$key}" name="row[channel_type]" type="radio" value="{$key}" {in name="key" value="$row.channel_type" }checked{/in} /> {$vo}</label>
+                {/foreach}
+            </div>
+        </div>
+    </div>
     <div class="form-group tf tf-list tf-channel tf-link">
         <label for="c-model_id" class="control-label col-xs-12 col-sm-2">{:__('Model_id')}:</label>
         <div class="col-xs-12 col-sm-8">
@@ -23,7 +33,7 @@
         </div>
     </div>
     <div class="form-group">
-        <label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('上级栏目')}:</label>
+        <label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('Superior column')}:</label>
         <div class="col-xs-12 col-sm-8">
             <!--@formatter:off-->
             <select name="row[parent_id]" data-rule="required" id="parent_id" class="form-control">
@@ -47,7 +57,7 @@
             <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}"/>
         </div>
     </div>
-    <div class="form-group tf tf-home_button">
+    <div class="form-group tf tf-home">
         <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-content" class="form-control" name="row[content]" placeholder="请输入内容" title="请输入内容" value="{$row.content|htmlentities}">
@@ -77,10 +87,10 @@
                 <span class="msg-box n-right" for="c-image"></span>
             </div>
             <ul class="row list-inline plupload-preview" id="p-image"></ul>
-            <span class="msg-box tf tf-home_button" style="color: #f00;line-height: 25px">Home menu image size:88*88px</span>
+            <span class="msg-box tf tf-home" style="color: #f00;line-height: 25px">Home menu image size:88*88px</span>
             <span class="msg-box tf tf-list" style="color: #f00;line-height: 25px">Home menu image size:18*18px</span>
             <p>
-                <span class="msg-box tf tf-home_button tf-list" style="color: #f00;line-height: 25px">File size:Not greater than 2M</span>
+                <span class="msg-box tf tf-home tf-list" style="color: #f00;line-height: 25px">File size:Not greater than 2M</span>
             </p>
         </div>
     </div>
@@ -122,7 +132,7 @@
             <input id="c-diyname" data-rule="required; diyname" class="form-control" name="row[diyname]" type="text" value="{$row.diyname|htmlentities}" data-tip="用于伪静态规则中[:diyname]替换">
         </div>
     </div>
-    <div class="form-group tf tf-link tf-home_button tf-footer_button">
+    <div class="form-group tf tf-link tf-home tf-footer">
         <label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -172,27 +182,27 @@
                 <input id="c-pagesize" data-rule="required" class="form-control" name="row[pagesize]" type="number" value="{$row.pagesize}" data-tip="用于前台列表页分页">
             </div>
         </div>
-        <div class="form-group tf tf-channel tf-list">
-            <label for="c-vip" class="control-label col-xs-12 col-sm-2">{:__('VIP Limit')}:</label>
-            <div class="col-xs-12 col-sm-4">
-                {if $vipList}
-                <select name="row[vip]" id="c-vip" class="form-control" data-tip="高于或等于该VIP等级的用户可查看">
-                    <option value="0">不限制</option>
-                    {foreach name="vipList" id="item"}
-                    <option value="{$item.level}" {:$item.level==$row.vip?'selected':''}>{$item.name} Lv:{$item.level}</option>
-                    {/foreach}
-                </select>
-                {else/}
-                <div class="alert alert-primary-light" style="margin-bottom:0;">未安装或未配置VIP会员插件</div>
-                {/if}
-            </div>
-        </div>
-        <div class="form-group tf tf-channel tf-list">
-            <label for="c-pagesize" class="control-label col-xs-12 col-sm-2">{:__('配置同步')}:</label>
-            <div class="col-xs-12 col-sm-4">
-                <div style="margin-top:5px;"><label for="syncconfig" style="font-weight:normal;"><input type="checkbox" name="row[syncconfig]" id="syncconfig" /> 同步高亮区域配置到所有子栏目</label></div>
-            </div>
-        </div>
+<!--        <div class="form-group tf tf-channel tf-list">-->
+<!--            <label for="c-vip" class="control-label col-xs-12 col-sm-2">{:__('VIP Limit')}:</label>-->
+<!--            <div class="col-xs-12 col-sm-4">-->
+<!--                {if $vipList}-->
+<!--                <select name="row[vip]" id="c-vip" class="form-control" data-tip="高于或等于该VIP等级的用户可查看">-->
+<!--                    <option value="0">不限制</option>-->
+<!--                    {foreach name="vipList" id="item"}-->
+<!--                    <option value="{$item.level}" {:$item.level==$row.vip?'selected':''}>{$item.name} Lv:{$item.level}</option>-->
+<!--                    {/foreach}-->
+<!--                </select>-->
+<!--                {else/}-->
+<!--                <div class="alert alert-primary-light" style="margin-bottom:0;">未安装或未配置VIP会员插件</div>-->
+<!--                {/if}-->
+<!--            </div>-->
+<!--        </div>-->
+<!--        <div class="form-group tf tf-channel tf-list">-->
+<!--            <label for="c-pagesize" class="control-label col-xs-12 col-sm-2">{:__('配置同步')}:</label>-->
+<!--            <div class="col-xs-12 col-sm-4">-->
+<!--                <div style="margin-top:5px;"><label for="syncconfig" style="font-weight:normal;"><input type="checkbox" name="row[syncconfig]" id="syncconfig" /> 同步高亮区域配置到所有子栏目</label></div>-->
+<!--            </div>-->
+<!--        </div>-->
     </div>
     <div class="form-group">
         <label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>

+ 13 - 13
application/admin/view/cms/channel/index.html

@@ -3,9 +3,9 @@
     <div class="panel-heading">
         {:build_heading(null,FALSE)}
         <ul class="nav nav-tabs" data-field="model_id">
-            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
-            {foreach name="modelList" item="vo"}
-            <li><a href="#t-{$vo.id}" data-value="{$vo.id}" data-toggle="tab">{$vo.name}</a></li>
+<!--            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>-->
+            {foreach name="typeList" item="vo"}
+            <li class="{$key == 'channel'?'active':''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>
@@ -16,20 +16,20 @@
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
                         {:build_toolbar('refresh,add,edit,del')}
-                        <div class="dropdown btn-group {:$auth->check('cms/channel/multi')?'':'hide'}">
-                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
-                            <ul class="dropdown-menu text-left" role="menu">
-                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
-                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
-                            </ul>
-                        </div>
+<!--                        <div class="dropdown btn-group {:$auth->check('cms/channel/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
+<!--                            </ul>-->
+<!--                        </div>-->
                         <!--<a href="javascript:;" class="btn btn-danger btn-toggle-all"><i class="fa fa-plus"></i> {:__('Toggle all')}</a>-->
                         {if $auth->check('cms/channel/admin')}
                         <a class="btn btn-info btn-dialog" href="{:url('cms.channel/admin')}" title="{:__('栏目授权')}"><i class="fa fa-list-alt"></i> {:__('栏目授权')}</a>
                         {/if}
-                        {if $auth->check('cms/fields/index')}
-                        <a class="btn btn-success btn-dialog" href="{:url('cms.fields/index')}/source/channel/source_id/0" data-area='["80%","80%"]' title="{:__('自定义字段')}(栏目)"><i class="fa fa-gears"></i> {:__('自定义字段')}</a>
-                        {/if}
+<!--                        {if $auth->check('cms/fields/index')}-->
+<!--                        <a class="btn btn-success btn-dialog" href="{:url('cms.fields/index')}/source/channel/source_id/0" data-area='["80%","80%"]' title="{:__('自定义字段')}(栏目)"><i class="fa fa-gears"></i> {:__('自定义字段')}</a>-->
+<!--                        {/if}-->
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover"
                            data-operate-edit="{:$auth->check('cms/channel/edit')}"

+ 1 - 1
application/index/view/user/special_issue.html

@@ -34,7 +34,7 @@
                                         </div>
                                     </div>
                                     <ul class="row list-inline plupload-preview" id="p-image"></ul>
-                                    <span class="msg-box tf tf-home_button" style="color: #f00;line-height: 25px">Image size:375*655px</span>
+                                    <span class="msg-box tf tf-home" style="color: #f00;line-height: 25px">Image size:375*655px</span>
                                 </div>
                             </div>
 

+ 1 - 1
application/index/view/user/submit_conference.html

@@ -112,7 +112,7 @@
                                                 </div>
                                             </div>
                                             <ul class="row list-inline plupload-preview" id="p-image"></ul>
-                                            <span class="msg-box tf tf-home_button" style="color: #f00;line-height: 25px">Image size:375*655px</span>
+                                            <span class="msg-box tf tf-home" style="color: #f00;line-height: 25px">Image size:375*655px</span>
                                         </div>
                                     </div>
                                     <div class="form-group">

BIN
public/assets/img/index/issues_empty.png


+ 35 - 33
public/assets/js/backend/cms/channel.js

@@ -37,10 +37,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {
                             field: 'type',
                             title: __('Type'),
-                            custom: {channel: 'info', list: 'success', link: 'primary', home_button: 'warning', footer_button: 'danger'},
+                            custom: {channel: 'info', list: 'success', link: 'primary', home: 'warning', footer: 'danger'},
                             formatter: Table.api.formatter.flag
                         },
-                        {field: 'model_name', title: __('Model_name'), operate: false},
+                        // {field: 'model_name', title: __('Model_name'), operate: false},
                         {field: 'name', title: __('Name'), align: 'left'},
                         {
                             field: 'url', title: __('Url'), operate: false, formatter: function (value, row, index) {
@@ -48,28 +48,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             }
                         },
                         {field: 'flag', title: __('Flag'), operate: 'find_in_set', searchList: Config.flagList, formatter: Table.api.formatter.flag},
-                        {
-                            field: 'spiders', title: __('Spiders'), visible: Config.spiderRecord || false, operate: false, formatter: function (value, row, index) {
-                                if (!$.isArray(value) || value.length === 0) {
-                                    return '-';
-                                }
-                                var html = [];
-                                $.each(value, function (i, j) {
-                                    var color = 'default', title = '暂无来访记录';
-                                    if (j.status === 'today') {
-                                        color = 'danger';
-                                        title = "今天有来访记录";
-                                    } else if (j.status === 'pass') {
-                                        color = 'success';
-                                        title = "最后来访日期:" + j.date;
-                                    }
-                                    html.push('<span class="label label-' + color + '" data-toggle="tooltip" data-title="' + j.title + ' ' + title + '">' + j.title.substr(0, 1) + '</span>');
-                                });
-                                return html.join(" ");
-                            }
-                        },
-                        {field: 'items', title: __('Items')},
-                        {field: 'vip', title: __('Vip')},
+                        // {
+                        //     field: 'spiders', title: __('Spiders'), visible: Config.spiderRecord || false, operate: false, formatter: function (value, row, index) {
+                        //         if (!$.isArray(value) || value.length === 0) {
+                        //             return '-';
+                        //         }
+                        //         var html = [];
+                        //         $.each(value, function (i, j) {
+                        //             var color = 'default', title = '暂无来访记录';
+                        //             if (j.status === 'today') {
+                        //                 color = 'danger';
+                        //                 title = "今天有来访记录";
+                        //             } else if (j.status === 'pass') {
+                        //                 color = 'success';
+                        //                 title = "最后来访日期:" + j.date;
+                        //             }
+                        //             html.push('<span class="label label-' + color + '" data-toggle="tooltip" data-title="' + j.title + ' ' + title + '">' + j.title.substr(0, 1) + '</span>');
+                        //         });
+                        //         return html.join(" ");
+                        //     }
+                        // },
+                        // {field: 'items', title: __('Items')},
+                        // {field: 'vip', title: __('Vip')},
                         {
                             field: 'weigh',
                             title: __('Weigh'),
@@ -118,13 +118,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             events: Table.api.events.operate,
                             formatter: Table.api.formatter.operate,
                             buttons: [
-                                {
-                                    name: 'addsub',
-                                    text: '添加子栏目',
-                                    classname: 'btn btn-info btn-xs btn-dialog',
-                                    icon: 'fa fa-plus',
-                                    url: 'cms/channel/add/parent_id/{ids}/type/{type}'
-                                },
+                                // {
+                                //     name: 'addsub',
+                                //     text: '添加子栏目',
+                                //     classname: 'btn btn-info btn-xs btn-dialog',
+                                //     icon: 'fa fa-plus',
+                                //     url: 'cms/channel/add/parent_id/{ids}/type/{type}'
+                                // },
                                 {
                                     name: 'editor',
                                     classname: 'btn btn-xs btn-warning btn-dialog',
@@ -135,7 +135,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                         return 'cms/channel/add_chief?ids=' + row.id;
                                     },
                                     visible: function (row) {
-                                        if (row.pid == 1) {
+                                        console.log(row);
+                                        if (row.type == 'channel') {
                                             return true;
                                         }
                                     },
@@ -158,7 +159,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 var options = table.bootstrapTable('getOptions');
                 options.pageNumber = 1;
                 options.queryParams = function (params) {
-                    params.model_id = value;
+                    // params.model_id = value;
+                    params.type = value;
                     return params;
                 };
                 table.bootstrapTable('refresh', {});