diff --git a/src/modules/helper/hooks/code.ts b/src/modules/helper/hooks/code.ts index f500b86..e406f2c 100644 --- a/src/modules/helper/hooks/code.ts +++ b/src/modules/helper/hooks/code.ts @@ -226,7 +226,7 @@ export function useCode() { // 字典 const dict = item.component?.options || column.dict; - if (dict) { + if (!isEmpty(dict)) { options[item.prop] = dict; const str = `$$options.${item.prop}$$`; @@ -326,13 +326,17 @@ export function useCode() { // 筛选 const clFilter = fieldEq .map((field) => { - const item = upsert.items.find((e) => e.prop == field); - - if (item) { - return `\n\n\n`; - } else { + if (isEmpty(options[field])) { return ""; } + + const item = upsert.items.find((e) => e.prop == field); + + if (!item) { + return ""; + } + + return `\n\n\n`; }) .filter(Boolean) .join("\n");