<template>
  <div>
    <BizTable :formatCol="formatCol" metaName="user_info" packageName="auth" isMulti></BizTable>
  </div>
</template>
  <script>
    import  BizTable from "../components/tables/biztables"
export default {
      name: 'userinfo_page',
      data () {
        return {
        }
        },
      components: {
          BizTable
      },
      methods:{
        formatCol(row,key,index){
          if(key=="roleName"){
               let rolestr=row.Roles.map(item=>item.name).join(",")
               row.roles=row.Roles.map(item=>item.id)
               return `<span>${rolestr}</span>`
          }
          if(key=="isAdmin" || key=="isSuper"){
             return `<span>${row[key]?'是':'否'}</span>`
          }
          if(key=="created_at"){
            return `<span>${new Date(row[key]).toLocaleString()}</span>`
          }
           return row[key]
        }
      }
 }
</script>
  <style>

  </style>
