<template>
  <view class="setting-building">
    <uni-section class="block mb10" title="基本信息" type="line" titleFontSize="16px" titleColor="#4074E7"></uni-section>
    <view class="basic-info p10">
      <u-row>
        <u-col span="5"> 建筑物名称 </u-col>
        <u-col span="7"> {{ getDetailData.build_name }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 建筑物类别 </u-col>
        <u-col span="7"> {{ getDetailData.build_type }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 建造日期 </u-col>
        <u-col span="7"> {{ getDetailData.build_time }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 使用性质 </u-col>
        <u-col span="7"> {{ getDetailData.nature_use }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 火灾危险级 </u-col>
        <u-col span="7"> {{ getDetailData.fire_risk_level }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 耐火等级 </u-col>
        <u-col span="7"> {{ getDetailData.fire_resistance_rating }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 结构类型 </u-col>
        <u-col span="7"> {{ getDetailData.structure_type }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 建筑高度 </u-col>
        <u-col span="7"> {{ getDetailData.build_height }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 建筑面积 </u-col>
        <u-col span="7"> {{ getDetailData.build_area }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 占地面积 </u-col>
        <u-col span="7"> {{ getDetailData.land_occupation_area }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 标准层面积 </u-col>
        <u-col span="7"> {{ getDetailData.standard_area }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 地上层数 </u-col>
        <u-col span="7"> {{ getDetailData.aboveground_layer }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 地上层面积 </u-col>
        <u-col span="7"> {{ getDetailData.aboveground_area }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 地下层数 </u-col>
        <u-col span="7"> {{ getDetailData.underground_floor }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 地下层面积 </u-col>
        <u-col span="7"> {{ getDetailData.underground_area }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 消防控制室位置 </u-col>
        <u-col span="7"> {{ getDetailData.control_room }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 避难层数量 </u-col>
        <u-col span="7"> {{ getDetailData.refuge_layer }} </u-col>
      </u-row>
      <u-row>
        <u-col span="5"> 消防电梯数量 </u-col>
        <u-col span="7"> {{ getDetailData.fire_elevator }} </u-col>
      </u-row>
    </view>

    <uni-section class="block mb10" title="消防设施平面布置图" type="line" titleFontSize="16px" titleColor="#4074E7"></uni-section>
    <view class="processStatus">
      <view class="plr10 imgPic">
        <image v-if="!getDetailData.build_plan && dataRes == 1" mode="widthFix" src="http://192.168.123.165:9300/statics/images/defaultImg.jpg" />
        <image v-else mode="widthFix" :src="getDetailData.layout_plan" />
      </view>
    </view>

    <uni-section class="block mb10" title="建筑平面图" type="line" titleFontSize="16px" titleColor="#4074E7"></uni-section>

    <view class="processStatus">
      <view class="plr10 pb20 imgPic">
        <image v-if="!getDetailData.build_plan && dataRes == 1" mode="widthFix" src="http://192.168.123.165:9300/statics/images/defaultImg.jpg" />
        <image v-else :src="getDetailData.build_plan" mode="widthFix" />
      </view>
    </view>
  </view>
</template>

<script setup>
import { onLoad, onShow, onReady, onHide, onLaunch } from "@dcloudio/uni-app";
import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
import { useStores, commonStores } from "@/store/modules/index";

import { getBuildingManagement } from "@/api/business/zhxf/building/index.js";

const useStore = useStores();

const { proxy } = getCurrentInstance();

const getDetailData = ref({});
const dataRes = ref(0);

// 建筑基础数据请求
function getDetails(params = {}) {
  getBuildingManagement(params).then((res) => {
    getDetailData.value = res.data[0];
    console.log(getDetailData.value);
    dataRes.value = 1;
  });
}

onLoad((option) => {
  // getDetails({ company_code: uni.getStorageSync("selectedCode") });
});

onReady(() => {
  //调用系统主题颜色
  proxy.$settingStore.systemThemeColor([1]);
});
</script>

<style lang="scss" scoped>
:deep(.image-bg > div) {
  background-size: cover !important;
}

.setting-building {
  background: #fff;
  .basic-info {
    .u-row {
      border: 1px #e5e5e5 solid;
      border-bottom: 0px;

      > .u-col {
        height: 33px;
        line-height: 33px;
        font-size: 13px;
        border-right: 1px #e5e5e5 solid;
      }

      > .u-col:last-child {
        border-right: 0px #e5e5e5 solid;
      }
    }

    .u-row:last-child {
      .u-col {
        border-bottom: 1px #e5e5e5 solid;
      }
    }

    .processStatus {
    }
  }
}
</style>
