From e235d5aa57314fbad9d30a77bab14bf917edb133 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 11 十月 2019 10:50:47 +0800 Subject: [PATCH] 新增在线用户 --- ruoyi-ui/src/views/monitor/online/index.vue | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 118 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue index 764613a..17104de 100644 --- a/ruoyi-ui/src/views/monitor/online/index.vue +++ b/ruoyi-ui/src/views/monitor/online/index.vue @@ -1,5 +1,121 @@ <template> <div class="app-container"> - 鍦ㄧ嚎鐢ㄦ埛 + <el-form :inline="true"> + <el-form-item label="鐧诲綍鍦板潃"> + <el-input + v-model="queryParams.ipaddr" + placeholder="璇疯緭鍏ョ櫥褰曞湴鍧�" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鐢ㄦ埛鍚嶇О"> + <el-input + v-model="queryParams.userName" + placeholder="璇疯緭鍏ョ敤鎴峰悕绉�" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + </el-form-item> + </el-form> + + <el-table + v-loading="loading" + :data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)" + style="width: 100%;" + > + <el-table-column label="搴忓彿" type="index" align="center"> + <template slot-scope="scope"> + <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span> + </template> + </el-table-column> + <el-table-column label="浼氳瘽缂栧彿" align="center" prop="tokenId" :show-overflow-tooltip="true" /> + <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="browser" /> + <el-table-column label="鎿嶄綔绯荤粺" align="center" prop="os" /> + <el-table-column label="鐧诲綍鏃堕棿" align="center" prop="loginTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.loginTime) }}</span> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleForceLogout(scope.row)" + v-hasPermi="['monitor:online:forceLogout']" + >寮洪��</el-button> + </template> + </el-table-column> + </el-table> + + <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" /> </div> -</template> \ No newline at end of file +</template> + +<script> +import { list, forceLogout } from "@/api/monitor/online"; + +export default { + data() { + return { + // 閬僵灞� + loading: true, + // 鎬绘潯鏁� + total: 0, + // 琛ㄦ牸鏁版嵁 + list: [], + pageNum: 1, + pageSize: 10, + // 鏌ヨ鍙傛暟 + queryParams: { + ipaddr: undefined, + userName: undefined + } + }; + }, + created() { + this.getList(); + }, + methods: { + /** 鏌ヨ鐧诲綍鏃ュ織鍒楄〃 */ + getList() { + this.loading = true; + list(this.queryParams).then(response => { + this.list = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.pageNum = 1; + this.getList(); + }, + /** 寮洪��鎸夐挳鎿嶄綔 */ + handleForceLogout(row) { + this.$confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勬暟鎹」?', "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(function() { + return forceLogout(row.tokenId); + }).then(() => { + this.getList(); + this.msgSuccess("寮洪��鎴愬姛"); + }).catch(function() {}); + } + } +}; +</script> + -- Gitblit v1.9.3