feat: 添加上分记录管理
This commit is contained in:
@@ -237,7 +237,9 @@ const local: App.I18n.Schema = {
|
||||
check: 'CheckIn',
|
||||
referral: 'Referral',
|
||||
deposit: 'Deposit',
|
||||
subscription: 'Subscription'
|
||||
subscription: 'Subscription',
|
||||
user_user: 'Users',
|
||||
user_wallet: 'Wallet Logs'
|
||||
},
|
||||
page: {
|
||||
login: {
|
||||
|
||||
@@ -233,7 +233,9 @@ const local: App.I18n.Schema = {
|
||||
check: '签到记录',
|
||||
referral: '推广管理',
|
||||
deposit: '充值管理',
|
||||
subscription: '认购记录'
|
||||
subscription: '认购记录',
|
||||
user_user: '用户列表',
|
||||
user_wallet: '上分记录'
|
||||
},
|
||||
page: {
|
||||
login: {
|
||||
|
||||
@@ -27,7 +27,8 @@ export const views: Record<LastLevelRouteKey, RouteComponent | (() => Promise<Ro
|
||||
product: () => import("@/views/product/index.vue"),
|
||||
referral: () => import("@/views/referral/index.vue"),
|
||||
subscription: () => import("@/views/subscription/index.vue"),
|
||||
user: () => import("@/views/user/index.vue"),
|
||||
user_user: () => import("@/views/user/user/index.vue"),
|
||||
user_wallet: () => import("@/views/user/wallet/index.vue"),
|
||||
wallet: () => import("@/views/wallet/index.vue"),
|
||||
withdraw: () => import("@/views/withdraw/index.vue"),
|
||||
};
|
||||
|
||||
@@ -137,12 +137,32 @@ export const generatedRoutes: GeneratedRoute[] = [
|
||||
{
|
||||
name: 'user',
|
||||
path: '/user',
|
||||
component: 'layout.base$view.user',
|
||||
component: 'layout.base',
|
||||
meta: {
|
||||
title: 'user',
|
||||
i18nKey: 'route.user',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'user_user',
|
||||
path: '/user/user',
|
||||
component: 'view.user_user',
|
||||
meta: {
|
||||
title: 'user_user',
|
||||
i18nKey: 'route.user_user'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'user_wallet',
|
||||
path: '/user/wallet',
|
||||
component: 'view.user_wallet',
|
||||
meta: {
|
||||
title: 'user_wallet',
|
||||
i18nKey: 'route.user_wallet'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'wallet',
|
||||
|
||||
@@ -176,6 +176,8 @@ const routeMap: RouteMap = {
|
||||
"referral": "/referral",
|
||||
"subscription": "/subscription",
|
||||
"user": "/user",
|
||||
"user_user": "/user/user",
|
||||
"user_wallet": "/user/wallet",
|
||||
"wallet": "/wallet",
|
||||
"withdraw": "/withdraw"
|
||||
};
|
||||
|
||||
5
src/typings/elegant-router.d.ts
vendored
5
src/typings/elegant-router.d.ts
vendored
@@ -30,6 +30,8 @@ declare module "@elegant-router/types" {
|
||||
"referral": "/referral";
|
||||
"subscription": "/subscription";
|
||||
"user": "/user";
|
||||
"user_user": "/user/user";
|
||||
"user_wallet": "/user/wallet";
|
||||
"wallet": "/wallet";
|
||||
"withdraw": "/withdraw";
|
||||
};
|
||||
@@ -106,7 +108,8 @@ declare module "@elegant-router/types" {
|
||||
| "product"
|
||||
| "referral"
|
||||
| "subscription"
|
||||
| "user"
|
||||
| "user_user"
|
||||
| "user_wallet"
|
||||
| "wallet"
|
||||
| "withdraw"
|
||||
>;
|
||||
|
||||
@@ -104,8 +104,9 @@ async function handleSubmit() {
|
||||
client.api.admin.wallet_import.jobs.post({
|
||||
fileId: fileId.value
|
||||
})
|
||||
);
|
||||
loading.value = false;
|
||||
).finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
window.$message?.success('操作成功');
|
||||
emit('close');
|
||||
}
|
||||
68
src/views/user/wallet/components/import-job-details.vue
Normal file
68
src/views/user/wallet/components/import-job-details.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<script lang="ts" setup>
|
||||
import { useTemplateRef } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { client, safeClient } from '@/service/api';
|
||||
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
||||
|
||||
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
||||
return safeClient(() => client.api.admin.wallet_import.jobs.get({ query: { ...pagination, ...filter } }));
|
||||
};
|
||||
|
||||
const columns: TableBaseColumns = [
|
||||
{
|
||||
key: 'id',
|
||||
title: 'ID'
|
||||
},
|
||||
{
|
||||
key: 'walletTypeCodeRaw',
|
||||
title: '钱包类型'
|
||||
},
|
||||
{
|
||||
key: 'phoneNumber',
|
||||
title: '手机号'
|
||||
},
|
||||
{
|
||||
key: 'memo',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
key: 'createdAt',
|
||||
title: '创建时间',
|
||||
render: (row: any) => {
|
||||
return dayjs(row.createdAt).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
title: '状态'
|
||||
},
|
||||
{
|
||||
key: 'amount',
|
||||
title: '金额'
|
||||
},
|
||||
{
|
||||
key: 'error',
|
||||
title: '错误信息'
|
||||
}
|
||||
];
|
||||
|
||||
const filterColumns: TableFilterColumns = [];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableBase
|
||||
ref="tableInst"
|
||||
:fetch-data="fetchData"
|
||||
:columns="columns"
|
||||
:filter-columns="filterColumns"
|
||||
:scroll-x="1200"
|
||||
:header-operations="{
|
||||
add: false,
|
||||
refresh: true,
|
||||
columns: true
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="css" scoped></style>
|
||||
131
src/views/user/wallet/index.vue
Normal file
131
src/views/user/wallet/index.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<script lang="ts" setup>
|
||||
import { h, useTemplateRef } from 'vue';
|
||||
import { NSelect, useDialog } from 'naive-ui';
|
||||
import dayjs from 'dayjs';
|
||||
import { client, safeClient } from '@/service/api';
|
||||
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
||||
import ImportJobDetails from './components/import-job-details.vue';
|
||||
|
||||
defineOptions({
|
||||
name: 'WalletImportJobs'
|
||||
});
|
||||
|
||||
const dialog = useDialog();
|
||||
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
||||
return safeClient(() => client.api.admin.wallet_import.jobs.get({ query: { ...pagination, ...filter } }));
|
||||
};
|
||||
|
||||
const columns: TableBaseColumns = [
|
||||
{
|
||||
key: 'id',
|
||||
title: 'ID'
|
||||
},
|
||||
{
|
||||
key: 'createdBy',
|
||||
title: '创建者'
|
||||
},
|
||||
{
|
||||
key: 'startedAt',
|
||||
title: '开始时间',
|
||||
render: (row: any) => {
|
||||
return dayjs(row.startedAt).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'finishedAt',
|
||||
title: '结束时间',
|
||||
render: (row: any) => {
|
||||
return dayjs(row.finishedAt).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'createdAt',
|
||||
title: '创建时间',
|
||||
render: (row: any) => {
|
||||
return dayjs(row.createdAt).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
title: '状态'
|
||||
},
|
||||
{
|
||||
key: 'total',
|
||||
title: '任务总数'
|
||||
},
|
||||
{
|
||||
key: 'processed',
|
||||
title: '已处理数'
|
||||
},
|
||||
{
|
||||
key: 'success',
|
||||
title: '成功数'
|
||||
},
|
||||
{
|
||||
key: 'failed',
|
||||
title: '失败数'
|
||||
},
|
||||
{
|
||||
key: 'ignored',
|
||||
title: '忽略数'
|
||||
},
|
||||
{
|
||||
key: 'error',
|
||||
title: '错误信息'
|
||||
},
|
||||
{
|
||||
key: 'operations',
|
||||
title: '操作',
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
operations: (row: any) => [
|
||||
{
|
||||
contentText: '查看明细',
|
||||
size: 'small',
|
||||
onClick: () => {
|
||||
dialog.create({
|
||||
title: '导入明细',
|
||||
showIcon: false,
|
||||
style: { width: '800px' },
|
||||
content: () => h(ImportJobDetails, { jobId: row.id })
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const filterColumns: TableFilterColumns = [
|
||||
{
|
||||
key: 'status',
|
||||
title: '状态',
|
||||
component: NSelect,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '待处理', value: 'pending' },
|
||||
{ label: '处理中', value: 'processing' },
|
||||
{ label: '已完成', value: 'completed' },
|
||||
{ label: '失败', value: 'failed' }
|
||||
]
|
||||
}
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableBase
|
||||
ref="tableInst"
|
||||
:fetch-data="fetchData"
|
||||
:columns="columns"
|
||||
:filter-columns="filterColumns"
|
||||
:scroll-x="2000"
|
||||
:header-operations="{
|
||||
add: false,
|
||||
refresh: true,
|
||||
columns: true
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="css" scoped></style>
|
||||
Reference in New Issue
Block a user