achieve.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div id="achieve">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <!-- <topInfo></topInfo> -->
  7. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  8. </el-col>
  9. <el-col :span="24" class="main">
  10. <achieves
  11. :peaceAchieveList="peaceAchieveList"
  12. @showBtn="showBtn"
  13. @showGuan="showGuan"
  14. @access="clickscore"
  15. :achieveList="achieveList"
  16. :show="show"
  17. :form="form"
  18. :score="score"
  19. :formscore="formscore"
  20. @clickDialog="clickAchieve"
  21. @submit="submitAchieve"
  22. ></achieves>
  23. </el-col>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. </template>
  28. <script>
  29. import NavBar from '@/layout/common/topInfo.vue';
  30. import achieves from '@/layout/class/achieve.vue';
  31. import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
  32. const { mapActions: mapStudent } = createNamespacedHelpers('student');
  33. export default {
  34. name: 'achieve',
  35. props: {},
  36. components: {
  37. NavBar, //头部导航
  38. achieves, //班级学生成绩列表
  39. },
  40. data: () => ({
  41. peaceAchieveList: [],
  42. // showPicker: false,
  43. // score: '',
  44. score: false,
  45. formscore: {},
  46. studid: '',
  47. achieveList: [
  48. {
  49. studentid: '刘裕',
  50. lesson: [
  51. {
  52. lessonid: '拓展训练',
  53. score: '20',
  54. },
  55. {
  56. lessonid: '简历制作',
  57. score: '20',
  58. },
  59. ],
  60. },
  61. {
  62. studentid: '刘裕',
  63. lesson: [
  64. {
  65. lessonid: '拓展训练',
  66. score: '20',
  67. },
  68. {
  69. lessonid: '简历制作',
  70. score: '20',
  71. },
  72. ],
  73. },
  74. ],
  75. show: false,
  76. form: {},
  77. title: '',
  78. isleftarrow: '',
  79. transitionName: 'fade',
  80. navShow: true,
  81. }),
  82. created() {
  83. this.search();
  84. },
  85. computed: {
  86. ...mapState(['user']),
  87. },
  88. mounted() {
  89. this.title = this.$route.meta.title;
  90. this.isleftarrow = this.$route.meta.isleftarrow;
  91. },
  92. watch: {
  93. $route(to, from) {
  94. this.title = to.meta.title;
  95. this.isleftarrow = to.meta.isleftarrow;
  96. },
  97. },
  98. methods: {
  99. ...mapStudent({ list: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
  100. async search() {
  101. let classid = this.user.classid;
  102. const res = await this.list({ classid });
  103. this.$set(this, `peaceAchieveList`, res.data);
  104. },
  105. showBtn(id) {
  106. this.$set(this, `studid`, id);
  107. this.score = true;
  108. },
  109. showGuan() {
  110. this.score = false;
  111. },
  112. async clickscore(formscore) {
  113. this.formscore.id = this.$route.query.id;
  114. let data = this.formscore;
  115. const ress = await this.updates(data);
  116. this.score = false;
  117. },
  118. clickAchieve() {
  119. this.show = true;
  120. },
  121. submitAchieve(form) {
  122. console.log(form);
  123. this.show = false;
  124. },
  125. },
  126. };
  127. </script>
  128. <style lang="less" scoped>
  129. .style {
  130. width: 100%;
  131. min-height: 667px;
  132. position: relative;
  133. background-color: #eeeeee;
  134. }
  135. .top {
  136. height: 46px;
  137. overflow: hidden;
  138. }
  139. .main {
  140. min-height: 570px;
  141. }
  142. </style>