|
@@ -6,7 +6,7 @@
|
|
|
:class="[
|
|
|
themeColor.length === 0 || themeColor === 'red'
|
|
|
? 'serial-number'
|
|
|
- : `serial-number-${themeColor}`,
|
|
|
+ : `serial-number-${themeColor}`
|
|
|
]"
|
|
|
>
|
|
|
{{ curQue.voiceMatrix.audioSerialNumber }}
|
|
@@ -22,7 +22,7 @@
|
|
|
:class="[
|
|
|
'Repeat-16',
|
|
|
'audio-simple-repeat',
|
|
|
- isRepeat ? '' : 'disabled',
|
|
|
+ isRepeat ? '' : 'disabled'
|
|
|
]"
|
|
|
@click="isRepeat = !isRepeat"
|
|
|
/>
|
|
@@ -45,7 +45,7 @@
|
|
|
v-if="curQue.voiceMatrix.matrix.length > 0"
|
|
|
class="matrix"
|
|
|
:style="{
|
|
|
- 'grid-template': `36px repeat(${curQue.voiceMatrix.matrix.length}, auto) minmax(36px, 1fr) / 36px repeat(${curQue.voiceMatrix.matrix[0].length}, auto) minmax(36px, 1fr)`,
|
|
|
+ 'grid-template': `36px repeat(${curQue.voiceMatrix.matrix.length}, auto) minmax(36px, 1fr) / 36px repeat(${curQue.voiceMatrix.matrix[0].length}, auto) minmax(36px, 1fr)`
|
|
|
}"
|
|
|
@mouseleave="clearSelectCell"
|
|
|
>
|
|
@@ -60,7 +60,7 @@
|
|
|
(selectColumn === i ||
|
|
|
(selectedLine.type === 'column' && selectedLine.index === i))
|
|
|
? 'read'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@mouseenter="checkboxMouseenter(selectColumn === i, 'column')"
|
|
|
>
|
|
@@ -76,7 +76,7 @@
|
|
|
`matrix-checkbox-row-${themeColor}`,
|
|
|
selectedLine.type === 'column' && selectedLine.index === i
|
|
|
? 'active'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@click="selectRowOrColumn(i, 'column')"
|
|
|
/>
|
|
@@ -93,7 +93,7 @@
|
|
|
(selectRow === i ||
|
|
|
(selectedLine.type === 'row' && selectedLine.index === i))
|
|
|
? 'read'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@mouseenter="checkboxMouseenter(selectRow === i, 'row')"
|
|
|
>
|
|
@@ -107,7 +107,7 @@
|
|
|
`matrix-checkbox-column-${themeColor}`,
|
|
|
selectedLine.type === 'row' && selectedLine.index === i
|
|
|
? 'active'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@click="selectRowOrColumn(i, 'row')"
|
|
|
/>
|
|
@@ -131,7 +131,7 @@
|
|
|
(i === 0 && curQue.voiceMatrix.firstLineHighlight) ||
|
|
|
(j === row.length - 1 && curQue.voiceMatrix.lastColumnHighlight)
|
|
|
? `highlight-${themeColor}`
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@mouseenter="matrixCellMouseenter(i, j, column.type)"
|
|
|
>
|
|
@@ -153,7 +153,7 @@
|
|
|
column.lrc_data.end_time === -1)
|
|
|
? 'playing'
|
|
|
: '',
|
|
|
- column.isTitle ? 'title' : '',
|
|
|
+ column.isTitle ? 'title' : ''
|
|
|
]"
|
|
|
@click="matrixCellClick(i, j)"
|
|
|
>
|
|
@@ -167,7 +167,7 @@
|
|
|
'connection',
|
|
|
i === 0 && curQue.voiceMatrix.firstLineHighlight
|
|
|
? `highlight-bc-${themeColor}`
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
/>
|
|
|
<!-- 分词 -->
|
|
@@ -188,27 +188,55 @@
|
|
|
column.lrc_data.end_time === -1)
|
|
|
? 'playing'
|
|
|
: '',
|
|
|
- column.isTitle ? 'title' : '',
|
|
|
+ column.isTitle ? 'title' : ''
|
|
|
]"
|
|
|
:style="{
|
|
|
- 'grid-template-columns': `repeat(${column.sentence_data.wordsList.length}, auto)`,
|
|
|
+ 'grid-template-columns': `repeat(${column.sentence_data.wordsList.length}, auto)`
|
|
|
}"
|
|
|
@click="matrixCellClick(i, j)"
|
|
|
>
|
|
|
- <template v-for="({pinyin, chs}, w) in column.sentence_data.wordsList">
|
|
|
+ <template
|
|
|
+ v-for="({ pinyin, chs }, w) in column.sentence_data.wordsList"
|
|
|
+ >
|
|
|
<span
|
|
|
- :key="`${column.sentence_data.pyPosition === 'top' ? 'pinyin' : 'chs'}-${w}`"
|
|
|
- :class="column.sentence_data.pyPosition === 'top' ? 'pinyin' : 'chs'"
|
|
|
+ :key="
|
|
|
+ `${
|
|
|
+ column.sentence_data.pyPosition === 'top'
|
|
|
+ ? 'pinyin'
|
|
|
+ : 'chs'
|
|
|
+ }-${w}`
|
|
|
+ "
|
|
|
+ :class="
|
|
|
+ column.sentence_data.pyPosition === 'top'
|
|
|
+ ? 'pinyin'
|
|
|
+ : 'chs'
|
|
|
+ "
|
|
|
>
|
|
|
- {{ column.sentence_data.pyPosition === 'top' ? pinyin : chs }}
|
|
|
+ {{
|
|
|
+ column.sentence_data.pyPosition === "top" ? pinyin : chs
|
|
|
+ }}
|
|
|
</span>
|
|
|
</template>
|
|
|
- <template v-for="({pinyin, chs}, w) in column.sentence_data.wordsList">
|
|
|
+ <template
|
|
|
+ v-for="({ pinyin, chs }, w) in column.sentence_data.wordsList"
|
|
|
+ >
|
|
|
<span
|
|
|
- :key="`${column.sentence_data.pyPosition === 'top' ? 'chs' : 'pinyin'}-${w}`"
|
|
|
- :class="column.sentence_data.pyPosition === 'top' ? 'chs' : 'pinyin'"
|
|
|
+ :key="
|
|
|
+ `${
|
|
|
+ column.sentence_data.pyPosition === 'top'
|
|
|
+ ? 'chs'
|
|
|
+ : 'pinyin'
|
|
|
+ }-${w}`
|
|
|
+ "
|
|
|
+ :class="
|
|
|
+ column.sentence_data.pyPosition === 'top'
|
|
|
+ ? 'chs'
|
|
|
+ : 'pinyin'
|
|
|
+ "
|
|
|
>
|
|
|
- {{ column.sentence_data.pyPosition === 'top' ? chs : pinyin }}
|
|
|
+ {{
|
|
|
+ column.sentence_data.pyPosition === "top" ? chs : pinyin
|
|
|
+ }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -230,7 +258,7 @@
|
|
|
column.lrc_data.end_time === -1)
|
|
|
? 'playing'
|
|
|
: '',
|
|
|
- column.isTitle ? 'title' : '',
|
|
|
+ column.isTitle ? 'title' : ''
|
|
|
]"
|
|
|
@click="matrixCellClick(i, j)"
|
|
|
>
|
|
@@ -261,7 +289,7 @@
|
|
|
column.lrc_data.end_time === -1)
|
|
|
? 'playing'
|
|
|
: '',
|
|
|
- column.isTitle ? 'title' : '',
|
|
|
+ column.isTitle ? 'title' : ''
|
|
|
]"
|
|
|
@click="matrixCellClick(i, j)"
|
|
|
>
|
|
@@ -286,7 +314,7 @@
|
|
|
(selectRow === i ||
|
|
|
(selectedLine.type === 'row' && selectedLine.index === i))
|
|
|
? 'read'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@mouseenter="clearSelectCell"
|
|
|
/>
|
|
@@ -302,7 +330,7 @@
|
|
|
(selectColumn === i ||
|
|
|
(selectedLine.type === 'column' && selectedLine.index === i))
|
|
|
? 'read'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
@mouseenter="clearSelectCell"
|
|
|
/>
|
|
@@ -318,13 +346,13 @@
|
|
|
class="luyin-box"
|
|
|
:file-name="fileName"
|
|
|
:select-data="selectData"
|
|
|
+ :answer-record-list="curQue.Bookanswer.recordList"
|
|
|
+ :task-model="TaskModel"
|
|
|
@getWavblob="getWavblob"
|
|
|
@getSelectData="getSelectData"
|
|
|
@handleParentPlay="pauseOtherAudio"
|
|
|
@sentPause="sentPause"
|
|
|
@handleWav="handleWav"
|
|
|
- :answerRecordList="curQue.Bookanswer.recordList"
|
|
|
- :TaskModel="TaskModel"
|
|
|
/>
|
|
|
<audio-compare
|
|
|
:style="{ flex: 1 }"
|
|
@@ -350,8 +378,11 @@
|
|
|
:theme-color="themeColor"
|
|
|
:cur-que="curQue"
|
|
|
:mp3="mp3Url"
|
|
|
+ :matrix-select-lrc="matrixSelectLrc"
|
|
|
+ :record-list="curQue.Bookanswer.recordList"
|
|
|
@exitFullscreen="exitFullscreen"
|
|
|
@changeIsFull="changeIsFull"
|
|
|
+ @handleWav="handleWav"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -369,13 +400,15 @@ export default {
|
|
|
AudioLine,
|
|
|
Soundrecord,
|
|
|
AudioCompare,
|
|
|
- VoiceFullscreen,
|
|
|
+ VoiceFullscreen
|
|
|
},
|
|
|
props: ["curQue", "themeColor", "TaskModel"],
|
|
|
data() {
|
|
|
return {
|
|
|
// 组件id
|
|
|
- cid: Math.random().toString(36).substr(2, 10),
|
|
|
+ cid: Math.random()
|
|
|
+ .toString(36)
|
|
|
+ .substr(2, 10),
|
|
|
isFull: false,
|
|
|
curTime: 0,
|
|
|
playing: false,
|
|
@@ -389,18 +422,18 @@ export default {
|
|
|
// 行、列选中
|
|
|
selectedLine: {
|
|
|
type: "",
|
|
|
- index: 0,
|
|
|
+ index: 0
|
|
|
},
|
|
|
// 点击选中
|
|
|
selectCell: {
|
|
|
row: -1,
|
|
|
- column: -1,
|
|
|
+ column: -1
|
|
|
},
|
|
|
isRepeat: false,
|
|
|
// 跟读所需属性
|
|
|
wavblob: null,
|
|
|
isRecord: false,
|
|
|
- matrixSelectLrc: null,
|
|
|
+ matrixSelectLrc: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -434,7 +467,7 @@ export default {
|
|
|
type: type.length > 0 && index >= 0 ? type : "cell",
|
|
|
index,
|
|
|
row,
|
|
|
- column,
|
|
|
+ column
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -458,12 +491,12 @@ export default {
|
|
|
return require("../../../assets/NPC/full-screen-red.png");
|
|
|
}
|
|
|
return require(`../../../assets/NPC/full-screen-${themeColor}.png`);
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
hasSelectedCell() {
|
|
|
this.handleParentPlay();
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
Bus.$on("audioPause", id => {
|
|
@@ -472,10 +505,10 @@ export default {
|
|
|
this.handleParentPlay();
|
|
|
});
|
|
|
if (!this.curQue.Bookanswer) {
|
|
|
- let bookanswer = {
|
|
|
- recordList: [],
|
|
|
- }
|
|
|
- this.$set(this.curQue, "Bookanswer", bookanswer);
|
|
|
+ let bookanswer = {
|
|
|
+ recordList: []
|
|
|
+ };
|
|
|
+ this.$set(this.curQue, "Bookanswer", bookanswer);
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -484,7 +517,11 @@ export default {
|
|
|
.querySelector("body")
|
|
|
.addEventListener("click", this.restoreAudioStatus);
|
|
|
// 如果一行内有两个语音矩阵,隐藏 全屏模式 文字
|
|
|
- if (Number(window.getComputedStyle(this.$refs.fullscreen).width.replace('px', '')) < 80) {
|
|
|
+ if (
|
|
|
+ Number(
|
|
|
+ window.getComputedStyle(this.$refs.fullscreen).width.replace("px", "")
|
|
|
+ ) < 80
|
|
|
+ ) {
|
|
|
this.$refs.fullscreen.children[0].hidden = true;
|
|
|
}
|
|
|
},
|
|
@@ -529,8 +566,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
setRecordingFileName(row, column) {
|
|
|
- let { type, text, sentence_data, pinyin_english_data, text_brackets } =
|
|
|
- this.curQue.voiceMatrix.matrix[row][column];
|
|
|
+ let {
|
|
|
+ type,
|
|
|
+ text,
|
|
|
+ sentence_data,
|
|
|
+ pinyin_english_data,
|
|
|
+ text_brackets
|
|
|
+ } = this.curQue.voiceMatrix.matrix[row][column];
|
|
|
if (type === "text") this.fileName = text;
|
|
|
if (type === "SentenceSegwordChs") this.fileName = sentence_data.sentence;
|
|
|
if (type === "PinyinEnglish") this.fileName = pinyin_english_data.pinyin;
|
|
@@ -549,7 +591,7 @@ export default {
|
|
|
"matrix-checkbox-row-",
|
|
|
"audio-simple-image",
|
|
|
"audio-simple-repeat",
|
|
|
- "luyin-box",
|
|
|
+ "luyin-box"
|
|
|
];
|
|
|
|
|
|
let operable = event.path.some(item => {
|
|
@@ -685,6 +727,10 @@ export default {
|
|
|
|
|
|
getSelectData({ type, index, row, column }) {
|
|
|
if (type === "") return;
|
|
|
+ if (index === 0 && row === -1 && column === -1) {
|
|
|
+ this.matrixSelectLrc = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
if (type.length > 0 && index >= 0 && type === "row") {
|
|
|
this.curQue.voiceMatrix.matrix[index].forEach(item => {
|
|
@@ -722,7 +768,7 @@ export default {
|
|
|
return {
|
|
|
begin_time: lrc_data.begin_time,
|
|
|
end_time: this.mp3Duration,
|
|
|
- text: lrc_data.text,
|
|
|
+ text: lrc_data.text
|
|
|
};
|
|
|
}
|
|
|
return lrc_data;
|
|
@@ -792,11 +838,10 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- handleWav(list, tmIndex) {
|
|
|
- tmIndex = tmIndex ? tmIndex : 0;
|
|
|
+ handleWav(list, tmIndex = 0) {
|
|
|
this.$set(this.curQue.Bookanswer, "recordList", list);
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|