2025-10-27 19:10:17 +08:00
|
|
|
|
let table, layer, form, laydate;
|
2025-10-16 16:26:48 +08:00
|
|
|
|
let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff';
|
|
|
|
|
|
|
|
|
|
|
|
const bidCode = parent.$('#bidPro').val();
|
2025-10-18 15:55:58 +08:00
|
|
|
|
layui.use(["layer", "table", "form", "laydate"], function () {
|
2025-10-16 16:26:48 +08:00
|
|
|
|
layer = layui.layer;
|
|
|
|
|
|
table = layui.table;
|
|
|
|
|
|
form = layui.form;
|
|
|
|
|
|
|
2025-10-18 15:55:58 +08:00
|
|
|
|
laydate = layui.laydate;
|
|
|
|
|
|
laydate.render({
|
|
|
|
|
|
elem: "#ID-laydate-rangeLinked",
|
|
|
|
|
|
range: ["#ID-laydate-start-date-1", "#ID-laydate-end-date-1"],
|
|
|
|
|
|
rangeLinked: true, // 开启日期范围选择时的区间联动标注模式 --- 2.8+ 新增
|
|
|
|
|
|
});
|
2025-10-16 16:26:48 +08:00
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
$("#ID-laydate-start-date-1").val(getOneMonthAgo())
|
2025-10-18 15:55:58 +08:00
|
|
|
|
$("#ID-laydate-end-date-1").val(getNowTime())
|
2025-10-16 16:26:48 +08:00
|
|
|
|
|
2025-10-18 15:55:58 +08:00
|
|
|
|
let startTime = "";
|
|
|
|
|
|
let endTime = "";
|
|
|
|
|
|
if ($("#ID-laydate-start-date-1").val() != "") {
|
|
|
|
|
|
startTime = $("#ID-laydate-start-date-1").val();
|
|
|
|
|
|
endTime = $("#ID-laydate-end-date-1").val();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
startTime = "";
|
|
|
|
|
|
endTime = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getEnergyReduction(startTime, endTime)
|
2025-10-27 19:10:17 +08:00
|
|
|
|
//蓄水和用水趋势
|
|
|
|
|
|
getWaterList(startTime, endTime)
|
|
|
|
|
|
//发电和用电趋势
|
|
|
|
|
|
getEnergyList(startTime, endTime)
|
2025-10-16 16:26:48 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-18 15:55:58 +08:00
|
|
|
|
function getEnergyReduction(startTime, endTime) {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl +
|
|
|
|
|
|
"screen/energyReduction/selectEnergyReduction?startTime=" + startTime + "&endTime=" + endTime;
|
|
|
|
|
|
ajaxRequestGet(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
setData(result);
|
2025-10-18 15:55:58 +08:00
|
|
|
|
} else if (result.code === 500) {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
setData(result);
|
2025-10-18 15:55:58 +08:00
|
|
|
|
} else if (result.code === 401) {
|
|
|
|
|
|
loginout(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
function (xhr, status, error) {
|
|
|
|
|
|
errorFn(xhr, status, error);
|
|
|
|
|
|
setData(null);
|
|
|
|
|
|
},
|
|
|
|
|
|
aqEnnable
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/* 实时检测赋值 */
|
|
|
|
|
|
function setData(data) {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
let energyUtilization = data.data.energyUtilization;
|
2025-10-21 13:21:22 +08:00
|
|
|
|
updateCounter("power", energyUtilization);
|
2025-10-27 19:10:17 +08:00
|
|
|
|
let waterUtilization = data.data.waterUtilization;
|
2025-10-21 13:21:22 +08:00
|
|
|
|
updateCounter("water", waterUtilization);
|
2025-10-27 19:10:17 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
layer.msg(data.msg || "暂无数据");
|
|
|
|
|
|
updateCounter("power", "0");
|
|
|
|
|
|
updateCounter("water", "0");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getWaterList(startTime, endTime) {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl +
|
|
|
|
|
|
"screen/energyReduction/getWaterList?startTime=" + startTime + "&endTime=" + endTime;
|
|
|
|
|
|
ajaxRequestGet(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
setData(result);
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
setData(result);
|
|
|
|
|
|
} else if (result.code === 401) {
|
|
|
|
|
|
loginout(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
function (xhr, status, error) {
|
|
|
|
|
|
errorFn(xhr, status, error);
|
|
|
|
|
|
setData(null);
|
|
|
|
|
|
},
|
|
|
|
|
|
aqEnnable
|
|
|
|
|
|
);
|
2025-10-21 13:21:22 +08:00
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function setData(data) {
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
initWaterTrend(data.data.dayList, data.data.ysList, data.data.xsList);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
layer.msg(data.msg || "暂无数据");
|
|
|
|
|
|
initWaterTrend("", "", "");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-21 13:21:22 +08:00
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function getEnergyList(startTime, endTime) {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl +
|
|
|
|
|
|
"screen/energyReduction/getEnergyList?startTime=" + startTime + "&endTime=" + endTime;
|
|
|
|
|
|
ajaxRequestGet(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
setData(result);
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
setData(result);
|
|
|
|
|
|
} else if (result.code === 401) {
|
|
|
|
|
|
loginout(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
function (xhr, status, error) {
|
|
|
|
|
|
errorFn(xhr, status, error);
|
|
|
|
|
|
setData(null);
|
|
|
|
|
|
},
|
|
|
|
|
|
aqEnnable
|
|
|
|
|
|
);
|
2025-10-18 15:55:58 +08:00
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function setData(data) {
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
initPowerTrend(data.data.dayList, data.data.fdList, data.data.ydList);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
layer.msg(data.msg || "暂无数据");
|
|
|
|
|
|
initPowerTrend("", "", "");
|
2025-10-18 15:55:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function query() {
|
|
|
|
|
|
let startTime = "";
|
|
|
|
|
|
let endTime = "";
|
|
|
|
|
|
if ($("#ID-laydate-start-date-1").val() != "") {
|
|
|
|
|
|
startTime = $("#ID-laydate-start-date-1").val();
|
|
|
|
|
|
endTime = $("#ID-laydate-end-date-1").val();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
startTime = "";
|
|
|
|
|
|
endTime = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
getEnergyReduction(startTime, endTime);
|
|
|
|
|
|
//蓄水和用水趋势
|
|
|
|
|
|
getWaterList(startTime, endTime)
|
|
|
|
|
|
//发电和用电趋势
|
|
|
|
|
|
getEnergyList(startTime, endTime)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-21 13:21:22 +08:00
|
|
|
|
function updateCounter(prefix, value) {
|
|
|
|
|
|
// 确保值在有效范围内
|
|
|
|
|
|
const numValue = Math.max(0, Math.min(9999, parseInt(value) || 0));
|
|
|
|
|
|
|
|
|
|
|
|
// 转换为4位数字字符串,不足4位用0补全
|
|
|
|
|
|
const paddedValue = String(numValue).padStart(4, '0');
|
|
|
|
|
|
|
|
|
|
|
|
// 更新每个数字显示
|
|
|
|
|
|
for (let i = 0; i < 4; i++) {
|
|
|
|
|
|
const digitElement = document.getElementById(`${prefix}-${i}`);
|
|
|
|
|
|
if (digitElement) {
|
|
|
|
|
|
digitElement.textContent = paddedValue[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function getWaterTrend(water, waterStorage) {
|
|
|
|
|
|
let date = [];
|
2025-10-21 13:21:22 +08:00
|
|
|
|
let waterDataNum = [];
|
|
|
|
|
|
let waterStorageDataNum = [];
|
|
|
|
|
|
for (let i = 0; i < water.length; i++) {
|
|
|
|
|
|
date.push(water[i].date);
|
|
|
|
|
|
waterDataNum.push(water[i].num);
|
|
|
|
|
|
waterStorageDataNum.push(waterStorage[i].num);
|
|
|
|
|
|
}
|
|
|
|
|
|
initWaterTrend(date, waterDataNum, waterStorageDataNum);
|
2025-10-16 16:26:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function initWaterTrend(date, waterDataNum, waterStorageDataNum) {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
const leftChart = echarts.init(document.getElementById("waterTrend"));
|
2025-10-27 19:10:17 +08:00
|
|
|
|
const option = {
|
2025-10-16 16:26:48 +08:00
|
|
|
|
tooltip: {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
show: true,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
trigger: 'axis',
|
|
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: 'shadow',
|
|
|
|
|
|
},
|
|
|
|
|
|
borderColor: 'rgba(255,255,255,.3)',
|
|
|
|
|
|
backgroundColor: 'rgba(19,51,55,.6)',
|
2025-10-16 16:26:48 +08:00
|
|
|
|
textStyle: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: 'white', //设置文字颜色
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
padding: 10,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
legend: {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
top: 40,
|
|
|
|
|
|
right: 20,
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: '#ffffff'
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
grid: {
|
|
|
|
|
|
top: '30%',
|
|
|
|
|
|
left: '8%',
|
|
|
|
|
|
right: '4%',
|
|
|
|
|
|
bottom: '15%'
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
xAxis: [
|
2025-10-16 16:26:48 +08:00
|
|
|
|
{
|
2025-10-21 13:21:22 +08:00
|
|
|
|
type: 'category',
|
|
|
|
|
|
boundaryGap: true,
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
//坐标轴轴线相关设置。数学上的x轴
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: '#5A6E71',
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
axisLabel: {
|
|
|
|
|
|
//坐标轴刻度标签的相关设置
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: fontColor,
|
|
|
|
|
|
fontSize: fontSize,
|
|
|
|
|
|
fontFamily: fontFamily
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
splitLine: {
|
2025-10-16 16:26:48 +08:00
|
|
|
|
show: false,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: '#233653',
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: true,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
data: date,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
],
|
2025-10-21 13:21:22 +08:00
|
|
|
|
yAxis: [{
|
|
|
|
|
|
min: 0,
|
|
|
|
|
|
splitNumber: 10,
|
|
|
|
|
|
splitLine: {
|
|
|
|
|
|
show: true,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
lineStyle: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: 'rgba(255,255,255,0.6)',
|
|
|
|
|
|
type: 'dashed',
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLabel: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: 'rgba(255,255,255,0.8)',
|
|
|
|
|
|
padding: 16
|
|
|
|
|
|
},
|
2025-10-27 19:10:17 +08:00
|
|
|
|
formatter: function (value) {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
if (value === 0) {
|
|
|
|
|
|
return value
|
|
|
|
|
|
}
|
|
|
|
|
|
return value
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}],
|
|
|
|
|
|
"dataZoom": [{
|
|
|
|
|
|
"show": true,
|
|
|
|
|
|
"height": 12,
|
|
|
|
|
|
"xAxisIndex": [
|
|
|
|
|
|
0
|
|
|
|
|
|
],
|
2025-10-27 19:10:17 +08:00
|
|
|
|
bottom: '8%',
|
2025-10-21 13:21:22 +08:00
|
|
|
|
"start": 10,
|
|
|
|
|
|
"end": 90,
|
|
|
|
|
|
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
|
|
|
|
|
|
handleSize: '110%',
|
2025-10-27 19:10:17 +08:00
|
|
|
|
handleStyle: {
|
|
|
|
|
|
color: "#d3dee5",
|
2025-10-21 13:21:22 +08:00
|
|
|
|
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-27 19:10:17 +08:00
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: "#fff"
|
|
|
|
|
|
},
|
|
|
|
|
|
borderColor: "#90979c"
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
"type": "inside",
|
|
|
|
|
|
"show": true,
|
|
|
|
|
|
"height": 15,
|
|
|
|
|
|
"start": 1,
|
|
|
|
|
|
"end": 35
|
|
|
|
|
|
}],
|
|
|
|
|
|
series: [{
|
|
|
|
|
|
name: '用水量',
|
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
symbol: 'circle',
|
|
|
|
|
|
showAllSymbol: true,
|
|
|
|
|
|
symbolSize: 0,
|
|
|
|
|
|
smooth: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
normal: {
|
2025-10-16 16:26:48 +08:00
|
|
|
|
width: 2,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: "#00FEFC",
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: "#00FEFC",
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
show: true
|
|
|
|
|
|
},
|
|
|
|
|
|
areaStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
color: "rgba(18,86,100,0.6)"
|
|
|
|
|
|
},
|
2025-10-16 16:26:48 +08:00
|
|
|
|
{
|
|
|
|
|
|
offset: 1,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: "rgba(16,72,81, 0.7)"
|
|
|
|
|
|
}
|
|
|
|
|
|
], false),
|
|
|
|
|
|
shadowColor: 'rgba(15,55,63, 0.8)',
|
|
|
|
|
|
shadowBlur: 20
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
data: waterDataNum
|
|
|
|
|
|
}, {
|
|
|
|
|
|
name: '蓄水量',
|
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
symbol: 'circle',
|
|
|
|
|
|
showAllSymbol: true,
|
|
|
|
|
|
symbolSize: 0,
|
|
|
|
|
|
smooth: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
width: 2,
|
|
|
|
|
|
color: "rgba(25,196,134, 1)",
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: "rgba(25,196,134, 1)",
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
tooltip: {
|
|
|
|
|
|
show: true
|
|
|
|
|
|
},
|
|
|
|
|
|
areaStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
color: "rgba(17,95,82, 0.6)"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
color: "rgba(16,72,67, 0.7)"
|
|
|
|
|
|
}
|
|
|
|
|
|
], false),
|
|
|
|
|
|
shadowColor: 'rgba(15,55,54, 0.8)',
|
|
|
|
|
|
shadowBlur: 20
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data: waterStorageDataNum
|
|
|
|
|
|
}]
|
|
|
|
|
|
};
|
2025-10-16 16:26:48 +08:00
|
|
|
|
|
2025-10-21 13:21:22 +08:00
|
|
|
|
leftChart.setOption(option);
|
|
|
|
|
|
// 响应式调整
|
|
|
|
|
|
window.addEventListener("resize", function () {
|
|
|
|
|
|
leftChart.resize();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function getPowerTrend(power, usePower) {
|
|
|
|
|
|
let date = [];
|
2025-10-21 13:21:22 +08:00
|
|
|
|
let powerDataNum = [];
|
|
|
|
|
|
let usePowerDataNum = [];
|
|
|
|
|
|
for (let i = 0; i < power.length; i++) {
|
|
|
|
|
|
date.push(power[i].date);
|
|
|
|
|
|
powerDataNum.push(power[i].num);
|
|
|
|
|
|
usePowerDataNum.push(usePower[i].num);
|
|
|
|
|
|
}
|
|
|
|
|
|
initPowerTrend(date, powerDataNum, usePowerDataNum);
|
2025-10-16 16:26:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 19:10:17 +08:00
|
|
|
|
function initPowerTrend(date, powerDataNum, usePowerDataNum) {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
const leftChart = echarts.init(document.getElementById("powerTrend"));
|
2025-10-27 19:10:17 +08:00
|
|
|
|
const option = {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
tooltip: {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
show: true,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
trigger: 'axis',
|
|
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: 'shadow',
|
|
|
|
|
|
},
|
|
|
|
|
|
borderColor: 'rgba(255,255,255,.3)',
|
|
|
|
|
|
backgroundColor: 'rgba(19,51,55,.6)',
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: 'white', //设置文字颜色
|
|
|
|
|
|
},
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
padding: 10,
|
|
|
|
|
|
},
|
|
|
|
|
|
legend: {
|
2025-10-27 19:10:17 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
top: 40,
|
|
|
|
|
|
right: 20,
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: '#ffffff'
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-10-16 16:26:48 +08:00
|
|
|
|
grid: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
top: '30%',
|
|
|
|
|
|
left: '8%',
|
|
|
|
|
|
right: '4%',
|
|
|
|
|
|
bottom: '15%'
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
xAxis: [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'category',
|
|
|
|
|
|
boundaryGap: true,
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
//坐标轴轴线相关设置。数学上的x轴
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: '#5A6E71',
|
|
|
|
|
|
},
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
axisLabel: {
|
|
|
|
|
|
//坐标轴刻度标签的相关设置
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: fontColor,
|
|
|
|
|
|
fontSize: fontSize,
|
|
|
|
|
|
fontFamily: fontFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
splitLine: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: '#233653',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
data: date,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
],
|
|
|
|
|
|
yAxis: [{
|
|
|
|
|
|
min: 0,
|
|
|
|
|
|
splitNumber: 10,
|
2025-10-16 16:26:48 +08:00
|
|
|
|
splitLine: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: 'rgba(255,255,255,0.6)',
|
|
|
|
|
|
type: 'dashed',
|
|
|
|
|
|
},
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLabel: {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: 'rgba(255,255,255,0.8)',
|
|
|
|
|
|
padding: 16
|
|
|
|
|
|
},
|
2025-10-27 19:10:17 +08:00
|
|
|
|
formatter: function (value) {
|
2025-10-21 13:21:22 +08:00
|
|
|
|
if (value === 0) {
|
|
|
|
|
|
return value
|
|
|
|
|
|
}
|
|
|
|
|
|
return value
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}],
|
|
|
|
|
|
"dataZoom": [{
|
|
|
|
|
|
"show": true,
|
|
|
|
|
|
"height": 12,
|
|
|
|
|
|
"xAxisIndex": [
|
|
|
|
|
|
0
|
|
|
|
|
|
],
|
2025-10-27 19:10:17 +08:00
|
|
|
|
bottom: '8%',
|
2025-10-21 13:21:22 +08:00
|
|
|
|
"start": 10,
|
|
|
|
|
|
"end": 90,
|
|
|
|
|
|
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
|
|
|
|
|
|
handleSize: '110%',
|
2025-10-27 19:10:17 +08:00
|
|
|
|
handleStyle: {
|
|
|
|
|
|
color: "#d3dee5",
|
2025-10-21 13:21:22 +08:00
|
|
|
|
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-27 19:10:17 +08:00
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: "#fff"
|
|
|
|
|
|
},
|
|
|
|
|
|
borderColor: "#90979c"
|
2025-10-21 13:21:22 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
"type": "inside",
|
|
|
|
|
|
"show": true,
|
|
|
|
|
|
"height": 15,
|
|
|
|
|
|
"start": 1,
|
|
|
|
|
|
"end": 35
|
|
|
|
|
|
}],
|
|
|
|
|
|
series: [{
|
|
|
|
|
|
name: '发电量',
|
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
symbol: 'circle',
|
|
|
|
|
|
showAllSymbol: true,
|
|
|
|
|
|
symbolSize: 0,
|
|
|
|
|
|
smooth: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
normal: {
|
2025-10-16 16:26:48 +08:00
|
|
|
|
width: 2,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: "#00FEFC",
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: "#00FEFC",
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
show: true
|
|
|
|
|
|
},
|
|
|
|
|
|
areaStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
color: "rgba(18,86,100,0.6)"
|
|
|
|
|
|
},
|
2025-10-16 16:26:48 +08:00
|
|
|
|
{
|
|
|
|
|
|
offset: 1,
|
2025-10-21 13:21:22 +08:00
|
|
|
|
color: "rgba(16,72,81, 0.7)"
|
|
|
|
|
|
}
|
|
|
|
|
|
], false),
|
|
|
|
|
|
shadowColor: 'rgba(15,55,63, 0.8)',
|
|
|
|
|
|
shadowBlur: 20
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
data: powerDataNum
|
|
|
|
|
|
}, {
|
|
|
|
|
|
name: '用电量',
|
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
symbol: 'circle',
|
|
|
|
|
|
showAllSymbol: true,
|
|
|
|
|
|
symbolSize: 0,
|
|
|
|
|
|
smooth: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
width: 2,
|
|
|
|
|
|
color: "rgba(25,196,134, 1)",
|
|
|
|
|
|
}
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: "rgba(25,196,134, 1)",
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
|
2025-10-16 16:26:48 +08:00
|
|
|
|
},
|
2025-10-21 13:21:22 +08:00
|
|
|
|
tooltip: {
|
|
|
|
|
|
show: true
|
|
|
|
|
|
},
|
|
|
|
|
|
areaStyle: {
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
color: "rgba(17,95,82, 0.6)"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
color: "rgba(16,72,67, 0.7)"
|
|
|
|
|
|
}
|
|
|
|
|
|
], false),
|
|
|
|
|
|
shadowColor: 'rgba(15,55,54, 0.8)',
|
|
|
|
|
|
shadowBlur: 20
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data: usePowerDataNum
|
|
|
|
|
|
}]
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
leftChart.setOption(option);
|
|
|
|
|
|
// 响应式调整
|
|
|
|
|
|
window.addEventListener("resize", function () {
|
|
|
|
|
|
leftChart.resize();
|
|
|
|
|
|
});
|
2025-10-16 16:26:48 +08:00
|
|
|
|
}
|
2025-10-21 13:21:22 +08:00
|
|
|
|
|