From ea48891f784062a85523a00aedc45216c7b2f839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=B4=9D=E8=B4=9D?= Date: Wed, 1 Sep 2021 17:51:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE=E7=BB=95=E8=BF=87=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/static/ace/ace-init.js | 2 +- sql/templates/sqlquery.html | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/common/static/ace/ace-init.js b/common/static/ace/ace-init.js index 98fb43679c..4a1c495cf6 100644 --- a/common/static/ace/ace-init.js +++ b/common/static/ace/ace-init.js @@ -40,7 +40,7 @@ editor.commands.addCommand({ exec: function (editor) { let pathname = window.location.pathname; if (pathname === "/sqlquery/") { - sqlquery(); + dosqlquery() } } }); diff --git a/sql/templates/sqlquery.html b/sql/templates/sqlquery.html index 24d94b5246..c3d8ed431d 100644 --- a/sql/templates/sqlquery.html +++ b/sql/templates/sqlquery.html @@ -622,11 +622,7 @@ //先做表单验证,验证成功再成功提交查询请求 $("#btn-sqlquery").click(function () { - if (sqlquery_validate()) { - $('input[type=button]').addClass('disabled'); - $('input[type=button]').prop('disabled', true); - sqlquery(); - } + dosqlquery(); } ); @@ -913,6 +909,14 @@ } }); } + + function dosqlquery() { + if (sqlquery_validate()) { + $('input[type=button]').addClass('disabled'); + $('input[type=button]').prop('disabled', true); + sqlquery(); + } + }