<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="auditorName"></el-table-column>
        <el-table-column label="审核时间" prop="auditTime"></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="auditRemark"  v-slot:default="{ row }">
          <div class="remark">
            {{row.auditRemark}}
          </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 { getExamineList } from '@/request/config'
import { 
  EXAMINE_VIEW_SELECT,
  getName 
} from '@/constant'

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

    state.pag.value.sizeChange(8)

    return { ...state }
  },
  methods: {
    getExamineName: getName(EXAMINE_VIEW_SELECT),
  },
  watch: {
    data() {
      this.search.state.houseId = this.props.data
    }
  },
  components: {
    "com-dialog": comDialog
  }  
}
</script>

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