<template>
  <Card title="基本信息">
    <div class="container">
      <vue-scroll style="height: 95%;">
        <div class="list">
          <!-- <div class="list-item" v-for="(item, key) in list" :key="key">
            <span class="label">{{ item.label +' ： '}} </span>
            <span class="value">{{ item.value }}</span>
          </div> -->
          <div class="list-item">
            <div >项目地址:{{ list.projectAddress}}</div>
            <div>项目面积:{{ list.projectAcreage}}</div>
            <div>建设单位:{{ list.constructionUnit}}</div>
            <div>设计单位:{{ list.designUnit}}</div>
            <div>总包单位:{{ list.designUnit}}</div>
            <div>监理单位:{{ list.supervisorUnit}}</div>
          </div>
        </div>
      </vue-scroll>
    </div>
  </Card>
</template>

<script>
import Card from '../components/Card'
import { listProjectInfo } from '@/assets/js/api/zhongjianFourth'


export default {
  components: { Card },
  data: () => ({
    // list: {
    //   projectAddress: { label: '项目地址', value: '' },
    //   projectAcreage: { label: '项目面积', value: '' },
    //   constructionUnit: { label: '建设单位', value: '' },
    //   designUnit: { label: '设计单位', value: '' },
    //   name: { label: '总包单位', value: '中国建筑第四工程局有限公司' },
    //   supervisorUnit: { label: '监理单位', value: '' },
    // },
    list:{},
  }),
  created() {
    this.projectSn = this.$store.state.projectSn
    // this.projectSn=localStorage.getItem('sn')
  },
  mounted(){
    this.getList()
  },
  methods: {
    /** 查询列表 */
    getList() {
      // listProjectInfo({ projectSn: this.projectSn }).then(res => {
      //   console.log('项目信息11111: ', res);
      //   const list = this.list;
      //   Object.keys(list).forEach(key => {
      //     list[key].value = res.result[key];
      //   })
      // })
      listProjectInfo({ projectSn: this.projectSn }).then(res => {
        this.list = res.result;
        console.log('项目信息11111: ', this.list);
      })
    },
  },
}
</script>

<style lang="less" scoped>
.container {
  box-sizing: border-box;
  padding-top: 16px;
  padding-left: 16px;
  width: 100%;
  height: 100%;

  .list {
    width: 100%;
    height: 100%;
    color: #fff;
    overflow-y: scroll;

    .list-item {
      flex: 1;
      position: relative;
      // display: flex;
      box-sizing: border-box;
      padding: 8px 0;
      width: 100%;
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s;
      white-space: nowrap;

      .label {
        box-sizing: border-box;
        width: 22%;
        padding-left: 20px;
      }

      .value {
        width: 75%;
      }
      div{
        margin: 13px 10px 0 0;
      }
    }
  }
}
</style>
