<div class="row rt-margin-bottom-before-box">
    <style>
        .knowledgerow {
            border: 1px solid #f0f0f0;
            border-bottom: none;
            padding: 20px;
        }

        .knowledgerow-oneline-two {
            float: right;
        }

        .knowledgerow-oneline-one {
            float: left;
            margin-top: -8px;
        }

        .knowledgerow-twoline {
            margin-top: 45px;
        }

        .knowledgerow-threeline {
            margin-top: 20px;
        }
    </style>

</div>

<div class="box box-primary">

    <div class="nav-tabs-custom">
        <div class="nav-tabs-custom" style="height:{{vm.view.autoHeight}}px; overflow:auto;float: left;padding-right: 10px; width: 260px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#1" onclick="return false;" data-toggle="tab">分类</a>
                </li>
                <li>
                    <a href="#2" onclick="return false;" data-toggle="tab">产品</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="1">
                    <div data-angular-treeview="true" data-tree-id="mytree" data-tree-model="roleList" data-node-id="Id" data-node-label="Name"
                        data-node-children="Children">
                    </div>
                </div>
                <div class="tab-pane" id="2">
                    <div data-angular-treeview="true" data-tree-id="mytree2" data-tree-model="roleList2" data-node-id="Id" data-node-label="Name"
                        data-node-children="Children">
                    </div>
                </div>
            </div>
        </div>

        <rt-data-grid rt-page-record-count="vm.page.recordCount" rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()" rt-sort-field="vm.view.sortField"
            rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds" rt-auto-height="{{vm.view.autoHeight}}">
            <div class="box box-widget" style="border: 1px solid #f0f0f0;border-bottom: none;">
                <!-- /.box-header -->
                <!-- form start -->
                <form class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <rt-input rt-type="text" rt-title="搜索条件" rt-col="3" ng-model="vm.searchword"></rt-input>
                            <label class="col-sm-2 control-label">检索对象</label>
                            <input type="checkbox" name="jsType" id="keyword" ng-checked="true" ng-click="vm.chooseSearch($event)" style="margin-top: 10px;margin-left: 20px;"
                            />关键字
                            <input type="checkbox" name="jsType" id="title" ng-checked="true" ng-click="vm.chooseSearch2($event)" style="margin-top: 10px;margin-left: 20px;"
                            />标题
                            <input type="checkbox" name="jsType" id="contcat" ng-checked="true" ng-click="vm.chooseSearch3($event)" style="margin-top: 10px;margin-left: 20px;"
                            />内容
                            <input type="checkbox" name="jsType" id="att" ng-checked="true" ng-click="vm.chooseSearch4($event)" style="margin-top: 10px;margin-left: 20px;"
                            />附件名称
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <input type="radio" name="cjType" id="now" ng-checked="true" ng-click="vm.chooseType(1)" style="margin-left: -70px;" />检索当前层级
                            <input type="radio" name="cjType" id="nowandabout" ng-click="vm.chooseType(2)" style="margin-left: 20px;" />检索当前层级及子层级
                            <input type="radio" name="cjType" id="all" ng-click="vm.chooseType(3)" style="margin-left: 20px;" />检索所有层级
                        </div>
                        <div class="form-group">
                            <rt-lookup2 rt-title="产品品类" ng-model="vm.product_categoryId" rt-get-data-name="XCRM.GetProductCategoryLookup" rt-order-by="name"
                                rt-col-list="[{Code:'name',Name:'产品品类名称'}]" rt-col="3"></rt-lookup2>
                            <label class="col-sm-2 control-label">附件格式</label>
                            <div class="col-sm-3">
                                <ui-select allow-clear ng-model="vm.attype" theme="bootstrap">
                                    <ui-select-match>{{$select.selected.Name}}</ui-select-match>
                                    <ui-select-choices repeat="item in vm.attypeList | filter: $select.search">
                                        <span ng-bind-html="item.Name| highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                            <div class="btn-group" class="col-sm-2">
                                <button class="btn btn-primary" ng-click="vm.getDataList()">查询</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="knowledgerow" ng-repeat="row in vm.data track by row.Id">
                <div>
                    <div class="knowledgerow-oneline-one">
                        <h4><a id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right" ui-sref=".edit({id:row.Id})"
                                ui-sref-opts="{location:true}"  ng-click="vm.addcs(row.Id)">{{row.name}} 相关资料</a></h4>
                    </div>
                    <div class="knowledgerow-oneline-two">{{row.releasedon | date:'yyyy-MM-dd HH:mm'}}</div>
                </div>

                <div class="knowledgerow-twoline">{{row.filename.substr(0,100)}}{{row.filename.length?'':'暂无相关附件资料'}}{{row.filename.length>100?'......':''}}</div>
                <div class="knowledgerow-threeline">阅读数：{{row.read_count==null?0:row.read_count}}</div>

            </div>
        </rt-data-grid>
    </div>
</div>

<div class="sidebar sidebar-right sidebar-animate rt-shadow-border-left content-wrapper" ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div>