<template>
  <div>
    <!-- 时间选择组件 -->
<!--    <div class="filter-container">-->
<!--      <el-date-picker-->
<!--        v-model="dateRange"-->
<!--        type="daterange"-->
<!--        range-separator="～"-->
<!--        start-placeholder="开始日期"-->
<!--        end-placeholder="结束日期"-->
<!--        value-format="yyyy-MM-dd"-->
<!--        :default-value="['', '']"-->
<!--      >-->
<!--      </el-date-picker>-->
<!--    </div>-->

    <!-- 表格 -->
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column type="index" label="序号"> </el-table-column>
      <el-table-column prop="operTime" label="操作时间"> </el-table-column>
      <el-table-column prop="operUser" label="操作人"> </el-table-column>
      <el-table-column prop="operType" label="操作类型"> </el-table-column>
      <el-table-column prop="operDetail" label="操作描述"> </el-table-column>
    </el-table>
    <div>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getData"
      />
    </div>
  </div>
</template>

<script>
import {taskLogListByTaskId} from "@/api/test/task";
export default {
  name: "operationRecords",
  mounted() {
    // 在这里进行数据预处理
    // console.log(this.taskId);
    this.getData();
  },
  data() {
    return {
      // 时间选择组件的默认值
      dateRange: ["", ""],
      // 表格数据（暂时为空）
      value: "",
      tableData: [],
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        id: null,
      },
    };
  },
  methods: {
    getData() {
      this.tableData=[]
      this.queryParams.id = this.$route.query.id;
      taskLogListByTaskId(this.queryParams).then(res => {
        this.tableData = res.rows;
        this.total = res.total;
      })
    },
  },
};
</script>

<style lang="scss" scoped>
.filter-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.el-icon-info {
  cursor: pointer;
}
.table-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}
</style>
