|
|
@@ -140,6 +140,34 @@
|
|
|
</div>
|
|
|
</aside>
|
|
|
<div class="content">
|
|
|
+ <div v-if="curToolbarIcon === 'search'" class="resource_box">
|
|
|
+ <h5>{{ drawerTitle }}</h5>
|
|
|
+ <div style="height: 40px"></div>
|
|
|
+ <el-row :gutter="10" style="margin: 5px -5px">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-input v-model="searchContent" placeholder="请输入文本内容" clearable />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="querySearchList"> 查询 </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div>
|
|
|
+ <el-table :data="searchList">
|
|
|
+ <!-- <el-table-column v-if="false" prop="text" label="文字">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ searchContent }}
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="courseware_name" label="课件" />
|
|
|
+ <el-table-column prop="component_type" label="组件" />
|
|
|
+ <el-table-column label="" width="50">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-link type="primary" @click="handLocation(row, 3)">定位</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<template v-if="curToolbarIcon === 'audit'">
|
|
|
<AuditRemark :remark-list="remark_list" :is-audit="isShowAudit" @deleteRemarks="deleteRemarks" />
|
|
|
</template>
|
|
|
@@ -309,6 +337,7 @@ import {
|
|
|
AddMyCollect,
|
|
|
GetMyCollectList,
|
|
|
DeleteMyCollect,
|
|
|
+ SearchBookContentText,
|
|
|
} from '@/api/book';
|
|
|
|
|
|
export default {
|
|
|
@@ -360,6 +389,7 @@ export default {
|
|
|
{ icon: 'mindmap', title: '思维导图', handle: 'openMindMap', param: {} },
|
|
|
{ icon: 'knowledge', title: '知识图谱', handle: 'openVisNetwork', param: {} },
|
|
|
// { icon: 'totalResources', title: '总资源', handle: '', param: {} },
|
|
|
+ { icon: 'search', title: '搜索', handle: 'getSearch', param: { type: '5' } },
|
|
|
{ icon: 'collect', title: '收藏', handle: 'getCollect', param: { type: '3' } },
|
|
|
{ icon: 'audio', title: '音频', handle: 'openDrawer', param: { type: '1' } },
|
|
|
{ icon: 'image', title: '图片', handle: 'openDrawer', param: { type: '0' } },
|
|
|
@@ -401,6 +431,8 @@ export default {
|
|
|
content_group_row_list: [],
|
|
|
remark_list: [],
|
|
|
remark_list_obj: {}, // 存放以组件为对象的数组
|
|
|
+ searchList: [],
|
|
|
+ searchContent: '',
|
|
|
visible: false,
|
|
|
remark_content: '',
|
|
|
submit_loading: false,
|
|
|
@@ -465,6 +497,7 @@ export default {
|
|
|
2: '视频资源',
|
|
|
3: '收藏列表',
|
|
|
4: '笔记列表',
|
|
|
+ 5: '搜索结果',
|
|
|
};
|
|
|
return titleMap[this.drawerType] || '资源列表';
|
|
|
},
|
|
|
@@ -875,6 +908,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handLocation(item, type) {
|
|
|
+ if (type == 3) {
|
|
|
+ var did = item.courseware_id + '#' + item.component_id;
|
|
|
+ this.handleNodeClick(did);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.$refs.courserware && this.$refs.courserware.handLocation) {
|
|
|
item.type = type;
|
|
|
this.$refs.courserware.handLocation(item);
|
|
|
@@ -1053,6 +1091,18 @@ export default {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
+ getSearch(params) {
|
|
|
+ if (params && params.type) this.drawerType = Number(params.type);
|
|
|
+ },
|
|
|
+ async querySearchList() {
|
|
|
+ this.searchList = [];
|
|
|
+ if (!this.searchContent) return;
|
|
|
+ await SearchBookContentText({ book_id: this.projectId, text: this.searchContent }).then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.searchList = res.courseware_component_list;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|