|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div
|
|
|
- class="header-separate"
|
|
|
v-if="judgeAnswer == 'standardAnswer' ? (userError ? true : false) : true"
|
|
|
+ class="header-separate"
|
|
|
>
|
|
|
<table
|
|
|
:style="{
|
|
@@ -9,7 +9,7 @@
|
|
|
curQue.tableData.colsConfig.width.length > 5
|
|
|
? width_total + 'px'
|
|
|
: '',
|
|
|
- fontSize: baseSizePhone + 2 + 'px'
|
|
|
+ fontSize: baseSizePhone + 2 + 'px',
|
|
|
}"
|
|
|
>
|
|
|
<colgroup>
|
|
@@ -17,7 +17,7 @@
|
|
|
v-for="(item, i) in curQue.tableData.colsConfig.width"
|
|
|
:key="`col-${i}`"
|
|
|
:style="{
|
|
|
- width: `${item.val}px`
|
|
|
+ width: `${item.val}px`,
|
|
|
}"
|
|
|
/>
|
|
|
</colgroup>
|
|
@@ -40,7 +40,7 @@
|
|
|
|
|
|
<tbody
|
|
|
:style="{
|
|
|
- 'text-align': `${curQue.textAlign}`
|
|
|
+ 'text-align': `${curQue.textAlign}`,
|
|
|
}"
|
|
|
>
|
|
|
<tr v-for="(row, i) in curQue.tableData.body" :key="`tr-${i}`">
|
|
@@ -61,7 +61,7 @@
|
|
|
? 'correct'
|
|
|
: 'error'
|
|
|
: ''
|
|
|
- : ''
|
|
|
+ : '',
|
|
|
]"
|
|
|
:style="{
|
|
|
'background-color':
|
|
@@ -69,14 +69,14 @@
|
|
|
`${col.background}` === '#ffffff'
|
|
|
? 'transparent'
|
|
|
: `${col.background}`,
|
|
|
- display: tdHeaderIsNone(i, j)
|
|
|
+ display: tdHeaderIsNone(i, j),
|
|
|
}"
|
|
|
>
|
|
|
<div
|
|
|
class="cell-wrap"
|
|
|
:class="[
|
|
|
col.isCross ? 'cell-wrap-between' : '',
|
|
|
- 'cell-wrap-' + curQue.textAlign
|
|
|
+ 'cell-wrap-' + curQue.textAlign,
|
|
|
]"
|
|
|
>
|
|
|
<template v-if="col.type === 'content'">
|
|
@@ -90,22 +90,19 @@
|
|
|
? col.answer
|
|
|
: curQue.Bookanswer[i].content[j].answer
|
|
|
"
|
|
|
- @blur="
|
|
|
- judgeAnswer == 'standardAnswer'
|
|
|
- ? (col.answer = col.answer.trim())
|
|
|
- : (curQue.Bookanswer[i].content[
|
|
|
- j
|
|
|
- ].answer = curQue.Bookanswer[i].content[
|
|
|
- j
|
|
|
- ].answer.trim())
|
|
|
- "
|
|
|
type="textarea"
|
|
|
:class="[`text-${curQue.textAlign}`]"
|
|
|
:placeholder="`${isAnswerMode ? '' : ''}`"
|
|
|
:disabled="isAnswerMode"
|
|
|
:autosize="{ minRows: 1, maxRows: 6 }"
|
|
|
- @input="enterAnswer(i, j, 'input')"
|
|
|
:style="{ fontSize: baseSizePhone + 2 + 'px' }"
|
|
|
+ @blur="
|
|
|
+ judgeAnswer == 'standardAnswer'
|
|
|
+ ? (col.answer = col.answer.trim())
|
|
|
+ : (curQue.Bookanswer[i].content[j].answer =
|
|
|
+ curQue.Bookanswer[i].content[j].answer.trim())
|
|
|
+ "
|
|
|
+ @input="enterAnswer(i, j, 'input')"
|
|
|
/>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -119,21 +116,19 @@
|
|
|
<span
|
|
|
v-for="({ pinyin, chs }, k) in col.sentence_data
|
|
|
.wordsList"
|
|
|
- :key="
|
|
|
- `${
|
|
|
- curQue.pinyinPosition === 'top' ||
|
|
|
- curQue.pinyinPosition === 'left'
|
|
|
- ? 'pinyin'
|
|
|
- : 'chs'
|
|
|
- }-${k}`
|
|
|
- "
|
|
|
+ :key="`${
|
|
|
+ curQue.pinyinPosition === 'top' ||
|
|
|
+ curQue.pinyinPosition === 'left'
|
|
|
+ ? 'pinyin'
|
|
|
+ : 'chs'
|
|
|
+ }-${k}`"
|
|
|
:class="[
|
|
|
`${
|
|
|
curQue.pinyinPosition === 'top' ||
|
|
|
curQue.pinyinPosition === 'left'
|
|
|
? 'pinyin'
|
|
|
: 'chs'
|
|
|
- }`
|
|
|
+ }`,
|
|
|
]"
|
|
|
>
|
|
|
{{
|
|
@@ -148,21 +143,19 @@
|
|
|
<span
|
|
|
v-for="({ pinyin, chs }, k) in col.sentence_data
|
|
|
.wordsList"
|
|
|
- :key="
|
|
|
- `${
|
|
|
- curQue.pinyinPosition === 'top' ||
|
|
|
- curQue.pinyinPosition === 'left'
|
|
|
- ? 'chs'
|
|
|
- : 'pinyin'
|
|
|
- }-${k}`
|
|
|
- "
|
|
|
+ :key="`${
|
|
|
+ curQue.pinyinPosition === 'top' ||
|
|
|
+ curQue.pinyinPosition === 'left'
|
|
|
+ ? 'chs'
|
|
|
+ : 'pinyin'
|
|
|
+ }-${k}`"
|
|
|
:class="[
|
|
|
`${
|
|
|
curQue.pinyinPosition === 'top' ||
|
|
|
curQue.pinyinPosition === 'left'
|
|
|
? 'chs'
|
|
|
: 'pinyin'
|
|
|
- }`
|
|
|
+ }`,
|
|
|
]"
|
|
|
>
|
|
|
{{
|
|
@@ -179,7 +172,7 @@
|
|
|
v-else-if="col.type === 'prePinyin'"
|
|
|
:style="{
|
|
|
'flex-direction':
|
|
|
- col.prefixOrSuffix === 'prefix' ? 'row' : 'row-reverse'
|
|
|
+ col.prefixOrSuffix === 'prefix' ? 'row' : 'row-reverse',
|
|
|
}"
|
|
|
class="pre-pinyin"
|
|
|
>
|
|
@@ -187,7 +180,7 @@
|
|
|
<div
|
|
|
class="right-pinyin"
|
|
|
:style="{
|
|
|
- 'grid-template-columns': `repeat(${col.sentence_data.wordsList.length}, auto)`
|
|
|
+ 'grid-template-columns': `repeat(${col.sentence_data.wordsList.length}, auto)`,
|
|
|
}"
|
|
|
>
|
|
|
<span
|
|
@@ -198,8 +191,7 @@
|
|
|
{{ pinyin }}
|
|
|
</span>
|
|
|
<span
|
|
|
- v-for="({ pinyin, chs }, k) in col.sentence_data
|
|
|
- .wordsList"
|
|
|
+ v-for="({ chs }, k) in col.sentence_data.wordsList"
|
|
|
:key="`pre-chs-${k}`"
|
|
|
class="chs"
|
|
|
>
|
|
@@ -207,17 +199,17 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="stem-content" v-else-if="col.type === 'mulText'">
|
|
|
+ <div v-else-if="col.type === 'mulText'" class="stem-content">
|
|
|
<div
|
|
|
- :class="['sent-main']"
|
|
|
v-for="(sdItem, sdIndex) in col.mulText.detail"
|
|
|
:key="'sent-option-items' + j + sdIndex"
|
|
|
+ :class="['sent-main']"
|
|
|
>
|
|
|
<div class="sent-que-box">
|
|
|
<div
|
|
|
- class="sent-que"
|
|
|
v-for="(sddItem, sddIndex) in sdItem.detail"
|
|
|
:key="'sent-option-items' + j + sdIndex + sddIndex"
|
|
|
+ class="sent-que"
|
|
|
:style="{
|
|
|
paddingLeft:
|
|
|
sddItem.config.wordPadding.indexOf('left') > -1
|
|
@@ -226,28 +218,28 @@
|
|
|
paddingRight:
|
|
|
sddItem.config.wordPadding.indexOf('right') > -1
|
|
|
? '4px'
|
|
|
- : '0px'
|
|
|
+ : '0px',
|
|
|
}"
|
|
|
>
|
|
|
<!-- 补全句子 -->
|
|
|
<OneSentenceTemp
|
|
|
:detail="sddItem"
|
|
|
- :pyPosition="curQue.pinyinPosition"
|
|
|
- :TaskModel="TaskModel"
|
|
|
- :Bookanswer="curQue.Bookanswer[i].content[j]"
|
|
|
- :judgeAnswer="judgeAnswer"
|
|
|
- :correctAnswer="col.mulText.correct.complateArr"
|
|
|
- :isInput="true"
|
|
|
+ :py-position="curQue.pinyinPosition"
|
|
|
+ :task-model="TaskModel"
|
|
|
+ :bookanswer="curQue.Bookanswer[i].content[j]"
|
|
|
+ :judge-answer="judgeAnswer"
|
|
|
+ :correct-answer="col.mulText.correct.complateArr"
|
|
|
+ :is-input="true"
|
|
|
:fn_check_list="[]"
|
|
|
- :pyNumber="col.pyNumber && col.pyNumber[sdIndex]"
|
|
|
- :hengLeg="sdItem.hengLeg"
|
|
|
- :maxFontsize="baseSizePhone"
|
|
|
+ :py-number="col.pyNumber && col.pyNumber[sdIndex]"
|
|
|
+ :heng-leg="sdItem.hengLeg"
|
|
|
+ :max-fontsize="baseSizePhone"
|
|
|
/>
|
|
|
<template
|
|
|
v-if="
|
|
|
sddItem.img_list &&
|
|
|
- sddItem.img_list.length > 0 &&
|
|
|
- sddItem.img_list[0].id
|
|
|
+ sddItem.img_list.length > 0 &&
|
|
|
+ sddItem.img_list[0].id
|
|
|
"
|
|
|
>
|
|
|
<img
|
|
@@ -269,7 +261,7 @@
|
|
|
? col
|
|
|
: curQue.Bookanswer[i].content[j]
|
|
|
"
|
|
|
- :isAnswerMode="isAnswerMode"
|
|
|
+ :is-answer-mode="isAnswerMode"
|
|
|
@enterAnswer="enterAnswer"
|
|
|
/>
|
|
|
</div>
|
|
@@ -291,32 +283,32 @@ export default {
|
|
|
props: {
|
|
|
curQue: {
|
|
|
type: Object,
|
|
|
- required: true
|
|
|
+ required: true,
|
|
|
},
|
|
|
themeColor: {
|
|
|
type: String,
|
|
|
- required: true
|
|
|
+ required: true,
|
|
|
},
|
|
|
judgeAnswer: {
|
|
|
- type: String
|
|
|
+ type: String,
|
|
|
},
|
|
|
TaskModel: {
|
|
|
- type: String
|
|
|
+ type: String,
|
|
|
},
|
|
|
baseSizePhone: {
|
|
|
- type: Number
|
|
|
- }
|
|
|
+ type: Number,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
isAnswerMode: false,
|
|
|
userError: false,
|
|
|
userAnswer: {
|
|
|
- completeInput: []
|
|
|
+ completeInput: [],
|
|
|
},
|
|
|
userBookanswer: [],
|
|
|
chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
|
|
|
- width_total: 0 //总宽度
|
|
|
+ width_total: 0, // 总宽度
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -324,24 +316,24 @@ export default {
|
|
|
const hp = this.curQue.headerEnglishPosition;
|
|
|
if (hp === "top") {
|
|
|
return {
|
|
|
- "flex-direction": "column-reverse"
|
|
|
+ "flex-direction": "column-reverse",
|
|
|
};
|
|
|
}
|
|
|
if (hp === "right") {
|
|
|
return {
|
|
|
"flex-direction": "row",
|
|
|
- "column-gap": "8px"
|
|
|
+ "column-gap": "8px",
|
|
|
};
|
|
|
}
|
|
|
if (hp === "bottom") {
|
|
|
return {
|
|
|
- "flex-direction": "column"
|
|
|
+ "flex-direction": "column",
|
|
|
};
|
|
|
}
|
|
|
if (hp === "left") {
|
|
|
return {
|
|
|
"flex-direction": "row-reverse",
|
|
|
- "column-gap": "8px"
|
|
|
+ "column-gap": "8px",
|
|
|
};
|
|
|
}
|
|
|
},
|
|
@@ -349,28 +341,28 @@ export default {
|
|
|
let pyPos = this.curQue.pinyinPosition;
|
|
|
if (pyPos === "left") {
|
|
|
return {
|
|
|
- "column-gap": "16px"
|
|
|
+ "column-gap": "16px",
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (pyPos === "top") {
|
|
|
return {
|
|
|
- "flex-direction": "column"
|
|
|
+ "flex-direction": "column",
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (pyPos === "right") {
|
|
|
return {
|
|
|
- "column-gap": "16px"
|
|
|
+ "column-gap": "16px",
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (pyPos === "bottom") {
|
|
|
return {
|
|
|
- "flex-direction": "column"
|
|
|
+ "flex-direction": "column",
|
|
|
};
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
if (this.judgeAnswer) {
|
|
@@ -382,9 +374,9 @@ export default {
|
|
|
this.width_total = 0;
|
|
|
this.curQue.tableData.body.forEach((item, i) => {
|
|
|
arr.push({
|
|
|
- content: []
|
|
|
+ content: [],
|
|
|
});
|
|
|
- item.content.forEach(items => {
|
|
|
+ item.content.forEach((items) => {
|
|
|
if (items.type === "mulText") {
|
|
|
flag = true;
|
|
|
}
|
|
@@ -397,19 +389,19 @@ export default {
|
|
|
items.CrossAnswer &&
|
|
|
items.CrossAnswer !== "normal")
|
|
|
? "[JUDGE##F##JUDGE]"
|
|
|
- : ""
|
|
|
+ : "",
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
if (!flag) {
|
|
|
this.$set(this.curQue, "Bookanswer", arr);
|
|
|
}
|
|
|
- this.curQue.tableData.colsConfig.width.forEach(width => {
|
|
|
+ this.curQue.tableData.colsConfig.width.forEach((width) => {
|
|
|
this.width_total += width.val;
|
|
|
});
|
|
|
} else {
|
|
|
- this.curQue.Bookanswer.forEach(item => {
|
|
|
- item.content.forEach(item => {
|
|
|
+ this.curQue.Bookanswer.forEach((item) => {
|
|
|
+ item.content.forEach((item) => {
|
|
|
if (item.userAnswerJudge == "[JUDGE##F##JUDGE]") {
|
|
|
this.userError = true;
|
|
|
return;
|
|
@@ -444,36 +436,32 @@ export default {
|
|
|
this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
"[JUDGE##T##JUDGE]";
|
|
|
}
|
|
|
- } else {
|
|
|
- if (this.curQue.tableData.body[i].content[j].answer) {
|
|
|
- this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
- "[JUDGE##F##JUDGE]";
|
|
|
- }
|
|
|
+ } else if (this.curQue.tableData.body[i].content[j].answer) {
|
|
|
+ this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
+ "[JUDGE##F##JUDGE]";
|
|
|
}
|
|
|
- } else {
|
|
|
- if (
|
|
|
- this.curQue.Bookanswer[i].content[j].CrossAnswer ==
|
|
|
- this.curQue.tableData.body[i].content[j].CrossAnswer
|
|
|
- ) {
|
|
|
- if (this.curQue.tableData.body[i].content[j].answer) {
|
|
|
- if (
|
|
|
- this.curQue.Bookanswer[i].content[j].answer ==
|
|
|
- this.curQue.tableData.body[i].content[j].answer
|
|
|
- ) {
|
|
|
- this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
- "[JUDGE##T##JUDGE]";
|
|
|
- } else {
|
|
|
- this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
- "[JUDGE##F##JUDGE]";
|
|
|
- }
|
|
|
- } else {
|
|
|
+ } else if (
|
|
|
+ this.curQue.Bookanswer[i].content[j].CrossAnswer ==
|
|
|
+ this.curQue.tableData.body[i].content[j].CrossAnswer
|
|
|
+ ) {
|
|
|
+ if (this.curQue.tableData.body[i].content[j].answer) {
|
|
|
+ if (
|
|
|
+ this.curQue.Bookanswer[i].content[j].answer ==
|
|
|
+ this.curQue.tableData.body[i].content[j].answer
|
|
|
+ ) {
|
|
|
this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
"[JUDGE##T##JUDGE]";
|
|
|
+ } else {
|
|
|
+ this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
+ "[JUDGE##F##JUDGE]";
|
|
|
}
|
|
|
} else {
|
|
|
this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
- "[JUDGE##F##JUDGE]";
|
|
|
+ "[JUDGE##T##JUDGE]";
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.curQue.Bookanswer[i].content[j].userAnswerJudge =
|
|
|
+ "[JUDGE##F##JUDGE]";
|
|
|
}
|
|
|
},
|
|
|
// 控制首尾表格显隐
|
|
@@ -569,7 +557,7 @@ export default {
|
|
|
items.mulText.detail.forEach((sdItem, sdIndex) => {
|
|
|
let isHasPY = 0;
|
|
|
let maxFontsize = 0;
|
|
|
- sdItem.detail.forEach(sddItem => {
|
|
|
+ sdItem.detail.forEach((sddItem) => {
|
|
|
if (sddItem.wordsList.length > 0) {
|
|
|
sddItem.wordsList.forEach((sItem, sIndex) => {
|
|
|
let reg = /_{2,}/g;
|
|
@@ -579,7 +567,7 @@ export default {
|
|
|
sItem.hengIndex = hengIndex;
|
|
|
hengIndex++;
|
|
|
}
|
|
|
- //补全句子
|
|
|
+ // 补全句子
|
|
|
if (!this.curQue.Bookanswer) {
|
|
|
let reg = /_{2,}/g;
|
|
|
if (reg.test(sItem.chs)) {
|
|
@@ -600,7 +588,7 @@ export default {
|
|
|
bool || !complateArr[sItem.hengIndex]
|
|
|
? ""
|
|
|
: "[JUDGE##F##JUDGE]",
|
|
|
- input_Isexample: bool ? true : false
|
|
|
+ input_Isexample: Boolean(bool),
|
|
|
};
|
|
|
Bookanswer[index].content[indexs].completeInput.push(
|
|
|
JSON.parse(JSON.stringify(obj))
|
|
@@ -630,15 +618,12 @@ export default {
|
|
|
maxFontsize =
|
|
|
fontSize > maxFontsize ? fontSize : maxFontsize;
|
|
|
});
|
|
|
- } else {
|
|
|
- if (sddItem.sentence) {
|
|
|
- let fontSize = JSON.parse(
|
|
|
- JSON.stringify(sddItem.config.fontSize)
|
|
|
- );
|
|
|
- fontSize = Number(fontSize.replace("px", ""));
|
|
|
- maxFontsize =
|
|
|
- fontSize > maxFontsize ? fontSize : maxFontsize;
|
|
|
- }
|
|
|
+ } else if (sddItem.sentence) {
|
|
|
+ let fontSize = JSON.parse(
|
|
|
+ JSON.stringify(sddItem.config.fontSize)
|
|
|
+ );
|
|
|
+ fontSize = Number(fontSize.replace("px", ""));
|
|
|
+ maxFontsize = fontSize > maxFontsize ? fontSize : maxFontsize;
|
|
|
}
|
|
|
});
|
|
|
sdItem.maxFontsize = maxFontsize;
|
|
@@ -704,15 +689,15 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- //词和标点合一起
|
|
|
+ // 词和标点合一起
|
|
|
mergeWordSymbol(sItem) {
|
|
|
if (this.chsFhList.indexOf(sItem.chs) > -1) {
|
|
|
sItem.isShow = false;
|
|
|
} else {
|
|
|
sItem.isShow = true;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -773,6 +758,8 @@ export default {
|
|
|
::v-deep .el-textarea__inner {
|
|
|
text-align: $type;
|
|
|
background-color: transparent;
|
|
|
+ cursor: text !important;
|
|
|
+ caret-color: #606266 !important;
|
|
|
}
|
|
|
}
|
|
|
}
|