|
|
@@ -8,8 +8,10 @@
|
|
|
<span class="name-path">{{ courseware_info.name_path }}</span>
|
|
|
<span class="flow-nodename">{{ courseware_info.cur_audit_flow_node_name }}</span>
|
|
|
<slot name="middle" :courseware="courseware_info"></slot>
|
|
|
- <i class="el-icon-setting" style="cursor: pointer" @click="openSimulateAnswerPermissionControl()"></i>
|
|
|
- <span class="link" @click="createCoursewarePreviewURL()">生成课件预览链接</span>
|
|
|
+ <template v-if="type === 'edit_preview'">
|
|
|
+ <i class="el-icon-setting" style="cursor: pointer" @click="openSimulateAnswerPermissionControl()"></i>
|
|
|
+ <span class="link" @click="createCoursewarePreviewURL()">生成课件预览链接</span>
|
|
|
+ </template>
|
|
|
<div class="group">
|
|
|
<el-checkbox v-model="isShowGroup">显示分组</el-checkbox>
|
|
|
<el-checkbox v-model="groupShowAll">分组显示全部</el-checkbox>
|
|
|
@@ -242,8 +244,8 @@
|
|
|
<span v-if="parseInt(drawerType) !== 1" class="word">{{ item.file_name }}</span>
|
|
|
<div class="mark">
|
|
|
<el-checkbox
|
|
|
- :disabled="!item.is_can_edit"
|
|
|
v-model="item.is_hided"
|
|
|
+ :disabled="!item.is_can_edit"
|
|
|
size="small"
|
|
|
@change="handleMediaShowChange(item)"
|
|
|
>
|
|
|
@@ -571,7 +573,7 @@ export default {
|
|
|
title_list: [],
|
|
|
visiblePermissionControl: false, // 模拟答题权限控制弹窗显示状态
|
|
|
permissionControl: {
|
|
|
- can_answer: false, // 可作答
|
|
|
+ can_answer: true, // 可作答
|
|
|
can_judge_correct: false, // 可判断对错(客观题)
|
|
|
can_show_answer: false, // 可查看答案
|
|
|
can_correct: false, // 可批改
|
|
|
@@ -626,7 +628,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
multimediaIsAllShow(newVal) {
|
|
|
- //切换显示全部,需清空所有数据,全部重新加载
|
|
|
+ // 切换显示全部,需清空所有数据,全部重新加载
|
|
|
this.bookChapterList.forEach((x) => {
|
|
|
this.$set(x, 'data', null);
|
|
|
});
|
|
|
@@ -694,7 +696,7 @@ export default {
|
|
|
({ courseware_info }) => {
|
|
|
this.courseware_info = { ...this.courseware_info, ...courseware_info };
|
|
|
this.getLangList();
|
|
|
- }
|
|
|
+ },
|
|
|
);
|
|
|
},
|
|
|
/**
|
|
|
@@ -758,14 +760,14 @@ export default {
|
|
|
});
|
|
|
|
|
|
if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
|
|
|
- }
|
|
|
+ },
|
|
|
);
|
|
|
},
|
|
|
getLangList() {
|
|
|
GetLanguageTypeList({ book_id: this.courseware_info.book_id, is_contain_zh: 'true' }).then(
|
|
|
({ language_type_list }) => {
|
|
|
this.langList = language_type_list;
|
|
|
- }
|
|
|
+ },
|
|
|
);
|
|
|
},
|
|
|
|
|
|
@@ -870,7 +872,7 @@ export default {
|
|
|
this.$refs.courserware.handleResult(
|
|
|
this.$refs.previewMain.scrollTop,
|
|
|
this.$refs.previewMain.scrollLeft,
|
|
|
- this.select_node
|
|
|
+ this.select_node,
|
|
|
);
|
|
|
},
|
|
|
/**
|
|
|
@@ -947,7 +949,6 @@ export default {
|
|
|
this.drawerType = type;
|
|
|
this.$nextTick(() => {
|
|
|
// 确保DOM更新后触发加载
|
|
|
- // this.loadMore();
|
|
|
this.loadBookChapterStructExpandList();
|
|
|
});
|
|
|
},
|
|
|
@@ -1028,60 +1029,12 @@ export default {
|
|
|
handleMediaShowChange(item) {
|
|
|
const params = { id: item.id, is_hided: item.is_hided ? 'true' : 'false' };
|
|
|
SetBookResourceHide(params).then((res) => {
|
|
|
- //如果不是显示全部资源,则需要重新加载
|
|
|
+ // 如果不是显示全部资源,则需要重新加载
|
|
|
if (!this.multimediaIsAllShow) {
|
|
|
this.multimediaHandleChange();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 加载更多数据
|
|
|
- //弃用
|
|
|
- async loadMore() {
|
|
|
- const now = Date.now();
|
|
|
- // 只有当lastLoadTime不为0(不是第一次)且时间间隔太短时才return
|
|
|
- if (this.lastLoadTime > 0 && now - this.lastLoadTime < this.minLoadInterval) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (this.disabled || this.loading) {
|
|
|
- if (this.lastLoadTime > 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- this.loading = true;
|
|
|
- const params = {
|
|
|
- page_capacity: this.page_capacity,
|
|
|
- cur_page: this.cur_page,
|
|
|
- book_id: this.projectId,
|
|
|
- book_chapter_node_id: this.activeBookChapterId,
|
|
|
- type: parseInt(this.drawerType),
|
|
|
- };
|
|
|
- await PageQueryBookResourceList(params)
|
|
|
- .then(({ total_count, resource_list }) => {
|
|
|
- this.total_count = total_count;
|
|
|
- // 记录加载前的滚动高度
|
|
|
- const scrollContainer = this.$el.querySelector('.scroll-container');
|
|
|
- const isAtBottom = this.isScrollAtBottom(scrollContainer);
|
|
|
-
|
|
|
- this.file_list = this.cur_page === 1 ? resource_list : [...this.file_list, ...resource_list];
|
|
|
- if (!resource_list || resource_list.length === 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.cur_page += 1;
|
|
|
-
|
|
|
- // 只有当前已经在底部时才微调滚动位置
|
|
|
- if (isAtBottom) {
|
|
|
- this.$nextTick(() => {
|
|
|
- // 轻微向上滚动,创造滚动空间
|
|
|
- scrollContainer.scrollTop -= 5;
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- this.lastLoadTime = now;
|
|
|
- });
|
|
|
- },
|
|
|
isScrollAtBottom(container) {
|
|
|
if (!container) return false;
|
|
|
return container.scrollHeight - container.scrollTop <= container.clientHeight + 5;
|
|
|
@@ -1254,7 +1207,7 @@ export default {
|
|
|
x.coursewareId === note.coursewareId &&
|
|
|
x.blockId === note.blockId &&
|
|
|
x.startIndex === note.startIndex &&
|
|
|
- x.endIndex === note.endIndex
|
|
|
+ x.endIndex === note.endIndex,
|
|
|
);
|
|
|
if (old) {
|
|
|
this.oldRichData = old;
|
|
|
@@ -1348,7 +1301,7 @@ export default {
|
|
|
x.coursewareId === collect.coursewareId &&
|
|
|
x.blockId === collect.blockId &&
|
|
|
x.startIndex === collect.startIndex &&
|
|
|
- x.endIndex === collect.endIndex
|
|
|
+ x.endIndex === collect.endIndex,
|
|
|
);
|
|
|
if (old) {
|
|
|
this.$message({
|