Browse Source

REPORT-53351 复制传参后sql-参数为空时的显示结果不对

feature/10.0
Bruce.Deng 4 years ago
parent
commit
eeb3ad9ce3
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

14
designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

@ -167,23 +167,10 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
parameterMap.put(parameter.getName(), parameter.getValue()); parameterMap.put(parameter.getName(), parameter.getValue());
} }
} }
boolean showOriginSql = true;
for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) {
if (parameterMap.containsKey(parameter.getName())) {
Object value = parameterMap.get(parameter.getName());
if (value != null && !StringUtils.EMPTY.equals(value)) {
showOriginSql = false;
}
parameter.setValue(value);
}
}
String sql; String sql;
// 计算高亮文本位置 // 计算高亮文本位置
List<int[]> specialCharParamIndex = null; List<int[]> specialCharParamIndex = null;
boolean highlight = true; boolean highlight = true;
if (showOriginSql) {
sql = tableData.getQuery();
} else {
NameSpace ns = ParameterMapNameSpace.create(parameterMap); NameSpace ns = ParameterMapNameSpace.create(parameterMap);
calculator.pushNameSpace(ns); calculator.pushNameSpace(ns);
Parameter[] paras = processParameters(tableData, calculator); Parameter[] paras = processParameters(tableData, calculator);
@ -203,7 +190,6 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
if (!StringUtils.equals(oldSql, sql)) { if (!StringUtils.equals(oldSql, sql)) {
highlight = false; highlight = false;
} }
}
// sql内容复制到剪切板 // sql内容复制到剪切板
StringSelection selection = new StringSelection(sql); StringSelection selection = new StringSelection(sql);
java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection); java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);

Loading…
Cancel
Save