forked from github/dataease
Merge pull request #11692 from dataease/pr@dev-v2@chart-view-add-field
fix(图表): 修复热力图以及流向地图新加的字段无法保存问题
This commit is contained in:
commit
0ec09f823d
@ -137,7 +137,7 @@ public class CoreChartView implements Serializable {
|
||||
private Long updateTime;
|
||||
|
||||
/**
|
||||
* 缩略图
|
||||
* 缩略图
|
||||
*/
|
||||
private String snapshot;
|
||||
|
||||
@ -206,6 +206,16 @@ public class CoreChartView implements Serializable {
|
||||
*/
|
||||
private Boolean aggregate;
|
||||
|
||||
private String flowMapStartName;
|
||||
|
||||
private String flowMapEndName;
|
||||
|
||||
/**
|
||||
* 颜色维度field
|
||||
*/
|
||||
private String extColor;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -510,6 +520,30 @@ public class CoreChartView implements Serializable {
|
||||
this.aggregate = aggregate;
|
||||
}
|
||||
|
||||
public String getFlowMapStartName() {
|
||||
return flowMapStartName;
|
||||
}
|
||||
|
||||
public void setFlowMapStartName(String flowMapStartName) {
|
||||
this.flowMapStartName = flowMapStartName;
|
||||
}
|
||||
|
||||
public String getFlowMapEndName() {
|
||||
return flowMapEndName;
|
||||
}
|
||||
|
||||
public void setFlowMapEndName(String flowMapEndName) {
|
||||
this.flowMapEndName = flowMapEndName;
|
||||
}
|
||||
|
||||
public String getExtColor() {
|
||||
return extColor;
|
||||
}
|
||||
|
||||
public void setExtColor(String extColor) {
|
||||
this.extColor = extColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CoreChartView{" +
|
||||
@ -551,6 +585,9 @@ public class CoreChartView implements Serializable {
|
||||
", copyFrom = " + copyFrom +
|
||||
", copyId = " + copyId +
|
||||
", aggregate = " + aggregate +
|
||||
", flowMapStartName=" + flowMapStartName +
|
||||
", flowMapEndName=" + flowMapEndName +
|
||||
", extColor=" + extColor +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -329,6 +329,9 @@ public class ChartViewManege {
|
||||
record.setDrillFields(objectMapper.writeValueAsString(dto.getDrillFields()));
|
||||
record.setCustomFilter(objectMapper.writeValueAsString(dto.getCustomFilter()));
|
||||
record.setViewFields(objectMapper.writeValueAsString(dto.getViewFields()));
|
||||
record.setFlowMapStartName(objectMapper.writeValueAsString(dto.getFlowMapStartName()));
|
||||
record.setFlowMapEndName(objectMapper.writeValueAsString(dto.getFlowMapEndName()));
|
||||
record.setExtColor(objectMapper.writeValueAsString(dto.getExtColor()));
|
||||
|
||||
return record;
|
||||
}
|
||||
@ -354,6 +357,9 @@ public class ChartViewManege {
|
||||
dto.setDrillFields(JsonUtil.parseList(record.getDrillFields(), tokenType));
|
||||
dto.setCustomFilter(JsonUtil.parseObject(record.getCustomFilter(), FilterTreeObj.class));
|
||||
dto.setViewFields(JsonUtil.parseList(record.getViewFields(), tokenType));
|
||||
dto.setFlowMapStartName(JsonUtil.parseList(record.getFlowMapStartName(), tokenType));
|
||||
dto.setFlowMapEndName(JsonUtil.parseList(record.getFlowMapEndName(), tokenType));
|
||||
dto.setExtColor(JsonUtil.parseList(record.getExtColor(), tokenType));
|
||||
|
||||
return dto;
|
||||
|
||||
|
@ -11,3 +11,10 @@ alter table `core_datasource`
|
||||
ALTER TABLE `visualization_outer_params_target_view_info`
|
||||
MODIFY COLUMN `target_view_id` varchar(50) NULL DEFAULT NULL COMMENT '联动视图ID/联动过滤项ID' ,
|
||||
ADD COLUMN `target_ds_id` varchar(50) NULL COMMENT '联动数据集id/联动过滤组件id' ;
|
||||
|
||||
alter table `core_chart_view`
|
||||
add flow_map_start_name longtext comment '流向地图起点名称field';
|
||||
alter table `core_chart_view`
|
||||
add flow_map_end_name longtext comment '流向地图终点名称field';
|
||||
alter table `core_chart_view`
|
||||
add ext_color longtext comment '颜色维度field';
|
||||
|
@ -61,3 +61,10 @@ ALTER TABLE `visualization_outer_params_target_view_info`
|
||||
MODIFY COLUMN `target_view_id` varchar(50) NULL DEFAULT NULL COMMENT '联动视图ID/联动过滤项ID' ,
|
||||
ADD COLUMN `target_ds_id` varchar(50) NULL COMMENT '联动数据集id/联动过滤组件id' ;
|
||||
|
||||
alter table `core_chart_view`
|
||||
add flow_map_start_name longtext comment '流向地图起点名称field';
|
||||
alter table `core_chart_view`
|
||||
add flow_map_end_name longtext comment '流向地图终点名称field';
|
||||
alter table `core_chart_view`
|
||||
add ext_color longtext comment '颜色维度field';
|
||||
|
||||
|
@ -28,7 +28,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const {compareItem, chart} = toRefs(props)
|
||||
const { compareItem, chart } = toRefs(props)
|
||||
|
||||
const state = reactive({
|
||||
fieldList: [],
|
||||
@ -37,9 +37,9 @@ const state = reactive({
|
||||
})
|
||||
|
||||
const dateFormatterList = [
|
||||
{name: '年', value: 'y'},
|
||||
{name: '年月', value: 'y_M'},
|
||||
{name: '年月日', value: 'y_M_d'}
|
||||
{ name: '年', value: 'y' },
|
||||
{ name: '年月', value: 'y_M' },
|
||||
{ name: '年月日', value: 'y_M_d' }
|
||||
]
|
||||
|
||||
const changeDateFormatter = () => {
|
||||
@ -47,7 +47,7 @@ const changeDateFormatter = () => {
|
||||
if (checkedField && checkedField.length > 0) {
|
||||
checkedField[0].dateStyle = state.dateFormatter
|
||||
if (!compareItem.value.compareCalc.custom) {
|
||||
compareItem.value.compareCalc.custom = {timeType: 'y_M_d'}
|
||||
compareItem.value.compareCalc.custom = { timeType: 'y_M_d' }
|
||||
}
|
||||
compareItem.value.compareCalc.custom.timeType = state.dateFormatter
|
||||
}
|
||||
@ -69,7 +69,7 @@ watch(
|
||||
initCompareType()
|
||||
initDateFormatter()
|
||||
},
|
||||
{deep: true}
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const isIndicator = computed(() => {
|
||||
@ -193,9 +193,8 @@ initDateFormatter()
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('chart.compare_type')">
|
||||
<el-radio-group v-model="compareItem.compareCalc.type">
|
||||
<el-radio v-for="radio in state.compareList" :key="radio.value" :label="radio.value">{{
|
||||
t('chart.' + radio.value)
|
||||
}}
|
||||
<el-radio v-for="radio in state.compareList" :key="radio.value" :label="radio.value"
|
||||
>{{ t('chart.' + radio.value) }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
@ -209,10 +208,10 @@ initDateFormatter()
|
||||
|
||||
<el-form-item :label="t('chart.compare_calc_expression')">
|
||||
<span v-if="compareItem.compareCalc.resultData === 'sub'" class="exp-style"
|
||||
>本期数据 - 上期数据</span
|
||||
>本期数据 - 上期数据</span
|
||||
>
|
||||
<span v-else-if="compareItem.compareCalc.resultData === 'percent'" class="exp-style"
|
||||
>(本期数据 / |上期数据| - 1) * 100%</span
|
||||
>(本期数据 / |上期数据| - 1) * 100%</span
|
||||
>
|
||||
</el-form-item>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user