<script setup lang="ts">

import BaseContainer from '@/components/base/BaseContainer.vue'
import { onBeforeUnmount, ref, watch } from 'vue'
interface Props{
  item:any,
  getItemDetailMethod:Function,
}
const emits = defineEmits('closeDialog')
const dialogVisible = ref(true);
const props = defineProps<Props>();
const currentShowData = ref();
watch(() => props.item,async () => {
  if(props.item == null) return;
  const res = await props.getItemDetailMethod.apply(this,[{pageNum:1,pageSize:100},props.item.unifiedSocialCreditCode]);
  currentShowData.value = res;
})
const ia = ()=>{
  console.log('初始化');
}
const ca = ()=>{
  console.log('确认');
}
const oa = ()=>{
  console.log('打开窗口');
}
const closeDialog = ()=>{
  currentShowData.value = []
  emits('closeDialog')
}


</script>

<template>
  <BaseContainer @closeDialog = "closeDialog" :isShow="dialogVisible" :showData="currentShowData" :initAction="ia" :confirmAction="ca" :openAction="oa" />
</template>

<style scoped>

</style>