|
|
@@ -1096,8 +1096,8 @@
|
|
|
flex: !data.col_width[4].value || data.col_width[4].value === '0' ? '1' : '',
|
|
|
}"
|
|
|
>
|
|
|
- <span v-if="sItem.collocation" class="collocation"
|
|
|
- ><b
|
|
|
+ <span v-if="sItem.collocation" class="collocation">
|
|
|
+ <b
|
|
|
:style="{
|
|
|
fontSize:
|
|
|
data.unified_attrib && data.unified_attrib.font_size
|
|
|
@@ -1527,7 +1527,6 @@ import { getNewWordData } from '@/views/book/courseware/data/newWord';
|
|
|
import PreviewMixin from '../common/PreviewMixin';
|
|
|
import SoundRecord from '../../common/SoundRecord.vue';
|
|
|
import AudioLine from '../voice_matrix/components/AudioLine.vue';
|
|
|
-import { GetFileURLMap } from '@/api/app';
|
|
|
import WordPhraseDetail from './components/WordPhraseDetail.vue';
|
|
|
import AudioPlay from './components/AudioPlay.vue';
|
|
|
import Strockplay from './components/Strockplay.vue';
|
|
|
@@ -1602,7 +1601,7 @@ export default {
|
|
|
computed: {
|
|
|
voiceTop() {
|
|
|
let height = 0;
|
|
|
- if (this.data.property.pinyin_position && this.data.property.pinyin_position == 'top') {
|
|
|
+ if (this.data.property.pinyin_position && this.data.property.pinyin_position === 'top') {
|
|
|
height = 24;
|
|
|
if (this.data.unified_attrib && this.data.unified_attrib.font_size) {
|
|
|
height = (this.data.unified_attrib.font_size.replace('pt', '') * 1.5 - (18 * 3) / 4) / 2;
|
|
|
@@ -1617,7 +1616,7 @@ export default {
|
|
|
},
|
|
|
tabNumTop() {
|
|
|
let height = 0;
|
|
|
- if (this.data.property.pinyin_position && this.data.property.pinyin_position == 'top') {
|
|
|
+ if (this.data.property.pinyin_position && this.data.property.pinyin_position === 'top') {
|
|
|
height = 24;
|
|
|
if (this.data.unified_attrib && this.data.unified_attrib.font_size) {
|
|
|
height = (this.data.unified_attrib.font_size.replace('pt', '') * 1.5 - (10 * 3) / 4) / 2;
|
|
|
@@ -1632,48 +1631,43 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
+ newData(val) {
|
|
|
+ if (val && val !== this.data) {
|
|
|
+ this.data = val;
|
|
|
+ }
|
|
|
+ },
|
|
|
data: {
|
|
|
handler(val, oldVal) {
|
|
|
- if (val !== oldVal) {
|
|
|
- if (
|
|
|
- (val &&
|
|
|
- val.new_word_list[0].new_word &&
|
|
|
- oldVal &&
|
|
|
- oldVal.new_word_list[0].new_word &&
|
|
|
- val.new_word_list[0].new_word !== oldVal.new_word_list[0].new_word) ||
|
|
|
- (val && val.new_word_list[0].new_word && !oldVal) ||
|
|
|
- (val && val.hasOwnProperty('unified_attrib') && oldVal && !oldVal.hasOwnProperty('unified_attrib'))
|
|
|
- ) {
|
|
|
- // this.wordShow = isEnable(this.data.property.is_word_show);
|
|
|
- this.initData();
|
|
|
- this.$nextTick(() => {
|
|
|
- setTimeout(() => {
|
|
|
- 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;
|
|
|
- }
|
|
|
+ if (val && val !== oldVal && val.new_word_list && val.new_word_list.length > 0) {
|
|
|
+ // this.wordShow = isEnable(this.data.property.is_word_show);
|
|
|
+ this.initData();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ 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;
|
|
|
}
|
|
|
- });
|
|
|
- this.rowWidth += 132;
|
|
|
- if (this.rowWidth < this.width - 2) {
|
|
|
- this.rowWidth = this.width - 2;
|
|
|
+ } else {
|
|
|
+ this.rowWidth += this.colHasContent[index] ? Number(item.value) : 0;
|
|
|
}
|
|
|
- }, 50);
|
|
|
- });
|
|
|
+ });
|
|
|
+ this.rowWidth += 132;
|
|
|
+ if (this.rowWidth < this.width - 2) {
|
|
|
+ this.rowWidth = this.width - 2;
|
|
|
+ }
|
|
|
+ }, 50);
|
|
|
+ });
|
|
|
|
|
|
- this.dataHeight = this.$refs.previewContainer ? this.$refs.previewContainer.style.height : 0;
|
|
|
- }
|
|
|
+ this.dataHeight = this.$refs.previewContainer ? this.$refs.previewContainer.style.height : 0;
|
|
|
}
|
|
|
},
|
|
|
deep: true,
|
|
|
@@ -1707,7 +1701,7 @@ export default {
|
|
|
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')
|
|
|
+ (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);
|
|
|
@@ -1734,7 +1728,7 @@ export default {
|
|
|
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')
|
|
|
+ (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);
|