zhaoke 3 жил өмнө
parent
commit
f30898293f

+ 10 - 0
src/api/apiLog.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+//岗位列表查询
+export function GetLogList (params) {
+  return request({
+    url: '/api/fs4a/log4a/v1',
+    method: 'post',
+    data: params
+  })
+}

+ 41 - 15
src/views/dashboard/components/journal.vue

@@ -16,11 +16,31 @@
     </div>
     <div class="journal-content">
       <el-table :data="tableData" :row-class-name="tableRowClassName" class="table" style="width: 100%">
-        <el-table-column prop="name" label="应用名称"></el-table-column>
-        <el-table-column prop="ip" label="IP"></el-table-column>
-        <el-table-column prop="cont" label="内容"></el-table-column>
-        <el-table-column prop="result" label="结果"></el-table-column>
-        <el-table-column prop="date" label="日志时间"></el-table-column>
+        <el-table-column label="应用名称">
+          <template slot-scope="scope">
+            <div>{{ scope.row.appName ? scope.row.appName : '暂无数据' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="IP">
+          <template slot-scope="scope">
+            <div>{{ scope.row.OperateIP ? scope.row.OperateIP :'暂无数据' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="内容">
+          <template slot-scope="scope">
+            <div>{{ scope.row.Msg ? scope.row.Msg: '暂无数据' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="结果">
+          <template slot-scope="scope">
+            <div>{{ scope.row.OperateResult ? scope.row.OperateResult: '暂无数据' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="日志时间">
+          <template slot-scope="scope">
+            <div>{{ scope.row.BeginTime ? scope.row.BeginTime: '暂无数据' }}</div>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
   </div>
@@ -28,24 +48,17 @@
 
 <script>
 import Search from '@/layout/components/Search'
+import { GetLogList } from '@/api/apiLog'
 export default {
   name: 'Journal',
   components: { Search },
   data () {
     return {
-      tableData: []
+      tableData: [],
     }
   },
   created () {
-    for (let i = 0; i < 10; i++) {
-      this.tableData.push({
-        name: '名称' + i,
-        ip: '192.168.1.1',
-        cont: '内容',
-        result: '成功',
-        date: '2021-11-25 16:59:42'
-      })
-    }
+    this.getLogList({});
   },
   methods: {
     tableRowClassName ({ row, rowIndex }) {
@@ -54,6 +67,19 @@ export default {
       } else {
         return 'success-row';
       }
+    },
+    async getLogList (params) {
+      try {
+        const res = await GetLogList(params);
+        if (res.code == 0) {
+          this.tableData = res.returnData;
+        } else {
+          this.tableData = [];
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log(error);
+      }
     }
   }
 }