<!--
 * @Title: 
 * @Description: 首页
 * @Author: swp
 * @Date: 2022-08-24 10:49:21
 * @LastEditors: 
 * @LastEditTime: 2022-08-24 10:49:21
-->
<template>
	<view class="container">
		<!-- 导航栏  #3F9EFF-->
		<uni-nav-bar :fixed="true" backgroundColor="#3F9EFF" statusBar="false" height="75px">
			<block slot="left">
				<view style="display: flex;flex-direction: column;justify-content: center;">
					<image src="/static/images/logo_start.png" class="logo" mode="widthFix"></image>
				</view>
			</block>
			<view style="display: flex;flex:1,justify-content: center;align-items: center;">
				<text style="color: #ffffff; font-size: 1rem;font-family: Microsoft YaHei;">{{title}}</text>
			</view>
			<block slot="right">
				<view style="margin-right:20rpx" @click="onNoticeMoreClick">
					<uni-badge class="uni-badge-left-margin" absolute="rightTop" :is-dot="noticeDot" :text="noticeValue"
						size="small">
						<uni-icons class="input-uni-icon" type="notification" size="24" color="#FFFFFF" />
					</uni-badge>
				</view>
			</block>
		</uni-nav-bar>
		<!-- 头部按钮 -->
		<view class="nav">
			<u-grid :col="4" :border="false">
				<u-grid-item v-if="navButtonIndex[index]" bg-color="transparent" v-for="(item, index) in navButton"
					:key="index">
					<navigator v-if="item.badge" :url="item.url" hover-class="none" class="nav-item"
						open-type="navigate">
						<uni-badge class="uni-badge-left-margin" absolute="rightTop" :text="item.value" size="small">
							<image :src="item.img" mode="widthFix" class="nav-item-img"></image>
						</uni-badge>
						<view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
					</navigator>
					<navigator v-else :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
						<image :src="item.img" mode="widthFix" class="nav-item-img"></image>
						<view style="font-size: 0.7rem;font-weight: bold;">{{ item.name }}</view>
					</navigator>
				</u-grid-item>
			</u-grid>
		</view>
		<!-- 新任务 -->
		<uni-section v-if="permission.companyServciePerson" title="新任务" titleColor="#5470c6" titleFontSize="0.7rem"
			:subTitle="realData.newCheckOrderCount">
			<template v-slot:right>
				<view v-if="loadMoreStatus === 'more'" class="line">
					<view class="block">
						<uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
					</view>
					<view class="block">
						<text style="margin-left: 2px;font-size:0.7rem;color:grey;"
							@click="onMoreUncomfireCheckOrderClick()">查看更多</text>
					</view>
				</view>
				<view v-else-if="loadMoreStatus === 'noMore'" class="line">
					<view class="block">
						<text style="font-size:0.7rem;color:gray;">暂无数据</text>
					</view>
				</view>
				<view v-else class="line">
					<view class="block">
						<text style="font-size:0.7rem;color:gray;">已全部加载</text>
					</view>
				</view>
			</template>
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<uni-list style="min-height: 40px;">
				<uni-list-item v-for="item in unconfirmOrderList" :key="item.id">
					<template v-slot:body>
						<view class="item-block">
							<uni-row>
								<uni-col :span="18">
									<view class="line">
										<view class="block">
											<uni-icons class="input-uni-icon" type="home" size="18" color="grey" />
										</view>
										<view class="block rtu-name">
											{{item.rtuName}}
										</view>
										<view class="block rtu-code">
											[{{item.rtuCode}}]
										</view>
									</view>
								</uni-col>
								<uni-col :span="6">
									<view class="line-end">
										<view class="block"
											style="width: 140px;height:28px;border-radius:7px;background-color:lightblue"
											@click="onOrderItemClick(item.id)">
											<view class="line-center">
												<view class="block">
													<uni-icons class="input-uni-icon" type="auth" size="16"
														color="coral" />
												</view>
												<view class="block">
													<text
														style="padding-left:2px;color:black;font-size:0.7rem">查看任务</text>
												</view>
											</view>
										</view>
									</view>
								</uni-col>
							</uni-row>
							<view class="item-text-line">
								<uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
								<text class="item-text">{{item.areaName}}</text>
							</view>
							<view class="item-text-line">
								<uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
								<text class="item-text" style="width: 60px;">备注：</text>
								<text class="item-text-ell">{{item.orderDesc}}</text>
							</view>
						</view>
					</template>
				</uni-list-item>
			</uni-list>
		</uni-section>
		<!-- 测站统计信息 -->
		<uni-section style="margin-bottom: 0px;" title="测站统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<view class="count-info-block">
				<uni-row>
					<uni-col :span="24">
						<view class="rtuCount">
							<view>
								<text class="name">测站数量：</text>
							</view>
							<view style="margin-left:10px;text-decoration-line: underline;"
								@click="onRtuManageViewClick">
								<text class="count">{{realData.rtus}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="warnRtuCount">
							<view>
								<text class="name">异常测站数量 ：</text>
							</view>
							<view style="margin-left:10px;text-decoration-line: underline;"
								@click="onWarningRtuViewClick">
								<text class="count">{{realData.warningRtus}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
			</view>
		</uni-section>
		<uni-section style="margin-bottom: 0px;" title="维修任务统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<view class="count-info-block">
				<uni-row>
					<uni-col :span="24">
						<view class="orderCount">
							<view>
								<text class="name">维修任务总数量：</text>
							</view>
							<view v-if="permission.companyServciePerson">
								<view v-if="realData.orderCount" style="margin-left:10px;">
									<text class="count">{{realData.orderCount}}</text>
								</view>
							</view>
							<view v-else>
								<view style="margin-left:10px;text-decoration-line: underline;"
									@click="onAllCheckOrderClick">
									<text class="count">{{realData.orderCount}}</text>
								</view>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="unconfirmOrderCount">
							<view>
								<text class="name">未确认维修任务数量：</text>
							</view>
							<view v-if="realData.unconfirmOrderCount"
								style="margin-left:10px;text-decoration-line: underline;"
								@click="onUncomfirecheckorderViewClick">
								<text class="count">{{realData.unconfirmOrderCount}}</text>
							</view>
							<view v-else style="margin-left:10px;text-decoration-line: underline;"
								@click="onUncomfirecheckorderViewClick">
								<text class="count">0</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="delayComfireOrders">
							<view>
								<text class="name">超时未确认维修任务数量：</text>
							</view>
							<view v-if="realData.delayComfireOrders"
								style="margin-left:10px;text-decoration-line: underline;"
								@click="onComfiredelaycheckorderClick">
								<text class="count">{{realData.delayComfireOrders}}</text>
							</view>
							<view v-else style="margin-left:10px;text-decoration-line: underline;"
								@click="onComfiredelaycheckorderClick">
								<text class="count">0</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="processOrderCount">
							<view>
								<text class="name">维修处理中任务数量：</text>
							</view>
							<view v-if="realData.processOrderCount"
								style="margin-left:10px;text-decoration-line: underline;"
								@click="onProcessCheckorderViewClick">
								<text class="count">{{realData.processOrderCount}}</text>
							</view>
							<view v-else style="margin-left:10px;text-decoration-line: underline;"
								@click="onProcessCheckorderViewClick">
								<text class="count">0</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="processOrderCount">
							<view>
								<text class="name">已处理任务数量：</text>
							</view>
							<view v-if="realData.reportOrder" style="margin-left:10px;text-decoration-line: underline;"
								@click="onReportCheckorderViewClick">
								<text class="count">{{realData.reportOrder}}</text>
							</view>
							<view v-else style="margin-left:10px;text-decoration-line: underline;"
								@click="onReportCheckorderViewClick">
								<text class="count">0</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
			</view>
		</uni-section>
		<uni-section title="本年度设备巡检统计信息" titleColor="#5470c6" titleFontSize="0.7rem">
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<view class="count-info-block">
				<uni-row>
					<uni-col :span="24">
						<view class="equipmentInspectionCount">
							<view>
								<text class="name">需巡检站点数量：</text>
							</view>
							<view style="margin-left: 10px;text-decoration-line: underline;"
								@click="onInspectionManageClick">
								<text class="count">{{realData.equipmentInspectionCount}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="equipmentInspectionBeforeRainCount">
							<view>
								<text class="name">汛前已巡检设备数量：</text>
							</view>
							<view style="margin-left: 10px;text-decoration-line: underline;"
								@click="onFinishedBeforeRainInspectionClick">
								<text class="count">{{realData.equipmentInspectionBeforeRainReports}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="equipmentInspectionRainFirstCount">
							<view>
								<text class="name">汛中（一）已巡检设备数量：</text>
							</view>
							<view style="margin-left: 10px;text-decoration-line: underline;"
								@click="onFinishedRainFirstInspectionClick">
								<text class="count">{{realData.equipmentInspectionRainFirstReports}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 4px;">
					<uni-col :span="24">
						<view class="equipmentInspectionRainSecondCount">
							<view>
								<text class="name">汛中（二）已巡检设备数量：</text>
							</view>
							<view style="margin-left: 10px;text-decoration-line: underline;"
								@click="onFinishedRainSecondInspectionClick">
								<text class="count">{{realData.equipmentInspectionRainSecondReports}}</text>
							</view>
						</view>
					</uni-col>
				</uni-row>
			</view>
		</uni-section>
		<!-- 任务动态 -->
		<uni-section v-if="permission.admin || permission.orgAdmin || permission.companyAdmin"
			style="margin-bottom: 0px;" title="今日维修任务信息" titleColor="#5470c6" titleFontSize="0.7rem"
			:subTitle="realData.todayOrderProcessCount">
			<template v-slot:right>
				<view class="line-end">
					<uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
					<text style="margin-left: 4px;;font-size:0.7rem;color:grey;"
						@click="onMoreTodayCheckOrderReportClick()">查看更多</text>
				</view>
			</template>
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<uni-list style="min-height: 40px;">
				<uni-list-item v-for="item in todayOrderProcessList" :key="item.id" showArrow clickable
					@click="onOrderReportItemClick(item.orderId)">
					<template v-slot:body>
						<view class="item-block">
							<view class="item-text-line">
								<view class="block">
									<image class="item-title-image" style="box-shadow:0 0 2px 2px lightblue"
										src="/static/images/list/order_item.png" mode="widthFix">
									</image>
								</view>
								<view class="block">
									<text class="rtu-name">{{item.rtuName}}</text>
								</view>
								<view class="block">
									<text class="rtu-code">[{{item.rtuCode}}]</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="loop" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-text">状态：</text>
								</view>
								<view class="block">
									<text class="item-text">
										{{item.orderStatusName}}
									</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title">填报人：</text>
								</view>
								<view class="block">
									<text class="item-text">
										{{item.orderProcessUserName}}
									</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title">填报时间：</text>
								</view>
								<view class="block">
									<text class="item-text">
										{{item.updateTime}}
									</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title" style="width: 50px;">说明：</text>
								</view>
								<text v-if="item.processDesc" class="item-text-ell">
									{{item.processDesc}}
								</text>
							</view>
							<!-- 		<view class="item-text-line" style="margin-top: 2px;">
								<text v-if="item.processDesc" class="item-text-ell">
									{{item.processDesc}}
								</text>
							</view> -->
						</view>
					</template>
				</uni-list-item>
			</uni-list>
		</uni-section>
		<!-- 巡检动态 -->
		<uni-section v-if="permission.admin || permission.orgAdmin || permission.companyAdmin" title="今日设备巡检信息"
			titleColor="#5470c6" titleFontSize="0.7rem" :subTitle="realData.todayIinspectionReportCount">
			<template v-slot:right>
				<view class="line-end">
					<uni-icons class="input-uni-icon" type="more-filled" size="18" color="skyblue" />
					<text style="font-size:0.7rem;color:grey;" @click="onMoreTodayInspectionReportInfoClick">查看更多</text>
				</view>
			</template>
			<template v-slot:decoration>
				<view class="decoration"></view>
			</template>
			<uni-list style="min-height: 40px;">
				<uni-list-item v-for="item in todayEquipmentInspectionList" :key="item.id" showArrow clickable
					@click="onInspectionItemClick(item.id,item.rainSeasonKind)">
					<template v-slot:body>
						<view class="item-block">
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<image class="item-title-image" style="box-shadow:0 0 2px 2px lightblue"
										src="/static/images/list/inspection_item.png" mode="widthFix">
									</image>
								</view>
								<view class="block">
									<text class="rtu-name">{{item.rtuName}}</text>
								</view>
								<view class="block">
									<text class="rtu-code">[{{item.rtuCode}}]</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="person" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title">填报人：</text>
								</view>
								<view class="block">
									<text class="item-text">
										{{item.servicePersonName}}
									</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title">填报时间：</text>
								</view>
								<view class="block">
									<text class="item-text">
										{{item.createTime}}
									</text>
								</view>
							</view>
							<view class="item-text-line" style="margin-top: 2px;">
								<view class="block">
									<uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
								</view>
								<view class="block">
									<text class="item-title" style="width: 50px;">说明：</text>
								</view>
								<text v-if="item.reportDesc" class="item-text-ell">
									{{item.reportDesc}}
								</text>
							</view>
							<!-- 			<view class="item-text-line" style="margin-top: 2px;">
								<text v-if="item.reportDesc" class="item-text-ell">
									{{item.reportDesc}}
								</text>
							</view> -->
						</view>
					</template>
				</uni-list-item>
			</uni-list>
		</uni-section>
	</view>
</template>

<script>
	import
	navBtns
	from "@/api/home.js";
	import {
		role
	} from "@/api/role.js";
	import http from '@/http/api.js';
	export default {
		components: {

		},
		data() {
			return {
				title: '山洪灾害监测预警平台运维系统',
				permission: {
					'admin': false,
					'orgAdmin': false,
					'companyAdmin': false,
					'companyServciePerson': false,
				},
				ywxtSubSystem: 0,
				yjxtSubSystem: 0,
				currentRole: '',
				current: 0,
				navButton: [],
				navButtonIndex: [],
				//more/loading/noMore
				loadMoreStatus: "noMore",
				timer: false,
				noticeDot: false,
				noticeValue: 0,
				unconfirmOrderList: [],
				todayEquipmentInspectionList: [],
				todayOrderProcessList: [],
				realData: {
					todayOrderProcessCount: '维修任务数量：0',
					todayIinspectionReportCount: '设备巡检数量：0',
					newCheckOrderCount: '新任务数量：0'
				},
			};
		},
		computed: {
			getProcessOrder() {
				if (this.realData.rtuCount && this.realData.unconfirmOrderCount) {
					return this.realData.rtuCount - this.realData.unconfirmOrderCount;
				}
				return 0;
			}
		},
		onLoad() {
			console.log("onLoad++++++++++++++ ")
			let subSystemSelectInfo = uni.getStorageSync("SubSystemSelectInfo");
			console.log("home " + JSON.stringify(subSystemSelectInfo))
			this.ywxtSubSystem = subSystemSelectInfo.ywxt;
			this.yjxtSubSystem = subSystemSelectInfo.yjxt;
			if (this.ywxtSubSystem == 1) {
				this.title = '山洪灾害监测预警平台运维系统';
				uni.setTabBarItem({
					"index": 1,
					"iconPath": "static/images/tabbar/workbench.png",
					"selectedIconPath": "static/images/tabbar/workbench_selected.png",
					"text": "管理工作台",
				})
			} else if (this.yjxtSubSystem == 1) {
				this.title = '山洪灾害监测预警平台应急系统';
				uni.setTabBarItem({
					"index": 1,
					"iconPath": "static/images/tabbar/warn.png",
					"selectedIconPath": "static/images/tabbar/warn_selected.png",
					"text": "监测预警",
				})
			}
			this.permission.admin = false;
			this.permission.orgAdmin = false;
			this.permission.companyAdmin = false;
			this.permission.companyServciePerson = false;
			this.navButton = navBtns.navButtons;
			if (this.userInfo.role_name === role.admin) {
				this.permission.admin = true;
				this.navButtonIndex = navBtns.sysAdminNavButton;
				this.currentRole = role.admin;
			} else if (this.userInfo.role_name === role.orgAdmin) {
				this.permission.orgAdmin = true;
				this.currentRole = role.orgAdmin;
				this.navButtonIndex = navBtns.orgAdminNavButton;
			} else if (this.userInfo.role_name === role.companyAdmin) {
				this.permission.companyAdmin = true;
				this.currentRole = role.companyAdmin;
				this.navButtonIndex = navBtns.companyAdminNavButton;
			} else if (this.userInfo.role_name === role.companyServciePerson) {
				this.permission.companyServciePerson = true;
				this.currentRole = role.companyServciePerson;
				this.navButtonIndex = navBtns.companyServicePersonNavButton;
			}
			if (this.$u.func.checkLogin()) {
				console.log("timer start  +++++++ ")
				this.timer = true;
				setTimeout(this.timeCall, 10);
			}
		},
		onUnload() {
			console.log("onUnload++++++++++++++ ")
			this.timer = false;
		},
		onReady() {
			console.log("onReady++++++++++++++ ")
			if (this.$u.func.checkLogin()) {
			} else {
				this.$u.func.logout();
			}
		},
		onShow() {
			console.log("onShow++++++++++++++ " + this.currentRole)
			if (this.$u.func.checkLogin()) {
				let subSystemSelectInfo = uni.getStorageSync("SubSystemSelectInfo");
				console.log("home " + JSON.stringify(subSystemSelectInfo))
				this.ywxtSubSystem = subSystemSelectInfo.ywxt;
				this.yjxtSubSystem = subSystemSelectInfo.yjxt;
				if (this.ywxtSubSystem == 1) {
					this.title = '山洪灾害监测预警平台运维系统';
					uni.setTabBarItem({
						"index": 1,
						"iconPath": "static/images/tabbar/workbench.png",
						"selectedIconPath": "static/images/tabbar/workbench_selected.png",
						"text": "管理工作台",
					})
				} else if (this.yjxtSubSystem == 1) {
					this.title = '山洪灾害监测预警平台应急系统';
					uni.setTabBarItem({
						"index": 1,
						"iconPath": "static/images/tabbar/warn.png",
						"selectedIconPath": "static/images/tabbar/warn_selected.png",
						"text": "监测预警",
					})
				}
				if (this.userInfo.role_name !== this.currentRole) {
					this.permission.admin = false;
					this.permission.orgAdmin = false;
					this.permission.companyAdmin = false;
					this.permission.companyServciePerson = false;
					if (this.userInfo.role_name === role.admin) {
						this.permission.admin = true;
						this.navButtonIndex = navBtns.sysAdminNavButton;
						this.currentRole = role.admin;
					} else if (this.userInfo.role_name === role.orgAdmin) {
						this.permission.orgAdmin = true;
						this.currentRole = role.orgAdmin;
						this.navButtonIndex = navBtns.orgAdminNavButton;
					} else if (this.userInfo.role_name === role.companyAdmin) {
						this.permission.companyAdmin = true;
						this.currentRole = role.companyAdmin;
						this.navButtonIndex = navBtns.companyAdminNavButton;
					} else if (this.userInfo.role_name === role.companyServciePerson) {
						this.permission.companyServciePerson = true;
						this.navButtonIndex = navBtns.companyServicePersonNavButton;
						this.currentRole = role.companyServciePerson;
					}
				}
				if (this.timer == false) {
					console.log("timer start  +++++++ ")
					this.timer = true;
					setTimeout(this.timeCall, 10);
				}
			} else {
				this.$u.func.logout();
			}
		},
		onHide() {
			console.log("onHide++++++++++++++ ")
			this.timer = false;
		},
		methods: {
			timeCall() {
				if (this.timer == true) {
					//console.log("time work ");
					this.getHomeInfo();
					setTimeout(this.timeCall, 10000);
				}
			},
			//跳转到工作台
			onRtuManageViewClick() {
				var url = '/pages/rtu-manage/rtumanage';
				uni.switchTab({
					url: url
				})
			},
			//查看设备异常信息
			onWarningRtuViewClick() {
				var url = '/pages/warning/warninglist';
				uni.navigateTo({
					url: url
				})
			},
			//跳转到维修任务
			onAllCheckOrderClick() {
				var url = '/pages/check-order/checkorderlist';
				uni.navigateTo({
					url: url
				})
			},
			//查看未确认维修任务
			onUncomfirecheckorderViewClick() {
				var url = '/pages/check-order/uncomfirecheckorderlistview';
				uni.navigateTo({
					url: url
				})
			},
			onProcessCheckorderViewClick() {
				var url = '/pages/check-order/processcheckorderlistview';
				uni.navigateTo({
					url: url
				})
			},
			onReportCheckorderViewClick() {
				if (this.permission.admin || this.permission.orgAdmin) {
					let url = '/pages/check-order/companycheckorderlist?type=4';
					uni.navigateTo({
						url: url
					})
				} else {
					let url = '/pages/check-order/servicepersoncheckorderlist?type=3';
					uni.navigateTo({
						url: url
					})
				}
			},
			//查看超时未确认维修任务
			onComfiredelaycheckorderClick() {
				var url = '/pages/check-order/comfiredelaycheckorderlist';
				uni.navigateTo({
					url: url
				})
			},
			onOrderReportItemClick(id) {
				console.log("opne record ", id)
				var url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
				uni.navigateTo({
					url: url
				})
			},
			onNoticeMoreClick() {
				uni.navigateTo({
					url: '/pages/news/noticelist'
				})
			},
			onMoreTodayCheckOrderReportClick() {
				uni.navigateTo({
					url: '/pages/check-order/todaycheckorderrprocesseportlist'
				})
			},
			onOrderItemClick(id) {
				let url =
					'/pages/check-order/orderconfirm?id=' + id;
				uni.navigateTo({
					url: url
				})
			},
			//跳转到待巡检页面
			onInspectionManageClick() {
				var url = '/pages/equipment-inspection/inspectionlist';
				uni.navigateTo({
					url: url
				})
			},
			onFinishedBeforeRainInspectionClick() {
				var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=1';
				uni.navigateTo({
					url: url
				})
			},
			onFinishedRainFirstInspectionClick() {
				var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=2';
				uni.navigateTo({
					url: url
				})
			},
			onFinishedRainSecondInspectionClick() {
				var url = '/pages/equipment-inspection/finishedinspectionreportlist?rainSeasonKind=3';
				uni.navigateTo({
					url: url
				})
			},
			onMoreTodayInspectionReportInfoClick() {
				uni.navigateTo({
					url: '/pages/equipment-inspection/todayinspectionreportlist'
				})
			},
			onInspectionItemClick(id, rainSeasonKind) {
				console.log("onInspectionItemClick " + id)
				var url = '/pages/equipment-inspection/inspectionreportview?id=' + id + "&type=" + rainSeasonKind;
				uni.navigateTo({
					url: url
				})
			},
			onMoreUncomfireCheckOrderClick() {
				uni.navigateTo({
					url: '/pages/check-order/uncomfirecheckorderlist'
				})
			},
			getHomeInfo() {
				//console.log("getHomeInfo ")
				let that = this;
				http.request({
					url: '/galaxy-business/home/real/info',
					method: 'GET'
				}).then(res => {
					//	console.log("getHomeInfo "+JSON.stringify(res))
					if (res && res.success) {
						that.realData = res.data;
						that.realData['processOrderCount'] = that.realData.processCheckOrderCount;
						that.realData['todayOrderProcessCount'] = '今日已处理任务数量：' + that.realData
							.todayOrderProcessCount;
						that.realData['todayIinspectionReportCount'] = '今日已巡检数量：' + that.realData
							.todayIinspectionReportCount;

						that.realData['newCheckOrderCount'] = '新任务数量：' + that.realData
							.unconfirmOrderCount;


						if (that.realData.hasNewNotice) {
							that.noticeDot = true;
							that.noticeValue = that.realData.newNoticeCount;
						} else {
							that.noticeDot = false;
							that.noticeValue = 0;
						}
						that.getTodayOrderProcessList();
						that.getTodayInspectionReport();
						if (that.permission.companyServciePerson) {
							console.log("companyServciePerson")
							that.getUnconfirmOrderList();
						}
					}
				}).catch(err => {
					console.log(JOSN.stringify(err))
				})
			},
			getUnconfirmOrderList() {
				let that = this;
				let postData = {};
				http.request({
					url: '/galaxy-business/rtu/check/order/unconfirm/last/list',
					method: 'GET',
					data: postData,
				}).then(res => {
					if (res.data != null) {
						that.unconfirmOrderList = res.data;
						if (that.realData.unconfirmOrderCount > 0) {
							if (that.realData.unconfirmOrderCount > that.unconfirmOrderList.length) {
								that.loadMoreStatus = "more";
							} else {
								that.loadMoreStatus = "load";
							}
						} else {
							that.loadMoreStatus = "noMore";
						}
					}
				}).catch(err => {
					console.log(JOSN.stringify(err))
				})
			},
			getTodayOrderProcessList() {
				const that = this;
				http.request({
					url: '/galaxy-business/rtu/check/order/process/today/list',
					method: 'GET'
				}).then(res => {
					that.todayOrderProcessList = [];
					if (res.data != null && res.data.length > 0) {
						that.todayOrderProcessList.push(res.data[0]);
					}
				}).catch(err => {
					console.log(JOSN.stringify(err))
				})
			},
			getTodayInspectionReport() {
				const that = this;
				http.request({
					url: '/galaxy-business/equipment/inspection/report/today/list',
					method: 'GET'
				}).then(res => {
					that.todayEquipmentInspectionList = [];
					if (res.data != null && res.data.length > 0) {
						that.todayEquipmentInspectionList.push(res.data[0]);
					}
				}).catch(err => {
					console.log(JOSN.stringify(err))
				})
			},

		}
	};
</script>

<style lang="scss" scoped>
	$nav-height: 75px;

	.decoration {
		width: 6px;
		height: 6px;
		margin-right: 4px;
		border-radius: 50%;
		background-color: cadetblue;
	}

	.item-block {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		width: 100%;
	}

	.line {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		width: 100%;
	}

	.line .block {
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.line-end {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		width: 100%;
	}

	.line-end .block {
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.line-center {
		display: flex;
		flex-direction: row;
		justify-content: center;
		width: 100%;
		height: 100%;
	}

	.line-center .block {
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.rtu-name {
		margin-left: 5rpx;
		font-size: 0.7rem;
		font-weight: bold;
	}

	.rtu-code {
		margin-left: 5rpx;
		font-size: 0.6rem;
		color: gray;
	}

	.item-text-line {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		padding-left: 0px;
		padding-right: 0px;

		.block {
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}

		.item-title {
			font-size: 0.7rem;
		}

		.item-text {
			padding-left: 2px;
			padding-right: 5px;
			font-size: 0.7rem;
		}

		.item-text-ell {
			width: 100%;
			overflow: hidden;
			font-size: 0.7rem;
			white-space: nowrap;
			text-overflow: ellipsis;
		}

		.item-number {
			font-size: 0.7rem;
			margin-left: 2px;
			margin-right: 5px;
		}
	}

	.item-title-image {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		margin-right: 5px;
		width: 20px;
		height: 20px;
		border-radius: 50%;
	}

	.uni-badge-left-margin {
		margin-left: 0px;
	}

	.logo {
		flex-shrink: 0;
		width: 100rpx;
		height: auto;
	}

	.container {
		background-color: #f7f7f7;
		min-height: 100vh;
		overflow: hidden;

	}

	.nav {
		margin: 0rpx 0;
		box-sizing: border-box;
		padding: 0 10rpx;
		background-color: white;

		&-item {
			width: 100%;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			height: 130rpx;

			&-img {
				width: 80rpx;
				height: 80rpx;
			}

			&-name {
				font-size: 0.7rem;
				font-family: PingFang SC;
				font-weight: 500;
				color: #585b61;
			}
		}
	}
</style>