Commit 6f037237 by 张立顺

feat 订单优化

1 parent 35470220
# 订单列表横向滚动卡顿 — 原因分析与优化
## 问题页面
- [`src/views/orderManage/order.vue`](../src/views/orderManage/order.vue)(1.1 精品升级)
- [`src/views/orderManage/carDamage.vue`](../src/views/orderManage/carDamage.vue)(2.1 会员权益 / 2.3 延保,共用同一列表组件)
## 根因(按影响排序)
1. **超宽表格(~45–50 列)+ `fixed="right"` 操作列** — Element UI 固定列双份 DOM,横滚时 layout/sync 成本高(主因)
2. **10+ 列对 `subOrderList` 嵌套 `v-for`** — 每行数千 DOM 节点
3. **30+ 列自定义 slot** — 无法走简单文本渲染
4. **`el-tooltip` 行内实例** — 商品名称/类目/套餐别名列
5. **模板内重复调用 `getGoodsTypeName`(4 次/格)**
6. **操作列多个 `auth-button`** + fixed 叠加
## 已实施优化
### 精品(order.vue)
| 阶段 | 改动 | 文件 |
|------|------|------|
| 保留 | **操作列 `fixed="right"`**(产品要求) | order.vue |
| 保留 | 操作按钮全部平铺 `auth-button`,不收进下拉 | order.vue |
| P0 | `getList` 预计算展示字段 | `utils/orderListRowDisplay.js` |
| P0 | 分页上限改为 20 | order.vue |
| P1 | 子商品 10 列收入展开行 | order.vue |
| P1b | 展开区改用**原生 table**(替代嵌套 el-table) | order.vue |
| P1b | 展开区 `overflow-x: auto` 独立横滚 | order.vue |
| P1b | **手风琴单展开**(`expand-row-keys`) | order.vue |
### 权益(carDamage.vue)
| 阶段 | 改动 | 文件 |
|------|------|------|
| 保留 | **操作列 `fixed="right"`** | carDamage.vue |
| 保留 | 操作按钮全部平铺 `auth-button`(9040132–9040135、9040147、9040148) | carDamage.vue |
| P0 | `getList` 预计算展示字段(`mapCarDamageListRow`) | `utils/orderListRowDisplay.js` |
| P0 | 分页上限改为 20 | carDamage.vue |
| P1 | 子商品 **14 列**收入展开行(含套餐、优惠券) | carDamage.vue |
| P1b | 展开区原生 table + 独立横滚 | carDamage.vue |
| P1b | 手风琴单展开 | carDamage.vue |
| 保留 | 权益特有主表列:第三方订单号、展业场景、交易参考号、上传协议 | carDamage.vue |
## 静态指标(优化后)
| 指标 | 精品 order.vue | 权益 carDamage.vue |
|------|----------------|-------------------|
| 主表列数 | ~33 | ~35 |
| 子商品展示 | 展开行原生 table(10 列) | 展开行原生 table(14 列) |
| 展开模式 | 同时仅 1 行展开 | 同时仅 1 行展开 |
| 操作列 fixed | **是(保留)** | **是(保留)** |
| 操作按钮 | 全部平铺,无 dropdown | 全部平铺,无 dropdown |
| pageSize 上限 | 20 | 20 |
## 展开行卡顿说明
展开后若使用嵌套 `el-table`,会与父表 `fixed="right"` 叠加导致横滚再次变卡。已通过原生 table + 展开区独立滚动 + 手风琴模式缓解。
## 后续可选(未实施)
- 列显示配置(用户自选可见列)
- 虚拟滚动 PoC(P2)
> 说明:操作列固定会带来一定横滚成本,通过子商品展开行 + 预计算字段等其他优化抵消大部分 DOM 压力。
## 验收指标
- 横滚 FPS ≥ 50(10 行、默认列)
- scroll 长任务 < 50ms
- 主表 DOM 节点降 40%+(展开行收起时)
const SALES_TYPE_MAP = {
0: "销售端引流 - 售前",
1: "门店引流 - 售后",
2: "自然到店",
3: "交付端引流 - 售前",
};
const ORDER_SOURCE_MAP = {
7: "系统导入",
12: "冀联小程序",
};
const CAR_DAMAGE_SALES_TYPE_MAP = {
0: "门店引流 - 售前",
1: "门店引流 - 售后",
2: "自然到店",
};
/**
* @param {string} [text]
* @param {number} [maxLen]
* @returns {string}
*/
export function truncateDisplay(text, maxLen = 10) {
if (!text) {
return "-";
}
return text.length > maxLen ? `${text.substring(0, maxLen)}...` : text;
}
/**
* @param {object} [item]
* @returns {string}
*/
export function getGoodsTypeName(item) {
const {
upgradeGoodsTypeName,
upgradeSecondaryGoodsTypeName,
upgradeThirdLevelGoodsTypeName,
} = item || {};
return [
upgradeGoodsTypeName,
upgradeSecondaryGoodsTypeName,
upgradeThirdLevelGoodsTypeName,
].filter(Boolean).join("-");
}
/**
* @param {object} item
* @param {Array<{ position: string|number, confName: string }>} positionTypeList
* @returns {object}
*/
export function mapSubOrderDisplayItem(item, positionTypeList) {
const goodsTypeFull = getGoodsTypeName(item);
const goodsNameFull = item.upgradeGoodsId
? (item.upgradeGoodsName || "-")
: (item.baseGoodsName || "-");
const unitPrice = item.upgradeGoodsId
? item.upgradePrice
: item.baseRetailPrice;
const salesPrice = item.upgradeGoodsId
? item.singleProductSalesPrice
: item.baseRetailPrice;
const finalUnitPrice = item.upgradeGoodsId
? item.singleProductFinalPrice
: item.baseRetailPrice;
const positionStr = positionTypeList?.filter(
sub => String(sub?.position) === String(item?.upgradeGoodsPosition),
)[0]?.confName || item.positionStr || "-";
return {
...item,
positionStr,
goodsNameFull,
goodsNameDisplay: truncateDisplay(goodsNameFull),
goodsTypeFull,
goodsTypeDisplay: truncateDisplay(goodsTypeFull),
unitPriceDisplay: unitPrice != null ? `¥ ${unitPrice}` : "-",
salesPriceDisplay: salesPrice != null ? `¥ ${salesPrice}` : "-",
finalUnitPriceDisplay: finalUnitPrice != null ? `¥ ${finalUnitPrice}` : "-",
numberDisplay: item.upgradeGoodsId ? String(item.number ?? "-") : "-",
discountDisplay: `¥${item.discountAmount || 0}`,
warrantyDisplay: item.upgradeWarrantyPeriod
? `${item.upgradeWarrantyPeriod}年`
: "无",
aliasDisplay: item.upgradeGoodsAlias || "-",
};
}
/**
* @param {object} row
* @param {object} ctx
* @param {object} ctx.maps
* @returns {object}
*/
export function mapOrderListRow(row, ctx) {
const {
statusOpts = {},
upgradeOpts = {},
profitAllocationStatusOpts = {},
invoiceStatusOpts = {},
saleFlagTextObj = {},
djOrderTypeMap = {},
auditStatusMap = {},
positionTypeList = [],
} = ctx.maps || {};
const subOrderDisplayList = (row.subOrderList || []).map(item =>
mapSubOrderDisplayItem(item, positionTypeList),
);
const packageNamesDisplay = (row.packageGoodsList || [])
.map(p => p.packageName)
.filter(Boolean)
.join("、");
const carParts = [
row.carBrand,
row.carChildsBrandName ? `-${row.carChildsBrandName}` : "",
row.carSeriesName ? `-${row.carSeriesName}` : "",
].filter(Boolean);
const carTypeDisplay = carParts.join("") || "-";
let refundDetailDisplay = "-";
if (row.status == 12) {
const typeLabel = row.refundType == "1" ? "退全款" : "退部分款";
refundDetailDisplay = `${typeLabel} ¥${row.refundAmount || 0}`;
}
const salesTypeNum = Number(row.salesType);
const salesTypeLabel = SALES_TYPE_MAP[salesTypeNum] !== undefined
? SALES_TYPE_MAP[salesTypeNum]
: "-";
return {
...row,
paySuccessDate: row.paySuccessDate || "",
subOrderDisplayList,
packageNamesDisplay: packageNamesDisplay || "-",
djOrderTypeLabel: row.djOrderType ? (djOrderTypeMap[row.djOrderType] || "-") : "-",
goodsOrderApplyStatusLabel: row.goodsOrderApplyStatus
? (auditStatusMap[row.goodsOrderApplyStatus] || "-")
: "-",
incorrectOrderCodeDisplay: row.incorrectOrderCode || "-",
customerSexLabel: row.customerSex == 1 ? "男" : "女",
carTypeDisplay,
upgradeFlagLabel: row.upgradeFlag
? (upgradeOpts[row.upgradeFlag] || "待升级")
: "待升级",
statusLabel: statusOpts[row.status] || "-",
profitAllocationStatusLabel:
profitAllocationStatusOpts[row.profitAllocationStatus] || "-",
invoiceStatusLabel: invoiceStatusOpts[row.invoiceStatus] || "-",
totalPriceDisplay: row.totalPrice != null ? `¥${row.totalPrice}` : "",
finalPriceDisplay: row.finalPrice != null ? `¥${row.finalPrice}` : "",
refundDetailDisplay,
directSalesFlagLabel: row.directSalesFlag != null
? (saleFlagTextObj[row.directSalesFlag] || "-")
: "-",
subShopMerchantNameDisplay: row.subShopMerchantName || "-",
orderSourceLabel: ORDER_SOURCE_MAP[row.source] || "小程序订单",
salesTypeLabel,
subOrderCount: subOrderDisplayList.length,
};
}
/**
* @param {object} opt
* @returns {string}
*/
function rightsSceneRowLabel(opt) {
if (!opt) return "-";
return opt.name || opt.subTypeName || opt.num || opt.baseSceneCode || "-";
}
/**
* @param {object} [row]
* @param {Array<object>} [sceneList]
* @returns {string}
*/
export function resolveRightsSceneLabel(row, sceneList) {
if (row == null) return "-";
const key = String(row.baseSceneCode == null ? "" : row.baseSceneCode).trim();
if (key) {
const list = sceneList || [];
const opt = list.find(
s => String((s && s.baseSceneCode) || "").trim() === key,
);
if (opt) return rightsSceneRowLabel(opt);
return key;
}
const nm = row.baseSceneName != null ? row.baseSceneName : row.sceneName;
if (nm != null && String(nm).trim() !== "") return String(nm).trim();
return "-";
}
/**
* @param {object} item
* @param {Array<{ position: string|number, confName: string }>} positionTypeList
* @returns {object}
*/
export function mapCarDamageSubOrderDisplayItem(item, positionTypeList) {
const base = mapSubOrderDisplayItem(item, positionTypeList);
const packageAliasFull = item.packageAlias || "";
const couponNameFull = item.coupon?.couponName || "";
return {
...base,
packageNameDisplay: item.packageName || "-",
packageAliasFull,
packageAliasDisplay: truncateDisplay(packageAliasFull),
couponCodeDisplay: item.coupon?.customerCouponCode || "-",
couponNameFull,
couponNameDisplay: couponNameFull ? truncateDisplay(couponNameFull) : "-",
couponAmountDisplay: item.coupon?.discountPrice != null
? String(item.coupon.discountPrice)
: "-",
};
}
/**
* @param {object} row
* @param {object} ctx
* @param {object} ctx.maps
* @returns {object}
*/
export function mapCarDamageListRow(row, ctx) {
const {
statusOpts = {},
upgradeOpts = {},
profitAllocationStatusOpts = {},
invoiceStatusOpts = {},
saleFlagTextObj = {},
djOrderTypeMap = {},
auditStatusMap = {},
positionTypeList = [],
rightsSceneListForSearch = [],
zyVoucherStatusOpts = {},
} = ctx.maps || {};
const subOrderDisplayList = (row.subOrderList || []).map(item =>
mapCarDamageSubOrderDisplayItem(item, positionTypeList),
);
const carParts = [
row.carBrand,
row.carChildsBrandName ? `-${row.carChildsBrandName}` : "",
row.carSeriesName ? `-${row.carSeriesName}` : "",
].filter(Boolean);
const carTypeDisplay = carParts.join("") || "-";
let refundDetailDisplay = "-";
if (row.status == 12) {
const typeLabel = row.refundType == "1" ? "退全款" : "退部分款";
refundDetailDisplay = `${typeLabel} ¥${row.refundAmount || 0}`;
}
const salesTypeNum = Number(row.salesType);
const salesTypeLabel = CAR_DAMAGE_SALES_TYPE_MAP[salesTypeNum] !== undefined
? CAR_DAMAGE_SALES_TYPE_MAP[salesTypeNum]
: "-";
let customerSexLabel = "-";
if (row.customerSex) {
customerSexLabel = row.customerSex == 1 ? "男" : "女";
}
return {
...row,
paySuccessDate: row.paySuccessDate || "",
subOrderDisplayList,
djOrderTypeLabel: row.djOrderType ? (djOrderTypeMap[row.djOrderType] || "-") : "-",
goodsOrderApplyStatusLabel: row.goodsOrderApplyStatus
? (auditStatusMap[row.goodsOrderApplyStatus] || "-")
: "-",
incorrectOrderCodeDisplay: row.incorrectOrderCode || "-",
rightsSceneDisplayLabel: resolveRightsSceneLabel(
row,
rightsSceneListForSearch,
),
customerSexLabel,
carTypeDisplay,
upgradeFlagLabel: row.upgradeFlag
? (upgradeOpts[row.upgradeFlag] || "待升级")
: "待升级",
statusLabel: statusOpts[row.status] || "-",
profitAllocationStatusLabel:
profitAllocationStatusOpts[row.profitAllocationStatus] || "-",
invoiceStatusLabel: invoiceStatusOpts[row.invoiceStatus] || "-",
zyVoucherStatusLabel: zyVoucherStatusOpts[row.zyVoucherStatus] || "-",
totalPriceDisplay: row.totalPrice != null ? `¥${row.totalPrice}` : "",
finalPriceDisplay: row.finalPrice != null ? `¥${row.finalPrice}` : "",
refundDetailDisplay,
directSalesFlagLabel: row.directSalesFlag != null
? (saleFlagTextObj[row.directSalesFlag] || "-")
: "-",
subShopMerchantNameDisplay: row.subShopMerchantName || "-",
orderSourceLabel: ORDER_SOURCE_MAP[row.source] || "小程序订单",
salesTypeLabel,
subOrderCount: subOrderDisplayList.length,
};
}
const {
resolveRightsSceneLabel,
mapCarDamageSubOrderDisplayItem,
mapCarDamageListRow,
} = require("@/views/orderManage/utils/orderListRowDisplay");
describe("carDamageListRowDisplay", () => {
describe("resolveRightsSceneLabel", () => {
const sceneList = [
{ baseSceneCode: "SC001", name: "场景一" },
];
it("matches scene from list by baseSceneCode", () => {
expect(resolveRightsSceneLabel({ baseSceneCode: "SC001" }, sceneList)).toBe("场景一");
});
it("falls back to baseSceneCode when not in list", () => {
expect(resolveRightsSceneLabel({ baseSceneCode: "SC999" }, sceneList)).toBe("SC999");
});
it("falls back to baseSceneName", () => {
expect(resolveRightsSceneLabel({ baseSceneName: "备用名称" }, sceneList)).toBe("备用名称");
});
it("returns dash for empty row", () => {
expect(resolveRightsSceneLabel(null, sceneList)).toBe("-");
});
});
describe("mapCarDamageSubOrderDisplayItem", () => {
it("precomputes package and coupon fields", () => {
const item = mapCarDamageSubOrderDisplayItem({
upgradeGoodsId: 1,
packageName: "权益套餐A",
packageAlias: "别名一二三四五六七八九十",
upgradeGoodsName: "商品名",
upgradePrice: 100,
singleProductSalesPrice: 90,
singleProductFinalPrice: 80,
number: 1,
discountAmount: 5,
upgradeWarrantyPeriod: 2,
upgradeGoodsAlias: "商品别名",
coupon: {
customerCouponCode: "CP001",
couponName: "满减券名称很长很长很长",
discountPrice: 10,
},
}, []);
expect(item.packageNameDisplay).toBe("权益套餐A");
expect(item.packageAliasDisplay).toBe("别名一二三四五六七八...");
expect(item.couponCodeDisplay).toBe("CP001");
expect(item.couponNameDisplay).toBe("满减券名称很长很长很...");
expect(item.couponAmountDisplay).toBe("10");
});
});
describe("mapCarDamageListRow", () => {
const maps = {
statusOpts: { 4: "已支付" },
upgradeOpts: { Y: "已升级" },
profitAllocationStatusOpts: { 1: "未分账" },
invoiceStatusOpts: { 1: "未开票" },
zyVoucherStatusOpts: { 1: "待上传" },
saleFlagTextObj: { 1: "直营" },
djOrderTypeMap: { 1: "普通" },
auditStatusMap: { 3: "已通过" },
positionTypeList: [],
rightsSceneListForSearch: [{ baseSceneCode: "SC001", name: "场景一" }],
};
it("maps car damage row with rights-specific labels", () => {
const row = mapCarDamageListRow({
djOrderType: 1,
goodsOrderApplyStatus: 3,
status: 4,
upgradeFlag: "Y",
profitAllocationStatus: 1,
invoiceStatus: 1,
zyVoucherStatus: 1,
directSalesFlag: 1,
salesType: 0,
source: 7,
baseSceneCode: "SC001",
subOrderList: [{ packageName: "套餐1", baseGoodsName: "商品A" }],
}, { maps });
expect(row.salesTypeLabel).toBe("门店引流 - 售前");
expect(row.rightsSceneDisplayLabel).toBe("场景一");
expect(row.zyVoucherStatusLabel).toBe("待上传");
expect(row.customerSexLabel).toBe("-");
expect(row.subOrderCount).toBe(1);
expect(row.subOrderDisplayList).toHaveLength(1);
});
it("maps customer sex when present", () => {
const row = mapCarDamageListRow({ customerSex: 2, subOrderList: [] }, { maps });
expect(row.customerSexLabel).toBe("女");
});
});
});
/**
* 权益列表表格性能相关静态指标(用于回归对比,非运行时 benchmark)
*/
const fs = require("fs");
const path = require("path");
const CAR_DAMAGE_VUE = fs.readFileSync(
path.resolve(__dirname, "../../../../src/views/orderManage/carDamage.vue"),
"utf8",
);
function countMatches(source, pattern) {
const matches = source.match(pattern);
return matches ? matches.length : 0;
}
describe("carDamagePerfMetrics", () => {
it("operation column should keep fixed right per product requirement", () => {
expect(CAR_DAMAGE_VUE).toMatch(
/<el-table-column[^>]*fixed="right"[^>]*label="操作"/,
);
});
it("operation buttons should remain separate auth-button entries", () => {
const operationSection = CAR_DAMAGE_VUE.match(
/<el-table-column[^>]*label="操作"[\s\S]*?<\/el-table-column>/,
);
expect(operationSection).toBeTruthy();
expect(operationSection[0]).toContain("auth-button");
expect(operationSection[0]).not.toContain("el-dropdown");
});
it("sub-order columns should be in expand row not main v-for columns", () => {
const mainSubOrderVFor = CAR_DAMAGE_VUE.match(
/<el-table-column[^>]*label="商品名称"[\s\S]*?v-for="\(item, index\) in scope\.row\.subOrderList"/,
);
expect(mainSubOrderVFor).toBeNull();
});
it("should use row display mapper in getList", () => {
expect(CAR_DAMAGE_VUE).toContain("mapCarDamageListRow");
});
it("page size max should be 20", () => {
expect(CAR_DAMAGE_VUE).toMatch(/:page-sizes="\[10,\s*20\]/);
});
it("expand area should use native table instead of nested el-table", () => {
expect(CAR_DAMAGE_VUE).not.toMatch(/<el-table :data="row\.subOrderDisplayList"/);
expect(CAR_DAMAGE_VUE).toContain("order-sub-goods-table");
});
it("should use accordion expand-row-keys", () => {
expect(CAR_DAMAGE_VUE).toContain(":expand-row-keys=\"expandedOrderCodes\"");
expect(CAR_DAMAGE_VUE).toContain("@expand-change=\"handleExpandChange\"");
expect(CAR_DAMAGE_VUE).toContain("handleExpandChange(row, expandedRows)");
});
it("main table has fewer columns than legacy ~50", () => {
const mainColumnCount = countMatches(CAR_DAMAGE_VUE, /<el-table-column/g);
expect(mainColumnCount).toBeLessThan(40);
expect(mainColumnCount).toBeGreaterThan(25);
});
});
/**
* 精品列表表格性能相关静态指标(用于回归对比,非运行时 benchmark)
*/
const fs = require("fs");
const path = require("path");
const ORDER_VUE = fs.readFileSync(
path.resolve(__dirname, "../../../../src/views/orderManage/order.vue"),
"utf8",
);
function countMatches(source, pattern) {
const matches = source.match(pattern);
return matches ? matches.length : 0;
}
describe("orderListPerfMetrics", () => {
it("operation column should keep fixed right per product requirement", () => {
expect(ORDER_VUE).toMatch(
/<el-table-column[^>]*fixed="right"[^>]*label="操作"/,
);
});
it("operation buttons should remain separate auth-button entries", () => {
const operationSection = ORDER_VUE.match(
/<el-table-column[^>]*label="操作"[\s\S]*?<\/el-table-column>/,
);
expect(operationSection).toBeTruthy();
expect(operationSection[0]).toContain("auth-button");
expect(operationSection[0]).not.toContain("el-dropdown");
});
it("sub-order columns should be in expand row not main v-for columns", () => {
const mainSubOrderVFor = ORDER_VUE.match(
/<el-table-column[^>]*label="商品名称"[\s\S]*?v-for="\(item, index\) in scope\.row\.subOrderList"/,
);
expect(mainSubOrderVFor).toBeNull();
});
it("should use row display mapper in getList", () => {
expect(ORDER_VUE).toContain("mapOrderListRow");
});
it("page size max should be 20", () => {
expect(ORDER_VUE).toMatch(/:page-sizes="\[10,\s*20\]/);
});
it("expand area should use native table instead of nested el-table", () => {
expect(ORDER_VUE).not.toMatch(/<el-table :data="row\.subOrderDisplayList"/);
expect(ORDER_VUE).toContain("order-sub-goods-table");
});
it("should use accordion expand-row-keys", () => {
expect(ORDER_VUE).toContain(":expand-row-keys=\"expandedOrderCodes\"");
expect(ORDER_VUE).toContain("@expand-change=\"handleExpandChange\"");
expect(ORDER_VUE).toContain("handleExpandChange(row, expandedRows)");
});
it("main table has fewer columns than legacy ~45", () => {
const mainColumnCount = countMatches(ORDER_VUE, /<el-table-column/g);
expect(mainColumnCount).toBeLessThan(40);
expect(mainColumnCount).toBeGreaterThan(25);
});
});
const {
truncateDisplay,
getGoodsTypeName,
mapSubOrderDisplayItem,
mapOrderListRow,
} = require("@/views/orderManage/utils/orderListRowDisplay");
describe("orderListRowDisplay", () => {
describe("truncateDisplay", () => {
it("truncates long text", () => {
expect(truncateDisplay("abcdefghijklmnop", 10)).toBe("abcdefghij...");
});
it("returns dash for empty", () => {
expect(truncateDisplay("")).toBe("-");
});
});
describe("getGoodsTypeName", () => {
it("joins type names with dash", () => {
expect(getGoodsTypeName({
upgradeGoodsTypeName: "A",
upgradeSecondaryGoodsTypeName: "B",
})).toBe("A-B");
});
});
describe("mapSubOrderDisplayItem", () => {
it("precomputes display fields", () => {
const item = mapSubOrderDisplayItem({
upgradeGoodsId: 1,
upgradeGoodsName: "超长商品名称一二三四五六七八九十",
upgradePrice: 100,
singleProductSalesPrice: 90,
singleProductFinalPrice: 80,
number: 2,
discountAmount: 5,
upgradeWarrantyPeriod: 3,
upgradeGoodsAlias: "别名",
upgradeGoodsTypeName: "贴膜",
}, []);
expect(item.goodsNameDisplay).toBe("超长商品名称一二三四...");
expect(item.goodsTypeDisplay).toBe("贴膜");
expect(item.unitPriceDisplay).toBe("¥ 100");
expect(item.warrantyDisplay).toBe("3年");
});
});
describe("mapOrderListRow", () => {
const maps = {
statusOpts: { 4: "已支付" },
upgradeOpts: { Y: "已升级" },
profitAllocationStatusOpts: { 1: "未分账" },
invoiceStatusOpts: { 1: "未开票" },
saleFlagTextObj: { 1: "直营" },
djOrderTypeMap: { 1: "普通" },
auditStatusMap: { 3: "已通过" },
positionTypeList: [],
};
it("maps order row display labels", () => {
const row = mapOrderListRow({
djOrderType: 1,
goodsOrderApplyStatus: 3,
status: 4,
upgradeFlag: "Y",
profitAllocationStatus: 1,
invoiceStatus: 1,
directSalesFlag: 1,
salesType: 0,
source: 7,
subOrderList: [{ baseGoodsName: "商品A" }],
packageGoodsList: [{ packageName: "套餐1" }],
}, { maps });
expect(row.statusLabel).toBe("已支付");
expect(row.orderSourceLabel).toBe("系统导入");
expect(row.subOrderDisplayList).toHaveLength(1);
expect(row.packageNamesDisplay).toBe("套餐1");
});
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!