<template>
  <div style="margin-top:10px;padding: 10px;"  v-if="list.length > 0">
    
    <el-table :data="list" :stripe="true" :show-overflow-tooltip="true">
      <el-table-column label="状态" align="center" prop="createTime" >
        <template #default="scope">
          {{scope.row.status === 1 ? '通过' : '拒绝'}}
        </template>
      </el-table-column>
      <el-table-column label="审核时间" align="center" prop="createTime">
        <template #default="scope">
          {{ formatDate(scope.row.createTime,"YYYY-MM-DD HH:mm") }}
        </template>
      </el-table-column>
      <el-table-column label="审核内容" align="center" prop="checkComment" >
        <template #default="scope">
          {{ scope.row.checkComment}}
        </template>
      </el-table-column>
      <!-- <el-table-column label="来源" align="center" prop="" /> -->
      
    </el-table>
    <!-- 分页 -->
    <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
      @pagination="getList" />
  </div>
  <div style="text-align: center;margin-top: 50px;font-size: 14px;"  v-else>
    暂无申请记录
  </div>

</template>


<script setup>
import { formatDate } from '@/utils/formatTime'
import * as ProductSpuApi from '@/api/mall/product/spu'
// import MerchantStoreTab from './MerchantStoreTab.vue'



const message = useMessage() // 消息弹窗

const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据
const queryParams = reactive({
    pageNo: 1,
    pageSize: 10,
    productSpuApplyId:undefined
})
const props = defineProps({
  propFormData: {
    type: Object,
    default: () => ({})
  }
})


/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    const data = await ProductSpuApi.getApplyLog(queryParams)
    list.value = data.list
    total.value = data.total
  } finally {
    loading.value = false
  }
}

/** 初始化 **/
onMounted(() => {
  queryParams.productSpuApplyId = props.propFormData.id

  getList()
})
</script>
<style src="@/styles/SearchIndex.css"  lang="scss" scoped></style>

<style lang="scss" scoped>
.setting {
  display: none !important;
}

.card:hover {
  .setting {
    display: block !important;

    .el-icon {
      margin-top: 5px;
    }
  }
}
::v-deep .el-card__body {
  padding: 0px !important
}
</style>
