<template>
  <special-fund-detail :formData="fundData.formData" :data="fundData" :showTable="showTable" :processViewer="fundProcessViewer"
                       :loading="loading"/>
</template>

<script setup lang="jsx">
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getFundDetailProcess} from "@/api/special-fund";
const processStore = useProcessStore()
const route = useRoute()
const fundData = ref({})
const fundProcessViewer = ref(true)
const showTable = ref(true)
const loading = ref(false)
const getDetail = async () => {
  const specialFundId = route.query.id
  showTable.value = false
  loading.value = true
  fundProcessViewer.value = false
  const {code, data, msg} = await getFundDetailProcess(specialFundId)
  if (code === 1000) {
    fundData.value = data
    loading.value = false
    if(data.operationList==null)return;
    processStore.setDesign(data)
    processStore.runningList.value = data.runningList;
    processStore.endList.value = data.endList;
    processStore.noTakeList.value = data.noTakeList;
    processStore.refuseList.value = data.refuseList;
    processStore.passList.value = data.passList;
    nextTick(() => {
      fundProcessViewer.value = true
      showTable.value = true
    })
  }else {
    ElNotification({
      title: '提示',
      message: msg,
      type: 'error'
    })
    loading.value = false
  }
}
getDetail()
</script>
<style scoped>

</style>
