fix: 视图创建出错异常捕捉和其他优化
This commit is contained in:
parent
eaf0b4c3c5
commit
90c51101ac
@ -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();
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -430,7 +430,7 @@ const openDialog = (row: any) => {
|
||||
|
||||
if (apiParamsMonacoEditor == null || apiParamsMonacoEditor == undefined) initApiParamsMonacoEditor();
|
||||
apiParamsMonacoEditor!.setValue(state.ruleForm.apiParams ?? '');
|
||||
}, 100);
|
||||
}, 0);
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
|
||||
Loading…
Reference in New Issue
Block a user