forked from github/dataease
Merge branch 'dev' into pr@dev@feat_relationship_analyze
This commit is contained in:
commit
ff7a1c659d
@ -279,6 +279,12 @@ public class ChartViewService {
|
||||
if (result == null) {
|
||||
DataEaseException.throwException(Translator.get("i18n_chart_delete"));
|
||||
}
|
||||
DatasetTable datasetTable = dataSetTableService.get(result.getTableId());
|
||||
if (ObjectUtils.isNotEmpty(datasetTable)) {
|
||||
result.setDatasetMode(datasetTable.getMode());
|
||||
Datasource datasource = datasourceService.get(datasetTable.getDataSourceId());
|
||||
result.setDatasourceType(datasource != null ? datasource.getType() : null);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -645,13 +651,23 @@ public class ChartViewService {
|
||||
// 直连明细表分页
|
||||
Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class);
|
||||
Map<String, Object> mapSize = (Map<String, Object>) mapAttr.get("size");
|
||||
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0 && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
if (chartExtRequest.getGoPage() == null) {
|
||||
chartExtRequest.setGoPage(1L);
|
||||
}
|
||||
if (chartExtRequest.getPageSize() == null) {
|
||||
String pageSize = (String) mapSize.get("tablePageSize");
|
||||
chartExtRequest.setPageSize(Long.parseLong(pageSize));
|
||||
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
|
||||
if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
if (chartExtRequest.getGoPage() == null) {
|
||||
chartExtRequest.setGoPage(1L);
|
||||
}
|
||||
if (chartExtRequest.getPageSize() == null) {
|
||||
String pageSize = (String) mapSize.get("tablePageSize");
|
||||
chartExtRequest.setPageSize(Math.min(Long.parseLong(pageSize), view.getResultCount().longValue()));
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
|
||||
chartExtRequest.setGoPage(1L);
|
||||
chartExtRequest.setPageSize(view.getResultCount().longValue());
|
||||
} else {
|
||||
chartExtRequest.setGoPage(null);
|
||||
chartExtRequest.setPageSize(null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
chartExtRequest.setGoPage(null);
|
||||
@ -910,7 +926,13 @@ public class ChartViewService {
|
||||
String totalPageSql = null;
|
||||
PageInfo pageInfo = new PageInfo();
|
||||
pageInfo.setGoPage(chartExtRequest.getGoPage());
|
||||
pageInfo.setPageSize(chartExtRequest.getPageSize());
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
|
||||
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
|
||||
pageInfo.setPageSize(Math.min(view.getResultCount() - (chartExtRequest.getGoPage() - 1) * chartExtRequest.getPageSize(), chartExtRequest.getPageSize()));
|
||||
}
|
||||
} else {
|
||||
pageInfo.setPageSize(chartExtRequest.getPageSize());
|
||||
}
|
||||
|
||||
List<ChartViewFieldDTO> detailFieldList = new ArrayList<>();
|
||||
String detailFieldSql = null;
|
||||
|
@ -66,7 +66,7 @@
|
||||
@mousedown.stop.prevent="handleDown(handlei, $event)"
|
||||
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
|
||||
>
|
||||
<slot :name="handlei" />
|
||||
<slot :name="handlei"/>
|
||||
</div>
|
||||
<div
|
||||
:id="componentCanvasId"
|
||||
@ -95,7 +95,7 @@
|
||||
class="svg-background"
|
||||
:icon-class="mainSlotSvgInner"
|
||||
/>
|
||||
<slot />
|
||||
<slot/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -2170,31 +2170,31 @@ export default {
|
||||
}
|
||||
|
||||
.de-drag-top {
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 1px;
|
||||
top: 1px;
|
||||
height: 12px;
|
||||
width: 100%;
|
||||
width: calc(100% - 2px);
|
||||
}
|
||||
|
||||
.de-drag-right {
|
||||
right: 0;
|
||||
top: 0;
|
||||
right: 1px;
|
||||
top: 1px;
|
||||
width: 16px;
|
||||
height: 100%;
|
||||
height: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.de-drag-bottom {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
left: 1px;
|
||||
bottom: 1px;
|
||||
height: 12px;
|
||||
width: 100%;
|
||||
width: calc(100% - 2px);
|
||||
}
|
||||
|
||||
.de-drag-left {
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 1px;
|
||||
top: 1px;
|
||||
width: 16px;
|
||||
height: 100%;
|
||||
height: calc(100% - 2px);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -376,7 +376,7 @@ export function getTooltip(chart) {
|
||||
} else {
|
||||
res = param.value
|
||||
}
|
||||
obj.value = res
|
||||
obj.value = res === null ? '' : res
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,9 @@ export const formatterType = [
|
||||
]
|
||||
|
||||
export function valueFormatter(value, formatter) {
|
||||
if (value === null || value === undefined) {
|
||||
return null
|
||||
}
|
||||
// 1.unit 2.decimal 3.thousand separator and suffix
|
||||
let result
|
||||
if (formatter.type === 'auto') {
|
||||
|
@ -332,6 +332,13 @@ export default {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.canvasStyleData.panel.themeColor === 'dark') {
|
||||
chart_option.legend['pageIconColor'] = '#ffffff'
|
||||
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
|
||||
} else {
|
||||
chart_option.legend['pageIconColor'] = '#000000'
|
||||
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
|
||||
}
|
||||
this.myEcharts(chart_option)
|
||||
this.$nextTick(() => (this.linkageActive()))
|
||||
},
|
||||
|
@ -58,6 +58,7 @@ import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
|
||||
import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
|
||||
import ChartTitleUpdate from './ChartTitleUpdate.vue'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'ChartComponentG2',
|
||||
@ -140,7 +141,10 @@ export default {
|
||||
chartInfo() {
|
||||
const { id, title } = this.chart
|
||||
return { id, title }
|
||||
}
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
chart: {
|
||||
@ -280,6 +284,24 @@ export default {
|
||||
if (this.myChart && chart.type !== 'liquid' && this.searchCount > 0) {
|
||||
this.myChart.options.animation = false
|
||||
}
|
||||
if (this.myChart.options.legend) {
|
||||
let pageNavigatorInactiveFill, pageNavigatorFill
|
||||
if (this.canvasStyleData.panel.themeColor === 'dark') {
|
||||
pageNavigatorFill = '#ffffff'
|
||||
pageNavigatorInactiveFill = '#8c8c8c'
|
||||
} else {
|
||||
pageNavigatorFill = '#000000'
|
||||
pageNavigatorInactiveFill = '#8c8c8c'
|
||||
}
|
||||
this.myChart.options.legend['pageNavigator'] = {
|
||||
marker: {
|
||||
style: {
|
||||
inactiveFill: pageNavigatorInactiveFill, // 不能点击的颜色
|
||||
fill: pageNavigatorFill // 正常的颜色
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.antVRenderStatus) {
|
||||
this.myChart.render()
|
||||
|
@ -76,11 +76,8 @@
|
||||
v-model="functionForm.emptyDataStrategy"
|
||||
@change="changeFunctionCfg"
|
||||
>
|
||||
<el-radio :label="'breakLine'">{{ chart.type.includes('bar')?$t('chart.set_zero'):$t('chart.break_line') }}</el-radio>
|
||||
<el-radio
|
||||
v-if="chart.type.includes('line') || chart.type.includes('area')"
|
||||
:label="'setZero'"
|
||||
>{{ $t('chart.set_zero') }}</el-radio>
|
||||
<el-radio :label="'breakLine'">{{ $t('chart.break_line') }}</el-radio>
|
||||
<el-radio :label="'setZero'">{{ $t('chart.set_zero') }}</el-radio>
|
||||
<el-radio :label="'ignoreData'">{{ $t('chart.ignore_data') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
Loading…
Reference in New Issue
Block a user