evaluateDetail.vue 8.7 KB

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