mirror of
https://gitee.com/anji-plus/report.git
synced 2026-03-20 09:38:35 +08:00
气泡地图支持动态数据
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
字典更新
|
||||
*/
|
||||
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 ('CHART_PROPERTIES', '地图地名', 'name', NULL, 1, 'zh', NULL, 10, '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 ('CHART_PROPERTIES', '地图数值', 'value', NULL, 1, 'zh', NULL, 10, 'admin', now(), 'admin', now(), 1);
|
||||
UPDATE `aj_report`.`gaea_dict_item` SET `dict_code` = 'CHART_PROPERTIES', `item_name` = '饼图/仪表盘/气泡地图name', `item_value` = 'name', `item_extend` = NULL, `enabled` = 1, `locale` = 'zh', `remark` = NULL, `sort` = 8, `create_by` = 'admin', `create_time` = '2021-04-29 10:48:43', `update_by` = 'admin', `update_time` = '2021-04-29 10:48:50', `version` = 1 WHERE `id` = 263;
|
||||
UPDATE `aj_report`.`gaea_dict_item` SET `dict_code` = 'CHART_PROPERTIES', `item_name` = '饼图/仪表盘/气泡地图value', `item_value` = 'value', `item_extend` = NULL, `enabled` = 1, `locale` = 'zh', `remark` = NULL, `sort` = 9, `create_by` = 'admin', `create_time` = '2021-04-29 10:48:43', `update_by` = 'admin', `update_time` = '2021-04-29 10:48:50', `version` = 1 WHERE `id` = 264;
|
||||
|
||||
@@ -156,7 +156,6 @@ export default {
|
||||
}
|
||||
ananysicData["xAxis"] = xAxisList;
|
||||
ananysicData["series"] = series;
|
||||
// console.log(ananysicData, '结果数据')
|
||||
return ananysicData;
|
||||
},
|
||||
// 饼图或者空心饼图或者漏斗图
|
||||
@@ -174,7 +173,6 @@ export default {
|
||||
}
|
||||
ananysicData.push(obj);
|
||||
}
|
||||
// console.log(ananysicData, '结果数据')
|
||||
return ananysicData;
|
||||
},
|
||||
gaugeFn(chartProperties, data) {
|
||||
@@ -194,7 +192,6 @@ export default {
|
||||
}
|
||||
ananysicData.push(obj);
|
||||
}
|
||||
// console.log(ananysicData, '结果数据')
|
||||
return ananysicData[0];
|
||||
},
|
||||
widgettext(chartProperties, data) {
|
||||
@@ -204,7 +201,6 @@ export default {
|
||||
for (const key in chartProperties) {
|
||||
const value = chartProperties[key];
|
||||
if (value === "name") {
|
||||
//obj["name"] = data[i][key];
|
||||
} else {
|
||||
obj["value"] = data[i][key];
|
||||
}
|
||||
|
||||
@@ -5889,12 +5889,20 @@ const widgetTools = [
|
||||
list: [
|
||||
{
|
||||
type: 'el-input-number',
|
||||
label: '气泡大小',
|
||||
name: 'fontAirSize',
|
||||
label: '最小半径',
|
||||
name: 'fontminSize4Pin',
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value: 20,
|
||||
},
|
||||
{
|
||||
type: 'el-input-number',
|
||||
label: '最大半径',
|
||||
name: 'fontmaxSize4Pin',
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value: 100,
|
||||
},
|
||||
/*{
|
||||
type: 'vue-color',
|
||||
label: '气泡颜色',
|
||||
|
||||
@@ -403,7 +403,7 @@ export default {
|
||||
editorOptions() {
|
||||
this.setOptionsTitle();
|
||||
this.setOptionTextValue();
|
||||
this.setOptionDataValue();
|
||||
//this.setOptionDataValue();
|
||||
this.setOptionsData();
|
||||
this.setOptionAirSize();
|
||||
this.setOptionMapBlocak();
|
||||
@@ -440,27 +440,6 @@ export default {
|
||||
};
|
||||
label['normal'] = normal;
|
||||
},
|
||||
setOptionDataValue() {
|
||||
const optionsSetup = this.optionsSetup;
|
||||
const label = this.options.series[1]['label'];
|
||||
const normal = {
|
||||
show: true,
|
||||
color: '#fff',
|
||||
fontWeight: 'bold',
|
||||
position: 'inside',
|
||||
formatter: function (para) {
|
||||
return '{cnNum|' + para.data.value[2] + '}'
|
||||
},
|
||||
rich: {
|
||||
cnNum: {
|
||||
fontSize: optionsSetup.fontDataSize,
|
||||
color: optionsSetup.fontDataColor,
|
||||
fontWeight: optionsSetup.fontDataWeight,
|
||||
}
|
||||
}
|
||||
};
|
||||
label['normal'] = normal;
|
||||
},
|
||||
setOptionMapBlocak() {
|
||||
const optionsSetup = this.optionsSetup;
|
||||
const itemStyle = this.options.series[0]['itemStyle'];
|
||||
@@ -483,7 +462,8 @@ export default {
|
||||
itemStyle['emphasis'] = emphasis;
|
||||
},
|
||||
setOptionAirSize() {
|
||||
minSize4Pin = this.optionsSetup.fontAirSize
|
||||
maxSize4Pin = this.optionsSetup.fontmaxSize4Pin
|
||||
minSize4Pin = this.optionsSetup.fontminSize4Pin
|
||||
},
|
||||
//数据解析
|
||||
setOptionsData() {
|
||||
@@ -496,10 +476,28 @@ export default {
|
||||
);
|
||||
},
|
||||
staticDataFn(val) {
|
||||
const serise1 = this.options.series[1];
|
||||
serise1['data'] = convertData(val)
|
||||
const serise = this.options.series[0];
|
||||
serise['data'] = val
|
||||
this.options.series[0]['data'] = val;
|
||||
const optionsSetup = this.optionsSetup;
|
||||
const label = this.options.series[1]['label'];
|
||||
const normal = {
|
||||
show: true,
|
||||
color: '#fff',
|
||||
fontWeight: 'bold',
|
||||
position: 'inside',
|
||||
formatter: function (para) {
|
||||
return '{cnNum|' + para.data.value[2] + '}'
|
||||
},
|
||||
rich: {
|
||||
cnNum: {
|
||||
fontSize: optionsSetup.fontDataSize,
|
||||
color: optionsSetup.fontDataColor,
|
||||
fontWeight: optionsSetup.fontDataWeight,
|
||||
}
|
||||
}
|
||||
};
|
||||
const data = convertData(val);
|
||||
this.options.series[1]['data']=data
|
||||
label['normal'] = normal
|
||||
},
|
||||
dynamicDataFn(val, refreshTime) {
|
||||
if (!val) return;
|
||||
@@ -519,11 +517,28 @@ export default {
|
||||
});
|
||||
},
|
||||
renderingFn(val) {
|
||||
for (const key in this.options.series) {
|
||||
if (this.options.series[key].type == "china") {
|
||||
this.options.series[key].data = val;
|
||||
this.options.series[0]['data'] = val;
|
||||
const optionsSetup = this.optionsSetup;
|
||||
const label = this.options.series[1]['label'];
|
||||
const normal = {
|
||||
show: true,
|
||||
color: '#fff',
|
||||
fontWeight: 'bold',
|
||||
position: 'inside',
|
||||
formatter: function (para) {
|
||||
return '{cnNum|' + para.data.value[2] + '}'
|
||||
},
|
||||
rich: {
|
||||
cnNum: {
|
||||
fontSize: optionsSetup.fontDataSize,
|
||||
color: optionsSetup.fontDataColor,
|
||||
fontWeight: optionsSetup.fontDataWeight,
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const data = convertData(val);
|
||||
this.options.series[1]['data']=data
|
||||
label['normal'] = normal
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user