mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-16 06:03:42 +08:00
feat(ui): 新增弹窗及时间格式化
This commit is contained in:
29
gpt-vue/projects/vue-admin/src/views/LoginLog.vue
Normal file
29
gpt-vue/projects/vue-admin/src/views/LoginLog.vue
Normal 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>
|
||||
@@ -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>
|
||||
9
gpt-vue/projects/vue-admin/src/views/Reward/api.ts
Normal file
9
gpt-vue/projects/vue-admin/src/views/Reward/api.ts
Normal 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
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user