| | |
| | | <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> |
| | | <el-input v-model="form.currentOnlineUser" :readOnly="true"></el-input> |
| | | <el-button plain type="primary" style="margin-left: 10px" @click="getOnlineUsersNum"> 刷新</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getOnlineUsersNum |
| | | } from "@/api/systemModel/systemConfig/api" |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | form: { |
| | | name: '0' |
| | | currentOnlineUser: '0' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getOnlineUsersNum(); |
| | | }, |
| | | methods: { |
| | | // 左侧树查询 |
| | | getOnlineUsersNum() { |
| | | getOnlineUsersNum().then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.obj; |
| | | this.form.currentOnlineUser = data; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |