bug
This commit is contained in:
@ -2,32 +2,34 @@
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-input v-model="query.filter" clearable size="small" placeholder="全表模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
<el-input v-model="query.filter" clearable size="small" placeholder="全表模糊搜索" style="width: 200px;"
|
||||
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
||||
<rrOperation :crud="crud"/>
|
||||
</div>
|
||||
<crudOperation>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:loading="delLoading"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="doDelete(crud.selections)"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:loading="delLoading"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="doDelete(crud.selections)"
|
||||
>
|
||||
强退
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="columns.visible('userName')" prop="userName" label="用户名" />
|
||||
<el-table-column v-if="columns.visible('nickName')" prop="nickName" label="用户昵称" />
|
||||
<el-table-column v-if="columns.visible('ip')" prop="ip" label="登录IP" />
|
||||
<el-table-column v-if="columns.visible('address')" :show-overflow-tooltip="true" prop="address" label="登录地点" />
|
||||
<el-table-column v-if="columns.visible('browser')" prop="browser" label="浏览器" />
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column v-if="columns.visible('userName')" prop="userName" label="用户名"/>
|
||||
<el-table-column v-if="columns.visible('nickName')" prop="nickName" label="用户昵称"/>
|
||||
<el-table-column v-if="columns.visible('ip')" prop="ip" label="登录IP"/>
|
||||
<el-table-column v-if="columns.visible('address')" :show-overflow-tooltip="true" prop="address" label="登录地点"/>
|
||||
<el-table-column v-if="columns.visible('browser')" prop="browser" label="浏览器"/>
|
||||
<el-table-column v-if="columns.visible('loginTime')" prop="loginTime" label="登录时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.loginTime) }}</span>
|
||||
@ -36,15 +38,17 @@
|
||||
<el-table-column label="操作" width="100px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:ref="scope.$index"
|
||||
v-permission="['admin']"
|
||||
placement="top"
|
||||
width="180"
|
||||
:ref="scope.$index"
|
||||
v-permission="['admin']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定强制退出该用户吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.$index].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.key, scope.$index)">确定</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row, scope.$index)">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" size="mini" type="text">强退</el-button>
|
||||
</el-popover>
|
||||
@ -52,22 +56,22 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { delT } from '@/api/monitor/online'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import {delT} from '@/api/monitor/online'
|
||||
import CRUD, {presenter, header, crud} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ url: 'auth/online', title: '在线用户', query: { type: 1 }})
|
||||
const defaultCrud = CRUD({url: 'auth/online', title: '在线用户', query: {type: 1}})
|
||||
export default {
|
||||
name: 'OnlineUser',
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
components: {pagination, crudOperation, rrOperation},
|
||||
mixins: [presenter(defaultCrud), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
@ -97,16 +101,19 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.delMethod(datas)
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 踢出用户
|
||||
delMethod(key, index) {
|
||||
delMethod(data, index) {
|
||||
const ids = []
|
||||
if (key instanceof Array) {
|
||||
key.forEach(val => {
|
||||
ids.push(val.key)
|
||||
if (data instanceof Array) {
|
||||
data.forEach(val => {
|
||||
ids.push(data.nickName + ":" + data.key)
|
||||
})
|
||||
} else ids.push(key)
|
||||
} else {
|
||||
ids.push(data.nickName + ":" + data.key)
|
||||
}
|
||||
this.delLoading = true
|
||||
delT(ids).then(() => {
|
||||
this.delLoading = false
|
||||
|
Reference in New Issue
Block a user