feat: 更新 @riwa/api-types 依赖至 0.0.67;新增资产视图及相关路由配置;优化 RWA 产品组件的操作按钮及功能

This commit is contained in:
2025-12-28 02:19:02 +07:00
parent f2f311fdab
commit e4e99f9ee2
12 changed files with 132 additions and 65 deletions

View File

@@ -50,7 +50,7 @@
"@better-scroll/core": "2.5.1",
"@elysiajs/eden": "^1.4.5",
"@iconify/vue": "5.0.0",
"@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz",
"@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz",
"@sa/axios": "workspace:*",
"@sa/color": "workspace:*",
"@sa/hooks": "workspace:*",

12
pnpm-lock.yaml generated
View File

@@ -18,8 +18,8 @@ importers:
specifier: 5.0.0
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
'@riwa/api-types':
specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz
version: http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))
specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz
version: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))
'@sa/axios':
specifier: workspace:*
version: link:packages/axios
@@ -1068,9 +1068,9 @@ packages:
'@quansync/fs@0.1.6':
resolution: {integrity: sha512-zoA8SqQO11qH9H8FCBR7NIbowYARIPmBz3nKjgAaOUDi/xPAAu1uAgebtV7KXHTc6CDZJVRZ1u4wIGvY5CWYaw==}
'@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz':
resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz}
version: 0.0.66
'@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz':
resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz}
version: 0.0.67
peerDependencies:
'@elysiajs/eden': ^1.4.5
@@ -5057,7 +5057,7 @@ snapshots:
dependencies:
quansync: 0.3.0
'@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.66.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))':
'@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))':
dependencies:
'@elysiajs/eden': 1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))

View File

@@ -32,9 +32,7 @@ function handleConfirm() {
</script>
<template>
<div class="rounded-lg bg-white p-5 dark:bg-container">
<div class="mb-5">搜索</div>
<div class="rounded-lg bg-white px-5 pt-5 dark:bg-container">
<NForm :label-width="80" label-align="left" label-placement="left">
<NGrid x-gap="20" :cols="4">
<NGi v-for="col in columns" :key="col.key">

View File

@@ -20,6 +20,7 @@ export const views: Record<LastLevelRouteKey, RouteComponent | (() => Promise<Ro
500: () => import("@/views/_builtin/500/index.vue"),
"iframe-page": () => import("@/views/_builtin/iframe-page/[url].vue"),
login: () => import("@/views/_builtin/login/index.vue"),
asset: () => import("@/views/asset/index.vue"),
deposit_fiat: () => import("@/views/deposit/fiat/index.vue"),
home: () => import("@/views/home/index.vue"),
rwa_product: () => import("@/views/rwa/product/index.vue"),

View File

@@ -39,6 +39,15 @@ export const generatedRoutes: GeneratedRoute[] = [
hideInMenu: true
}
},
{
name: 'asset',
path: '/asset',
component: 'layout.base$view.asset',
meta: {
title: 'asset',
i18nKey: 'route.asset'
}
},
{
name: 'deposit',
path: '/deposit',
@@ -135,6 +144,26 @@ export const generatedRoutes: GeneratedRoute[] = [
}
]
},
{
name: 'tradingpairs',
path: '/tradingpairs',
component: 'layout.base$view.tradingpairs',
meta: {
title: 'tradingpairs',
i18nKey: 'route.tradingpairs',
order: 6
}
},
{
name: 'transfer',
path: '/transfer',
component: 'layout.base$view.transfer',
meta: {
title: 'transfer',
i18nKey: 'route.transfer',
order: 5
}
},
{
name: 'user',
path: '/user',
@@ -214,25 +243,5 @@ export const generatedRoutes: GeneratedRoute[] = [
}
}
]
},
{
name: 'transfer',
path: '/transfer',
component: 'layout.base$view.transfer',
meta: {
title: 'transfer',
i18nKey: 'route.transfer',
order: 5
}
},
{
name: 'tradingpairs',
path: '/tradingpairs',
component: 'layout.base$view.tradingpairs',
meta: {
title: 'tradingpairs',
i18nKey: 'route.tradingpairs',
order: 6
}
},
}
];

View File

@@ -166,6 +166,7 @@ const routeMap: RouteMap = {
"403": "/403",
"404": "/404",
"500": "/500",
"asset": "/asset",
"deposit": "/deposit",
"deposit_fiat": "/deposit/fiat",
"home": "/home",

View File

@@ -20,6 +20,7 @@ declare module "@elegant-router/types" {
"403": "/403";
"404": "/404";
"500": "/500";
"asset": "/asset";
"deposit": "/deposit";
"deposit_fiat": "/deposit/fiat";
"home": "/home";
@@ -73,6 +74,7 @@ declare module "@elegant-router/types" {
| "403"
| "404"
| "500"
| "asset"
| "deposit"
| "home"
| "iframe-page"
@@ -103,6 +105,7 @@ declare module "@elegant-router/types" {
| "500"
| "iframe-page"
| "login"
| "asset"
| "deposit_fiat"
| "home"
| "rwa_product"

View File

@@ -0,0 +1,5 @@
<script lang="ts" setup></script>
<template>Hello world</template>
<style lang="css" scoped></style>

View File

@@ -22,9 +22,9 @@ const form = ref({
totalSupply: '1',
unitPrice: '1',
dividendRate: '0.01',
launchDate: dayjs().add(1, 'day').valueOf() as number | null,
subscriptionStartDate: null as number | null,
subscriptionEndDate: null as number | null
launchDate: dayjs().valueOf() as number | null,
subscriptionStartDate: dayjs().valueOf() as number | null,
subscriptionEndDate: dayjs().valueOf() as number | null
});
const rules: FormRules = {
@@ -66,11 +66,6 @@ function validateTimes() {
function handleCreateDraft() {
formInst.value?.validate(async errors => {
if (!errors) {
const timeError = validateTimes();
if (timeError) {
window.$message?.error(timeError);
return;
}
await safeClient(
client.api.admin.rwa.issuance.editions.post({
...form.value,

View File

@@ -23,9 +23,9 @@ const form = ref<Body>({
totalSupply: props.data.totalSupply,
unitPrice: props.data.unitPrice,
dividendRate: props.data.dividendRate,
launchDate: dayjs(props.data.launchDate).toDate(),
subscriptionStartDate: props.data.subscriptionStartDate ? dayjs(props.data.subscriptionStartDate).toDate() : null,
subscriptionEndDate: props.data.subscriptionEndDate ? dayjs(props.data.subscriptionEndDate).toDate() : null
launchDate: dayjs().toDate(),
subscriptionStartDate: dayjs().toDate(),
subscriptionEndDate: dayjs().toDate()
});
const rules: FormRules = {
@@ -67,11 +67,6 @@ function validateTimes() {
function handleSubmit() {
formInst.value?.validate(async errors => {
if (!errors) {
const timeError = validateTimes();
if (timeError) {
window.$message?.error(timeError);
return;
}
await safeClient(
client.api.admin.rwa.issuance.editions.post({
...form.value,

View File

@@ -59,7 +59,10 @@ const columns: TableBaseColumns = [
},
{
title: '分红率',
key: 'editionName'
key: 'dividendRate',
render: (row: any) => {
return `${(Number(row.dividendRate) * 100).toFixed(2)}%`;
}
},
{
title: '预热时间',
@@ -93,18 +96,19 @@ const columns: TableBaseColumns = [
title: '操作',
fixed: 'right',
key: 'operation',
width: 'auto',
width: 300,
operations: (row: any) => [
{
contentText: '发布',
contentText: '排期',
type: 'primary',
ghost: true,
size: 'small',
visible: row.status === 'draft' || row.status === 'cancelled',
text: true,
onClick: async () => {
dialog.create({
title: '确认发布该发行期吗?',
content: '发布后该发行期将对投资者可见,且不可修改。',
title: '确认期吗?',
content: '排期后将对投资者可见,且不可修改。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
@@ -115,15 +119,16 @@ const columns: TableBaseColumns = [
}
},
{
contentText: '取消发布',
contentText: '取消排期',
type: 'primary',
ghost: true,
size: 'small',
text: true,
visible: row.status === 'scheduled',
onClick: async () => {
dialog.create({
title: '确认取消发布该发行期吗?',
content: '取消发布后该发行期将对投资者不可见,且不可修改。',
title: '确认取消发布该期吗?',
content: '取消期将对投资者不可见,且不可修改。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
@@ -133,11 +138,36 @@ const columns: TableBaseColumns = [
});
}
},
{
contentText: '执行分红',
type: 'primary',
ghost: true,
size: 'small',
text: true,
// visible: row.status === 'scheduled',
onClick: async () => {
dialog.create({
title: '确认执行分红吗?',
content: '执行分红后将按照分红率向持有者分配收益。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(
client.api.admin.rwa.issuance.dividend.distribute.post({
editionId: row.id as string
})
);
tableInst.value?.reload();
}
});
}
},
{
contentText: '申购记录',
type: 'primary',
ghost: true,
size: 'small',
text: true,
visible: row.status === 'scheduled',
onClick: () => handleAllocations(row)
},
@@ -146,7 +176,8 @@ const columns: TableBaseColumns = [
type: 'primary',
ghost: true,
size: 'small',
visible: row.status === 'draft',
text: true,
// visible: row.status === 'draft',
onClick: () => handleEdit(row)
},
{
@@ -154,11 +185,12 @@ const columns: TableBaseColumns = [
type: 'error',
ghost: true,
size: 'small',
visible: row.status === 'draft' || row.status === 'cancelled',
text: true,
// visible: row.status === 'draft' || row.status === 'cancelled',
onClick: () => {
dialog.create({
title: '确认删除该发行期吗?',
content: '删除后该发行期将不可恢复,请谨慎操作。',
title: '确认删除该期吗?',
content: '删除后该期将不可恢复,请谨慎操作。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
@@ -174,7 +206,7 @@ const columns: TableBaseColumns = [
function handleAdd() {
const dialogInstance = dialog.create({
title: '添加发行期',
title: '添加阶段',
content: () =>
h(AddEdition, {
productId: props.data.id,
@@ -192,7 +224,7 @@ function handleAdd() {
}
function handleEdit(row: any) {
const dialogInstance = dialog.create({
title: '编辑发行期',
title: '编辑阶段',
content: () =>
h(EditEdition, {
data: row,
@@ -219,7 +251,7 @@ function handleAllocations(row: any) {
</script>
<template>
<TableBase ref="tableInst" title="RWA发行期" :columns="columns" :fetch-data="fetchData" @add="handleAdd" />
<TableBase ref="tableInst" title="RWA阶段" :columns="columns" :fetch-data="fetchData" @add="handleAdd" />
</template>
<style lang="css" scoped></style>

View File

@@ -148,10 +148,10 @@ const columns: TableBaseColumns = [
},
{
contentText: '编辑',
type: 'tertiary',
type: 'primary',
ghost: true,
size: 'small',
visible: row.status === 'draft' || row.status === 'rejected',
// visible: row.status === 'draft' || row.status === 'rejected',
onClick: () => {
handleEdit(row);
}
@@ -161,7 +161,7 @@ const columns: TableBaseColumns = [
type: 'error',
ghost: true,
size: 'small',
visible: row.status === 'draft' || row.status === 'rejected',
// visible: row.status === 'draft' || row.status === 'rejected',
onClick: () => {
dialog.create({
title: '删除产品',
@@ -183,6 +183,15 @@ const columns: TableBaseColumns = [
onClick: () => {
handleViewEditions(row);
}
},
{
contentText: '代币化',
type: 'tertiary',
ghost: true,
size: 'small',
onClick: () => {
handleTokenization(row);
}
}
]
}
@@ -204,6 +213,25 @@ const filterColumns: TableFilterColumns = [
}
];
function handleTokenization(row: any) {
dialog.create({
title: '代币化产品',
content: '确认将该产品代币化吗?',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(() =>
client.api.admin.rwa.tokenization.issue.post({
assetCode: row.code,
productId: row.id,
totalSupply: row.estimatedValue
})
);
tableInst.value?.reload();
}
});
}
function handleAdd() {
const dialogInstance = dialog.create({
title: '添加产品',