<template>
    <section class="homeRTGT">
        <div class="htaTitle">
            <span class="TitleName"><i></i><strong>挂图作战</strong></span>
            <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'>更多<img src="~@/assets/images/RTImgs/moreicon.png"></span></div>
        <div class="htaBoxGT">
            <div class="tableContent" v-if='type==1'>
                <el-scrollbar class="scrollbarClass">
                   <div class="gtsectionUl">
                       <li v-for="(item,index) in tableData" :key='index'>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="item.item_progress"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong :title='item.item_task_name'>{{item.item_task_name}}</strong>
                                    <em>责任人：<i>{{item.item_per_name}}</i></em>
                                    <em>责任部门：<i>{{item.item_departname}}</i></em>
                                    <em>计划时间：<i>{{item.item_granttime}}</i></em>
                                </span>
                                <span class="elStatus"><i>{{item.item_priority}}</i></span>
                           </span>
                       </li>   

                       <!-- <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong>标题测试信息标题测试信息标</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li>

                       <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong>标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息2</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li>

                       <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong>标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息3</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li> -->
                   </div>
                 </el-scrollbar>
            </div>

            <div class="tableContent" v-if='type==2'>
                 <el-scrollbar class="scrollbarClass">
                   <div class="gtsectionUl">                       
                       <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong title='555'>标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息1</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li> 
                       
                                          
                   </div>
                 </el-scrollbar>
            </div>

            <div class="tableContent" v-if='type==3'>
                 <el-scrollbar class="scrollbarClass">
                   <div class="gtsectionUl">
                       <li v-for="(item,index) in tableData3" :key='index'>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="item.item_progress"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong :title='item.item_task_name'>{{item.item_task_name}}</strong>
                                    <em>责任人：<i>{{item.item_person_name}}</i></em>
                                    <em>责任部门：<i>{{item.item_depart_name}}</i></em>
                                    <em>计划时间：<i>{{item.item_granttime}}</i></em>
                                </span>
                                <span class="elStatus"><i>{{item.item_priority}}</i></span>
                           </span>
                       </li> 

                       <!-- <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong title='555'>题测试信息标题测试信息标题测试信息标题测试信息1</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li> 
                       <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong title='555'>标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息标题测试信息1</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li> 

                       <li>
                           <span class="flexspan">
                                <span class="elprogreeLeft"><el-progress type="circle" :percentage="25"></el-progress></span>
                                <span class="elcontentRight">
                                    <strong title='555'>标息标题测试信息标题测试信息标题测试信息1</strong>
                                    <em>责任人：555</em>
                                    <em>责任部门：555</em>
                                    <em>计划时间：555</em>
                                </span>
                                <span class="elStatus"><i>一般</i></span>
                           </span>
                       </li>  -->
                   </div>
                 </el-scrollbar>
            </div>
        </div>
    </section>
</template>
<script>
export default {
    data(){
        return{
          titleArr:[
              {name:'集团督办事项',type:3},
              {name:'年度工作要点',type:1},
            //   {name:'绩效任务指标',type:2},
              
          ],
          inx:0,
          params:{//搜索条件
            pageIndex:1,
            pageSize:3,
            total:0
          },
          type:3,
          tableData:[],
          tableData2:[],
          tableData3:[]
        }
    },
    mounted() {
        this.ndgzydlist()
        this.jdzhyjlist()
        this.dzdbsxlist()
    },
    methods: {
        titleClick(item,index){
           this.inx=index
           this.type=item.type
        },
        ndgzydlist(){
            this.$api.ndgzydlistApi(this.params,{
                onSucess: response => {
                    console.log(response)
                    this.tableData=response.data.data
                }
            })            
        },
        jdzhyjlist(){
            this.$api.jdzhyjlistApi(this.params,{
                onSucess: response => {
                    console.log(response)
                    this.tableData2=response.data.data
                }
            })            
        },
        dzdbsxlist(){
            this.$api.dzdbsxlistApi(this.params,{
                onSucess: response => {
                    console.log(response)
                    this.tableData3=response.data.data
                }
            })            
        },
        more(){
            if(this.type==1){
                 let appId='__2oNwctJi6ZtNyy6reZt'
                let name='年度工作要点'
                let flag=1
                this.$store.dispatch("loadMenus", {appId, name,flag});
            }else if(this.type==2){
                let appId='__2oNwctJi6ZtNyy6reZt'
                let name='绩效任务指标'
                let flag=1
                this.$store.dispatch("loadMenus", {appId, name,flag});
            }else if(this.type==3){
                let appId='__bz3qqsT3rMFguVhywxN'
                let name='集团督办事项'
                let flag=1
                this.$store.dispatch("loadMenus", {appId, name,flag});
            }            
        },
    },
}
</script>
<style lang="scss" scoped>
.homeRTGT{
    display: flex; 
    flex-direction: column;
    background: #fff;
    box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    .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;
        .TitleName{
            display: flex;
            align-items: center;
            margin-right: 40px;
            i{
                width: 2px;
                height: 18px;
                background: #0E71FF;
                margin-right:4px;
            }
            strong{color: rgba(0, 0, 0, 0.85);font-size: 16px;}
        }
        .TitleTab{
          flex:1;
          em{
              margin-right: 15px;
              font-size: 16px;
              padding-bottom:16px;
              cursor: pointer;
              &.active{
                 border-bottom: 2px solid #0076f6;  
                 color: #0076f6;
              }
          }
        }
        .more{
            flex-wrap: 150px;
            font-size: 14px;
            cursor: pointer;
            color: rgba(0, 0, 0, 0.45);
             display: flex;
            align-items: center;
        }
    }
    .htaBoxGT{
        padding: 0;
        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!important;
            height: calc(100% + 20px)!important; //多出来的20px是横向滚动条默认的样式       
        }
        .el-table--scrollable-x .el-table__body-wrapper{overflow-x: hidden!important;;}
    }
}

.gtsectionUl{
    width: 100%;
    overflow: auto;
    display: flex;
    white-space: nowrap;
    padding: 16px 0 16px 0;
    li{
        display: inline;
        float: left;
        box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        border: 1px solid #E9E9E9;
        margin-right: 16px;
        padding: 16px;
        position: relative;
        width: 553px;
        .flexspan{
           display: inline-block;
           float: left;
           width: 553px;
           .elprogreeLeft{ display: inline; float: left;width: 130px;}
           .elcontentRight{
               display: inline;
               float: left;
               width: 380px;       
               margin-left:12px;
               strong{
                   font-weight: 500;
                    color: rgba(0, 0, 0, 0.85);
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    width: 98%;
                    margin-bottom: 7px;
                    font-weight: bold;
                    margin-top: 16px;
                    display: block;
               }
               em{
                 color: rgba(0, 0, 0, 0.65);
                 font-size: 14px;
                 margin-bottom: 8px;
                 display: block;
                 i{
                     font-weight: 400;
                     color: rgba(0, 0, 0, 0.85);
                 }
               }
           }
           .elStatus{
               position: absolute;
               right:0;
               bottom: 12px;
               background: #FFBF00;
               border-radius: 100px 0px 0px 100px;
               color: #fff;
               padding: 5px 12px;
           }
        }
    }
}
</style>