Commit dfc4b8ee authored by chenqikuai's avatar chenqikuai

fix

parent 3ac1c8d7
......@@ -134,3 +134,16 @@ export function deleteCopyRights(ids: number[]) {
},
});
}
export function getBills(payload: {
name?: string;
type?: number;
page: number;
page_size: number;
}) {
return $ajax({
type: "get",
url: "/api/billings",
params: payload,
});
}
......@@ -4,29 +4,48 @@
ref="tableRef"
:columns="tableColumns"
height="100%"
:data="data"
:data="tableData"
v-loading="loading"
element-loading-text="加载中..."
>
<template #fee="slotProps">
<div
:style="{
color: green.color || red.color,
color: (
slotProps.amount !== 0
? slotProps.amount
: slotProps.chain_times > 0
)
? green.color
: red.color,
}"
>
{{ 11 }} 元 积分
{{ slotProps.amount !== 0 ? slotProps.amount + "元" : "" }}
{{ slotProps.amount === 0 ? slotProps.chain_times + "次" : "" }}
</div>
</template>
<template #type="slotProps">
{{ (slotProps.type === 1 && "实名认证") || "" }}
{{ (slotProps.type === 2 && "套餐购买") || "" }}
{{ (slotProps.type === 3 && "存证上链") || "" }}
{{ (slotProps.type === 4 && "文件上链") || "" }}
{{ (slotProps.type === 5 && "版权备案") || "" }}
</template>
<template #create_time="slotProps">
{{ formatTime(slotProps.create_time) }}
</template>
</Table>
</template>
<script setup lang="ts">
import Table from "@/components/Table/index.vue";
import { tableColumns } from "./table";
import { ref } from "vue";
import { onMounted, ref } from "vue";
import { formatTime } from "cqk-sy-ui";
import { eStatusOfCopyright } from "@/components/ApproveStatus/status";
import { useTableScrollListener } from "@/components/Table/hooks";
import { useTableData, useTableScrollListener } from "@/components/Table/hooks";
import { green, red } from "@/components/ApproveStatus/btnStyle";
import { getBills } from "@/service/copyrightService";
// defineProps<{
// // data: any[];
......@@ -37,7 +56,6 @@ const data = [] as any[];
const loading = false;
const emit = defineEmits<{
(e: "scrollToEnd"): void;
(
e: "clickOperate",
payload: {
......@@ -50,8 +68,22 @@ const emit = defineEmits<{
const tableRef = ref<InstanceType<typeof Table>>();
const { tableData, fetchNextPage } = useTableData({
fetchData: async ({ page, page_size }) => {
const res = await getBills({
name: "",
page,
page_size,
});
return {
total: res?.data.total,
data: res?.data.results || [],
};
},
});
useTableScrollListener(tableRef, () => {
emit("scrollToEnd");
fetchNextPage();
});
</script>
......
......@@ -6,18 +6,16 @@ export const tableColumns = [
prop: "name",
},
{
label: "商品名称",
prop: "address",
},
{
label: "费用",
slotName: "fee",
},
{
label: "费用类型",
prop: "date",
prop: "type",
slotName: "type",
},
{
label: "费用时间",
slotName: "create_time",
},
] as iTableColumn[];
......@@ -38,7 +38,9 @@
:infos="userInfo"
@ToUpdate="ToUpdate"
></Secutiry>
<div style="height: 400px">
<OrderRecords></OrderRecords>
</div>
</ModuleContainer>
</div>
<div class="">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment