<template>
  <div>
    <div class="refresh">
      <div class="refresh-icon">
        <i class="el-icon-refresh"></i>
        <span>刷新</span>
      </div>
    </div>
<!--    <div class="chart-container">-->
<!--      <div class="chart-instance">-->
<!--        <div>定时任务执行记录</div>-->
<!--        <lineChart />-->
<!--      </div>-->
<!--    </div>-->
    <div class="table-content">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="triggerTime" label="触发时间"> </el-table-column>
        <el-table-column prop="startTime" label="开始时间"> </el-table-column>
        <el-table-column prop="triggerMethod" label="触发方式">
        </el-table-column>
        <el-table-column prop="environment" label="执行环境"> </el-table-column>
        <el-table-column label="状态">
          <template slot-scope="scope">
            <div class="status-cell">
              <span class="status-icon success"></span>
              <span class="status-text">{{ scope.row.status }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="发送状态">
          <template slot-scope="scope">
            <div class="status-cell">
              <span class="status-icon pending"></span>
              <span class="status-text">{{ scope.row.sendStatus }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="executionTime" label="执行耗时">
        </el-table-column>
        <el-table-column fixed="right" label="操作">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import lineChart from "./lineChart.vue";
export default {
  components: {
    lineChart,
  },
  data() {
    return {
      value: "",
      tableData: [],
      currentPage: 1,
    };
  },
  methods: {
    handleClick(row) {
      this.$router.push({
        name: "Report",
      });
    },
    handleSizeChange() {},
    handleCurrentChange() {},
  },
};
</script>
<style scoped lang="scss">
.row {
  border-bottom: 1px solid #e3e8f2;
  display: flex;
  flex-direction: row-reverse;
  padding: 0 24px 8px 24px;
  .button {
    align-items: center;
    display: inline-flex;
  }
  .el-icon-setting {
    font-size: 14px;
    color: #343434;
    margin-left: 10px;
  }

  .el-button {
    height: 24px;
    line-height: 22px;
    padding: 0 12px;
    font-size: 12px;
  }
}
.refresh {
  display: flex;
  flex-direction: row-reverse;
  padding: 16px 24px;
  .refresh-icon {
    font-size: 12px;
    color: #343434;
    align-items: center;
    display: inline-flex;
  }
  span {
    font-size: 12px;
    color: #343434;
    margin-left: 10px;
  }
}
.chart-container {
  display: flex;

  .chart-instance {
    width: 100%;
    padding: 16px;
    border: 1px solid #e9f3fb;
    margin-right: 16px;
    &:last-of-type {
      margin-right: 0;
    }
  }
}
.trend-chart {
  display: flex;
  justify-content: space-between;
}
.select {
  color: #4f597f;
  font-size: 12px;
  padding-right: 8px;
}
.table-content {
  padding-top: 24px;
}

.status-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-icon.success {
  background-color: green; // 成功状态图标颜色
}

.status-icon.pending {
  background-color: gray; // 未发送状态图标颜色
}

.pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  text-align: right;
}
</style>
