123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446 |
- <template>
- <div class="dataAnalysisHotAns" :class="!theme ? 'themeDark' : 'themeLight'">
- <div class="dataAnalysisHotAnsMain">
- <div class="main_top">
- <p class="topPsty">温度与功率分析</p>
- </div>
- <div class="main">
- <div class="main">
- <div class="treeDataMain">
- <tree-cop
- :data="processTreeData"
- :height="treeHeight"
- :currentNodeKey="currentNodeKey"
- @currentChange="funProcessCurrentChange"
- @refresh="funGetProcessTree"
- ></tree-cop>
- </div>
- <div class="excelDataMain">
- <excel-cop
- :data="excelList"
- :height="excelHeight"
- @excelChange="funExcelChange"
- :theme="theme"
- >
- </excel-cop>
- </div>
- <div class="tableDataMain">
- <div class="">
- <el-tabs v-model="activeTab">
- <el-tab-pane label="温度曲线" name="1"> </el-tab-pane>
- <el-tab-pane label="温度与功率" name="2"> </el-tab-pane>
- <el-tab-pane label="表格数据" name="3"> </el-tab-pane>
- <div v-if="activeTab === '2'" :style="{ height: tableHeight }">
- <div style="height: 49%">
- <el-icon
- :style="!theme ? 'color: #fff' : ''"
- class="chartIcon"
- size="18"
- @click="
- funActCop(
- {
- xAxis: barxAxis,
- yAxis: baryAxis,
- series: barSeries,
- },
- 'barChartCop'
- )
- "
- >
- <ZoomIn />
- </el-icon>
- <bar-chart-cop
- width="100%"
- height="100%"
- :subtext="`平均功率-额定功率 ${powerproduction}`"
- :xAxis="barxAxis"
- :theme="theme"
- :echartsTheme="echartsTheme"
- :yAxis="baryAxis"
- :series="barSeries"
- >
- </bar-chart-cop>
- </div>
- <div style="height: 49%">
- <el-icon
- :style="!theme ? 'color: #fff' : ''"
- class="chartIcon"
- size="18"
- @click="
- funActCop(
- {
- xAxis: linexAxis,
- yAxis: lineyAxis,
- series: lineSeries,
- },
- 'lineChartCop'
- )
- "
- >
- <ZoomIn />
- </el-icon>
- <line-chart-cop
- class=""
- height="100%"
- width="100%"
- :xAxis="linexAxis"
- :yAxis="lineyAxis"
- :series="lineSeries"
- :theme="theme"
- :echartsTheme="echartsTheme"
- :subtext="`额定功率温度分析 ${powerproduction}`"
- :dataset="lineDataSet"
- >
- </line-chart-cop>
- </div>
- </div>
- <div
- v-if="activeTab === '1'"
- :style="{
- height:
- typeof tableHeight === 'string'
- ? tableHeight
- : tableHeight + 'px',
- }"
- class="p-[10px]"
- >
- <CurrentScatterChart
- ref="chartRef"
- width="100%"
- :height="`calc( ${tableHeight} - 20px )`"
- :chartTitle="
- avgObj.title +
- ' ' +
- '平均Cp值:' +
- avgObj.cpavg +
- '; 静风频率:' +
- avgObj.frequency +
- '%; 曲线偏差率:' +
- avgObj.pcratio +
- '%'
- "
- :xAxisData="xAxisData"
- :yAxisData="{ splitLine: { show: false } }"
- :seriesData="seriesData"
- :showLegend="true"
- :brushSelected="false"
- :maxMinData="maxMinData"
- :theme="theme"
- :echartsTheme="echartsTheme"
- :dataSet="dataSet"
- @getSelected="funhotChartSelect"
- />
- </div>
- <div v-if="activeTab === '3'" :style="{ height: tableHeight }">
- <table-cop
- class=""
- :data="tableData"
- :column="tableColumn"
- :theme="theme"
- :height="tableHeight"
- tableId="1"
- tableName="温度与功率分析"
- ></table-cop>
- </div>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- </div>
- <el-dialog
- custom-class="windLifeDialog"
- draggable
- width="80%"
- v-model="dialog"
- :title="actDiaTitle"
- >
- <el-form class="whitespace-nowrap" :inline="true" :model="queryForm">
- <el-form-item label="" class="!mb-0">
- <el-select
- v-model="queryForm.checkIds"
- clearable
- @clear="checkAll = false"
- collapse-tags
- multiple
- >
- <el-option
- label="全选"
- :class="{ selected: checkAll }"
- @click="funCheckAll"
- ></el-option>
- <el-option
- v-for="item in chartExcelList"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="!mb-0">
- <submit-btn desc="查询" @click="funDiaSubmit"></submit-btn>
- <submit-btn desc="导出" @click="funDiaExport"></submit-btn>
- </el-form-item>
- </el-form>
- <div v-loading="exportLoading">
- <el-row
- ref="diaPanelRef"
- style="height: 650px; overflow-y: auto; over-x: hidden"
- >
- <el-col
- :span="actCopList.length > 1 ? 12 : 24"
- v-for="item in actCopList"
- :key="item.id"
- style="height: 650px"
- >
- <component
- :is="item.actCop"
- width="100%"
- height="100%"
- :xAxis="item.xAxis"
- :subtext="item.subtext"
- :title="item.title"
- :series="item.series"
- :isDiaAlone="actCopList.length === 1"
- @dblclick="funDbClick(item)"
- :yAxis="item.yAxis"
- :dataset="item.dataset"
- :brush="item.isBrush"
- :theme="theme"
- :echartsTheme="echartsTheme"
- @getSelected="funChartSelect"
- ></component>
- </el-col>
- </el-row>
- </div>
- </el-dialog>
- <el-dialog
- custom-class="windLifeDialog warn-table"
- v-model="wtDialog"
- draggable
- title="风机功率点位"
- >
- <el-tabs v-model="wtTab">
- <el-tab-pane label="数据" name="table">
- <el-table :data="wtData" row-key="id" :max-height="550">
- <el-table-column property="wtId" align="center" label="风机" />
- <el-table-column
- property="time"
- sortable
- :width="160"
- align="center"
- label="时间"
- />
- <el-table-column
- property="speed"
- sortable
- align="center"
- label="风速(m/s)"
- />
- <el-table-column
- property="power"
- sortable
- align="center"
- label="功率(kW)"
- />
- <el-table-column
- property="rr"
- sortable
- align="center"
- label="转速"
- />
- <el-table-column
- property="filter"
- sortable
- align="center"
- label="是否有用点"
- />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="故障" name="problem" disabled> </el-tab-pane>
- <el-tab-pane label="预警" name="warning" disabled> </el-tab-pane>
- </el-tabs>
- </el-dialog>
- </div>
- </template>
- <script setup name="prepare">
- import excelCop from "@/components/generatingCapacityComponent/excel.vue";
- import treeCop from "@/components/generatingCapacityComponent/tree.vue";
- import tableCop from "@/components/generatingCapacityComponent/table.vue";
- import barChartCop from "./components/barChart.vue";
- import lineChartCop from "./components/lineChart.vue";
- import {
- shallowRef,
- ref,
- nextTick,
- onActivated,
- onMounted,
- reactive,
- watch,
- } from "vue";
- import { useStore } from "vuex";
- import httpRequest from "@/utils/request.js";
- import tools from "@tools/htmlToPdf.js";
- import { ElMessage } from "element-plus";
- import util from "@tools/util";
- import CurrentScatterChart from "./components/current-scatter-chart.vue";
- import jsonData from "./components/data.json";
- const treeHeight = ref(window.innerHeight - 111 + "px");
- const excelHeight = ref(window.innerHeight - 111 + "px");
- const tableHeight = ref(window.innerHeight - 171 + "px");
- const powerproduction = ref("");
- const tableData = ref([]);
- const tableColumn = ref([]);
- const currentNodeKey = ref("");
- const tableDataGet = async () => {
- const res = await httpRequest.get("/temperature/show", {
- params: {
- id: excelCheckIds.value.join(),
- },
- });
- tableColumn.value = res.data.title.map((o) => {
- return {
- prop: o.key,
- label: o.des,
- width: o.des === "时间" ? 100 : 80,
- };
- });
- tableData.value = res.data.data;
- };
- const excelCheckboxShow = ref(false);
- const excelCheckIds = ref([]);
- const excelList = ref([]);
- const funExcelChange = async (obj) => {
-
-
- excelCheckIds.value = [obj.id];
- chartExcelList.value = excelList.value.map((o) => {
- return {
- ...o,
- name: o.name.split("_")[0],
- };
- });
- queryForm.checkIds = excelList.value.map((o) => o.id);
- checkAll.value = true;
- funSubmit();
- tableDataGet();
-
-
- isChartArea.value = false;
- let chartRes = {
- scatterhs: [[]],
- scatterls: [[]],
- sjgl: [[]],
- llgl: [[]],
- cpz: [[]],
- };
- let chartResponse = null;
- if (obj.type === "fitting") {
- chartResponse = await httpRequest.get("/temperature/curve/analysis", {
- params: {
- id: obj.id,
- p: 1,
- },
- });
- }
- if (chartResponse && chartResponse.code === 200) {
- chartRes = chartResponse.data;
- maxMinData.value = [chartRes.maxhjwd, chartRes.minhjwd];
- markDot.pcl5 = chartRes.obj.pc5ratio;
- markDot.pcl10 = chartRes.obj.pc10ratio;
- markDot.pcl12 = chartRes.obj.pc12ratio;
- markDot.pcl25 = chartRes.obj.pc25ratio;
- avgObj.title = chartRes.obj.path
- .substring(
- chartRes.obj.path.indexOf(chartRes.obj.station + "_") +
- (chartRes.obj.station + "_").length
- )
- .split("_")[0];
- avgObj.cpavg = Number(chartRes.obj.cpavg).toFixed(2);
- avgObj.frequency = Number(chartRes.obj.frequency).toFixed(2);
- avgObj.pcratio = Number(chartRes.obj.pcratio).toFixed(2);
- const color = [
- "#1C99FF",
- "#FF8700",
- "#3D54BE",
- "#fa8c16",
- "#1DA0D7",
- "#DD5044",
- ];
- seriesData.value = [
- {
- name: "拟合功率",
- type: "line",
- symbol: "line",
- symbolSize: 0,
- smooth: true,
- data: chartRes.sjgl,
- xAxisIndex: 0,
- },
- {
- name: "保证功率",
- type: "line",
- symbol: "line",
- symbolSize: 0,
- smooth: true,
- data: chartRes.llgl,
- xAxisIndex: 0,
- },
- {
- type: "effectScatter",
- showEffectOn: "emphasis",
- rippleEffect: {
- scale: 1,
- },
- name: "数据散点",
- symbolSize: 5,
-
-
-
-
-
-
-
-
- data: chartRes.scatter,
- xAxisIndex: 0,
- yAxisIndex: 0,
- },
- ];
- }
- };
- const funExcelCheckChange = ({ checkArr, data }) => {
- excelCheckIds.value = checkArr;
- };
- const treeData = ref([]);
- const actTreeNode = ref(null);
- const funRepeatMap = (arr) => {
- return arr.map((o) => {
- if (o.children) {
- const findIndex = o.children.findIndex((p) => !!p.type);
- if (findIndex !== -1) {
- o.childs = o.children;
- o.children = [];
- if (!actTreeNode.value) {
-
- actTreeNode.value = o;
- }
- }
- }
- return {
- ...o,
- children: o.children ? funRepeatMap(o.children) : [],
- };
- });
- };
- const funCurrentChange = ({ current, currentNode }) => {
- excelCheckboxShow.value = true;
- if (current.childs) {
- excelList.value = current.childs.map((o) => {
- return {
- id: o.id,
- interval: o.interval,
- path: o.path,
- prepareid: o.prepareid,
- station: o.station,
- time: o.time,
- type: o.type,
- windturbine: o.windturbine,
- name: o.path.substring(
- o.path.indexOf(o.station + "_") + (o.station + "_").length
- ),
- };
- });
- } else {
- excelList.value = [];
- }
- };
- const processTreeData = ref([]);
- const funGetProcessTree = async () => {
-
- actTreeNode.value = null;
- const res = await httpRequest.get("/power/fitting/tree");
- excelList.value = [];
- processTreeData.value = funRepeatMap(res.data);
- if (actTreeNode.value) {
- funProcessCurrentChange({
- current: actTreeNode.value,
- currentNode: null,
- });
- const child = actTreeNode.value.childs[0];
- const obj = {
- id: child.id,
- interval: child.interval,
- path: child.path,
- prepareid: child.prepareid,
- station: child.station,
- time: child.time,
- type: child.type,
- windturbine: child.windturbine,
- name: child.path.substring(
- child.path.indexOf(child.station + "_") + (child.station + "_").length
- ),
- };
- currentNodeKey.value = actTreeNode.value?.id || "";
- funExcelChange(obj);
- }
- };
- const funProcessCurrentChange = ({ current, currentNode }) => {
- if (current.childs) {
- excelList.value = current.childs.map((o) => {
- return {
- id: o.id,
- interval: o.interval,
- path: o.path,
- prepareid: o.prepareid,
- station: o.station,
- time: o.time,
- type: o.type,
- windturbine: o.windturbine,
- name: o.path.substring(
- o.path.indexOf(o.station + "_") + (o.station + "_").length
- ),
- };
- });
- if (excelList.value.length > 0) {
- funExcelChange(excelList.value[0]);
- }
- } else {
- excelList.value = [];
- }
- };
- let chartId = 1;
- const powerproductionNum = ref(0);
- const funSubmit = async () => {
- const tempRes = await httpRequest.get("/temperature/rated/power", {
- params: {
- ids: excelCheckIds.value.join(","),
- },
- });
- if (tempRes.code === 200) {
- if (tempRes.data.length) {
- for (const chart of tempRes.data) {
- powerproduction.value = `(额定功率=${chart.power.powerProduction}kW)`;
- powerproductionNum.value = chart.power.powerProduction;
- barxAxis.data = Object.keys(chart.res1);
- barSeries[0].data = Object.values(chart.res1);
- barSeries[0].markLine.data = [
- {
- yAxis: 0,
- },
- ];
- chartId++;
- lineSeries.value = [
- {
- type: "effectScatter",
- showEffectOn: "emphasis",
- rippleEffect: {
- scale: 1,
- },
- legendHoverLink: false,
- name: "",
- symbolSize: 5,
- data: chart.res2,
- yAxisIndex: 0,
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "#F72C5B",
- },
- data: [
- {
- yAxis: powerproductionNum.value,
- },
- ],
- },
- },
- ];
- chartId++;
- }
- }
- }
- };
- const linexAxis = reactive({
- type: "value",
- name: "°C",
- splitLine: {
- show: false,
- },
- axisTick: {
- show: true,
- },
- axisLine: {
- onZero: false,
- },
- });
- const lineyAxis = reactive([
- {
- type: "value",
- name: "kW",
- splitLine: {
- show: false,
- },
- axisTick: {
- show: true,
- },
- axisLine: {
- onZero: false,
- },
- },
- ]);
- const lineSeries = ref([]);
- const lineDataSet = reactive([
- {
- source: [],
- },
- ]);
- const funChartSelect = async (batch) => {
- const wDataArr = [];
- const yDataArr = [];
- let scatterls = [];
- let dataSetObj = [];
- wtData.value = [];
- if (batch.length && actCopList.value[0].dataset) {
- scatterls = batch[0].selected[1].dataIndex;
- if (scatterls.length) {
- dataSetObj = JSON.parse(actCopList.value[0].dataset);
- if (scatterls.length) {
- for (const scatterIndex of scatterls) {
- wDataArr.push(dataSetObj[0].source[scatterIndex].k);
- }
- }
- const wtRes = await httpRequest.get("/power/fitting/filter", {
- params: {
- yk: yDataArr.join(","),
- wk: wDataArr.join(","),
- },
- });
- if (wtRes.code === 200) {
- let id = 1;
- const tempArr = [];
- if (wtRes.data.length) {
- for (const data of wtRes.data) {
- if (tempArr.length) {
- const findIndex = tempArr.findIndex((o) => o.wtId === data.wtId);
- if (findIndex !== -1) {
- if (!tempArr[findIndex].children) {
- tempArr[findIndex].children = [];
- }
- tempArr[findIndex].children.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- } else {
- tempArr.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- }
- } else {
- tempArr.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- }
- }
- wtDialog.value = true;
- nextTick(() => {
- wtTab.value = "table";
- wtData.value = tempArr;
- });
- }
- }
- }
- }
- };
- const barxAxis = reactive({
- type: "category",
- name: "℃",
- data: [],
- splitLine: {
- show: false,
- },
- axisTick: {
- show: true,
- },
- axisLine: {
- onZero: false,
- },
- });
- const baryAxis = reactive({
- type: "value",
- name: "kW",
- splitLine: {
- show: false,
- },
- axisTick: {
- show: true,
- },
- axisLine: {
- onZero: false,
- },
- });
- const barSeries = reactive([
- {
- name: "",
- type: "bar",
- data: [],
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "#F72C5B",
- },
- data: [],
- },
- },
- ]);
- const avgObj = reactive({
-
- title: "",
- cpavg: "",
- frequency: "",
- pcratio: "",
- });
- const markDot = reactive({
-
- pcl5: null,
- pcl10: null,
- pcl12: null,
- pcl25: null,
- });
- const xAxisData = ref([]);
- const chartRef = ref();
- const seriesData = ref([]);
- const maxMinData = ref([]);
- const isChartArea = ref(false);
- const dataSet = ref("");
- const funhotChartSelect = async (batch) => {
- const wDataArr = [];
- const yDataArr = [];
- let scatterls = [];
- let scatterhs = [];
- let dataSetObj = [];
- wtData.value = [];
- if (batch.length && dataSet.value) {
- scatterls = batch[0].selected[2].dataIndex;
- scatterhs = batch[0].selected[3].dataIndex;
- if (scatterls.length || scatterhs.length) {
- dataSetObj = JSON.parse(dataSet.value);
- if (scatterls.length) {
- for (const scatterIndex of scatterls) {
- wDataArr.push(dataSetObj[0].source[scatterIndex].k);
- }
- }
- if (scatterhs.length) {
- for (const scatterIndex of scatterhs) {
- yDataArr.push(dataSetObj[1].source[scatterIndex].k);
- }
- }
- const wtRes = await httpRequest.get("/power/fitting/filter", {
- params: {
- yk: yDataArr.join(","),
- wk: wDataArr.join(","),
- },
- });
- if (wtRes.code === 200) {
- let id = 1;
- const tempArr = [];
- if (wtRes.data.length) {
- for (const data of wtRes.data) {
- if (tempArr.length) {
- const findIndex = tempArr.findIndex((o) => o.wtId === data.wtId);
- if (findIndex !== -1) {
- if (!tempArr[findIndex].children) {
- tempArr[findIndex].children = [];
- }
- tempArr[findIndex].children.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- } else {
- tempArr.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- }
- } else {
- tempArr.push({
- ...data,
- id: id,
- filter: data.filter === 0 ? "是" : "否",
- });
- id++;
- }
- }
- wtDialog.value = true;
- nextTick(() => {
- wtTab.value = "table";
- wtData.value = tempArr;
- });
- }
- }
- }
- }
- };
- const funChartArea = () => {
- if (seriesData.value.length) {
- if (!isChartArea.value) {
-
- seriesData.value[0] = {
- ...seriesData.value[0],
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "rgba(96,174,255, 1)",
- },
- data: [
- {
- xAxis: 3,
- valueIndex: 0,
- },
- {
- xAxis: 5,
- valueIndex: 0,
- },
- {
- xAxis: 10,
- valueIndex: 0,
- },
- {
- xAxis: 12,
- valueIndex: 0,
- },
- {
- xAxis: 25,
- valueIndex: 0,
- },
- ],
- },
- markArea: {
- label: {
- fontSize: util.vh(12),
- },
- itemStyle: {
- color: "rgba(236,245,255, 0)",
- },
- emphasis: {
- itemStyle: {
- color: "rgba(96,174,255, 0.5)",
- },
- },
- data: [
- [
- {
- name: `3~5m 偏差率: ${markDot.pcl5}%`,
- xAxis: 3,
- },
- {
- xAxis: 5,
- },
- ],
- [
- {
- name: `5~10m 偏差率: ${markDot.pcl10}%`,
- xAxis: 5,
- },
- {
- xAxis: 10,
- },
- ],
- [
- {
- name: `10~12m 偏差率: ${markDot.pcl12}%`,
- xAxis: 10,
- },
- {
- xAxis: 12,
- },
- ],
- [
- {
- name: `12~25m 偏差率: ${markDot.pcl25}%`,
- xAxis: 12,
- },
- {
- xAxis: 25,
- },
- ],
- ],
- },
- };
- isChartArea.value = true;
- } else {
- seriesData.value[0] = {
- ...seriesData.value[0],
- markLine: null,
- markArea: null,
- };
- isChartArea.value = false;
- }
- }
- };
- const wtDialog = ref(false);
- const wtData = ref([]);
- const wtTab = ref("table");
- const dialog = ref(false);
- const actChartName = ref("");
- const actDiaTitle = ref("");
- const diaPanelRef = ref();
- const exportLoading = ref(false);
- const actCopList = ref([
-
-
-
-
-
-
-
-
-
- ]);
- const actCopListBak = ref([]);
- const checkAll = ref(true);
- const queryForm = reactive({
- checkIds: [],
- });
- const funCheckAll = () => {
- checkAll.value = !checkAll.value;
- if (checkAll.value) {
- queryForm.checkIds = chartExcelList.value.map((o) => o.id);
- } else {
- queryForm.checkIds = [];
- }
- };
- const chartExcelList = ref([]);
- const funActCop = (obj, type) => {
- switch (type) {
- case "barChartCop":
- actChartName.value = "barChartCop";
- obj.actCop = shallowRef(barChartCop);
- actDiaTitle.value = "平均功率-额定功率";
- break;
- case "lineChartCop":
- actChartName.value = "lineChartCop";
- obj.actCop = shallowRef(lineChartCop);
- actDiaTitle.value = "额定功率温度分析";
- break;
-
-
-
-
-
- }
- obj.isBrush = false;
- obj.id = chartId;
- chartId++;
- dialog.value = true;
- actCopListBak.value = [];
- nextTick(() => {
- actCopList.value = [obj];
- });
- };
- const funDiaSubmit = async () => {
- let url = "";
- switch (actChartName.value) {
- case "barChartCop":
- url = "/temperature/rated/power";
- break;
- case "lineChartCop":
- url = "/temperature/rated/power";
- break;
-
-
-
- }
- if (url) {
- const res = await httpRequest.get(url, {
- params: {
- ids: queryForm.checkIds.join(","),
- mode: 0,
- },
- });
- if (res.code === 200) {
- actCopList.value = [];
- actCopListBak.value = [];
- if (res.data.length) {
- for (const chart of res.data) {
- if (actChartName.value === "barChartCop") {
- actCopList.value.push({
- id: chartId,
- isBrush: false,
- actCop: shallowRef(barChartCop),
- title: chart.wt,
- subtext: `平均功率-额定功率(额定功率=${chart.power.powerProduction}kW)`,
- xAxis: {
- ...barxAxis,
- data: Object.keys(chart.res1),
- },
- yAxis: baryAxis,
- series: [
- {
- name: "",
- type: "bar",
- data: Object.values(chart.res1),
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "#F72C5B",
- },
- data: [
- {
- yAxis: 0,
- },
- ],
- },
- },
- ],
- });
- chartId++;
- }
- if (actChartName.value === "lineChartCop") {
- actCopList.value.push({
- id: chartId,
- isBrush: false,
- actCop: shallowRef(lineChartCop),
- title: chart.wt,
- subtext: `额定功率温度分析(额定功率=${chart.power.powerProduction}kW)`,
- xAxis: linexAxis,
- yAxis: lineyAxis,
- dataset: lineDataSet,
- series: [
- {
- type: "effectScatter",
- showEffectOn: "emphasis",
- rippleEffect: {
- scale: 1,
- },
- legendHoverLink: false,
- name: "",
- symbolSize: 5,
- data: chart.res2,
- yAxisIndex: 0,
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "#F72C5B",
- },
- data: [
- {
- yAxis: chart.power.powerProduction,
- },
- ],
- },
- },
- ],
- });
- chartId++;
- }
- }
- actCopListBak.value = actCopList.value;
- }
- }
- }
- };
- const funDiaExport = () => {
- exportLoading.value = true;
- tools.scrollToPDF(diaPanelRef.value, actDiaTitle.value, () => {
- exportLoading.value = false;
- });
- };
- const funDbClick = (obj) => {
- if (actCopListBak.value.length > 1) {
-
- if (actCopList.value.length === 1) {
- actCopList.value = actCopListBak.value;
- } else {
- actCopList.value = [obj];
- }
- }
- };
- const activeTab = ref("1");
- const theme = ref(null);
- const echartsTheme = ref("");
- const store = useStore();
- watch(
- () => store.state.theme,
- (newVal, oldVal) => {
- theme.value = newVal;
- echartsTheme.value = !newVal ? "dark" : "";
- funGetProcessTree();
- },
- {
- deep: true,
- }
- );
- const initPageData = () => {
-
- actTreeNode.value = null;
- excelList.value = [];
- processTreeData.value = funRepeatMap(
- JSON.parse(JSON.stringify(jsonData.treeData))
- );
- if (actTreeNode.value) {
- if (actTreeNode.value.childs) {
- excelList.value = actTreeNode.value.childs.map((o) => {
- return {
- id: o.id,
- interval: o.interval,
- path: o.path,
- prepareid: o.prepareid,
- station: o.station,
- time: o.time,
- type: o.type,
- windturbine: o.windturbine,
- isCheck: false,
- name: o.path.substring(
- o.path.indexOf(o.station + "_") + (o.station + "_").length
- ),
- };
- });
- } else {
- excelList.value = [];
- }
- const child = actTreeNode.value.childs[0];
- const obj = {
- id: child.id,
- interval: child.interval,
- path: child.path,
- prepareid: child.prepareid,
- station: child.station,
- time: child.time,
- type: child.type,
- windturbine: child.windturbine,
- name: child.path.substring(
- child.path.indexOf(child.station + "_") + (child.station + "_").length
- ),
- };
- currentNodeKey.value = actTreeNode.value?.id || "";
- excelCheckIds.value = [obj.id];
- chartExcelList.value = excelList.value.map((o) => {
- return {
- ...o,
- name: o.name.split("_")[0],
- };
- });
- queryForm.checkIds = excelList.value.map((o) => o.id);
- checkAll.value = true;
- for (const chart of jsonData.powerData) {
- powerproduction.value = `(额定功率=${chart.power.powerProduction}kW)`;
- powerproductionNum.value = chart.power.powerProduction;
- barxAxis.data = Object.keys(chart.res1);
- barSeries[0].data = Object.values(chart.res1);
- barSeries[0].markLine.data = [
- {
- yAxis: 0,
- },
- ];
- chartId++;
- lineSeries.value = [
- {
- type: "effectScatter",
- showEffectOn: "emphasis",
- rippleEffect: {
- scale: 1,
- },
- legendHoverLink: false,
- name: "",
- symbolSize: 5,
- data: chart.res2,
- yAxisIndex: 0,
- markLine: {
- symbol: "none",
- label: {
- show: false,
- },
- lineStyle: {
- color: "#F72C5B",
- },
- data: [
- {
- yAxis: powerproductionNum.value,
- },
- ],
- },
- },
- ];
- chartId++;
- }
- tableColumn.value = jsonData.tableData.title.map((o) => {
- return {
- prop: o.key,
- label: o.des,
- width: o.des === "时间" ? 100 : 80,
- };
- });
- tableData.value = jsonData.tableData.data;
-
-
- isChartArea.value = false;
- const chartRes = jsonData.analysisData;
- maxMinData.value = [chartRes.maxhjwd, chartRes.minhjwd];
- markDot.pcl5 = chartRes.obj.pc5ratio;
- markDot.pcl10 = chartRes.obj.pc10ratio;
- markDot.pcl12 = chartRes.obj.pc12ratio;
- markDot.pcl25 = chartRes.obj.pc25ratio;
- avgObj.title = chartRes.obj.path
- .substring(
- chartRes.obj.path.indexOf(chartRes.obj.station + "_") +
- (chartRes.obj.station + "_").length
- )
- .split("_")[0];
- avgObj.cpavg = Number(chartRes.obj.cpavg).toFixed(2);
- avgObj.frequency = Number(chartRes.obj.frequency).toFixed(2);
- avgObj.pcratio = Number(chartRes.obj.pcratio).toFixed(2);
- const color = [
- "#1C99FF",
- "#FF8700",
- "#3D54BE",
- "#fa8c16",
- "#1DA0D7",
- "#DD5044",
- ];
- seriesData.value = [
- {
- name: "拟合功率",
- type: "line",
- symbol: "line",
- symbolSize: 0,
- smooth: true,
- data: chartRes.sjgl,
- xAxisIndex: 0,
- },
- {
- name: "保证功率",
- type: "line",
- symbol: "line",
- symbolSize: 0,
- smooth: true,
- data: chartRes.llgl,
- xAxisIndex: 0,
- },
- {
- type: "effectScatter",
- showEffectOn: "emphasis",
- rippleEffect: {
- scale: 1,
- },
- name: "数据散点",
- symbolSize: 5,
-
-
-
-
-
-
-
-
- data: chartRes.scatter,
- xAxisIndex: 0,
- yAxisIndex: 0,
- },
- ];
- }
- };
- onMounted(() => {
- initPageData();
- funGetProcessTree();
- theme.value = store.state.theme;
- echartsTheme.value = !theme.value ? "dark" : "";
- tableHeight.value = window.innerHeight - 171 + "px";
- excelHeight.value = window.innerHeight - 111 + "px";
- treeHeight.value = window.innerHeight - 111 + "px";
- window.addEventListener("resize", () => {
- tableHeight.value = window.innerHeight - 171 + "px";
- excelHeight.value = window.innerHeight - 111 + "px";
- treeHeight.value = window.innerHeight - 111 + "px";
- });
-
-
-
-
-
-
- });
- onActivated(() => {
-
- });
- </script>
- <style lang="less" scoped>
- .dataAnalysisHotAns {
- height: 100%;
- .dataAnalysisHotAnsMain {
- height: 100%;
- .main_top {
- height: 40px;
- display: flex;
- align-items: center;
- .topPsty {
- position: relative;
- top: 5px;
- padding: 7px 20px;
- font-size: 12px;
- font-weight: 600;
- margin-left: 10px;
- border-radius: 3px;
- }
- }
- .main {
- display: flex;
- width: 100%;
- .treeDataMain,
- .excelDataMain,
- .tableDataMain {
- border-radius: 10px;
- }
- .treeDataMain {
- margin-right: 10px;
- padding: 10px 0 10px 10px;
- width: calc(19% - 20px);
- }
- .excelDataMain {
- margin-right: 10px;
- padding: 10px 0 10px 10px;
- width: calc(15% - 20px);
- }
- .tableDataMain {
- padding: 10px;
- width: calc(66% - 20px);
- position: relative;
- .chartIcon {
- cursor: pointer;
- }
- .butten_com {
- position: absolute;
- right: 20px;
- z-index: 111111;
- }
- }
- }
- }
- }
- .themeDark {
- .dataAnalysisHotAnsMain {
- .main_top {
- .topPsty {
- color: #1c99ff;
- background: #1e2126;
- }
- }
- .main {
- background: #13171e;
- .treeDataMain {
- background: transparent;
- }
- .excelDataMain {
- background: #313233;
- }
- .tableDataMain {
- margin-top: 5px;
- background: #212223;
- }
- }
- }
- }
- .themeLight {
- padding: 0;
- .dataAnalysisHotAnsMain {
- .main_top {
- .topPsty {
- color: #2778ff;
- background: #ffffff;
- }
- }
- .main {
- background: #e6e8f2;
- .treeDataMain {
- background: transparent;
- }
- .excelDataMain {
- background: #f4f6fb;
- }
- .tableDataMain {
- background: #fff;
- margin-top: 5px;
- }
- }
- }
- }
- </style>
|