setAuto 插件添加 ignoreFields

This commit is contained in:
神仙都没用 2025-02-22 12:53:59 +08:00
parent 80fd5ac7f8
commit e31bce93d1

View File

@ -7,12 +7,14 @@ import { useI18n } from 'vue-i18n';
*
* @param options.hideLabel
* @param options.customComponent
* @param options.ignoreFields prop
* @returns
*/
export function setAuto(
options: {
hideLabel?: boolean;
customComponent?: (field: ClCrud.Field) => Render.Component | null;
ignoreFields?: string[];
} = {
hideLabel: true
}
@ -84,6 +86,10 @@ export function setAuto(
// 精确搜索
if (!isEmpty(fields)) {
fields.forEach(e => {
if (options.ignoreFields?.includes(e.propertyName)) {
return;
}
arr.push({
prop: e.propertyName,
label: options.hideLabel ? undefined : t(e.comment),