<template>
    <section class="homeGT">
        <div class="htaTitle"><span class="TitleTab"><em v-for='(item,index) in titleArr' :key='index' @click='titleClick(item,index)' :class='inx==index?"active":""'>{{item.name}}</em></span><span class="more" @click='more'>查看更多>></span></div>
        <div class="htaBox">
            <div class="tableContent">
                <el-scrollbar style="height:100%"  class="scrollbarClass" :vertical="true">
                <el-table
                :data="tableData"
                style="width: 100%">
                 <el-table-column
                    prop="item_date"
                    min-width='100'
                    label="日期">
                </el-table-column>
                 <el-table-column
                    prop="item_time"
                    min-width='130'
                    label="时间">
                </el-table-column>
                <el-table-column
                    prop="item_per_duty_name"
                    label="值班人员"
                    width="80">
                </el-table-column>
                <!-- <el-table-column
                    prop="item_week"
                    label="星期"
                    width="80">
                </el-table-column>                -->
                <el-table-column
                    prop="item_phone"
                    min-width='120'
                    label="电话">
                </el-table-column>               
                 </el-table>
                 </el-scrollbar>
            </div>
        </div>
    </section>
</template>
<script>
export default {
    data(){
        return{
          titleArr:[
              {name:'7x24小时值班',type:1},
          ],
          inx:0,
          params:{//搜索条件
            pageIndex:1,
            pageSize:3,
            total:0
          },
          type:1,
          tableData:[],
        }
    },
    mounted() {
        this.duty24list()
    },
    methods: {
        titleClick(item,index){
           this.inx=index
           this.type=item.type
        },
        duty24list(){
            this.$api.duty24listApi(this.params,{
                onSucess: response => {
                    console.log(response)
                    this.tableData=response.data.data
                }
            })            
        },
        more(){
            if(this.type==1){
                 let appId='__yhRBKi7f6rkt9BhuVBM'
                let name='7x24小时值班'
                let flag=1
                this.$store.dispatch("loadMenus", {appId, name,flag});
            }         
        },
    },
}
</script>
<style lang="scss" scoped>
.homeGT{
    display: flex; 
    flex-direction: column;
    .htaTitle{
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        font-size: 18px;
        color: rgba(0, 0, 0, 0.85);
        padding: 16px;
        display: flex;
        align-items: center;
        .TitleTab{
          flex:1;
          em{
              margin-right: 15px;
              font-size: 16px;
              padding-bottom:16px;
              cursor: pointer;
              &.active{
                 border-bottom: 1px solid #0076f6;  
                 color: #0076f6;
              }
          }
        }
        .more{
            flex-wrap: 150px;
            font-size: 14px;
            cursor: pointer;
        }
    }
    .htaBox{
        padding: 16px 0 16px 16px;
        ul{
            display: flex;
            flex-wrap: wrap;
            align-content: flex-start;
            
            li{
                background: #fff;
                width: 140px;
                height: 100px;
                border-radius: 4px;
                display: flex;
                flex-direction: column;
                padding: 16px;
                margin-right:16px;
                margin-bottom: 16px;
                align-items: center;
                text-align: center;
                span{
                  margin-bottom: 8px;  
                   img{
                     width: 48px;
                     height:48px;
                   }
                   strong{                      
                       color: rgba(0, 0, 0, 0.85);
                       font-size: 14px;
                       font-weight: normal;
                   }
                }
            }
        }
    }

    .scrollbarClass .el-scrollbar__wrap{
       overflow: scroll;
       height: calc(100% + 20px); //多出来的20px是横向滚动条默认的样式       
    }
    
  
}
</style>