<template>
  <el-table :data="tableData">
    <el-table-column prop="orderId" label="订单号" />
    <el-table-column prop="comments" label="产品名称" />
    <el-table-column prop="payPrice" label="订单金额(元)" />
    <el-table-column prop="month" label="购买时长(月)" />
    <el-table-column prop="appName" label="应用名称" />
    <el-table-column prop="createTime" label="下单时间" />
    <el-table-column prop="action" label="操作">
      <template #default="scope">
        <el-button @click="openUrl(`https://${scope.row.tenantId}.websoft.top`,form,scope.row.tenantId,true)">控制台</el-button></template>
    </el-table-column>
  </el-table>
</template>
<script setup lang="ts">

import {ref} from "vue";
import type {ApiResult, PageResult} from "~/api";
import type {OrderGoods} from "~/api/system/orderGoods/model";

withDefaults(
    defineProps<{
      form?: any;
      title?: string;
      desc?: string;
    }>(),
    {}
);

const tableData = ref<OrderGoods[]>([]);

const {data: response} = await useServerRequest<ApiResult<PageResult<OrderGoods>>>('/system/order-goods/page',{
  params: {
    userId: localStorage.getItem('UserId')
  }
})
if(response.value?.data){
  tableData.value = response.value.data.list;
  console.log(tableData.value,'tableData')
}
</script>

<style scoped lang="less">

</style>
