<script setup>
import { ref, onMounted} from 'vue'
import apiDataEDB from '@/api/dataEDB'
import { useRoute } from 'vue-router'

const route=useRoute()


// 获取记录
const treeData=ref({})
async function getHistory(){
    const res=await apiDataEDB.edbCreateHistory({UniqueCode:route.query.code})
    if(res.Ret===200){
        treeData.value=res.Data
    }
}
/* function changeFullScreen(){
    //将render-wrap内容旋转90°
} */
onMounted(()=>{
    getHistory()
})

</script>

<template>
    <div class="edb-history-page-wrap">
        <div class="edb-title van-ellipsis">{{treeData.EdbName||''}}</div>
        <div class="render-wrap" id="render-wrap">
            <vue3TreeOrg
                :data="treeData"
                :props="{
                    label: 'EdbName',
                    children: 'Child',
                }"
                :disabled="true"
                :scalable="false"
                :draggable="false"
                :horizontal="false"
                :toolBar="{scale: false, restore: false, expand: false, zoom: false, fullscreen: false, }"
            />
        </div>
        <!-- <div class="full-btn">
            <div class="btn" @click="changeFullScreen">
                全屏显示
            </div>
        </div> -->
    </div>
    
</template>

<style lang="scss" scoped>
.edb-history-page-wrap{
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    .edb-title{
        display: flex;
        justify-content: center;
        align-items: center;
        padding:30px 0;
        box-sizing: border-box;
        border-bottom: 1px solid #C8CDD9;
    }
    .full-btn{
        padding:48px;
        box-sizing: border-box;
        .btn{
            background-color: #0052D9;
            color: #fff;
            height:80px;
            line-height: 80px;
            text-align: center;
        }
    }
    .render-wrap{
        flex:1;
        overflow: hidden;
        :deep(.zoom-container){
            overflow: auto;
        }
        :deep(.zm-draggable){
            position: static;
            display: inline-block;
        }
        :deep(.tree-org){
            pointer-events: none;
        }
        :deep(.tree-org-node__text){
            width: 240px;
        }
        :deep(.tree-org-node__content){
            background-color: #0052D9;
            color: #fff;
            border-radius: 4PX;
        }
        :deep(.tree-org-node__children){
            .tree-org-node__content{
                background-color: #F2F6FA;
                color: #333333;
                border-radius: 4PX;
            }
        }
    }
    @media screen and (min-width:650px){
        height: calc(100vh - 60px);
        .render-wrap{
            :deep(.tree-org-node__text){
                width: 130px;
            }
        }
        .edb-title,.full-btn{
            display: none;
        }
    }
}
</style>