<template>
  <div class="entry-manager">
    <bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
    <div class="component-content screenSet" id="screenSet">
      <el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline">
        <el-col :span="6">
          <el-form-item label="入口名称：">
            <el-input size="small" v-model="formInline.name" placeholder="请输入名称"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="2">
        </el-col>
        <el-col :span="2">
          <el-button type="primary" size="small">查询</el-button>
        </el-col>
        <el-col :span="6" style="padding:0;text-align:right;padding-right:10px;">
          <el-button type="primary" size="small">新建入口</el-button>
        </el-col>
      </el-form>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="id" label="ID编号" align="center"></el-table-column>
        <el-table-column prop="project" label="入口名称" align="center"></el-table-column>
        <el-table-column prop="name" label="创建人" align="center"></el-table-column>
        <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
        <el-table-column prop="desc" label="入口介绍" align="center"></el-table-column>
        <el-table-column prop="startTime" label="开始时间" align="center"></el-table-column>
        <el-table-column prop="endTime" label="介绍时间" align="center"></el-table-column>
        <el-table-column fixed="right" label="状态" align="center">
          <template slot-scope="scope">{{ scope.row.status | shieldStatus }}</template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="150" align="center">
          <template slot-scope="scope">
            <el-button 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="formInline.pageNo"
          :page-sizes="[10, 20, 30, 100]"
          :page-size="formInline.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="totalRows"
        ></el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null;
export default {
  components: {
    BreadCrumb
  },
  data() {
    return {
      curmbFirst: "入口管理",
      totalRows: 0,
      formInline: {
        name: "",
        pageNo: 1,
        pageSize: 10
      },
      tableData: [
        {
          id: 123,
          project: "小何同学的项目",
          name: "小王同学",
          createTime: "2019-09-09",
          desc: "小王同学",
          startTime: "2019-10-10",
          endTime: "2019-12-10",
          status: 1
        }
      ]
    };
  },
  computed: {
    ...mapGetters(["_token"])
  },
  created() {
    vm = this;
  },
  mounted: function() {
    commonUtil.resizeHeight();
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.formInline.pageSize = val;
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.formInline.pageNo = val;
    }
  }
};
</script>
<style lang="scss">
.item-shield {
  .entry-manager {
    padding: 10px;
    background: #fff;
  }
}
</style>