workList.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div id="leaveList">
  3. <el-row>
  4. <el-col :span="24" class="info">
  5. <el-col :span="24" class="list" v-for="(item, index) in workLists" :key="index">
  6. <el-col :span="14" class="time">
  7. <el-col>科目:{{ item.name }}</el-col>
  8. <el-col :span="24" class="anniu">
  9. <el-button v-if="item.display === 'second'" type="primary" size="small" @click="clickBtn(item.id)">在线作答</el-button>
  10. <el-button v-else type="primary" size="small" @click="clickzy(item.id)">上传作业</el-button>
  11. </el-col>
  12. </el-col>
  13. </el-col>
  14. </el-col>
  15. </el-row>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'leaveList',
  21. props: {
  22. workLists: null,
  23. names: null,
  24. display: { type: String, default: 'first' },
  25. },
  26. components: {},
  27. data: () => ({}),
  28. created() {},
  29. computed: {},
  30. methods: {
  31. clickBtn(id) {
  32. this.$router.push({ path: '/user/dati', query: { id: id } });
  33. },
  34. clickzy(id) {
  35. console.log(id);
  36. this.$router.push({ path: '/user/chuanzuoye', query: { id: id } });
  37. },
  38. },
  39. };
  40. </script>
  41. <style lang="less" scoped>
  42. p {
  43. padding: 0;
  44. margin: 0;
  45. }
  46. .info {
  47. min-height: 300px;
  48. }
  49. .list {
  50. width: 97%;
  51. padding: 0px 0px 0 70px;
  52. background-color: #fff;
  53. border-radius: 15px;
  54. margin: 0 5px 5px 5px;
  55. }
  56. .list .time {
  57. padding: 5px 0;
  58. }
  59. .list .ispass {
  60. padding: 20px 0;
  61. }
  62. .anniu {
  63. padding: 20px 0 0 0;
  64. }
  65. </style>