|
@@ -49,6 +49,18 @@
|
|
|
</ul>
|
|
|
<p v-else style="text-align: center">暂无批注</p>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="sidebar">
|
|
|
+ <div
|
|
|
+ v-for="{ icon, title, handle } in sidebarIconList"
|
|
|
+ :key="icon"
|
|
|
+ :title="title"
|
|
|
+ class="sidebar-icon"
|
|
|
+ @click="handleSidebarClick(handle)"
|
|
|
+ >
|
|
|
+ <SvgIcon :icon-class="`sidebar-${icon}`" size="24" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<el-dialog
|
|
@@ -57,7 +69,7 @@
|
|
|
width="680px"
|
|
|
:close-on-click-modal="false"
|
|
|
class="audit-dialog"
|
|
|
- @close="dialogClose"
|
|
|
+ @close="dialogClose('')"
|
|
|
>
|
|
|
<RichText
|
|
|
v-model="remark_content"
|
|
@@ -73,6 +85,16 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="" :visible="visibleMindMap" width="1100px" class="audit-dialog" @close="dialogClose('MindMap')">
|
|
|
+ <MindMap
|
|
|
+ v-if="isChildDataLoad"
|
|
|
+ ref="mindMapRef"
|
|
|
+ :project-id="projectId"
|
|
|
+ :mind-map-json-data="mindMapJsonData"
|
|
|
+ @child-click="handleNodeClick"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -81,6 +103,7 @@ import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview
|
|
|
import MenuPopover from '@/views/personal_workbench/common/MenuPopover.vue';
|
|
|
import RichText from '@/components/RichText.vue';
|
|
|
import { isTrue } from '@/utils/common';
|
|
|
+import MindMap from '@/components/MindMap.vue';
|
|
|
|
|
|
import {
|
|
|
GetBookCoursewareInfo,
|
|
@@ -89,7 +112,12 @@ import {
|
|
|
AddCoursewareAuditRemark,
|
|
|
DeleteCoursewareAuditRemarkList,
|
|
|
} from '@/api/project';
|
|
|
-import { ContentGetCoursewareContent_View, ChapterGetBookChapterStructExpandList, GetBookBaseInfo } from '@/api/book';
|
|
|
+import {
|
|
|
+ ContentGetCoursewareContent_View,
|
|
|
+ ChapterGetBookChapterStructExpandList,
|
|
|
+ GetBookBaseInfo,
|
|
|
+ MangerGetBookMindMap,
|
|
|
+} from '@/api/book';
|
|
|
|
|
|
export default {
|
|
|
name: 'CommonPreview',
|
|
@@ -97,6 +125,7 @@ export default {
|
|
|
CoursewarePreview,
|
|
|
MenuPopover,
|
|
|
RichText,
|
|
|
+ MindMap,
|
|
|
},
|
|
|
props: {
|
|
|
projectId: {
|
|
@@ -150,6 +179,7 @@ export default {
|
|
|
remark_list: [],
|
|
|
remark_list_obj: {}, // 存放以组件为对象的数组
|
|
|
visible: false,
|
|
|
+
|
|
|
remark_content: '',
|
|
|
submit_loading: false,
|
|
|
isTrue,
|
|
@@ -158,6 +188,20 @@ export default {
|
|
|
y: -1,
|
|
|
componentId: 'WHOLE',
|
|
|
},
|
|
|
+ sidebarIconList: [
|
|
|
+ { icon: 'search', title: '搜索', handle: '' },
|
|
|
+ { icon: 'mindmap', title: '思维导图', handle: 'openMindMap' },
|
|
|
+ { icon: 'connect', title: '连接', handle: '' },
|
|
|
+ { icon: 'audio', title: '音频', handle: '' },
|
|
|
+ { icon: 'image', title: '图片', handle: '' },
|
|
|
+ { icon: 'video', title: '视频', handle: '' },
|
|
|
+ { icon: 'text', title: '文本', handle: '' },
|
|
|
+ { icon: 'collect', title: '收藏', handle: '' },
|
|
|
+ { icon: 'setting', title: '设置', handle: '' },
|
|
|
+ ],
|
|
|
+ visibleMindMap: false,
|
|
|
+ isChildDataLoad: false,
|
|
|
+ mindMapJsonData: {}, // 思维导图json数据
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -268,8 +312,8 @@ export default {
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
- dialogClose() {
|
|
|
- this.visible = false;
|
|
|
+ dialogClose(type) {
|
|
|
+ this[`visible${type}`] = false;
|
|
|
},
|
|
|
// 添加审校批注
|
|
|
addCoursewareAuditRemark(id) {
|
|
@@ -313,6 +357,28 @@ export default {
|
|
|
this.select_node,
|
|
|
);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 处理侧边栏图标点击事件
|
|
|
+ * @param {string} handle - 处理函数名
|
|
|
+ * @param {any} param - 处理函数参数
|
|
|
+ */
|
|
|
+ handleSidebarClick(handle, param) {
|
|
|
+ if (typeof handle === 'string' && handle && typeof this[handle] === 'function') {
|
|
|
+ this[handle](param);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openMindMap() {
|
|
|
+ MangerGetBookMindMap({ book_id: this.projectId }).then(({ content }) => {
|
|
|
+ if (content) {
|
|
|
+ this.mindMapJsonData = JSON.parse(content);
|
|
|
+ this.isChildDataLoad = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.visibleMindMap = true;
|
|
|
+ },
|
|
|
+ handleNodeClick(data) {
|
|
|
+ console.log('子组件触发了事件', data); // 节点UID
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -427,12 +493,12 @@ export default {
|
|
|
|
|
|
.audit-content {
|
|
|
display: flex;
|
|
|
- column-gap: 20px;
|
|
|
min-width: 1400px;
|
|
|
height: calc(100vh - 175px);
|
|
|
|
|
|
.remark-list {
|
|
|
width: 300px;
|
|
|
+ margin-left: 20px;
|
|
|
overflow: auto;
|
|
|
border: 1px solid #e5e5e5;
|
|
|
|
|
@@ -477,6 +543,21 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .sidebar {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ row-gap: 16px;
|
|
|
+ align-items: center;
|
|
|
+ height: 100%;
|
|
|
+ padding: 12px 8px;
|
|
|
+ margin-left: 8px;
|
|
|
+ box-shadow: -4px 0 4px rgba(0, 0, 0, 10%);
|
|
|
+
|
|
|
+ &-icon {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|