<template>
  <com-dialog
    v-if="show"
    title="审核记录"
    :show="show"
    hideFloor
    @update:show="val => $emit('update:show', val)">
    
    <div style="width: 100%; overflow: hidden">
      <el-table ref="multipleTable" :data="dataList.state" style="width: 100%" >
        <el-table-column label="姓名" prop="reviewer"></el-table-column>
        <el-table-column label="操作类型"  prop="processOperation">
        </el-table-column>
        <el-table-column label="公司" prop="companyName"></el-table-column>
        <el-table-column label="更新时间" prop="lastupdateTime"></el-table-column>
        <el-table-column label="状态" prop="auditStatus"  v-slot:default="{ row }">
          <span>{{getExamineName(row.auditStatus)}}</span>
        </el-table-column>
        <el-table-column label="审核备注" prop="reviewMark"  v-slot:default="{ row }">
          <div class="remark">
            {{row.reviewMark}}
          </div>
        </el-table-column>
      </el-table>
    </div>

    <div class="pag-block no-sizes">
      <el-pagination
        @current-change="pag.currentChange"
        :current-page="pag.state.currPage"
        :page-size="pag.state.size"
        layout="total, prev, pager, next, jumper"
        :total="pag.state.total">
      </el-pagination>
    </div>

  </com-dialog>
</template>

<script>
import getTableState from '@/state/tableRef'
import comDialog from "@/components/dialog";
import { getSecondHouseExamineViewList } from '@/request/config'
import { 
  AUTH_REDIRECT_COM_VIEW,
  EXAMINE_DRAFT_STATUS,
  getName 
} from '@/constant'

export default {
  props: ['show', 'data'],
  setup(props) {
    const state = getTableState({
      getUrl: getSecondHouseExamineViewList,
      searchAttr: { vrId: props.data }
    })

    state.pag.value.sizeChange(8)

    return { ...state, EXAMINE_DRAFT_STATUS }
  },
  methods: {
    getExamineName: getName(AUTH_REDIRECT_COM_VIEW),
  },
  components: {
    "com-dialog": comDialog
  }  
}
</script>

<style lang="scss" scoped>
.remark {
  max-height: 100px;
  overflow-y: auto;
}
</style>