CurriculaManager.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div class="curricula-manager">
  3. <div class="curricula-manager-header">
  4. <el-input v-model="input" placeholder="请输入" suffix-icon="el-icon-search"> </el-input>
  5. </div>
  6. <div class="curricula-manager-body">
  7. <div class="curricula-manager-body1">
  8. <el-button
  9. @click="click(item.status, index)"
  10. :class="background == index ? 'changeColor' : 'bgcolor'"
  11. v-for="(item, index) in statusList"
  12. :key="index"
  13. >
  14. {{ item.val }}
  15. </el-button>
  16. </div>
  17. <div class="sort">
  18. <span>排序:</span>
  19. <div class="sort-body" v-for="item in sortList" :key="item.id">
  20. {{ item.name }}
  21. <i class="el-icon-sort"></i>
  22. </div>
  23. </div>
  24. <div class="curricula-manager-body2">
  25. <el-button class="bgcolor" @click="add()">新建课程</el-button>
  26. </div>
  27. </div>
  28. <div class="curricula-manager-foot">
  29. <div v-for="(item, inx) in taskList" :key="inx">
  30. <div v-if="item.status == isstatus" class="circulation">
  31. <div class="curricula-manager-foot1">
  32. <span>{{ item.subject }}</span>
  33. <span>{{ item.val }}</span>
  34. </div>
  35. <div class="curricula-manager-foot2">
  36. <span>{{ item.createTime }}</span>
  37. <span class="curricula-manager-foot3">{{ item.onclassTime }}</span>
  38. <span class="curricula-manager-foot3">授课教师:{{ item.teacher }}</span>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'CurriculaManager',
  48. data() {
  49. return {
  50. input: '',
  51. background: 0,
  52. isstatus: 1,
  53. sortList: [
  54. {
  55. id: '1',
  56. name: '创建时间',
  57. sortType: 'createTime', // 数组对象中的哪一个属性进行排序
  58. order: false //升序还是降序
  59. },
  60. {
  61. id: '2',
  62. name: '编辑时间',
  63. sortType: 'editTime',
  64. order: false
  65. },
  66. {
  67. id: '3',
  68. name: '开课时间',
  69. sortType: 'onclassTime',
  70. order: false
  71. }
  72. ],
  73. statusList: [
  74. {
  75. status: '1',
  76. val: '进行中'
  77. },
  78. {
  79. status: '2',
  80. val: '待开始'
  81. },
  82. {
  83. status: '3',
  84. val: '已结束'
  85. }
  86. ],
  87. taskList: [
  88. {
  89. subject: '中文 轻松学中文初段 暑假 0813',
  90. createTime: '2021/3/28',
  91. onclassTime: '2021/4/25',
  92. teacher: '张一三',
  93. val: '进行中',
  94. status: '1'
  95. },
  96. {
  97. subject: '中文 轻松学中文初段 暑假 0813',
  98. createTime: '2021/3/12',
  99. onclassTime: '2021/4/23',
  100. teacher: '张一三',
  101. val: '进行中',
  102. status: '1'
  103. },
  104. {
  105. subject: '中文 轻松学中文初段 暑假 0813',
  106. createTime: '2021/3/22',
  107. onclassTime: '2021/4/17',
  108. teacher: '张一三',
  109. val: '已结束',
  110. status: '3'
  111. },
  112. {
  113. subject: '中文 轻松学中文初段 暑假 0813',
  114. createTime: '2021/3/2',
  115. onclassTime: '2021/4/28',
  116. teacher: '张一三',
  117. val: '待开始',
  118. status: '2'
  119. },
  120. {
  121. subject: '中文 轻松学中文初段 暑假 0813',
  122. createTime: '2021/3/6',
  123. onclassTime: '2021/4/1',
  124. teacher: '张一三',
  125. val: '进行中',
  126. status: '1'
  127. },
  128. {
  129. subject: '中文 轻松学中文初段 暑假 0813',
  130. createTime: '2021/3/19',
  131. onclassTime: '2021/4/9',
  132. teacher: '张一三',
  133. val: '已结束',
  134. status: '3'
  135. },
  136. {
  137. subject: '中文 轻松学中文初段 暑假 0813',
  138. createTime: '2021/3/16',
  139. onclassTime: '2021/4/25',
  140. teacher: '张一三',
  141. val: '待开始',
  142. status: '2'
  143. },
  144. {
  145. subject: '中文 轻松学中文初段 暑假 0813',
  146. createTime: '2021/3/21',
  147. onclassTime: '2021/4/11',
  148. teacher: '张一三',
  149. val: '进行中',
  150. status: '1'
  151. }
  152. ]
  153. };
  154. },
  155. methods: {
  156. click(status, index) {
  157. this.isstatus = status;
  158. this.background = index;
  159. console.log(status);
  160. console.log(index);
  161. },
  162. add() {
  163. console.log(123);
  164. }
  165. }
  166. };
  167. </script>
  168. <style lang="scss">
  169. .curricula-manager {
  170. .changeColor {
  171. background: #e5e5e5;
  172. border: 1px solid #e5e5e5;
  173. border-radius: 0;
  174. color: #0c0c0c;
  175. margin-bottom: 20px;
  176. }
  177. .curricula-manager-header .el-input {
  178. width: 365px;
  179. margin-top: 50px;
  180. margin-left: 359px;
  181. }
  182. .curricula-manager-body1 .el-button {
  183. width: 145px;
  184. height: 75px;
  185. font-size: 20px;
  186. margin-top: 50px;
  187. margin-left: 325px;
  188. }
  189. .bgcolor {
  190. background: #c4c4c4;
  191. border: 1px solid #c4c4c4;
  192. border-radius: 0;
  193. color: #0c0c0c;
  194. margin-bottom: 20px;
  195. }
  196. .el-button + .el-button {
  197. margin-left: 0;
  198. }
  199. .sort {
  200. display: flex;
  201. margin-top: 30px;
  202. margin-bottom: -35px;
  203. .sort-body {
  204. margin-left: 20px;
  205. }
  206. }
  207. .curricula-manager-body {
  208. .curricula-manager-body2 {
  209. margin-top: 5px;
  210. margin-left: 930px;
  211. }
  212. }
  213. .curricula-manager-foot {
  214. .circulation {
  215. margin: 0 0 20px 0;
  216. width: 1030px;
  217. height: 100px;
  218. background-color: #eee;
  219. padding: 20px 20px 0 20px;
  220. }
  221. .curricula-manager-foot1 {
  222. display: flex;
  223. justify-content: space-between;
  224. }
  225. .curricula-manager-foot2 {
  226. padding: 20px 0 0 0;
  227. }
  228. .curricula-manager-foot3 {
  229. margin-left: 20px;
  230. }
  231. }
  232. }
  233. </style>