From 960bdbc77b153b97d8e49c8eaf88497353204307 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期五, 27 十二月 2024 17:57:03 +0800
Subject: [PATCH] 系统运行监控调试接口以页面处理

---
 Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue |   76 ++++++++++++++++++++++++++++++++-----
 1 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue
index 24f5dce..df30d90 100644
--- a/Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue
@@ -1,27 +1,81 @@
 <template>
   <basic-container>
-    <div class="container">
-      <el-form ref="form" :model="form" label-width="150px">
-        <el-form-item label="褰撳墠鍦ㄧ嚎鐢ㄦ埛浜烘暟">
-          <div style="display: flex;">
-            <el-input v-model="form.name" :readOnly="true"></el-input>
-            <el-button plain style="margin-left: 10px"> 鍒锋柊</el-button>
-          </div>
-        </el-form-item>
-      </el-form>
+    <div style="display: flex;justify-content: space-between;align-items: center">
+      <h3>褰撳墠鍦ㄧ嚎浜哄憳淇℃伅</h3>
+      <el-button type="primary" size="small" plain style="margin-right: 10px" @click="getOnlinUsersHandler">鍒锋柊</el-button>
     </div>
+    <avue-crud :data="data" :option="option" :table-loading="loading" ></avue-crud>
   </basic-container>
 </template>
 
 <script>
+import {
+  getOnlinUsers
+} from "@/api/systemModel/systemConfig/api"
+import basicOption from '@/util/basic-option';
+import func from "@/util/func";
 export default {
   name: "index",
   data() {
     return {
-      form: {
-        name: '0'
+      loading:false,
+      data:[],
+      option:{
+        ...basicOption,
+        refreshBtn:false,
+        addBtn:false,
+        menu:false,
+        column:[
+          {
+            label:'鐢ㄦ埛OID',
+            prop:'oid',
+            overHidden:true,
+          },
+          {
+            label:'鐢ㄦ埛璐﹀彿',
+            prop:'userId'
+          },
+          {
+            label:'鐢ㄦ埛濮撳悕',
+            prop:'userName'
+          },
+          {
+            label:'鏈哄櫒ip',
+            prop:'ip'
+          },
+          {
+            label:'鐧诲綍鏃堕棿',
+            prop:'loginTime'
+          },
+          {
+            label:'鏈�鍚庢搷浣滄椂闂�',
+            prop:'lastRequestTs'
+          }
+        ]
       }
     }
+  },
+  created() {
+    this.getOnlinUsersHandler();
+  },
+  methods: {
+    // 宸︿晶鏍戞煡璇�
+    getOnlinUsersHandler() {
+      this.loading = true;
+      getOnlinUsers().then(res => {
+        if (res.data.code === 200) {
+          const data = res.data.data;
+          this.data = data.map(item => {
+            return{
+              ...item,
+              loginTime:func.formattedDate(item.loginTime),
+              lastRequestTs:func.formattedDate(item.lastRequestTs),
+            }
+          })
+          this.loading = false;
+        }
+      })
+    }
   }
 }
 </script>

--
Gitblit v1.9.3