+
+
+
+
+
+
+ (form.perUserLimit = String(val))"
+ />
+
+
+ (form.totalSupply = String(val))"
+ />
+
+
+ (form.unitPrice = String(val))" />
+
+
+ (form.dividendRate = String(val))"
+ />
+
+
+ (form.launchDate = new Date(val))"
+ />
+
+
+
+
+ (form.subscriptionStartDate = new Date(val))"
+ />
+
+
+ (form.subscriptionEndDate = new Date(val))"
+ />
+
+
+
+
+
+ 修 改
+
+
+
+
+
+
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: () => {