28 lines
845 B
TypeScript
28 lines
845 B
TypeScript
/** 商品分类(多级,children 由后端组装) */
|
|
export default interface IProductCategory {
|
|
id?: number;
|
|
parent_id?: number;
|
|
name?: string;
|
|
sort?: number;
|
|
status?: number;
|
|
children?: IProductCategory[];
|
|
created_at?: string;
|
|
}
|
|
|
|
/** 商品分类(多级,children 由后端组装) */
|
|
export interface IProductCategoryTree {
|
|
id?: number;
|
|
parent_id?: number;
|
|
name?: string;
|
|
/** TreeSelect 节点禁选标记(前端组装:父分类/超层级节点不可选) */
|
|
disabled?: boolean;
|
|
/** Tree 节点不可选中标记(前端组装:侧栏父分类仅供展开) */
|
|
selectable?: boolean;
|
|
children?: IProductCategoryTree[];
|
|
}
|
|
|
|
export const CATEGORY_STATUS_MAP: Record<number, { text: string; color: string }> = {
|
|
0: { text: '停用', color: 'error' },
|
|
1: { text: '正常', color: 'success' },
|
|
};
|