feat: 更新 @riwa/api-types 依赖版本至 0.0.58;优化产品编号验证逻辑,调整按钮文本和表单字段类型
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
"@better-scroll/core": "2.5.1",
|
"@better-scroll/core": "2.5.1",
|
||||||
"@elysiajs/eden": "^1.4.5",
|
"@elysiajs/eden": "^1.4.5",
|
||||||
"@iconify/vue": "5.0.0",
|
"@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/axios": "workspace:*",
|
||||||
"@sa/color": "workspace:*",
|
"@sa/color": "workspace:*",
|
||||||
"@sa/hooks": "workspace:*",
|
"@sa/hooks": "workspace:*",
|
||||||
|
|||||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -18,8 +18,8 @@ importers:
|
|||||||
specifier: 5.0.0
|
specifier: 5.0.0
|
||||||
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
|
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
|
||||||
'@riwa/api-types':
|
'@riwa/api-types':
|
||||||
specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.56.tgz
|
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.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)))
|
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':
|
'@sa/axios':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:packages/axios
|
version: link:packages/axios
|
||||||
@@ -1068,9 +1068,9 @@ packages:
|
|||||||
'@quansync/fs@0.1.6':
|
'@quansync/fs@0.1.6':
|
||||||
resolution: {integrity: sha512-zoA8SqQO11qH9H8FCBR7NIbowYARIPmBz3nKjgAaOUDi/xPAAu1uAgebtV7KXHTc6CDZJVRZ1u4wIGvY5CWYaw==}
|
resolution: {integrity: sha512-zoA8SqQO11qH9H8FCBR7NIbowYARIPmBz3nKjgAaOUDi/xPAAu1uAgebtV7KXHTc6CDZJVRZ1u4wIGvY5CWYaw==}
|
||||||
|
|
||||||
'@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':
|
||||||
resolution: {tarball: 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.59.tgz}
|
||||||
version: 0.0.56
|
version: 0.0.59
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@elysiajs/eden': ^1.4.5
|
'@elysiajs/eden': ^1.4.5
|
||||||
|
|
||||||
@@ -5057,7 +5057,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
quansync: 0.3.0
|
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:
|
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))
|
'@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))
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ function handleCreateDraftAndSubmit() {
|
|||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NSpace justify="end" class="mt-5">
|
<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>
|
<NButton type="primary" @click="handleCreateDraft">创建</NButton>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
</NForm>
|
</NForm>
|
||||||
|
|||||||
@@ -25,14 +25,33 @@ const form = ref<Body>({
|
|||||||
code: '',
|
code: '',
|
||||||
categoryId: '',
|
categoryId: '',
|
||||||
description: '',
|
description: '',
|
||||||
estimatedValue: '',
|
estimatedValue: '1',
|
||||||
totalSupplyLimit: '',
|
totalSupplyLimit: '100',
|
||||||
proofDocuments: ''
|
proofDocuments: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules: FormRules = {
|
const rules: FormRules = {
|
||||||
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
|
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'] }],
|
categoryId: [{ required: true, message: '请输入产品类型', trigger: ['blur', 'input'] }],
|
||||||
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
|
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
|
||||||
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]
|
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]
|
||||||
@@ -89,10 +108,20 @@ function handleCreateDraftAndSubmit() {
|
|||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem path="estimatedValue" label="产品估值">
|
<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>
|
||||||
<NFormItem path="totalSupplyLimit" label="总发行量">
|
<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>
|
||||||
<NFormItem path="description" label="产品描述">
|
<NFormItem path="description" label="产品描述">
|
||||||
<NInput v-model:value="form.description" type="textarea" />
|
<NInput v-model:value="form.description" type="textarea" />
|
||||||
|
|||||||
@@ -38,7 +38,27 @@ const form = ref<Body>({
|
|||||||
|
|
||||||
const rules: FormRules = {
|
const rules: FormRules = {
|
||||||
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
|
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'] }],
|
categoryId: [{ required: true, message: '请输入产品类型', trigger: ['blur', 'input'] }],
|
||||||
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
|
estimatedValue: [{ required: true, message: '请输入产品估值', trigger: ['blur', 'input'] }],
|
||||||
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]
|
totalSupplyLimit: [{ required: true, message: '请输入总发行量', trigger: ['blur', 'input'] }]
|
||||||
|
|||||||
@@ -145,9 +145,18 @@ const columns: TableBaseColumns = [
|
|||||||
type: 'error',
|
type: 'error',
|
||||||
ghost: true,
|
ghost: true,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
visible: row.status === 'draft',
|
visible: row.status === 'draft' || row.status === 'cancelled',
|
||||||
onClick: () => {
|
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();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -79,18 +79,25 @@ const columns: TableBaseColumns = [
|
|||||||
width: 300,
|
width: 300,
|
||||||
operations: (row: any) => [
|
operations: (row: any) => [
|
||||||
{
|
{
|
||||||
contentText: '提交到流程',
|
contentText: '提交到审核',
|
||||||
ghost: true,
|
ghost: true,
|
||||||
visible: row.status === 'draft',
|
visible: row.status === 'draft',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
// await safeClient(() =>
|
dialog.create({
|
||||||
// client.api.admin.rwa.issuance.approve.post({
|
title: '提交到审核流程',
|
||||||
// productId: row.id as string,
|
content: '确认将该产品提交到审核流程吗?',
|
||||||
// publishFirstEdition: true
|
positiveText: '确认',
|
||||||
// })
|
negativeText: '取消',
|
||||||
// );
|
onPositiveClick: async () => {
|
||||||
tableInst.value?.reload();
|
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',
|
visible: row.status === 'under_review',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
await safeClient(() =>
|
dialog.create({
|
||||||
client.api.admin.rwa.issuance.approve.post({
|
title: '批准产品',
|
||||||
productId: row.id as string,
|
content: '确认批准该产品吗?',
|
||||||
publishFirstEdition: true
|
positiveText: '确认',
|
||||||
})
|
negativeText: '取消',
|
||||||
);
|
onPositiveClick: async () => {
|
||||||
tableInst.value?.reload();
|
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',
|
visible: row.status === 'under_review',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
await safeClient(() =>
|
dialog.create({
|
||||||
client.api.admin.rwa.issuance.reject.post({
|
title: '批准产品',
|
||||||
productId: row.id as string,
|
content: '确认批准该产品吗?',
|
||||||
rejectionReason: '不符合要求'
|
positiveText: '确认',
|
||||||
})
|
negativeText: '取消',
|
||||||
);
|
onPositiveClick: async () => {
|
||||||
tableInst.value?.reload();
|
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);
|
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: '发行期',
|
contentText: '发行期',
|
||||||
type: 'tertiary',
|
type: 'tertiary',
|
||||||
|
|||||||
Reference in New Issue
Block a user