4 Commits

Author SHA1 Message Date
zyclove
236b9c75d3 Merge 668f872743 into 8abfc923a0 2025-03-26 11:35:46 +08:00
coosir
8abfc923a0 (fix)(supersonic-fe) support needMultiply100 for bar chart to show correct percentage value (#2189)
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled
2025-03-26 10:11:52 +08:00
zhaoyingchao
668f872743 Merge remote-tracking branch 'origin/master' into jsqlparser-fix 2025-03-05 10:01:57 +08:00
zhaoyingchao
acb9cef64e feat:upgrade jsqlparser 4.9 and add timeout 2025-02-27 17:30:48 +08:00
3 changed files with 5 additions and 5 deletions

View File

@@ -225,7 +225,7 @@ public class SqlSelectHelper {
public static Select getSelect(String sql) {
Statement statement = null;
try {
statement = CCJSqlParserUtil.parse(sql);
statement = CCJSqlParserUtil.parse(sql, parser -> parser.withTimeOut(20000));
} catch (JSQLParserException e) {
log.error("parse error, sql:{}", sql, e);
throw new RuntimeException(e);

View File

@@ -32,7 +32,7 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<file.encoding>UTF-8</file.encoding>
<jsqlparser.version>4.7</jsqlparser.version>
<jsqlparser.version>4.9</jsqlparser.version>
<pagehelper.version>6.1.0</pagehelper.version>
<pagehelper.spring.version>2.1.0</pagehelper.spring.version>
<mybatis.version>3.5.3</mybatis.version>

View File

@@ -94,7 +94,7 @@ const BarChart: React.FC<Props> = ({
return value === 0
? 0
: metricField.dataFormatType === 'percent'
? `${formatByDecimalPlaces(value, metricField.dataFormat?.decimalPlaces || 2)}%`
? `${formatByDecimalPlaces(metricField.dataFormat?.needMultiply100 ? +value * 100 : value, metricField.dataFormat?.decimalPlaces || 2)}%`
: getFormattedValue(value);
},
},
@@ -116,7 +116,7 @@ const BarChart: React.FC<Props> = ({
: metricField.dataFormatType === 'percent' ||
metricField.dataFormatType === 'decimal'
? `${formatByDecimalPlaces(
item.value,
metricField.dataFormat?.needMultiply100 ? +item.value * 100 : item.value,
metricField.dataFormat?.decimalPlaces || 2
)}${metricField.dataFormatType === 'percent' ? '%' : ''}`
: getFormattedValue(item.value)
@@ -151,7 +151,7 @@ const BarChart: React.FC<Props> = ({
return value === 0
? 0
: metricField.dataFormatType === 'percent'
? `${formatByDecimalPlaces(value, metricField.dataFormat?.decimalPlaces || 2)}%`
? `${formatByDecimalPlaces(metricField.dataFormat?.needMultiply100 ? +value * 100 : value, metricField.dataFormat?.decimalPlaces || 2)}%`
: getFormattedValue(value);
},
},