| | |
| | | <template> |
| | | |
| | | <basic-container> |
| | | <div style="display: flex;justify-content: space-between;align-items: center"> |
| | | <h3>当前在线人员信息</h3> |
| | | <el-button v-if="permissionList.referBtn" class="button-custom-icon" type="primary" size="small" plain style="margin-right: 10px" @click="getOnlinUsersHandler"> |
| | | <icon-show :name="permissionList.referBtn.source"></icon-show> |
| | | 刷新 |
| | | </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"; |
| | | import {mapGetters} from "vuex"; |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | 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' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | referBtn: this.vaildData(this.permission[this.$route.query.id].REFRESH, false), |
| | | }; |
| | | }, |
| | | }, |
| | | 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> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |