生成代码 配置detail 忽略detail的处理

This commit is contained in:
lvjunzhao
2025-03-03 16:11:57 +08:00
parent 35a809e957
commit 363789d227

View File

@ -434,7 +434,7 @@ export function buildListCode(model: GeneratorConfig): string {
}); });
let btnEvent = `{`; let btnEvent = `{`;
model.listConfig.buttonConfigs model.listConfig.buttonConfigs
.filter((x) => x.isUse && x.isDefault) .filter((x) => x.isUse && x.isDefault && x.code != 'detail')
.forEach((x) => { .forEach((x) => {
btnEvent += `${x.code} : handle${upperFirst(x.code)},`; btnEvent += `${x.code} : handle${upperFirst(x.code)},`;
}); });
@ -451,6 +451,11 @@ export function buildListCode(model: GeneratorConfig): string {
buttonConfigs.push(item); buttonConfigs.push(item);
return; return;
} }
if (item.code === 'detail') {
//detail按钮 只作为权限处理
buttonConfigs.splice(index, 1);
return;
}
}); });
const hasAddButton = hasButton(buttonConfigs, 'add'); const hasAddButton = hasButton(buttonConfigs, 'add');
const hasEditButton = hasButton(buttonConfigs, 'edit'); const hasEditButton = hasButton(buttonConfigs, 'edit');