From 3dbbc6a22360fa65c66609285f10bffc3a32334d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期五, 22 十月 2021 16:23:08 +0800
Subject: [PATCH] AjaxResult重写put方法,以方便链式调用
---
ruoyi-ui/src/views/monitor/online/index.vue | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue
index 17104de..ab66827 100644
--- a/ruoyi-ui/src/views/monitor/online/index.vue
+++ b/ruoyi-ui/src/views/monitor/online/index.vue
@@ -1,7 +1,7 @@
<template>
<div class="app-container">
- <el-form :inline="true">
- <el-form-item label="鐧诲綍鍦板潃">
+ <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+ <el-form-item label="鐧诲綍鍦板潃" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="璇疯緭鍏ョ櫥褰曞湴鍧�"
@@ -10,7 +10,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
- <el-form-item label="鐢ㄦ埛鍚嶇О">
+ <el-form-item label="鐢ㄦ埛鍚嶇О" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="璇疯緭鍏ョ敤鎴峰悕绉�"
@@ -21,9 +21,10 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
- </el-form>
+ </el-form>
<el-table
v-loading="loading"
:data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
@@ -38,7 +39,7 @@
<el-table-column label="鐧诲綍鍚嶇О" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="閮ㄩ棬鍚嶇О" align="center" prop="deptName" />
<el-table-column label="涓绘満" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
- <el-table-column label="鐧诲綍鍦扮偣" align="center" prop="loginLocation" />
+ <el-table-column label="鐧诲綍鍦扮偣" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="娴忚鍣�" align="center" prop="browser" />
<el-table-column label="鎿嶄綔绯荤粺" align="center" prop="os" />
<el-table-column label="鐧诲綍鏃堕棿" align="center" prop="loginTime" width="180">
@@ -67,6 +68,7 @@
import { list, forceLogout } from "@/api/monitor/online";
export default {
+ name: "Online",
data() {
return {
// 閬僵灞�
@@ -102,18 +104,19 @@
this.pageNum = 1;
this.getList();
},
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ resetQuery() {
+ this.resetForm("queryForm");
+ this.handleQuery();
+ },
/** 寮洪��鎸夐挳鎿嶄綔 */
handleForceLogout(row) {
- this.$confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勬暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return forceLogout(row.tokenId);
- }).then(() => {
- this.getList();
- this.msgSuccess("寮洪��鎴愬姛");
- }).catch(function() {});
+ this.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勬暟鎹」锛�').then(function() {
+ return forceLogout(row.tokenId);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("寮洪��鎴愬姛");
+ }).catch(() => {});
}
}
};
--
Gitblit v1.9.3