|
@@ -70,8 +70,9 @@
|
|
|
:inline="true"
|
|
|
toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
|
v-if="data.mode === 'normal'"
|
|
|
+ @handleRichTextBlur="handleBlurCon"
|
|
|
/>
|
|
|
- <el-input v-else v-model="li.content"></el-input>
|
|
|
+ <el-input v-else v-model="li.content" @blur="handleBlurCon"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="table-node">
|
|
@@ -89,7 +90,13 @@
|
|
|
<script>
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
|
|
|
-import { getTableData, getOption, tableTypeList, fontFamilyList } from '@/views/book/courseware/data/table';
|
|
|
+import {
|
|
|
+ getTableData,
|
|
|
+ getOption,
|
|
|
+ tableTypeList,
|
|
|
+ fontFamilyList,
|
|
|
+ getAnswerOption,
|
|
|
+} from '@/views/book/courseware/data/table';
|
|
|
|
|
|
export default {
|
|
|
name: 'Table',
|
|
@@ -107,10 +114,12 @@ export default {
|
|
|
handler(val) {
|
|
|
if (val < this.data.option_list.length) {
|
|
|
this.data.option_list = this.data.option_list.slice(0, val);
|
|
|
+ this.data.answer_list = this.data.answer_list.slice(0, val);
|
|
|
} else {
|
|
|
const diff = val - this.data.option_list.length;
|
|
|
for (let i = 0; i < diff; i++) {
|
|
|
this.data.option_list.push(Array.from({ length: this.data.property.column_count }, getOption));
|
|
|
+ this.data.answer_list.push(Array.from({ length: this.data.property.column_count }, getAnswerOption));
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -132,6 +141,14 @@ export default {
|
|
|
|
|
|
return row.concat(Array.from({ length: diff }, getOption));
|
|
|
});
|
|
|
+ this.data.answer_list = this.data.answer_list.map((row) => {
|
|
|
+ if (val < row.length) {
|
|
|
+ return row.slice(0, val);
|
|
|
+ }
|
|
|
+ const diff = val - row.length;
|
|
|
+
|
|
|
+ return row.concat(Array.from({ length: diff }, getAnswerOption));
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -191,6 +208,21 @@ export default {
|
|
|
return arr;
|
|
|
},
|
|
|
// 思维导图数据
|
|
|
+ handleMindMap() {
|
|
|
+ let node_list = [];
|
|
|
+ this.data.option_list.forEach((item) => {
|
|
|
+ item.forEach((items) => {
|
|
|
+ node_list.push({
|
|
|
+ name: items.content.replace(/<[^>]*>?/gm, ''),
|
|
|
+ id: Math.random().toString(36).substring(2, 12),
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.data.mind_map.node_list = node_list;
|
|
|
+ },
|
|
|
+ handleBlurCon() {
|
|
|
+ this.handleMindMap();
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|