<template>
  <view>
	<view v-if="datalist.length>0">
		<!-- 履职信息 -->
		<block v-if="type=='lzxx'">
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.memberId)">
				<view class="head flexc mb18">
					<image v-if="ite.avatar" :src="baseUrl+ite.avatar"></image>
					<image v-else :src="avatarimg"></image>
					<view class="headr">
						<view class="name">{{ite.name}}</view>
						<view class="unit">{{kaType(ite.boundary,jblist)}}；{{kaType(ite.studio,wybgslist)}}</view>
					</view>
				</view>
				<!-- <view class="tit overtwo">{{ite.title}}</view> -->
				<view class="ftxt">
					<text>工作单位及职位</text>
					<view>{{ite.unit}}</view>
				</view>
				<view class="ftxt">
					<text>联系方式</text>
					<view>{{ite.phonenumber}}</view>
				</view>
				<view class="flexw">
					<view class="ftxt">
						<text>履职得分</text>
						<view class="cofe">{{ite.score}}</view>
					</view>
					<view class="ftxt">
						<text>综合排名</text>
						<view class="cofe">{{ite.ranking}}</view>
					</view>
				</view>
				<view class="casebtn">
					<!-- <view class="btn btn2">审核</view> -->
					<view class="btn btn4" v-if="checkPermi(['member:info:edit'])" @click.stop="getTuiFn(ite.memberId,'edit')">修改</view>
					<view class="btn btn1" v-if="checkPermi(['member:info:remove'])" @click.stop="getTuiFn(ite.memberId,'del')">删除</view>
				</view>
			</view>
		</block>
		<!-- 加分记录 -->
		<block v-if="type=='jfju'">
			<view class="caselist" v-for="(ite,idx) in datalist" :key='idx'  @click="getDetail(ite.bonusId)">
				<!-- <view class="tit overtwo">{{kaType(ite.boundary,jblist)}}</view> -->
				<!-- <view class="ftxt">
					<text>考核类型</text>
					<view>{{kaType(ite.checkType,khlxList)}}</view>
				</view> -->
				<view class="ftxt">
					<text>加分类型</text>
					<!-- <view>{{kaType(ite.bonusType,jflxList)}}</view> -->
					<view>{{ite.bonusType}}</view>
				</view>
				<!-- <view class="ftxt">
					<text>加分时间</text>
					<view>{{ite.bonusTime}}</view>
				</view> -->
				<view class="ftxt">
					<text>分值</text>
					<view class="cofe">{{ite.score}}</view>
				</view>
				<view class="ftxt">
					<text>加分事由</text>
					<view class="overtwo">{{ite.bonusReason}}</view>
				</view>
				<view class="casebtn">
					<!-- <view class="btn btn2">审核</view> -->
					<view class="btn btn4" v-if="checkPermi(['zxBonus:bonus:edit'])" @click.stop="getTuiFn(ite.bonusId,'edit')">修改</view>
					<view class="btn btn1" v-if="checkPermi(['zxBonus:bonus:remove'])" @click.stop="getTuiFn(ite.bonusId,'del')">删除</view>
				</view>
			</view>
		</block>
		<!-- 提案方面 -->
		<block v-if="type==2">
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.proposalId)">
				<view class="tit overtwo">{{ite.title}}</view>
				<view class="flexc">
					<view class="f12 co6 fw5 mr24">{{ite.isJointly=='是'?'联名提案':'个人提案'}}</view>
					<view class="f12 co6 fw5">{{ite.createTime}}</view>
				</view>
				<view class="mt9 flexcj">
					<view class="btna">{{kaType(ite.proposalProgress,tajdlist)}}</view>
					<!-- <view class="btnb">4.3 <text>分</text></view> -->
				</view>
			</view>
		</block>
		<!-- 社情民意集合 -->
		<block v-if="type==3">
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.sqmyId)">
				<view class="tit overtwo">{{ite.title}}</view>
				<view class="flexc">
					<view class="f12 co6 fw5 mr24">{{kaType(ite.topicType,ztlxlist)}}</view>
					<view class="f12 co6 fw5">{{ite.createTime}}</view>
				</view>
				<view class="mt9 flexcj">
					<view class="btna">{{kaType(ite.sqmyProgress,sqjdlist)}}</view>
					<!-- <view class="btnb">4.3 <text>分</text></view> -->
				</view>
			</view>
		</block>
		<!-- 会议集合 -->
		<block v-if="type==4">
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.conferenceId)">
				<view class="tit overtwo">{{ite.conferenceTitle}}</view>
				<view class="f12 co6 fw5 mr24">{{kaType(ite.conferenceType,hylxlist)}}</view>
				<view class="f12 co6 fw5">{{ite.conferenceDate}} {{ite.conferenceTime}}</view>
				<view class="mt9 flexcj">
					<!-- <view class="btna">{{kaType(ite.proposalProgress,tajdlist)}}</view> -->
					<!-- <view class="btnb">4.3 <text>分</text></view> -->
				</view>
			</view>
		</block>
		<!-- 活动集合 -->
		<block v-if="type==5||type==8||type==9||type==10||type==11" >
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.activityId)">
				<view class="tit overtwo">{{ite.activityTitle}}</view>
				<view class="flexc">
					<view class="f12 co6 fw5 mr24">{{kaType(ite.activityType,hdlxlist)}}</view>
					<view class="f12 co6 fw5">{{ite.activityDate}} {{ite.activityTime}}</view>
				</view>
			</view>
		</block>
		<!-- 发言集合 -->
		<block v-if="type==6">
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx'>
				<view class="tit overtwo">{{ite.speakTitle}}</view>
				<view class="flexc">
					<view class="f12 co6 fw5 mr24">{{ite.conferenceTitle}}</view>
					<view class="f12 co6 fw5">{{ite.speakUnit}} {{ite.speakTime}}</view>
				</view>
			</view>
		</block>
		<!-- 招商集合 -->
		<block v-if="type==7" >
			<view class="talist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.investmentId)">
				<view class="tit overtwo">{{ite.clueName}}</view>
				<view class="flexc">
					<view class="f12 co6 fw5 mr24">{{ite.investmentAmount}}</view>
					<view class="f12 co6 fw5">{{ite.contactsName}} {{ite.contactsPhone}}</view>
				</view>
			</view>
		</block>
		<view class="shax" v-if="wtdt">{{wtdt}}</view>
	</view>
	<block v-else>
		<no-data></no-data>
	</block>
  </view>
</template>

<script>
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	import config from '@/config'
	const baseUrl = config.baseUrl
	import { selectValue } from '@/utils/common.js';
	import noData from "@/components/nodata/nodata.vue"
  export default {
	props:{
		datalist: {
			type: Array,
			default () {
				return []
			}
		},
		wybgslist: {
			type: Array,
			default () {
				return []
			}
		},
		jblist: {
			type: Array,
			default () {
				return []
			}
		},
		sqjdlist:{
			type: Array,
			default () {
				return []
			}
		},
		khlxList: {
			type: Array,
			default () {
				return []
			}
		},
		tajdlist:{
			type: Array,
			default () {
				return []
			}
		},
		ztlxlist:{
			type: Array,
			default () {
				return []
			}
		},
		hylxlist:{
			type: Array,
			default () {
				return []
			}
		},
		hdlxlist:{
			type: Array,
			default () {
				return []
			}
		},
		jflxList: {
			type: Array,
			default () {
				return []
			}
		},
		wtdt:{
			type: String,
			default () {
				return ''
			}
		},
		type:{
			type: [String,Number],
			default () {
				return ''
			}
		},
	},
	components:{
		noData
	},
	data(){
		return{
			avatarimg:require("@/static/images/mine/header.png"),
			start:require("@/work/static/images/start.png"),
			nstart:require("@/work/static/images/nstart.png"),
			zanimg:require("@/work/static/images/zanico.png"),
			nzanimg:require("@/work/static/images/nzanico.png"),
			flower:require("@/work/static/images/flower.png"),
			nflower:require("@/work/static/images/nflower.png"),
			baseUrl:"",
		}
	},
	onLoad: function() {
		
	},
	mounted() {
		this.baseUrl=baseUrl;
	},
	methods:{
		checkPermi, checkRole,
		kaType(ite,list){
			return selectValue(list, ite);
		},
		getDetail(e){
			this.$emit('getDetail',e)
		},
		getTuiFn(id,txt){
			var obj={
				type:txt,
				id:id,
			}
			this.$emit('getTuiFn',obj)
		},
		typeFn(data){
			if(data){
				var newArr=[]
				var astr=data.split('-')
				astr.forEach(ite=>{
					var a=ite.substring(0,5);
					newArr.push(a)
				})
				return newArr.join('-')
			}else{
				return ''
			}
		},
	},
	
  }
</script>

<style lang="scss" scoped>
.caselist{background: #FFFFFF;border-radius: 30rpx;margin-top: 24rpx;padding: 38rpx 24rpx 8rpx;
	.head{
		image{width: 120rpx;height: 120rpx;margin-right: 36rpx;flex: 0 0 auto;border-radius: 50%;}
		.headr{
			.name{font-weight: bold;font-size: 30rpx;color: #222327;margin-bottom: 14rpx;}
			.unit{font-weight: 500;font-size: 26rpx;color: #666666;}
		}
	}
	.tit{font-weight: bold;font-size: 32rpx;color: #222327;margin-bottom: 42rpx;}
	.ftxt{display: flex;align-items: flex-start;margin-bottom: 32rpx;flex:0 1 auto;min-width: 50%;
		text{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 0 0 auto;min-width: 104rpx;text-align-last: justify;}
		view{flex: 1;color: #343434;font-size: 26rpx;margin-left: 20rpx;line-height: 34rpx;}
	}
	.casebtn{padding: 26rpx 0;border-top: 2rpx solid #E6E6E6;display: flex;align-items: center;justify-content: flex-end;
		.ftit{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 1;
			text{color: $com-cd3;margin-left: 20rpx;font-weight:500;min-width: 104rpx;text-align-last: justify;}
		}
		.lftit{font-weight: 500;font-size: 26rpx;color: #666666;flex:1;
			.lfdet{color: $com-cd3;text-decoration: underline;}
		}
		.zanimg{width: 22rpx;height: 20rpx;margin-right: 14rpx;}
		.staimg{width: 24rpx;height: 24rpx;margin-right: 14rpx;}
		.btn{min-width: 128rpx;height: 52rpx;border-radius: 26rpx;font-weight: bold;flex: 0 0 auto;
font-size: 26rpx;margin-left: 24rpx;line-height: 52rpx;text-align: center;padding: 0 32rpx;box-sizing: border-box;
		&.btn1{background: #FFEDED;color: #FF4141;}
		&.btn2{background: #E4EEFF;color: #1D64E2;}
		&.btn3{background: #ECECEC;color: #666666;}
		&.btn4{background:  #E9FFE9;color: #28C529;}
		
		}
	}
}
.talist{width: 100%;background: #F2F6FF;border-radius: 10rpx;padding: 24rpx 24rpx;margin-bottom: 24rpx;
	.tit{font-weight: bold;font-size: 30rpx;color: #222327;margin-bottom: 16rpx;}
	.btna{font-weight: bold;font-size: 24rpx;color: #FF4E00;}
	.btnb{font-weight: bold;font-size: 46rpx;color: #1D64E2;
		text{font-size: 24rpx;color: #222327;margin-left: 8rpx;}
	}
	
}
</style>
