<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-axis__caLoudong}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.buildingId" placeholder="buildingId" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button class="diy-button--add" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
        </el-form-item>
        <!-- <el-form-item>
          <el-button class="diy-button--delete" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
        </el-form-item> -->
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="buildingId" label="楼栋ID" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingType" label="楼宇类型" header-align="center" align="center"></el-table-column>
        <el-table-column prop="gridId" label="网格ID" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingName" label="楼宇名称" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingUse" label="用途分类" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingStatus" label="楼宇状态" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingStructure" label="楼宇结构" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingUseage" label="使用现状" header-align="center" align="center"></el-table-column>
        <el-table-column prop="constructionTime" label="建筑时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingAddr" label="所处位置" header-align="center" align="center"></el-table-column>
        <el-table-column prop="communityName" label="小区（单位）名称" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingLeader" label="楼栋长" header-align="center" align="center"></el-table-column>
        <el-table-column prop="layerCount" label="楼层数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="basementLayerCount" label="地下楼层数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="houseBeginLayer" label="住宅开始层数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="unitCount" label="单元数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="layerRoomCount" label="每层每单元户数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="roomCount" label="总房屋数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="elevatorCount" label="电梯数量" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingArea" label="建筑面积" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingPmc" label="物业公司" header-align="center" align="center"></el-table-column>
        <el-table-column prop="buildingDesc" label="介绍" header-align="center" align="center"></el-table-column>
        <el-table-column prop="pointStatus" label="标绘状态" header-align="center" align="center"></el-table-column>
        <el-table-column prop="longitude" label="经度" header-align="center" align="center"></el-table-column>
        <el-table-column prop="latitude" label="纬度" header-align="center" align="center"></el-table-column>
        <el-table-column prop="platCode" label="数据来源" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createBy" label="创建人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createDate" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updateBy" label="最后修改人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updateDate" label="最后修改时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="deleteFlag" label="删除状态" header-align="center" align="center"></el-table-column>
        <el-table-column prop="versions" label="乐观锁" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute1" label="扩展字段1" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute2" label="扩展字段2" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute3" label="扩展字段3" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute4" label="扩展字段4" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute5" label="扩展字段5" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute6" label="小区主键" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute7" label="扩展字段7" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute8" label="扩展字段8" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute9" label="扩展字段9" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute10" label="扩展字段10" header-align="center" align="center"></el-table-column>
        <el-table-column prop="communityId" label="小区主键" header-align="center" align="center"></el-table-column>
        <!-- <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
          <template slot-scope="scope">
            <el-button v-if="$hasPermission('axis:caloudong:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
            <el-button v-if="$hasPermission('axis:caloudong:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
          </template>
        </el-table-column> -->
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './caloudong-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/opendata/caLoudong/page',
        getDataListIsPage: true,
        deleteURL: '/opendata/caloudong',
        deleteIsBatch: true
      },
      dataForm: {
        buildingId: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
