feat(ui): 新增弹窗及时间格式化

This commit is contained in:
廖彦棋
2024-03-07 09:23:45 +08:00
parent f2cfcfeefc
commit a36f14eb94
11 changed files with 217 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
<script lang="ts" setup>
import { dateFormat } from "@gpt-vue/packages/utils";
import SearchTable from "@/components/SearchTable/SearchTable.vue";
import type { SearchTableColumns } from "@/components/SearchTable/type";
import { loginLog } from "@/http/login";
const columns: SearchTableColumns[] = [
{
dataIndex: "username",
title: "用户名",
},
{
dataIndex: "login_ip",
title: "登录IP",
},
{
dataIndex: "login_address",
title: "登录地址",
},
{
dataIndex: "created_at",
title: "登陆时间",
render: ({ record }) => dateFormat(record.created_at),
},
];
</script>
<template>
<SearchTable :request="loginLog" :columns="columns" />
</template>

View File

@@ -0,0 +1,59 @@
<script lang="ts" setup>
import type { TableColumnData } from "@arco-design/web-vue";
import { dateFormat } from "@gpt-vue/packages/utils";
import SimpleTable from "@/components/SimpleTable/SimpleTable.vue";
import { getList } from "./api";
const columns: TableColumnData[] = [
{
dataIndex: "username",
title: "用户",
},
{
dataIndex: "tx_id",
title: "转账单号",
},
{
dataIndex: "amount",
title: "转账金额",
},
{
dataIndex: "remark",
title: "备注",
},
{
dataIndex: "created_at",
title: "转账时间",
render: ({ record }) => dateFormat(record.created_at),
},
{
title: "核销时间",
slotName: "updated_at",
},
{
title: "兑换详情",
slotName: "exchange",
},
{
title: "操作",
slotName: "actions",
fixed: "right",
},
];
</script>
<template>
<SimpleTable :request="getList" :columns="columns">
<template #updated_at="{ record }">
<span v-if="record.status">{{ dateFormat(record.updated_at) }}</span>
<a-tag v-else>未核销</a-tag>
</template>
<template #exchange="{ record }">
<a-tag v-if="record.exchange.calls > 0"
>聊天{{ record.exchange.calls }}</a-tag
>
<a-tag v-else-if="record.exchange.img_calls > 0"
>绘图{{ record.exchange.img_calls }}</a-tag
>
</template>
</SimpleTable>
</template>

View File

@@ -0,0 +1,9 @@
import http from "@/http/config";
export const getList = (params?: Record<string, unknown>) => {
return http({
url: "/api/admin/reward/list",
method: "get",
params
})
}