evaluateDetail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>评价详情
  5. </h2>
  6. <div class="m-core">
  7. <div class="left">
  8. <el-table
  9. style="width: 100%"
  10. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  11. :data="tableData"
  12. >
  13. <el-table-column align="center" prop="month" label="时间"></el-table-column>
  14. <el-table-column align="center" label="操作">
  15. <template slot-scope="scope">
  16. <div>
  17. <el-button type="text" @click="getReviews(scope.row.id)">查看</el-button>
  18. </div>
  19. </template>
  20. </el-table-column>
  21. </el-table>
  22. <!-- <pagination
  23. :total="rules.total"
  24. :page.sync="rules.page"
  25. :limit.sync="rules.limit"
  26. :page-sizes="rules.page_size"
  27. @pagination="getList"
  28. />-->
  29. </div>
  30. <div class="right" v-if="isLook">
  31. <el-card class="box-card">
  32. 评价详情
  33. <div class="cardWrap">
  34. <div class="cardWrapleft">
  35. <p class="title">授课内容</p>
  36. <el-divider></el-divider>
  37. <p class="row">评价时间:{{commitWrap.time }}</p>
  38. <p class="row">老师: {{commitWrap.teacher}}</p>
  39. <p class="row">声部:{{ commitWrap.soundName }}</p>
  40. <p class="row">训练次数:{{ commitWrap.count }}</p>
  41. <p class="row">训练时长:{{ commitWrap.timers }}</p>
  42. <p class="title">授课内容</p>
  43. <el-divider></el-divider>
  44. <p class="row">乐理:{{ musicTheory }}</p>
  45. <p class="row">曲子: {{ song}}</p>
  46. <p class="row">教材: {{teachingMaterial }}</p>
  47. </div>
  48. <div class="cardWrapright">
  49. <p class="title">点评</p>
  50. <el-divider></el-divider>
  51. <div v-if="version == 1">
  52. <p class="row" v-for="(item,index) in askList">{{index+1+':'+item}}</p>
  53. </div>
  54. <div v-if="version == 2">
  55. <p class="row" v-for="(item,index) in askList">{{item}}</p>
  56. </div>
  57. <!-- <div class="textWrap"></div> -->
  58. </div>
  59. </div>
  60. </el-card>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import pagination from "@/components/Pagination/index";
  67. import { getGroupReviews, getReviewsInfo } from "@/api/buildTeam";
  68. import { subjectJsonOld, subjectJson } from "@/utils/questionJson";
  69. export default {
  70. components: { pagination },
  71. data() {
  72. return {
  73. tableData: [],
  74. id: null,
  75. isLook: false,
  76. rules: {
  77. // 分页规则
  78. limit: 10, // 限制显示条数
  79. page: 1, // 当前页
  80. total: 0, // 总条数
  81. page_size: [10, 20, 40, 50] // 选择限制显示条数
  82. },
  83. subjectJsonOld: subjectJsonOld,
  84. subjectJson: subjectJson,
  85. askList: [],
  86. commitWrap: {
  87. time: "",
  88. teacher: "",
  89. soundName: "",
  90. count: "",
  91. timers: ""
  92. },
  93. version: null,
  94. musicTheory: null,
  95. teachingMaterial: null,
  96. song: null
  97. };
  98. },
  99. activated() {
  100. this.init();
  101. },
  102. created() {
  103. this.init();
  104. },
  105. methods: {
  106. init() {
  107. this.id = this.$route.query.id;
  108. this.evaluateId = this.$route.query.evaluateId;
  109. // 获取列表
  110. this.getList();
  111. // 获取评论详情
  112. if (this.evaluateId > 0) {
  113. this.getReviews(this.evaluateId);
  114. }
  115. },
  116. getList() {
  117. getGroupReviews({ groupId: this.id }).then(res => {
  118. if (res.code == 200) {
  119. // this.tableData = res.data.rows;
  120. // this.rules.total = res.data.total;
  121. this.tableData = res.data;
  122. }
  123. });
  124. },
  125. getReviews(id) {
  126. getReviewsInfo({ id: this.evaluateId }).then(res => {
  127. if (res.code == 200) {
  128. this.isLook = true;
  129. this.version = res.data.version;
  130. if (res.data.version == 1) {
  131. this.askList = res.data.item.split(",").map((item, index) => {
  132. return this.subjectJsonOld[index + 1][item];
  133. });
  134. } else if (res.data.version == 2) {
  135. // this.askList = res.data.item.split(",").map((item, index) => {
  136. // return this.subjectJson[index + 1][item];
  137. // });
  138. let some = {
  139. one: 1,
  140. two: 2,
  141. three: 3,
  142. four: 4,
  143. five: 5,
  144. six: 6,
  145. seven: 7,
  146. eight: 8
  147. };
  148. this.item = JSON.parse(res.data.item);
  149. console.log(this.item);
  150. this.askList = []
  151. for (let key in this.item) {
  152. switch (key) {
  153. case "one": {
  154. this.askList.push('1:'+this.subjectJson[1][this.item[key]])
  155. break;
  156. }
  157. case "two": {
  158. this.askList.push('2:'+this.subjectJson[2][this.item[key]])
  159. break;
  160. }
  161. case "three": {
  162. this.askList.push('3:'+this.subjectJson[3][this.item[key]])
  163. break;
  164. }
  165. case "four": {
  166. this.askList.push('4:'+this.subjectJson[4][this.item[key]])
  167. break;
  168. }
  169. case "five": {
  170. this.askList.push('5:'+this.subjectJson[5][this.item[key]])
  171. break;
  172. }
  173. case "six": {
  174. this.askList.push('6:'+this.subjectJson[6][this.item[key]])
  175. break;
  176. }
  177. case "seven":
  178. {
  179. this.askList.push('7:'+this.subjectJson[7][this.item[key]])
  180. break;
  181. }
  182. case "eight": {
  183. this.askList.push('8:'+this.subjectJson[8][this.item[key]])
  184. break;
  185. }
  186. }
  187. // this.askList.push(this.subjectJson[])
  188. }
  189. this.askList.sort((a,b)=>{
  190. return parseInt(a)-parseInt(b)
  191. })
  192. // console.log( this.askList)
  193. this.musicTheory = JSON.parse(res.data.musicTheory)
  194. .map(item => {
  195. return item.str;
  196. })
  197. .join(",");
  198. this.teachingMaterial = JSON.parse(res.data.teachingMaterial)
  199. .map(item => {
  200. return item.str;
  201. })
  202. .join(",");
  203. this.song = res.data.song;
  204. }
  205. this.commitWrap = {
  206. time: res.data.createTime,
  207. teacher: res.data.teacher,
  208. soundName: res.data.subjectName,
  209. count: res.data.times,
  210. timers: res.data.totalMinutes
  211. };
  212. }
  213. });
  214. }
  215. }
  216. };
  217. </script>
  218. <style lang="scss" scoped>
  219. .m-core {
  220. display: flex;
  221. flex-direction: row;
  222. .left {
  223. width: 550px;
  224. }
  225. .right {
  226. margin-left: 30px;
  227. min-width: 600px;
  228. .box-card {
  229. width: 100%;
  230. min-height: 500px;
  231. .cardWrap {
  232. display: flex;
  233. flex-direction: row;
  234. justify-content: space-between;
  235. width: 100%;
  236. margin-top: 30px;
  237. .row {
  238. line-height: 30px;
  239. font-size: 14px;
  240. }
  241. .title {
  242. text-align: center;
  243. }
  244. .cardWrapleft {
  245. width: 48%;
  246. }
  247. .cardWrapright {
  248. width: 48%;
  249. .textWrap {
  250. margin-top: 20px;
  251. width: 100%;
  252. border: 1px solid #999;
  253. min-height: 100px;
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. </style>