<template>
  <FillPreview v-if="currentBusinessId" :businessId="currentBusinessId" backUrl="/mid/fill/data" type="fill" />
</template>

<script setup>
import { useRoute } from 'vue-router';
import FillPreview from '../../preview/index.vue';
import { onMounted, ref, watch } from 'vue';

const route = useRoute();

const currentBusinessId = ref('');

onMounted(() => {
  init();
});

const init = () => {
  const { businessId } = route.query;
  currentBusinessId.value = businessId;
};

watch(
  () => route.query?.businessId,
  val => {
    if (route.path == '/mid/fill/detail') {
      init();
    }
  },
  { deep: true }
);
</script>

<style></style>
