fix: 视图创建出错异常捕捉和其他优化

This commit is contained in:
写意 2025-06-27 22:33:50 +08:00
parent eaf0b4c3c5
commit 90c51101ac
3 changed files with 12 additions and 4 deletions

View File

@ -599,8 +599,16 @@ public static class SqlSugarSetup
var sql = viewType.GetMethod(nameof(ISqlSugarView.GetQueryableSqlString))?.Invoke(Activator.CreateInstance(viewType), [dbProvider]) as string;
if (string.IsNullOrWhiteSpace(sql)) throw new Exception("视图初始化Sql语句不能为空");
// 创建视图
dbProvider.Ado.ExecuteCommand($"CREATE VIEW {entityInfo.DbTableName} AS " + Environment.NewLine + " " + sql);
try
{
// 创建视图
dbProvider.Ado.ExecuteCommand($"CREATE VIEW {entityInfo.DbTableName} AS " + Environment.NewLine + " " + sql);
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"初始化视图 {viewType.FullName,-58} ({config.ConfigId} - 失败,{ex.Message})");
}
// 停止计时
stopWatch.Stop();

View File

@ -186,7 +186,7 @@ const openCopyMenu = (row: any) => {
//
const handleDelete = (row: any) => {
ElMessageBox.confirm(i18n.t('message.list.confirmDeleteMenu', { name: row.name }), i18n.t('message.list.hint'), {
ElMessageBox.confirm(i18n.t('message.list.confirmDeleteMenu', { title: row.title }), i18n.t('message.list.hint'), {
confirmButtonText: i18n.t('message.list.confirmButtonText'),
cancelButtonText: i18n.t('message.list.cancelButtonText'),
type: 'warning',

View File

@ -430,7 +430,7 @@ const openDialog = (row: any) => {
if (apiParamsMonacoEditor == null || apiParamsMonacoEditor == undefined) initApiParamsMonacoEditor();
apiParamsMonacoEditor!.setValue(state.ruleForm.apiParams ?? '');
}, 100);
}, 0);
};
//