<template>
    <div>
        <div class="content">
            <div class="flex-arround" style="margin-bottom: 50px">
                <div>项目编号：{{ projectCode }}</div>
                <div>项目名称：{{ projectName }}</div>
                <div>发布时间：{{ detail.createTime }}</div>
            </div>
            <div v-if="state">
                <div v-html="detail.content"></div>
                <div class="enclosure flex-item">
                    <div style="margin-right: 30px">相关附件</div>
                    <ul v-if="detail.fileList !== undefined && detail.fileList.length > 0">
                        <li v-for="(item, i) in detail.accessoryVOList" :key="i">
                            <a href="item.accessoryUrl">{{ item.fileName }}</a>
                        </li>
                    </ul>
                    <div v-else>空</div>
                </div>
            </div>
            <div v-else>{{ msg }}</div>
            <div class="centerButton">
                <el-button @click="back">返回</el-button>
            </div>
        </div>
    </div>
</template>

<script>
import { cadidate } from '@api/supply/bid';

export default {
    components: {},
    data() {
        return {
            projectCode: '',
            projectName: '',
            detail: '',
            msg: '',
            state: true
        };
    },
    methods: {
        back() {
            this.$router.go(-1);
        },
        async getcadidate() {
            let projectId = localStorage.getItem('projectId');
            const { data, code, msg } = await cadidate(projectId);
            if (code == 200) {
                this.detail = data;
            } else {
                this.msg = msg;
                this.state = false;
            }
        }
    },
    created() {
        this.projectCode = localStorage.getItem('projectCode');
        this.projectName = localStorage.getItem('projectName');
        this.getcadidate();
    }
};
</script>

	
<style scoped>
.content > h1 {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
    font-weight: bold;
}
.content > .img {
    width: 600px;
    margin: 0 auto;
}
.enclosure {
    margin: 20px 0;
}
</style>