|
@@ -0,0 +1,343 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!--
|
|
|
+ scoreDetailResult:星光大评分
|
|
|
+ voteDetailResult:投票
|
|
|
+ mutualSummary:互评
|
|
|
+ mutualDetailSummary:互评数据
|
|
|
+ -->
|
|
|
+ <div class="smart-wrap">
|
|
|
+ <p class="clt-type">{{ smartType.name }}:</p>
|
|
|
+ <template v-if="smartType.value === 'vote'">
|
|
|
+ <!-- <div v-for="(item, index) in scoreListNew" :key="index" style="margin-bottom: 10px;"> -->
|
|
|
+ 第{{ vote.round }}轮({{ vote.votes }}票)
|
|
|
+ <Icon title="查看评语" type="md-chatbubbles" size="17" color="#2EC7C9" @click="openComment('vote')" style="cursor: pointer; margin-top: 3px; margin-right: 5px;" />
|
|
|
+ <SmartVote :smartData="scoreListNew"></SmartVote>
|
|
|
+ <!-- </div> -->
|
|
|
+ </template>
|
|
|
+ <template v-else-if="smartType.value === 'score'">
|
|
|
+ <SmartScore :smartData="scoreListNew"></SmartScore>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div v-for="(item, index) in scoreListNew" :key="index" class="smart-list">
|
|
|
+ <p style="height: 21px;">
|
|
|
+ <Icon type="md-trophy" v-if="item.king" color="#ff880d" />
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span style="color: #2d8cf0;">{{ item.name }}</span>
|
|
|
+ <Icon type="md-chatbubbles" color="#2EC7C9" style="cursor: pointer;" @click="openComment('mutal', index, item)"
|
|
|
+ v-show="!smartRate.smartRateSummary.rateInfo.AnonyCandi" />
|
|
|
+ </p>
|
|
|
+ <p>平均得分:{{ item.result }}</p>
|
|
|
+ <img v-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork'" :src="item.material" @click="$hevueImgPreview(item.material)" />
|
|
|
+ <p v-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'IRS'" v-html="item.material" class="smart-material"></p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <StudentClient></StudentClient>
|
|
|
+ <Modal v-model="isComment" title="评语" :footer-hide="true">
|
|
|
+ <div class="mutal-info" v-if="mutalInfo">
|
|
|
+ <img v-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork'" :src="mutalInfo" />
|
|
|
+ <p v-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'IRS'" v-html="mutalInfo"></p>
|
|
|
+ </div>
|
|
|
+ <div v-for="(item, index) in showResult" :key="index" style="margin-bottom: 5px;">
|
|
|
+ <span style="color: #2d8cf0;">
|
|
|
+ {{ item.id === '-1' ? '别人给我的评语' : item.name }}
|
|
|
+ </span>:
|
|
|
+ <span>{{ item.details }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="!showResult.length">暂无评语</div>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import StudentClient from '@/view/classrecord/eventchart/StudentClient.vue'
|
|
|
+import SmartVote from './SmartVote.vue'
|
|
|
+import SmartScore from './SmartScore.vue'
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ StudentClient,
|
|
|
+ SmartVote,
|
|
|
+ SmartScore
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ recordInfo: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ smartRate: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ students: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ vote: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sas: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ scoreListNew: [],
|
|
|
+ showResult: [],
|
|
|
+ isComment: false,
|
|
|
+ allResult: [],
|
|
|
+ mutalInfo: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ smartType() {
|
|
|
+ let types = {
|
|
|
+ value: '',
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ if(this.smartRate.smartRateSummary.scoreDetailResult && Object.keys(this.smartRate.smartRateSummary.scoreDetailResult).length) {
|
|
|
+ types = {
|
|
|
+ value: 'score',
|
|
|
+ name: "星光大评分"
|
|
|
+ }
|
|
|
+ } else if(this.smartRate.smartRateSummary.voteDetailResult && Object.keys(this.smartRate.smartRateSummary.voteDetailResult).length) {
|
|
|
+ types = {
|
|
|
+ value: 'vote',
|
|
|
+ name: "投票"
|
|
|
+ }
|
|
|
+ } else if(this.smartRate.smartRateSummary.mutualSummary && Object.keys(this.smartRate.smartRateSummary.mutualSummary).length) {
|
|
|
+ types.value = 'mutual'
|
|
|
+ if(this.smartRate.smartRateSummary.mutualSummary.mutualType === 'All') {
|
|
|
+ types.name = "每人多件评分"
|
|
|
+ } else if(this.smartRate.smartRateSummary.mutualSummary.mutualType === 'Two') {
|
|
|
+ types.name = "随机分配互评"
|
|
|
+ } else {
|
|
|
+ types.name = "自评"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return types
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getSmartInfo()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getSmartInfo() {
|
|
|
+ let lists = []
|
|
|
+ let stuInfo = this.students.find(stu => stu.id === this.$store.state.userInfo.sub)
|
|
|
+ let seatID = stuInfo.seatID.toString()
|
|
|
+ if(this.smartType.value === 'vote') {
|
|
|
+ let objectInd = (this.vote.round - 1).toString()
|
|
|
+ lists = this.smartRate.smartRateSummary.meteor_VoteSummary[objectInd].sort((a, b) => {
|
|
|
+ return a.result - b.result
|
|
|
+ })
|
|
|
+ lists = lists.map(item => {
|
|
|
+ if(item.id === seatID) {
|
|
|
+ // id:'-1' 别人给自己的评语
|
|
|
+ this.allResult.push({
|
|
|
+ details: item.comment,
|
|
|
+ id: '-1',
|
|
|
+ name: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(item.result === lists[0].result) {
|
|
|
+ item.king = true
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ let voteSummary = [...this.smartRate.smartRateSummary.voteDetailResult[objectInd]]
|
|
|
+ this.allResult.push(voteSummary.find(item => {
|
|
|
+ return item.id === seatID
|
|
|
+ }))
|
|
|
+ } else {
|
|
|
+ let allResultList = {}
|
|
|
+ if(this.smartType.value === 'score') {
|
|
|
+ lists = this.smartRate.smartRateSummary.meteor_ScoreSummary.sort((a, b) => {
|
|
|
+ return a.result - b.result
|
|
|
+ })
|
|
|
+ let giveMe = lists.find(item => {
|
|
|
+ return item.id === seatID
|
|
|
+ })
|
|
|
+ if(giveMe) {
|
|
|
+ this.allResult.push({
|
|
|
+ details: giveMe.comment,
|
|
|
+ id: '-1',
|
|
|
+ name: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ allResultList = {...this.smartRate.smartRateSummary.scoreDetailResult}
|
|
|
+ } else if(this.smartType.value === 'mutual') {
|
|
|
+ lists = this.smartRate.smartRateSummary.mutualSummary.mutualResults.sort((a, b) => {
|
|
|
+ return b.result - a.result
|
|
|
+ })
|
|
|
+ allResultList = {...this.smartRate.smartRateSummary.mutualDetailSummary}
|
|
|
+ }
|
|
|
+ // 非通用作品&&互评,需要找出当前学生的内容
|
|
|
+ if(!lists[0].isGeneral && this.smartType.value === 'mutual') {
|
|
|
+ let s = lists.find(item => {
|
|
|
+ return item.id === seatID
|
|
|
+ })
|
|
|
+ if(this.smartRate.smartRateSummary.mutualSummary.materialInfos.length) {
|
|
|
+ let materialInfos = this.smartRate.smartRateSummary.mutualSummary.materialInfos.find(info => {
|
|
|
+ return info.id === s.id
|
|
|
+ })
|
|
|
+ // IRS:文字题 StudentWork:图片
|
|
|
+ if(this.smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork') {
|
|
|
+ s.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ } else {
|
|
|
+ s.material = materialInfos.material
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s.material = ''
|
|
|
+ }
|
|
|
+ lists = [s]
|
|
|
+ } else {
|
|
|
+ lists = lists.map(item => {
|
|
|
+ item.material = ''
|
|
|
+ if(item.result === lists[0].result) {
|
|
|
+ item.king = true
|
|
|
+ }
|
|
|
+ if(this.smartType.value === 'mutual' && this.smartRate.smartRateSummary.mutualSummary.materialInfos.length) {
|
|
|
+ let materialInfos = this.smartRate.smartRateSummary.mutualSummary.materialInfos.find(info => {
|
|
|
+ return info.id === item.id
|
|
|
+ })
|
|
|
+ // IRS:文字题 StudentWork:图片
|
|
|
+ if(this.smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork') {
|
|
|
+ item.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ } else {
|
|
|
+ item.material = materialInfos.material
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ let results = new Array(lists.length)
|
|
|
+ for (let i = 0; i < results.length; i++) {
|
|
|
+ results[i] = new Array()
|
|
|
+ }
|
|
|
+ for (let k in allResultList) {
|
|
|
+ let studentInfo = this.students.find(item => {
|
|
|
+ let kk = Number(k)
|
|
|
+ return item.seatID === kk
|
|
|
+ })
|
|
|
+ // 通用展示所有 && 自己写给别人的评语
|
|
|
+ if(lists[0].isGeneral || seatID === k) {
|
|
|
+ for (let j in allResultList[k]) {
|
|
|
+ let index = lists.findIndex(item => {
|
|
|
+ return item.id === j
|
|
|
+ })
|
|
|
+ if(index != -1) {
|
|
|
+ results[index].push({
|
|
|
+ details: allResultList[k][j],
|
|
|
+ id: k,
|
|
|
+ name: studentInfo.name
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if(!this.smartRate.smartRateSummary.rateInfo.AnonyCandi && allResultList[k][seatID]) {
|
|
|
+ // 互评为匿名,则不能看别人给自己的评语
|
|
|
+ let index = lists.findIndex(item => {
|
|
|
+ return item.id === seatID
|
|
|
+ })
|
|
|
+ if(index != -1) {
|
|
|
+ // id:'-1' 别人给自己的评语
|
|
|
+ let other = results[index].findIndex(item => {
|
|
|
+ return item.id === '-1'
|
|
|
+ })
|
|
|
+ if(other != -1) {
|
|
|
+ results[index][other].details = results[index][other].details + allResultList[k][seatID]
|
|
|
+ } else {
|
|
|
+ results[index].unshift({
|
|
|
+ details: allResultList[k][seatID],
|
|
|
+ id: '-1',
|
|
|
+ name: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.allResult = results
|
|
|
+ }
|
|
|
+ this.scoreListNew = lists
|
|
|
+ },
|
|
|
+ openComment(type, index, item) {
|
|
|
+ if(type === 'vote') {
|
|
|
+ this.showResult = [...this.allResult]
|
|
|
+ } else {
|
|
|
+ this.mutalInfo = ''
|
|
|
+ if(type === 'mutal') {
|
|
|
+ this.mutalInfo = item.material
|
|
|
+ }
|
|
|
+ this.showResult = [...this.allResult[index]]
|
|
|
+ }
|
|
|
+ this.isComment = true
|
|
|
+ },
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.smart-wrap {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: end;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .clt-type {
|
|
|
+ margin-right: 10px;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .smart-vote {
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.smart-list {
|
|
|
+ width: 150px;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 20px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ max-width: 150px;
|
|
|
+ max-height: 150px;
|
|
|
+ border: 1px solid #eeeeee;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .smart-material {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ width: 150px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+.mutal-info {
|
|
|
+ border-bottom: 1px #ccc dashed;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|