<template>
  <div class="page-container hardwareClassification-infoPage">
    <div class="page-top-title-box">
      <p class="page-top-title-name-p">{{propsData.hardwareTypeName}}详情</p>
      <p class="page-top-title-out-p" @click="outButton">返回</p>
    </div>
    <div class="content-box">
      <div class="text-box">
        <div>
          <p>标识：</p>
          <p>{{propsData.hardwareTypeKey}}</p>
        </div>
        <div>
          <p>状态：</p>
          <p>{{propsData.state?'启用':'停用'}}</p>
        </div>
      </div>
      <div class="table-button">
        <div>
          <p class="cursor-p" @click="tableClick(1)"
             :class="tableType == 1? 'checkTableColor':''">功能</p>
          <p :class="tableType == 1? 'checkTableBack':''"></p>
        </div>
        <div class="div-flex">
          <p> </p>
          <p></p>
        </div>
      </div>
      <function-page v-if="tableType == 1"></function-page>
    </div>
  </div>
</template>

<script>
  import functionPage from "./functionPage.vue";
  export default {
    name: 'infoPage',
    components: {
      functionPage,
    },
    props:{
      propsData:{},
    },
    data(){
      return{
        tableType:1,
      }
    },
    created(){

    },
    mounted(){

    },
    methods:{
      //table切换
      tableClick(type){
        if(type != this.tableType){
          this.$set(this,'tableType',type);
        }
      },
      //返回按钮
      outButton(){
        this.$parent.tableButton('6')
      },
    },
  }
</script>

<style scoped lang="scss">
  .hardwareClassification-infoPage{
    .content-box{
      flex:1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      .text-box{
        display: flex;
        div{
          display: flex;
          width:400px;
          p{
            margin-top:10px;
            line-height:40px;
          }
          p:nth-child(1){
            width:122px;
            text-align: right;
          }
          p:nth-child(2){

          }
        }
      }
      .table-button{
        display: flex;
        div{
          width:180px;
          p{
            text-align: center;
          }
          p:nth-child(1){
            height:60px;
            line-height:60px;
          }
          p:nth-child(2){
            height:2px;
            background-color: #dedede;
          }
          .cursor-p{
            cursor: pointer;
          }
          .checkTableColor{
            color:#0045AF!important;
          }
          .checkTableBack{
            background-color: #0045AF!important;
          }
        }
        .div-flex{
          flex:1;
        }
      }
    }
  }
</style>
