From 0f2f8065937f21635fb7f2c147e8932c7cb30932 Mon Sep 17 00:00:00 2001 From: Seven Date: Tue, 23 Dec 2025 03:40:50 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20@riwa/api-types=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC=E8=87=B3=200.0.58=EF=BC=9B?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81=E7=BC=96=E5=8F=B7=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=80=BB=E8=BE=91=EF=BC=8C=E8=B0=83=E6=95=B4=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=96=87=E6=9C=AC=E5=92=8C=E8=A1=A8=E5=8D=95=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 12 +-- .../rwa/product/components/add-edition.vue | 2 +- src/views/rwa/product/components/add.vue | 39 +++++++-- src/views/rwa/product/components/edit.vue | 22 ++++- src/views/rwa/product/components/editions.vue | 13 ++- src/views/rwa/product/index.vue | 86 ++++++++++++++----- 7 files changed, 138 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index c0737c2..e0eac3a 100644 --- a/package.json +++ b/package.json @@ -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:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 223ad2f..f741668 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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)) diff --git a/src/views/rwa/product/components/add-edition.vue b/src/views/rwa/product/components/add-edition.vue index 40e0497..4c46c28 100644 --- a/src/views/rwa/product/components/add-edition.vue +++ b/src/views/rwa/product/components/add-edition.vue @@ -184,7 +184,7 @@ function handleCreateDraftAndSubmit() { - 创建并发布 + 创建并提交审核 创建 diff --git a/src/views/rwa/product/components/add.vue b/src/views/rwa/product/components/add.vue index 5b4dd03..956fb02 100644 --- a/src/views/rwa/product/components/add.vue +++ b/src/views/rwa/product/components/add.vue @@ -25,14 +25,33 @@ const form = ref({ 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() { /> - + - + diff --git a/src/views/rwa/product/components/edit.vue b/src/views/rwa/product/components/edit.vue index ffd1e9d..4a7a973 100644 --- a/src/views/rwa/product/components/edit.vue +++ b/src/views/rwa/product/components/edit.vue @@ -38,7 +38,27 @@ const form = ref({ 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'] }] diff --git a/src/views/rwa/product/components/editions.vue b/src/views/rwa/product/components/editions.vue index 861bfb2..75b52ee 100644 --- a/src/views/rwa/product/components/editions.vue +++ b/src/views/rwa/product/components/editions.vue @@ -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(); + } + }); } } ] diff --git a/src/views/rwa/product/index.vue b/src/views/rwa/product/index.vue index 0a6666d..901d9e5 100644 --- a/src/views/rwa/product/index.vue +++ b/src/views/rwa/product/index.vue @@ -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',