feat: 更新 API 地址,添加分类组件,优化市场页面布局和功能
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
import type { GenericObject } from "vee-validate";
|
||||
import type { RwaIssuanceCategoriesData, RwaIssuanceProductBody } from "@/api/types";
|
||||
import { toTypedSchema } from "@vee-validate/yup";
|
||||
import { ErrorMessage, Field, FieldArray, Form } from "vee-validate";
|
||||
import { ErrorMessage, Field, Form } from "vee-validate";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import * as yup from "yup";
|
||||
|
||||
const props = defineProps<{
|
||||
initialData: RwaIssuanceProductBody["product"];
|
||||
categories: RwaIssuanceCategoriesData;
|
||||
categories: RwaIssuanceCategoriesData | null;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
(e: "next", values: GenericObject): void;
|
||||
@@ -64,7 +64,7 @@ function handleSubmit(values: GenericObject) {
|
||||
<Field name="categoryId" type="text">
|
||||
<template #default="{ field }">
|
||||
<ion-select class="ui-select" interface="action-sheet" toggle-icon="" v-bind="field" :label="t('asset.issue.apply.productType')" :placeholder="t('asset.issue.apply.chooseProductType')">
|
||||
<ion-select-option v-for="item in categories" :key="item.id" :value="item.id">
|
||||
<ion-select-option v-for="item in categories?.data" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
@@ -17,7 +17,7 @@ const initialData: RwaIssuanceProductBody = {
|
||||
product: {
|
||||
name: "",
|
||||
code: "",
|
||||
categoryId: categories.value!.length > 0 ? categories.value![0].id : "",
|
||||
categoryId: categories.value?.data && categories.value?.data!.length > 0 ? categories.value?.data![0].id : "",
|
||||
},
|
||||
editions: [
|
||||
{
|
||||
@@ -55,7 +55,7 @@ async function handleSubmit(editions: RwaIssuanceProductBody["editions"]) {
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<IonContent :fullscreen="true" class="ion-padding">
|
||||
<Base v-if="step === 1" :initial-data="form.product" :categories="categories || []" @next="handleNext" />
|
||||
<Base v-if="step === 1" :initial-data="form.product" :categories="categories" @next="handleNext" />
|
||||
<IssuePeriod v-else-if="step === 2" :initial-data="form.editions" @submit="handleSubmit" />
|
||||
<Done v-else />
|
||||
</IonContent>
|
||||
|
||||
Reference in New Issue
Block a user