<template>
|
<div class="chengBenFenXi">
|
<el-tabs @tab-click="tabClick" v-model="state.m_activeName" type="border-card">
|
<el-tab-pane name="tabParas" :label="t('LCC.Analysis.TR')" ref="elTabPane">
|
<div class="div_tr">
|
<div class="div_box">
|
<div class="div_box_title">
|
<div style="
|
width: 100%;
|
height: 100%;
|
display: flex;
|
justify-content: space-between;
|
position: relative;
|
">
|
<span>{{ t("LCC.workingPointFlow.TR")
|
}}<i style="margin-left: 0.2rem" @click="addTr" class="iconfont icontianjia1"></i></span>
|
<div style="width: 30%; margin-right: 0.1rem">
|
<select style="width: 100%; font-family: 'Source Han Sans'" v-model="state.m_selWrkStatusType"
|
@change="changeSelectWorkStatusType">
|
<option v-for="item in state.m_workStatusList" :key="item.value" :value="item.value">
|
{{ item.label }}
|
</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
<div class="div_box_content">
|
<table style="width: 100%">
|
<thead class="table_head">
|
<tr>
|
<th>{{ t("LCC.status.TR") }}</th>
|
<th>{{ t("LCC.flowRatio.TR") }}(%)</th>
|
<th>{{ t("LCC.timeScale.TR") }}(%)</th>
|
</tr>
|
</thead>
|
<tbody id="pumpStatusTableBody">
|
<tr v-for="(item, index) in state.m_runStatusList" :key="index">
|
<td>{{ item.Name }}</td>
|
<td>
|
<input type="number" v-model="item.FlowRatio" onblur class="pump_flow" />
|
</td>
|
<td style="position: relative">
|
<input type="number" v-model="item.TimeRatio" onblur class="pump_time pump_timebili" />
|
<i v-if="item.close" @click="closeTr(index)" class="closeTr el-icon-close"></i>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
<div class="div_box">
|
<div class="div_box_title">{{ t("LCC.energyCosts.TR") }}</div>
|
<div class="div_box_content">
|
<div class="div_box_content_group">
|
<label class="pump_label" id="GongZuoTianShiLabel">{{
|
t("LCC.workingDays.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.gzts" class="pump_time" />
|
</div>
|
<label class="pump_label" id="GongZuoXiaoShiLabel">{{
|
t("LCC.workingHours.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.gzxs" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="DianFeilabel">{{ t("LCC.powerFees.TR") }}({{ t("LCC.per.TR") }})</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.df" class="pump_time" />
|
</div>
|
<label class="pump_label">{{ t("LCC.risiPowerPrice.TR") }}({{
|
t("LCC.year.TR")
|
}})</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.dfsz" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="ZhouQilabel">{{ t("LCC.CalcCycle.TR") }}({{ t("LCC.year.TR") }})</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.jszq" class="pump_time" />
|
</div>
|
<label class="pump_label">{{ t("LCC.interestRate.TR") }}(%)</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.lilv" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="XiaoLvXiaJianglabel">{{ t("LCC.droop.TR") }}(%{{ t("LCC.year.TR")
|
}})</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.xlxj" class="pump_time" />
|
</div>
|
<label class="pump_label">{{ t("LCC.co2Ratio.TR") }}(KW/Kg)</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.co2xs" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="nhcbmeixs">{{ t("LCC.conversionFactor.TR") }}({{
|
t("LCC.tonAndkW.TR")
|
}})</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.nhcb.meixs" class="pump_time" />
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="div_tr">
|
<div style="height: 1.8rem" class="div_box">
|
<div class="div_box_title">
|
{{ t("LCC.maintenanceCost.TR") }} ({{ t("LCC.thousand.TR") }}/{{
|
t("LCC.eachYear.TR")
|
}})
|
</div>
|
<div class="div_box_content">
|
<div class="div_box_content_group">
|
<label class="pump_label" id="WeiHuWeiXiulabel">{{
|
t("LCC.maintenance.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.whwxcb.whhxl" class="pump_time" />
|
</div>
|
<label class="pump_label" id="YunXingFeilabel">{{
|
t("LCC.runningCost.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.whwxcb.yxfy" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="SunHaolabel">{{
|
t("LCC.downtimeAndLoss.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.whwxcb.sctghsh" class="pump_time" />
|
</div>
|
<label class="pump_label" id="HuanJinglabel">{{
|
t("LCC.environmentalFee.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.whwxcb.hjbhf" class="pump_time" />
|
</div>
|
</div>
|
<div class="div_box_content_group">
|
<label class="pump_label" id="QiTalabel">{{
|
t("LCC.othersFee.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.whwxcb.qtnfy" class="pump_time" />
|
</div>
|
</div>
|
</div>
|
</div>
|
<div style="width: calc(50% - 0.1rem)">
|
<div style="height: 1rem; width: 100%; margin-left: -0.02rem" class="div_box">
|
<div class="div_box_title">
|
{{ t("LCC.initialCost.TR") }} ({{ t("LCC.thousand.TR") }})
|
</div>
|
<div class="div_box_content">
|
<div class="div_box_content_group">
|
<label class="pump_label" id="ChuShiTouZilabel">{{
|
t("LCC.orderCost.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.cscb.sbcgfy" class="pump_time" />
|
</div>
|
<label class="pump_label" id="AnZhuangTiaoShilabel">{{
|
t("LCC.installDebugCharge.TR")
|
}}</label>
|
<div class="pump_value">
|
<input type="number" v-model="state.cscb.azhtsfy" class="pump_time" />
|
</div>
|
</div>
|
</div>
|
</div>
|
<el-button class="btn_color" style="margin-top: 0.1rem" @click="clickAnaCostMoneyBtn">{{ t("LCC.Analysis.TR")
|
}}</el-button>
|
</div>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane name="tabResult" :disabled="state.tabIsClick" :label="t('LCC.mapOfCosts.TR')">
|
<div style="display: flex; height: 100%; width: 100%">
|
<el-table :data="state.moneyComponentList" stripe :border="true" :cell-style="rowClass"
|
:header-cell-style="rowClass" style="width: 30%">
|
<el-table-column prop="name" :label="t('LCC.costItem.TR')"></el-table-column>
|
<el-table-column width="80" prop="value" :label="t('LCC.cost.TR')"></el-table-column>
|
<el-table-column width="100" prop="per" :label="t('LCC.percentage.TR')"></el-table-column>
|
</el-table>
|
<div id="echart_pie_box"></div>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane name="four" :disabled="state.tabIsClick" :label="t('LCC.accumulationCurve.TR')">
|
<div style="display: flex; height: 100%; width: 100%">
|
<el-table :data="state.chartDataLeiJiTable" stripe :border="true" style="width: 30%"
|
:height="state.chartDataTableHeight" :cell-style="rowClass" :header-cell-style="rowClass">
|
<el-table-column width="60" prop="year" :label="t('LCC.year.TR')"></el-table-column>
|
<el-table-column prop="feiyong" :label="t('LCC.cost.TR')"></el-table-column>
|
<el-table-column prop="co2" :label="t('LCC.co2.TR')"></el-table-column>
|
<el-table-column prop="ljyml" :label="t('LCC.coalConsumption.TR')"></el-table-column>
|
</el-table>
|
<div style="width: 70%; height: 100%" id="echart_box_fyqx"></div>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane name="five" :disabled="state.tabIsClick" :label="t('LCC.statisticalChart.TR')">
|
<div style="width: 100%; height: 100%" id="echart_box_dntj"></div>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</template>
|
|
<script setup name="chengbenfenxi">
|
import { reactive, shallowRef, ref, onMounted, nextTick } from "vue";
|
import UnitHelper from "@/utils/unit.js";
|
import { useI18n } from 'vue-i18n'
|
import echarts from '@/utils/echarts.js';
|
import { ElMessage, ElTabs, ElTabPane, ElTable, ElTableColumn, ElButton, } from "element-plus";
|
const { t } = useI18n()
|
let m_chartPie = shallowRef(null);
|
let m_chartCost = shallowRef(null);
|
let m_chartYear = shallowRef(null);
|
const colors = [
|
"#FF0000",
|
"#0000FF",
|
"#6AAA6A",
|
"#A52A2A",
|
"#1E90FF",
|
"#FF00FF",
|
"#434384",
|
"#800000",
|
"#7FFFD4",
|
"#546570",
|
"#c4ccd3",
|
];
|
let state = reactive({
|
tabIsClick: true,
|
m_activeName: "tabParas",
|
m_cbCalcPowerByFlow: null,
|
m_cbCalcEtaByFlow: null,
|
m_FlowPercent100: 0, //百分之百点的流量
|
m_unitQ: 0,
|
m_runStatusList: [],
|
m_selWrkStatusType: 0, //工作点流量的展示类型
|
nhcb: {
|
//能耗成本
|
gzts: 200, //每年大致工作天数
|
gzxs: 12, //每天大致工作小时
|
df: 1, //电费
|
dfsz: 0, //电费上涨(每年)
|
jszq: 10, //计算周期(年)
|
lilv: 1, //利率(%)
|
xlxj: 0, //效率下降(%年)
|
co2xs: 0.622, //CO2系数(KW/Kg)
|
meixs: 2.7978, //煤炭折算系数(吨/万千瓦)
|
},
|
whwxcb: {
|
//维护维修成本
|
whhxl: "", //维护和修理
|
yxfy: "", //运行费用
|
sctghsh: "", //生产停工和损耗
|
hjbhf: "", //环境保护费
|
qtnfy: "", //其他年费用
|
},
|
cscb: {
|
//初始成本
|
sbcgfy: "", //设备采购费用
|
azhtsfy: "", //安装和调试费用
|
},
|
m_workStatusList: [],
|
chartData4Pies: [],
|
chartData4LeiJi: [],
|
chartData4Year: [],
|
moneyComponentList: [],
|
|
chartDataLeiJiTable: [],
|
chartDataTableHeight: 0,
|
|
m_totalList电费: [], //年度电费 (千元)
|
m_yearList电费: [], //每年的电费 (千元)
|
|
m_totalListCO2: [], //年累计CO2排放量
|
m_yearListCO2: [], //每年CO2排放量
|
|
m_totalList煤: [], //
|
m_yearList煤: [],
|
|
m_yearList费用: [],
|
})
|
onMounted(() => {
|
nextTick(function () {
|
let tableHeight = document.getElementById('pane-tabParas').offsetHeight - 30;
|
state.chartDataTableHeight = tableHeight;
|
});
|
|
let runStatusList = [
|
{
|
FlowRatio: "100",
|
Name: `${t("LCC.fullLoad.TR")}`,
|
TimeRatio: 55,
|
},
|
{
|
FlowRatio: "75",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 15,
|
},
|
{
|
FlowRatio: "50",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 30,
|
},
|
];
|
|
let workStatusList = [
|
{ label: `${t("LCC.default.TR")}`, value: 0 },
|
{ label: `${t("LCC.heating.TR")}`, value: 1 },
|
{ label: `${t("LCC.pressurize.TR")}`, value: 2 },
|
{ label: `${t("LCC.custom.TR")}`, value: 3 },
|
];
|
|
state.m_runStatusList = runStatusList;
|
state.m_workStatusList = workStatusList;
|
})
|
const initLccData = (flowPercent100, unitQ, unitNameQ) => {
|
if (flowPercent100 <= 0) return;
|
state.m_unitQ = unitQ;
|
state.m_FlowPercent100 = flowPercent100;
|
}
|
//
|
const getFlowPercent100 = () => {
|
return state.m_FlowPercent100;
|
}
|
//获取运行点
|
const getRunStatusList = () => {
|
return state.m_runStatusList;
|
}
|
//监听工作点列表类型的选择
|
const changeSelectWorkStatusType = (e) => {
|
changeWorkStatusType(state.m_selWrkStatusType);
|
}
|
//切换工作点流量列表数据
|
const changeWorkStatusType = (type) => {
|
let statusList = [];
|
if (type == 0) {
|
statusList.push({
|
FlowRatio: "100",
|
Name: `${t("LCC.fullLoad.TR")}`,
|
TimeRatio: 55,
|
});
|
statusList.push({
|
FlowRatio: "75",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 15,
|
});
|
statusList.push({
|
FlowRatio: "50",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 30,
|
});
|
} else if (type == 1) {
|
statusList.push({
|
FlowRatio: "100",
|
Name: `${t("LCC.fullLoad.TR")}`,
|
TimeRatio: 35,
|
});
|
statusList.push({
|
FlowRatio: "75",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 10,
|
});
|
statusList.push({
|
FlowRatio: "50",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 25,
|
});
|
statusList.push({
|
FlowRatio: "40",
|
Name: `${t("LCC.nightCoolingOperation.TR")}`,
|
TimeRatio: 30,
|
});
|
} else if (type == 2) {
|
statusList.push({
|
FlowRatio: "100",
|
Name: `${t("LCC.fullLoad.TR")}`,
|
TimeRatio: 10,
|
});
|
statusList.push({
|
FlowRatio: "80",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 20,
|
});
|
statusList.push({
|
FlowRatio: "50",
|
Name: `${t("LCC.partialLoad.TR")}`,
|
TimeRatio: 15,
|
});
|
statusList.push({
|
FlowRatio: "40",
|
Name: `${t("LCC.lowLoad.TR")}`,
|
TimeRatio: 20,
|
});
|
} else if (type == 3) {
|
statusList.push({
|
FlowRatio: "",
|
Name: "",
|
TimeRatio: "",
|
});
|
}
|
state.m_runStatusList = statusList;
|
}
|
//设置计算的回调函数
|
const setCalcFuncByFlowCb = (cb_power, cb_eta) => {
|
if (state.m_cbCalcPowerByFlow == null) state.m_cbCalcPowerByFlow = cb_power;
|
if (state.m_cbCalcEtaByFlow == null) state.m_cbCalcEtaByFlow = cb_eta;
|
}
|
//定义表格row样式
|
const rowClass = () => {
|
return { 'textAlign': 'center' };
|
}
|
const addTr = () => {
|
state.m_runStatusList.push({
|
Name: `${t("LCC.load.TR")}`,
|
FlowRatio: "",
|
TimeRatio: "",
|
close: true,
|
});
|
}
|
const closeTr = (i) => {
|
state.m_runStatusList.splice(i, 1);
|
}
|
//初始化费用图图表
|
const initChartPie = () => {
|
let data = state.chartData4Pies;
|
let legendSelected = {};
|
data.forEach((item) => {
|
if (item[1] == 0) {
|
legendSelected["" + item[0] + ""] = false;
|
} else {
|
legendSelected["" + item[0] + ""] = true;
|
}
|
});
|
m_chartPie.value = echarts.init(document.getElementById("echart_pie_box"));
|
var legendData = [];
|
var seriesData = [];
|
for (var i = 0; i < data.length; i++) {
|
legendData.push(data[i][0]);
|
seriesData.push({
|
name: data[i][0],
|
value: data[i][1],
|
label: {
|
formatter: "{b}:{d}%\n" + `${t("LCC.cost.TR")}` + ":{c}",
|
},
|
itemStyle: { color: colors[i] },
|
});
|
}
|
|
let chart_pie_option = {
|
title: {
|
text: "",
|
subtext: "",
|
left: "center",
|
},
|
tooltip: {
|
trigger: "item",
|
formatter: "{b} : {c} ({d}%)",
|
},
|
|
legend: {
|
//type: 'scroll',
|
//orient: 'vertical',
|
orient: "vertical",
|
left: "right",
|
right: 10,
|
top: 20,
|
bottom: 20,
|
data: legendData,
|
selected: legendSelected,
|
},
|
series: [
|
{
|
name: "",
|
type: "pie",
|
radius: "55%",
|
center: ["40%", "50%"],
|
data: seriesData,
|
emphasis: {
|
itemStyle: {
|
shadowBlur: 10,
|
shadowOffsetX: 0,
|
shadowColor: "rgba(0, 0, 0, 0.5)",
|
},
|
},
|
},
|
],
|
};
|
|
// 使用刚指定的配置项和数据显示图表。
|
m_chartPie.value.setOption(chart_pie_option);
|
}
|
//年度累计曲线图表
|
const initChartLeiJi = () => {
|
let chartData4LeiJi = state.chartData4LeiJi;
|
if (m_chartCost.value) {
|
m_chartCost.value.setOption({
|
yAxis: [
|
{
|
min: null,
|
max: null,
|
interval: null,
|
},
|
{
|
min: null,
|
max: null,
|
interval: null,
|
},
|
],
|
});
|
}
|
m_chartCost.value = echarts.init(document.getElementById("echart_box_fyqx"));
|
|
let chart_lj_option = {
|
color: [colors[0], colors[1], colors[2], colors[3]],
|
tooltip: {
|
trigger: "axis",
|
axisPointer: {
|
type: "shadow",
|
},
|
},
|
grid: {
|
top: "15%",
|
left: "2%",
|
right: "8%",
|
bottom: "3%",
|
containLabel: true,
|
},
|
|
legend: {
|
data: [
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
"用电量",
|
`${t("LCC.coalConsumption.TR")}`,
|
],
|
},
|
xAxis: [
|
{
|
axisLine: {
|
onZero: false,
|
},
|
type: "category",
|
axisTick: {
|
alignWithLabel: true,
|
},
|
data: chartData4LeiJi.year,
|
},
|
],
|
yAxis: [
|
{
|
type: "value",
|
// name: "总费用(万)",
|
name:
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
offset: 0,
|
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[0],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
{
|
type: "value",
|
// name: "CO2总排放量(万吨)",
|
name:
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
|
nameLocation: "middle",
|
nameRotate: 270,
|
nameGap: 35,
|
position: "right",
|
splitNumber: 5,
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[1],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
{
|
type: "value",
|
// name: "耗煤量",
|
name: `${t("LCC.coalConsumption.TR")}`,
|
nameLocation: "middle",
|
nameRotate: 270,
|
nameGap: 45,
|
position: "right",
|
splitNumber: 5,
|
offset: 60,
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[2],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
],
|
series: [
|
{
|
name:
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
type: "line",
|
data: chartData4LeiJi.feiyong,
|
},
|
{
|
name:
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
type: "line",
|
yAxisIndex: 1,
|
data: chartData4LeiJi.co2,
|
},
|
{
|
name: `${t("LCC.coalConsumption.TR")}`,
|
type: "line",
|
yAxisIndex: 2,
|
data: chartData4LeiJi.ljyml,
|
},
|
],
|
};
|
m_chartCost.value.setOption(chart_lj_option);
|
var feiyongmaxmin = m_chartCost.value.getModel()._componentsMap.data.get('yAxis')[0].axis.scale._extent;
|
|
var co2maxmin = m_chartCost.value.getModel()._componentsMap.data.get('yAxis')[1].axis.scale._extent;
|
|
var ljhmlmaxmin = m_chartCost.value.getModel()._componentsMap.data.get('yAxis')[2].axis.scale._extent;
|
|
var chart_max_FY = getChartMaxMinInterval(
|
feiyongmaxmin[1],
|
feiyongmaxmin[0],
|
5
|
); //费用
|
var chart_max_co2 = getChartMaxMinInterval(
|
co2maxmin[1],
|
co2maxmin[0],
|
5
|
); //co2
|
var chart_max_hml = getChartMaxMinInterval(
|
ljhmlmaxmin[1],
|
ljhmlmaxmin[0],
|
5
|
); //耗煤量
|
|
m_chartCost.value.setOption({
|
yAxis: [
|
{
|
min: chart_max_FY.min,
|
max: chart_max_FY.max,
|
interval: chart_max_FY.interval,
|
},
|
{
|
//gridIndex: 1,
|
min: chart_max_co2.min,
|
max: chart_max_co2.max,
|
interval: chart_max_co2.interval,
|
},
|
{
|
//gridIndex: 1,
|
min: chart_max_hml.min,
|
max: chart_max_hml.max,
|
interval: chart_max_hml.interval,
|
},
|
],
|
});
|
}
|
//当年统计图表
|
const initChartYear = () => {
|
let chartData4Year = state.chartData4Year;
|
// console.log(chartData4Year, 510);
|
if (m_chartYear.value) {
|
m_chartYear.value.setOption({
|
yAxis: [
|
{
|
min: null,
|
max: null,
|
interval: null,
|
},
|
{
|
min: null,
|
max: null,
|
interval: null,
|
},
|
],
|
});
|
}
|
m_chartYear.value = echarts.init(document.getElementById("echart_box_dntj"));
|
let chart_year_option = {
|
color: [colors[0], colors[1], colors[2], colors[3]],
|
tooltip: {
|
trigger: "axis",
|
axisPointer: {
|
type: "shadow",
|
},
|
},
|
grid: {
|
top: "15%",
|
left: "5%",
|
right: "6%",
|
bottom: "3%",
|
containLabel: true,
|
},
|
|
legend: {
|
data: [
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
`${t("LCC.coalConsumption.TR")}`,
|
],
|
},
|
xAxis: [
|
{
|
axisLine: {
|
onZero: false,
|
},
|
type: "category",
|
axisTick: {
|
alignWithLabel: true,
|
},
|
data: chartData4Year.year,
|
},
|
],
|
yAxis: [
|
{
|
type: "value",
|
nameLocation: "middle",
|
nameRotate: 270,
|
nameGap: 35,
|
offset: 0,
|
position: "right",
|
name:
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[0],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
{
|
type: "value",
|
nameLocation: "middle",
|
name:
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
position: "right",
|
nameRotate: 270,
|
nameGap: 45,
|
offset: 60,
|
splitNumber: 5,
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[1],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
{
|
type: "value",
|
nameLocation: "middle",
|
name: `${t("LCC.coalConsumption.TR")}`,
|
position: "right",
|
nameRotate: 270,
|
nameGap: 50,
|
offset: 120,
|
axisLine: {
|
show: true,
|
lineStyle: {
|
color: colors[2],
|
},
|
},
|
axisTick: {
|
show: true,
|
},
|
axisLabel: {
|
formatter: "{value} ",
|
},
|
},
|
],
|
series: [
|
{
|
name:
|
`${t("LCC.totalAnnualCost.TR")}` +
|
"(" +
|
`${t("LCC.tenThousand.TR")}` +
|
")",
|
type: "bar",
|
data: chartData4Year.feiyong,
|
},
|
{
|
name:
|
`${t("LCC.co2TotalEmissions.TR")}` +
|
"(" +
|
`${t("LCC.tenThousandTon.TR")}` +
|
")",
|
type: "bar",
|
yAxisIndex: 1,
|
data: chartData4Year.co2,
|
},
|
{
|
name: `${t("LCC.coalConsumption.TR")}`,
|
type: "bar",
|
yAxisIndex: 2,
|
data: chartData4Year.dnyml,
|
},
|
],
|
};
|
m_chartYear.value.setOption(chart_year_option);
|
// console.log(m_chartYear.getModel(), 643);
|
var feiyongmaxmin =
|
m_chartYear.value.getModel()._componentsMap.data.get('yAxis')[0].axis.scale._extent; //费用
|
var co2maxmin =
|
m_chartYear.value.getModel()._componentsMap.data.get('yAxis')[1].axis.scale._extent; //co2
|
var meiliangmaxmin =
|
m_chartYear.value.getModel()._componentsMap.data.get('yAxis')[2].axis.scale._extent; //用煤量
|
|
var chart_max_FY = getChartMaxMinInterval(
|
feiyongmaxmin[1],
|
feiyongmaxmin[0],
|
5
|
); //费用
|
var chart_max_co2 = getChartMaxMinInterval(
|
co2maxmin[1],
|
co2maxmin[0],
|
5
|
); //co2
|
var chart_max_meiliangmaxmin = getChartMaxMinInterval(
|
meiliangmaxmin[1],
|
meiliangmaxmin[0],
|
5
|
); //用煤量
|
|
m_chartYear.value.setOption({
|
yAxis: [
|
{
|
min: chart_max_FY.min,
|
max: chart_max_FY.max,
|
interval: chart_max_FY.interval,
|
},
|
{
|
//gridIndex: 1,
|
min: chart_max_co2.min,
|
max: chart_max_co2.max,
|
interval: chart_max_co2.interval,
|
},
|
{
|
//gridIndex: 1,
|
min: chart_max_meiliangmaxmin.min,
|
max: chart_max_meiliangmaxmin.max,
|
interval: chart_max_meiliangmaxmin.interval,
|
},
|
],
|
});
|
}
|
//tab栏切换
|
const tabClick = (obj) => {
|
// console.log(obj);
|
// let name = obj.props.name;
|
setTimeout(() => {
|
if (m_chartPie.value) {
|
m_chartPie.value.resize();
|
}
|
if (m_chartCost.value) {
|
m_chartCost.value.resize();
|
}
|
if (m_chartYear.value) {
|
m_chartYear.value.resize();
|
}
|
}, 10);
|
}
|
//成本分析表单校验
|
const checkInputValid = () => {
|
let nhcb = state.nhcb;
|
let calcYearNum = parseInt(nhcb.jszq); //计算周期(年)
|
if (isNaN(calcYearNum) || calcYearNum < 2) {
|
ElMessage.warning({
|
message: `${t("LCC.calculationPeriod.TR")}`,
|
type: "warning",
|
});
|
return false;
|
}
|
|
let runStatusList = state.m_runStatusList;
|
|
//
|
let total_bili = 0;
|
for (let i = 0; i < runStatusList.length; i++) {
|
let item = runStatusList[i];
|
if (item.TimeRatio == null || item.TimeRatio == "") continue;
|
|
let bili = parseFloat(item.TimeRatio);
|
if (isNaN(bili)) {
|
ElMessage.warning({
|
message: `${t("LCC.scaleTime.TR")}`,
|
type: "warning",
|
});
|
return;
|
}
|
bili = parseInt(bili);
|
if (isNaN(bili)) {
|
ElMessage.warning({
|
message: `${t("LCC.scaleTime.TR")}`,
|
type: "warning",
|
});
|
return;
|
}
|
total_bili += parseInt(bili);
|
}
|
if (runStatusList.length == 1) {
|
state.m_runStatusList = runStatusList;
|
runStatusList[0].TimeRatio = "100";
|
total_bili = 100;
|
}
|
if (total_bili > 102 || total_bili < 98) {
|
ElMessage.warning({
|
message: `${t("LCC.sumProportions.TR")}`,
|
type: "warning",
|
});
|
return false;
|
}
|
|
let df = parseFloat(nhcb.df); //电费(每度)
|
if (isNaN(df)) {
|
ElMessage.warning({
|
message: `${t("LCC.electricCharge.TR")}`,
|
type: "warning",
|
});
|
return false;
|
}
|
let ratio_co2 = parseFloat(nhcb.co2xs); //CO2系数
|
if (isNaN(ratio_co2)) {
|
ElMessage.warning({
|
message: `${t("LCC.coefficient_c.TR")}`,
|
type: "warning",
|
});
|
return false;
|
}
|
let ratio_mei = parseFloat(nhcb.meixs); // 煤炭折算系数
|
if (isNaN(ratio_mei)) {
|
ElMessage.warning({
|
message: `${t("LCC.conversionCoefficient.TR")}`,
|
type: "warning",
|
});
|
return false;
|
}
|
return true;
|
}
|
//
|
const MyRound = (v, num) => {
|
if (num == 1) return Math.round(v * 10) / 10.0;
|
else return Math.round(v * 100) / 100.0;
|
}
|
//
|
const CalcYearPower = (zhouqi) => {
|
let nhcb = state.nhcb;
|
let mngzts = parseFloat(nhcb.gzts); //每年大致工作天数
|
if (isNaN(mngzts)) {
|
ElMessage.warning({
|
message: "请输入每年大致工作天数!",
|
type: "warning",
|
});
|
return;
|
}
|
var d_每年工作天数 = mngzts;
|
|
let mtgzxs = parseFloat(nhcb.gzxs); //每天大致工作小时
|
if (isNaN(mtgzxs)) {
|
ElMessage.warning({
|
message: "请输入每天大致工作小时!",
|
type: "warning",
|
});
|
return;
|
}
|
var d_工作小时 = mtgzxs;
|
|
let runStatusList = state.m_runStatusList;
|
|
let value_每年效率下降点 = parseFloat(nhcb.xlxj); //系统效率下降(%每年)
|
if (isNaN(value_每年效率下降点)) {
|
value_每年效率下降点 = 0;
|
}
|
|
if (value_每年效率下降点 < 0.1) {
|
//没有下降
|
var percent_gonglv = 0;
|
for (let i = 0; i < runStatusList.length; i++) {
|
var row = runStatusList[i];
|
var flow = (parseFloat(row.FlowRatio) / 100) * state.m_FlowPercent100;
|
var timePercent = parseFloat(row.TimeRatio) / 100;
|
|
//var axisEff = this.MyRound(this.m_cbCalcEtaByFlow(flow,this.m_unitQ), 1);
|
var power = MyRound(
|
state.m_cbCalcPowerByFlow(flow, state.m_unitQ),
|
2
|
);
|
|
var gonglv = power * d_每年工作天数 * d_工作小时 * timePercent;
|
//console.log("lcc calc ",flow,power,gonglv,this.m_unitQ)
|
percent_gonglv += gonglv;
|
}
|
percent_gonglv = MyRound(percent_gonglv, 1);
|
|
var percentPowerList = []; //每年的用电量
|
for (var year = 0; year < zhouqi; year++) {
|
percentPowerList.push(percent_gonglv);
|
}
|
|
return percentPowerList;
|
} else {
|
var eta_dict = [];
|
var power_dict = [];
|
for (let i = 0; i < runStatusList.length; i++) {
|
var row = runStatusList[i];
|
var flow = (parseFloat(row.FlowRatio) / 100) * state.m_FlowPercent100;
|
var timePercent = parseFloat(row.TimeRatio) / 100;
|
|
var axisEff = MyRound(
|
state.m_cbCalcEtaByFlow(flow, state.m_unitQ),
|
1
|
);
|
var axisPower = MyRound(
|
state.m_cbCalcPowerByFlow(flow, state.m_unitQ),
|
2
|
);
|
|
eta_dict.push(axisEff);
|
power_dict.push(
|
axisPower * d_每年工作天数 * d_工作小时 * timePercent
|
);
|
}
|
|
var percentPowerList = []; //每年的用电量
|
for (var year = 0; year < zhouqi; year++) {
|
//处理效率下降问题
|
for (let i = 0; i < runStatusList.length; i++) {
|
var axisEff = eta_dict[i];
|
var axisPower = power_dict[i];
|
|
if (axisEff > 5) {
|
//防止效率下降到负数
|
axisEff = axisEff - value_每年效率下降点;
|
axisPower =
|
(axisPower * axisEff) / (axisEff - value_每年效率下降点);
|
|
eta_dict[i] = MyRound(axisEff, 1); //修改值
|
power_dict[i] = MyRound(axisPower, 2);
|
}
|
}
|
var sum = 0;
|
power_dict.forEach((ele) => {
|
sum += ele;
|
});
|
|
percentPowerList.push(MyRound(sum, 1));
|
}
|
return percentPowerList;
|
}
|
}
|
//计算 费用组成 (以及计算每年的费用)
|
const CalcYearValue = (percentPowerList, zhouqi) => {
|
//console.log(percentPowerList, "percentPowerList");
|
let chartData4Pies = [];
|
|
let nhcb = state.nhcb;
|
let dianfei_raio = parseFloat(nhcb.df); //电费(每度)
|
|
let dianfei_zhengzhang = parseFloat(nhcb.dfsz); //电费上涨(每年)
|
if (isNaN(dianfei_zhengzhang)) {
|
dianfei_zhengzhang = 0;
|
}
|
let ratio_co2 = parseFloat(nhcb.co2xs); //CO2系数
|
|
let ratio_mei = parseFloat(nhcb.meixs); // 煤炭折算系数
|
|
var totalList电费 = []; //年度电费
|
var yearList电费 = []; //每年的电费
|
|
var totalListCO2 = []; //年累计CO2排放量
|
var yearListCO2 = []; //每年CO2排放量
|
|
var totalList煤 = [];
|
var yearList煤 = [];
|
|
var rato_电费 = 1; //电费实际系数,//第一年无变化
|
|
var value_电费_累计 = 0;
|
var value_co2_累计 = 0; //C02累计排放量
|
var value_煤_累计 = 0; //累计煤
|
|
for (var year = 0; year < zhouqi; year++) {
|
var valve_每年耗电量 = percentPowerList[year];
|
|
var value_电费_当年 = MyRound(
|
(valve_每年耗电量 * dianfei_raio * rato_电费) / 1000, //换算成千元
|
1
|
);
|
var value_co2_当年 = MyRound(
|
(valve_每年耗电量 * ratio_co2) / 1000,
|
3
|
); //当年排放CO2量(吨) 系数是kg 所以除以1000
|
var value_煤_当年 = MyRound(
|
(valve_每年耗电量 * ratio_mei) / 10000,
|
3
|
); //吨 系数是万千瓦 所以除以10000
|
|
yearListCO2.push(value_co2_当年);
|
yearList电费.push(value_电费_当年);
|
yearList煤.push(value_煤_当年);
|
|
//console.log(year,value_电费_当年)
|
value_co2_累计 += value_co2_当年;
|
totalListCO2.push(value_co2_累计);
|
|
value_电费_累计 += value_电费_当年;
|
totalList电费.push(value_电费_累计);
|
|
value_煤_累计 += value_煤_当年;
|
totalList煤.push(value_煤_累计);
|
|
rato_电费 = rato_电费 * (1 + dianfei_zhengzhang / 100);
|
}
|
|
state.m_totalList电费 = totalList电费; //年度电费
|
state.m_yearList电费 = yearList电费; //每年的电费
|
|
state.m_totalListCO2 = totalListCO2; //年累计CO2排放量
|
state.m_yearListCO2 = yearListCO2; //每年CO2排放量
|
|
state.m_totalList煤 = totalList煤;
|
state.m_yearList煤 = yearList煤;
|
return true;
|
}
|
//分析成本
|
const clickAnaCostMoneyBtn = () => {
|
if (!checkInputValid()) return;
|
|
let nhcb = state.nhcb;
|
let zhouqi = parseInt(nhcb.jszq); //计算周期(年)
|
if (zhouqi < 2) {
|
zhouqi = 3;
|
}
|
|
//计算每年的功率
|
var percentPowerList = CalcYearPower(zhouqi);
|
if (percentPowerList == null || percentPowerList.length == 0) return;
|
|
//计算 费用组成 (以及计算每年的费用)
|
if (!CalcYearValue(percentPowerList, zhouqi)) {
|
return;
|
}
|
|
//计算 费用组成 (以及计算每年的费用)
|
if (!CalcPercenYearMoney(zhouqi)) return;
|
// 计算 累计数据
|
if (!CalcYearTolalMoneyValue(zhouqi)) return;
|
|
state.tabIsClick = false;
|
state.m_activeName = "tabResult";
|
nextTick(() => {
|
initChartPie();
|
initChartLeiJi();
|
initChartYear();
|
})
|
return;
|
}
|
//计算每年的费用 (以及费用组成 )
|
const CalcPercenYearMoney = (zhouqi) => {
|
//
|
var yearList费用 = []; //每年的费用
|
state.m_yearList电费.forEach((element) => {
|
yearList费用.push(MyRound(element, 1));
|
});
|
|
var list_各项费用组成 = [];
|
//
|
list_各项费用组成.push([
|
`${t("LCC.powerFees.TR")}`,
|
MyRound(
|
MyRound(
|
state.m_totalList电费[state.m_totalList电费.length - 1],
|
1
|
),
|
0
|
),
|
]);
|
|
let nhcb = state.nhcb;
|
let whwxcb = state.whwxcb;
|
let cscb = state.cscb;
|
|
//利率
|
var lilv = 0;
|
if (nhcb.lilv == "") {
|
lilv = 0;
|
} else {
|
lilv = parseFloat(nhcb.lilv);
|
}
|
//初期
|
var cost初期投资 = 0;
|
|
if (cscb.sbcgfy == "") {
|
cost初期投资 = 0;
|
} else {
|
cost初期投资 = parseFloat(cscb.sbcgfy);
|
}
|
//安装和调试
|
var cost安装和调试 = 0;
|
if (cscb.azhtsfy == "") {
|
cost安装和调试 = 0;
|
} else {
|
cost安装和调试 = parseFloat(cscb.azhtsfy);
|
}
|
|
yearList费用[0] += cost初期投资 + cost安装和调试;
|
list_各项费用组成.push([
|
`${t("LCC.initialCost.TR")}`,
|
cost初期投资 + cost安装和调试,
|
]);
|
|
//每年 费用
|
var cost维护和修理_bf = 0;
|
if (whwxcb.whhxl == "") {
|
cost维护和修理_bf = 0;
|
} else {
|
cost维护和修理_bf = parseFloat(whwxcb.whhxl);
|
}
|
var cost维护和修理 = 0;
|
if (cost维护和修理_bf > 0) {
|
for (var year = 0; year < zhouqi; year++) {
|
cost维护和修理 += cost维护和修理_bf;
|
yearList费用[year] += cost维护和修理_bf;
|
cost维护和修理_bf = MyRound(
|
(cost维护和修理_bf * (100 + lilv)) / 100,
|
1
|
);
|
}
|
}
|
|
list_各项费用组成.push([
|
`${t("LCC.maintenanceAndRepair.TR")}`,
|
MyRound(cost维护和修理, 0),
|
]);
|
|
var cost运行费用_bf = 0;
|
var cost运行费用 = 0;
|
if (whwxcb.yxfy == "") {
|
cost运行费用_bf = 0;
|
} else {
|
cost运行费用_bf = parseFloat(whwxcb.yxfy);
|
}
|
|
if (cost运行费用_bf > 0) {
|
for (var year = 0; year < zhouqi; year++) {
|
cost运行费用 += cost运行费用_bf;
|
yearList费用[year] += cost运行费用_bf;
|
cost运行费用_bf = MyRound(
|
(cost运行费用_bf * (100 + lilv)) / 100,
|
1
|
);
|
}
|
}
|
|
list_各项费用组成.push([
|
`${t("LCC.runningCost.TR")}`,
|
MyRound(cost运行费用, 0),
|
]);
|
|
var cost生产停工和损耗_bf = 0;
|
var cost生产停工和损耗 = 0;
|
if (whwxcb.sctghsh == "") {
|
cost生产停工和损耗_bf = 0;
|
} else {
|
cost生产停工和损耗_bf = parseFloat(whwxcb.sctghsh);
|
}
|
if (cost生产停工和损耗_bf > 0) {
|
for (var year = 0; year < zhouqi; year++) {
|
cost生产停工和损耗 += cost生产停工和损耗_bf;
|
yearList费用[year] += cost生产停工和损耗_bf;
|
cost生产停工和损耗_bf = MyRound(
|
(cost生产停工和损耗_bf * (100 + lilv)) / 100,
|
1
|
);
|
}
|
}
|
|
list_各项费用组成.push([
|
`${t("LCC.downtimeAndLoss.TR")}`,
|
MyRound(cost生产停工和损耗, 0),
|
]);
|
|
var cost环境保护费_bf = 0;
|
var cost环境保护费 = 0;
|
if (whwxcb.hjbhf == "") {
|
cost环境保护费_bf = 0;
|
} else {
|
cost环境保护费_bf = parseFloat(whwxcb.hjbhf);
|
}
|
if (cost环境保护费_bf > 0) {
|
for (var year = 0; year < zhouqi; year++) {
|
cost环境保护费 += cost环境保护费_bf;
|
yearList费用[year] += cost环境保护费_bf;
|
cost环境保护费_bf = MyRound(
|
(cost环境保护费_bf * (100 + lilv)) / 100,
|
1
|
);
|
}
|
}
|
|
list_各项费用组成.push([
|
`${t("LCC.environmentalFee.TR")}`,
|
MyRound(cost环境保护费, 0),
|
]);
|
|
var cost其他年费_bf = 0;
|
var cost其他年费 = 0;
|
if (whwxcb.qtnfy == "") {
|
cost其他年费_bf = 0;
|
} else {
|
cost其他年费_bf = parseFloat(whwxcb.qtnfy);
|
}
|
if (cost其他年费_bf > 0) {
|
for (var year = 0; year < zhouqi; year++) {
|
cost其他年费 += cost其他年费_bf;
|
yearList费用[year] += cost其他年费_bf;
|
cost其他年费_bf = MyRound(
|
(cost其他年费_bf * (100 + lilv)) / 100,
|
1
|
);
|
}
|
}
|
list_各项费用组成.push([
|
`${t("LCC.othersFee.TR")}`,
|
MyRound(cost其他年费, 0),
|
]);
|
|
state.m_yearList费用 = yearList费用;
|
|
// console.log("各项费用组成", list_各项费用组成);
|
|
let nowyear = new Date().getFullYear(); //当前年份
|
let chartData4Year = {
|
//单年图表数据
|
feiyong: [],
|
co2: [],
|
dnyml: [], //单年用煤量
|
year: [],
|
};
|
for (var i = 0; i < yearList费用.length; i++) {
|
// console.log(
|
// "年",
|
// i,
|
// yearList费用[i],
|
// this.m_yearList煤[i],
|
// this.m_yearListCO2[i]
|
// );
|
chartData4Year.year.push(nowyear);
|
chartData4Year.feiyong.push(yearList费用[i]);
|
chartData4Year.dnyml.push(state.m_yearList煤[i]);
|
chartData4Year.co2.push(state.m_yearListCO2[i]);
|
|
nowyear++;
|
}
|
|
/**
|
* 处理饼图表格数据
|
**/
|
//电费排序(降序)
|
list_各项费用组成 = sortDianFei(list_各项费用组成);
|
// console.log(chartData4Pies,1033)
|
let moneyComponentList = [];
|
let zong = list_各项费用组成
|
.map((item) => {
|
return item[1];
|
})
|
.reduce((total, num) => {
|
return total + num;
|
});
|
for (var i = 0; i < list_各项费用组成.length; i++) {
|
let item = list_各项费用组成[i];
|
moneyComponentList.push({
|
name: item[0],
|
value: item[1],
|
per: ((parseFloat(item[1]) / zong) * 100).toFixed(2),
|
color: colors[i],
|
});
|
}
|
//获取饼图数据
|
state.chartData4Pies = list_各项费用组成;
|
state.moneyComponentList = moneyComponentList;
|
//获取单年柱状图表数据
|
state.chartData4Year = chartData4Year;
|
|
return true;
|
}
|
//计算 累计费用
|
const CalcYearTolalMoneyValue = (zhouqi) => {
|
var totalList费用 = []; //总费用
|
var yearList费用 = state.m_yearList费用;
|
for (var i = 0; i < yearList费用.length; i++) {
|
var item = 0;
|
for (var j = 0; j <= i; j++) {
|
item += yearList费用[j];
|
}
|
totalList费用.push(MyRound(item, 1));
|
}
|
//console.log(totalList费用);
|
|
let nowyear = new Date().getFullYear(); //当前年份
|
var year_info_list = {
|
feiyong: [],
|
co2: [],
|
ljyml: [],
|
year: [],
|
};
|
|
for (var i = 0; i < totalList费用.length; i++) {
|
// console.log(
|
// "累计",
|
// i,
|
// totalList费用[i],
|
// this.m_totalList煤[i],
|
// this.m_totalListCO2[i]
|
// );
|
|
year_info_list.year.push(nowyear);
|
year_info_list.co2.push(parseFloat(state.m_totalListCO2[i]).toFixed(2));
|
year_info_list.ljyml.push(parseFloat(state.m_totalList煤[i]).toFixed(2));
|
year_info_list.feiyong.push(totalList费用[i]);
|
|
nowyear++;
|
}
|
//获取累计表格数据
|
year_info_list.year.forEach((item, index) => {
|
state.chartDataLeiJiTable.push({
|
year: item,
|
feiyong: year_info_list.feiyong[index],
|
co2: year_info_list.co2[index],
|
ljyml: year_info_list.ljyml[index],
|
});
|
});
|
state.chartData4LeiJi = year_info_list;
|
return true;
|
}
|
const getPowerByFlow = (flow) => {
|
if (state.m_cbCalcPowerByFlow == null) return null;
|
|
return state.m_cbCalcPowerByFlow(flow, state.m_unitQ);
|
}
|
//排序(降序)
|
const sortDianFei = (data) => {
|
data.sort(function (a, b) {
|
var v1 = a[1];
|
var v2 = b[1];
|
return v2 - v1;
|
});
|
//console.log(data)
|
return data;
|
}
|
//计算echarts 的 max ,min ,interval
|
const getChartMaxMinInterval = (max, min, splitNumber) => {
|
function getMaxMinNumber(n, l) {
|
var a1 = Math.floor(Math.log(n) / Math.LN10);
|
var b;
|
if (l) {
|
a1 < 2
|
? (b =
|
n / Math.pow(10, a1) - parseInt(n / Math.pow(10, a1)) > 0.5
|
? MyRound(n / Math.pow(10, a1)) * Math.pow(10, a1)
|
: (parseInt(n / Math.pow(10, a1)) + 0.5) * Math.pow(10, a1))
|
: (b = Math.ceil(n / Math.pow(10, 1)) * Math.pow(10, 1));
|
} else {
|
a1 < 2
|
? (b =
|
n / Math.pow(10, a1) - parseInt(n / Math.pow(10, a1)) > 0.5
|
? (parseInt(n / Math.pow(10, a1)) + 0.5) * Math.pow(10, a1)
|
: Math.floor(n / Math.pow(10, a1)) * Math.pow(10, a1))
|
: (b = Math.floor(n / Math.pow(10, 1)) * Math.pow(10, 1));
|
}
|
return l ? (-20 <= a1 ? +b.toFixed(a1 < 0 ? -a1 + 1 : 0) : b) : b;
|
}
|
var interval = 0;
|
if ((max - min) % splitNumber != 0) {
|
interval = getMaxMinNumber((max - min) / splitNumber, 1);
|
max = parseFloat(
|
(parseFloat((interval * splitNumber).toFixed(12)) + min).toFixed(12)
|
); //解决小数精度一般问题,极端问题并不能解决。
|
min = min;
|
} else {
|
interval = (max - min) / splitNumber;
|
min = min;
|
max = max;
|
}
|
return { max: max, min: min, interval: interval };
|
}
|
defineExpose({
|
initLccData,
|
setCalcFuncByFlowCb
|
})
|
|
</script>
|
|
<style lang="scss">
|
/* scoped */
|
#echart_pie_box {
|
width: 7.6rem;
|
height: 5rem;
|
}
|
|
.chengBenFenXi {
|
.el-tabs__header {
|
height: 0.4rem;
|
line-height: 0.4rem;
|
}
|
|
.el-tabs__item {
|
height: 0.4rem;
|
line-height: 0.4rem;
|
}
|
|
.el-tabs__content {
|
height: 4.75rem;
|
|
.el-tab-pane {
|
height: 100%;
|
}
|
}
|
|
.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled {
|
cursor: not-allowed;
|
}
|
|
.div_tr {
|
display: flex;
|
justify-content: space-between;
|
align-items: flex-start;
|
margin-bottom: 0.1rem;
|
|
&:last-of-type {
|
margin-bottom: 0;
|
}
|
|
.div_box {
|
width: calc(50% - 0.1rem);
|
height: 2.6rem;
|
border: 0.01rem solid #bce8f1;
|
|
.div_box_title {
|
height: 0.3rem;
|
line-height: 0.3rem;
|
background-color: #c1e0cc;
|
color: #31708f;
|
padding-left: 0.1rem;
|
text-align: left;
|
}
|
|
.div_box_content {
|
min-height: 2.3rem;
|
overflow: auto;
|
padding: 0.1rem;
|
box-sizing: border-box;
|
|
table {
|
thead {
|
height: 0.3rem;
|
line-height: 0.3rem;
|
}
|
|
tr {
|
height: 0.3rem;
|
line-height: 0.3rem;
|
|
.closeTr {
|
position: absolute;
|
right: 0rem;
|
top: 0.07rem;
|
display: inline-block;
|
width: 0.2rem;
|
height: 0.2rem;
|
line-height: 0.2rem;
|
}
|
}
|
}
|
|
.pump_flow,
|
.pump_time {
|
border: none;
|
border-bottom: 0.01rem solid #ddd;
|
outline: none;
|
text-align: center;
|
// height: 0.3rem;
|
}
|
|
.pump_flow {
|
width: 1.2rem;
|
}
|
|
.pump_time {
|
width: 1rem;
|
}
|
|
.div_box_content_group {
|
display: flex;
|
padding: 0.05rem 0;
|
box-sizing: border-box;
|
align-items: center;
|
.pump_label {
|
width: 30%;
|
text-align: right;
|
padding-right: 0.05rem;
|
margin-bottom: 0rem;
|
// height: 0.3rem;
|
// line-height: 0.3rem;
|
}
|
|
.pump_value {
|
width: 20%;
|
height: 0.3rem;
|
line-height: 0.3rem;
|
|
input {
|
width: 100%;
|
border: 0;
|
border-bottom: 0.01rem solid #ccc;
|
text-align: center;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|