diff --git a/src/utils/index.ts b/src/utils/index.ts index 2b0aad5..8347e82 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -316,3 +316,22 @@ export const removeClass = (ele: HTMLElement, cls: string) => { export const isExternal = (path: string) => { return /^(https?:|http?:|mailto:|tel:)/.test(path); }; + +// 获取枚举值的中文label回显 +/** + *@param id 要匹配的id + *@param emuList枚举值 + */ +export const getEmulistLabelById = (id: string, emuList: any) => { + if (!id) { + return '--'; + } + if (emuList && emuList.length) { + const { label } = emuList.find((item: any) => { + return item.value == id; + }); + return label || '--'; + } else { + return '--'; + } +}; diff --git a/src/views/oms/order/index.vue b/src/views/oms/order/index.vue index db90371..b221ccd 100644 --- a/src/views/oms/order/index.vue +++ b/src/views/oms/order/index.vue @@ -1,18 +1,17 @@