mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-10 20:02:54 +00:00
setAuto 插件添加 ignoreFields
This commit is contained in:
parent
80fd5ac7f8
commit
e31bce93d1
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user