import {getByParentId} from "@/api/redenvelopemall/categoryinfo";

export const goodsinfoOption = {
  height: 'auto',
  calcHeight: 30,
  border: true,
  index: false,
  viewBtn: false,
  delBtn:false,
  editBtn: false,
  selection: true,
  dialogClickModal: false,
  labelWidth: 150,
  searchIcon: true,
  searchIndex: 3,
  column: [
    {
      label: "主键",
      prop: "id",
      hide: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
      rules: [{
        required: true,
        message: "请输入主键",
        trigger: "blur"
      }]
    },
    {
      label: "商品编号",
      prop: "goodsNo",
      addDisplay: false,
      editDisabled: true,
      search: true,
      rules: [{
        required: true,
        message: "请输入商品编号",
        trigger: "blur"
      }]
    },
    {
      label: "商品名称",
      prop: "goodsName",
      search: true,
      width: 280,
      rules: [{
        required: true,
        message: "请输入商品名称",
        trigger: "blur"
      }]
    },
    {
      label: "商品封面",
      prop: "goodsCover",
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      type: 'img',
      // listType: 'picture-img',
    },
    {
      label: "品牌",
      prop: "brandDesc",
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
    },
    // {
    //   label: "商品标签",
    //   prop: "goodsLable",
    //   hide: true,
    // },
    {
      label: "分类",
      prop: "categoryIdArr",
      hide: true,
      search: true,
      lazy: true,
      rules: [{
        required: true,
        message: "请选择分类",
        trigger: "blur"
      }],
      type: "cascader",
      filterable: true,
      checkStrictly: true,
      lazyLoad(node, resolve) {
        let parentId;
        let stop_level = 2;
        let level = node.level;
        let list = [];

        if (node.level === 0) {
          parentId = 0;
          getByParentId(0).then((res) => {
            list = res.data.data;
            list = (list || []).map(ele => {
                return Object.assign(ele, {
                  leaf: level >= stop_level
                })
              })
            resolve(list)
          })
        } else {
          parentId = node.data.id;
          getByParentId(node.data.id).then((res) => {
            list = res.data.data;
            list = (list || []).map(ele => {
              return Object.assign(ele, {
                leaf: level >= stop_level
              })
            })
            resolve(list)
          })
        }
      },
      // dicUrl: "/api/redenvelopemall/categoryinfo/tree?flag=1",
      props: {
        label: "title",
        value: "key"
      },
    },
    {
      label: "品牌",
      prop: "brandId",
      hide: true,
      search: true,
      rules: [{
        required: true,
        message: "请选择品牌",
        trigger: "blur"
      }],
      type: "select",
      remote: true,
      dicUrl: "/api/redenvelopemall/brandsinfo/getByName?brandName={{key}}",
      props: {
        label: "brandName",
        value: "id"
      },
      dataType: "string",
    },
    {
      label: "折扣",
      prop: "discount",
    },
    {
      label: "排序",
      prop: "sort",
      type: "number",
      hide: true,
      rules: [{
        required: true,
        message: "请输入排序",
        trigger: "blur"
      }]
    },
    {
      label: "市场价",
      prop: "marketPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      }
    },
    {
      label: "协议价",
      prop: "agreementPrice",
      precision: 2,
      type: "number",
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      },
      rules: [{
        required: true,
        message: "请输入协议价",
        trigger: "blur"
      }],
    },
    {
      label: "指导价",
      prop: "guidePrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      },
    },
    {
      label: "毛利率",
      prop: "promotionRate",
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
      formatter:(val,value)=>{
        return value + "%";
      },
    },
    {
      label: "营销价",
      prop: "activityPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      }
    },
    {
      label: "销售价",
      prop: "salePrice",
      precision: 2,
      type: "number",
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      },
      rules: [{
        required: true,
        message: "请输入销售价",
        trigger: "blur"
      }],
      blur: ({value,column}) => {
        console.log('失去焦点',value,column)
      },
    },
    {
      label: "成本价",
      prop: "costPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value)=>{
        return Number(value).toFixed(2);
      },
      rules: [{
        required: true,
        message: "请输入成本价",
        trigger: "blur"
      }]
    },
    {
      label: "营销利润率",
      prop: "activityRate",
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
      hide: true
    },
    {
      label: "是否推荐",
      prop: "isRecom",
      rules: [{
        required: true,
        message: "请选择是否推荐",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
      search: true
    },
    {
      label: "双十一",
      prop: "isActivity",
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
      search: true
    },
    {
      label: "是否上架",
      prop: "isSale",
      search: true,
      hide: true,
      rules: [{
        required: true,
        message: "请输入是否上架",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "上架时间",
      prop: "saleTime",
      hide: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "所需积分",
      prop: "needIntegral",
      addDisplay: false,
      editDisplay: false,
      hide: true
    },
    {
      label: "所需金额",
      prop: "needAmount",
      addDisplay: false,
      editDisplay: false,
      hide: true
    },

    {
      label: "是否包邮",
      prop: "isFreeShipping",
      hide: true,
      search: true,
      rules: [{
        required: true,
        message: "请选择是否包邮",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "运费",
      prop: "freePrice",
      hide: true,
      precision: 2,
      type: "number",
      rules: [{
        required: true,
        message: "请输入运费",
        trigger: "blur"
      }]
    },
    {
      label: "总库存",
      prop: "totalStock",
      type: "number",
      min: 1,
      rules: [
        {required: true, message: "请输入总库存", trigger: "blur"},
      ]
    },
    {
      label: "总销量",
      prop: "totalSales",
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: "总浏览量",
      prop: "totalViews",
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: "单位",
      prop: "unit",
      hide: true,
      rules: [{
        required: true,
        message: "请输入单位",
        trigger: "blur"
      }]
    },
    {
      label: "营业类型",
      prop: "businessType",
      search: true,
      editDisabled: true,
      rules: [{
        required: true,
        message: "请选择营业类型",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "商品来源",
      prop: "source",
      editDisabled: true,
      type: "select",
      search: true,
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=third_source",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
      rules: [{
        required: true,
        message: "请选择商品来源",
        trigger: "blur"
      }],
    },
    {
      label: "专区类型",
      prop: "zoneType",
      search: true,
      rules: [{
        required: true,
        message: "请选择专区类型",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=zone_type",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "是否热销",
      prop: "isHot",
      rules: [{
        required: true,
        message: "请选择是否热销",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "是否新品",
      prop: "isNew",
      rules: [{
        required: true,
        message: "请选择是否新品",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label:'是否上架',
      prop: 'saleSwitch',
      type:'switch',
      cell: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "是否为合伙人商品",
      prop: "isPartner",
      hide: true,
      rules: [{
        required: true,
        message: "请选择是否为合伙人商品",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "产地",
      prop: "origin",
      hide: true,
    },
    {
      label: "第三方商品ID",
      prop: "thirdId",
      hide: true,
      editDisabled: true,
    },
    {
      label: "是否为特殊商品",
      prop: "isSpecial",
      hide: true,
      rules: [{
        required: true,
        message: "请选择是否为特殊商品",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "红包比例",
      prop: "redEnvRatio",
      hide: true,
    },
    {
      label: "加速红包比例",
      prop: "speedRatio",
      hide: true,
    },
    {
      label: "间接加速红包比例",
      prop: "twoSpeedRatio",
      hide: true,
    },
    {
      label: "创建时间",
      prop: "createTime",
      hide: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: false,
    },
    {
      label: '商品封面',
      prop: 'uploadCover',
      type: 'upload',
      listType: 'picture-img',
      loadText: '上传中，请稍等',
      accept: 'image/png, image/jpeg',
      fileSize: 500,
      tip: '只能上传jpg/png文件，且不超过500kb',
      span: 24,
      hide: true,
      propsHttp: {
        res: 'data',
        url: 'link',
      },
      action: "/api/blade-resource/oss/endpoint/put-file-attach"
    },
    {
      label: '商品轮播图',
      prop: 'slideshowList',
      type: 'upload',
      dataType: 'array',
      listType: 'picture-card',
      loadText: '上传中，请稍等',
      accept: 'image/png, image/jpeg',
      fileSize: 500,
      tip: '只能上传jpg/png文件，且不超过500kb',
      span: 24,
      hide: true,
      propsHttp: {
        res: 'data',
        url: 'link',
      },
      action: "/api/blade-resource/oss/endpoint/put-file-attach"
    },
    {
      label: '图文详情',
      prop: 'detailImgUrlList',
      type: 'upload',
      dataType: 'array',
      listType: 'picture-card',
      loadText: '上传中，请稍等',
      accept: 'image/png, image/jpeg',
      fileSize: 2048,
      tip: '只能上传jpg/png文件，且不超过2M',
      limit: 25,
      span: 24,
      hide: true,
      propsHttp: {
        res: 'data',
        url: 'link',
      },
      action: "/api/blade-resource/oss/endpoint/put-file-attach"
    },
    {
      label: "商品视频",
      hide: true,
      prop: "goodsVideo",
      type: 'upload',
      fileSize: 5120,
      listType: 'picture-img',
      span: 24,
      accept: "video/mp4",
      loadText: '附件上传中，请稍等',
      tip: '只能上传mp4文件，且不超过5M',
      propsHttp: {
        res: 'data',
        url: 'link',
      },
      action: "/api/blade-resource/oss/endpoint/put-file-attach",
    },
    {
      label: "折扣",
      prop: "discountRange",
      hide: true,
      search: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: false,
      viewDisplay: false,
      type: "select",
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=discount_range",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "string",
    },
    {
      label: "毛利率",
      prop: "promotionRateRange",
      hide: true,
      search: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: false,
      viewDisplay: false,
    },
    {
      label: "活动日期",
      type: 'select',
      prop: "activityDate",
      hide: true,
      search: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: false,
      viewDisplay: false,
    },
  ]
}

export const goodsParamOption = {
  height:'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  index: true,
  viewBtn: false,
  selection: true,
  dialogClickModal: false,
  column: [
    {
      label: "主键",
      prop: "id",
      hide: true,
      addDisplay: false,
      editDisabled: true,
      editDisplay: false,
    },
    {
      label: "参数名",
      prop: "paramName",
      rules: [{
        required: true,
        message: "请输入参数名",
        trigger: "blur"
      }]
    },
    {
      label: "参数值",
      prop: "paramValue",
      rules: [{
        required: true,
        message: "请输入参数值",
        trigger: "blur"
      }]
    },
    {
      label: "商品id",
      prop: "goodsId",
      hide: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "排序",
      prop: "sort",
      rules: [{
        required: true,
        message: "请输入排序",
        trigger: "blur"
      }]
    },
  ]
}


const DIC = {
  STATUS: [{
    label: '正常',
    value: '1'
  }, {
    label: '下架',
    value: '0'
  }]
};

export const scOption = {
  height:'auto',
  calcHeight: 100,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  index: false,
  viewBtn: true,
  addBtn: false,
  delBtn: false,
  editBtn: false,
  selection: true,
  dialogClickModal: false,
  menuWidth: 75,
  menu:false,
  searchIcon: true,
  searchIndex: 3,
  column: [
    {
      label: "关键字",
      prop: "search_words",
      hide: true,
      search: true
    },
    {
      label: "主键",
      prop: "id",
      hide: true,
      addDisplay: false,
      editDisabled: true,
      editDisplay: false,
    },
    {
      label: "商品标题",
      prop: "title",
      width: 300
    },
    {
      label: "商品封面",
      prop: "cover",
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      type: 'img',
      dataType: 'string',
      size: "large"
    },
    {
      label: "折扣",
      prop: "discount",
    },
    {
      label: "协议价",
      prop: "agreement_price",
      formatter:(val,value)=>{
        return Number(value).toFixed(2)/100.00;
      },
    },
    {
      label: "指导价",
      prop: "guide_price",
      formatter:(val,value)=>{
        return Number(value).toFixed(2)/100.00;
      },
    },
    {
      label: "销售价",
      prop: "sale_price",
      formatter:(val,value)=>{
        return Number(value).toFixed(2)/100.00;
      },
    },
    {
      label: "成本价",
      prop: "cost_price",
      formatter:(val,value)=>{
        return Number(value).toFixed(2)/100.00;
      },
    },
    {
      label: "市场价",
      prop: "market_price",
      formatter:(val,value)=>{
        return Number(value).toFixed(2)/100.00;
      },
    },
    {
      label: "利润百分比",
      prop: "rate",
    },
    {
      label: "三方品牌",
      prop: "third_brand_name",
    },
    {
      label: "最低利润",
      prop: "min_profits",
    },
    {
      label: "最高利润",
      prop: "max_profits",
    },
    {
      label: "平台来源",
      prop: "source",
      type: "select",
      search: true,
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=goods_source",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "是否导入",
      prop: "is_import",
      type: "select",
      search: true,
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=import_flag",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "分组",
      prop: "group_id",
      type: "select",
      search: true,
      hide: true,
      dicUrl: "/api/supplyChain/group/list?page=1&limit=200",
      props: {
        label: "name",
        value: "id"
      },
      dataType: "number",
    },
    {
      label: "状态",
      prop: "status",
      type: "select",
      search: true,
      dicData: DIC.STATUS,
      formatter:(val,value)=>{
        return value == 1 ? "正常" : "下架";
      },
    },
    {
      label: "折扣",
      prop: "discountRange",
      hide: true,
      search: true,
      type: "select",
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=discount_range",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "string",
    },

  ]
}

export const goodsSpecOption = {
    labelWidth: 170,
    height:'auto',
    calcHeight: 30,
    tip: false,
    searchShow: true,
    searchMenuSpan: 6,
    border: true,
    index: true,
    viewBtn: true,
    selection: true,

    dialogClickModal: false,
    column: [
    {
      label: "主键",
      prop: "id",
      hide: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "规格名称",
      prop: "spceName",
      width: 200,
      rules: [{
        required: true,
        message: "请输入规格名称",
        trigger: "blur"
      }]
    },
    {
      label: "规格编号",
      overHidden: true,
      addDisplay: false,
      editDisabled: true,
      prop: "spceNo",
      rules: [{
        required: true,
        message: "请输入规格编号",
        trigger: "blur"
      }]
    },
    {
      label: "规格封面",
      prop: "coverShow",
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      type: 'upload',
      listType: 'picture-img',
    },
    {
      label: "默认规格",
      prop: "isDefault",
      rules: [{
        required: true,
        message: "请输入是否默认规格",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "市场价",
      prop: "marketPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
    },
    {
      label: "指导价",
      prop: "guidePrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
    },
    {
      label: "协议价",
      prop: "agreementPrice",
      precision: 2,
      type: "number",
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
      rules: [{
        required: true,
        message: "请输入协议价",
        trigger: "blur"
      }]
    },
    {
      label: "营销价",
      prop: "activityPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
    },
    {
      label: "销售价",
      prop: "salePrice",
      precision: 2,
      type: "number",
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
      rules: [{
        required: true,
        message: "请输入销售价",
        trigger: "blur"
      }]
    },
    {
      label: "成本价",
      prop: "costPrice",
      precision: 2,
      type: "number",
      hide: true,
      formatter:(val,value,label)=>{
        return Number(value).toFixed(2);
      },
    },
    {
      label: "毛利率",
      prop: "promotionRate",
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "所需积分",
      prop: "exchangeNeedIntegral",
      addDisplay: false,
      editDisplay: false,
      hide: true
    },
    {
      label: "所需金额",
      prop: "needAmount",
      addDisplay: false,
      editDisplay: false,
      hide: true
    },
    {
      label: "营销利润率",
      prop: "activityRate",
      hide: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "库存",
      prop: "stock",
      type: "number",
      rules: [{
        required: true,
        message: "请输入库存",
        trigger: "blur"
      }]
    },
    {
      label: "销量",
      prop: "sale",
      addDisplay: false,
      editDisplay: false,
      rules: [{
        required: true,
        message: "请输入销量",
        trigger: "blur"
      }]
    },
    {
      label: "是否能积分抵扣",
      prop: "isIntegralDeduction",
      hide: true,
      rules: [{
        required: true,
        message: "请输入是否能积分抵扣",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label: "抵扣所需积分",
      prop: "needIntegral",
      type: "number",
      hide: true,
      rules: [{
        required: true,
        message: "请输入抵扣所需积分",
        trigger: "blur"
      }]
    },
    {
      label: "购买时获得的积分数",
      hide: true,
      prop: "obtainIntegral",
      type: "number",
      rules: [{
        required: true,
        message: "请输入购买时获得的积分数",
        trigger: "blur"
      }]
    },
    {
      label: "专区类型",
      prop: "zoneType",
      // search: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
      rules: [{
        required: true,
        message: "请选择专区类型",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=zone_type",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    {
      label:'是否上架',
      prop: 'saleSwitch',
      type:'switch',
      cell: true,
      addDisplay: false,
      viewDisplay: false,
      editDisplay: false,
      editDisabled: true,
    },
    {
      label: "是否上架",
      prop: "isSale",
      hide: true,
      rules: [{
        required: true,
        message: "",
        trigger: "blur"
      }],
      type: "select",
      dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      dataType: "number",
    },
    // {
    //   label: "利润百分比",
    //   prop: "rate",
    //   precision: 2,
    //   type: "number",
    //   hide: true,
    //   addDisplay: false,
    //   editDisplay: false,
    //   formatter:(val,value,label)=>{
    //     return Number(value).toFixed(2);
    //   },
    // },
      {
        label: "第三方规格ID",
        prop: "optionId",
        addDisplay: false,
        editDisplay: false,
        hide: true
      },
      {
        label: "是否为套装",
        prop: "isPackage",
        hide: true,
        rules: [{
          required: true,
          message: "请输入是否为套装",
          trigger: "blur"
        }],
        type: "select",
        dicUrl: "/api/blade-system/dict/dictionary?code=yes_or_no",
        props: {
          label: "dictValue",
          value: "dictKey"
        },
        dataType: "number",
      },
      {
        label: "套装商品数量",
        hide: true,
        prop: "packageNum",
        type: "number",
        rules: [{
          required: true,
          message: "请输入套装商品数量",
          trigger: "blur"
        }]
      },
    {
      label: '规格图片',
      prop: 'cover',
      type: 'upload',
      listType: 'picture-img',
      loadText: '上传中，请稍等',
      accept: 'image/png, image/jpeg',
      fileSize: 500,
      tip: '只能上传jpg/png文件，且不超过500kb',
      span: 24,
      hide: true,
      propsHttp: {
        res: 'data',
        url: 'link',
      },
      action: "/api/blade-resource/oss/endpoint/put-file-attach"
    },
  ]
}
