<template>
  <div class="maincontemer">
    <el-row>
      <el-col :span="24">
        <el-card>
          <div slot="header" class="clearfix">
            <span>设备信息</span>
          </div>
          <el-table
            :data="tableData"
            style="width: 100%">
            <el-table-column
              prop="name"

              width="100px">
            </el-table-column>
            <el-table-column
              prop="Value"

              width="100px">
            </el-table-column>
          </el-table>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "GuiForDivesInfo",
  data(){
    return {
      tableData: [{
        name: '设备名称',
        Value: 'ARS'
      } ]
    }

  },
  methods: {
    onloaddata(jsondata){
      //if (jsondata.isObject){
      this.tableData=[];
        this.tableData.push(...convertObjectToArray(jsondata));
     // }

    }
  }
}

function convertObjectToArray(jsonObject) {
  const jsonArray = [];

  for (const key in jsonObject) {
    if (jsonObject.hasOwnProperty(key)) {
      const keyValueObject = {
        name: key,
        Value: jsonObject[key]
      };
      jsonArray.push(keyValueObject);
    }
  }

  return jsonArray;
}

</script>

<style scoped>
.maincontemer{
  height: 100px;
}
</style>
