import { createTooltip, createImages } from "/@/utils/tooltip";
import { ContentConfig } from "/@/components/PageDetail";
import { httpDetail } from "/@/api/parameter/good";
const columns = [
  {
    field: "good_name",
    label: "商品名称",
    span: 24,
    render: (good_name, { good_code }) =>
      createTooltip(good_name, "商品编号 : " + good_code, 360)
  },
  {
    label: "图片",
    field: "good_cover_img",
    span: 6,
    render: good_cover_img => createImages(good_cover_img)
  },
  {
    field: "type",
    label: "商品类型",
    span: 6
  },
  {
    label: "售价",
    field: "price",
    span: 6
  },

  {
    label: "单位",
    field: "unit",
    span: 6
  },
  {
    label: "起订量",
    field: "moq",
    span: 6
  },
  {
    label: "步长",
    field: "step",
    span: 6
  },

  {
    field: "updatetime",
    label: "更新时间",
    span: 6
  },
  {
    field: "good_banner_img",
    label: "轮播图",
    span: 12,
    render: good_banner_img => createImages(good_banner_img)
  },
  {
    field: "good_cover_img",
    label: "详情图",
    span: 12,
    render: good_cover_img => createImages(good_cover_img)
  },
  {
    field: "good_remark",
    label: "商品备注",
    span: 24
  }
];
const goodDetailConfig: ContentConfig = {
  columns,
  apis: {
    httpDetail
  }
};

export default goodDetailConfig;
