|
@@ -272,7 +272,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- handleReplaceTone(value, mark) {
|
|
|
+ handleReplaceTone(value, mark, itemIndex) {
|
|
|
if (!value) return;
|
|
|
value.split(/\s+/).forEach((item) => {
|
|
|
this.handleValue(item);
|
|
@@ -289,6 +289,12 @@ export default {
|
|
|
)
|
|
|
.filter((item) => item.length > 0)
|
|
|
.join(' ');
|
|
|
+ if (this.matically_pinyin_str[mark].indexOf(',') > -1) {
|
|
|
+ this.$message.warning('输入的拼音有误,请重新输入');
|
|
|
+ this.matically_pinyin_obj[mark] = [];
|
|
|
+ this.matically_pinyin_str[mark] = '';
|
|
|
+ this.data.option_list[itemIndex].content = '';
|
|
|
+ }
|
|
|
},
|
|
|
handleValue(valItem) {
|
|
|
let numList = [];
|
|
@@ -313,7 +319,7 @@ export default {
|
|
|
},
|
|
|
// 答案
|
|
|
handleItemAnswer(item) {
|
|
|
- const index = this.data.answer.answer_list.findIndex((items) => items.mark === item.mark);
|
|
|
+ const itemIndex = this.data.answer.answer_list.findIndex((items) => items.mark === item.mark);
|
|
|
let content = item.content.trim();
|
|
|
const regex = /[\u4e00-\u9fa5]/g;
|
|
|
item.content_hz = content.match(regex) ? content.match(regex).join('') : '';
|
|
@@ -337,17 +343,17 @@ export default {
|
|
|
select_item += `${items_trim}${index === content_arr.length - 1 ? '' : ' '}`;
|
|
|
}
|
|
|
content_preview += `${items_yuan} `;
|
|
|
- this.handleReplaceTone(items_yuan + items_trim.substring(indexs, indexs + 1), item.mark);
|
|
|
+ this.handleReplaceTone(items_yuan + items_trim.substring(indexs, indexs + 1), item.mark, itemIndex);
|
|
|
}
|
|
|
});
|
|
|
- if (index === -1) {
|
|
|
+ if (itemIndex === -1) {
|
|
|
let obj = {
|
|
|
mark: item.mark,
|
|
|
value: select_item.split(' '),
|
|
|
};
|
|
|
this.data.answer.answer_list.push(obj);
|
|
|
} else {
|
|
|
- this.data.answer.answer_list[index].value = select_item.split(' ');
|
|
|
+ this.data.answer.answer_list[itemIndex].value = select_item.split(' ');
|
|
|
}
|
|
|
item.content_view = content_preview.trim().split(' ');
|
|
|
// item.matically_pinyin = matically_pinyin.trim().split(' ').join(',');
|