[Frontend] 修改 dashbord 儀表版內容 | 歷史數據查詢月 input 應該只顯示到月
This commit is contained in:
parent
3751a21273
commit
a1b7d9333b
@ -199,7 +199,7 @@
|
|||||||
class="panel"
|
class="panel"
|
||||||
style="height: calc(100% - 1.5rem)">
|
style="height: calc(100% - 1.5rem)">
|
||||||
<div class="panel-hdr">
|
<div class="panel-hdr">
|
||||||
<h2>即時契約容量占比 - 第一校區</h2>
|
<h2>即時契約容量占比 - 第一校區 <span id="contractCapacityForArea1">--</span></h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-container show h-100">
|
<div class="panel-container show h-100">
|
||||||
<div id="contractValueChart" style="height: 240px"></div>
|
<div id="contractValueChart" style="height: 240px"></div>
|
||||||
@ -211,7 +211,7 @@
|
|||||||
class="panel"
|
class="panel"
|
||||||
style="height: calc(100% - 1.5rem)">
|
style="height: calc(100% - 1.5rem)">
|
||||||
<div class="panel-hdr">
|
<div class="panel-hdr">
|
||||||
<h2>即時契約容量占比 - 第二校區</h2>
|
<h2>即時契約容量占比 - 第二校區 <span id="contractCapacityForArea2">--</span></</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-container h-100 show">
|
<div class="panel-container h-100 show">
|
||||||
<div id="contractValueChart2" style="height: 240px"></div>
|
<div id="contractValueChart2" style="height: 240px"></div>
|
||||||
@ -469,9 +469,11 @@
|
|||||||
({ point_name }) => point_name === "Capacity"
|
({ point_name }) => point_name === "Capacity"
|
||||||
)?.value;
|
)?.value;
|
||||||
}
|
}
|
||||||
|
$("#contractCapacityForArea1").text(` (${contractCapacityForchart1} kW)`);
|
||||||
chartContractValue(
|
chartContractValue(
|
||||||
"contractValueChart",
|
"contractValueChart",
|
||||||
((value / contractCapacityForchart1) * 100).roundDecimal(2)
|
Math.round((value / contractCapacityForchart1) * 100),
|
||||||
|
value
|
||||||
);
|
);
|
||||||
} else if (value && compus === "Area2") {
|
} else if (value && compus === "Area2") {
|
||||||
if (data.some(({ point_name }) => point_name === "Capacity")) {
|
if (data.some(({ point_name }) => point_name === "Capacity")) {
|
||||||
@ -479,9 +481,11 @@
|
|||||||
({ point_name }) => point_name === "Capacity"
|
({ point_name }) => point_name === "Capacity"
|
||||||
)?.value;
|
)?.value;
|
||||||
}
|
}
|
||||||
|
$("#contractCapacityForArea2").text(` (${contractCapacityForchart2} kW)`);
|
||||||
chartContractValue(
|
chartContractValue(
|
||||||
"contractValueChart2",
|
"contractValueChart2",
|
||||||
((value / contractCapacityForchart2) * 100).roundDecimal(2)
|
Math.round((value / contractCapacityForchart2) * 100),
|
||||||
|
value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1121,7 +1125,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 圖表 - 取得契約容量
|
// 圖表 - 取得契約容量
|
||||||
function chartContractValue(ele, value) {
|
function chartContractValue(ele, value, pValue) {
|
||||||
var chartDom = document.getElementById(ele);
|
var chartDom = document.getElementById(ele);
|
||||||
contractValueChart = echarts.init(chartDom, null, {
|
contractValueChart = echarts.init(chartDom, null, {
|
||||||
renderer: "canvas",
|
renderer: "canvas",
|
||||||
@ -1132,6 +1136,9 @@
|
|||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: "gauge",
|
type: "gauge",
|
||||||
|
//startAngle: 180,
|
||||||
|
//endAngle: 0,
|
||||||
|
//center: ['50%', '60%'],
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 30,
|
width: 30,
|
||||||
@ -1171,13 +1178,13 @@
|
|||||||
},
|
},
|
||||||
detail: {
|
detail: {
|
||||||
valueAnimation: true,
|
valueAnimation: true,
|
||||||
formatter: "{value} %",
|
formatter: (value) => { return `\t\n ${value} % \t\n ${Math.round(pValue)} kW` },
|
||||||
color: "inherit",
|
color: "inherit",
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value,
|
value
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
name="date"
|
name="date"
|
||||||
value="" />
|
value="" />
|
||||||
<input class="form-control flatpickr flatpickr-input selectDate"
|
<input class="form-control flatpickr flatpickr-input selectMonth"
|
||||||
id="getmonth"
|
id="getmonth"
|
||||||
type="month"
|
type="month"
|
||||||
style="display: none" />
|
style="display: none" />
|
||||||
@ -120,6 +120,7 @@
|
|||||||
hisFirst = true;
|
hisFirst = true;
|
||||||
$(function () {
|
$(function () {
|
||||||
flatpickr(".selectDate", {});
|
flatpickr(".selectDate", {});
|
||||||
|
flatpickr(".selectMonth", { dateFormat: "Y-m", });
|
||||||
let html = "";
|
let html = "";
|
||||||
for (let building of pageAct.buildList) {
|
for (let building of pageAct.buildList) {
|
||||||
html += `<label class="btn btn-secondary">
|
html += `<label class="btn btn-secondary">
|
||||||
|
Loading…
Reference in New Issue
Block a user