<template>
	<view>
		<view class="content" v-if="shouye==1">
			<!-- 项目总览 -->
			<view class="projectAll">
				<view class="all-text">项目总览</view>
				<view class="all-more" @click="takeMore">查看更多</view>
				<view class="all-select">
					<view class="all-list" style="margin-left: 15rpx;" v-if="change==0">今日</view>
					<view class="all-list2" style="margin-left: 15rpx;" v-else @click="changeTime(0)">今日</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change==1">本周</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime(1)">本周</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change==2">本月</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime(2)">本月</view>
				</view>
				<view class="all-num">
					<view class="shuzi" v-for="(item,index) in allList.slice(0,5)">
						<view class="shu-num">{{item.num}}</view>
						<view>
							<template v-if="item.state==1">正常在办</template>
							<template v-if="item.state==2">预警在办</template>
							<template v-if="item.state==3">超时在办</template>
							<template v-if="item.state==4">正常办结</template>
							<template v-if="item.state==5">超时办结</template>
							<template v-if="item.state==6">项目总数</template>
						</view>
					</view>
				</view>
			</view>
			<!-- 项目列表 -->
			<!-- <view class="projectlist" style="height: 100%;">
				<view class="all-text">项目列表</view>
				<view class="all-cui" @click="cuiban('总的')" v-if="allcuiban==1">催办</view>
				<view class="all-more" style="margin: -59rpx 0 0 581rpx;" @click="takeMore">查看更多</view>
				<view class="all-select">
					<view class="all-list" style="margin-left: 15rpx;" v-if="change2==0">今日</view>
					<view class="all-list2" style="margin-left: 15rpx;" v-else @click="changeTime2(0)">今日</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change2==1">本周</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime2(1)">本周</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change2==2">本月</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime2(2)">本月</view>
				</view> -->
				<!-- 列表 -->
				<!-- <view class="projectL" v-for="(item,index) in list" :key="index" @click="XiangPro(item)">
					<view class="projectName">{{item.projectName}}</view>
					<view class="all-cui" style="margin: -44rpx 0 0 581rpx;" @click.stop="cuiban(item)" v-if="(item.state==1||item.state==2||item.state==3) && acuiban==1">催办</view>
					<view style="margin: 10rpx 0 0 19rpx;">结束时间：{{item.endTime}}</view>
					<view style="margin: 20rpx 0 0 19rpx;">参与成员：{{item.coSposonerName}}</view>
					<progress v-if="item.progress!='/'" :percent="item.progress" activeColor="rgba(0, 97, 255, 1)" border-radius="50" stroke-width="12" show-info font-size='12' active='true' />
					<view class="projectLine" v-if="list.length>=1&&(index<=list.length-1)"></view>
				</view>
			</view> -->
			<!-- 未完成清单 -->
			<view class="projectlist" style="height: 100%;">
				<view class="all-text">未完成清单</view>
				<view class="wei-title1 title1" v-if="qingdan==0">
					<view>问题清单</view>
					<view class="wei-line1"></view>
				</view>
				<view class="title1" style="rgba(0, 0, 0, 1)" v-else @click="qingQie(0)">
					问题清单
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="wei-title1 title2" v-if="qingdan==1">
					<view>预警清单</view>
					<view class="wei-line1"></view>
				</view>
				<view class="title2" style="rgba(0, 0, 0, 1)" v-else @click="qingQie(1)">
					预警清单
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="all-cui" style="margin: -35px 0 0 581rpx;" @click="cuiban('未完成')" v-if="allcuiban==1">催办</view>
				<view class="all-select">
					<view class="all-list" style="margin-left: 15rpx;" v-if="change3==0">今日</view>
					<view class="all-list2" style="margin-left: 15rpx;" v-else @click="changeTime3(0)">今日</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change3==1">本周</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime3(1)">本周</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change3==2">本月</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime3(2)">本月</view>
				</view>
				<!-- 未完成清单表格 -->
				<view style="margin: 24rpx 0 0 20rpx;width: 710rpx;">
					<uni-table ref="table" emptyText="暂无更多数据"
					 style="width:710rpx;table-layout: fixed; word-wrap: break-word;">
						<uni-tr style="background-color: rgba(245, 246, 250, 1);color: rgba(90, 96, 127, 1);font-size: 24rpx;">
							<uni-th align="center">姓名</uni-th>
							<uni-th align="center">项目名称</uni-th>
							<uni-th align="center">项目任务</uni-th>
							<uni-th align="center">情况状态</uni-th>
						</uni-tr>
						<uni-tr v-for="(item, index) in tableNo" :key="index" style="color: rgba(0, 0, 0, 1);">
							<uni-td align="center">{{ item.headerName }}</uni-td>
							<uni-td align="center">
								<view class="name">{{ item.projectName }}</view>
							</uni-td>
							<uni-td align="center">{{ item.taskName }}</uni-td>
							<uni-td align="center">{{ item.projectLevel }}</uni-td>
						</uni-tr>
					</uni-table>
				</view>
				
			</view>
			<!-- 部门排行榜 -->
			<view class="projectlist" style="height: 100%;">
				<view class="all-text">部门排行榜</view>
				<view class="wei-title1 title1" v-if="bumen==0">
					<view>评分</view>
					<view class="wei-line1" style="margin: 10rpx 0 0 -8rpx;"></view>
				</view>
				<view class="title1" style="rgba(0, 0, 0, 1)" v-else @click="bumenQie(0)">
					评分
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="wei-title1 title2" v-if="bumen==1">
					<view>完成率</view>
					<view class="wei-line1" style="margin: 10rpx 0 0 4rpx;"></view>
				</view>
				<view class="title2" style="rgba(0, 0, 0, 1)" v-else @click="bumenQie(1)">
					完成率
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="all-select">
					<view class="all-list" style="margin-left: 15rpx;" v-if="change4==0">今日</view>
					<view class="all-list2" style="margin-left: 15rpx;" v-else @click="changeTime4(0)">今日</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change4==1">本周</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime4(1)">本周</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change4==2">本月</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime4(2)">本月</view>
				</view>
				<!-- 部门排行榜表格 -->
				<view style="margin: 24rpx 0 0 20rpx;width: 710rpx;">
					<uni-table ref="table" emptyText="暂无更多数据"
					 style="width:710rpx;table-layout: fixed; word-wrap: break-word;">
						<uni-tr style="background-color: rgba(245, 246, 250, 1);color: rgba(90, 96, 127, 1);font-size: 24rpx;">
							<uni-th align="center">排行</uni-th>
							<uni-th align="center">部门名称</uni-th>
							<uni-th align="center">评分</uni-th>
						</uni-tr>
						<uni-tr v-for="(item, index) in tableData" :key="index" style="color: rgba(0, 0, 0, 1);">
							<uni-td align="center">{{ item.id }}</uni-td>
							<uni-td align="center">
								<view class="name">{{ item.name }}</view>
							</uni-td>
							<uni-td align="center">{{ item.num }}</uni-td>
						</uni-tr>
					</uni-table>
				</view>
				
			</view>
			<!-- 消息预警推送汇总 -->
			<view class="projectlist" style="height: 100%;">
				<view class="all-text">消息预警推送汇总</view>
				<view class="wei-title1 title1" v-if="yujin==0">
					<view>汇总</view>
					<view class="wei-line1" style="margin: 10rpx 0 0 -8rpx;"></view>
				</view>
				<view class="title1" style="rgba(0, 0, 0, 1)" v-else @click="yujinQie(0)">
					汇总
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="wei-title1 title2" v-if="yujin==1">
					<view>明细</view>
					<view class="wei-line1" style="margin: 10rpx 0 0 -8rpx;"></view>
				</view>
				<view class="title2" style="rgba(0, 0, 0, 1)" v-else @click="yujinQie(1)">
					明细
					<view class="wei-line1" style="background: rgba(255, 255, 255, 1);"></view>
				</view>
				<view class="all-select">
					<view class="all-list" style="margin-left: 15rpx;" v-if="change5==0">今日</view>
					<view class="all-list2" style="margin-left: 15rpx;" v-else @click="changeTime5(0)">今日</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change5==1">本周</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime5(1)">本周</view>
					<view class="all-list" style="margin-left: 25rpx;" v-if="change5==2">本月</view>
					<view class="all-list2" style="margin-left: 25rpx;" v-else @click="changeTime5(2)">本月</view>
				</view>
				<!-- 汇总表格 -->
				<view style="margin: 24rpx 0 0 20rpx;width: 710rpx;" v-if="yujin==0">
					<view class="hui-kuang" v-for="(item,index) in xiaoban" :key="index">
						<view class="hui-left">{{item.organize}}</view>
						<view>
							<view class="hui-center">{{item.mtype}}</view>
							<view class="hui-center">{{item.num}}次</view>
						</view>
						<view>
							<view class="hui-center">预警次数</view>
							<view class="hui-center">{{item.num2}}次</view>
						</view>
					</view>
				</view>
				<!-- 消息预警推送汇总明细表格 -->
				<view style="margin: 24rpx 0 0 20rpx;width: 710rpx;" v-if="yujin==1">
					<uni-table ref="table" emptyText="暂无更多数据"
					 style="width:710rpx;table-layout: fixed; word-wrap: break-word;">
						<uni-tr style="background-color: rgba(245, 246, 250, 1);color: rgba(90, 96, 127, 1);font-size: 24rpx;">
							<uni-th align="center">项目</uni-th>
							<uni-th align="center">任务</uni-th>
							<uni-th align="center">类型</uni-th>
							<uni-th align="center">发生时间</uni-th>
							<uni-th align="center">部门</uni-th>
							<uni-th align="center">姓名</uni-th>
						</uni-tr>
						<uni-tr v-for="(item, index) in yujinList" :key="index" style="color: rgba(0, 0, 0, 1);">
							<uni-td align="center">{{ item.projectName }}</uni-td>
							<uni-td align="center">
								<view class="name">{{ item.taskName }}</view>
							</uni-td>
							<uni-td align="center">{{ item.mtype }}</uni-td>
							<uni-td align="center">{{item.createTime}}</uni-td>
							<uni-td align="center">
								<view class="name">{{ item.organize }}</view>
							</uni-td>
							<uni-td align="center">{{ item.userName }}</uni-td>
						</uni-tr>
					</uni-table>
				</view>
				<view style="width: 100%;height:120rpx;"></view>
			</view>
		</view>
		<view v-if="shouye==0" class="content">
			<image src="../../static/img/quesheng.png" class="quesheng"></image>
			<view style="color: rgba(87, 146, 240, 1);">暂无内容</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				allList:[],
				change:0,//项目总览
				change2:0,//项目列表
				change3:0,//未完成清单
				change4:0,//部门排行榜
				bumen:0,//0评分，1完成率
				change5:0,//预警消息
				yujin:0,//0汇总，1明细
				list:[],
				qingdan:0,//未完成清单
				tableNo:[],//未完成清单
				// 部门排行榜
				tableData:[],
				
				// 校办
				xiaoban:[],
				yujinList:[],//预警明细
				nowDate:new Date().toISOString().slice(0, 10),//今日
				weekStart:'',//本周开始时间
				weekEnd:'',//本周结束时间
				monthStart:'',//本月开始时间
				monthEnd:'',//本月结束时间
				
				shouye:1,//首页
				allcuiban:1,//一键催办
				acuiban:1,//是否催办
				
				weidu:[],
				
				page:1,
				size:10,
				totalCount:0,
			}
		},
		onLoad() {
			this.getUser()
			this.weekStart=this.getStartDayOfWeek(this.nowDate)
			this.weekEnd=this.getEndDayOfWeek(this.nowDate)
			this.monthStart=this.getStartDayOfMonth(this.nowDate)
			this.monthEnd=this.getEndDayOfMonth(this.nowDate)
			//项目总览
			this.getStateLb()
			//项目列表
			// this.getList()
			//未完成清单
			this.getNoQingdan()
			//部门排行
			this.getCcoreBank()
			this.getWanBank()
			//预警
			this.getYujinAll()
			this.getYujinXi()
		},
		methods: {
			//查看更多项目
			takeMore(){
				uni.switchTab({
					url:'/pages/project/index'
				})
			},
			//获取个人信息
			getUser(){
				let that = this
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				that.$Request.postT('/api/sysUser/queryOwn').then(res => {
					if (res.code==200) {
						sessionStorage.setItem('roleId',res.data.roleId)
						var roleId=res.data.roleId
						that.getRole(roleId)
						console.log(sessionStorage.getItem("roleId"),'数据')
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//查询角色权限
			getRole(roleId){
				let that = this
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					roleId:roleId
				}
				that.$Request.postT('/api/sysRole/queryMenuByRole',data).then(res => {
					if (res.code==200) {
						this.shouye=res.data[0].state
						this.allcuiban=res.data[1].menuLists[0].state
						this.acuiban=res.data[1].menuLists[3].state
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//项目总览
			//切换
			changeTime(a){
				this.change=a
				this.getStateLb()
			},
			//查看项目总览信息
			getStateLb(){
				this.allList=[]
				let that = this
				if(that.change==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change==2){
					var time11='本月'
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"organize": null,
					"timeType": time11,// 时间类型：有：【最近7日】，【本月】，【本季度】，【2024-12-01,2024-12-30】，null全部
				}
				that.$Request.postJson('/api/sysProject/queryTjByState',data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						this.allList=res.data
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//项目列表
			changeTime2(a){
				this.change2=a
				// this.getList()
			},
			//查看项目详情
			XiangPro(item){
				//传参对象，使用encodeURIComponent编码
				let str = JSON.stringify(item)
				//注意这里——————————————————————
				str = str.replace(/%/g, '%25')
				//这里———————————————————————————
				let query = encodeURIComponent(str)
				
				let t2=JSON.stringify(this.weidu)
				//这里———————————————————————————
				let query2 = encodeURIComponent(t2)
				uni.navigateTo({
					url:'/pages/project/projectX?data='+query+'&weidu='+query2
				})
			},
			// 催办
			cuiban(item){
				if(item=='总的'){
					var ids=[]
					this.list.map(item =>{
						ids.push(item.id)
					})
					var idd=ids.join(",")
				}else if(item=='未完成'){
					var ids=[]
					this.tableNo.map(item =>{
						ids.push(item.id)
					})
					var idd=ids.join(",")
				}else{
					var idd=item.id
				}
				let that = this
				uni.showModal({
					title: '提示',
					content: '确定催办项目吗？',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							uni.showLoading({
								title: '加载中',
								mask: true, // 是否显示透明蒙层，防止触摸穿透
							});
							let data={
								projectIds:idd,
							}
							that.$Request.postT('/api/sysProject/urge',data).then(res => {
								if (res.code==200) {
									uni.showToast({
										title: '催办成功',
										icon: 'none',
										duration:800
									});			
									setTimeout(function() {
										// that.getList()
									}, 1000)
								} else {
									uni.showToast({
										title: res.message,
										icon: 'none',
										duration:800
									});
								}
								uni.hideLoading();
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			getList(){
				this.list=[]
				this.weidu=[]
				let that = this
				if(that.change2==0){
					var time1=that.nowDate
					var time2=that.nowDate+' 24:00:00'
				}else if(that.change2==1){
					var time1=that.weekStart
					var time2=that.nowDate+' 24:00:00'//that.weekEnd
				}else if(that.change2==2){
					var time1=that.monthStart
					var time2=that.monthEnd
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"type": null,    // 3我负责的、4我协办的、5创建的、6我分管的
					"project": {
						"projectName": null,   // 项目名称
						"projectFrom": null,    // 项目来源
						"projectLevel":null,    // 项目等级
						"state": null,   // 1、正常在办，2、预警在办，3、超时在办，4、正常办结，5、超时办结
						"organize": null,   // 主办单位-单选
						"coOrganize": null,   // 协办单位-多选
						"sposonerName": null,    // 主办人
						"coSposonerName": null,    // 协办人
						"scoreState": null,      // 是否已评分：1已评分，0未评分，null全部
						"collect": null,     // 是否已关注，1收藏，0未收藏，null全部
						"hasTask": null,      // 是否有任务：1有任务，0没有认为，null全部
						"isScore": null     // 是否我评分，1是我，0不是我，null全部
					},
					"t1": time1,    // 创建开始时间
					"t2": time2,    // 创建结束时间
					"t3": null,      // 周期开始时间
					"t4": null,      // 周期结束时间
					"t5": null,    // 完成开始时间
					"t6": null     // 完成结束时间
				}
				that.$Request.postJson('/api/sysProject/queryPage?page=1&rows=2',data).then(res => {
					if (res.code==200) {
						that.list=res.data.project.rows.slice(0,2)
						that.weidu=res.data.config
						console.log(that.list,'数据')
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//未完成清单
			changeTime3(a){
				this.change3=a
				this.getNoQingdan()
			},
			qingQie(a){
				this.qingdan=a
				this.getNoQingdan()
			},
			//未完成清单
			getNoQingdan(){
				this.tableNo=[]
				let that = this
				if(that.change3==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change3==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change3==2){
					var time=[]
					time=[that.monthStart,that.monthEnd]
					var time11=time.join(",")
				}
				if(that.qingdan==0){
					var wenti=1
				}else if(that.qingdan==1){
					var wenti=2
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"createBy": wenti,    // 1问题清单，2预警清单
					"updateBy": time11,// 时间类型：
				}
				that.$Request.postJson('/api/sysTask/queryProblemAndWarmList',data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						this.tableNo=res.data
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//部门评分排行榜
			changeTime4(a){
				this.change4=a
				if(this.bumen==0){
					this.getCcoreBank()
				}else{
					this.getWanBank()
				}
			},
			bumenQie(a){
				this.bumen=a
				if(this.bumen==0){
					this.getCcoreBank()
				}else{
					this.getWanBank()
				}
			},
			//部门评分
			getCcoreBank(){
				this.tableData=[]
				let that = this
				if(that.change4==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change4==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change4==2){
					var time11='本月'
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"organize": null,
					"timeType": time11,// 时间类型：有：【最近7日】，【本月】，【本季度】，【2024-12-01,2024-12-30】，null全部
				}
				that.$Request.postJson('/api/sysTask/queryDepartScoreBank',data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						this.tableData=res.data
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//部门完成率
			getWanBank(){
				this.tableData=[]
				let that = this
				if(that.change4==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change4==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change4==2){
					var time11='本月'
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"organize": null,
					"timeType": time11,// 时间类型：有：【最近7日】，【本月】，【本季度】，【2024-12-01,2024-12-30】，null全部
				}
				that.$Request.postJson('/api/sysTask/queryDepartFinishBank',data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						this.tableData=res.data
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//消息预警推送
			changeTime5(a){
				this.change5=a
				if(this.yujin==0){
					this.getYujinAll()
				}else{
					this.getYujinXi()
				}
			},
			yujinQie(a){
				this.yujin=a
				if(this.yujin==0){
					this.getYujinAll()
				}else{
					this.getYujinXi()
				}
			},
			//预警汇总
			getYujinAll(){
				this.xiaoban=[]
				let that = this
				if(that.change5==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change5==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change5==2){
					var time11='本月'
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"organize": null,   // 主办部门
					"projectName": null,   // 项目名称
					"projectFrom": null,    // 项目来源
					"projectLevel": null,    // 项目等级
					"state": null,   // 1、正常在办，2、预警在办，3、超时在办，4、正常办结，5、超时办结
					"coOrganize": null,  // 协办单位
					"sposonerName": null,    // 主办人
					"coSposonerName": null,    // 协办人
					"updateBy": time11     // 时间类型：有：【最近7日】，【本月】，【本季度】，【2024-12-01,2024-12-30】
				}
				that.$Request.postJson('/api/sysProject/queryMessageTj',data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						this.xiaoban=res.data
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			//预警明细
			getYujinXi(){
				// this.yujinList=[]
				let that = this
				if(that.change5==0){
					var time=[]
					time=[that.nowDate,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change5==1){
					var time=[]
					time=[that.weekStart,that.nowDate+' 24:00:00']
					var time11=time.join(",")
				}else if(that.change5==2){
					var time11='本月'
				}
				uni.showLoading({
					title: '加载中',
					mask: true, // 是否显示透明蒙层，防止触摸穿透
				});
				var data={
					"organize": null,   // 主办部门
					"projectName": null,   // 项目名称
					"projectFrom": null,    // 项目来源
					"projectLevel": null,    // 项目等级
					"state": null,   // 1、正常在办，2、预警在办，3、超时在办，4、正常办结，5、超时办结
					"coOrganize": null,  // 协办单位
					"sposonerName": null,    // 主办人
					"coSposonerName": null,    // 协办人
					"updateBy": time11     // 时间类型：有：【最近7日】，【本月】，【本季度】，【2024-12-01,2024-12-30】
				}
				that.$Request.postJson('/api/sysProject/queryMessage?page='+that.page+'&rows='+that.size,data).then(res => {
					if (res.code==200) {
						console.log(res,data,'项目')
						that.totalCount = res.data.total
						if (that.page == 1) {
							that.yujinList = res.data.rows
						} else {
							that.yujinList = that.yujinList.concat(res.data.rows)
						}
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration:800
						});
					}
					uni.hideLoading();
				});
			},
			// 上拉加载
			onReachBottom: function() {
				if(this.yujin==1){
					if(this.yujinList.length < this.totalCount){
						this.page = this.page + 1;
						this.getYujinXi()
					} else {
						uni.showToast({
							title: '已经最后一页啦',
							icon: 'none'
						})
					}
				}
				
			},
			onPullDownRefresh: function() {
				if(this.yujin==1){
					this.page = 1;
					this.getYujinXi()
				}
			},
			
			//获得7天前的开始时间：
			getStartDayOfWeek(time) {
				let now = new Date(time); // 当前日期
				let nowDayOfWeek = now.getDay(); // 今天本周的第几天
				let day = nowDayOfWeek || 7;
				let nowDay = now.getDate(); // 当前日
				let nowMonth = now.getMonth(); // 当前月
				return this.formatDate(new Date(now.getFullYear(), nowMonth, nowDay -6));
			},
			//获得本周的结束时间：
			getEndDayOfWeek(time) {
				let now = new Date(time); // 当前日期
				let nowDayOfWeek = now.getDay(); // 今天本周的第几天
				let day = nowDayOfWeek || 7;
				let nowDay = now.getDate(); // 当前日
				let nowMonth = now.getMonth(); // 当前月
				return this.formatDate(new Date(now.getFullYear(), nowMonth, nowDay + 7 - day));
			},
			//获得本月的开始时间：
			getStartDayOfMonth(time) {
				let now = new Date(time); // 当前日期
				let nowDay = now.getDate(); // 当前日
				let nowMonth = now.getMonth(); // 当前月
				return this.formatDate(new Date(now.getFullYear(), nowMonth, 1));
			},
			//获得本月的结束时间：
			getEndDayOfMonth(time) {
				let now = new Date(time); // 当前日期
				let nowDayOfWeek = now.getDay(); // 今天本周的第几天
				let day = nowDayOfWeek || 7;
				let nowDay = now.getDate(); // 当前日
				let nowMonth = now.getMonth(); // 当前月
				return this.formatDate(new Date(now.getFullYear(), nowMonth+1, 0));
			},
			// 日期格式化
			formatDate(date) {
				let myyear = date.getFullYear();
				let mymonth = date.getMonth() + 1;
				let myweekday = date.getDate();
				if (mymonth < 10) {
					mymonth = '0' + mymonth;
				}
				if (myweekday < 10) {
					myweekday = '0' + myweekday;
				}
				return (myyear + '-' + mymonth + '-' + myweekday);
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	/* 项目总览 */
	.projectAll{
		margin-top: 26rpx;
		width: 100%;
		height: 350rpx;
		background: #FFFFFF;
	}
	.all-text{
		margin: 27rpx 0 0 19rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: rgba(0, 0, 0, 1);
	}
	.all-more{
		margin: -47rpx 0 0 581rpx;
		width: 149rpx;
		height: 59rpx;
		border-radius: 92rpx;
		background: #0061FF;
		font-size: 28rpx;
		color: rgba(255, 255, 255, 1);
		line-height: 59rpx;
		text-align: center;
	}
	.all-select{
		display: flex;
		margin: 31rpx 0 0  19rpx;
		width: 712rpx;
		height: 90rpx;
		border-radius: 7rpx;
		background: rgba(242, 247, 255, 1);
		align-items: center;
	}
	.all-list{
		width: 211rpx;
		height: 71rpx;
		border-radius: 7rpx;
		background: rgba(0, 97, 255, 0.1);
		border: 1rpx solid rgba(0, 97, 255, 1);
		font-size: 28rpx;
		line-height: 71rpx;
		color: rgba(0, 97, 255, 1);
		text-align: center;
	}
	.all-list2{
		width: 211rpx;
		height: 71rpx;
		border-radius: 7rpx;
		font-size: 28rpx;
		line-height: 71rpx;
		color: rgba(56, 56, 56, 1);
		text-align: center;
	}
	.all-num{
		display: flex;
		margin: 31rpx 0 0  19rpx;
		width: 712rpx;
	}
	.shuzi{
		width: 20%;
		text-align: center;
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(128, 128, 128, 1);
	}
	.shu-num{
		font-size: 40rpx;
		color: rgba(0, 0, 0, 1);
		font-weight: 500;
	}
	/* 项目列表 */
	.projectlist{
		margin-top: 20rpx;
		width: 100%;
		height: 741rpx;
		background: #FFFFFF;
	}
	.all-cui{
		margin: -47rpx 0 0 412rpx;
		width: 149rpx;
		height: 59rpx;
		border-radius: 92rpx;
		border: 1rpx solid rgba(0, 97, 255, 1);
		font-size: 28rpx;
		color: rgba(0, 97, 255, 1);
		line-height: 59rpx;
		text-align: center;
	}
	/* 列表 */
	.projectL{
		margin-top: 10rpx;
		width: 100%;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 1);
	}
	.projectName{
		margin: 45rpx 0 0 20rpx;
		font-size: 28rpx;
		font-weight: 500;
	}
	>>>.uni-progress-bar {
	    border-radius: 129rpx;  
	}  
	>>>.uni-progress-inner-bar {  
	    border-radius: 129rpx;  
	}
	>>>.uni-progress-info {
		margin-top: 0;
		margin-bottom: 0;
		min-width: 2em;
		margin-left: 15px;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 1);
	}
	>>>uni-progress {
	    width: 90%;
		margin: 25rpx 0 0 20rpx;
	}
	.projectLine{
		margin: 40rpx 0 0 20rpx;
		width: 711rpx;
		height: 1rpx;
		background: rgba(230, 230, 230, 1);
	}
	/* 未完成清单 */
	.wei-title1{
		color: rgba(0, 97, 255, 1);
	}
	.title1{
		margin: 37rpx 0 0 20rpx;
		font-size: 28rpx;
	}
	.title2{
		margin: -29px 0 0 197rpx;
		font-size: 28rpx;
	}
	.wei-line1{
		margin: 10rpx 0 0 15rpx;
		width: 79rpx;
		height: 8rpx;
		border-radius: 75rpx;
		background: rgba(0, 97, 255, 1);
	}
	>>>.uni-table[data-v-6cd49106] {
		position: relative;
		width: 710rpx;
		border-radius: 5px;
		background-color: #fff;
		box-sizing: border-box;
		display: table;
    /* overflow-x: inherit; */
}

/* 消息预警汇总表格 */
.hui-kuang{
	display: flex;
	width: 710rpx;
	height: 120rpx;
	/* border: 1rpx solid rgba(215, 219, 236, 1); */
	font-size: 24rpx;
	color: rgba(90, 96, 127, 1);
}
.hui-left{
	width: 171rpx;
	height: 120rpx;
	background: rgba(245, 246, 250, 1);
	line-height: 120rpx;
	text-align: center;
}
.hui-center{
	width: 270rpx;
	height: 60rpx;
	border: 1rpx solid rgba(215, 219, 236, 1);
	line-height: 60rpx;
	text-align: center;
}

.quesheng{
		margin-top: 300rpx;
		width: 480rpx;
		height: 558rpx;
	}
</style>
