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): 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): VNode | string | any => { return YES_OR_NO[scope.row.is_sale]; } }, { align: "center", label: "库存数量", prop: "stock_qty", width: 80, render: (scope: RenderScope): VNode | string | any => { return scope.row.stock_qty === 0 ? "0" : scope.row.stock_qty; } }, { align: "center", label: "上架状态", prop: "is_show", render: (scope: RenderScope): VNode | string | any => { return YES_OR_NO[scope.row.is_show]; } }, { prop: "operation", label: "操作", fixed: "right", width: 300 } ];