<template>
  <div>
    <!-- 物联数据-->
    <div class="basic-details" id="internet">
      <div class="basic-details-title">
        <span class="border-span">物联数据</span>
      </div>
    </div>
    <!-- 挤压机 65 -->
    <InternetExtruder :info="info" v-if="parentClassId == '65'" />
    <!-- 干燥箱 57 -->
    <InternetDryingBox :info="info" v-else-if="parentClassId == '57'" />
    <!-- 其他设备 -->
    <InternetOther v-else :id="id"></InternetOther>
  </div>
</template>

<script>
  import InternetExtruder from './InternetExtruder/InternetExtruder';
  import InternetDryingBox from './InternetDryingBox/InternetDryingBox';
  import InternetOther from './InternetOther';
  // import { getDetail } from '@/api/ledgerAssets/equipment';
  export default {
    props: ['id'],
    components: { InternetExtruder, InternetDryingBox, InternetOther },

    data() {
      return {
        iotId: null,
        // 设备信息
        info: '',
        // 父类id
        parentClassId: ''
      };
    },
    created() {
      this.getInfo();
    },
    methods: {
      getInfo() {
        // getDetail({
        //   id: this.id
        // }).then((res) => {
        //   this.info = res.data;
        //   this.parentClassId = this.setParentClassId(
        //     this.info.information.classificationUrlId
        //   );
        // });
      },
      // 获取父类id
      setParentClassId(val) {
        let data = JSON.parse(val);
        return data[1];
      }
    }
  };
</script>
<style lang="scss" scoped>
  .basic-details {
    background: #fff;
    padding: 20px;
  }
  .wrapper {
    background: #fff;
    padding: 20px;
  }

  .no-data {
    background: #fff;
    line-height: 100px;
    font-size: 26px;
    text-align: center;
  }
</style>
