<template>
  <div class="dashboard-container">
    <!-- 首页 -->
    <header class="header_title">张呼铁路客运专线信息</header>
    <el-row :gutter="24">
      <el-col :span="12" v-for="item in listData" class="mb20">
        <el-card shadow="never">
          <div slot="header" class="clearfix posa">
            <span>{{ item.title }}</span>
            <el-button v-if="item.option" style="float: right; padding: 3px 0;margin-right:20px" type="text" class="savebtn">保存</el-button>
          </div>
          <div v-for="k in item.list" :key="k.name" :class="item.list.length<=2? 'text2' : 'text'">
            <el-row :gutter="24">
              <el-col :span="10">
                <div class="item_name">{{ k.name }}</div>
              </el-col>
              <el-col :span="10">
                <div  v-if="item.option">
                  <el-input v-model="k.value"  clearable placeholder="请输入内容">{{ k.value }}</el-input>
                </div>
                <el-row :gutter="20" v-else-if="k.handle">
                  <el-col :span="10" class="value_handle">{{ k.value }}</el-col>
                  <el-col :span="10"><el-button class="alarmbtn" type="primary" size="mini">处理告警</el-button></el-col>
                </el-row>
                <div class="item_data" v-else>{{ k.value }}</div>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <div>
      
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { listData } from './const'

export default {
  name: 'Dashboard',
  data() {
    return {
      listData
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  }
}
</script>

<style lang="scss" scoped>
.header_title {
  font-size: 23px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 40px;
  text-align: center;
  color: #0058FF;
  letter-spacing: 10px;
  opacity: 1;
  margin-bottom: 20px;
}
::v-deep.el-card {
  border: 1px solid #E3E3E3;
  border-radius: 8px;
  min-height: 243px;
  .el-card__header {
    font-size: 18px;
    color: #333333;
    font-weight: 500;
    text-align: center;
    background: rgba(226, 235, 255, 0.39);
    opacity: 1;
  }
  .el-card__body {
    padding: 0px;
}
}
.posa{
  position: relative;
}
.savebtn{
  position: absolute;
  right:2%;
}
// .el-col {
//   margin-bottom: 20px;
// }
.text {
  // display: flex;
  padding: 10px 20px 10px 20px;
  border-bottom: 1px solid #E3E3E3;
  &:last-child {
    border-bottom: none;
  }
   .item_name ,.item_data ,.value_handle {
     height: 16px;
    line-height: 16px;
     margin-top: 12px;
    margin-bottom: 12px;
  }
  .item_name {
    width: 262px;
    height: 16px;
    line-height: 16px;
    color:#7E7E7E;
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .item_data{
   
  }
  .value_handle {
    color:red;
    margin-right: 10px;
   
  }
  .alarmbtn{
     margin-top: 6px;
    margin-bottom: 6px;
  }
  .el-card:last-child .text {
  
    border-bottom: none !important;
}
}
.text2 {
  // display: flex;
  padding: 10px 20px 10px 20px;
  border-bottom: 1px solid #E3E3E3;
  .item_name ,.item_data ,.value_handle {
     height: 16px;
    line-height: 16px;
     margin-top: 12px;
    margin-bottom: 12px;
  }
  .item_name {
    width: 262px;
    height: 16px;
    line-height: 16px;
    color:#7E7E7E;
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .item_data{
   
  }
  .value_handle {
    color:red;
    margin-right: 10px;
    min-width: 52px;
   
  }
  .alarmbtn{
     margin-top: 6px;
    margin-bottom: 6px;
  }
  .el-card:last-child .text {
  
    border-bottom: none !important;
}
}
 

</style>
