|
@@ -2,203 +2,58 @@
|
|
|
<div class="audit">
|
|
|
<MenuPage cur-key="check_task" />
|
|
|
|
|
|
- <div class="audit__header">
|
|
|
- <div class="menu-container">
|
|
|
- <MenuPopover :id="id" :node-list="node_list" :book-name="courseware_info.book_name" @selectNode="selectNode" />
|
|
|
- </div>
|
|
|
- <div class="courseware">
|
|
|
- <span class="name-path">{{ courseware_info.name_path }}</span>
|
|
|
- <span class="flow-nodename">{{ courseware_info.cur_audit_flow_node_name }}</span>
|
|
|
- <div class="operator">
|
|
|
- <span v-if="isTrue(courseware_info.is_can_add_audit_remark)" class="link" @click="addRemark">
|
|
|
- 添加审校批注
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="isTrue(courseware_info.is_can_finish_audit)"
|
|
|
- class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('false')"
|
|
|
- >
|
|
|
- 审校完成
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="isTrue(courseware_info.is_can_audit_pass)"
|
|
|
- class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('true')"
|
|
|
- >
|
|
|
- 审核通过
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="isTrue(courseware_info.is_can_audit_reject)"
|
|
|
- class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('false')"
|
|
|
- >
|
|
|
- 审核驳回
|
|
|
- </span>
|
|
|
- <span class="link" @click="goBackBookList">返回教材列表</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="audit-content">
|
|
|
- <div class="main-container">
|
|
|
- <main class="preview-main">
|
|
|
- <span class="title">
|
|
|
- <SvgIcon icon-class="menu-2" size="24" />
|
|
|
- <span>{{ courseware_info.name_path }}</span>
|
|
|
- </span>
|
|
|
-
|
|
|
- <CoursewarePreview :data="data" :component-list="component_list" :background="background" />
|
|
|
- </main>
|
|
|
- </div>
|
|
|
- <div class="remark-list">
|
|
|
- <h5>审校批注</h5>
|
|
|
- <ul v-if="remark_list.length > 0">
|
|
|
- <li v-for="(item, index) in remark_list" :key="index">
|
|
|
- <p v-html="item.content"></p>
|
|
|
- <div class="remark-bottom">
|
|
|
- <span>{{ item.remark_person_name + ':' + item.remark_time }}</span>
|
|
|
- <el-button type="text" class="delete-btn" @click="deleteRemarks(item.id)">删除</el-button>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <p v-else style="text-align: center">暂无批注</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-dialog
|
|
|
- title="添加课件审校批注"
|
|
|
- :visible="visible"
|
|
|
- width="680px"
|
|
|
- :close-on-click-modal="false"
|
|
|
- class="audit-dialog"
|
|
|
- @close="dialogClose"
|
|
|
- >
|
|
|
- <RichText
|
|
|
- v-model="remark_content"
|
|
|
- toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
|
- :wordlimit-num="false"
|
|
|
- :height="240"
|
|
|
- page-from="audit"
|
|
|
- />
|
|
|
- <div slot="footer">
|
|
|
- <el-button @click="dialogClose">取消</el-button>
|
|
|
- <el-button type="primary" :loading="submit_loading" @click="addCoursewareAuditRemark(select_node)">
|
|
|
- 确定
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ <CommonPreview :id="id" ref="preview" :project-id="project_id" :is-audit="true">
|
|
|
+ <template #operator="{ courseware }">
|
|
|
+ <span v-if="isTrue(courseware.is_can_add_audit_remark)" class="link" @click="addRemark">添加审校批注</span>
|
|
|
+ <span
|
|
|
+ v-if="isTrue(courseware.is_can_finish_audit)"
|
|
|
+ class="link"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('false')"
|
|
|
+ >
|
|
|
+ 审校完成
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="isTrue(courseware.is_can_audit_pass)"
|
|
|
+ class="link"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('true')"
|
|
|
+ >
|
|
|
+ 审核通过
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="isTrue(courseware.is_can_audit_reject)"
|
|
|
+ class="link"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('false')"
|
|
|
+ >
|
|
|
+ 审核驳回
|
|
|
+ </span>
|
|
|
+ <span class="link" @click="goBackBookList">返回教材列表</span>
|
|
|
+ </template>
|
|
|
+ </CommonPreview>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import MenuPage from '@/views/personal_workbench/common/menu.vue';
|
|
|
-import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
|
-import MenuPopover from '@/views/personal_workbench/common/MenuPopover.vue';
|
|
|
+import CommonPreview from '@/components/CommonPreview.vue';
|
|
|
|
|
|
import { isTrue } from '@/utils/common';
|
|
|
-import {
|
|
|
- GetBookCoursewareInfo,
|
|
|
- FinishCoursewareCurFlowNodeAudit,
|
|
|
- addCoursewareAuditRemark,
|
|
|
- getCoursewareAuditRemarkList,
|
|
|
- deleteCoursewareAuditRemarkList,
|
|
|
-} from '@/api/project';
|
|
|
-import { ContentGetCoursewareContent_View, ChapterGetBookChapterStructExpandList } from '@/api/book';
|
|
|
-
|
|
|
-import RichText from '@/components/RichText.vue';
|
|
|
+import { FinishCoursewareCurFlowNodeAudit } from '@/api/project';
|
|
|
|
|
|
export default {
|
|
|
name: 'AuditTaskPage',
|
|
|
components: {
|
|
|
MenuPage,
|
|
|
- CoursewarePreview,
|
|
|
- MenuPopover,
|
|
|
- RichText,
|
|
|
+ CommonPreview,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
id: this.$route.params.id || '',
|
|
|
project_id: this.$route.query.project_id || '',
|
|
|
- courseware_info: {
|
|
|
- is_can_add_audit_remark: 'false',
|
|
|
- is_can_finish_audit: 'false',
|
|
|
- is_can_audit_pass: 'false',
|
|
|
- is_can_audit_reject: 'false',
|
|
|
- cur_audit_flow_node_type: 0,
|
|
|
- },
|
|
|
- background: {
|
|
|
- background_image_url: '',
|
|
|
- background_position: {
|
|
|
- left: 0,
|
|
|
- top: 0,
|
|
|
- },
|
|
|
- },
|
|
|
- node_list: [],
|
|
|
- data: { row_list: [] },
|
|
|
- component_list: [],
|
|
|
isTrue,
|
|
|
- visible: false,
|
|
|
- remark_content: '',
|
|
|
- submit_loading: false, // 确定按钮loading
|
|
|
- select_node: '', // 选中节点课件id
|
|
|
- remark_list: [], // 批注列表
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getBookCoursewareInfo(this.id);
|
|
|
- this.getCoursewareComponentContent_View(this.id);
|
|
|
- this.getBookChapterStructExpandList();
|
|
|
- this.getCoursewareAuditRemarkList(this.id);
|
|
|
- },
|
|
|
methods: {
|
|
|
/**
|
|
|
- * 得到教材课件信息
|
|
|
- * @param {string} id - 课件ID
|
|
|
- */
|
|
|
- getBookCoursewareInfo(id) {
|
|
|
- GetBookCoursewareInfo({ id, is_contain_producer: 'true', is_contain_auditor: 'true' }).then(
|
|
|
- ({ courseware_info }) => {
|
|
|
- this.courseware_info = courseware_info;
|
|
|
- },
|
|
|
- );
|
|
|
- },
|
|
|
- /**
|
|
|
- * 得到课件内容(展示内容)
|
|
|
- * @param {string} id - 课件ID
|
|
|
- */
|
|
|
- getCoursewareComponentContent_View(id) {
|
|
|
- ContentGetCoursewareContent_View({ id }).then(({ content, component_list }) => {
|
|
|
- if (content) {
|
|
|
- this.data = JSON.parse(content);
|
|
|
- } else {
|
|
|
- this.data = { row_list: [] };
|
|
|
- }
|
|
|
-
|
|
|
- if (component_list) this.component_list = component_list;
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 得到教材章节结构展开列表
|
|
|
- */
|
|
|
- getBookChapterStructExpandList() {
|
|
|
- ChapterGetBookChapterStructExpandList({
|
|
|
- book_id: this.project_id,
|
|
|
- node_deep_mode: 0,
|
|
|
- is_contain_producer: 'true',
|
|
|
- is_contain_auditor: 'true',
|
|
|
- }).then(({ node_list }) => {
|
|
|
- this.node_list = node_list;
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 选择节点
|
|
|
- * @param {string} nodeId - 节点ID
|
|
|
- */
|
|
|
- selectNode(nodeId) {
|
|
|
- this.getCoursewareComponentContent_View(nodeId);
|
|
|
- this.getBookCoursewareInfo(nodeId);
|
|
|
- this.getCoursewareAuditRemarkList(nodeId);
|
|
|
- this.select_node = nodeId;
|
|
|
- },
|
|
|
- /**
|
|
|
* 提交课件到审校流程
|
|
|
* @param {'true'|'false'} is_pass - 是否通过审校
|
|
|
*/
|
|
@@ -217,66 +72,7 @@ export default {
|
|
|
|
|
|
// 点击添加审校意见
|
|
|
addRemark() {
|
|
|
- this.remark_content = '';
|
|
|
- this.visible = true;
|
|
|
- },
|
|
|
-
|
|
|
- dialogClose() {
|
|
|
- this.visible = false;
|
|
|
- },
|
|
|
-
|
|
|
- // 添加审校批注
|
|
|
- addCoursewareAuditRemark(id) {
|
|
|
- this.submit_loading = true;
|
|
|
- addCoursewareAuditRemark({
|
|
|
- courseware_id: id || this.id,
|
|
|
- content: this.remark_content,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.submit_loading = false;
|
|
|
- if (res.status === 1) {
|
|
|
- this.visible = false;
|
|
|
- this.getCoursewareAuditRemarkList(id || this.id);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.submit_loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 审校批注列表
|
|
|
- getCoursewareAuditRemarkList(id) {
|
|
|
- this.remark_list = [];
|
|
|
- getCoursewareAuditRemarkList({
|
|
|
- courseware_id: id,
|
|
|
- }).then((res) => {
|
|
|
- if (res.status === 1) {
|
|
|
- this.remark_list = res.remark_list;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 删除批注
|
|
|
- deleteRemarks(id) {
|
|
|
- let _this = this;
|
|
|
- _this
|
|
|
- .$confirm('确定要删除此条批注吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- .then(function () {
|
|
|
- deleteCoursewareAuditRemarkList({ id }).then((res) => {
|
|
|
- if (res.status === 1) {
|
|
|
- _this.getCoursewareAuditRemarkList(_this.select_node ? _this.select_node : _this.id);
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!',
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ this.$refs.preview.addRemark();
|
|
|
},
|
|
|
},
|
|
|
};
|