From 92950640ca38f147718abacd87473285bc5b63ec Mon Sep 17 00:00:00 2001 From: interestinglife Date: Fri, 22 May 2020 22:16:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=94=AF=E6=8C=81=E5=B0=86SQL=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=8C=BA=E9=80=89=E4=B8=AD=E6=96=87=E6=9C=AC=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E5=8F=82=E6=95=B0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/view/freemarker/analysis/dataSet/dataSet_form.ftl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datagear-web/src/main/resources/org/datagear/web/webapp/view/freemarker/analysis/dataSet/dataSet_form.ftl b/datagear-web/src/main/resources/org/datagear/web/webapp/view/freemarker/analysis/dataSet/dataSet_form.ftl index 82e59428..b70393b8 100644 --- a/datagear-web/src/main/resources/org/datagear/web/webapp/view/freemarker/analysis/dataSet/dataSet_form.ftl +++ b/datagear-web/src/main/resources/org/datagear/web/webapp/view/freemarker/analysis/dataSet/dataSet_form.ftl @@ -268,7 +268,10 @@ readonly 是否只读操作,允许为null po.element(".sql-add-param-button").click(function() { - po.sqlParamsTableElement().DataTable().row.add({ name: "", type: "STRING", required: true, desc: "" }).draw(); + var selectionRange = po.sqlEditor.getSelectionRange(); + var selectText = (po.sqlEditor.session.getTextRange(selectionRange) || ""); + + po.sqlParamsTableElement().DataTable().row.add({ name: selectText, type: "${DataType.STRING}", required: true, desc: "" }).draw(); }); po.element(".sql-del-param-button").click(function()