<template>
  <div class="dashboard-editor-container" style="background-color: #fff;">
    <el-row :gutter="10">
      <el-col :xs="24" :sm="17">
        <div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700;">本日打卡统计</div>
        <el-row :gutter="20">
          <el-col :xs="12" :sm="4"  style="display: flex; flex-direction: column;"> <panel-group @handleSetLineChartData="handleSetLineChartData" /><div style="width: 130px; text-align: center;">正常打卡</div></el-col>
          <el-col :xs="12" :sm="4"   > <panel-groupone @handleSetLineChartData="handleSetLineChartData" /><div style="width: 155px; text-align: center;">外勤</div></el-col>
          <el-col :xs="12" :sm="4"   > <panel-grouptwo @handleSetLineChartData="handleSetLineChartData" /><div style="width: 185px; text-align: center;">早退</div></el-col>
          <el-col :xs="12" :sm="4"   > <panel-groupther @handleSetLineChartData="handleSetLineChartData" /><div style="width: 200px; text-align: center;">迟到</div></el-col>
          <el-col :xs="12" :sm="4"   > <panel-groupfour @handleSetLineChartData="handleSetLineChartData" /><div style="width: 230px; text-align: center; color: #000;">缺卡</div></el-col>
        </el-row>
        <el-row :gutter="32" style="margin-top: 40px;">
          <el-col :xs="24" :sm="24" :lg="24"><div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700;">本周补卡申请/请假统计</div>
            <div class="chart-wrapper"> <line-chart :chart-data="lineChartData" /></div>
          </el-col>
          <!-- <el-col :xs="24" :sm="24" :lg="12">
            <div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700;">本周请假统计</div>
            <div class="chart-wrapper"><pie-chart /></div>
          </el-col> -->

        </el-row>
      </el-col>
      <el-col :xs="24" :sm="7">
        <el-row :gutter="10" style="margin-top: 0;padding-top: 0;">
          <el-col :xs="12" :sm="12"  :lg="24" ><div class="grid-content bg-purple">
          <div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700;">本月打卡记录</div>
          <panel-groupfiv @handleSetLineChartData="handleSetLineChartData" />
          </div>

          </el-col>
          <el-col :xs="12" :sm="12"  :lg="24" style="margin-top: -20px;">
           <!-- <div style="border-left: 3px solid #42B7EE;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700;">本周关注目标</div> -->
           <div class="bottom">
             <p><span>总计</span><span>23</span></p>
             <p><span>正常打卡</span><span>23</span></p>
             <p><span>缺卡</span><span>23</span></p>
             <p><span>早退</span><span>23</span></p>
             <p><span>迟到</span><span>23</span></p>
             <p><span>外勤</span><span>23</span></p>
           </div>
          </el-col>
        </el-row>
      </el-col>
      <el-col :xs="24" :sm="24"  :lg="12" >
         <div class="idnetw">
            <div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700; margin-bottom: 20px;">本月考勤统计</div>
           <el-table
               :data="tableData"
               stripe
               style="width: 100%">
               <el-table-column
                 prop="date"
                 label="姓名"
                >
               </el-table-column>
               <el-table-column
                 prop="name"
                 label="部门"
                >
               </el-table-column>
               <el-table-column
                 prop="address"
                 label="迟到" show-overflow-tooltip>
                 </el-table-column>
                 <el-table-column
                   prop="address"
                   label="早退" show-overflow-tooltip>
                   </el-table-column>
                   <el-table-column
                     prop="address"
                     label="旷工" show-overflow-tooltip>
                     </el-table-column>
                     <el-table-column
                       prop="address"
                       label="外勤" show-overflow-tooltip>
                       </el-table-column>
             </el-table>
         </div>
      </el-col>
      <el-col :xs="24" :sm="24"  :lg="12" >
         <div class="idnetw">
            <div style="border-left: 3px solid #0155C9;padding-left: 8px;color: #343434; font-size: 14px; font-weight: 700; margin-bottom: 20px;">本月补卡申请</div>
           <el-table
               :data="tableData"
               stripe
               style="width: 100%">
               <el-table-column
                 prop="date"
                 label="人员姓名"
                 >
               </el-table-column>
              <!-- <el-table-column
                 prop="name"
                 label="部门"
                 >
               </el-table-column> -->
               <el-table-column
                 prop="address"
                 label="补卡时间" show-overflow-tooltip>
               </el-table-column>
               <el-table-column
                 prop="address"
                 label="补卡理由" show-overflow-tooltip>
               </el-table-column>
               <el-table-column width="120" label="操作" align="center" class-name="small-padding fixed-width">
                 <template slot-scope="scope">
                   <div style="cursor: pointer;">
                     <span @click="handleTy(scope.row)" style="margin-right: 10px;color: #10D066;">同意</span>
                     <span @click="handleJj(scope.row)" style="color: #F12626;">驳回</span>
                   </div>

                   <!-- <el-button
                     size="mini"
                     type="text"

                   >同意</el-button> -->
                   <!-- v-if="scope.row.isPass==0" -->
                   <!-- <el-button
                     size="mini"
                     type="text"
                     @click="handleJj(scope.row)"
                   >驳回</el-button> -->
                 </template>
               </el-table-column>
             </el-table>
         </div>
      </el-col>

    </el-row>
  </div>
</template>

<script>
import PanelGroup from './dashboard/PanelGroup';
import PanelGroupone from './dashboard/PanelGroupone';
import PanelGrouptwo from './dashboard/PanelGrouptwo';
import PanelGroupther from './dashboard/PanelGroupther';
import PanelGroupfour from './dashboard/PanelGroupfour';
import PanelGroupfiv from './dashboard/PanelGroupfiv';
import LineChart from './dashboard/LineChart';
import RaddarChart from './dashboard/RaddarChart';
import PieChart from './dashboard/PieChart';
import BarChart from './dashboard/BarChart';
import BarChartone from './dashboard/BarChartone';

const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  },
  messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },
  purchases: {
    expectedData: [80, 100, 121, 104, 105, 90, 100],
    actualData: [120, 90, 100, 138, 142, 130, 130]
  },
  shoppings: {
    expectedData: [130, 140, 141, 142, 145, 150, 160],
    actualData: [120, 82, 91, 154, 162, 140, 130]
  }
};

export default {
  name: 'Index',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart,
    PanelGroupone,
    PanelGrouptwo,
    PanelGroupther,
    PanelGroupfour,
    PanelGroupfiv,
    BarChartone
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis,
      tableData: [{
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
              }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
              }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
              }, {
                date: '2016-05-03',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1516 弄'
              }]
    };
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type];
    }
  }
};
</script>
<style  lang="scss">
  .dashboard-editor-container{
    .el-row{
      box-shadow:none;
      -webkit-box-shadow:none;
    }
  }
  .idnetw{
    .el-table .el-table__header-wrapper th{
      background-color: #F1F1F1 !important;
      color: #343434 !important;
    }
  }
</style>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}
.anve{
  display: flex;
  flex-wrap: wrap;
  // width: 100%;
  p{
    // flex: 1;
    width: 30%;
    background-color: #DDE7EF;
    display: flex;
    flex-direction: column;
    padding:  11px 11px;
    border-radius: 5px;
    opacity: 0.7;
    margin: 0;
    margin-bottom: 8px;
    span:nth-child(2){
      font-size: 14px;
      font-family: PingFang SC;
      font-weight: bold;
      color: #000000;
      margin-top: 5px;
    }
  }
  p:nth-child(2){
    margin-left: 12px;
    margin-right: 12px;
  }
  p:nth-child(5){
    margin-left: 12px;
    margin-right: 12px;
  }
}
.actie{
    display: flex;
    p{
      // flex: 1;
      width: 30%;
      background-color: #DDE7EF;
      display: flex;
      flex-direction: column;
      padding:  11px 11px;
      // border-radius: 5px;
      opacity: 0.7;
      margin: 0;
      margin-bottom: 8px;
      text-align: center;

    }
    p:nth-child(1){
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      span:nth-child(2){
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: bold;
        color: #000000;
        margin-top: 5px;
        text-align: left;
      }
    }
    p:nth-child(2){
      // margin-left: 12px;
      // margin-right: 12px;
      padding-right: 0;
      padding-left: 18px;
      width: 34%;
      text-align: center;
      background-color: #F5F5F5;
    }
    p:nth-child(3){
      // margin-left: 12px;
      // margin-right: 12px;
      width: 34%;
      background-color: #F5F5F5;
    }
}
.bottom{
  p{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14;
    font-family: PingFang SC;
    font-weight: 400;
    color: #000000;
    background-color: #DDE7EF;
    opacity: 0.7;
    border-radius: 5px;
    padding: 9px 19px;
    span:nth-child(2){
      font-size: 14px;
      font-family: PingFang SC;
      font-weight: bold;
      color: #000000;
    }
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
