
<template>
    <div class="home">
        <div class="user">
            <ul class="user-list flex">
                <li class="flex-colunm">
                    <i class="el-icon-user"></i>
                    <p class="user-pos">今日可报名项目</p>
                    <div>{{ detail.applyProjects }}</div>
                </li>
                <li class="flex-colunm">
                    <i class="el-icon-user"></i>
                    <p class="user-pos">中标项目</p>
                    <div>{{ detail.winProjects }}</div>
                </li>
            </ul>
            <h2>项目信息</h2>
            <dataTable :table-data="tabledata" :columns="columns"> </dataTable>
            <!-- <h2 class="se-h2">待办事项</h2>
            <ul class="project-list flex">
                <li v-for="item in projectlist" :key="item.id">
                    <img :src="item.src" alt="" />
                    <div>{{ item.project }}</div>
                    <div>{{ item.account }}</div>
                </li>
            </ul> -->
        </div>
    </div>
</template>

<script>
import { home } from '@api/supply/home';
import { getSearchString } from '@utils/common';
import dataTable from '@components/nopageTable.vue';
export default {
    components: {
        dataTable
    },
    data() {
        return {
            projectlist: [
                {
                    id: 0,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 1,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 2,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 3,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 4,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 5,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 6,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 7,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 8,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 9,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 10,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 11,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 12,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 13,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                },
                {
                    id: 14,
                    src: require('@static/images/item.png'),
                    project: '待处理投标邀请',
                    account: 100
                }
            ],
            //表格第一行
            columns: [
                {
                    label: '当前状态',
                    prop: 'state'
                },
                {
                    label: '数量',
                    prop: 'number'
                },
                {
                    slot: 'opration'
                }
            ],
            tabledata: [
                {
                    state: '处于售标&投标阶段的项目',
                    number: 10,
                    url: ''
                },
                {
                    state: '处于投标阶段的项目',
                    number: 10,
                    url: ''
                },
                {
                    state: '今日截标（开标）的项目',
                    number: 10,
                    url: ''
                },
                {
                    state: '处于开标阶段的项目',
                    number: 10,
                    url: ''
                },
                {
                    state: '处于评标阶段的项目',
                    number: 10,
                    url: ''
                },
                {
                    state: '处于定标阶段的项目',
                    number: 10,
                    url: ''
                }
            ],
            detail: ''
        };
    },
    methods: {
        async gethome() {
            const { data, code } = await home();
            this.detail = data;
            this.tabledata[0].number = data.sellingBidding;
            this.tabledata[1].number = data.bidding;
            this.tabledata[2].number = data.open;
            this.tabledata[3].number = data.bidOpening;
            this.tabledata[4].number = data.bidOevaluating;
            this.tabledata[5].number = data.bidDecide;
        }
    },
    created() {
        getSearchString('token');
        this.gethome();
    }
};
</script>

<style  scoped>
.home {
    box-sizing: border-box;
}
.home > .user {
    box-sizing: border-box;
    padding: 30px;
    background: #fff;
}
.user > .user-list {
    width: 100%;
    height: 180px;
    background: linear-gradient(180deg, #f3b880 0%, #f66827 100%);
    border-radius: 5px;
    box-sizing: border-box;
    padding: 0 116px;
}
.user-list > li {
    margin-right: 70px;
    font-size:30px;
    color:#fff
}
.user-list > li >p{
   font-size: 18px;
   margin-top:10px;
   margin-bottom: 10px;
}
.user-list > li >i{
  color:#fff
}
h5 {
    margin-top: 30px;
    margin-bottom: 30px;
}

h2 {
    margin-bottom: 50px;
}
.se-h2 {
    margin-top: 30px;
}
.project-list {
    margin-left: 30px;
    flex-wrap: wrap;
    text-align: center;
}
.project-list > li {
    margin-right: 100px;
    margin-bottom: 20px;
}
</style>
