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;
|
var sql = viewType.GetMethod(nameof(ISqlSugarView.GetQueryableSqlString))?.Invoke(Activator.CreateInstance(viewType), [dbProvider]) as string;
|
||||||
if (string.IsNullOrWhiteSpace(sql)) throw new Exception("视图初始化Sql语句不能为空");
|
if (string.IsNullOrWhiteSpace(sql)) throw new Exception("视图初始化Sql语句不能为空");
|
||||||
|
|
||||||
// 创建视图
|
try
|
||||||
dbProvider.Ado.ExecuteCommand($"CREATE VIEW {entityInfo.DbTableName} AS " + Environment.NewLine + " " + sql);
|
{
|
||||||
|
// 创建视图
|
||||||
|
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();
|
stopWatch.Stop();
|
||||||
|
|||||||
@ -186,7 +186,7 @@ const openCopyMenu = (row: any) => {
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = (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'),
|
confirmButtonText: i18n.t('message.list.confirmButtonText'),
|
||||||
cancelButtonText: i18n.t('message.list.cancelButtonText'),
|
cancelButtonText: i18n.t('message.list.cancelButtonText'),
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
|||||||
@ -430,7 +430,7 @@ const openDialog = (row: any) => {
|
|||||||
|
|
||||||
if (apiParamsMonacoEditor == null || apiParamsMonacoEditor == undefined) initApiParamsMonacoEditor();
|
if (apiParamsMonacoEditor == null || apiParamsMonacoEditor == undefined) initApiParamsMonacoEditor();
|
||||||
apiParamsMonacoEditor!.setValue(state.ruleForm.apiParams ?? '');
|
apiParamsMonacoEditor!.setValue(state.ruleForm.apiParams ?? '');
|
||||||
}, 100);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user