index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div>
  3. <head-bar :isBack="false">
  4. <template #title>
  5. <div style="width: 100%">
  6. <div class="rightSearch">
  7. <div class="searchImg" @click="selectAll1">
  8. <img src="../../assets/images/home/search.png" alt="" />
  9. </div>
  10. <el-input v-model="courseName" auto-complete="off" placeholder="搜索课程..."></el-input>
  11. </div>
  12. </div>
  13. </template>
  14. </head-bar>
  15. <class-filter @getAll="selectAll"> </class-filter>
  16. <course-all :courseList="zoneClass"></course-all>
  17. </div>
  18. </template>
  19. <script>
  20. import { selectTypeCourse2 } from '@/api/home'
  21. import { mapGetters } from 'vuex'
  22. import headBar from '@/components/headBar.vue'
  23. import classFilter from './components/classFilter.vue'
  24. import courseAll from './components/courseAll.vue'
  25. export default {
  26. components: {
  27. headBar,
  28. classFilter,
  29. courseAll
  30. },
  31. data() {
  32. return {
  33. courseName: '',
  34. zoneClass: []
  35. }
  36. },
  37. computed: {
  38. ...mapGetters(['userinfo'])
  39. },
  40. methods: {
  41. selectAll1(){
  42. this.selectAll({})
  43. },
  44. selectAll(tList) {
  45. var a = '',b = '',c = ''
  46. if (tList != undefined) {
  47. var typeList = Object.values(tList);
  48. a = typeList[0]
  49. b = typeList[2]
  50. c = typeList[1]
  51. }
  52. const params = {
  53. uid: this.userinfo.userid,
  54. oid: this.userinfo.organizeid,
  55. typea: a != undefined ? a : '',
  56. typeb: b != undefined ? a : '',
  57. typec: '',
  58. typed: c != undefined ? a : '',
  59. typeE: '',
  60. cu: '',
  61. cn: this.courseName,
  62. classid: this.userinfo.classid,
  63. org: this.userinfo.org,
  64. page: 1,
  65. pageSize: 10
  66. }
  67. selectTypeCourse2(params)
  68. .then(res => {
  69. this.zoneClass = res[0]
  70. })
  71. .catch(err => {
  72. console.log(err)
  73. })
  74. }
  75. },
  76. mounted() {
  77. this.selectAll()
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. /deep/.rightSearch {
  83. display: flex;
  84. flex-direction: row;
  85. width: 100%;
  86. height: 30px;
  87. position: relative;
  88. .searchImg {
  89. width: 20px;
  90. height: 20px;
  91. position: absolute;
  92. z-index: 9;
  93. top: 5px;
  94. left: 5px;
  95. > img {
  96. width: 100%;
  97. height: 100%;
  98. }
  99. }
  100. .el-input__inner {
  101. width: 100%;
  102. height: 30px;
  103. text-indent: 15px;
  104. line-height: 30px;
  105. }
  106. }
  107. </style>