<script setup name="DataEDBCalculateDetail">
import {ref} from 'vue'
import apiDataEDB from '@/api/dataEDB'
import { useRoute } from "vue-router";
import DiffusionIndexCalcualate from './components/DiffusionIndexCalcualate.vue';
import FittingResidualsCalculate from './components/FittingResidualsCalculate.vue';
import FormulaCalculate from './components/FormulaCalculate.vue';
import JointCalculate from './components/JointCalculate.vue';
import OtherCalculate from './components/OtherCalculate.vue';

const route=useRoute()
const source=ref(route.query.source||'')//计算类型
document.title=route.query.name||'指标运算'

// 获取计算指标详情
const edbInfo=ref(null)
async function getCalculateInfo(){
    const res=await apiDataEDB.getCalculateEdbInfo({EdbInfoId:Number(route.query.edbInfoId)})
    if(res.Ret===200){
        edbInfo.value=res.Data
    }
}
if(route.query.type==='edit'){
    getCalculateInfo()
}

 
</script>

<template>
    <!-- 指标运算 -->
    <FormulaCalculate v-if="['4'].includes(source)"/>
    <!-- 其他的运算 -->
    <OtherCalculate v-if="['toMonthSeason','6','7','8','12','13','14','22','35','51','52','accumulate'].includes(source)"/>
    <!-- 拼接计算 -->
    <JointCalculate v-if="source==='joint'"/>
    <!-- 拟合残差计算 -->
    <FittingResidualsCalculate v-if="source==='37'"/>
    <!-- 扩散指数计算 -->
    <DiffusionIndexCalcualate v-if="source==='53'" :edbInfo="edbInfo"/>
</template>
