templateList.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>名字
  6. </h2>
  7. <div class="m-core">
  8. <el-form :inline="true"
  9. :model="searchForm">
  10. <el-form-item>
  11. <el-input v-model.trim="searchForm.search"
  12. @keyup.enter.native="search"
  13. placeholder></el-input>
  14. </el-form-item>
  15. </el-form>
  16. <div class="tableWrap">
  17. <el-table style="width: 100%"
  18. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  19. :data="tableList">
  20. <el-table-column align="center"
  21. prop="studentId"
  22. label="分部"></el-table-column>
  23. </el-table>
  24. <pagination :total="rules.total"
  25. :page.sync="rules.page"
  26. :limit.sync="rules.limit"
  27. :page-sizes="rules.page_size"
  28. @pagination="getList" />
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import axios from "axios";
  35. import { getToken } from "@/utils/auth";
  36. import pagination from "@/components/Pagination/index";
  37. import load from "@/utils/loading";
  38. import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
  39. export default {
  40. components: { pagination },
  41. data () {
  42. return {
  43. searchForm: {
  44. search: null
  45. },
  46. teacherList: [],
  47. tableList: [],
  48. organList: [],
  49. rules: {
  50. // 分页规则
  51. limit: 10, // 限制显示条数
  52. page: 1, // 当前页
  53. total: 0, // 总条数
  54. page_size: [10, 20, 40, 50] // 选择限制显示条数
  55. },
  56. };
  57. },
  58. //生命周期 - 创建完成(可以访问当前this实例)
  59. created () { },
  60. //生命周期 - 挂载完成(可以访问DOM元素)
  61. mounted () {
  62. getTeacher().then(res => {
  63. if (res.code == 200) {
  64. this.teacherList = res.data;
  65. }
  66. });
  67. getEmployeeOrgan().then(res => {
  68. if (res.code == 200) {
  69. this.organList = res.data;
  70. }
  71. });
  72. // 获取分部
  73. this.init();
  74. },
  75. // activated () {
  76. // this.init();
  77. // },
  78. methods: {
  79. init () {
  80. },
  81. getList () { }
  82. }
  83. };
  84. </script>
  85. <style lang='scss' scoped>
  86. </style>