zq 3 недель назад
Родитель
Сommit
ea188959d3

+ 7 - 0
src/api/book.js

@@ -359,3 +359,10 @@ export function GetBookKnowledgeGraph(data) {
 export function SaveBookKnowledgeGraph(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-SaveBookKnowledgeGraph`, data);
 }
+/**
+ * @description 搜索教材内容文本
+ * @param {object} data
+ */
+export function SearchBookContentText(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-SearchBookContentText`, data);
+}

+ 50 - 0
src/components/CommonPreview.vue

@@ -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>

+ 2 - 2
src/views/project_manage/org/offlinepackauth/index.vue

@@ -37,9 +37,9 @@
             {{ isTrue(row.is_activated) ? '已激活' : '未激活' }}
           </template>
         </el-table-column>
-        <el-table-column label="激活时间" width="120" align="center">
+        <el-table-column label="激活时间" width="160" align="center">
           <template slot-scope="{ row }">
-            <span v-if="isTrue(row.is_activated)" style="color: red">{{ row.effective_end_date }}</span>
+            <span v-if="isTrue(row.is_activated)">{{ row.activate_time }}</span>
             <span v-else>--</span>
           </template>
         </el-table-column>