|
|
@@ -1,56 +1,67 @@
|
|
|
<template>
|
|
|
<ModuleBase ref="base" :type="data.type">
|
|
|
<template #content>
|
|
|
- <ul class="option-list">
|
|
|
- <li v-for="(item, i) in data.option_list" :key="item.mark" class="option-item">
|
|
|
- <span
|
|
|
- v-if="!('enable_serial' in data.property) || isEnable(data.property.enable_serial)"
|
|
|
- class="serial-number"
|
|
|
- >{{ computedOptionNumber(i) }}.</span
|
|
|
- >
|
|
|
- <div class="option-contnet">
|
|
|
+ <div v-loading="loading" class="select-wrapper">
|
|
|
+ <ul class="option-list">
|
|
|
+ <li v-for="(item, i) in data.option_list" :key="item.mark" class="option-item">
|
|
|
<span
|
|
|
- :class="[isSingle ? 'radio' : 'checkbox', { active: isAnswer(item.mark) }]"
|
|
|
- @click="selectAnswer(item.mark)"
|
|
|
+ v-if="!('enable_serial' in data.property) || isEnable(data.property.enable_serial)"
|
|
|
+ class="serial-number"
|
|
|
+ >{{ computedOptionNumber(i) }}.</span
|
|
|
>
|
|
|
- <SvgIcon icon-class="check-mark" width="10" height="7" />
|
|
|
+ <div class="option-contnet">
|
|
|
+ <span
|
|
|
+ :class="[isSingle ? 'radio' : 'checkbox', { active: isAnswer(item.mark) }]"
|
|
|
+ @click="selectAnswer(item.mark)"
|
|
|
+ >
|
|
|
+ <SvgIcon icon-class="check-mark" width="10" height="7" />
|
|
|
+ </span>
|
|
|
+ <RichText
|
|
|
+ v-if="property.isGetContent"
|
|
|
+ ref="richText"
|
|
|
+ v-model="item.content"
|
|
|
+ :font-size="data?.unified_attrib?.font_size"
|
|
|
+ :font-family="data?.unified_attrib?.font"
|
|
|
+ :font-color="data?.unified_attrib?.text_color"
|
|
|
+ placeholder="输入内容"
|
|
|
+ :inline="true"
|
|
|
+ :height="32"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <span class="multilingual" @click="openMultilingual(i)">
|
|
|
+ <SvgIcon icon-class="multilingual" class-name="multilingual" width="12" height="12" />
|
|
|
</span>
|
|
|
- <RichText
|
|
|
- v-if="property.isGetContent"
|
|
|
- ref="richText"
|
|
|
- v-model="item.content"
|
|
|
- :font-size="data?.unified_attrib?.font_size"
|
|
|
- :font-family="data?.unified_attrib?.font"
|
|
|
- :font-color="data?.unified_attrib?.text_color"
|
|
|
- placeholder="输入内容"
|
|
|
- :inline="true"
|
|
|
- :height="32"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <span class="multilingual" @click="openMultilingual(i)">
|
|
|
- <SvgIcon icon-class="multilingual" class-name="multilingual" width="12" height="12" />
|
|
|
- </span>
|
|
|
- <span class="delete" @click="deleteOption(i)">
|
|
|
- <SvgIcon icon-class="delete-2" width="12" height="12" />
|
|
|
- </span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div class="add">
|
|
|
- <SvgIcon icon-class="add-circle" width="14" height="14" />
|
|
|
- <span class="add-button" @click="addOption">增加选项</span>
|
|
|
- </div>
|
|
|
+ <span class="delete" @click="deleteOption(i)">
|
|
|
+ <SvgIcon icon-class="delete-2" width="12" height="12" />
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="add">
|
|
|
+ <SvgIcon icon-class="add-circle" width="14" height="14" />
|
|
|
+ <span class="add-button" @click="addOption">增加选项</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <el-divider v-if="isEnable(data.property.view_pinyin)" content-position="left">拼音效果</el-divider>
|
|
|
- <PinyinText
|
|
|
- v-for="(item, i) in data.option_list"
|
|
|
- v-show="isEnable(data.property.view_pinyin)"
|
|
|
- :key="i"
|
|
|
- ref="PinyinText"
|
|
|
- :paragraph-list="item.paragraph_list"
|
|
|
- :rich-text-list="item.rich_text_list"
|
|
|
- :pinyin-position="data.property.pinyin_position"
|
|
|
- @fillCorrectPinyin="fillCorrectPinyin($event, i)"
|
|
|
- />
|
|
|
+ <el-divider v-if="isEnable(data.property.view_pinyin)" content-position="left">
|
|
|
+ <span>显示效果</span>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ title="刷新"
|
|
|
+ class="refresh-pinyin-btn"
|
|
|
+ @click.native="handleViewPinyin(true)"
|
|
|
+ />
|
|
|
+ </el-divider>
|
|
|
+ <PinyinText
|
|
|
+ v-for="(item, i) in data.option_list"
|
|
|
+ v-show="isEnable(data.property.view_pinyin)"
|
|
|
+ :key="i"
|
|
|
+ ref="PinyinText"
|
|
|
+ :paragraph-list="item.paragraph_list"
|
|
|
+ :rich-text-list="item.rich_text_list"
|
|
|
+ :pinyin-position="data.property.pinyin_position"
|
|
|
+ @fillCorrectPinyin="fillCorrectPinyin($event, i)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
|
|
|
<MultilingualFill
|
|
|
v-if="curSelectIndex !== -1"
|
|
|
@@ -89,6 +100,7 @@ export default {
|
|
|
return {
|
|
|
data: getSelectData(),
|
|
|
curSelectIndex: -1,
|
|
|
+ loading: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -100,24 +112,11 @@ export default {
|
|
|
'data.property.arrange_type': 'handlerMindMap',
|
|
|
'data.answer.answer_list': 'handlerMindMap',
|
|
|
'data.property': {
|
|
|
- handler({ view_pinyin }) {
|
|
|
- if (!this.isEnable(view_pinyin)) {
|
|
|
- this.data.option_list.forEach((item) => {
|
|
|
- item.paragraph_list = [];
|
|
|
- item.paragraph_list_parameter = {
|
|
|
- text: '',
|
|
|
- pinyin_proofread_word_list: [],
|
|
|
- };
|
|
|
- });
|
|
|
- return;
|
|
|
+ handler(val) {
|
|
|
+ if (this.property.isSilentPropertyWatch) return;
|
|
|
+ if (val.view_pinyin === 'true') {
|
|
|
+ this.handleViewPinyin();
|
|
|
}
|
|
|
- if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
|
|
|
- this.data.option_list.forEach((item, i) => {
|
|
|
- const text = item.content;
|
|
|
- if (!text) return;
|
|
|
- item.paragraph_list_parameter.text = text;
|
|
|
- this.createParsedTextInfoPinyin(text, i);
|
|
|
- });
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
|
@@ -130,6 +129,39 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ async handleViewPinyin(isPrompt = false) {
|
|
|
+ if (isPrompt) {
|
|
|
+ try {
|
|
|
+ await this.$confirm('刷新将会重置分词和拼音,是否刷新?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ if (!this.isEnable(this.data.property.view_pinyin)) {
|
|
|
+ this.data.option_list.forEach((item) => {
|
|
|
+ item.paragraph_list = [];
|
|
|
+ item.paragraph_list_parameter = {
|
|
|
+ text: '',
|
|
|
+ pinyin_proofread_word_list: [],
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
|
|
|
+ this.data.option_list.forEach((item, i) => {
|
|
|
+ const text = item.content;
|
|
|
+ if (!text) return;
|
|
|
+ item.paragraph_list_parameter.text = text;
|
|
|
+ this.createParsedTextInfoPinyin(text, i);
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
computedOptionNumber(number) {
|
|
|
let type = serialNumberTypeList.find((item) => item.value === this.data.property.option_serial_type)?.value;
|
|
|
if (!type) return number + 1;
|