import { ref } from 'vue' import { ColumnsProps } from '../../../components/table/table-helper' import { AccountUser } from '../../../entity/account/account-user' /** * 登录类型 */ const LOGIN_TYPE_MAP = [ 'WEB', '安卓', '苹果', '钉钉', '微信小程序', '微信公众号', '微信扫码登录', 'qq扫码登录', '钉钉扫码登录', '邮箱验证码登录', '手机验证码登录', 'App', 'H5' ] /** * 登出类型 */ const LOGIN_OUT_TYPE = ['', '注销', '重复登录掉线', '登录超时', '切换账号'] /** * 登录状态 */ const LOGIN_STATE_MAP = ['', '成功', '账号不存在', '密码错误', '账号未激活', '账号被锁定', '失败'] /** * 登录类型 */ const LOGIN_TYPE = ['PC', '钉钉', '单点登录', '未知'] const columns = ref[]>([ { title: '登录时间', dataIndex: 'loginDate', minWidth: 50, width: '180px' }, { title: '账号', dataIndex: 'userAccount', width: '100px' }, { title: '登录类型', dataIndex: 'loginType', width: '100px', customRender: ({ text }) => LOGIN_TYPE_MAP[text] }, { title: '登出类型', dataIndex: 'loginOutType', width: '110px', customRender: ({ text }) => LOGIN_OUT_TYPE[text] }, { title: '登录IP', dataIndex: 'requestIp', minWidth: 40, width: '120px' }, { title: '登录状态', dataIndex: 'loginState', width: '120px', customRender: ({ text }) => LOGIN_STATE_MAP[text] }, { title: '登录类型', dataIndex: 'loginType', width: '120px', customRender: ({ text }) => LOGIN_TYPE[text] }, { title: '手机型号/浏览器型号', dataIndex: 'modelNumber', minWidth: 60, width: '120px', ellipsis: true } ]) export default columns