¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> |
| | | <el-form-item label="ç»å½å°å" prop="ipaddr"> |
| | | <el-input |
| | | v-model="queryParams.ipaddr" |
| | | placeholder="请è¾å
¥ç»å½å°å" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·åç§°" prop="userName"> |
| | | <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</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" :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"> |
| | | <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> |
| | | |
| | | <script> |
| | | import { list, forceLogout } from "@/api/monitor/online"; |
| | | |
| | | export default { |
| | | name: "Online", |
| | | 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(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | /** 强éæé®æä½ */ |
| | | handleForceLogout(row) { |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å¼ºéå称为"' + row.userName + '"çç¨æ·ï¼').then(function() { |
| | | return forceLogout(row.tokenId); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("强éæå"); |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |