<template>
	<view class="container">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view class="nav-title">
				<text>{{title}}</text>
			</view>
		</uni-nav-bar>
		<uni-card title="预警信息" :is-shadow="false">
			<view>预警名称：<span style="color: skyblue;">{{formData.warnName}}</span></view>
			<view>预警时间：<span style="color: skyblue;">{{formData.warnTime}}</span></view>
			<view>预警状态：<span style="color: skyblue;">{{formData.warnStatusText}}</span></view>
			<view>审核状态：<span style="color: skyblue;">{{formData.reviewStatusText}}</span></view>
			<view>预警信息：<span style="color: skyblue;">{{formData.warnInfo}}</span></view>
			<view>预警政区：<span style="color: skyblue;">{{formData.warnAdcd}}</span></view>
			<view>预警点经纬度：<span style="color: skyblue;">{{formData.warnLgtd}},{{formData.warnLttd}}</span></view>
		</uni-card>
		<uni-card title="站点信息" :is-shadow="false">
			<view>测站编码：<span style="color: skyblue;">{{formData.stcd}}</span></view>
			<view>站类：<span style="color: skyblue;">{{formData.typeText}}</span></view>
			<view>雨量站预警频率：<span style="color: skyblue;">{{formData.rainWarnRateText}}</span></view>
			<view>降雨时段：<span style="color: skyblue;">{{formData.intv}}</span></view>
			<view>降雨总量：<span style="color: skyblue;">{{formData.drp}}</span></view>
			<view v-if="formData.z">河道水位：<span style="color: skyblue;">{{formData.z}}</span></view>
			<view v-if="formData.q">河道流量：<span style="color: skyblue;">{{formData.q}}</span></view>
			<view v-if="formData.wptn">河道水势：<span style="color: skyblue;">{{formData.wptn}}</span></view>
			<view v-if="formData.rz">水库水位：<span style="color: skyblue;">{{formData.rz}}</span></view>
			<view v-if="formData.rwptn">水库水势：<span style="color: skyblue;">{{formData.rwptn}}</span></view>
			<view v-if="formData.inq">水库流量：<span style="color: skyblue;">{{formData.inq}}</span></view>
		</uni-card>
	</view>
</template>

<script>
	import {
		role
	} from "@/api/role.js";
	import http from '@/http/api.js';
	export default {
		data() {
			return {
				title: '预警详情',
				warnId: '',
				formData: {},
			}
		},
		onLoad(option) {
			this.warnId = option.id;
			this.getDetail();
		},
		computed: {

		},
		methods: {
			//返回上一页
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			getDetail() {
				let that = this;
				http.request({
					url: '/galaxy-business/yj/warn/detail?id=' + this.warnId,
					method: 'GET'
				}).then(res => {
					if (res && res.success) {
						that.formData = res.data;
					}
				}).catch(err => {
					console.log(JOSN.stringify(err))
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 0 0 100rpx;
	}
</style>