1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <div class="table-box">
- <ProTable ref="proTable" :columns="columns" row-key="infoId" :request-api="listLogininforApi" :init-param="initParam"> </ProTable>
- <ImportExcel ref="dialogRef" />
- </div>
- </template>
- <script setup lang="tsx" name="Logininfor">
- import { ref, reactive } from 'vue'
- import ProTable from '@/components/ProTable/index.vue'
- import ImportExcel from '@/components/ImportExcel/index.vue'
- import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
- import { listLogininforApi } from '@/api/modules/monitor/logininfor'
- import { getDictsApi } from '@/api/modules/system/dictData'
- // ProTable 实例
- const proTable = ref<ProTableInstance>()
- // 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
- const initParam = reactive({ type: 1 })
- // 批量添加系统访问记录
- const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
- // 表格配置项
- const columns = reactive<ColumnProps<any>[]>([
- { prop: 'infoId', label: '访问ID' },
- {
- prop: 'userName',
- label: '用户账号',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'ipaddr',
- label: '登录IP地址',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'loginLocation',
- label: '登录地点',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'browser',
- label: '浏览器类型',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'os',
- label: '操作系统',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'status',
- label: '登录状态',
- tag: true,
- enum: () => getDictsApi('sys_common_status'),
- fieldNames: {
- label: 'dictLabel',
- value: 'dictValue'
- },
- search: {
- el: 'input'
- }
- },
- {
- prop: 'msg',
- label: '提示消息',
- search: {
- el: 'input'
- }
- },
- {
- prop: 'loginTime',
- label: '访问时间',
- search: {
- el: 'date-picker',
- props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
- }
- }
- ])
- </script>
|