<template>
	<view class="padding">
		<view style="width:100%;overflow:auto;    height: calc(100vh - 156px);" >

			
			
			<uni-table  stripe emptyText="暂无更多数据" >
			    <!-- 表头行 -->
			    <uni-tr>
			        <uni-th align="center" style="width:200rpx">人员名称</uni-th>
			        <uni-th align="center">联系方式</uni-th>
			        <uni-th align="center">所在单位</uni-th>
					 <uni-th align="center" width="100">角色权限</uni-th>
			    </uni-tr>
			    <!-- 表格数据行 -->
			    <uni-tr v-for="(item,index) in getData" :key="index">
			        <uni-td align="center">{{item.username}}</uni-td>
			        <uni-td align="center">{{item.phone}}</uni-td>
			        <uni-td align="center">{{item.owner_name}}</uni-td>
					<uni-td align="center">{{item.statusid}}</uni-td>
			    </uni-tr>
			
			</uni-table>
			

		</view>
		
		
		
		<view class="btn-area submitBottomBtn  bg-white">
			<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" /></view>
			<button class="bg-blue round " @click="goAddPer()">新 增</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getData:[],
				// 每页数据量
				pageSize: 100,
				// 当前页
				pageCurrent: 1,
				// 数据总量
				total: '',
				loading: false
			}
		},
		onLoad:function(option){
			this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':this.pageCurrent,"number":this.pageSize})
		},
		methods: {
			
			
			// 列表数据请求
			async getDataList(params = {}) {
				const res = await this.$myRequest({
					url: 'PermissionBinding/getPermissionBindingList',
					data:params,
					showLoading: true
				})
				this.getData=res.data.data;
				console.log(res.data.data[0])
				console.log(res.data.data.length)
				console.log(this.getData.length);
				this.total=res.data.total;
			},
			
			// 分页触发
			change(e) {
				console.log(e)
				// this.$refs.table.clearSelection()
				// this.selectedIndexs.length = 0
				this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':e.current,"number":this.pageSize})
				// this.getDataList(e.current)
			},
			
			
			
			goAddPer() {
				uni.navigateTo({
					url: '/pages/accountManage/perAdd/perAdd',
					
				});
			},
			
		}
	}
</script>

<style lang="scss">
	/deep/ .uni-pagination__btn{
		background-color:rgba(0,0,0,0)!important
	}
	/deep/ .uni-pagination-box{
		background:#fff;
		border-top:1px solid #ddd
	}
	.submitBottomBtn{
		padding:0px 32rpx 32rpx 32rpx
	}
	/deep/ .uni-pagination__num{
		height:80rpx
	}

</style>
