|
@@ -49,20 +49,48 @@
|
|
|
}"
|
|
|
>
|
|
|
<div :style="[tdStyle]" class="cell-wrap">
|
|
|
- <p v-for="(item, index) in col.model_essay" :key="index">
|
|
|
- <span v-if="item.type === 'text'" :key="index" v-html="sanitizeHTML(item.value)"></span>
|
|
|
- <template v-if="item.type === 'input'">
|
|
|
- <el-input
|
|
|
- :key="index"
|
|
|
- v-model="item.value"
|
|
|
- :disabled="disabled"
|
|
|
- :style="[{ width: Math.max(80, item.value.length * 21.3) + 'px' }]"
|
|
|
- />
|
|
|
- <!-- <span v-show="computedAnswerText(li.mark).length > 0" :key="`answer-${indexs}`" class="right-answer">
|
|
|
+ <template v-if="isEnable(data.property.view_pinyin)">
|
|
|
+ <p v-for="(item, index) in col.model_pinyin" :key="index" class="pinyin-text">
|
|
|
+ <template v-if="item.type === 'input'">
|
|
|
+ <el-input
|
|
|
+ :key="index"
|
|
|
+ v-model="item.value"
|
|
|
+ :disabled="disabled"
|
|
|
+ :style="[{ width: Math.max(80, item.value.length * 21.3) + 'px' }]"
|
|
|
+ />
|
|
|
+ <!-- <span v-show="computedAnswerText(li.mark).length > 0" :key="`answer-${indexs}`" class="right-answer">
|
|
|
{{ computedAnswerText(li.mark) }}
|
|
|
</span> -->
|
|
|
- </template>
|
|
|
- </p>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <span v-if="data.property.pinyin_position === 'top'" class="pinyin">
|
|
|
+ {{ item.pinyin.replace(/\s+/g, '') }}
|
|
|
+ </span>
|
|
|
+ <span :style="{ ...item.activeTextStyle }">
|
|
|
+ {{ item.text }}
|
|
|
+ </span>
|
|
|
+ <span v-if="data.property.pinyin_position === 'bottom'" class="pinyin">{{
|
|
|
+ item.pinyin.replace(/\s+/g, '')
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <p v-for="(item, index) in col.model_essay" :key="index">
|
|
|
+ <span v-if="item.type === 'text'" :key="index" v-html="sanitizeHTML(item.value)"></span>
|
|
|
+ <template v-if="item.type === 'input'">
|
|
|
+ <el-input
|
|
|
+ :key="index"
|
|
|
+ v-model="item.value"
|
|
|
+ :disabled="disabled"
|
|
|
+ :style="[{ width: Math.max(80, item.value.length * 21.3) + 'px' }]"
|
|
|
+ />
|
|
|
+ <!-- <span v-show="computedAnswerText(li.mark).length > 0" :key="`answer-${indexs}`" class="right-answer">
|
|
|
+ {{ computedAnswerText(li.mark) }}
|
|
|
+ </span> -->
|
|
|
+ </template>
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<span class="multilingual" v-if="showLang">
|
|
|
{{
|
|
@@ -86,6 +114,7 @@
|
|
|
import { getTableData } from '@/views/book/courseware/data/table';
|
|
|
|
|
|
import PreviewMixin from '../common/PreviewMixin';
|
|
|
+import { isEnable } from '../../../data/common';
|
|
|
|
|
|
export default {
|
|
|
name: 'TablePreview',
|
|
@@ -151,6 +180,7 @@ export default {
|
|
|
this.$set(this.multilingualTextList, item.type, chunkedArr);
|
|
|
});
|
|
|
}
|
|
|
+ console.log(this.data);
|
|
|
},
|
|
|
computedAnswerText(mark) {
|
|
|
if (!this.isShowRightAnswer) return '';
|
|
@@ -190,7 +220,9 @@ $border-color: #e6e6e6;
|
|
|
|
|
|
.cell-wrap {
|
|
|
display: flex;
|
|
|
+ flex-flow: wrap;
|
|
|
grid-area: fill;
|
|
|
+ align-items: end;
|
|
|
|
|
|
p {
|
|
|
margin: 0;
|
|
@@ -252,6 +284,17 @@ $border-color: #e6e6e6;
|
|
|
.multilingual {
|
|
|
word-break: break-word;
|
|
|
}
|
|
|
+
|
|
|
+ .pinyin-text {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ font-size: 24px;
|
|
|
+
|
|
|
+ .pinyin {
|
|
|
+ font-family: 'League';
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|