<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(['edit','preview'].includes(route.query.type)){
    getCalculateInfo()
}

 
</script>

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