坐标轴字典更新

qianming 3 years ago
parent ea46ccebbe
commit aa8fba3c33

@ -1,6 +1,7 @@
-- 新增坐标轴字典 -- 新增坐标轴字典
INSERT INTO `aj_report`.`gaea_dict`(`dict_name`,`dict_code`,`remark`) SELECT "XY坐标属性","COORD_PROPERTIES","XY坐标属性" FROM DUAL WHERE NOT EXISTS(SELECT `dict_name`,`dict_code`,`remark` FROM `aj_report`.`gaea_dict` WHERE `dict_name`="XY坐标属性" AND `dict_code`="COORD_PROPERTIES" AND `remark`="XY坐标属性");
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`,`item_name`,`item_value`,`locale`) SELECT "COORD_PROPERTIES","数据","series","zh" FROM DUAL WHERE NOT EXISTS(SELECT `dict_code`,`item_name`,`item_value`,`locale` FROM `aj_report`.`gaea_dict_item` WHERE `dict_code`="COORD_PROPERTIES" AND `item_name`="数据" AND `item_value`="series" AND `locale`="zh"); INSERT INTO `aj_report`.`gaea_dict`(`dict_name`, `dict_code`, `remark`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('XY坐标属性', 'COORD_PROPERTIES', 'XY坐标属性', 'admin', NOW(), 'admin', NOW(), 1);
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`,`item_name`,`item_value`,`locale`) SELECT "COORD_PROPERTIES","X轴","xAxis","zh" FROM DUAL WHERE NOT EXISTS(SELECT `dict_code`,`item_name`,`item_value`,`locale` FROM `aj_report`.`gaea_dict_item` WHERE `dict_code`="COORD_PROPERTIES" AND `item_name`="X轴" AND `item_value`="xAxis" AND `locale`="zh");
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`,`item_name`,`item_value`,`locale`) SELECT "COORD_PROPERTIES","Y轴","yAxis","zh" FROM DUAL WHERE NOT EXISTS(SELECT `dict_code`,`item_name`,`item_value`,`locale` FROM `aj_report`.`gaea_dict_item` WHERE `dict_code`="COORD_PROPERTIES" AND `item_name`="Y轴" AND `item_value`="yAxis" AND `locale`="zh"); INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`, `item_name`, `item_value`, `item_extend`, `enabled`, `locale`, `remark`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('COORD_PROPERTIES', '数据', 'series', NULL, 1, 'zh', NULL, NULL, 'admin', NOW(), 'admin', NOW(), 1);
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`, `item_name`, `item_value`, `item_extend`, `enabled`, `locale`, `remark`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('COORD_PROPERTIES', 'X轴', 'xAxis', NULL, 1, 'zh', NULL, NULL, 'admin', NOW(), 'admin', NOW(), 1);
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`, `item_name`, `item_value`, `item_extend`, `enabled`, `locale`, `remark`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('COORD_PROPERTIES', 'Y轴', 'yAxis', NULL, 1, 'zh', NULL, NULL, 'admin', NOW(), 'admin', NOW(), 1);

@ -109,6 +109,7 @@ export default {
// widget-text 文本框 // widget-text 文本框
// widge-table 表格(数据不要转) // widge-table 表格(数据不要转)
// widget-stackchart 堆叠图 // widget-stackchart 堆叠图
// widget-heatmap 热力图
const chartType = params.chartType const chartType = params.chartType
if ( if (
chartType == "widget-barchart" || chartType == "widget-barchart" ||
@ -125,6 +126,8 @@ export default {
return this.widgettext(params.chartProperties, data) return this.widgettext(params.chartProperties, data)
} else if (chartType == "widget-stackchart") { } else if (chartType == "widget-stackchart") {
return this.stackChartFn(params.chartProperties, data) return this.stackChartFn(params.chartProperties, data)
} else if (chartType == "widget-heatmap") {
return this.heatmapChartFn(params.chartProperties, data)
}else { }else {
return data return data
} }
@ -223,6 +226,20 @@ export default {
} }
return ananysicData; return ananysicData;
}, },
// 坐标系数据解析
heatmapChartFn(chartProperties,data){
const ananysicData = {};
const series = [];
//全部字段字典值
const types = Object.values(chartProperties)
//x轴字段、y轴字段名
const xAxisField = Object.keys(chartProperties)[types.indexOf('xAxis')]
const yAxisField = Object.keys(chartProperties)[types.indexOf('yAxis')]
//x轴数值去重y轴去重
const xAxisList = this.setUnique(data.map(item => item[xAxisField]))
const yAxisList = this.setUnique(data.map(item => item[yAxisField]))
},
setUnique(arr) { setUnique(arr) {
let newArr = []; let newArr = [];
arr.forEach(item => { arr.forEach(item => {

@ -645,7 +645,7 @@ export const widgetHeatmap = {
relactiveDom: 'dataType', relactiveDom: 'dataType',
chartType: 'widget-heatmap', chartType: 'widget-heatmap',
relactiveDomValue: 'dynamicData', relactiveDomValue: 'dynamicData',
dictKey: 'PIE_PROPERTIES', dictKey: 'COORD_PROPERTIES',
value: '', value: '',
}, },
], ],
@ -681,7 +681,7 @@ export const widgetHeatmap = {
name: 'height', name: 'height',
required: false, required: false,
placeholder: '该容器在1080px大屏中的高度', placeholder: '该容器在1080px大屏中的高度',
value: 250, value: 300,
}, },
], ],
} }

Loading…
Cancel
Save