Selaa lähdekoodia

日志管理功能代码提交

jingyuanchao 1 vuosi sitten
vanhempi
commit
64102f88d6
2 muutettua tiedostoa jossa 21 lisäystä ja 15 poistoa
  1. 2 2
      src/api/system/logManagement.js
  2. 19 13
      src/views/system/logManagement/dialog.info.vue

+ 2 - 2
src/api/system/logManagement.js

@@ -36,9 +36,9 @@ export function getLogList(serverId, checkId) {
 }
 
 // 转存目标服务器上的日志到 挂载目录下
-export function transferLog(data) {
+export function transferLogData(data) {
   return request({
-    url: '/system/transferLog',
+    url: '/system/server/transferLog',
     method: 'post',
     data: data
   })

+ 19 - 13
src/views/system/logManagement/dialog.info.vue

@@ -3,11 +3,11 @@
     <DialogCom :title="this.title" :visible.sync="isShow" append-to-body>
       <div class="page-body">
         <div class="extend_mod" style="max-height: 500px;">
-          <el-table :data="logList" border style="width: 100%;max-height: 500px;overflow-y: auto;">
+          <el-table :data="logList" border style="width: 100%;max-height: 500px;overflow-y: auto;" row-key="id" :default-expand-all="false" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
             <el-table-column
               prop="fileName"
               label="文件名称"
-              align="center"
+              align="left"
             ></el-table-column>
             <el-table-column
               prop="fileType"
@@ -36,21 +36,16 @@
                   size="mini"
                   type="text"
                   icon="el-icon-edit-outline"
+                  v-if="scope.row.fileType ==1 "
                   @click="transferLog(scope.row)"
                 >获取日志
                 </el-button>
                 <el-button
                   size="mini"
                   type="text"
-                  icon="el-icon-edit-outline"
-                  @click="transferLog(scope.row)"
-                >重新获取
-                </el-button>
-                <el-button
-                  size="mini"
-                  type="text"
                   icon="el-icon-delete"
-                  @click="handleDelete(scope.row)"
+                  v-if="scope.row.exit == 1"
+
                 >下载
                 </el-button>
               </template>
@@ -68,7 +63,7 @@
 
 <script>
 import {mapMutations, mapState} from "vuex";
-import {getLogList} from "@/api/system/logManagement";
+import {getLogList, transferLogData} from "@/api/system/logManagement";
 import {getLabel} from "@/views/commonOption";
 
 export default {
@@ -122,8 +117,19 @@ export default {
     },
 
     transferLog(row) {
-
-
+      console.log(row)
+      let data = {
+        serverId: this.serverId,
+        parentPath: row.parentPath,
+        path: row.path,
+        rootDir: row.path,
+      };
+      transferLogData(data).then((response) => {
+        this.$message.success("获取成功");
+      });
+    },
+    checkExit(row) {
+      return;
     },
     // 事件
     onHide() {