<template>
	<div>
		<div class="content-head">
			<dataBreadcrumb :breads="breads"></dataBreadcrumb>
			<h3>查看中标公告</h3>
			<h5>查看中标公告</h5>
		</div>
		<div class="content">
			<div class="flex-arround">
				<div>项目编号：{{projectCode}}</div>
				<div>项目名称：{{projectName}}</div>
				<div v-if="state">发布时间：{{detail.createTime}}</div>
			</div>
			<div class='detail1' v-if="state">
				<div v-html="detail.content"></div>
				<div class="enclosure" v-if="detail.accessoryDOList">
					<ul>
						<li v-for="(item,i) in detail.accessoryDOList" :key="i">
							<a href="item.accessoryUrl">item.fileName</a>
						</li>
					</ul>
				</div>  
				<div class="enclosure">相关附件：空</div>
			</div>
			<div v-else class="detail1">
				未找到该公告详情！
			</div>
			<div class="centerButton">
				<el-button @click="back">返回</el-button>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		noticeWin
	} from '@api/supply/bid'
	import dataBreadcrumb from '@components/dataBreadcrumb.vue'
	export default {
		components: {
			dataBreadcrumb
		},
		data() {
			return {
				breads: ['投标管理 ', '我参加的项目', '工作台'],
				projectCode: "",
				projectName: "",
				state: true,
				detail: ""
			}
		},
		methods: {
			back() {
				this.$router.go(-1)
			},
			async getnoticeWin() {
				try {
					let projectId = localStorage.getItem("projectId")
					const {
						data,
						code
					} = await noticeWin(projectId)
					if (code == 200) {
						console.log(data)
						this.detail = data
					} else {
						this.state = false
					}
				} catch (err) {
                   console.log(err)
				}
			}
		},
		created() {
			this.projectCode = localStorage.getItem("projectCode")
			this.projectName = localStorage.getItem("projectName")
			this.getnoticeWin()
		}
	}
</script>


<style scoped>
	.detail1 {
		background: #fff;
		
		margin-top: 30px;
	}

	.content>h1 {
		text-align: center;
		margin-top: 20px;
		margin-bottom: 40px;
		font-weight: bold;
	}

	.content>.img {
		width: 600px;
		margin: 0 auto
	}

	.enclosure {
		margin: 50px 0;
	}
</style>
