<template>
	<view class="check" >
		<view class="navbox">
			<view class="plr12 mt18">
				<view class="search flex0 mb10">
					<image :src="searchimg"></image>
					<input placeholder="输入委员姓名进行查询" />
				</view>
			</view>
			<view class="tablists flexc mb20">
				<view v-for="(ite,idx) in tabList" @click="getTabFn(ite.val)" :class="{act:tabidx==ite.val}" :key="idx">{{ite.tit}}</view>
			</view>
		</view>
		<view class="ctip flex0">请左右滑动查看详细信息</view>
		<!-- 表格 -->
		<view class="tables">
			<view class="table">
				<zb-table
				  :show-header="true"
				  :columns="columns"
				  :headbgColor="headbgColor"
				  :stripe="false"
				  :fit="false"
				  @rowClick="rowClick"
				  @toggleRowSelection="toggleRowSelection"
				  @toggleAllSelection="toggleAllSelection"
				  :border="border"
				  :borderr="borderr"
				  @detail="getDetail"
				  :data="tableData"></zb-table>	
			</view>
		</view>

		<!-- 弹窗 -->
		<pop-up :type='ptype' @getClose="getClose"></pop-up>
	</view>
</template>

<script>
	import zbTable from "@/work/components/zb-table/zb-tables.vue"
	
	import {getCaseListFn} from "@/api/mine/case.js"
	import popUp from "@/work/components/popup/popup.vue"
	import {getDictionaryFn} from "@/api/mine/register.js"
	export default{
		components:{popUp,zbTable},
		data(){
			return{
				searchimg: require("@/work/static/images/search.png"),
				ccicoimg:require("@/work/static/images/ccico.png"),
				lbicoimg:require("@/work/static/images/lbico.png"),
				backimg:require("@/work/static/images/back.png"),
				upimg:require("@/work/static/images/up.png"),
				backgroundColor:"#1D64E2",
				tabidx:0,
				tabList:[{tit:'全部',val:0},{tit:'已读',val:1},{tit:'未读',val:2},{tit:'请假',val:3}],
				talbList:[{},],
				taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
				talbidx:'',
				datainfo:{
					talb:'',
				},
				columns: [
				    { name: 'name', label: '姓名',width:130,align:'center', },
				    { name: 'unit', label: '职务',align:'center'},
				    { name: 'unit', label: '答复时间',align:'center'},
				    // { name: 'unit', label: '是否参会',align:'center'},
					{ name: 'isc', type:'operation',label: '是否参会',renders:[
						  {
						    name:'isc',
						    type:'detail',
						    func:"detail"
						  },
					]},
				],
				ptype:'',//弹窗类型
				border:true,
				borderr:false,
				headbgColor:'#F1F1F1',
				tableData:[{name:'校长',unit:"委员",time:"2023",isc:'否'},{name:'校长',unit:"委员",time:"2023",isc:'是'},{name:'校长',unit:"委员",time:"2023",isc:'是'},{name:'校长',unit:"委员",time:"2023",isc:'是'},{name:'校长',unit:"委员",time:"2023",isc:'是'}],
				// pageSize: 10,
				// pageNum: 1,
				// reachflag: true,
				// wtdt:'',
				// tajdlist:[]
				
			}
		},
		onUnload(){
			uni.$off('refreshlist')
		},
		onLoad(e) {
			// this.getDataFn()
			// this.init()
			// uni.$on('refreshlist', (e) => {
			// 	this.getDataFn()
			// })
		},
		mounted() {
		},
		methods:{
			// 提案状态
			init(){
				// getDictionaryFn('proposal_progress').then(res=>{
				// 	if(res.code==200&&res.data.length){
				// 		this.tajdlist = res.data.map(v => {
				// 			return {
				// 				label: v.dictLabel,
				// 				value: Number(v.dictValue)
				// 			}
				// 		})
				// 	}
				// })
			},
			getClose(){
				this.ptype=""
			},
			getTabFn(idx){
				this.tabidx=idx;
			},
			getBack(){
				uni.navigateBack({
					delta:1
				})
			},
			bindDateChangea(e){
				console.log(e,2)
			},
			getChFn(){
				this.$tab.navigateTo('/work/pages/case/tacheck')
			},
			getTuiFn(ite){
				this.ptype=ite.type
			},
			rowClick(){
				
			},
			getDetail(data){
				console.log(52)
				// this.$tab.navigateTo('/work/pages/case/details?id='+data)	
			},
			getDataFn(){
				var params={
					pageSize:this.pageSize,
					pageNum: this.pageNum,
					// visitType:3
				}
				getCaseListFn(params).then(res=>{
					if(res.code==200){
						if (res.rows.length < this.pageSize) {
							this.reachflag = false
							this.wtdt = '到底了~';
						} else {
							var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -	1)
							if (num < res.total) {
								this.reachflag = true
								this.wtdt = '上拉加载更多'
							} else {
								this.reachflag = false
								this.wtdt = '到底了~';
							}
						}
						if (this.pageNum == 1) {
							this.list = res.rows;
						} else {
							this.list = this.list.concat(res.rows)
						}
					}else{
						this.$toast(res.msg)
					}
				}) 
				
			},
		}
	}
</script>

<style scoped lang="scss">
page{background-color: #FFFFFF;}
.check{height: 100vh;display: flex;flex-direction: column;
	.tables{flex:0 1 auto;overflow: auto;padding: 0 24rpx;
		.table{
			height: 100%;
		}
	}
	.ctip{font-weight: 500;padding: 22rpx 24rpx 26rpx;font-size: 26rpx;color: #FF0000;}
	.cbtn{margin: 0 24rpx;height: 80rpx;background: #1D64E2;border-radius: 80rpx;font-weight: bold;font-size: 30rpx;color: #FFFFFF;}
}
.navbox{background-color: $com-cd3;flex: 0 0 auto;
	.tablists{
		overflow: auto;flex-wrap: nowrap;
		view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;position: relative;flex: 1;padding: 22rpx 24rpx;margin-right: 6rpx;box-sizing: border-box;
				text-align: center;
			&:last-child{margin-right: 0;}
			&.act{font-size: 30rpx;
				&::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
			}
		}
	}
}
</style>