<script setup lang="ts">
import { useDetail } from "/@/hooks/core/useDetail"
import BaseForm from "./components/BaseForm.vue"

import ProductDetail from "/@/components/productDetail/index.vue"
import { httpDetail } from "/@/api/invoiceInOut/productManager";
import { useTask } from "/@/hooks/core"

const detailTask = useTask()
const { title, isDetail, collapses, id } = useDetail({ baseName: '商品', collapseLen: 2 });

id.value && detailTask.run(httpDetail({ id: id.value }))
</script>

<template>
  <div class="padding__container" v-loading="detailTask.loading">
     <p class="my-[5px]" style="font-size:14px">{{ title }}</p>
     
     <BaseForm v-if="!isDetail" />
     <ProductDetail v-if="detailTask.data" :data="detailTask.data" />
  </div>
</template>
