templateList.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 { getEmployeeOrgan } from "@/api/buildTeam";
  39. export default {
  40. components: { pagination },
  41. data () {
  42. return {
  43. searchForm: {
  44. search: null
  45. },
  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. getEmployeeOrgan().then(res => {
  62. if (res.code == 200) {
  63. this.organList = res.data;
  64. }
  65. });
  66. // 获取分部
  67. this.init();
  68. },
  69. // activated () {
  70. // this.init();
  71. // },
  72. methods: {
  73. init () {
  74. },
  75. getList () { }
  76. }
  77. };
  78. </script>
  79. <style lang='scss' scoped>
  80. </style>