<template>
  <div class="app-container">
    <search-form
      :list-loading="listLoading"
      @change="searchHandle"
    />
    <table-list
      :list-loading="listLoading"
      :data="tableData2"
      :columns="listConfig"
      :current-page="currentPage"
      :page-size="pageSize"
      :total-records="totalRecords"
      @currentChange="pageHandle"
      @sizeChange="sizeChange"
    >
    </table-list>
  </div>
</template>
<script>
import { arrToObj } from '@/utils'
import SearchForm from './components/searchForm/Yanfang'
import baseTable from '_m/baseTable.js'
export default {
  name: 'index',
  components: {
    SearchForm,
  },
  provide() {
    return {
      parentData: this
    }
  },
  mixins: [baseTable],
  data() {
    return {
      apiStr: 'other.admhouseinspectlist',
      searchForm: null,
      isDtlShow: false,
      curObj: {},
    }
  },
  computed: {
    tableData2() {
      const arr = [...this.tableData]
      arr.map(item => {
        const userInfo = item.userinfo
        if (userInfo) {
          const UI = JSON.parse(userInfo)
          item.wxName = `${UI.nickName}(${UI.phone})`
          item.wxImg = UI.avatarUrl
        }
      })
      return arr
    }
  },
  created() {},
  mounted() {
    this.listConfig = {
      rows: [
        { label: '提交时间', prop: 'create_at' },
        { label: '意向楼盘', prop: 'estate_name' },
        { label: '楼栋单元', prop: 'address' },
        { label: '用户名称', prop: 'name' },
        { label: '手机号', prop: 'phone' },
        { label: '备注', prop: 'remark', minWidth: 200 },
        { label: '微信头像', prop: 'wxImg', type: 'img' },
        { label: '微信昵称(手机)', prop: 'wxName', fullShow: true, minWidth: 200 },
        // { label: '操作', width: 60, type: 'handle2', operations:
        //   [
        //     { label: '删除', func: this.delHandle, btnType: 'danger' },
        //   ]
        // }
      ]
    }
  },
  methods: {}
}
</script>
<style lang="scss" scoped>
</style>

