123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <div class="m-container">
- <el-page-header @back="onCancel"
- content="评价详情"></el-page-header>
- <div class="m-core">
- <div class="left">
- <el-table
- style="width: 100%"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- :data="tableData"
- >
- <el-table-column align="center" prop="month" label="时间"></el-table-column>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <div>
- <el-button type="text" @click="getReviews(scope.row.id)">查看</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- <pagination
- :total="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />-->
- </div>
- <div class="right" v-if="isLook">
- <el-card class="box-card">
- 评价详情
- <div class="cardWrap">
- <div class="cardWrapleft">
- <p class="title">课程信息</p>
- <el-divider></el-divider>
- <p class="row">评价时间:{{commitWrap.time | dateForMinFormat}}</p>
- <p class="row">老师: {{commitWrap.teacher}}</p>
- <p class="row">声部:{{ commitWrap.soundName }}</p>
- <p class="row">训练次数:{{ commitWrap.count }}</p>
- <p class="row">训练时长:{{ commitWrap.timers }}</p>
- <div v-if="version == 2">
- <p class="title">授课内容</p>
- <el-divider></el-divider>
- <p class="row">乐理:{{ musicTheory }}</p>
- <p class="row">曲子: {{ song}}</p>
- <p class="row">教材: {{teachingMaterial }}</p>
- </div>
-
- </div>
- <div class="cardWrapright">
- <p class="title">课程点评</p>
- <el-divider></el-divider>
- <div v-if="version == 1">
- <p class="row" v-for="(item,index) in askList" :key="index">{{subjectJsonOld[index+1].title+' : '+item}}</p>
- </div>
- <div v-if="version == 2">
- <p class="row" v-for="(item,index) in askList" :key="index">{{item}}</p>
- </div>
- <!-- <div class="textWrap"></div> -->
- </div>
- </div>
- </el-card>
- </div>
- </div>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import { getGroupReviews, getReviewsInfo } from "@/api/buildTeam";
- import { subjectJsonOld, subjectJson } from "@/utils/questionJson";
- export default {
- components: { pagination },
- data() {
- return {
- tableData: [],
- id: null,
- isLook: false,
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50] // 选择限制显示条数
- },
- subjectJsonOld: subjectJsonOld,
- subjectJson: subjectJson,
- askList: [],
- commitWrap: {
- time: "",
- teacher: "",
- soundName: "",
- count: "",
- timers: ""
- },
- version: null,
- musicTheory: null,
- teachingMaterial: null,
- song: null,
- Fsearch: null,
- Frules: null
- };
- },
- activated() {
- this.init();
- },
- created() {
- this.init();
- },
- methods: {
- init() {
- this.id = this.$route.query.id;
- this.evaluateId = this.$route.query.evaluateId;
- if (this.$route.query.search) {
- this.Fsearch = this.$route.query.search;
- }
- if (this.$route.query.rules) {
- this.Frules = this.$route.query.rules
- }
- // 获取列表
- this.getList();
- // 获取评论详情
- if (this.evaluateId > 0) {
- this.getReviews(this.evaluateId);
- }
- },
- getList() {
- getGroupReviews({ groupId: this.id }).then(res => {
- if (res.code == 200) {
- // this.tableData = res.data.rows;
- // this.rules.total = res.data.total;
- this.tableData = res.data;
- }
- });
- },
- getReviews(id) {
- getReviewsInfo({ id }).then(res => {
- if (res.code == 200) {
- this.isLook = true;
- this.version = res.data.version;
- if (res.data.version == 1) {
- this.askList = res.data.item.split(",").map((item, index) => {
- return this.subjectJsonOld[index + 1][item];
- });
- } else if (res.data.version == 2) {
- // this.askList = res.data.item.split(",").map((item, index) => {
- // return this.subjectJson[index + 1][item];
- // });
- let some = {
- one: 1,
- two: 2,
- three: 3,
- four: 4,
- five: 5,
- six: 6,
- seven: 7,
- eight: 8
- };
- this.item = JSON.parse(res.data.item);
- // console.log(this.item);
- this.askList = []
- for (let key in this.item) {
- switch (key) {
- case "one": {
- this.askList.push(this.subjectJson[1].title+' : '+this.subjectJson[1][this.item[key]])
- break;
- }
- case "two": {
- this.askList.push(this.subjectJson[2].title+' : '+this.subjectJson[2][this.item[key]])
- break;
- }
- case "three": {
- this.askList.push(this.subjectJson[3].title+' : '+this.subjectJson[3][this.item[key]])
- break;
- }
- case "four": {
- this.askList.push(this.subjectJson[4].title+' : '+this.subjectJson[4][this.item[key]])
- break;
- }
- case "five": {
- this.askList.push(this.subjectJson[5].title+' : '+this.subjectJson[5][this.item[key]])
- break;
- }
- case "six": {
- if(this.item['six']){
- this.askList.push(this.subjectJson[6].title+' : '+this.subjectJson[6][this.item[key]])
- }
-
- break;
- }
- case "seven":
- { if(this.item['seven']){
- this.askList.push(this.subjectJson[7].title+' : '+this.subjectJson[7][this.item[key]])
- }
-
- break;
- }
-
- case "eight": {
- if(this.item['eight']){
- this.askList.push(this.subjectJson[8].title+' : '+this.subjectJson[8][this.item[key]])
- }
-
- break;
- }
- }
-
- // this.askList.push(this.subjectJson[])
- }
- this.askList.sort((a,b)=>{
- return parseInt(a)-parseInt(b)
- })
- // console.log( this.askList)
- this.musicTheory = JSON.parse(res.data.musicTheory)
- .map(item => {
- return item.str;
- })
- .join(",");
- this.teachingMaterial = JSON.parse(res.data.teachingMaterial)
- .map(item => {
- return item.str;
- })
- .join(",");
- this.song = res.data.song;
- }
- this.commitWrap = {
- time: res.data.createTime,
- teacher: res.data.teacher&&res.data.teacher.name,
- soundName: res.data.subjectName,
- count: res.data.times,
- timers: res.data.totalMinutes
- };
- }
- });
- },
- onCancel(){
- this.$router.push({ path: '/operateManager/commentManager', query: { search: this.Fsearch, rules: this.Frules,activeIndex:'1' } })
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .m-core {
- display: flex;
- flex-direction: row;
- .left {
- width: 550px;
- }
- .right {
- margin-left: 30px;
- min-width: 600px;
- .box-card {
- width: 100%;
- min-height: 500px;
- .cardWrap {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- width: 100%;
- margin-top: 30px;
- .row {
- line-height: 30px;
- font-size: 14px;
- }
- .title {
- text-align: center;
- }
- .cardWrapleft {
- width: 48%;
- }
- .cardWrapright {
- width: 48%;
- .textWrap {
- margin-top: 20px;
- width: 100%;
- border: 1px solid #999;
- min-height: 100px;
- }
- }
- }
- }
- }
- }
- </style>
|