forked from github/dataease
Merge branch 'dev' into pr@dev_st_fix
This commit is contained in:
commit
58055dc5e3
@ -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
|
||||
|
||||
[](https://star-history.com/#dataease/dataease&Date)
|
||||
|
||||
## FOSSA Status
|
||||
|
||||
[](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.
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user