js 遇到的写法记录

2022-03-09  本文已影响0人  糖醋里脊120625
**组成新的数组**
ygstProductsToProducts(list, orgId, orgName) {
      let reList = list.map(item => {
        return {
          productImageUrl: item.pictureUrl,
          productSpec: item.itemUnit,
          productNetContent: item.netAmount,
          productNetContentUnit: item.netAmountUnit,
          productLevel: item.specificationLevel,
          productInfoId: item.id,
          productCode: item.salesSubItemCode,
          productName: item.salesSubItemName,
          productTypeId: item.salesItemName,// 阳光食堂统一使用 code
          productTypeCode: item.salesItemCode,
          productTypeName: "",
          orgId: orgId,
          orgName: orgName,
          platform: 1,
          checked: false
        };
      });
      this.initTableDataItemsChecked(reList);
      return reList;
    },


*过滤**
  this.selectedProducts = this.selectedProducts.filter(function (ele) {
        return ele.productInfoId !== item.productInfoId;
      });
上一篇下一篇

猜你喜欢

热点阅读