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) {
|
if (result == null) {
|
||||||
DataEaseException.throwException(Translator.get("i18n_chart_delete"));
|
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;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -645,13 +651,23 @@ public class ChartViewService {
|
|||||||
// 直连明细表分页
|
// 直连明细表分页
|
||||||
Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class);
|
Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class);
|
||||||
Map<String, Object> mapSize = (Map<String, Object>) mapAttr.get("size");
|
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 (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
|
||||||
if (chartExtRequest.getGoPage() == null) {
|
if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||||
chartExtRequest.setGoPage(1L);
|
if (chartExtRequest.getGoPage() == null) {
|
||||||
}
|
chartExtRequest.setGoPage(1L);
|
||||||
if (chartExtRequest.getPageSize() == null) {
|
}
|
||||||
String pageSize = (String) mapSize.get("tablePageSize");
|
if (chartExtRequest.getPageSize() == null) {
|
||||||
chartExtRequest.setPageSize(Long.parseLong(pageSize));
|
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 {
|
} else {
|
||||||
chartExtRequest.setGoPage(null);
|
chartExtRequest.setGoPage(null);
|
||||||
@ -910,7 +926,13 @@ public class ChartViewService {
|
|||||||
String totalPageSql = null;
|
String totalPageSql = null;
|
||||||
PageInfo pageInfo = new PageInfo();
|
PageInfo pageInfo = new PageInfo();
|
||||||
pageInfo.setGoPage(chartExtRequest.getGoPage());
|
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<>();
|
List<ChartViewFieldDTO> detailFieldList = new ArrayList<>();
|
||||||
String detailFieldSql = null;
|
String detailFieldSql = null;
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
@mousedown.stop.prevent="handleDown(handlei, $event)"
|
@mousedown.stop.prevent="handleDown(handlei, $event)"
|
||||||
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
|
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
|
||||||
>
|
>
|
||||||
<slot :name="handlei" />
|
<slot :name="handlei"/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:id="componentCanvasId"
|
:id="componentCanvasId"
|
||||||
@ -95,7 +95,7 @@
|
|||||||
class="svg-background"
|
class="svg-background"
|
||||||
:icon-class="mainSlotSvgInner"
|
:icon-class="mainSlotSvgInner"
|
||||||
/>
|
/>
|
||||||
<slot />
|
<slot/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2170,31 +2170,31 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.de-drag-top {
|
.de-drag-top {
|
||||||
left: 0;
|
left: 1px;
|
||||||
top: 0;
|
top: 1px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
width: 100%;
|
width: calc(100% - 2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-drag-right {
|
.de-drag-right {
|
||||||
right: 0;
|
right: 1px;
|
||||||
top: 0;
|
top: 1px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 100%;
|
height: calc(100% - 30px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-drag-bottom {
|
.de-drag-bottom {
|
||||||
left: 0;
|
left: 1px;
|
||||||
bottom: 0;
|
bottom: 1px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
width: 100%;
|
width: calc(100% - 2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-drag-left {
|
.de-drag-left {
|
||||||
left: 0;
|
left: 1px;
|
||||||
top: 0;
|
top: 1px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 100%;
|
height: calc(100% - 2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -376,7 +376,7 @@ export function getTooltip(chart) {
|
|||||||
} else {
|
} else {
|
||||||
res = param.value
|
res = param.value
|
||||||
}
|
}
|
||||||
obj.value = res
|
obj.value = res === null ? '' : res
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,9 @@ export const formatterType = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export function valueFormatter(value, formatter) {
|
export function valueFormatter(value, formatter) {
|
||||||
|
if (value === null || value === undefined) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
// 1.unit 2.decimal 3.thousand separator and suffix
|
// 1.unit 2.decimal 3.thousand separator and suffix
|
||||||
let result
|
let result
|
||||||
if (formatter.type === 'auto') {
|
if (formatter.type === 'auto') {
|
||||||
|
@ -332,6 +332,13 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
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.myEcharts(chart_option)
|
||||||
this.$nextTick(() => (this.linkageActive()))
|
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 { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
|
||||||
import ChartTitleUpdate from './ChartTitleUpdate.vue'
|
import ChartTitleUpdate from './ChartTitleUpdate.vue'
|
||||||
import { equalsAny } from '@/utils/StringUtils'
|
import { equalsAny } from '@/utils/StringUtils'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartComponentG2',
|
name: 'ChartComponentG2',
|
||||||
@ -140,7 +141,10 @@ export default {
|
|||||||
chartInfo() {
|
chartInfo() {
|
||||||
const { id, title } = this.chart
|
const { id, title } = this.chart
|
||||||
return { id, title }
|
return { id, title }
|
||||||
}
|
},
|
||||||
|
...mapState([
|
||||||
|
'canvasStyleData'
|
||||||
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
chart: {
|
chart: {
|
||||||
@ -280,6 +284,24 @@ export default {
|
|||||||
if (this.myChart && chart.type !== 'liquid' && this.searchCount > 0) {
|
if (this.myChart && chart.type !== 'liquid' && this.searchCount > 0) {
|
||||||
this.myChart.options.animation = false
|
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) {
|
if (this.antVRenderStatus) {
|
||||||
this.myChart.render()
|
this.myChart.render()
|
||||||
|
@ -76,11 +76,8 @@
|
|||||||
v-model="functionForm.emptyDataStrategy"
|
v-model="functionForm.emptyDataStrategy"
|
||||||
@change="changeFunctionCfg"
|
@change="changeFunctionCfg"
|
||||||
>
|
>
|
||||||
<el-radio :label="'breakLine'">{{ chart.type.includes('bar')?$t('chart.set_zero'):$t('chart.break_line') }}</el-radio>
|
<el-radio :label="'breakLine'">{{ $t('chart.break_line') }}</el-radio>
|
||||||
<el-radio
|
<el-radio :label="'setZero'">{{ $t('chart.set_zero') }}</el-radio>
|
||||||
v-if="chart.type.includes('line') || chart.type.includes('area')"
|
|
||||||
:label="'setZero'"
|
|
||||||
>{{ $t('chart.set_zero') }}</el-radio>
|
|
||||||
<el-radio :label="'ignoreData'">{{ $t('chart.ignore_data') }}</el-radio>
|
<el-radio :label="'ignoreData'">{{ $t('chart.ignore_data') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
Loading…
Reference in New Issue
Block a user