|
@@ -10,6 +10,9 @@
|
|
|
</span>
|
|
|
<RichText v-model="item.content" 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">
|
|
|
<SvgIcon icon-class="delete-2" width="12" height="12" />
|
|
|
</span>
|
|
@@ -19,6 +22,14 @@
|
|
|
<SvgIcon icon-class="add-circle" width="14" height="14" />
|
|
|
<span class="add-button" @click="addOption">增加选项</span>
|
|
|
</div>
|
|
|
+
|
|
|
+ <MultilingualFill
|
|
|
+ v-if="curSelectIndex !== -1"
|
|
|
+ :visible.sync="multilingualVisible"
|
|
|
+ :text="data.option_list[curSelectIndex].content"
|
|
|
+ :translations="data.option_list[curSelectIndex].multilingual"
|
|
|
+ @SubmitTranslation="handleMultilingualTranslation"
|
|
|
+ />
|
|
|
</template>
|
|
|
</ModuleBase>
|
|
|
</template>
|
|
@@ -34,6 +45,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
data: getSelectData(),
|
|
|
+ curSelectIndex: -1,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -82,6 +94,13 @@ export default {
|
|
|
const select = this.data.answer.answer_list.length > 1 ? '多选' : '单选';
|
|
|
this.data.mind_map.node_list = [{ name: `${direction}${select}选择题` }];
|
|
|
},
|
|
|
+ openMultilingual(i) {
|
|
|
+ this.curSelectIndex = i;
|
|
|
+ this.multilingualVisible = true;
|
|
|
+ },
|
|
|
+ handleMultilingualTranslation(translations) {
|
|
|
+ this.$set(this.data.option_list[this.curSelectIndex], 'multilingual', translations);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -142,7 +161,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .delete {
|
|
|
+ .delete,
|
|
|
+ .multilingual {
|
|
|
margin-left: 8px;
|
|
|
cursor: pointer;
|
|
|
}
|