diff --git a/datagear-web/src/main/resources/locales/datagear.properties b/datagear-web/src/main/resources/locales/datagear.properties index 218de3b6..ca6ba054 100644 --- a/datagear-web/src/main/resources/locales/datagear.properties +++ b/datagear-web/src/main/resources/locales/datagear.properties @@ -340,6 +340,7 @@ changelog.viewAll=\u67E5\u770B\u5168\u90E8 sqlpad.sqlpad=SQL\u5DE5\u4F5C\u53F0 sqlpad.executeWithShortcut=\u6267\u884C\uFF08Ctrl+Enter\uFF09 sqlpad.commit=\u63D0\u4EA4 +sqlpad.rollback=\u56DE\u6EDA sqlpad.stopExecution=\u505C\u6B62\u6267\u884C sqlpad.clearEditSql=\u6E05\u9664SQL sqlpad.moreOperation=\u8BBE\u7F6E diff --git a/datagear-web/src/main/webapp/WEB-INF/view/sqlpad/sqlpad.ftl b/datagear-web/src/main/webapp/WEB-INF/view/sqlpad/sqlpad.ftl index 8c91376b..ec402a30 100644 --- a/datagear-web/src/main/webapp/WEB-INF/view/sqlpad/sqlpad.ftl +++ b/datagear-web/src/main/webapp/WEB-INF/view/sqlpad/sqlpad.ftl @@ -22,6 +22,7 @@ Schema schema 数据库,不允许为null
+
@@ -30,21 +31,21 @@ Schema schema 数据库,不允许为null
-
+
-
- - - +
+ +
-
+
-
- - +
+ + +
@@ -99,8 +100,8 @@ select count(*) from t_order where id = 3 and name = 'jack'; po.sqlResultContentElement = po.element("#${pageId}-sql-result > .result-content"); $.initButtons(po.element(".head")); - po.element("#sqlExceptionHandleModeSet").buttonset(); po.element("#sqlCommitModeSet").buttonset(); + po.element("#sqlExceptionHandleModeSet").buttonset(); po.element(".more-operation-panel").hide(); $(document.body).bind("click", function(event) @@ -281,20 +282,30 @@ select count(*) from t_order where id = 3 and name = 'jack'; po.element(".more-operation-panel").toggle(); }); - po.updateCommitSqlButtonStatus = function(enable) - { - if(enable == undefined) - enable = (po.element("input[name='sqlCommitMode']").val() == "manual"); - - if(enable) - po.element("#commitSqlButton").button("enable"); - else - po.element("#commitSqlButton").button("disable"); - }; - po.element("input[name='sqlCommitMode']").change(function() { - po.updateCommitSqlButtonStatus($(this).val() == "manual"); + var value = $(this).val(); + + console.log(value); + + if(value == "manual") + { + po.element("#commitSqlButton").button("enable"); + po.element("#rollbackSqlButton").button("enable"); + + var $rollbackExceptionHandle = po.element("input[name='sqlExceptionHandleModel'][value='rollback']"); + $rollbackExceptionHandle.attr("disabled", "disabled"); + if($rollbackExceptionHandle.is(":checked")) + po.element("input[name='sqlExceptionHandleModel'][value='abort']").prop("checked", true); + po.element("#sqlExceptionHandleModeSet").buttonset("refresh"); + } + else + { + po.element("#commitSqlButton").button("disable"); + po.element("#rollbackSqlButton").button("disable"); + po.element("input[name='sqlExceptionHandleModel'][value='rollback']").removeAttr("disabled"); + po.element("#sqlExceptionHandleModeSet").buttonset("refresh"); + } }); po.element("#toggleResultTimeButton").click(function() @@ -318,7 +329,7 @@ select count(*) from t_order where id = 3 and name = 'jack'; po.sqlResultContentElement.empty(); }); - po.updateCommitSqlButtonStatus(); + po.element("input[name='sqlCommitMode'][value='auto']").click(); }) (${pageId});