<div class="listview">
    <div class="row">
        <div class="col-sm-8">
            <div class="btn-group">
                <button class="btn btn-link"
                        data-toggle="sidebar"
                        data-target=".sidebar-right"
                        ng-if="vm.view.type=='default'"
                        ng-show="vm.privilege.IsCreate"
                        ui-sref=".edit({id:''})"
                        ui-sref-opts="{location:true}">
                    <i class="fa fa-plus"></i> 新建
                </button>
                <button class="btn btn-link"
                        ng-if="vm.view.type=='grid'"
                        ng-click="vm.actions.showForm('')"
                        ng-show="vm.privilege.IsCreate">
                    <i class="fa fa-plus"></i> 新建
                </button>
                <button class="btn btn-link"
                        ng-click="vm.actions.del()"
                        ng-show="vm.privilege.IsDelete">
                    <i class="fa fa-trash"></i> 删除
                </button>
                <button class="btn btn-link"
                        ng-click="vm.actions.activate()"
                        ng-show="vm.privilege.IsWrite">
                    <i class="fa fa-check"></i> 激活
                </button>
                <button class="btn btn-link"
                        ng-click="vm.actions.deactivate()"
                        ng-show="vm.privilege.IsWrite">
                    <i class="fa fa-ban"></i> 停用
                </button>
                <!--<button class="btn btn-link"-->
                <!--ng-disabled="true"-->
                <!--ng-show="vm.privilege.IsAssign">-->
                <!--<i class="fa fa-share"></i> 分派-->
                <!--</button>-->
                <!--<button class="btn btn-link"-->
                        <!--ng-disabled="false"-->
                        <!--ng-show="vm.privilege.IsWrite"-->
                        <!--ng-click = 'vm.actions.import({-->
                            <!--Title:"联系人",-->
                            <!--ModuleName:"ContactImport",-->
                            <!--EntityName:"contact",-->
                            <!--Columns:[-->
                                <!--{ColumnName:"firstname",DisplayName:"姓*",IsRequired:true,IsKey:true},-->
                                <!--{ColumnName:"lastname",DisplayName:"名*",IsRequired:true,IsKey:true},-->
                                <!--{ColumnName:"jobtitle",DisplayName:"职务",IsRequired:true,IsKey:false},-->
                                <!--{ColumnName:"accountid",DisplayName:"所属客户",IsRequired:true,IsKey:false},-->
                                <!--{ColumnName:"gendercode",DisplayName:"性别",IsRequired:false,IsKey:false},-->
                                <!--{ColumnName:"telephone",DisplayName:"电话",IsRequired:false,IsKey:false},-->
                                <!--{ColumnName:"mailaddress",DisplayName:"邮件",IsRequired:false,IsKey:false},-->
                                <!--{ColumnName:"BusinessUnitId",DisplayName:"所属部门",IsRequired:false,IsKey:false},-->
                                <!--{ColumnName:"OwnerId",DisplayName:"业务代表",IsRequired:false,IsKey:false},-->
                            <!--]-->
                        <!--})'>-->
                    <!--<i class="fa fa-upload"></i> 导入-->
                <!--</button>-->
                <button class="btn btn-link"
                        ng-show="vm.privilege.IsExport"
                        ng-click='vm.actions.export({
                        "name":"姓名",
                        "jobtitle":"职务",
                        "contactnumber":"联系人编码",
                        "accountidName":"所属客户",
                        "gendercodeName":"性别",
                        "telephone":"电话",
                        "mailaddress":"邮件",
                        "fax":"传真",
                        "idcard":"身份证号码",
                        "is_department_managerName":"是否科室实际负责人",
                        "is_speakerName":"是否为讲者",
                        "speaker_level":"讲者级别",
                        "professional":"专业方向",
                        "bachelorName":"最高学历",
                        "work_experience":"工作经历",
                        "training_experience":"进修经历",
                        "honour":"个人荣誉",
                        "personal_product_desc":"对产品的看法",
                        "books":"主要专著和文献"
                        })'
                >
                    <i class="fa fa-download"></i> 导出
                </button>
            </div><!-- div[.btn-group] -->
        </div><!-- div[.col-sm-12]-->
        <form class="col-sm-4">
            <div class="input-group">
				<span class="input-group-btn">
					<button type="button"
                            ng-disabled="true"
                            class="btn btn-link">
                        <i class="fa fa-filter"></i> 高级搜索
                    </button>
				</span>
                <!-- @@ 搜索条件 -->
                <input type="search"
                       placeholder="搜索..."
                       class="form-control"
                       ng-model="vm.view.searchText" />
				<span class="input-group-btn"
                      ng-click="vm.view.search(1)">
					<button type="submit" class="btn btn-default">
                        <i class="fa fa-search"></i>
                    </button>
				</span>
            </div>
        </form><!-- div[.col-sm-4] -->
    </div><!-- div[.row]-->
    <div class="viewlist">
        <ul class="nav nav-tabs">
            <li ng-repeat="view in vm.view.list track by view.Id"
                ng-class="{true:'active',false:'inactive'}[view.Id == vm.view.selectedView.Id]"
                ng-click="vm.view.select(view)">
                <a href="#1"
                   onclick="return false;"
                   data-toggle="tab">{{view.ViewName}}</a>
            </li>
        </ul>
        <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">
            <table class="table table-condensed table-hover">
                <thead>
                <tr>
                    <th><rt-header-checkbox></rt-header-checkbox></th>
                    <!-- @@ 视图表头 -->
                    <th rt-field-code="name">姓名</th>
                    <th>职务</th>
                    <th>联系人编码</th>
                    <th>所属医院</th>
                    <th>所属科室</th>
                    <th>性别</th>
                    <th>电话</th>
                    <th>邮件</th>
                    <th>传真</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in vm.data track by row.Id">
                    <td>
                        <rt-data-checkbox value="{{row.Id}}" />
                    </td>
                    <!-- @@ 视图列表值 -->
                    <td ng-if="vm.view.type=='default'">
                        <a id="{{row.Id}}"
                           data-toggle="sidebar"
                           data-target=".sidebar-right"
                           ui-sref=".edit({id:row.Id})"
                           ui-sref-opts="{location:true}"> {{row.name}}</a>
                    </td>
                    <td ng-if="vm.view.type=='grid'">
                        <a href="javascript:;"
                           ng-click="vm.actions.showForm(row.Id)"> {{row.name}}   </a>
                    </td>
                    <td>{{row.jobtitle}}</td>
                    <td>{{row.contactnumber}}</td>
                    <td>{{row.accountid.Name}}</td>
                    <td>{{row.departmentid.Name}}</td>
                    <td>{{row.gendercode.Name}}</td>
                    <td>{{row.telephone}}</td>
                    <td>{{row.mailaddress}}</td>
                    <td>{{row.fax}}</td>
                </tr>
                </tbody>
            </table>
        </rt-data-grid><!-- rt-data-grid  -->
    </div><!-- div[.panel-default] -->
</div><!-- div[.listview] -->

<div class="editview borderShadow sidebar sidebar-right sidebar-animate"
     ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div><!-- div[.editview] -->