2025-03-26
This commit is contained in:
4
src/views/productManagement/recycle/constant/index.ts
Normal file
4
src/views/productManagement/recycle/constant/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { FORM_DATA, RULE_FORM } from "./search";
|
||||
import { COLUMNS } from "./table";
|
||||
import { OPERATIONS } from "./operations";
|
||||
export { FORM_DATA, RULE_FORM, COLUMNS, OPERATIONS };
|
||||
26
src/views/productManagement/recycle/constant/operations.ts
Normal file
26
src/views/productManagement/recycle/constant/operations.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
export const OPERATIONS = [
|
||||
{
|
||||
name: "下架",
|
||||
name1: "上架",
|
||||
id: 1,
|
||||
type: "primary"
|
||||
},
|
||||
{
|
||||
name: "添加SKU",
|
||||
name1: "添加SKU",
|
||||
id: 2,
|
||||
type: "info"
|
||||
},
|
||||
{
|
||||
name: "编辑",
|
||||
name1: "编辑",
|
||||
id: 3,
|
||||
type: "primary"
|
||||
},
|
||||
{
|
||||
name: "删除",
|
||||
name1: "删除",
|
||||
id: 4,
|
||||
type: "info"
|
||||
}
|
||||
];
|
||||
63
src/views/productManagement/recycle/constant/search.ts
Normal file
63
src/views/productManagement/recycle/constant/search.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
interface FormItem {
|
||||
prop: string;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
type: string;
|
||||
isCopy?: boolean;
|
||||
optionProps?: any;
|
||||
startPlaceholder?: string;
|
||||
endPlaceholder?: string;
|
||||
options?: any;
|
||||
isArray?: boolean;
|
||||
startDate?: string; //开始时间(传入后台需要的参数)
|
||||
endDate?: string; //结束时间(传入后台需要的参数)
|
||||
startProp?: string;
|
||||
endProp?: string;
|
||||
isInteger?: boolean;
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "产品名称: "
|
||||
},
|
||||
{
|
||||
prop: "spu",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "型号: "
|
||||
},
|
||||
{
|
||||
prop: "category_id",
|
||||
placeholder: "请选择",
|
||||
type: "treeSelect",
|
||||
isArray: true,
|
||||
label: "产品分类: ",
|
||||
options: [
|
||||
{
|
||||
value: "1",
|
||||
label: "Level one 1",
|
||||
children: [
|
||||
{
|
||||
value: "1-1",
|
||||
label: "Level two 1-1",
|
||||
children: [
|
||||
{
|
||||
value: "1-1-1",
|
||||
label: "Level three 1-1-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50
|
||||
};
|
||||
95
src/views/productManagement/recycle/constant/table.ts
Normal file
95
src/views/productManagement/recycle/constant/table.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { RenderScope } from "@/components/ProTable/interface";
|
||||
const YES_OR_NO: any = {
|
||||
0: "❌",
|
||||
1: "✔️"
|
||||
};
|
||||
export const COLUMNS = [
|
||||
{ type: "selection", fixed: "left", width: 40 },
|
||||
{
|
||||
align: "center",
|
||||
fixed: true,
|
||||
label: "ID",
|
||||
prop: "id",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "图片",
|
||||
prop: "cover_image",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "产品名称",
|
||||
prop: "name",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "型号",
|
||||
prop: "spu",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "产品分类",
|
||||
prop: "category_name",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "产品排序",
|
||||
prop: "sort",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "新品",
|
||||
prop: "is_new",
|
||||
width: 80,
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return YES_OR_NO[scope.row.is_new];
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "添加时间",
|
||||
prop: "created_at",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "在售",
|
||||
prop: "is_sale",
|
||||
width: 80,
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return YES_OR_NO[scope.row.is_sale];
|
||||
}
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "库存数量",
|
||||
prop: "stock_qty",
|
||||
width: 80,
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return scope.row.stock_qty === 0 ? "0" : scope.row.stock_qty;
|
||||
}
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
label: "上架状态",
|
||||
prop: "is_show",
|
||||
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||
return YES_OR_NO[scope.row.is_show];
|
||||
}
|
||||
},
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 300 }
|
||||
];
|
||||
Reference in New Issue
Block a user