taskid:111 remark:"commit"
This commit is contained in:
@@ -1010,9 +1010,6 @@
|
||||
isClickedPftj.value = false;
|
||||
isClickedTplx.value = true;
|
||||
getCarbonFlowDirection();
|
||||
setTimeout(() => {
|
||||
drawEcharts();
|
||||
}, 500);
|
||||
};
|
||||
// 获取碳排流向数据
|
||||
const queryFlowDirection = ref({
|
||||
@@ -1021,9 +1018,14 @@
|
||||
year: props.year,
|
||||
categoryId: categoryId.value,
|
||||
});
|
||||
const linksData = ref([])
|
||||
const datalist = ref([])
|
||||
const getCarbonFlowDirection = () => {
|
||||
fetch(carbonInventoryCheck.carbonFlowDirection, queryFlowDirection.value).then((res) => {
|
||||
console.log(res);
|
||||
linksData.value = res.data[0]
|
||||
datalist.value = res.data[1]
|
||||
drawEcharts();
|
||||
});
|
||||
};
|
||||
// 获取排放统计数据
|
||||
@@ -1154,133 +1156,6 @@
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const drawEcharts = () => {
|
||||
chartInstance = echarts.init(tplxChart.value);
|
||||
let datalist = [
|
||||
{
|
||||
name: '公共平台',
|
||||
},
|
||||
{
|
||||
name: '系统0000',
|
||||
},
|
||||
{
|
||||
name: '系统0011',
|
||||
},
|
||||
{
|
||||
name: '系统0022',
|
||||
},
|
||||
{
|
||||
name: '系统0033',
|
||||
},
|
||||
{
|
||||
name: '系统0044',
|
||||
},
|
||||
{
|
||||
name: '系统0055',
|
||||
},
|
||||
{
|
||||
name: '系统11',
|
||||
},
|
||||
{
|
||||
name: '系统22',
|
||||
},
|
||||
{
|
||||
name: '系统33',
|
||||
},
|
||||
{
|
||||
name: '系统44',
|
||||
},
|
||||
{
|
||||
name: '系统55',
|
||||
},
|
||||
{
|
||||
name: '系统66',
|
||||
},
|
||||
{
|
||||
name: '系统77',
|
||||
},
|
||||
{
|
||||
name: '系统88',
|
||||
},
|
||||
{
|
||||
name: '系统99',
|
||||
},
|
||||
];
|
||||
let linksData = [
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0000',
|
||||
value: 1044305,
|
||||
},
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0011',
|
||||
value: 651527,
|
||||
},
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0022',
|
||||
value: 651527,
|
||||
},
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0033',
|
||||
value: 486710,
|
||||
},
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0044',
|
||||
value: 212670,
|
||||
},
|
||||
{
|
||||
source: '公共平台',
|
||||
target: '系统0055',
|
||||
value: 210400,
|
||||
},
|
||||
{
|
||||
source: '系统0011',
|
||||
target: '系统11',
|
||||
value: 645246,
|
||||
},
|
||||
{
|
||||
source: '系统0022',
|
||||
target: '系统22',
|
||||
value: 513275,
|
||||
},
|
||||
{
|
||||
source: '系统0011',
|
||||
target: '系统33',
|
||||
value: 282986,
|
||||
},
|
||||
{
|
||||
source: '系统0011',
|
||||
target: '系统44',
|
||||
value: 118655,
|
||||
},
|
||||
{
|
||||
source: '系统0022',
|
||||
target: '系统55',
|
||||
value: 105989,
|
||||
},
|
||||
{
|
||||
source: '系统0022',
|
||||
target: '系统66',
|
||||
value: 95100,
|
||||
},
|
||||
{
|
||||
source: '系统0033',
|
||||
target: '系统77',
|
||||
value: 87796,
|
||||
},
|
||||
{
|
||||
source: '系统0044',
|
||||
target: '系统88',
|
||||
value: 47658,
|
||||
},
|
||||
{
|
||||
source: '系统0055',
|
||||
target: '系统99',
|
||||
value: 243660,
|
||||
},
|
||||
];
|
||||
let Color = [
|
||||
'#61FEFF',
|
||||
'#937FE6',
|
||||
@@ -1337,18 +1212,17 @@
|
||||
];
|
||||
let itemStyleColor = [];
|
||||
let labelSource = [];
|
||||
for (let i = 0; i < datalist.length; i++) {
|
||||
datalist[i].label = {
|
||||
for (let i = 0; i < datalist.value.length; i++) {
|
||||
datalist.value[i].label = {
|
||||
normal: {
|
||||
position: sourceLabel[i],
|
||||
},
|
||||
};
|
||||
labelSource.push(sourceLabel[i]);
|
||||
}
|
||||
for (let d = 0; d < datalist.length; d++) {
|
||||
datalist[d].itemStyle = {
|
||||
for (let d = 0; d < datalist.value.length; d++) {
|
||||
datalist.value[d].itemStyle = {
|
||||
normal: {
|
||||
// color: Color[d]
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
@@ -1369,28 +1243,13 @@
|
||||
},
|
||||
},
|
||||
};
|
||||
itemStyleColor.push(datalist[d]);
|
||||
itemStyleColor.push(datalist.value[d]);
|
||||
}
|
||||
const option = {
|
||||
backgroundColor: 'transparent',
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
triggerOn: 'mousemove',
|
||||
formatter: function (params) {
|
||||
if (params.name == '公共平台') {
|
||||
return ' 公共平台 ';
|
||||
} else {
|
||||
let value = params.data.value;
|
||||
if (!value && value !== 0) return 0;
|
||||
let str = value.toString();
|
||||
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g;
|
||||
if (params.data.source == '公共平台') {
|
||||
return params.data.target + ' : ' + str.replace(reg, '$1,');
|
||||
} else {
|
||||
return params.data.source + ' : ' + str.replace(reg, '$1,');
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -1404,7 +1263,7 @@
|
||||
nodeWidth: 25,
|
||||
focusNodeAdjacency: 'allEdges',
|
||||
data: itemStyleColor,
|
||||
links: linksData,
|
||||
links: linksData.value,
|
||||
label: {
|
||||
normal: {
|
||||
color: '#fff',
|
||||
|
Reference in New Issue
Block a user