|
|
@@ -1,5 +1,25 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div class="p-4">
|
|
|
+ <Row class="mb-2">
|
|
|
+ <Card class="w-1/4" style="width: 25%; text-align: center">
|
|
|
+ <img src="http://n.sinaimg.cn/sinacn12/149/w539h410/20181011/9663-hktxqai5109344.jpg" />
|
|
|
+ <p>当前会话数:16</p>
|
|
|
+ </Card>
|
|
|
+
|
|
|
+ <Card class="w-1/4" style="width: 25%; text-align: center">
|
|
|
+ <img src="http://n.sinaimg.cn/sinacn12/149/w539h410/20181011/9663-hktxqai5109344.jpg" />
|
|
|
+ <p>最大令牌发放数:162</p>
|
|
|
+ </Card>
|
|
|
+
|
|
|
+ <Card class="w-1/4" style="width: 25%; text-align: center">
|
|
|
+ <img src="http://n.sinaimg.cn/sinacn12/149/w539h410/20181011/9663-hktxqai5109344.jpg" />
|
|
|
+ <p>一小时内新增:0</p>
|
|
|
+ </Card>
|
|
|
+ <Card class="w-1/4" style="width: 25%; text-align: center">
|
|
|
+ <img src="http://n.sinaimg.cn/sinacn12/149/w539h410/20181011/9663-hktxqai5109344.jpg" />
|
|
|
+ <p>B/C端占比:1/0</p>
|
|
|
+ </Card>
|
|
|
+ </Row>
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.key === 'tenantName'">
|
|
|
@@ -16,6 +36,11 @@
|
|
|
<template v-if="column.key === 'action'">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
+ {
|
|
|
+ tooltip: '列表',
|
|
|
+ label: '列表',
|
|
|
+ onClick: handletoken.bind(null, record),
|
|
|
+ },
|
|
|
{
|
|
|
tooltip: '强制退出',
|
|
|
label: '强制退出',
|
|
|
@@ -30,19 +55,23 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
+ <formDrawer @register="registerDrawer" @success="handleSuccessDrawer" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { onBeforeMount, ref } from 'vue';
|
|
|
// import { Tag } from 'ant-design-vue';
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
+ import { Card, Row } from 'ant-design-vue';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { columns, searchFormSchema } from './data';
|
|
|
-
|
|
|
- import { onlineList, onlineForceLogout } from '/@/api/monitor/onlineApi';
|
|
|
+ import formDrawer from './FormDrawer.vue';
|
|
|
+ import { onlineList, onlineForceLogout } from '/@/api/sys/onlineApi';
|
|
|
import { listDictModel } from '/@/api/common';
|
|
|
import { formatToDateTime } from '/@/utils/dateUtil';
|
|
|
// import { formatDictValue } from '/@/utils';
|
|
|
+ import { useDrawer } from '/@/components/Drawer';
|
|
|
+ const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
|
|
|
const sysUserPlatformOptions = ref([]);
|
|
|
onBeforeMount(async () => {
|
|
|
@@ -56,7 +85,7 @@
|
|
|
rowKey: 'token',
|
|
|
columns,
|
|
|
formConfig: {
|
|
|
- labelWidth: 120,
|
|
|
+ labelWidth: 180,
|
|
|
schemas: searchFormSchema,
|
|
|
autoSubmitOnEnter: true,
|
|
|
baseColProps: { xs: 24, sm: 12, md: 12, lg: 8 },
|
|
|
@@ -68,13 +97,13 @@
|
|
|
},
|
|
|
},
|
|
|
showIndexColumn: true,
|
|
|
- useSearchForm: true,
|
|
|
+ // useSearchForm: true,
|
|
|
showTableSetting: true,
|
|
|
bordered: true,
|
|
|
striped: true,
|
|
|
actionColumn: {
|
|
|
// auth: ['monitor:onlineUser:forceLogout'],
|
|
|
- width: 80,
|
|
|
+ width: 160,
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
},
|
|
|
@@ -87,9 +116,31 @@
|
|
|
|
|
|
// 强制退出按钮事件
|
|
|
async function handleForce(record: Recordable) {
|
|
|
- console.log(record);
|
|
|
- await onlineForceLogout({ token: record.token });
|
|
|
+ console.log(record, '2222222222222222');
|
|
|
+ await onlineForceLogout({ sessionId: record.sessionId, loginType: 'login' });
|
|
|
createMessage.success('强退成功!');
|
|
|
await reload();
|
|
|
}
|
|
|
+ // 退出token
|
|
|
+ async function handletoken(record) {
|
|
|
+ console.log(record, '2222222222222222');
|
|
|
+ openDrawer(true, {
|
|
|
+ record,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 抽屉回调事件
|
|
|
+ async function handleSuccessDrawer() {
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
</script>
|
|
|
+<style scoped>
|
|
|
+ Card {
|
|
|
+ height: 200px !important;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 150px;
|
|
|
+ height: 75px;
|
|
|
+ /* text-align: center; */
|
|
|
+ margin: auto;
|
|
|
+ }
|
|
|
+</style>
|