소스 검색

删除激活

dsy 3 주 전
부모
커밋
3b1d7678e3
2개의 변경된 파일20개의 추가작업 그리고 25개의 파일을 삭제
  1. 1 1
      src/utils/http.js
  2. 19 24
      src/views/project_manage/org/offlinepackauth/index.vue

+ 1 - 1
src/utils/http.js

@@ -7,7 +7,7 @@ import { Message } from 'element-ui';
 
 const service = axios.create({
   baseURL: getLocalStore('server_address') || process.env.VUE_APP_EEP,
-  timeout: 60000,
+  timeout: 300000,
 });
 
 // 请求拦截器

+ 19 - 24
src/views/project_manage/org/offlinepackauth/index.vue

@@ -51,14 +51,13 @@
         </el-table-column>
         <el-table-column prop="creator_name" label="创建人" width="120" align="center" />
         <el-table-column prop="create_time" label="创建时间" width="160" align="center" />
-        <el-table-column label="操作" fixed="right" width="220" align="center">
+        <el-table-column label="操作" fixed="right" width="180" align="center">
           <template slot-scope="{ row }">
             <span class="link" @click="selectDirectory(row.id)">导出离线包</span>
+            <el-divider direction="vertical" />
             <span class="link" @click="handleDisable(row.id)">废弃</span>
             <el-divider direction="vertical" />
             <span class="link" @click="handleDel(row.id)">删除</span>
-            <el-divider direction="vertical" />
-            <span class="link" @click="handleActive('', row.id)">激活</span>
           </template>
         </el-table-column>
         <el-table-column prop="memo" label="备注" />
@@ -126,7 +125,6 @@ import {
   AddBookOfflinePackAuth,
   DeleteBookOfflinePackAuth,
   DisableBookOfflinePackAuth,
-  BookOfflinePackActivate,
   PageQueryBookOfflinePackAuthList,
   CreateBookOfflinePackChapterStructFileList,
   CreateOfflinePackCoursewareFileList,
@@ -295,11 +293,6 @@ export default {
         })
         .catch(() => {});
     },
-    handleActive(id) {
-      BookOfflinePackActivate({ id }).then(() => {
-        this.queryList();
-      });
-    },
 
     /**
      * 选择保存离线包的目录
@@ -356,21 +349,23 @@ export default {
       }
 
       if (courseware_id_list && courseware_id_list.length > 0) {
-        this.downloadWatcher = this.$watch(
-          'downloadProgress',
-          (newVal) => {
-            if (newVal >= 100) {
-              this.downloadWatcher();
-              this.startCompress();
-            } else {
-              // 显示下载进度,预留 10% 的压缩进度
-              this.loadingInstance.text = `正在下载离线包,进度:${((this.downloadCompleted / (this.downloadTotal + this.downloadTotal * 0.1)) * 100).toFixed(2)}%`;
-            }
-          },
-          { immediate: true },
-        );
-
-        Promise.all(courseware_id_list.map((courseware_id) => this.CreateOfflinePackCoursewareFileList(courseware_id)));
+        Promise.all(
+          courseware_id_list.map((courseware_id) => this.CreateOfflinePackCoursewareFileList(courseware_id)),
+        ).then(() => {
+          this.downloadWatcher = this.$watch(
+            'downloadProgress',
+            (newVal) => {
+              if (newVal >= 100) {
+                this.downloadWatcher();
+                this.startCompress();
+              } else {
+                // 显示下载进度,预留 10% 的压缩进度
+                this.loadingInstance.text = `正在下载离线包,进度:${((this.downloadCompleted / (this.downloadTotal + this.downloadTotal * 0.1)) * 100).toFixed(2)}%`;
+              }
+            },
+            { immediate: true },
+          );
+        });
       }
     },