|
|
@@ -43,6 +43,22 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="NPC-top-right">
|
|
|
+ <svg-icon
|
|
|
+ :style="{
|
|
|
+ color:
|
|
|
+ assessmentMode && data.unified_attrib && data.unified_attrib.topic_color
|
|
|
+ ? data.unified_attrib.topic_color
|
|
|
+ : 'rgba(0,0,0,0.65)',
|
|
|
+ }"
|
|
|
+ :title="convertText('语音测评')"
|
|
|
+ @click.stop="assessmentMode = !assessmentMode"
|
|
|
+ v-if="
|
|
|
+ !(data.property.is_enable_score && data.property.is_enable_score === 'false') &&
|
|
|
+ !data.audio_data.file_id
|
|
|
+ "
|
|
|
+ icon-class="icon-article-practice"
|
|
|
+ size="24"
|
|
|
+ />
|
|
|
<el-popover placement="right-start" width="60" trigger="click">
|
|
|
<ul class="show-obj-list">
|
|
|
<li v-if="colHasContent[0]" @click="handleShow('pinyin')">
|
|
|
@@ -302,18 +318,34 @@
|
|
|
<el-collapse-transition>
|
|
|
<template v-if="is_list">
|
|
|
<div v-if="data.new_word_list && data.new_word_list.length > 0" v-show="wordShow" class="NPC-word-list">
|
|
|
- <div v-if="data.audio_data.file_id" class="aduioLine-box">
|
|
|
- <AudioLine
|
|
|
- ref="audioLine"
|
|
|
- :audio-id="'newWordAudio' + indexStr"
|
|
|
- :mp3="data.audio_data.url"
|
|
|
- :get-cur-time="getCurTime"
|
|
|
- :ed="ed"
|
|
|
- type="audioLine"
|
|
|
- :attrib="data.unified_attrib"
|
|
|
- @handleListenRead="handleListenRead"
|
|
|
- :stop-audio="stopAudios"
|
|
|
- />
|
|
|
+ <div class="aduioLine-box" v-if="data.audio_data.file_id">
|
|
|
+ <div class="aduioLine-content">
|
|
|
+ <AudioLine
|
|
|
+ ref="audioLine"
|
|
|
+ :audio-id="'newWordAudio' + indexStr"
|
|
|
+ :mp3="data.audio_data.url"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :ed="ed"
|
|
|
+ type="audioLine"
|
|
|
+ :attrib="data.unified_attrib"
|
|
|
+ @handleListenRead="handleListenRead"
|
|
|
+ :stop-audio="stopAudios"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="aduioLine-right"
|
|
|
+ :style="{
|
|
|
+ color:
|
|
|
+ assessmentMode && data.unified_attrib && data.unified_attrib.topic_color
|
|
|
+ ? data.unified_attrib.topic_color
|
|
|
+ : 'rgba(0,0,0,0.65)',
|
|
|
+ }"
|
|
|
+ :title="convertText('语音测评')"
|
|
|
+ @click.stop="assessmentMode = !assessmentMode"
|
|
|
+ v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
|
+ >
|
|
|
+ <svg-icon icon-class="icon-article-practice" size="24" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<ul
|
|
|
v-if="isEnable(data.property.auto_wrap)"
|
|
|
@@ -339,11 +371,7 @@
|
|
|
]"
|
|
|
@click="changeWholeIndex(sItem.sIndex)"
|
|
|
:style="{
|
|
|
- paddingRight: !(data.property.is_enable_score && data.property.is_enable_score === 'false')
|
|
|
- ? isHasScore
|
|
|
- ? '254px'
|
|
|
- : '166px'
|
|
|
- : '',
|
|
|
+ paddingRight: assessmentMode ? (isShowScoreBtn ? (isHasScore ? '254px' : '166px') : '116px') : '',
|
|
|
}"
|
|
|
>
|
|
|
<template v-if="isMobile">
|
|
|
@@ -768,7 +796,14 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<el-button
|
|
|
- v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
|
+ v-if="
|
|
|
+ assessmentMode &&
|
|
|
+ answer &&
|
|
|
+ answer.answer_list &&
|
|
|
+ answer.answer_list[index][sIndex] &&
|
|
|
+ answer.answer_list[index][sIndex].recordList &&
|
|
|
+ answer.answer_list[index][sIndex].recordList.length > 0
|
|
|
+ "
|
|
|
type="text"
|
|
|
:class="[
|
|
|
'record-score-btn',
|
|
|
@@ -1229,7 +1264,14 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<el-button
|
|
|
- v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
|
+ v-if="
|
|
|
+ assessmentMode &&
|
|
|
+ answer &&
|
|
|
+ answer.answer_list &&
|
|
|
+ answer.answer_list[index][sIndex] &&
|
|
|
+ answer.answer_list[index][sIndex].recordList &&
|
|
|
+ answer.answer_list[index][sIndex].recordList.length > 0
|
|
|
+ "
|
|
|
type="text"
|
|
|
:class="[
|
|
|
'record-score-btn',
|
|
|
@@ -1836,6 +1878,8 @@ export default {
|
|
|
isHasScore: false, // 是否有录音评分分数
|
|
|
isRecord: false,
|
|
|
stopAudios: false,
|
|
|
+ assessmentMode: false, // 是否开启录音评分模式
|
|
|
+ isShowScoreBtn: false, // 是否显示评分按钮
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -1901,10 +1945,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.rowWidth += 180;
|
|
|
- if (!(this.data.property.is_enable_score && this.data.property.is_enable_score === 'false')) {
|
|
|
- // 有评分按钮
|
|
|
- this.rowWidth += 50;
|
|
|
- }
|
|
|
if (this.rowWidth < this.width - 2) {
|
|
|
this.rowWidth = this.width - 2;
|
|
|
}
|
|
|
@@ -1957,11 +1997,119 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.rowWidth += 180;
|
|
|
- if (!(this.data.property.is_enable_score && this.data.property.is_enable_score === 'false')) {
|
|
|
- // 有评分按钮
|
|
|
- this.rowWidth += 50;
|
|
|
+
|
|
|
+ this.rowWidth += 138; // 加上评分分数的宽度
|
|
|
+ if (this.rowWidth < this.width - 2) {
|
|
|
+ this.rowWidth = this.width - 2;
|
|
|
}
|
|
|
- this.rowWidth += 88; // 加上评分分数的宽度
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ isShowScoreBtn: {
|
|
|
+ handler(val) {
|
|
|
+ if (val && this.assessmentMode) {
|
|
|
+ // 如果有录音评分数据
|
|
|
+ let totalWidth = document.querySelector('.newWord-preview').clientWidth;
|
|
|
+ this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - 1}`;
|
|
|
+ this.rowWidth = 0;
|
|
|
+ this.data.col_width.forEach((item, index) => {
|
|
|
+ if (
|
|
|
+ this.data.property.pinyin_position &&
|
|
|
+ (this.data.property.pinyin_position === 'top' || this.data.property.pinyin_position === 'bottom')
|
|
|
+ ) {
|
|
|
+ if (index < 2) {
|
|
|
+ this.rowWidth = this.rowWidth > Number(item.value) ? this.rowWidth : Number(item.value);
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.rowWidth += 180;
|
|
|
+
|
|
|
+ // 有评分按钮
|
|
|
+ this.rowWidth += 50;
|
|
|
+ if (this.rowWidth < this.width - 2) {
|
|
|
+ this.rowWidth = this.width - 2;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果有录音评分数据
|
|
|
+ let totalWidth = document.querySelector('.newWord-preview').clientWidth;
|
|
|
+ this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - 1}`;
|
|
|
+ this.rowWidth = 0;
|
|
|
+ this.data.col_width.forEach((item, index) => {
|
|
|
+ if (
|
|
|
+ this.data.property.pinyin_position &&
|
|
|
+ (this.data.property.pinyin_position === 'top' || this.data.property.pinyin_position === 'bottom')
|
|
|
+ ) {
|
|
|
+ if (index < 2) {
|
|
|
+ this.rowWidth = this.rowWidth > Number(item.value) ? this.rowWidth : Number(item.value);
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.rowWidth += 180;
|
|
|
+ if (this.rowWidth < this.width - 2) {
|
|
|
+ this.rowWidth = this.width - 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ assessmentMode: {
|
|
|
+ handler(val) {
|
|
|
+ if (val && this.isShowScoreBtn) {
|
|
|
+ // 如果有录音评分数据
|
|
|
+ let totalWidth = document.querySelector('.newWord-preview').clientWidth;
|
|
|
+ this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - 1}`;
|
|
|
+ this.rowWidth = 0;
|
|
|
+ this.data.col_width.forEach((item, index) => {
|
|
|
+ if (
|
|
|
+ this.data.property.pinyin_position &&
|
|
|
+ (this.data.property.pinyin_position === 'top' || this.data.property.pinyin_position === 'bottom')
|
|
|
+ ) {
|
|
|
+ if (index < 2) {
|
|
|
+ this.rowWidth = this.rowWidth > Number(item.value) ? this.rowWidth : Number(item.value);
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.rowWidth += 180;
|
|
|
+ // 有评分按钮
|
|
|
+ this.rowWidth += 50;
|
|
|
+ if (this.rowWidth < this.width - 2) {
|
|
|
+ this.rowWidth = this.width - 2;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果有录音评分数据
|
|
|
+ let totalWidth = document.querySelector('.newWord-preview').clientWidth;
|
|
|
+ this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - 1}`;
|
|
|
+ this.rowWidth = 0;
|
|
|
+ this.data.col_width.forEach((item, index) => {
|
|
|
+ if (
|
|
|
+ this.data.property.pinyin_position &&
|
|
|
+ (this.data.property.pinyin_position === 'top' || this.data.property.pinyin_position === 'bottom')
|
|
|
+ ) {
|
|
|
+ if (index < 2) {
|
|
|
+ this.rowWidth = this.rowWidth > Number(item.value) ? this.rowWidth : Number(item.value);
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.rowWidth += 180;
|
|
|
if (this.rowWidth < this.width - 2) {
|
|
|
this.rowWidth = this.width - 2;
|
|
|
}
|
|
|
@@ -1992,10 +2140,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.rowWidth += 180;
|
|
|
- if (!(this.data.property.is_enable_score && this.data.property.is_enable_score === 'false')) {
|
|
|
- // 有评分按钮
|
|
|
- this.rowWidth += 50;
|
|
|
- }
|
|
|
if (this.rowWidth < this.width - 2) {
|
|
|
this.rowWidth = this.width - 2;
|
|
|
}
|
|
|
@@ -2023,10 +2167,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.rowWidth += 180;
|
|
|
- if (!(this.data.property.is_enable_score && this.data.property.is_enable_score === 'false')) {
|
|
|
- // 有评分按钮
|
|
|
- this.rowWidth += 50;
|
|
|
- }
|
|
|
// 如果有宽度为0且有内容的列,则行宽最小为撑满
|
|
|
if (this.rowWidth < this.width - 2) {
|
|
|
this.rowWidth = this.width - 2;
|
|
|
@@ -2097,6 +2237,8 @@ export default {
|
|
|
this.sentList = [];
|
|
|
this.showRecordScoreList = [];
|
|
|
this.isHasScore = false;
|
|
|
+ this.isShowScoreBtn = false;
|
|
|
+ this.assessmentMode = false;
|
|
|
this.showObj = {
|
|
|
pinyin: true,
|
|
|
newWord: true,
|
|
|
@@ -2260,6 +2402,7 @@ export default {
|
|
|
},
|
|
|
handleWav(list, tmIndex, tmsIndex) {
|
|
|
this.$set(this.answer.answer_list[tmIndex || 0][tmsIndex || 0], 'recordList', list);
|
|
|
+ this.isShowScoreBtn = true;
|
|
|
},
|
|
|
// 翻面
|
|
|
changeShowLeft(item) {
|
|
|
@@ -2415,6 +2558,7 @@ export default {
|
|
|
this.$set(scoreObj, 'singleText', singleText);
|
|
|
this.showRecordScoreList[index] = scoreObj;
|
|
|
this.isHasScore = true;
|
|
|
+ this.isShowScoreBtn = true;
|
|
|
},
|
|
|
recordScoreStyle(score) {
|
|
|
let style = {
|
|
|
@@ -2509,6 +2653,7 @@ export default {
|
|
|
});
|
|
|
this.showRecordScoreList = score;
|
|
|
this.isHasScore = true;
|
|
|
+ this.isShowScoreBtn = true;
|
|
|
this.whileRecordScoreList[this.wholeRecordIndex] = list;
|
|
|
},
|
|
|
getCurTimes(curTime) {
|
|
|
@@ -2552,7 +2697,30 @@ export default {
|
|
|
// margin-bottom: 24px;
|
|
|
|
|
|
.aduioLine-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
margin-bottom: 8px;
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 10%);
|
|
|
+
|
|
|
+ .aduioLine-content {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .aduioLine-right {
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 40px;
|
|
|
+ padding: 0 12px;
|
|
|
+ border-left: 1px solid rgba(0, 0, 0, 10%);
|
|
|
+
|
|
|
+ .svg-icon {
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.practiceBox {
|
|
|
@@ -2637,7 +2805,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.NPC-word-list {
|
|
|
- padding: 10px 0 0;
|
|
|
+ // padding: 10px 0 0;
|
|
|
border: 1px solid rgba(0, 0, 0, 10%);
|
|
|
border-radius: 4px;
|
|
|
}
|