* [bug#61285] Set the button of create template when has no template in list.

This commit is contained in:
xieqiyu
2025-04-29 10:39:53 +08:00
committed by 刘刚
parent c154166f06
commit ae0fb66e4b
+20 -1
View File
@@ -499,7 +499,26 @@ $.extend(window.docAppActions,
{text: lang.cancel, size: 'md', className: 'btn-wide', type: 'primary-outline', command: 'cancelEditDoc'},
{text: lang.settings, size: 'md', type: 'ghost', command: `showDocSettingModal/${doc.id}/template/1`, icon: 'cog-outline'},
];
}
},
/**
* 定义模板列表的操作按钮。
* Define the actions on the template list.
*/
'doc-list': function(info)
{
const lang = getLang();
const canCreateDoc = hasPriv('create');
/* 文档列表没有文档时的按钮。Actions for empty doc list. */
if(info.ui === 'doc-list-empty')
{
return canCreateDoc ? [{icon: 'plus', text: lang.createTemplate, btnType: 'primary', command: 'startCreateTemplate'}] : null;
}
const items = [];
if(canCreateDoc) items.push({text: lang.createTemplate, icon: 'plus', btnType: 'primary', command: 'startCreateTemplate'});
return items.length ? {component: 'toolbar', props: {items: items}} : null;
},
});
/**