mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 05:32:48 +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.hideLabel 是否隐藏标签
|
||||||
* @param options.customComponent 自定义组件
|
* @param options.customComponent 自定义组件
|
||||||
|
* @param options.ignoreFields 忽略的字段 prop
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function setAuto(
|
export function setAuto(
|
||||||
options: {
|
options: {
|
||||||
hideLabel?: boolean;
|
hideLabel?: boolean;
|
||||||
customComponent?: (field: ClCrud.Field) => Render.Component | null;
|
customComponent?: (field: ClCrud.Field) => Render.Component | null;
|
||||||
|
ignoreFields?: string[];
|
||||||
} = {
|
} = {
|
||||||
hideLabel: true
|
hideLabel: true
|
||||||
}
|
}
|
||||||
@ -84,6 +86,10 @@ export function setAuto(
|
|||||||
// 精确搜索
|
// 精确搜索
|
||||||
if (!isEmpty(fields)) {
|
if (!isEmpty(fields)) {
|
||||||
fields.forEach(e => {
|
fields.forEach(e => {
|
||||||
|
if (options.ignoreFields?.includes(e.propertyName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
arr.push({
|
arr.push({
|
||||||
prop: e.propertyName,
|
prop: e.propertyName,
|
||||||
label: options.hideLabel ? undefined : t(e.comment),
|
label: options.hideLabel ? undefined : t(e.comment),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user