From 1144df10bb091a876df3cd64c713d1e1779199f6 Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 22 Dec 2025 20:28:20 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=91=E8=A1=8C?= =?UTF-8?q?=E6=9C=9F=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=92=8C=E7=8A=B6=E6=80=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 3 +- src/components/table/index.ts | 1 + src/components/table/table-base.vue | 12 +- src/enum/index.ts | 15 +- src/service/api/client.ts | 4 +- src/typings/components.d.ts | 2 + .../rwa/product/components/add-edition.vue | 195 ++++++++++++++++++ src/views/rwa/product/components/add.vue | 19 +- src/views/rwa/product/components/edit.vue | 2 +- src/views/rwa/product/components/editions.vue | 156 ++++++++++++++ src/views/rwa/product/index.vue | 68 +++++- 11 files changed, 453 insertions(+), 24 deletions(-) create mode 100644 src/views/rwa/product/components/add-edition.vue create mode 100644 src/views/rwa/product/components/editions.vue diff --git a/eslint.config.js b/eslint.config.js index 77e5ca4..fcf803d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,7 +19,8 @@ export default defineConfig( } ], 'vue/no-duplicate-attr-inheritance': 'off', - 'unocss/order-attributify': 'off' + 'unocss/order-attributify': 'off', + '@typescript-eslint/no-unused-vars': 'off' } } ); diff --git a/src/components/table/index.ts b/src/components/table/index.ts index ac0af86..b726144 100644 --- a/src/components/table/index.ts +++ b/src/components/table/index.ts @@ -15,6 +15,7 @@ export type TableBaseExpandColumn = { operations?: (row: T) => Array; key: string; title: string; + editComponent?: Component | VNode | string; }; type TableBaseColumn = DataTableColumn & TableBaseExpandColumn; diff --git a/src/components/table/table-base.vue b/src/components/table/table-base.vue index f15ad1d..9f449a2 100644 --- a/src/components/table/table-base.vue +++ b/src/components/table/table-base.vue @@ -13,11 +13,6 @@ import { } from '.'; import type { TableColumnCheck } from '~/packages/hooks/src'; -const route = useRoute(); -const { t } = useI18n(); - -const loading = ref(false); -const title = t(route.meta.i18nKey as string); const props = withDefaults( defineProps<{ fetchData: TableFetchData; @@ -30,8 +25,10 @@ const props = withDefaults( columns?: boolean; }; filterColumns?: TableFilterColumns; + title?: string; }>(), { + title: '', showHeaderOperation: true, filterColumns: () => [], headerOperations: () => ({ @@ -47,6 +44,11 @@ const emit = defineEmits<{ (e: 'delete'): void; }>(); +const route = useRoute(); +const { t } = useI18n(); + +const loading = ref(false); +const title = ref(props.title || t(route.meta.i18nKey as string)); const tableData = ref([]); const dataTableColumns = ref(transformColumns(props.columns)); const headerTableColumns = ref(transformHeaderColumns(props.columns)); diff --git a/src/enum/index.ts b/src/enum/index.ts index 6a32a88..4b8c863 100644 --- a/src/enum/index.ts +++ b/src/enum/index.ts @@ -12,9 +12,18 @@ export enum DepositTypeEnum { } export enum RwaStatusEnum { - pending = '待审核', - approved = '已通过', - rejected = '已拒绝' + draft = '草稿', + under_review = '待审核', + approved = '审核通过', + rejected = '审核拒绝' +} + +export enum RwaEditionStatusEnum { + draft = '草稿', + scheduled = '已排期', + allocation_pending = '申购结束,待分配中签', + allocated = '已分配', + cancelled = '已取消' } export enum WithdrawMethodEnum { diff --git a/src/service/api/client.ts b/src/service/api/client.ts index fe27ccb..5080d0f 100644 --- a/src/service/api/client.ts +++ b/src/service/api/client.ts @@ -64,9 +64,7 @@ export function safeClient( if (res.error) { if (res.status === 418) { if (!options.silent) { - const msg = $t((res.error as any).value.code, { - ...(res.error as any).value.context - }); + const msg = (res.error as any).value.message; window.$message?.create(msg, { type: 'error' }); diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index e270e9b..e57b793 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -48,6 +48,7 @@ declare module 'vue' { NCheckbox: typeof import('naive-ui')['NCheckbox'] NColorPicker: typeof import('naive-ui')['NColorPicker'] NDataTable: typeof import('naive-ui')['NDataTable'] + NDatePicker: typeof import('naive-ui')['NDatePicker'] NDescriptions: typeof import('naive-ui')['NDescriptions'] NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] @@ -136,6 +137,7 @@ declare global { const NCheckbox: typeof import('naive-ui')['NCheckbox'] const NColorPicker: typeof import('naive-ui')['NColorPicker'] const NDataTable: typeof import('naive-ui')['NDataTable'] + const NDatePicker: typeof import('naive-ui')['NDatePicker'] const NDescriptions: typeof import('naive-ui')['NDescriptions'] const NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem'] const NDialogProvider: typeof import('naive-ui')['NDialogProvider'] diff --git a/src/views/rwa/product/components/add-edition.vue b/src/views/rwa/product/components/add-edition.vue new file mode 100644 index 0000000..71e198e --- /dev/null +++ b/src/views/rwa/product/components/add-edition.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/src/views/rwa/product/components/add.vue b/src/views/rwa/product/components/add.vue index 980633b..5b4dd03 100644 --- a/src/views/rwa/product/components/add.vue +++ b/src/views/rwa/product/components/add.vue @@ -38,7 +38,7 @@ const rules: FormRules = { totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }] }; -function handleSubmit() { +function handleCreateDraft() { formInst.value?.validate(async errors => { if (!errors) { await safeClient( @@ -50,6 +50,19 @@ function handleSubmit() { } }); } +function handleCreateDraftAndSubmit() { + formInst.value?.validate(async errors => { + if (!errors) { + // await safeClient( + // client.api.admin.rwa.issuance.products.post({ + // ...form.value, + // submitForReview: true + // }) + // ); + emit('close'); + } + }); +}