<template>
  <div class="height_100">
    <el-container>
        <el-header>
            <div class="head">
                <div>
                    <el-button @click="changeShow(1)" type="primary" :plain="!isSelect">对比结果查看</el-button>
                    <el-button @click="changeShow(2)" type="primary" :plain="isSelect" v-if=" $reportPermission(reportId,[0,1])">对比方案选择</el-button>
                </div>
                <div>
                    <el-select placeholder="请选择显示类型" v-model="Type" style="margin-left: 10px;" @change="TypeSelect($event)" >
                        <el-option label="仅显示主权要" value="1"></el-option>
                        <el-option label="全部显示" value="0"></el-option>
                    </el-select>
                </div>
                <div></div>
            </div>
        </el-header>
        <el-main>
            <div class="height_100" v-show="!isSelect">
                <el-container>
                    <el-header class="basic_header">
                        <el-tabs v-model="activeName" @tab-click="handleClick" style="width:100%">
                            <el-tab-pane v-for="item in menu" :key='item.path' :label="item.label" :name="item.path"></el-tab-pane>
                        </el-tabs>
                    </el-header>
                    <el-main>
                        <component :is='activeName' :tableData="tableData" :showType="Type"></component>
                    </el-main>
                </el-container>
            </div>
            <div v-show="isSelect">
                <chooseContrastPlan :tableData="tableData" :showType="Type"></chooseContrastPlan>
            </div>
        </el-main>
    </el-container>
  </div>
</template>

<script>
import chooseContrastPlan from './components/chooseContrastPlan.vue'
import contrastRecord from './components/contrastRecord.vue'
import contrastResult from './components/contrastResult.vue'
export default {
  components: {
    chooseContrastPlan,
    contrastRecord,
    contrastResult
  },
  props: {
    projectId:{
        default:0
    }
  },
  data() {
    return {
        tableData:[],
        originalData:[],
        Type:'0',
        isSelect:false,
        activeName:'contrastResult',
        menu:[
            {
                label:'对比结果',
                path:'contrastResult'
            },
            {
                label:'对比记录',
                path:'contrastRecord'
            }
        ]
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {
    this.getList()
  },
  methods: {
    //获取对比结果
    getList(){

    },
    //切换查看结果和选择对比方案
    changeShow(type){

    },
    //切换主权要
    TypeSelect(val){
        if(val == 1){
            this.tableData = this.originalData.filter(item=>{
                return
            })
        }else if(val == 0){
            this.tableData = this.originalData
        }
        
    }
  },
};
</script>
<style lang="scss" scoped>
.head{
    width: 100%;
    display: flex;
    justify-content: space-between;
}

</style>