feat: 添加订阅管理功能,新增路由和视图组件;更新路由映射和类型定义
This commit is contained in:
@@ -38,3 +38,10 @@ export enum WithdrawStatusEnum {
|
|||||||
rejected = '已拒绝',
|
rejected = '已拒绝',
|
||||||
completed = '已完成'
|
completed = '已完成'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum RwaSubscribeStatusEnum {
|
||||||
|
pending = '分配中',
|
||||||
|
rejected = '已拒绝',
|
||||||
|
allocated = '已分配',
|
||||||
|
cancelled = '已取消'
|
||||||
|
}
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ const local: App.I18n.Schema = {
|
|||||||
rwa_producttype: 'Product Type',
|
rwa_producttype: 'Product Type',
|
||||||
rwa: 'RWA Management',
|
rwa: 'RWA Management',
|
||||||
rwa_product: 'RWA Product',
|
rwa_product: 'RWA Product',
|
||||||
|
rwa_subscribe: 'RWA Subscribe',
|
||||||
user: 'User Management',
|
user: 'User Management',
|
||||||
user_bank: 'User Bank',
|
user_bank: 'User Bank',
|
||||||
user_bankcard: 'User Bank Card',
|
user_bankcard: 'User Bank Card',
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ const local: App.I18n.Schema = {
|
|||||||
rwa: 'RWA管理',
|
rwa: 'RWA管理',
|
||||||
rwa_product: 'RWA产品',
|
rwa_product: 'RWA产品',
|
||||||
rwa_producttype: 'RWA产品类型',
|
rwa_producttype: 'RWA产品类型',
|
||||||
|
rwa_subscribe: 'RWA申购记录',
|
||||||
user: '用户管理',
|
user: '用户管理',
|
||||||
user_list: '用户列表',
|
user_list: '用户列表',
|
||||||
user_bankcard: '用户银行卡',
|
user_bankcard: '用户银行卡',
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const views: Record<LastLevelRouteKey, RouteComponent | (() => Promise<Ro
|
|||||||
home: () => import("@/views/home/index.vue"),
|
home: () => import("@/views/home/index.vue"),
|
||||||
rwa_product: () => import("@/views/rwa/product/index.vue"),
|
rwa_product: () => import("@/views/rwa/product/index.vue"),
|
||||||
rwa_producttype: () => import("@/views/rwa/productType/index.vue"),
|
rwa_producttype: () => import("@/views/rwa/productType/index.vue"),
|
||||||
|
rwa_subscribe: () => import("@/views/rwa/subscribe/index.vue"),
|
||||||
user_bank: () => import("@/views/user/bank/index.vue"),
|
user_bank: () => import("@/views/user/bank/index.vue"),
|
||||||
user_bankcard: () => import("@/views/user/bankcard/index.vue"),
|
user_bankcard: () => import("@/views/user/bankcard/index.vue"),
|
||||||
user_list: () => import("@/views/user/list/index.vue"),
|
user_list: () => import("@/views/user/list/index.vue"),
|
||||||
|
|||||||
@@ -123,6 +123,15 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
title: 'rwa_producttype',
|
title: 'rwa_producttype',
|
||||||
i18nKey: 'route.rwa_producttype'
|
i18nKey: 'route.rwa_producttype'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'rwa_subscribe',
|
||||||
|
path: '/rwa/subscribe',
|
||||||
|
component: 'view.rwa_subscribe',
|
||||||
|
meta: {
|
||||||
|
title: 'rwa_subscribe',
|
||||||
|
i18nKey: 'route.rwa_subscribe'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ const routeMap: RouteMap = {
|
|||||||
"rwa": "/rwa",
|
"rwa": "/rwa",
|
||||||
"rwa_product": "/rwa/product",
|
"rwa_product": "/rwa/product",
|
||||||
"rwa_producttype": "/rwa/producttype",
|
"rwa_producttype": "/rwa/producttype",
|
||||||
|
"rwa_subscribe": "/rwa/subscribe",
|
||||||
"user": "/user",
|
"user": "/user",
|
||||||
"user_bank": "/user/bank",
|
"user_bank": "/user/bank",
|
||||||
"user_bankcard": "/user/bankcard",
|
"user_bankcard": "/user/bankcard",
|
||||||
|
|||||||
2
src/typings/elegant-router.d.ts
vendored
2
src/typings/elegant-router.d.ts
vendored
@@ -28,6 +28,7 @@ declare module "@elegant-router/types" {
|
|||||||
"rwa": "/rwa";
|
"rwa": "/rwa";
|
||||||
"rwa_product": "/rwa/product";
|
"rwa_product": "/rwa/product";
|
||||||
"rwa_producttype": "/rwa/producttype";
|
"rwa_producttype": "/rwa/producttype";
|
||||||
|
"rwa_subscribe": "/rwa/subscribe";
|
||||||
"user": "/user";
|
"user": "/user";
|
||||||
"user_bank": "/user/bank";
|
"user_bank": "/user/bank";
|
||||||
"user_bankcard": "/user/bankcard";
|
"user_bankcard": "/user/bankcard";
|
||||||
@@ -102,6 +103,7 @@ declare module "@elegant-router/types" {
|
|||||||
| "home"
|
| "home"
|
||||||
| "rwa_product"
|
| "rwa_product"
|
||||||
| "rwa_producttype"
|
| "rwa_producttype"
|
||||||
|
| "rwa_subscribe"
|
||||||
| "user_bank"
|
| "user_bank"
|
||||||
| "user_bankcard"
|
| "user_bankcard"
|
||||||
| "user_list"
|
| "user_list"
|
||||||
|
|||||||
95
src/views/rwa/subscribe/index.vue
Normal file
95
src/views/rwa/subscribe/index.vue
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { useTemplateRef } from 'vue';
|
||||||
|
import { useDateFormat } from '@vueuse/core';
|
||||||
|
import { client, safeClient } from '@/service/api';
|
||||||
|
import type { TableBaseColumns, TableFetchData, TableInst } from '@/components/table';
|
||||||
|
import { RwaSubscribeStatusEnum } from '@/enum';
|
||||||
|
|
||||||
|
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||||
|
|
||||||
|
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
||||||
|
return safeClient(() =>
|
||||||
|
client.api.admin.rwa.subscription.orders.get({
|
||||||
|
query: {
|
||||||
|
...pagination,
|
||||||
|
...filter
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const columns: TableBaseColumns = [
|
||||||
|
{
|
||||||
|
key: 'selection',
|
||||||
|
title: '序号',
|
||||||
|
type: 'selection',
|
||||||
|
width: 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户ID',
|
||||||
|
key: 'userId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '产品名称',
|
||||||
|
key: 'product.name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申购数量',
|
||||||
|
key: 'quantity',
|
||||||
|
render: (row: any) => {
|
||||||
|
return Number(row.quantity).toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '单价',
|
||||||
|
key: 'unitPrice',
|
||||||
|
render: (row: any) => {
|
||||||
|
return Number(row.unitPrice).toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '总价',
|
||||||
|
key: 'totalAmount',
|
||||||
|
render: (row: any) => {
|
||||||
|
return Number(row.totalAmount).toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申购时间',
|
||||||
|
key: 'createdAt',
|
||||||
|
render: (row: any) => {
|
||||||
|
return useDateFormat(new Date(row.createdAt), 'YYYY-MM-DD HH:mm:ss').value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
key: 'status',
|
||||||
|
render: (row: any) => {
|
||||||
|
return RwaSubscribeStatusEnum[row.status as keyof typeof RwaSubscribeStatusEnum];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
fixed: 'right',
|
||||||
|
key: 'operation',
|
||||||
|
width: 200,
|
||||||
|
operations: (row: any) => []
|
||||||
|
}
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<TableBase
|
||||||
|
ref="tableInst"
|
||||||
|
show-header-operation
|
||||||
|
:header-operations="{
|
||||||
|
add: false,
|
||||||
|
refresh: true,
|
||||||
|
columns: true
|
||||||
|
}"
|
||||||
|
:columns="columns"
|
||||||
|
:fetch-data="fetchData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="css" scoped></style>
|
||||||
Reference in New Issue
Block a user