123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <script setup>
- //数据来源详情
- import {ref,watch} from 'vue'
- import apiChart from '@/api/chart'
- const props = defineProps({
- show:{
- type:Boolean,
- default:false
- },
- EdbInfoId:{
- type:Number,
- default:0
- },
- UniqueCode: {
- type:Number,
- default: ''
- }
- })
- watch(()=>props.show,()=>{
- if(props.show){
- getEdbInfo()
- }
- },{immediate:true})
- const edbSourceData = ref([])
- async function getEdbInfo(){
- const res = await apiChart.getEdbCreateHistory({
- UniqueCode:props.UniqueCode
- })
- if(res.Ret!==200) return
- edbSourceData.value = flatTreeData([res.Data]||[]).reverse()
- }
- function flatTreeData(tree){
- let arr = []
- let concatData=[]
- for(const item of tree){
- const {EdbName,RuleTitle} = item
- concatData.push({EdbName:EdbName||'',RuleTitle:RuleTitle||''})
- if(item.Child&&item.Child.length){
- arr = arr.concat(flatTreeData(item.Child))
- }
- }
- arr.push(concatData)
- return arr
- }
- </script>
- <template>
- <div class="source-detail-wrap">
- <div class="top-box">
- <span class="title"> 数据来源</span>
- </div>
- <div class="source-arr-wrap">
- <div class="source-item" v-for="(arr,index) in edbSourceData">
- <template v-for="item in arr">
- <span class="title">{{item.EdbName}}</span>
- <span class="text">{{item.RuleTitle}}</span>
- </template>
-
- <div class="line" v-if="index!==edbSourceData.length-1"></div>
- </div>
- </div>
- </div>
- </template>
- <style scoped lang="scss">
- .source-detail-wrap{
- .top-box{
- padding: 32px $page-padding;
- border-bottom: 1px solid $border-color;
- .title{
- font-size: 32px;
- font-weight: 600;
- }
- }
- .source-arr-wrap{
- display: flex;
- flex-direction: column;
- padding:40px 80px;
- gap:40px;
- max-height: 600px;
- overflow-y:scroll;
- .source-item{
- position: relative;
- .text{
- display: block;
- margin: 8px 0;
- font-size: 12px;
- color: #00000066;;
- }
- .line{
- position:absolute;
- left:-33px;
- top:36px;
- width:1px;
- height:100%;
- background-color: $theme-color;
- }
- &::after{
- content:'';
- position:absolute;
- top:0;
- left:-40px;
- background-color: $theme-color;
- width:16px;
- height:16px;
- border-radius: 50%;
- top:8px;
- }
- }
- }
- @media screen and (min-width:$media-width){
- .top-box{
- padding: 16px;
- .title{
- font-size: 18px;
- }
- }
- .source-arr-wrap{
- padding:20px 40px;
- gap:20px;
- max-height: 300px;
- .source-item{
- .text{
- margin: 8px 0;
- font-size: 12px;
- }
- .line{
- position:absolute;
- left:-17px;
- top:18px;
- width:1px;
- height:100%;
- background-color: $theme-color;
- }
- &::after{
- left: -20px;
- width: 8px;
- height: 8px;
- top:4px;
- }
- }
- }
- }
- }
- </style>
|