<template>
  <div class="e-object-device-manage">
    <el-tabs v-model="activeName">
      <el-tab-pane :label="tabLabel.dictLabel" :name="tabLabel.dictValue" v-for="(tabLabel, idx) in projectDeviceTagGroup" :key="idx">
        <e-device-table v-if="tabLabel.dictValue === activeName" :sourceId="projectInfo['projectId']" :deviceType="tabLabel.dictValue" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import EDeviceTable from './EDeviceTable'
export default {
  name: 'EObjectDeviceManage',
  components: {
    EDeviceTable
  },
  props: {
    projectInfo: {
      type: Object,
      require: true
    }
  },
  data() {
    return {
      activeName: '',
      projectDeviceTagGroup: []
    }
  },
  created() {
    this.getDicts("project_device_tag_group").then(response => {
      this.projectDeviceTagGroup = response.data;
      if (this.projectDeviceTagGroup &&　this.projectDeviceTagGroup.length > 0) {
        this.activeName = this.projectDeviceTagGroup[0]['dictValue'] || ''
      };
    });
  },
  methods: {
    // 菜单状态字典翻译
    statusFormat(row, column) {
      return this.selectDictLabel(this.projectDeviceTagGroup, row.industry);
    },
    // 获取 网关设备列表
    getGatewayDeviceList() {

    },
  }
}
</script>
