|
@@ -25,12 +25,25 @@
|
|
|
<div class="textbook-chapter">
|
|
|
<div class="chapter-header">
|
|
|
<span class="cell">教材内容</span>
|
|
|
+ <span class="cell">制作人</span>
|
|
|
<span class="cell">状态</span>
|
|
|
</div>
|
|
|
<div class="chapter-list">
|
|
|
- <div v-for="chapter in courseware_list" :key="chapter.id" class="chapter-item">
|
|
|
- <span class="path" @click="navigateToChapter(chapter.id)">{{ chapter.name_path }}</span>
|
|
|
- <span class="status">{{ chapter.status_name }}</span>
|
|
|
+ <div
|
|
|
+ v-for="{ id, name, producer_list, status_name, deep, is_my_edit_task } in node_list"
|
|
|
+ :key="id"
|
|
|
+ :style="computedNameStyle(deep, isTrue(is_my_edit_task))"
|
|
|
+ class="chapter-item"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="path"
|
|
|
+ :style="computedPathStyle(isTrue(is_my_edit_task))"
|
|
|
+ @click="navigateToChapter(id, isTrue(is_my_edit_task))"
|
|
|
+ >
|
|
|
+ {{ name }}
|
|
|
+ </span>
|
|
|
+ <span>{{ producer_list.map((producer) => producer.name).join(';') }}</span>
|
|
|
+ <span class="status">{{ status_name }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -42,7 +55,8 @@
|
|
|
import MenuPage from '../common/menu.vue';
|
|
|
|
|
|
import { PageQueryMyProjectList_Producer } from '@/api/list';
|
|
|
-import { GetMyBookCoursewareTaskList_Edit } from '@/api/project';
|
|
|
+import { ChapterGetBookChapterStructExpandList } from '@/api/book';
|
|
|
+import { isTrue } from '@/utils/validate';
|
|
|
|
|
|
export default {
|
|
|
name: 'EditTask',
|
|
@@ -53,7 +67,8 @@ export default {
|
|
|
return {
|
|
|
project_list: [], // 项目列表
|
|
|
cur_project_id: '', // 当前选中的项目ID
|
|
|
- courseware_list: [], // 课程列表
|
|
|
+ node_list: [], // 章节结构列表
|
|
|
+ isTrue,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -73,21 +88,52 @@ export default {
|
|
|
},
|
|
|
selectProject(id) {
|
|
|
this.cur_project_id = id;
|
|
|
- this.getMyBookCoursewareTaskList();
|
|
|
+ this.getBookChapterStructExpandList();
|
|
|
},
|
|
|
/**
|
|
|
- * 得到我的教材课件任务列表
|
|
|
+ * 得到教材章节结构展开列表
|
|
|
*/
|
|
|
- getMyBookCoursewareTaskList() {
|
|
|
- GetMyBookCoursewareTaskList_Edit({ project_id: this.cur_project_id }).then(({ courseware_list }) => {
|
|
|
- this.courseware_list = courseware_list;
|
|
|
+ getBookChapterStructExpandList() {
|
|
|
+ ChapterGetBookChapterStructExpandList({
|
|
|
+ book_id: this.cur_project_id,
|
|
|
+ node_deep_mode: 0,
|
|
|
+ is_contain_producer: 'true',
|
|
|
+ is_contain_auditor: 'false',
|
|
|
+ }).then(({ node_list }) => {
|
|
|
+ this.node_list = node_list;
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
+ * 计算章节名称样式
|
|
|
+ * @param {number} deep - 节点深度
|
|
|
+ * @param {boolean} isMyEditTask - 是否是我的编辑任务
|
|
|
+ * @returns {Object} - 样式对象
|
|
|
+ */
|
|
|
+ computedNameStyle(deep, isMyEditTask) {
|
|
|
+ return {
|
|
|
+ 'padding-left': `${(deep - 1) * 16}px`,
|
|
|
+ fontWeight: deep === 1 ? 'bold' : 'normal',
|
|
|
+ cursor: isMyEditTask ? 'pointer' : 'auto',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 计算章节路径样式
|
|
|
+ * @param {boolean} isMyEditTask - 是否是我的编辑任务
|
|
|
+ * @returns {Object} - 样式对象
|
|
|
+ */
|
|
|
+ computedPathStyle(isMyEditTask) {
|
|
|
+ return {
|
|
|
+ color: isMyEditTask ? '#165dff' : 'default',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 跳转到章节预览页面
|
|
|
* @param {string} id 课件ID
|
|
|
+ * @param {boolean} isMyEditTask - 是否是我的编辑任务
|
|
|
*/
|
|
|
- navigateToChapter(id) {
|
|
|
+ navigateToChapter(id, isMyEditTask) {
|
|
|
+ if (!isMyEditTask) return;
|
|
|
+ if (!id) return;
|
|
|
this.$router.push({
|
|
|
path: `/personal_workbench/edit_task/preview/${id}`,
|
|
|
query: { project_id: this.cur_project_id },
|
|
@@ -198,6 +244,12 @@ export default {
|
|
|
border-right: $border;
|
|
|
}
|
|
|
|
|
|
+ :nth-child(2) {
|
|
|
+ width: 140px;
|
|
|
+ text-align: center;
|
|
|
+ border-right: $border;
|
|
|
+ }
|
|
|
+
|
|
|
:last-child {
|
|
|
width: 140px;
|
|
|
text-align: center;
|
|
@@ -234,11 +286,6 @@ export default {
|
|
|
font-size: 14px;
|
|
|
border-bottom: $border;
|
|
|
|
|
|
- .path {
|
|
|
- color: $main-color;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-
|
|
|
@include cell;
|
|
|
}
|
|
|
}
|