diff --git a/package.json b/package.json index 6dd7045..c0737c2 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.47.tgz", + "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.56.tgz", "@sa/axios": "workspace:*", "@sa/color": "workspace:*", "@sa/hooks": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52e9daa..223ad2f 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.47.tgz - version: http://192.168.1.27:9527/api/riwa-api-types-0.0.47.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.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))) '@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.47.tgz': - resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.47.tgz} - version: 0.0.47 + '@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 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.47.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.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)))': 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 71e198e..40e0497 100644 --- a/src/views/rwa/product/components/add-edition.vue +++ b/src/views/rwa/product/components/add-edition.vue @@ -91,15 +91,14 @@ function handleCreateDraftAndSubmit() { window.$message?.error(timeError); return; } - // await safeClient( - // client.api.admin.rwa.issuance.editions.post({ - // ...form.value, - // launchDate: form.value.launchDate ? new Date(form.value.launchDate) : undefined, - // subscriptionStartDate: form.value.subscriptionStartDate ? new Date(form.value.subscriptionStartDate) : undefined, - // subscriptionEndDate: form.value.subscriptionEndDate ? new Date(form.value.subscriptionEndDate) : undefined, - // submitForReview: true - // }) - // ); + await safeClient( + client.api.admin.rwa.issuance.editions.post({ + ...form.value, + launchDate: new Date(form.value.launchDate!), + subscriptionStartDate: new Date(form.value.subscriptionStartDate!), + subscriptionEndDate: new Date(form.value.subscriptionEndDate!) + } as Body) + ); emit('close'); } }); @@ -185,8 +184,8 @@ function handleCreateDraftAndSubmit() { - 创建草稿并发布 - 创建草稿 + 创建并发布 + 创建 diff --git a/src/views/rwa/product/components/edit-edition.vue b/src/views/rwa/product/components/edit-edition.vue new file mode 100644 index 0000000..aa563b4 --- /dev/null +++ b/src/views/rwa/product/components/edit-edition.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/src/views/rwa/product/components/editions.vue b/src/views/rwa/product/components/editions.vue index c4eed98..861bfb2 100644 --- a/src/views/rwa/product/components/editions.vue +++ b/src/views/rwa/product/components/editions.vue @@ -7,6 +7,7 @@ import { client, safeClient } from '@/service/api'; import type { TableBaseColumns, TableFetchData, TableInst } from '@/components/table'; import { RwaEditionStatusEnum } from '@/enum'; import AddEdition from './add-edition.vue'; +import EditEdition from './edit-edition.vue'; defineOptions({ name: 'RwaProductEditions' }); @@ -98,19 +99,37 @@ const columns: TableBaseColumns = [ type: 'primary', ghost: true, size: 'small', - visible: row.status === 'draft', - onClick: () => { - console.log(row); + visible: row.status === 'draft' || row.status === 'cancelled', + onClick: async () => { + dialog.create({ + title: '确认发布该发行期吗?', + content: '发布后该发行期将对投资者可见,且不可修改。', + positiveText: '确认', + negativeText: '取消', + onPositiveClick: async () => { + await safeClient(client.api.admin.rwa.issuance.editions({ id: row.id }).publish.post()); + tableInst.value?.reload(); + } + }); } }, { - contentText: '取消', + contentText: '取消发布', type: 'primary', ghost: true, size: 'small', - visible: row.status === 'draft', - onClick: () => { - console.log(row); + visible: row.status === 'scheduled', + onClick: async () => { + dialog.create({ + title: '确认取消发布该发行期吗?', + content: '取消发布后该发行期将对投资者不可见,且不可修改。', + positiveText: '确认', + negativeText: '取消', + onPositiveClick: async () => { + await safeClient(client.api.admin.rwa.issuance.editions({ id: row.id }).cancel.post()); + tableInst.value?.reload(); + } + }); } }, { @@ -119,15 +138,14 @@ const columns: TableBaseColumns = [ ghost: true, size: 'small', visible: row.status === 'draft', - onClick: () => { - console.log(row); - } + onClick: () => handleEdit(row) }, { contentText: '删除', type: 'error', ghost: true, size: 'small', + visible: row.status === 'draft', onClick: () => { tableInst.value?.reload(); } @@ -138,8 +156,33 @@ const columns: TableBaseColumns = [ function handleAdd() { const dialogInstance = dialog.create({ - title: '发行期列表', - content: () => h(AddEdition, { productId: props.data.id }), + title: '添加发行期', + content: () => + h(AddEdition, { + productId: props.data.id, + onClose: () => { + dialogInstance.destroy(); + tableInst.value?.reload(); + } + }), + style: { width: '600px' }, + showIcon: false, + onPositiveClick: () => { + tableInst.value?.reload(); + } + }); +} +function handleEdit(row: any) { + const dialogInstance = dialog.create({ + title: '编辑发行期', + content: () => + h(EditEdition, { + data: row, + onClose: () => { + dialogInstance.destroy(); + tableInst.value?.reload(); + } + }), style: { width: '600px' }, showIcon: false, onPositiveClick: () => {