123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644 |
- <template>
- <div class="powerPredictionPage" :class="!theme ? 'themeDark' : 'themeLight'">
- <el-row class="windStstus">
- <el-col :span="6" class="scrollbar">
- <!-- <span class="scrollbarName">场站名称:</span> -->
- <div class="seachPower">
- <el-form class="generat-seach" :inline="true">
- <el-form-item label="场站">
- <el-select v-model="reportStation" placeholder="选择场站" @change="changeWindNo">
- <el-option v-for="item in stationData" :key="item.no" :label="item.stationName"
- :value="item.no">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="seachData">查询</el-button>
- </el-form-item>
- </el-form>
- </div>
- <!-- <el-scrollbar>
- <div class="scrollbar-flex-content">
- <p v-for="item in stationData" :key="item.no" class="scrollbar-demo-item"
- :class="item.showBac ? 'changeBacksty' : 'defaultBacksty'" @click="changeStation(item.no)">
- {{ item.stationName }}
- </p>
- </div>
- </el-scrollbar> -->
- </el-col>
- <el-col :span="17">
- <div class="everyOne" v-for="(item, index) in !theme ? statusData : statusDataW" :key="index"
- :style="statusSty(item)">
- <div class="everyOneImg" style="width: 39px">
- <img :src="item.img" alt="" />
- </div>
- <span class="statusName"
- :style="{ color: `${!theme ? item.borderSty : '#fff'}` }">{{ item.name }}</span>
- <span class="statusNum" :style="statusNumSty(item)">{{
- item.number
- }}</span>
- </div>
- </el-col>
- </el-row>
- <div class="lineMain" :style="pageHeight">
- <el-row>
- <el-col :span="14">
- <div class="lineStyle" v-on:dblclick="doubleclick('功率预测')" style="position: relative">
- <div style="
- display: flex;
- float: right;
- justify-content: end;
- margin-right: 23px;
- ">
- <div v-for="item in showpowerLegend" :key="item.name">
- <span class="lineColor" :style="{ background: item.color }"></span>
- <span class="powerLegendColor" :style="{ background: item.color }"></span>
- <span :style="!theme ? 'color: #fff' : ''" style="
- font-size: 12px;
- margin-left: 12px;
- position: relative;
- top: 1px;
- ">{{ item.name }}</span>
- </div>
- </div>
- <div class="chart-name">
- <div class="point point-left bottom"></div>
- <div class="point point-right bottom"></div>
- </div>
- <div id="powerChart" :style="chartStyle"></div>
- </div>
- <div class="lineStyle" v-on:dblclick="doubleclick('风速预测')" style="position: relative">
- <div class="chart-name">
- <div class="point point-left bottom"></div>
- <div class="point point-right bottom"></div>
- </div>
- <div id="windChart" :style="chartStyle"></div>
- </div>
- <div class="lineStyle" style="position: relative">
- <div class="chart-name">
- <div class="point point-left bottom"></div>
- <div class="point point-right bottom"></div>
- </div>
- <div id="assessmentChart" :style="chartStyle"></div>
- </div>
- </el-col>
- <el-col :span="10">
- <div class="lineStyle1" style="position: relative">
- <div class="chart-name">
- <div class="point point-left bottom"></div>
- <div class="point point-right bottom"></div>
- </div>
- <div id="installChart" :style="messageStyle"></div>
- </div>
- <div class="lineStyle1" :style="messageStylexc">
- <div style="display: flex" :style="messageStyle">
- <div style="width: 50%">
- <div id="guageChart" style="width: 100%; height: 100%"></div>
- </div>
- <div style="width: 50%">
- <div id="radarChart" style="width: 100%; height: 100%"></div>
- </div>
- </div>
- <div style="display: flex" :style="messageStyle">
- <div style="width: 50%">
- <div id="guageChart1" style="width: 100%; height: 100%"></div>
- </div>
- <div style="width: 50%">
- <div id="guageChart2" style="width: 100%; height: 100%"></div>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <power-prediction-dialog ref="prediction" :ExceedTimeList="ExceedTimeList" :echartsTheme="echartsTheme"
- :theme="theme"></power-prediction-dialog>
- </div>
- </template>
- <script>
- import powerPredictionDialog from "../../components/powerPredictionComponent/powerPredictionDialog/predictionDialogPage.vue";
- import {
- apiGetStationGL,
- apiGetglobalPowerCharts,
- apiGetglobalWindSpeedCharts,
- apiGetinstalledCapacity,
- apiGetpredictedAssessmentScores,
- apiGetmeteorologicalElements,
- apiGetwindRosetteChart,
- apiGetUnitStatusInfoByStationNo,
- } from "../../api/api";
- import oneimg from "@/assets/windStatusPic/yunxing.png";
- import twoimg from "@/assets/windStatusPic/daiji.png";
- import threeimg from "@/assets/windStatusPic/weihu.png";
- import fourimg from "@/assets/windStatusPic/tingji.png";
- import fiveimg from "@/assets/windStatusPic/xiandian.png";
- import siximg from "@/assets/windStatusPic/shoulei.png";
- import sevenimg from "@/assets/windStatusPic/guzhang.png";
- import oneimg1 from "@/assets/windStatusPic/yunxing_W.png";
- import twoimg1 from "@/assets/windStatusPic/daiji_W.png";
- import threeimg1 from "@/assets/windStatusPic/weihu_W.png";
- import fourimg1 from "@/assets/windStatusPic/tingji_W.png";
- import fiveimg1 from "@/assets/windStatusPic/xiandian_W.png";
- import siximg1 from "@/assets/windStatusPic/shoulei_W.png";
- import sevenimg1 from "@/assets/windStatusPic/guzhang_W.png";
- import jsonData from "./component/power.json";
- import {
- apiGethomeData
- } from "@/api/gengra";
- export default {
- components: {
- powerPredictionDialog,
- },
- data() {
- return {
- windTurbines: "",
- reportStation: "",
- stationCode: "",
- statusData: [],
- statusDataW: [],
- stationData: [],
- pickerTime: [],
- pickerTimeDia: [],
- itemVal: "",
- planFiveMin: "",
- showpowerLegend: [],
- echartsTheme: "",
- theme: null,
- };
- },
- watch: {
- "$store.state.theme": {
- handler: function (newVal, oldVal) {
- this.theme = newVal;
- this.echartsTheme = !newVal ? "dark" : "";
- this.pickerTime = [
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
- ),
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
- 24 * 60 * 60 * 1000
- ),
- ];
- this.pickerTimeDia = [
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
- ),
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
- 24 * 60 * 60 * 1000 -
- 1000
- ),
- ];
- this.getStationData();
- },
- immediate: true,
- },
- },
- created() {
- this.statusData = [{
- img: oneimg,
- name: "运行",
- nameEn: "yxsum",
- borderSty: "#1C99FF",
- backSty: "#0046C7",
- numBack: "#212223",
- number: 0,
- },
- {
- img: twoimg,
- name: "待机",
- nameEn: "djsum",
- borderSty: "#05BB4C",
- backSty: "#258952",
- numBack: "#212223",
- number: 0,
- },
- {
- img: sevenimg,
- name: "故障",
- nameEn: "jxsum",
- borderSty: "#BA3237",
- backSty: "#73262B",
- numBack: "#212223",
- number: 0,
- },
- {
- img: threeimg,
- name: "维护",
- nameEn: "whsum",
- borderSty: "#E17D24",
- backSty: "#694119",
- numBack: "#212223",
- number: 0,
- },
- {
- img: fiveimg,
- name: "限电",
- nameEn: "xdsum",
- borderSty: "#C530C8",
- backSty: "#7A277F",
- numBack: "#212223",
- number: 0,
- },
- {
- img: siximg,
- name: "受累",
- nameEn: "tjsum",
- borderSty: "#fff",
- backSty: "#38393B",
- numBack: "#212223",
- number: 0,
- },
- {
- img: fourimg,
- name: "离线",
- nameEn: "lxsum",
- borderSty: "#52595B",
- backSty: "#272a2b",
- numBack: "#212223",
- number: 0,
- },
- ];
- this.statusDataW = [{
- img: oneimg1,
- name: "运行",
- nameEn: "yxsum",
- borderSty: "#3777E8",
- backSty: "#1850B3",
- numBack: "#073484",
- number: 0,
- },
- {
- img: twoimg1,
- name: "待机",
- nameEn: "djsum",
- borderSty: "#6BDB97",
- backSty: "#0EAC4C",
- numBack: "#077C35",
- number: 0,
- },
- {
- img: sevenimg1,
- name: "故障",
- nameEn: "jxsum",
- borderSty: "#73262B",
- backSty: "#BA3237",
- numBack: "#881B1F",
- number: 0,
- },
- {
- img: threeimg1,
- name: "维护",
- nameEn: "whsum",
- borderSty: "#F1AF74",
- backSty: "#E17D24",
- numBack: "#A6530A",
- number: 0,
- },
- {
- img: fiveimg1,
- name: "限电",
- nameEn: "xdsum",
- borderSty: "#E757EA",
- backSty: "#C530C8",
- numBack: "#901193",
- number: 0,
- },
- {
- img: fourimg1,
- name: "受累",
- nameEn: "tjsum",
- borderSty: "#CDCDCD",
- backSty: "#A8A8A8",
- numBack: "#878787",
- number: 0,
- },
- {
- img: siximg1,
- name: "离线",
- nameEn: "lxsum",
- borderSty: "#595D61",
- backSty: "#38393B",
- numBack: "#151719",
- number: 0,
- },
- ];
- this.pickerTime = [
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
- ),
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
- 24 * 60 * 60 * 1000
- ),
- ];
- this.pickerTimeDia = [
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
- ),
- new Date(
- new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
- 24 * 60 * 60 * 1000 -
- 1000
- ),
- ];
- this.ExceedTimeList = [{
- label: "超前15分钟",
- value: 0,
- },
- {
- label: "超前30分钟",
- value: 1,
- },
- {
- label: "超前45分钟",
- value: 2,
- },
- {
- label: "超前1小时",
- value: 3,
- },
- {
- label: "超前1小时15分钟",
- value: 4,
- },
- {
- label: "超前1小时30分钟",
- value: 5,
- },
- {
- label: "超前1小时45分钟",
- value: 6,
- },
- {
- label: "超前2小时",
- value: 7,
- },
- {
- label: "超前2小时15分钟",
- value: 8,
- },
- {
- label: "超前2小时30分钟",
- value: 9,
- },
- {
- label: "超前2小时45分钟",
- value: 10,
- },
- {
- label: "超前3小时",
- value: 11,
- },
- {
- label: "超前3小时15分钟",
- value: 12,
- },
- {
- label: "超前3小时30分钟",
- value: 13,
- },
- {
- label: "超前3小时45分钟",
- value: 14,
- },
- {
- label: "超前4小时",
- value: 15,
- },
- {
- label: "超前5小时",
- value: 19,
- },
- {
- label: "超前6小时",
- value: 23,
- },
- ];
- this.showpowerLegend = [{
- name: "理论",
- color: "#5672c4",
- },
- {
- name: "可用",
- color: "#95cc7a",
- },
- {
- name: "AGC",
- color: "#f7c75f",
- },
- {
- name: "超短期",
- color: "#e96366",
- },
- {
- name: "实际",
- color: "#7ac1dd",
- },
- ];
- // this.getStationData();
- },
- computed: {
- pageHeight() {
- return {
- height: document.documentElement.clientHeight - 110 + "px",
- };
- },
- chartStyle() {
- let height =
- (document.documentElement.clientHeight - 100 - 100) / 3 + "px";
- return {
- width: "100%",
- height: height,
- };
- },
- messageStyle() {
- let height =
- (document.documentElement.clientHeight - 100 - 100) / 3 + "px";
- return {
- width: "96%",
- height: height,
- };
- },
- messageStylexc() {
- let height =
- ((document.documentElement.clientHeight - 100 - 60) / 3) * 2 + "px";
- return {
- width: "96%",
- height: height,
- };
- },
- },
- mounted() {
- let that = this;
- that.initPageData();
- that.planFiveMin = setInterval(function () {
- // that.seachData();
- }, 300000);
- },
- beforeRouteLeave(to, from, next) {
- next();
- if (this.planFiveMin) {
- clearInterval(this.planFiveMin);
- this.planFiveMin = null;
- }
- },
- methods: {
- initPageData() {
- const that = this;
- {
- let xAxis = [];
- let series = [];
- let legend = [];
- jsonData.globalPowerPredictionChartData2.dateList.forEach((item) => {
- xAxis.push(item.substring(item.indexOf(" ") + 1));
- });
- jsonData.globalPowerPredictionChartData2.dataFormatList.forEach(
- (iten) => {
- if (iten.name !== "短期") {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "line",
- data: iten.data.map((it) => {
- return that.$utils.isHasNum(it);
- }),
- symbol: "none",
- };
- series.push(seriesObj);
- }
- }
- );
- that.getPowerLine("powerChart", "功率预测", xAxis, legend, series);
- }
- {
- let xAxis = [];
- let series = [];
- let legend = [];
- jsonData.globalWindSpeedForecastChartData.dateList.forEach((item) => {
- xAxis.push(item.substring(item.indexOf(" ") + 1));
- });
- jsonData.globalWindSpeedForecastChartData.dataFormatList.forEach(
- (iten) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "line",
- data: iten.data.map((it) => {
- return that.$utils.isHasNum(it);
- }),
- symbol: "none",
- };
- series.push(seriesObj);
- }
- );
- that.getPowerLine("windChart", "风速预测", xAxis, legend, series);
- }
- {
- let xAxis = [];
- let series = [];
- let legend = [];
- jsonData.installedCapacityData.name.forEach((item) => {
- xAxis.push(item);
- });
- jsonData.installedCapacityData.dataFormatList.forEach((iten, index) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "bar",
- barGap: 0,
- emphasis: {
- focus: "series",
- },
- data: iten.data.map((it) => {
- return that.$utils.isHasNum(it);
- }),
- };
- series.push(seriesObj);
- });
- that.getPowerBar("installChart", "功率统计", xAxis, legend, series);
- }
- {
- let xAxis = [];
- let series = [];
- let legend = [];
- jsonData.predictedAssessmentScoresData.name.forEach((item) => {
- xAxis.push(item);
- });
- jsonData.predictedAssessmentScoresData.dataFormatList.forEach(
- (iten, index) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "bar",
- barGap: 0,
- emphasis: {
- focus: "series",
- },
- data: iten.data.map((it) => {
- return that.$utils.isHasNum(it);
- }),
- };
- series.push(seriesObj);
- }
- );
- that.getPowerBar(
- "assessmentChart",
- "预测考核分数",
- xAxis,
- legend,
- series
- );
- }
- {
- // let radar = [];
- // let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
- // let serise = [{
- // value: [],
- // name: "实际风向",
- // },
- // {
- // value: [],
- // name: "预测风向",
- // },
- // ];
- // jsonData.windRosetteChartData.dataFormatList[0].data.forEach(
- // (item, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // let obj = {
- // name: (index + 1) * 5,
- // };
- // radar.unshift(obj);
- // }
- // }
- // );
- // jsonData.windRosetteChartData.dataFormatList.forEach((itn) => {
- // let ser1 = [];
- // let ser2 = [];
- // if (itn.name === "预测风速") {
- // itn.data.forEach((it, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
- // }
- // });
- // serise[1].value = ser1;
- // } else {
- // itn.data.forEach((it, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
- // }
- // });
- // serise[0].value = ser2;
- // }
- // });
- // radar.forEach((itb) => {
- // if (itb.name === 360) {
- // itb.name = "北";
- // } else if (itb.name === 45) {
- // itb.name = "东北";
- // } else if (itb.name === 90) {
- // itb.name = "东";
- // } else if (itb.name === 135) {
- // itb.name = "东南";
- // } else if (itb.name === 180) {
- // itb.name = "南";
- // } else if (itb.name === 225) {
- // itb.name = "西南";
- // } else if (itb.name === 270) {
- // itb.name = "西";
- // } else if (itb.name === 315) {
- // itb.name = "西北";
- // }
- // });
- let serise = []
- jsonData.meteorologicalElementsData.dataFormatList.forEach(it => {
- if (it.name === '风向') {
- serise = it.data
- }
- })
- that.getRose(serise);
- }
- const gaugeData = [{
- title: {
- offsetCenter: ["-40%", "85%"],
- },
- detail: {
- offsetCenter: ["-40%", "110%"],
- },
- },
- {
- title: {
- offsetCenter: ["40%", "85%"],
- },
- detail: {
- offsetCenter: ["40%", "110%"],
- },
- },
- ];
- jsonData.meteorologicalElementsData.dataFormatList.forEach((item) => {
- gaugeData[0].name = "实际" + item.name;
- gaugeData[0].value = Math.ceil(item.data[1]);
- gaugeData[1].name = "预测" + item.name;
- gaugeData[1].value = Math.ceil(item.data[0]);
- if (item.name === "温度") {
- that.getGaugeX("guageChart", gaugeData);
- } else if (item.name === "湿度") {
- that.getGaugeX("guageChart1", gaugeData);
- } else {
- that.getGaugeX("guageChart2", gaugeData);
- }
- });
- that.statusData.forEach((item) => {
- for (let it in jsonData.unitStatusInfoByStationNoData) {
- if (item.nameEn === it) {
- item.number = jsonData.unitStatusInfoByStationNoData[it];
- }
- }
- });
- that.statusDataW.forEach((item) => {
- for (let it in jsonData.unitStatusInfoByStationNoData) {
- if (item.nameEn === it) {
- item.number = jsonData.unitStatusInfoByStationNoData[it];
- }
- }
- });
- },
- statusSty(item) {
- return `border: 1px solid ${item.borderSty};background: ${item.backSty}`;
- },
- statusNumSty(item) {
- return `border: 1px solid ${item.borderSty};background:${item.numBack}`;
- },
- doubleclick(name) {
- let title = this.reportStation;
- // debugger
- // this.stationData.forEach((item) => {
- // if (item.stationName === this.windTurbines) {
- // title = item.stationName;
- // }
- // });
- this.$refs.prediction.dialogVisible = true;
- this.$refs.prediction.isPower = false;
- this.$refs.prediction.tableData = [];
- this.$refs.prediction.dateType = 1;
- this.$refs.prediction.title = title + name;
- this.$refs.prediction.loading = true;
- this.$refs.prediction.pickerTime = this.pickerTimeDia;
- this.$refs.prediction.windTurbines = this.windTurbines;
- this.$refs.prediction.windTurbinesVal = this.itemVal;
- this.$nextTick(() => {
- const myChart1 = this.$echarts.init(
- document.getElementById("powerChart"),
- this.echartsTheme
- );
- const myChart2 = this.$echarts.init(
- document.getElementById("windChart"),
- this.echartsTheme
- );
- myChart1.dispatchAction({
- type: "hideTip",
- });
- myChart2.dispatchAction({
- type: "hideTip",
- });
- if (name === "功率预测") {
- this.$refs.prediction.isPower = true;
- this.$refs.prediction.getChartsData();
- this.$refs.prediction.getTableData();
- } else {
- this.$refs.prediction.isPower = false;
- this.$refs.prediction.getwindChartsData();
- this.$refs.prediction.getwindTableData();
- }
- });
- },
- getStationData() {
- apiGetStationGL().then((datas) => {
- this.stationData = datas.data.list;
- this.stationData[0].showBac = true;
- this.windTurbines = datas.data.list[0].no;
- this.reportStation = datas.data.list[0].stationName;
- this.stationCode = datas.data.list[0].stationCode;
- this.itemVal = datas.data.list[0].itemVal;
- this.getPowerPrediction();
- this.getWindSpeed();
- this.getCapacity();
- this.getAssessmentScore();
- this.getIrradiance();
- // this.getwindRosetteChart();
- this.getUnitStatus();
- });
- },
- // 根据场站编号获取机组状态信息
- getUnitStatus() {
- let that = this;
- // let params = {
- // stationNo: that.windTurbines,
- // };
- // apiGetUnitStatusInfoByStationNo(params).then((datas) => {
- // if (datas) {
- // if (datas.data) {
- // that.statusData.forEach((item) => {
- // for (let it in datas.data) {
- // if (item.nameEn === it) {
- // item.number = datas.data[it];
- // }
- // }
- // });
- // that.statusDataW.forEach((item) => {
- // for (let it in datas.data) {
- // if (item.nameEn === it) {
- // item.number = datas.data[it];
- // }
- // }
- // });
- // }
- // }
- // });
- let params = {
- wpId: this.stationCode,
- };
- apiGethomeData(params)
- .then((res) => {
- if (res && res.data.ztmap) {
- that.statusData.forEach((item) => {
- for (let it in res.data.ztmap) {
- if (item.nameEn === it) {
- item.number = res.data.ztmap[it];
- }
- }
- });
- that.statusDataW.forEach((item) => {
- for (let it in res.data.ztmap) {
- if (item.nameEn === it) {
- item.number = res.data.ztmap[it];
- }
- }
- });
- }
- })
- },
- changeWindNo(val) {
- this.windTurbines = val
- this.stationData.forEach((item) => {
- if (item.no === val) {
- this.stationCode = item.stationCode
- this.reportStation = item.stationName;
- }
- });
- },
- statusIcon(type) {
- let picture = "";
- if (type === "1") {
- picture = "yunxingPic";
- } else if (type === "2") {
- picture = "daijiPic";
- } else if (type === "3") {
- picture = "weihuPic";
- } else if (type === "4") {
- picture = "tingjiPic";
- } else if (type === "5") {
- picture = "xiandianPic";
- } else if (type === "6") {
- picture = "lixianPic";
- } else if (type === "7") {
- picture = "jianxiuPic";
- }
- return picture;
- },
- seachData() {
- this.getPowerPrediction();
- this.getWindSpeed();
- this.getCapacity();
- this.getAssessmentScore();
- // this.getwindRosetteChart();
- this.getIrradiance();
- this.getUnitStatus();
- },
- // 今日功率预测
- getPowerPrediction() {
- let pickStartTime = this.$utils.getTime(this.pickerTime[0]);
- let pickEndTime = this.$utils.getTime(this.pickerTime[1]);
- let type = 2;
- // if (
- // new Date(pickEndTime).getTime() - new Date(pickStartTime).getTime() <=
- // 10 * 86400000
- // ) {
- // type = 1;
- // } else {
- // type = 2;
- // }
- let params = {
- beginDataTime: pickStartTime,
- endDataTime: pickEndTime,
- stationNumber: this.windTurbines,
- timeType: type,
- // itemVal: this.itemVal,
- itemVal: 0,
- leadTime: 0
- };
- apiGetglobalPowerCharts(params).then((datas) => {
- if (datas && datas.data) {
- let xAxis = [];
- let series = [];
- let legend = [];
- if (datas.data.dateList.length > 0) {
- datas.data.dateList.forEach((item) => {
- xAxis.push(item.substring(item.indexOf(" ") + 1));
- });
- }
- if (datas.data.dataFormatList.length > 0) {
- datas.data.dataFormatList.forEach((iten) => {
- if (iten.name !== "短期") {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "line",
- data: iten.data.map((it) => {
- return this.$utils.isHasNum(it);
- }),
- symbol: "none",
- };
- series.push(seriesObj);
- }
- });
- }
- this.getPowerLine("powerChart", "功率预测", xAxis, legend, series);
- }
- });
- },
- // 今日风速预测
- getWindSpeed() {
- let pickStartTime = this.$utils.getTime(this.pickerTime[0]);
- let pickEndTime = this.$utils.getTime(this.pickerTime[1]);
- let type;
- if (
- new Date(pickEndTime).getTime() - new Date(pickStartTime).getTime() <=
- 10 * 86400000
- ) {
- type = 1;
- } else {
- type = 2;
- }
- let params = {
- beginDataTime: pickStartTime,
- endDataTime: pickEndTime,
- stationNumber: this.windTurbines,
- timeType: type,
- };
- apiGetglobalWindSpeedCharts(params).then((datas) => {
- if (datas && datas.data) {
- let xAxis = [];
- let series = [];
- let legend = [];
- if (datas.data.dateList.length > 0) {
- datas.data.dateList.forEach((item) => {
- xAxis.push(item.substring(item.indexOf(" ") + 1));
- });
- }
- if (datas.data.dataFormatList.length > 0) {
- datas.data.dataFormatList.forEach((iten) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "line",
- data: iten.data.map((it) => {
- return this.$utils.isHasNum(it);
- }),
- symbol: "none",
- };
- series.push(seriesObj);
- });
- }
- this.getPowerLine("windChart", "风速预测", xAxis, legend, series);
- }
- });
- },
- getPowerLine(name, title, xAxis, legend, series) {
- let option = {
- backgroundColor: "",
- title: {
- text: title,
- textStyle: {
- fontSize: "16",
- fontWeight: "bold",
- },
- },
- tooltip: {
- trigger: "axis",
- formatter: name === "powerChart" ?
- (item) => {
- let str =
- `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
- let strMsg = "";
- if (item.length > 1) {
- item.forEach((it, index) => {
- // if (index !== 3) {
- if (it.seriesName !== "超短期") {
- strMsg = `<div style="margin-bottom: 5px">
- <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>
- <span style="display:inline-block;">${it.seriesName}:</span> <span>${it.value}</span>
- </div>`;
- this.showpowerLegend[index].name = it.seriesName;
- this.showpowerLegend[index].color = it.color;
- } else {
- if (it.axisValue === "00:15:00") {
- it.color = "#e96366";
- }
- strMsg = `<div style="margin-bottom: 5px">
- <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
- it.color
- };\"></span>
- <span style="display:inline-block;">${
- it.color === "#e96366" ? "超短期" : "短期"
- }:</span> <span>${it.value}</span>
- </div>`;
- if (it.color === "#e96366") {
- this.showpowerLegend[index].name = "超短期";
- } else {
- this.showpowerLegend[index].name = "短期";
- }
- this.showpowerLegend[index].color = it.color;
- }
- str = str + strMsg;
- });
- } else {
- if (item[0].axisValue === "00:15:00") {
- item[0].color = "#e96366";
- }
- strMsg = `<div style="margin-bottom: 5px">
- <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
- item[0].color
- };\"></span>
- <span style="display:inline-block;">${
- item[0].color === "#e96366" ? "超短期" : "短期"
- }:</span> <span>${item[0].value}</span>
- </div>`;
- if (item[0].color === "#e96366") {
- this.showpowerLegend[3].name = "超短期";
- } else {
- this.showpowerLegend[3].name = "短期";
- }
- this.showpowerLegend[3].color = item[0].color;
- str = str + strMsg;
- }
- return str;
- } : "",
- },
- legend: {
- // width: '380',
- right: "20",
- data: legend,
- // show: name === 'powerChart' ? false : true
- show: false,
- },
- grid: {
- left: "5%",
- right: "5%",
- bottom: "3%",
- containLabel: true,
- },
- xAxis: {
- type: "category",
- boundaryGap: false,
- data: xAxis,
- },
- yAxis: {
- type: "value",
- name: title === "功率预测" ? "兆瓦(Mw)" : "m/s",
- },
- series: series,
- };
- if (name === "powerChart") {
- let hour = new Date().getHours() + 6;
- let min = new Date().getMinutes();
- let allTime = "";
- let num = 0;
- if (0 <= min && min < 15) {
- allTime = hour + ":00:00";
- } else if (15 <= min && min < 30) {
- allTime = hour + ":15:00";
- } else if (30 <= min && min < 45) {
- allTime = hour + ":30:00";
- } else if (45 <= min && min < 60) {
- allTime = hour + ":45:00";
- }
- xAxis.forEach((item, index) => {
- if (item === allTime) {
- num = index;
- }
- });
- if (num > 0) {
- option.visualMap = {
- show: false,
- dimension: 0,
- seriesIndex: 3,
- pieces: [{
- gt: 0,
- lte: num,
- color: "#e96366",
- },
- {
- gt: num,
- color: "#39ccd9",
- },
- ],
- };
- }
- } else {
- option.legend.show = true;
- option.data = legend;
- option.right = "20";
- }
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById(name);
- dom.removeAttribute("_echarts_instance_") ?
- dom.removeAttribute("_echarts_instance_") :
- "";
- let myChart = this.$echarts.init(dom, this.echartsTheme);
- myChart.setOption(option);
- myChart.on("mousemove", this.setTooltip("powerChart", "windChart", 0));
- myChart.on("mouseover", function (params) {
- console.log("myChart1=====>>>>>", params);
- });
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- },
- setTooltip(name1, name2, num) {
- const myChart1 = this.$echarts.init(
- document.getElementById(name1),
- this.echartsTheme
- );
- const myChart2 = this.$echarts.init(
- document.getElementById(name2),
- this.echartsTheme
- );
- this.$utils.setTooltip(myChart1, myChart2, num);
- },
- // 装机,并网,实时,可用电量
- getCapacity() {
- let params = {
- stationNumber: this.windTurbines,
- // itemVal: this.itemVal
- itemVal: 0,
- };
- apiGetinstalledCapacity(params).then((datas) => {
- if (datas && datas.data) {
- let xAxis = [];
- let series = [];
- let legend = [];
- if (datas.data.name.length > 0) {
- datas.data.name.forEach((item) => {
- xAxis.push(item);
- });
- }
- if (datas.data.dataFormatList.length > 0) {
- datas.data.dataFormatList.forEach((iten, index) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "bar",
- barGap: 0,
- emphasis: {
- focus: "series",
- },
- data: iten.data.map((it) => {
- return this.$utils.isHasNum(it);
- }),
- };
- series.push(seriesObj);
- });
- }
- this.getPowerBar("installChart", "功率统计", xAxis, legend, series);
- }
- });
- },
- // 预测考核分数
- getAssessmentScore() {
- let params = {
- stationNumber: this.windTurbines,
- };
- apiGetpredictedAssessmentScores(params).then((datas) => {
- if (datas && datas.data) {
- let xAxis = [];
- let series = [];
- let legend = [];
- if (datas.data.name.length > 0) {
- datas.data.name.forEach((item) => {
- xAxis.push(item);
- });
- }
- if (datas.data.dataFormatList.length > 0) {
- datas.data.dataFormatList.forEach((iten, index) => {
- legend.push(iten.name);
- let seriesObj = {
- name: iten.name,
- type: "bar",
- barGap: 0,
- emphasis: {
- focus: "series",
- },
- data: iten.data.map((it) => {
- return this.$utils.isHasNum(it);
- }),
- };
- series.push(seriesObj);
- });
- }
- this.getPowerBar(
- "assessmentChart",
- "预测考核分数",
- xAxis,
- legend,
- series
- );
- }
- });
- },
- getPowerBar(name, title, xAxis, legend, series) {
- let option = {
- backgroundColor: "",
- title: {
- text: title,
- textStyle: {
- fontSize: "16",
- fontWeight: "bold",
- },
- },
- tooltip: {
- trigger: "axis",
- axisPointer: {
- type: "shadow",
- },
- },
- grid: {
- left: "5%",
- right: "5%",
- bottom: "3%",
- containLabel: true,
- },
- legend: {
- // bottom: bott,
- right: "20",
- data: legend,
- },
- xAxis: [{
- type: "category",
- axisTick: {
- show: false,
- },
- data: xAxis,
- }, ],
- yAxis: [{
- type: "value",
- name: title === "预测考核分数" ? "分" : "兆瓦(M/w)",
- }, ],
- series: series,
- };
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById(name);
- dom.removeAttribute("_echarts_instance_") ?
- dom.removeAttribute("_echarts_instance_") :
- "";
- let myChart = this.$echarts.init(dom, this.echartsTheme);
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- },
- // 仪表盘,玫瑰图
- getIrradiance() {
- let params = {
- dateTime: this.getPowerTime(new Date()),
- stationNumber: this.windTurbines,
- };
- apiGetmeteorologicalElements(params).then((datas) => {
- if (datas.data && datas.data.dataFormatList.length > 0) {
- const gaugeData = [{
- title: {
- offsetCenter: ["-40%", "85%"],
- },
- detail: {
- offsetCenter: ["-40%", "110%"],
- },
- },
- {
- title: {
- offsetCenter: ["40%", "85%"],
- },
- detail: {
- offsetCenter: ["40%", "110%"],
- },
- },
- ];
- datas.data.dataFormatList.forEach((item) => {
- gaugeData[0].name = "实际" + item.name;
- gaugeData[0].value = Math.ceil(item.data[1]);
- gaugeData[1].name = "预测" + item.name;
- gaugeData[1].value = Math.ceil(item.data[0]);
- if (item.name === "温度") {
- this.getGaugeX("guageChart", gaugeData);
- } else if (item.name === "湿度") {
- this.getGaugeX("guageChart1", gaugeData);
- } else if (item.name === '风向') {
- this.getRose(item.data);
- } else {
- this.getGaugeX("guageChart2", gaugeData);
- }
- });
- }
- });
- },
- //转换时间
- getPowerTime(date) {
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- m = m < 10 ? "0" + m : m;
- var d = date.getDate();
- d = d < 10 ? "0" + d : d;
- var h = date.getHours();
- h = h < 10 ? "0" + h : h;
- var minute = date.getMinutes();
- minute = minute < 10 ? "0" + minute : minute;
- // var second=date.getSeconds();
- // second=second < 10 ? ('0' + second) : second;
- // return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
- let timeF = "";
- timeF = y + "-" + m + "-" + d + " " + h + ":" + minute;
- return this.$utils.changePowerPickDate(timeF);
- },
- getGaugeX(name, servies) {
- let formatVal = "";
- let maxNum = null;
- let minNum = null;
- if (name === "guageChart") {
- formatVal = "{value}℃";
- maxNum = 50;
- minNum = -50;
- } else if (name === "guageChart1") {
- formatVal = "{value}%";
- maxNum = 100;
- minNum = 0;
- } else {
- formatVal = "{value}Pa";
- maxNum = 1500;
- minNum = 0;
- }
- let option = {
- series: [{
- type: "gauge",
- min: minNum,
- max: maxNum,
- anchor: {
- show: true,
- showAbove: true,
- size: 18,
- itemStyle: {
- color: "#FAC858",
- },
- },
- pointer: {
- icon: "path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z",
- width: 8,
- length: "80%",
- offsetCenter: [0, "8%"],
- },
- progress: {
- show: true,
- overlap: true,
- roundCap: true,
- },
- axisLine: {
- roundCap: true,
- },
- data: servies,
- title: {
- fontSize: 14,
- },
- detail: {
- width: 40,
- height: 14,
- fontSize: 14,
- color: "#fff",
- backgroundColor: "auto",
- borderRadius: 3,
- formatter: formatVal,
- },
- }, ],
- };
- if (!this.theme) {
- option.backgroundColor = "";
- }
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById(name);
- dom.removeAttribute("_echarts_instance_") ?
- dom.removeAttribute("_echarts_instance_") :
- "";
- let myChart = this.$echarts.init(dom, this.echartsTheme);
- // let that = this
- // setInterval(function () {
- // that.getIrradiance()
- // }, 2000);
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- },
- //风向玫瑰图
- getwindRosetteChart() {
- let params = {
- stationNumber: this.windTurbines,
- };
- apiGetwindRosetteChart(params).then((datas) => {
- if (datas && datas.data) {
- // let radar = [];
- // let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
- // let serise = [{
- // value: [],
- // name: "实际风向",
- // },
- // {
- // value: [],
- // name: "预测风向",
- // },
- // ];
- // datas.data.dataFormatList[0].data.forEach((item, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // let obj = {
- // name: (index + 1) * 5,
- // };
- // radar.unshift(obj);
- // }
- // });
- // datas.data.dataFormatList.forEach((itn) => {
- // let ser1 = [];
- // let ser2 = [];
- // if (itn.name === "预测风速") {
- // itn.data.forEach((it, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
- // }
- // });
- // serise[1].value = ser1;
- // } else {
- // itn.data.forEach((it, index) => {
- // if (radaxr.indexOf((index + 1) * 5) !== -1) {
- // ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
- // }
- // });
- // serise[0].value = ser2;
- // }
- // });
- // radar.forEach((itb) => {
- // if (itb.name === 360) {
- // itb.name = "北";
- // } else if (itb.name === 45) {
- // itb.name = "东北";
- // } else if (itb.name === 90) {
- // itb.name = "东";
- // } else if (itb.name === 135) {
- // itb.name = "东南";
- // } else if (itb.name === 180) {
- // itb.name = "南";
- // } else if (itb.name === 225) {
- // itb.name = "西南";
- // } else if (itb.name === 270) {
- // itb.name = "西";
- // } else if (itb.name === 315) {
- // itb.name = "西北";
- // }
- // });
- let serise = []
- datas.data.dataFormatList.forEach(it => {
- if (it.name === '风向') {
- serise = it.data
- }
- })
- console.log("风向", datas.data.dataFormatList)
- this.getRose(serise);
- }
- });
- },
- getRadar(radar, serise) {
- let option = {
- backgroundColor: "",
- legend: {
- bottom: "-5",
- data: ["实际", "预测"],
- },
- tooltip: {
- trigger: "item",
- formatter: (item) => {
- let str =
- `<span style="display:inline-block;margin-bottom:5px;">${item.name}(风向: 风速)</span></br>`;
- let strMsg = "";
- radar.forEach((it, index) => {
- strMsg = `<div>
- <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${item.color};\"></span>
- <span style="display:inline-block;width: 55%">${it.name}:</span> <span>${item.data.value[index]}</span>
- </div>`;
- str = str + strMsg;
- });
- return str;
- },
- },
- radar: {
- // shape: 'circle',
- indicator: radar,
- },
- series: [{
- type: "radar",
- data: serise,
- }, ],
- };
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById("radarChart");
- dom.removeAttribute("_echarts_instance_") ?
- dom.removeAttribute("_echarts_instance_") :
- "";
- let myChart = this.$echarts.init(dom, this.echartsTheme);
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- },
- getRose(serise) {
- let option = {
- backgroundColor: '',
- polar: {
- radius: [10, '80%']
- },
- radiusAxis: {
- // max: 25,
- startAngle: 75
- },
- angleAxis: {
- type: 'category',
- data: ["北", "东北", "东", "东南", "南", "西南", "西", "西北"],
- boundaryGap: false,
- axisLabel: {
- show: true,
- interval: 0,
- formatter: '{value}',
- align: 'center',
- margin: 10
- },
- axisTick: {
- show: true,
- alignWithLabel: true
- }
- },
- tooltip: {},
- series: [{
- name: '实际',
- type: 'bar',
- data: serise[1],
- coordinateSystem: 'polar',
- barWidth: 15
- },
- {
- name: '预测',
- type: 'bar',
- data: serise[0],
- coordinateSystem: 'polar',
- barWidth: 15
- }
- ],
- animation: false
- };
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById("radarChart");
- dom.removeAttribute("_echarts_instance_") ?
- dom.removeAttribute("_echarts_instance_") :
- "";
- let myChart = this.$echarts.init(dom, this.echartsTheme);
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize();
- });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- @import "../../viewsCss/powerPredictionPageLess.less";
- .themeDark {
- .windStstus {
- background: #040c0b;
- }
- .lineMain {
- background: #040c0b;
- .lineStyle,
- .lineStyle1 {
- background: #161f1e;
- .chart-name {
- display: flex;
- align-items: center;
- position: absolute;
- top: 0;
- height: 39px;
- width: 96%;
- border-bottom: 1px solid rgba(153, 153, 153, 0.5);
- .point {
- width: 6px;
- height: 1px;
- background-color: #ffffff;
- position: absolute;
- &.point-left {
- left: 0;
- }
- &.point-right {
- right: 0;
- }
- &.top {
- top: -1px;
- }
- &.bottom {
- bottom: -1px;
- }
- }
- }
- }
- }
- }
- .themeLight {
- .windStstus {
- // background: linear-gradient(0deg, transparent, #373590);
- }
- .lineMain {
- background: #edeffb;
- .lineStyle,
- .lineStyle1 {
- background: #fff;
- }
- }
- }
- </style>
|