|
@@ -91,6 +91,17 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column prop="match_jump" label="关联跳转" width="300">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <template v-if="scope.row.match_jump.type === 'outer' && scope.row.match_jump.con">
|
|
|
|
|
+ 已关联:{{ scope.row.match_jump.con }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else-if="scope.row.match_jump.type === 'inner' && scope.row.match_jump.source_courseware_name">
|
|
|
|
|
+ 已关联:{{ scope.row.match_jump.source_courseware_name }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <div class="match-btn" @click="handleMatch(scope.row)"><SvgIcon icon-class="match" /><span>关联</span></div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="操作" width="150">
|
|
<el-table-column label="操作" width="150">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -108,6 +119,44 @@
|
|
|
:translations="data.multilingual"
|
|
:translations="data.multilingual"
|
|
|
@SubmitTranslation="handleMultilingualTranslation"
|
|
@SubmitTranslation="handleMultilingualTranslation"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-if="dialogFlag"
|
|
|
|
|
+ :visible.sync="dialogFlag"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
|
+ :modal="false"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ class="Notes-edit-dialog"
|
|
|
|
|
+ title="关联跳转"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="check-box">
|
|
|
|
|
+ <el-form ref="form" :model="matchObj" label-width="80px">
|
|
|
|
|
+ <el-form-item label="类型">
|
|
|
|
|
+ <el-radio-group v-model="matchObj.type">
|
|
|
|
|
+ <el-radio label="outer">外部跳转</el-radio>
|
|
|
|
|
+ <el-radio label="inner">内部跳转</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="关联链接" v-if="matchObj.type === 'outer'">
|
|
|
|
|
+ <el-input v-model="matchObj.con"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="关联节点" v-else>
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ v-model="matchObj.source_courseware_id_list"
|
|
|
|
|
+ :options="courseware_node_list"
|
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
|
+ @change="handleChangeCourseware"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :ref="refId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div class="btn-box">
|
|
|
|
|
+ <el-button type="info" size="small" @click="cancleDialog">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="sureMatch">确定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
</ModuleBase>
|
|
</ModuleBase>
|
|
|
</template>
|
|
</template>
|
|
@@ -115,7 +164,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
-import { PinyinBuild_OldFormat } from '@/api/book';
|
|
|
|
|
|
|
+import { ChapterGetBookChapterStruct, PinyinBuild_OldFormat } from '@/api/book';
|
|
|
import UploadPicture from '../new_word/components/UploadPicture.vue';
|
|
import UploadPicture from '../new_word/components/UploadPicture.vue';
|
|
|
|
|
|
|
|
import { getNotesData, getOption } from '@/views/book/courseware/data/notes';
|
|
import { getNotesData, getOption } from '@/views/book/courseware/data/notes';
|
|
@@ -130,6 +179,11 @@ export default {
|
|
|
data: getNotesData(),
|
|
data: getNotesData(),
|
|
|
multilingualText: '',
|
|
multilingualText: '',
|
|
|
refreshKey: '',
|
|
refreshKey: '',
|
|
|
|
|
+ dialogFlag: false,
|
|
|
|
|
+ matchObj: null,
|
|
|
|
|
+ activeMatchRow: null,
|
|
|
|
|
+ courseware_node_list: [],
|
|
|
|
|
+ refId: 'Notes-' + Math.random().toString(36).substring(2, 12),
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -146,7 +200,56 @@ export default {
|
|
|
deep: true,
|
|
deep: true,
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getBookChapterStructExpandList();
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 得到教材章节结构展开列表
|
|
|
|
|
+ */
|
|
|
|
|
+ getBookChapterStructExpandList() {
|
|
|
|
|
+ ChapterGetBookChapterStruct({
|
|
|
|
|
+ book_id: this.$route.query.project_id,
|
|
|
|
|
+ node_deep_mode: 0,
|
|
|
|
|
+ is_contain_producer: 'false',
|
|
|
|
|
+ is_contain_auditor: 'false',
|
|
|
|
|
+ }).then(({ nodes }) => {
|
|
|
|
|
+ this.courseware_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);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleChangeCourseware(val) {
|
|
|
|
|
+ this.matchObj.source_courseware_id = val[val.length - 1];
|
|
|
|
|
+ this.matchObj.source_courseware_name = this.$refs[this.refId].getCheckedNodes()[0].pathLabels.join('/');
|
|
|
|
|
+ },
|
|
|
// 删除行
|
|
// 删除行
|
|
|
handleDelete(index) {
|
|
handleDelete(index) {
|
|
|
this.data.option.splice(index, 1);
|
|
this.data.option.splice(index, 1);
|
|
@@ -174,6 +277,9 @@ export default {
|
|
|
name: item.con.replace(/<[^>]*>?/gm, ''),
|
|
name: item.con.replace(/<[^>]*>?/gm, ''),
|
|
|
id: Math.random().toString(36).substring(2, 12),
|
|
id: Math.random().toString(36).substring(2, 12),
|
|
|
});
|
|
});
|
|
|
|
|
+ if (!item.hasOwnProperty('match_jump')) {
|
|
|
|
|
+ this.$set(item, 'match_jump', { type: 'outer', con: '', source_courseware_id_list: [] });
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
this.data.mind_map.node_list = node_list;
|
|
this.data.mind_map.node_list = node_list;
|
|
|
},
|
|
},
|
|
@@ -316,6 +422,23 @@ export default {
|
|
|
this.data.option[index].file_list[0] = '';
|
|
this.data.option[index].file_list[0] = '';
|
|
|
this.data.file_id_list = this.data.file_id_list.filter((item) => item !== file_id);
|
|
this.data.file_id_list = this.data.file_id_list.filter((item) => item !== file_id);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 点击关联按钮
|
|
|
|
|
+ handleMatch(row) {
|
|
|
|
|
+ this.matchObj = JSON.parse(JSON.stringify(row.match_jump));
|
|
|
|
|
+ this.activeMatchRow = row;
|
|
|
|
|
+ this.dialogFlag = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 确定关联
|
|
|
|
|
+ sureMatch() {
|
|
|
|
|
+ this.dialogFlag = false;
|
|
|
|
|
+ this.activeMatchRow.match_jump = JSON.parse(JSON.stringify(this.matchObj));
|
|
|
|
|
+ this.matchObj = null;
|
|
|
|
|
+ },
|
|
|
|
|
+ cancleDialog() {
|
|
|
|
|
+ this.dialogFlag = false;
|
|
|
|
|
+ this.matchObj = null;
|
|
|
|
|
+ this.activeMatchRow = null;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -360,9 +483,45 @@ export default {
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.match-btn {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ column-gap: 12px;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 233px;
|
|
|
|
|
+ padding: 4px 12px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #1d2129;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ background-color: #f2f3f5;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
.tox .tox-editor-header {
|
|
.tox .tox-editor-header {
|
|
|
z-index: 3 !important;
|
|
z-index: 3 !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.Notes-edit-dialog {
|
|
|
|
|
+ .el-dialog__body {
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .check-box {
|
|
|
|
|
+ padding: 24px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 25%);
|
|
|
|
|
+
|
|
|
|
|
+ .btn-box {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+
|
|
|
|
|
+ .el-button {
|
|
|
|
|
+ padding: 2px 12px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ line-height: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|