Merge pull request !281 from dylanmay/dev
This commit is contained in:
xingyu
2025-11-27 05:33:41 +00:00
committed by Gitee
35 changed files with 714 additions and 925 deletions

View File

@@ -1,7 +1,5 @@
<script generic="T extends MallSpuApi.Spu" lang="ts" setup>
import type { RuleConfig, SpuProperty } from './type';
import type { MallSpuApi } from '#/api/mall/product/spu';
import type { MallSpuApi, RuleConfig, SpuProperty } from './type';
import { ref, watch } from 'vue';
@@ -45,13 +43,7 @@ const expandRowKeys = ref<string[]>([]); // 控制展开行需要设置 row-key
function getSkuConfigs(extendedAttribute: string) {
// 验证 SKU 数据(如果有 ref 的话)
if (skuListRef.value) {
// TODO @puhui999这里有个 linter 错误;
try {
skuListRef.value.validateSku();
} catch (error) {
// 验证失败时抛出错误
throw error;
}
skuListRef.value.validateSku();
}
const seckillProducts: unknown[] = [];
spuPropertyList.value.forEach((item) => {

View File

@@ -1,3 +1,5 @@
import type { MallSpuApi } from '#/api/mall/product/spu';
/** 商品属性及其值的树形结构(用于前端展示和操作) */
export interface PropertyAndValues {
id: number;
@@ -26,3 +28,6 @@ export interface SpuProperty<T> {
spuDetail: T;
spuId: number;
}
// Re-export for use in generic constraint
export type { MallSpuApi };