feat: 更新 @riwa/api-types 依赖版本至 0.0.58;优化产品编号验证逻辑,调整按钮文本和表单字段类型

This commit is contained in:
2025-12-23 03:40:50 +07:00
parent c1076b5e98
commit 0f2f806593
7 changed files with 138 additions and 38 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.56.tgz",
"@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.59.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.56.tgz
version: http://192.168.1.27:9527/api/riwa-api-types-0.0.56.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.59.tgz
version: http://192.168.1.27:9527/api/riwa-api-types-0.0.59.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.56.tgz':
resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.56.tgz}
version: 0.0.56
'@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.59.tgz':
resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.59.tgz}
version: 0.0.59
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.56.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.59.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

@@ -184,7 +184,7 @@ function handleCreateDraftAndSubmit() {
</NFormItem>
<NSpace justify="end" class="mt-5">
<NButton type="primary" ghost @click="handleCreateDraftAndSubmit">创建并发布</NButton>
<NButton type="primary" ghost @click="handleCreateDraftAndSubmit">创建并提交审核</NButton>
<NButton type="primary" @click="handleCreateDraft">创建</NButton>
</NSpace>
</NForm>

View File

@@ -25,14 +25,33 @@ const form = ref<Body>({
code: '',
categoryId: '',
description: '',
estimatedValue: '',
totalSupplyLimit: '',
estimatedValue: '1',
totalSupplyLimit: '100',
proofDocuments: ''
});
const rules: FormRules = {
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
code: [{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] }],
code: [
{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] },
{
trigger: ['blur'],
asyncValidator: async (rule, value, callback) => {
if (!value) return;
const { data: check } = await safeClient(() =>
client.api.admin.rwa.issuance.products.check_code.get({
query: {
code: value
}
})
);
if (check.value?.exists) {
callback(new Error('产品编号已存在'));
}
callback();
}
}
],
categoryId: [{ required: true, message: '请输入产品类型', trigger: ['blur', 'input'] }],
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]
@@ -89,10 +108,20 @@ function handleCreateDraftAndSubmit() {
/>
</NFormItem>
<NFormItem path="estimatedValue" label="产品估值">
<NInput v-model:value="form.estimatedValue" />
<NInputNumber
:min="1"
:step="100"
:value="Number(form.estimatedValue)"
@update:value="val => (form.estimatedValue = String(val))"
/>
</NFormItem>
<NFormItem path="totalSupplyLimit" label="总发行量">
<NInput v-model:value="form.totalSupplyLimit" />
<NInputNumber
:min="1"
:step="100"
:value="Number(form.totalSupplyLimit)"
@update:value="val => (form.totalSupplyLimit = String(val))"
/>
</NFormItem>
<NFormItem path="description" label="产品描述">
<NInput v-model:value="form.description" type="textarea" />

View File

@@ -38,7 +38,27 @@ const form = ref<Body>({
const rules: FormRules = {
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
code: [{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] }],
code: [
{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] },
{
trigger: ['blur'],
asyncValidator: async (rule, value, callback) => {
if (!value) return;
const { data: check } = await safeClient(() =>
client.api.admin.rwa.issuance.products.check_code.get({
query: {
code: value,
excludeId: props.data.id
}
})
);
if (check.value?.exists) {
callback(new Error('产品编号已存在'));
}
callback();
}
}
],
categoryId: [{ required: true, message: '请输入产品类型', trigger: ['blur', 'input'] }],
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]

View File

@@ -145,9 +145,18 @@ const columns: TableBaseColumns = [
type: 'error',
ghost: true,
size: 'small',
visible: row.status === 'draft',
visible: row.status === 'draft' || row.status === 'cancelled',
onClick: () => {
tableInst.value?.reload();
dialog.create({
title: '确认删除该发行期吗?',
content: '删除后该发行期将不可恢复,请谨慎操作。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(client.api.admin.rwa.issuance.editions({ id: row.id }).delete());
tableInst.value?.reload();
}
});
}
}
]

View File

@@ -79,18 +79,25 @@ const columns: TableBaseColumns = [
width: 300,
operations: (row: any) => [
{
contentText: '提交到流程',
contentText: '提交到审核',
ghost: true,
visible: row.status === 'draft',
size: 'small',
onClick: async () => {
// await safeClient(() =>
// client.api.admin.rwa.issuance.approve.post({
// productId: row.id as string,
// publishFirstEdition: true
// })
// );
tableInst.value?.reload();
dialog.create({
title: '提交到审核流程',
content: '确认将该产品提交到审核流程吗?',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(() =>
client.api.admin.rwa.issuance.products({ id: row.id }).submit.post({
submissionNote: '提交审核'
})
);
tableInst.value?.reload();
}
});
}
},
{
@@ -99,13 +106,21 @@ const columns: TableBaseColumns = [
visible: row.status === 'under_review',
size: 'small',
onClick: async () => {
await safeClient(() =>
client.api.admin.rwa.issuance.approve.post({
productId: row.id as string,
publishFirstEdition: true
})
);
tableInst.value?.reload();
dialog.create({
title: '批准产品',
content: '确认批准该产品吗?',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(() =>
client.api.admin.rwa.issuance.approve.post({
productId: row.id as string,
publishFirstEdition: true
})
);
tableInst.value?.reload();
}
});
}
},
{
@@ -114,13 +129,21 @@ const columns: TableBaseColumns = [
visible: row.status === 'under_review',
size: 'small',
onClick: async () => {
await safeClient(() =>
client.api.admin.rwa.issuance.reject.post({
productId: row.id as string,
rejectionReason: '不符合要求'
})
);
tableInst.value?.reload();
dialog.create({
title: '批准产品',
content: '确认批准该产品吗?',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(() =>
client.api.admin.rwa.issuance.reject.post({
productId: row.id as string,
rejectionReason: '不符合要求'
})
);
tableInst.value?.reload();
}
});
}
},
{
@@ -133,6 +156,25 @@ const columns: TableBaseColumns = [
handleEdit(row);
}
},
{
contentText: '删除',
type: 'error',
ghost: true,
size: 'small',
visible: row.status === 'draft' || row.status === 'rejected',
onClick: () => {
dialog.create({
title: '删除产品',
content: '确认删除该产品吗,删除后不可恢复。',
positiveText: '确认',
negativeText: '取消',
onPositiveClick: async () => {
await safeClient(() => client.api.admin.rwa.issuance.products({ id: row.id }).delete());
tableInst.value?.reload();
}
});
}
},
{
contentText: '发行期',
type: 'tertiary',