import { h, ref } from 'vue' import { ColumnsProps } from '../../../components/table/table-helper' import { LogLogin } from '../../../entity/system-log/log-login' import { Tag } from 'ant-design-vue' /** * 登录类型map */ const LOGIN_TYPE_MAP = [ 'WEB', '安卓', '苹果', '钉钉', '微信小程序', '微信公众号', '微信扫码登录', 'qq扫码登录', '钉钉扫码登录', '邮箱验证码登录', '手机验证码登录', 'App', 'H5' ] /** * 登出类型map */ const LOGIN_OUT_TYPE_MAP = ['', '注销', '重复登录掉线', '登录超时', '切换账号'] /** * 登录状态map */ const LOGIN_STATE_MAP = [ h( Tag, { color: '#f50' }, { default: () => '登录失败' } ), h( Tag, { color: '#87d068' }, { default: () => '登录成功' } ) ] const columns = ref[]>([ { title: '账号', dataIndex: 'userAccount', width: 120 }, { title: '姓名', dataIndex: 'rfUserName', width: 100 }, { title: '登录时间', dataIndex: 'loginDate', width: 170 }, { title: '登录类型', dataIndex: 'loginType', width: 100, customRender: ({ text }) => LOGIN_TYPE_MAP[text] }, { title: '登出类型', dataIndex: 'loginOutType', width: 120, customRender: ({ text }) => LOGIN_OUT_TYPE_MAP[text] }, { title: '登录ip', dataIndex: 'requestIp', width: 180 }, { title: '登录地点', dataIndex: 'loginAddress', width: 100 }, { title: '客户端型号', dataIndex: 'modelNumber', ellipsis: true }, { title: '登录状态', width: 120, dataIndex: 'loginState', customRender: ({ text }) => LOGIN_STATE_MAP[text] || '' } ]) export default columns