<template>
	<div v-if="visible" class="popup-model station-model comp-container">
		<div class="station-title">{{ title }}</div>
		<i class="icon el-icon-close" @click="close"></i>
		<div class="station-content" v-html="content">
			
		</div>
	</div>
</template>

<script>
	import digitalReservoir from '@/api/frontScreen/digitalReservoir.js'
	export default {
		name: 'historyModel',
		data() {
			return {
				visible: false,
				title: '',
				content:''
				
			}
		},
		methods: {
			open(title, id) {
				this.title = title
				this.visible = true
				this.getHistoryContent(id)
			},
			getHistoryContent(val){
				this.content = this.$options.data().content
				digitalReservoir.historyContent(val,res=>{
					if(res.state){
						this.content=res.value
					}
				})
			},
			close() {
				this.visible = false
				this.$emit('close')
			},
		},
	}
</script>

<style lang="scss" scoped>
	@import './../css/gisComp.scss';

	.popup-model {
		width: 1000PX;
		height: 80%;
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		background-color: rgba(0, 0, 0, 0.8);
		z-index: 99;
		border: 1px solid #d2d6dc;
		border-radius: 6px;
		color: #d3d4d7;
		padding: 20px;
		box-sizing: border-box;
		// overflow-y: auto;
		.el-icon-close {
			position: absolute;
			right: 6px;
			top: 6px;
			font-size: 20px;
			color: #f56c6c;
			cursor: pointer;
		}

		.station-title {
			text-align: center;
			font-size: 16px;
			height: 20px;
			line-height: 20px;
			font-weight: 700;
			margin-bottom: 16px;
		}

		.station-content {
			height: calc(100% - 36px);
			width: 100%;
			overflow-y:auto;
		}
	}
</style>
