<template>
	<div>
		<!-- 发布岗位 -->
		<el-dialog @close="close" :close-on-click-modal="false" v-model="dialogAgreement" :title="title" width="50%">
			<div class="content" v-html="content">

			</div>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		props: {
			// 显示弹窗
			dialogAgreements: {
				type: Boolean,
				default: false
			},
			//协议名称
			title: {
				type: String,
				default: 'save'
			},
			//协议id
			typeid: {
				type: String || Number,
				default: ''
			}
		},
		data() {
			return {
				content: '',
				dialogAgreement: false,
			}
		},
		mounted() {
			this.dialogAgreement = this.dialogAgreements
			this.getAgreeCont()
		},
		methods: {
			//获取协议内容
			getAgreeCont() {
				this.$Request.get('/app/common/type/' + this.typeid).then(res => {
					if (res.code === 0) {
						this.content = res.data.value;
					}
				});
			},
			//关闭弹窗
			close() {
				this.$emit('closeAgree', false)
			}
		}
	}
</script>

<style lang="scss" scoped>
	:deep(.el-dialog) {
		border-radius: 14px !important;
	}

	:deep(.el-dialog__body) {
		padding-top: 10px !important;

	}

	:deep(.el-dialog__header) {
		background: linear-gradient(45deg, #f2fffa, #FFFFFF);
		border-radius: 14px 14px 0 0;
	}

	.content {
		width: 100%;
		height: 300px;
		overflow: hidden;
		overflow-y: scroll;
	}

	::-webkit-scrollbar {
		/* Chrome, Safari, Opera */
		width: 4px;
	}

	::-webkit-scrollbar-thumb {
		background-color: #cccccc;
		/* 滚动条颜色 */
	}

	::-webkit-scrollbar-track {
		background-color: #ffffff;
		/* 轨道颜色 */
	}
</style>