<!--
授权管理日志详情
@Author: linqian
@Date: 2021-05-27 15:10
-->
<template>
  <div>
    <el-form v-if="detailInfo.id" label-width="120px" label-suffix="：">
      <dg-row>
        <dg-col :span="12">
          <el-form-item label="授权管理类型">
            <div class="u-detail__text" v-translate="{ enum: 'AuthorizeTypeEnum' }">
              {{ detailInfo.authorizeType }}
            </div>
          </el-form-item>
          <el-form-item label="权限处理时间">
            <div class="u-detail__text">{{ detailInfo.createTime | dateFormatter('YYYY-MM-DD HH:mm:ss') }}</div>
          </el-form-item>
        </dg-col>
        <dg-col :span="12">
          <el-form-item label="状态">
            <div class="u-detail__text" v-translate="{ enum: 'AuthResultEnum' }">
              {{ detailInfo.state }}
            </div>
          </el-form-item>
          <!-- 接口没有的字段，假假的显示在页面 -->
          <el-form-item label="操作内容"> </el-form-item>
        </dg-col>
      </dg-row>

      <dg-row zebra="16px">
        <dg-table :data="detailInfo.handlers" paging-type="client" :pagination-props="paginationProps">
          <dg-table-column prop="handlerName" label="权限处理者"></dg-table-column>
          <dg-table-column prop="handlerIdcard" label="权限处理者身份证号码"></dg-table-column>
        </dg-table>
      </dg-row>
      <dg-row zebra="16px">
        <dg-table :data="detailInfo.subjects" paging-type="client" :pagination-props="paginationProps">
          <dg-table-column prop="subjectName" label="权限处理主体"></dg-table-column>
          <dg-table-column prop="subjectId" label="权限处理主体ID"></dg-table-column>
        </dg-table>
      </dg-row>
      <dg-row zebra="16px">
        <dg-table :data="detailInfo.objects" paging-type="client" :pagination-props="paginationProps">
          <dg-table-column prop="objectName" label="授权管理客体"></dg-table-column>
          <dg-table-column prop="objectId" label="授权管理客体ID"></dg-table-column>
        </dg-table>
      </dg-row>
    </el-form>
    <div v-footer>
      <dg-button @click="handleClose">关闭</dg-button>
    </div>
  </div>
</template>

<script>
import { getAuthManageLogDetail } from '@/api/permiss-log-manage';
export default {
  props: {
    id: [String, Number]
  },
  components: {},
  data() {
    return {
      detailInfo: {},
      value: '',
      paginationProps: {
        currentPage: 1,
        pageSizes: [10, 20],
        pageSize: 5,
        layout: 'total, prev, pager, next, jumper'
      }
    };
  },
  computed: {},
  methods: {
    handleClose() {
      this.$emit('close');
    }
  },
  created() {
    getAuthManageLogDetail(this.id).then((res) => {
      this.detailInfo = res.data.content;
    });
  },
  mounted() {}
};
</script>

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