templateList.vue 2.0 KB

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