From 6879397b778d540f71fa0244c45c923178700d65 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 1 Feb 2023 15:52:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E5=8F=82=E6=95=B0column?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/comm.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/utils/comm.ts b/src/utils/comm.ts index e7b4363f..26d09dd9 100644 --- a/src/utils/comm.ts +++ b/src/utils/comm.ts @@ -76,3 +76,23 @@ export function getSlotVNode(slots: Slots, props: Record, pr } return (props[prop] || slots[prop]?.()) as T; } + + +/** + * 修改Select参数column的值 + * @param e // 查询参数 e + * @param column {Object} {需要修改的值: 修改后的值} + * { + username: 'context.username', + } + */ +export const modifySearchColumnValue = (e: any, column: object) => { + e.terms.forEach((item: any) => { + item.terms.forEach((t: any) => { + if (column[t.column]) { + t.column = column[t.column]; + } + }); + }); + return e; +}; \ No newline at end of file