Merge branch 'dev' into pr@dev_st_fix

This commit is contained in:
dataeaseShu 2023-05-15 13:43:00 +08:00
commit 58055dc5e3
9 changed files with 73 additions and 6 deletions

View File

@ -5,7 +5,7 @@
<a href="https://app.codacy.com/gh/dataease/dataease?utm_source=github.com&utm_medium=referral&utm_content=dataease/dataease&utm_campaign=Badge_Grade_Dashboard"><img src="https://app.codacy.com/project/badge/Grade/da67574fd82b473992781d1386b937ef" alt="Codacy"></a>
<a href="https://github.com/dataease/dataease/releases/latest"><img src="https://img.shields.io/github/v/release/dataease/dataease" alt="Latest release"></a>
<a href="https://github.com/dataease/dataease"><img src="https://img.shields.io/github/stars/dataease/dataease?color=%231890FF&style=flat-square" alt="Stars"></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2F1dataease%2Fdataease?ref=badge_shield"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdataease%2Fdataease.svg?type=shield" alt="FOSSA Status"></a>
</p>
<hr/>
@ -104,6 +104,11 @@ curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start.sh | bash
[![Star History Chart](https://api.star-history.com/svg?repos=dataease/dataease&type=Date)](https://star-history.com/#dataease/dataease&Date)
## FOSSA Status
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdataease%2Fdataease.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdataease%2Fdataease?ref=badge_large)
## License
Copyright (c) 2014-2023 [FIT2CLOUD 飞致云](https://fit2cloud.com/), All rights reserved.

View File

@ -56,6 +56,7 @@ public interface ShareApi {
@PostMapping("/removeShares")
void removeShares(PanelShareRemoveRequest request);
@DePermission(type = DePermissionType.PANEL)
@ApiOperation("删除仪表板所有分享")
@PostMapping("/removePanelShares/{panelId}")
void removePanelShares(@PathVariable("panelId") String panelId);

View File

@ -787,7 +787,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
if(redshiftConfiguration.getDataBase().length() > 64 || redshiftConfiguration.getDataBase().length() < 1){
throw new Exception("Invalid database name");
}
if(!redshiftConfiguration.getDataBase().matches("\"^[a-z][a-z0-9_+.@-]*$\"")){
if(!redshiftConfiguration.getDataBase().matches("^[a-z][a-z0-9_+.@-]*$")){
throw new Exception("Invalid database name");
}
break;

View File

@ -20,7 +20,7 @@ public class MysqlDDLProvider extends DDLProviderImpl {
private static final String creatTableSql =
"CREATE TABLE IF NOT EXISTS `TABLE_NAME`" +
"Column_Fields;" ;
"Column_Fields" + " ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;" ;
@Override

View File

@ -1122,8 +1122,7 @@ public class DataSetTableService {
SelectBody selectBody = ((SubSelect) fromItem).getSelectBody();
SubSelect subSelect = new SubSelect();
Select subSelectTmp = (Select) CCJSqlParserUtil.parse(removeVariables(selectBody.toString(), dsType));
PlainSelect subPlainSelect = ((PlainSelect) subSelectTmp.getSelectBody());
subSelect.setSelectBody(subPlainSelect);
subSelect.setSelectBody(subSelectTmp.getSelectBody());
if (dsType.equals(DatasourceTypes.oracle.getType())) {
subSelect.setAlias(new Alias(fromItem.getAlias().toString(), false));
} else {
@ -1280,7 +1279,6 @@ public class DataSetTableService {
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
String sqlAsTable = qp.createSQLPreview(sql, null);
datasourceRequest.setQuery(sqlAsTable);
Map<String, List> result;
try {
datasetSqlLog.setStartTime(System.currentTimeMillis());

View File

@ -227,6 +227,9 @@ public class EngineService {
mysqlConfiguration.setPort(Integer.valueOf(matcher.group(2)));
mysqlConfiguration.setDataBase(matcher.group(3).split("\\?")[0]);
mysqlConfiguration.setExtraParams(matcher.group(3).split("\\?")[1]);
if(StringUtils.isNotEmpty(mysqlConfiguration.getExtraParams()) && !mysqlConfiguration.getExtraParams().contains("connectionCollation")){
mysqlConfiguration.setExtraParams(mysqlConfiguration.getExtraParams() + "&connectionCollation=utf8mb4_general_ci");
}
mysqlConfiguration.setUsername(env.getProperty("spring.datasource.username"));
mysqlConfiguration.setPassword(env.getProperty("spring.datasource.password"));
engine.setConfiguration(new Gson().toJson(mysqlConfiguration));

View File

@ -24,6 +24,7 @@ export function baseMixOption(chart_option, chart) {
}
}
// 处理data
const yAxisSeriesMaxList = []; const yAxisExtSeriesMaxList = []
if (chart.data) {
chart_option.title.text = chart.title
chart_option.xAxis.data = chart.data.x
@ -69,12 +70,42 @@ export function baseMixOption(chart_option, chart) {
chart_option.legend.data.push(y.name)
i >= yAxis.length ? (y.yAxisIndex = 1) : (y.yAxisIndex = 0)
// get max
if (i >= yAxis.length) {
const valueList = []
y.data.forEach(ele => {
valueList.push(ele.value)
})
yAxisExtSeriesMaxList.push(Math.max.apply(null, valueList))
} else {
const valueList = []
y.data.forEach(ele => {
valueList.push(ele.value)
})
yAxisSeriesMaxList.push(Math.max.apply(null, valueList))
}
y.selectedMode = true
y.select = BASE_ECHARTS_SELECT
chart_option.series.push(y)
}
}
componentStyle(chart_option, chart)
// 若轴值中最大值小于data的最大值则轴值最大值设置失效
if (yAxisSeriesMaxList.length > 0 && !isNaN(chart_option.yAxis[0].max)) {
const max = Math.max.apply(null, yAxisSeriesMaxList)
if (max > chart_option.yAxis[0].max) {
delete chart_option.yAxis[0].max
}
}
if (yAxisExtSeriesMaxList.length > 0 && !isNaN(chart_option.yAxis[1].max)) {
const max = Math.max.apply(null, yAxisExtSeriesMaxList)
if (max > chart_option.yAxis[1].max) {
delete chart_option.yAxis[1].max
}
}
seniorCfg(chart_option, chart)
return chart_option
}

View File

@ -56,6 +56,7 @@
<script>
import { compareDayList, compareMonthList, compareYearList } from '@/views/chart/chart/compare'
import { SUPPORT_Y_M } from '@/views/chart/chart/chart'
export default {
name: 'CompareEdit',
@ -95,6 +96,19 @@ export default {
xAxis = JSON.parse(this.chart.xaxis)
}
const t1 = xAxis.filter(ele => { return ele.deType === 1 })
if (this.chart.type === 'table-pivot') {
let xAxisExt = null
if (Object.prototype.toString.call(this.chart.xaxisExt) === '[object Array]') {
xAxisExt = JSON.parse(JSON.stringify(this.chart.xaxisExt))
} else {
xAxisExt = JSON.parse(this.chart.xaxisExt)
}
const t2 = xAxisExt.filter(ele => { return ele.deType === 1 })
t1.push(...t2)
}
this.fieldList = t1
//
if ((!this.compareItem.compareCalc.field || this.compareItem.compareCalc.field === '') && this.fieldList.length > 0) {

View File

@ -324,6 +324,21 @@ export default {
const t1 = xAxis.filter(ele => {
return ele.deType === 1 && SUPPORT_Y_M.includes(ele.dateStyle)
})
if (this.chart.type === 'table-pivot') {
let xAxisExt = null
if (Object.prototype.toString.call(this.chart.xaxisExt) === '[object Array]') {
xAxisExt = JSON.parse(JSON.stringify(this.chart.xaxisExt))
} else {
xAxisExt = JSON.parse(this.chart.xaxisExt)
}
const t2 = xAxisExt.filter(ele => {
return ele.deType === 1 && SUPPORT_Y_M.includes(ele.dateStyle)
})
t1.push(...t2)
}
// /
if (t1.length > 0 && this.chart.type !== 'text' && this.chart.type !== 'label' && this.chart.type !== 'gauge' && this.chart.type !== 'liquid') {
this.disableEditCompare = false