feat: 进一步优化显示效果

pull/236/head
xingyu4j 2025-10-21 18:17:02 +08:00
parent 20f95bb8ab
commit 760c5dde2a
1 changed files with 16 additions and 11 deletions

View File

@ -89,7 +89,7 @@ const formData = ref<MallSpuApi.Spu>({
virtualSalesCount: 0, // virtualSalesCount: 0, //
}); });
const propertyList = ref<PropertyAndValues[]>([]); // const propertyList = ref<PropertyAndValues[]>([]); //
const formLoading = ref(false); // 12 const formLoading = ref(true); // 12
const isDetail = ref(false); // const isDetail = ref(false); //
const skuListRef = ref(); // Ref const skuListRef = ref(); // Ref
@ -236,13 +236,12 @@ async function onSubmit() {
} }
/** 获得详情 */ /** 获得详情 */
const getDetail = async () => { async function getDetail() {
if (name === 'ProductSpuDetail') { if (name === 'ProductSpuDetail') {
isDetail.value = true; isDetail.value = true;
} }
const id = params.id as unknown as number; const id = params.id as unknown as number;
if (id) { if (id) {
formLoading.value = true;
try { try {
const res = await getSpu(spuId.value!); const res = await getSpu(spuId.value!);
res.skus?.forEach((item) => { res.skus?.forEach((item) => {
@ -276,7 +275,7 @@ const getDetail = async () => {
} }
// SKU PropertyAndValues // SKU PropertyAndValues
propertyList.value = getPropertyList(formData.value); propertyList.value = getPropertyList(formData.value);
}; }
// =========== sku form =========== // =========== sku form ===========
@ -285,21 +284,21 @@ function openPropertyAddForm() {
} }
/** 调用 SkuList generateTableData 方法*/ /** 调用 SkuList generateTableData 方法*/
const generateSkus = (propertyList: any[]) => { function generateSkus(propertyList: any[]) {
skuListRef.value.generateTableData(propertyList); skuListRef.value.generateTableData(propertyList);
}; }
/** 分销类型 */ /** 分销类型 */
const changeSubCommissionType = () => { function changeSubCommissionType() {
// //
for (const item of formData.value.skus!) { for (const item of formData.value.skus!) {
item.firstBrokeragePrice = 0; item.firstBrokeragePrice = 0;
item.secondBrokeragePrice = 0; item.secondBrokeragePrice = 0;
} }
}; }
/** 选择规格 */ /** 选择规格 */
const onChangeSpec = () => { function onChangeSpec() {
// //
propertyList.value = []; propertyList.value = [];
// sku // sku
@ -317,7 +316,7 @@ const onChangeSpec = () => {
secondBrokeragePrice: 0, secondBrokeragePrice: 0,
}, },
]; ];
}; }
// sku form schema // sku form schema
watch( watch(
@ -345,7 +344,8 @@ onMounted(async () => {
<Page auto-content-height> <Page auto-content-height>
<Card <Card
class="h-full w-full pb-8" class="h-full w-full"
:loading="formLoading"
:tab-list="tabList" :tab-list="tabList"
:active-key="activeTabName" :active-key="activeTabName"
@tab-change="onTabChange" @tab-change="onTabChange"
@ -403,3 +403,8 @@ onMounted(async () => {
</Page> </Page>
</div> </div>
</template> </template>
<style lang="scss" scoped>
:deep(.ant-tabs-tab-btn) {
font-size: 14px !important;
}
</style>