<div class="row rt-margin-bottom-before-box">
	<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('','mdm/userinfo/userInfoEditView.html','userInfoEditController')"
			 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="false" ng-show="vm.privilege.IsWrite" ng-if="vm.view.type=='default'" ng-click='vm.actions.import({
                            Title:"用户",
                            ModuleName:"userinfoimport",
                            EntityName:"user_info",
                            Columns:[
								{ColumnName:"code",DisplayName:"用户编号*",IsRequired:true,IsKey:true},
                                {ColumnName:"name",DisplayName:"姓名*",IsRequired:true,IsKey:false},
								{ColumnName:"gendercode",DisplayName:"性别",IsRequired:false,IsKey:false},
								{ColumnName:"bachelor",DisplayName:"最高学历",IsRequired:false,IsKey:false},
								{ColumnName:"position",DisplayName:"职位",IsRequired:false,IsKey:false},
								{ColumnName:"mobilephone",DisplayName:"手机",IsRequired:false,IsKey:false},
								{ColumnName:"weixin_account",DisplayName:"微信帐号",IsRequired:false,IsKey:false},
								{ColumnName:"idcard",DisplayName:"身份证",IsRequired:false,IsKey:false},
								{ColumnName:"email",DisplayName:"邮箱",IsRequired:false,IsKey:false},
								{ColumnName:"birthday",DisplayName:"出生年月",IsRequired:false,IsKey:false},
								{ColumnName:"entry_date",DisplayName:"入职年月",IsRequired:false,IsKey:false},
								{ColumnName:"collage",DisplayName:"毕业学校",IsRequired:false,IsKey:false},
								{ColumnName:"other_education",DisplayName:"其他教育说明",IsRequired:false,IsKey:false},
                                {ColumnName:"manager",DisplayName:"上级主管",IsRequired:false,IsKey:false},
                                {ColumnName:"user_type",DisplayName:"用户类型",IsRequired:false,IsKey:false},
                                {ColumnName:"roleids",DisplayName:"角色*",IsRequired:true,IsKey:false},
                                {ColumnName:"business_unitids",DisplayName:"部门编码*",IsRequired:true,IsKey:false},
								{ColumnName:"work_experience",DisplayName:"工作经验",IsRequired:false,IsKey:false}
                            ]
                        })'>
				<i class="fa fa-upload"></i> 导入
			</button>
			<button class="btn btn-link" ng-show="vm.privilege.IsExport" ng-if="vm.view.type=='default'" ng-click='vm.actions.export({
						"code":"用户编号",
                        "name":"姓名",
						"gendercodeName":"性别",
						"bachelorName":"最高学历",
						"position":"职位",
						"mobilephone":"手机",
						"weixin_account":"微信帐号",
						"idcard":"身份证",
						"email":"邮箱",
						"birthDay":"出生年月",
						"entryDate":"入职年月",
						"collage":"毕业学校",
						"other_education":"其他教育说明",
                        "managerName":"上级主管",
                        "user_typeName":"用户类型",
                        "roleNames":"角色",
						"businessUnitIdNames":"所属部门",
						"work_experience":"工作经验",
						"StateCodeName":"状态"
                        },"UserInfoExport",vm.view.selectedView.ViewName)'>
				<i class="fa fa-download"></i> 导出
			</button>
		</div>
	</div>
	<div class="col-sm-4">
		<form class="input-group">
			<input type="search" placeholder="搜索名称...." class="form-control" ng-model="vm.view.searchText" />
			<span class="input-group-btn" ng-click="vm.view.searchClick()">
				<button type="submit" class="btn btn-default">
					<i class="fa fa-search"></i>
				</button>
			</span>
		</form>
	</div>
</div>

<div class="box box-primary">
	<div class="box-header" style="cursor: move;">
		<div class="pull-left">
			<div class="btn-group">
				<button class="btn btn-default dropdown-toggle" id="dropdownMenuViewSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					{{vm.view.selectedView.ViewName}}
					<span class="caret"></span>
				</button>
				<ul class="dropdown-menu" aria-labelledby="dropdownMenuViewSelect">
					<li ng-repeat="view in vm.view.list track by view.Id" ng-click="vm.view.select(view)">
						<a href="javascript:void(0)">{{view.ViewName}}</a>
					</li>
				</ul>
			</div>
			<div ng-show="vm.view.type=='default'" class="btn-group">
				<rt-checkbox rt-title="只显示所选部门用户" rt-label-col="9" rt-col="1" ng-model="vm.isNotInclude"></rt-checkbox>
			</div>
		</div>
	</div>
	<div class="nav-tabs-custom">
		<div ng-show="vm.view.type=='default'" style="height:{{vm.view.autoHeight}}px; overflow:auto;float: left;padding-right: 10px;"
		 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>
		<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>#</th>
						<th rt-field-code="code">用户编号</th>
						<th rt-field-code="name">姓名</th>
						<th rt-field-code="weixin_account">微信帐号</th>
						<th rt-field-code="idcard">身份证号</th>
						<th rt-field-code="position">职位</th>
						<th rt-field-code="mobilephone">手机</th>
						<th rt-field-code="email">电子邮箱</th>
						<th>出生年月</th>
						<th>入职年月</th>
						<th>毕业学校</th>
						<th rt-field-code="manager">上级主管</th>
						<th rt-field-code="user_type">用户类型</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}">查看</a>
						</td>
						<td ng-if="vm.view.type=='grid'">
							<a href="javascript:;" ng-click="vm.actions.showForm(row.Id,'mdm/userinfo/userInfoEditView.html','userInfoEditController')">查看</a>
						</td>
						<td>{{row.code}}</td>
						<td>{{row.name}}</td>
						<td>{{row.weixin_account}}</td>
						<td>{{row.idcard}}</td>
						<td>{{row.position}}</td>
						<td>{{row.mobilephone}}</td>
						<td>{{row.email}}</td>
						<td>{{row.birthday | date:'yyyy-MM'}}</td>
						<td>{{row.entry_date | date:'yyyy-MM'}}</td>
						<td>{{row.collage}}</td>
						<td>{{row.manager.Name}}</td>
						<td>{{row.user_type.Name}}</td>
						<td>
							<span ng-repeat="role in row.Roles track by role.Id">
								{{role.Name}}
							</span>
						</td>
						<td>
							<span ng-repeat="b in row.BusinessUnits track by b.Id">
								<span> {{b.Name}}</span>
								<br />
							</span>
						</td>
						<td>
							<span ng-if="row.user_deviceId==null">未绑定</span>
							<button type="button" class="btn btn-default" ng-if="row.user_deviceId!=null" ng-click="vm.actions.unBind(row)">
								解绑
							</button>
						</td>
						<td>{{row.StateCodeName}}</td>
					</tr>
				</tbody>
			</table>
		</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>