|
|
@@ -23,18 +23,48 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="textbook-chapter">
|
|
|
- <div class="chapter-header">
|
|
|
+ <div ref="chapterHeader" class="chapter-header">
|
|
|
<span class="cell">教材内容</span>
|
|
|
+ <span class="cell">最后编辑人</span>
|
|
|
+ <span class="cell">最后编辑时间</span>
|
|
|
+ <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="audit-node-desc nowrap-ellipsis" :title="chapter.my_audit_node_desc">
|
|
|
- {{ chapter.my_audit_node_desc }}
|
|
|
+ <div ref="chapterList" class="chapter-list">
|
|
|
+ <div
|
|
|
+ v-for="{
|
|
|
+ id,
|
|
|
+ name,
|
|
|
+ producer_list,
|
|
|
+ status_name,
|
|
|
+ deep,
|
|
|
+ is_my_audit_task,
|
|
|
+ last_editor_name,
|
|
|
+ last_edit_time,
|
|
|
+ is_leaf_chapter,
|
|
|
+ my_audit_node_desc,
|
|
|
+ } in node_list"
|
|
|
+ :key="id"
|
|
|
+ :style="computedNameStyle(deep, isTrue(is_my_audit_task))"
|
|
|
+ class="chapter-item"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="path"
|
|
|
+ :style="computedPathStyle(isTrue(is_my_audit_task))"
|
|
|
+ @click="navigateToChapter(id, isTrue(is_my_audit_task))"
|
|
|
+ >
|
|
|
+ {{ name }}
|
|
|
+ </span>
|
|
|
+ <span>{{ isTrue(is_leaf_chapter) ? last_editor_name : '' }}</span>
|
|
|
+ <span>{{ isTrue(is_leaf_chapter) ? last_edit_time : '' }}</span>
|
|
|
+ <span :title="producer_list.map((producer) => producer.name).join(';')">
|
|
|
+ {{ producer_list.map((producer) => producer.name).join(';') }}
|
|
|
+ </span>
|
|
|
+ <span class="audit-node-desc nowrap-ellipsis" :title="my_audit_node_desc">
|
|
|
+ {{ my_audit_node_desc }}
|
|
|
</span>
|
|
|
- <span class="status">{{ chapter.status_name }}</span>
|
|
|
+ <span class="status">{{ status_name }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -45,8 +75,9 @@
|
|
|
<script>
|
|
|
import MenuPage from '../common/menu.vue';
|
|
|
|
|
|
-import { GetMyBookCoursewareTaskList_Audit } from '@/api/project';
|
|
|
+import { ChapterGetBookChapterStructExpandList } from '@/api/book';
|
|
|
import { PageQueryMyProjectList_Auditor } from '@/api/list';
|
|
|
+import { isTrue } from '@/utils/validate';
|
|
|
|
|
|
export default {
|
|
|
name: 'CheckTaskPage',
|
|
|
@@ -57,7 +88,8 @@ export default {
|
|
|
return {
|
|
|
project_list: [],
|
|
|
cur_project_id: '',
|
|
|
- courseware_list: [],
|
|
|
+ node_list: [],
|
|
|
+ isTrue,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -72,16 +104,30 @@ export default {
|
|
|
this.project_list = project_list;
|
|
|
if (this.project_list.length > 0) {
|
|
|
this.cur_project_id = this.project_list[0].id;
|
|
|
- this.getMyBookCoursewareTaskList();
|
|
|
+ this.getBookChapterStructExpandList();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
- * 查询当前项目的审校任务列表
|
|
|
+ * 得到教材章节结构展开列表
|
|
|
*/
|
|
|
- getMyBookCoursewareTaskList() {
|
|
|
- GetMyBookCoursewareTaskList_Audit({ 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: 'true',
|
|
|
+ }).then(({ node_list }) => {
|
|
|
+ this.node_list = node_list;
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const chapterList = this.$refs.chapterList;
|
|
|
+ if (chapterList.scrollHeight > chapterList.clientHeight) {
|
|
|
+ this.$refs.chapterHeader.classList.add('has-scrollbar');
|
|
|
+ } else {
|
|
|
+ this.$refs.chapterHeader.classList.remove('has-scrollbar');
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
@@ -90,13 +136,41 @@ export default {
|
|
|
*/
|
|
|
selectProject(id) {
|
|
|
this.cur_project_id = id;
|
|
|
- this.getMyBookCoursewareTaskList();
|
|
|
+ this.getBookChapterStructExpandList();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 计算章节名称样式
|
|
|
+ * @param {number} deep - 节点深度
|
|
|
+ * @param {boolean} isMyAuditTask - 是否是我的审校任务
|
|
|
+ * @returns {Object} - 样式对象
|
|
|
+ */
|
|
|
+ computedNameStyle(deep, isMyAuditTask) {
|
|
|
+ return {
|
|
|
+ 'padding-left': `${(deep - 1) * 16}px`,
|
|
|
+ fontWeight: deep === 1 ? 'bold' : 'normal',
|
|
|
+ cursor: isMyAuditTask ? 'pointer' : 'auto',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 计算章节路径样式
|
|
|
+ * @param {boolean} isMyAuditTask - 是否是我的审校任务
|
|
|
+ * @returns {Object} - 样式对象
|
|
|
+ */
|
|
|
+ computedPathStyle(isMyAuditTask) {
|
|
|
+ console.log(isMyAuditTask);
|
|
|
+
|
|
|
+ return {
|
|
|
+ color: isMyAuditTask ? '#165dff' : 'default',
|
|
|
+ };
|
|
|
},
|
|
|
/**
|
|
|
* 导航到章节
|
|
|
* @param {string} id - 章节ID
|
|
|
+ * @param {boolean} isMyAuditTask - 是否是我的审校任务
|
|
|
*/
|
|
|
- navigateToChapter(id) {
|
|
|
+ navigateToChapter(id, isMyAuditTask) {
|
|
|
+ if (!isMyAuditTask) return;
|
|
|
+ if (!id) return;
|
|
|
this.$router.push({
|
|
|
path: `/personal_workbench/check_task/audit/${id}`,
|
|
|
query: { project_id: this.cur_project_id },
|
|
|
@@ -112,6 +186,8 @@ export default {
|
|
|
.check-task {
|
|
|
@include page-base;
|
|
|
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
.check-main {
|
|
|
display: flex;
|
|
|
flex: 1;
|
|
|
@@ -206,7 +282,9 @@ export default {
|
|
|
|
|
|
@mixin cell {
|
|
|
> span {
|
|
|
+ min-height: 37px;
|
|
|
padding: 8px 12px;
|
|
|
+ border-right: $border;
|
|
|
}
|
|
|
|
|
|
:first-child {
|
|
|
@@ -215,9 +293,24 @@ export default {
|
|
|
}
|
|
|
|
|
|
:nth-child(2) {
|
|
|
+ width: 120px;
|
|
|
+ max-width: 120px;
|
|
|
+ }
|
|
|
+
|
|
|
+ :nth-child(3) {
|
|
|
+ width: 170px;
|
|
|
+ max-width: 170px;
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+
|
|
|
+ :nth-child(4) {
|
|
|
+ width: 140px;
|
|
|
+ max-width: 140px;
|
|
|
+ }
|
|
|
+
|
|
|
+ :nth-child(5) {
|
|
|
width: 320px;
|
|
|
text-align: center;
|
|
|
- border-right: $border;
|
|
|
}
|
|
|
|
|
|
:last-child {
|
|
|
@@ -239,6 +332,10 @@ export default {
|
|
|
font-weight: bold;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+
|
|
|
+ &.has-scrollbar {
|
|
|
+ padding-right: 15px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.chapter-list {
|
|
|
@@ -251,11 +348,6 @@ export default {
|
|
|
font-size: 14px;
|
|
|
border-bottom: $border;
|
|
|
|
|
|
- .path {
|
|
|
- color: $main-color;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-
|
|
|
@include cell;
|
|
|
}
|
|
|
}
|