<template>
  <es-data-table
    numbers
    :url="sysuseronline"
    :thead="thead"
    page
  ></es-data-table>
</template>

<script>
import { userOnline } from 'eoss-ui/src/config/api.js';
export default {
  name: 'Online',
  components: {},
  props: {
    sysuseronline: {
      type: String,
      default: userOnline
    }
  },
  data() {
    return {
      thead: [
        {
          title: '单位',
          field: 'orgName',
          minWidth: 120
        },
        {
          title: '部门',
          field: 'depName',
          align: 'center',
          minWidth: 120
        },
        {
          title: '姓名',
          field: 'userName',
          align: 'center',
          width: 120
        },
        {
          title: '职务',
          field: 'position',
          align: 'center',
          width: 120
        },
        {
          title: '账号',
          field: 'loginName',
          align: 'center',
          width: 120
        },
        {
          title: '登录时间',
          field: 'loginDate',
          align: 'center',
          width: 170
        },
        {
          title: '登录次数',
          field: 'freQuency',
          align: 'center',
          width: 100
        },
        {
          title: '登录方式',
          field: 'loginModel',
          align: 'center',
          width: 100,
          render: (h, params) => {
            let {
              row: { loginModel }
            } = params;
            let types = ['普通登录', 'CA登录', '手机登录'];
            return h('span', {}, [types[loginModel] || types[0]]);
          }
        }
      ]
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {}
};
</script>

<style lang="scss" scoped></style>
