|
@@ -10,6 +10,16 @@
|
|
toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div style="margin-bottom: 12px">
|
|
|
|
+ <label>跨页关联课文所在内容节点:</label>
|
|
|
|
+ <el-cascader
|
|
|
|
+ v-model="data.source_courseware_id_list"
|
|
|
|
+ :options="node_list"
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
+ @change="handleChange"
|
|
|
|
+ >
|
|
|
|
+ </el-cascader>
|
|
|
|
+ </div>
|
|
<el-table :data="data.new_word_list" border style="width: 100%">
|
|
<el-table :data="data.new_word_list" border style="width: 100%">
|
|
<el-table-column fixed prop="number" label="序号" width="70">
|
|
<el-table-column fixed prop="number" label="序号" width="70">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -157,7 +167,7 @@ import { getNewWordData, getOption } from '@/views/book/courseware/data/newWord'
|
|
import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
|
|
import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
|
|
import { GetStaticResources } from '@/api/app';
|
|
import { GetStaticResources } from '@/api/app';
|
|
import cnchar from 'cnchar';
|
|
import cnchar from 'cnchar';
|
|
-
|
|
|
|
|
|
+import { ChapterGetBookChapterStruct } from '@/api/book';
|
|
export default {
|
|
export default {
|
|
name: 'NewWordPage',
|
|
name: 'NewWordPage',
|
|
components: {
|
|
components: {
|
|
@@ -170,6 +180,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
data: getNewWordData(),
|
|
data: getNewWordData(),
|
|
|
|
+ node_list: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -340,6 +351,54 @@ export default {
|
|
});
|
|
});
|
|
this.data.mind_map.node_list = node_list;
|
|
this.data.mind_map.node_list = node_list;
|
|
},
|
|
},
|
|
|
|
+ /**
|
|
|
|
+ * 得到教材章节结构展开列表
|
|
|
|
+ */
|
|
|
|
+ getBookChapterStructExpandList() {
|
|
|
|
+ ChapterGetBookChapterStruct({
|
|
|
|
+ book_id: this.$route.query.project_id,
|
|
|
|
+ node_deep_mode: 0,
|
|
|
|
+ is_contain_producer: 'false',
|
|
|
|
+ is_contain_auditor: 'false',
|
|
|
|
+ }).then(({ nodes }) => {
|
|
|
|
+ this.node_list = nodes;
|
|
|
|
+ nodes.forEach((item) => {
|
|
|
|
+ item.label = item.name;
|
|
|
|
+ item.pid = '';
|
|
|
|
+ item.nodexIndex = 0;
|
|
|
|
+ item.isLeaf = item.is_leaf === 'true';
|
|
|
|
+ item.value = item.id;
|
|
|
|
+ if (item.nodes) {
|
|
|
|
+ item.children = item.nodes;
|
|
|
|
+ item.lists = item.nodes;
|
|
|
|
+ this.handleData(item, 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 递归
|
|
|
|
+ handleData(data, nodeIndex) {
|
|
|
|
+ if (data.nodes) {
|
|
|
|
+ data.nodes.forEach((item) => {
|
|
|
|
+ item.label = item.name;
|
|
|
|
+ item.pid = data.id;
|
|
|
|
+ item.nodexIndex = nodeIndex;
|
|
|
|
+ item.isLeaf = item.is_leaf === 'true';
|
|
|
|
+ item.value = item.id;
|
|
|
|
+ if (item.nodes) {
|
|
|
|
+ item.children = item.nodes;
|
|
|
|
+ item.lists = item.nodes;
|
|
|
|
+ this.handleData(item, nodeIndex + 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleChange(val) {
|
|
|
|
+ this.data.source_courseware_id = val[val.length - 1];
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getBookChapterStructExpandList();
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|