homePageNoMap.vue 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379
  1. <template>
  2. <div class="homePageNoMap" :class="!theme ? 'themeDark' : 'themeLight'" :style="pageHeight">
  3. <div class="windStstus">
  4. <div class="everyOne" v-for="(item, index) in !theme ? statusData : statusDataW" :key="index"
  5. :style="statusSty(item)">
  6. <div class="everyOneImg" style="width: 39px">
  7. <img :src="item.img" alt="" />
  8. </div>
  9. <span class="statusName"
  10. :style="{ color: `${!theme ? item.borderSty : '#fff'}` }">{{ item.name }}</span>
  11. <span class="statusNum" :style="statusNumSty(item)">{{
  12. item.number
  13. }}</span>
  14. </div>
  15. </div>
  16. <div class="homePage_main">
  17. <div class="mainLeft">
  18. <div class="lineStyle" :style="leftDivStyle" v-on:dblclick="doubleclick('全域功率预测')"
  19. style="position: relative">
  20. <div style="
  21. display: flex;
  22. float: right;
  23. justify-content: end;
  24. margin-right: 53px;
  25. ">
  26. <div v-for="item in showpowerLegend" :key="item.name">
  27. <span class="lineColor" :style="{ background: item.color }"></span>
  28. <span class="powerLegendColor" :style="{ background: item.color }"></span>
  29. <span :style="!theme ? 'color: #fff' : ''" style="
  30. font-size: 12px;
  31. margin-left: 12px;
  32. position: relative;
  33. top: 1px;
  34. ">{{ item.name }}</span>
  35. </div>
  36. </div>
  37. <div class="chart-name">
  38. <div class="point point-left bottom"></div>
  39. <div class="point point-right bottom"></div>
  40. </div>
  41. <div id="lineChart" :style="lineChartStyle"></div>
  42. </div>
  43. <div class="lineStyle" :style="leftDivStyle" v-on:dblclick="doubleclick('全域风速预测')"
  44. style="position: relative">
  45. <div class="chart-name">
  46. <div class="point point-left bottom"></div>
  47. <div class="point point-right bottom"></div>
  48. </div>
  49. <!-- 两个按钮及以上 class="styleData" -->
  50. <div class="styleOneData">
  51. <span class="changeStyle" @click="getWindorSunDate('风速')">风速</span>
  52. <!-- <span
  53. :class="sunShow ? 'changeStyle' : 'defaultSty'"
  54. @click="getWindorSunDate('辐照度')"
  55. >辐照度</span
  56. > -->
  57. </div>
  58. <div id="lineChart1" :style="lineChartStyle"></div>
  59. </div>
  60. </div>
  61. <div class="mainRight">
  62. <div class="lineStyle" style="position: relative">
  63. <div class="chart-name">
  64. <div class="point point-left bottom"></div>
  65. <div class="point point-right bottom"></div>
  66. </div>
  67. <div id="barChart" :style="barChartStyle"></div>
  68. </div>
  69. <div class="lineStyle" style="position: relative">
  70. <div class="styleData">
  71. <span :class="dayShow ? 'changeStyle' : 'defaultSty'" @click="getbarDate('日')">日</span>
  72. <span :class="monthShow ? 'changeStyle' : 'defaultSty'" @click="getbarDate('月')">月</span>
  73. <span :class="yearShow ? 'changeStyle' : 'defaultSty'" @click="getbarDate('年')">年</span>
  74. </div>
  75. <div class="chart-name">
  76. <div class="point point-left bottom"></div>
  77. <div class="point point-right bottom"></div>
  78. </div>
  79. <div id="barChart1" :style="barChartStyle"></div>
  80. </div>
  81. <div class="messageData">
  82. <div :style="barChartStyle">
  83. <p style="margin-bottom: 30px">温馨提示:</p>
  84. <div class="msgHeight">
  85. <div v-for="(item, index) in messageDataxc" :key="index">
  86. <div style="display: flex">
  87. <!-- <span class="stationSty">{{ item.name }}</span> -->
  88. <!-- <span class="titleSty"
  89. :style="{ color: item.data[0].color }">【{{ item.data[0].name }}】</span> -->
  90. <!-- <span class="msgSty" @click="showDetail(item, index)">{{
  91. item.data[0].msg
  92. }}</span> -->
  93. <span class="stationSty">{{ item.name }}</span>
  94. <span class="titleSty"
  95. :style="showColor(item.alertObj.alertTitle) ? 'color: red':'color:green'"
  96. @click="showDetail(item, index)">【{{ item.alertObj.alertTitle }}】</span>
  97. <span class="msgSty"
  98. @click="showDetail(item, index)">{{item.alertObj.alertMessage}}</span>
  99. </div>
  100. <el-divider></el-divider>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="footer">
  108. <div class="exitV">
  109. <div class="time">
  110. <img :src="!theme ? timeImg1 : timeImg" alt="" />
  111. <span>服务器时间:{{ currentTime }}</span>
  112. </div>
  113. <div class="earlywarning">
  114. <div class="warningdata" v-for="item in warningData" :key="item.name">
  115. <span>{{ item.name }}</span>
  116. <!-- <span class="warningColor" :style="`background:${item.color}`"></span> -->
  117. <img :src="item.img" alt="" />
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <global-dialog ref="global" from="index" :echartsTheme="echartsTheme" :theme="theme" @notReload="notReload"
  123. :ExceedTimeList="ExceedTimeList" :stationData="stationData"></global-dialog>
  124. <weather-detail ref="weatherDetail"></weather-detail>
  125. </div>
  126. </template>
  127. <script>
  128. import {
  129. apiGetStationGL,
  130. apiGetPowerPrediction,
  131. apiGetWindSpeed,
  132. apiGetCapacity,
  133. apiGetAssessmentScore,
  134. apiGetEarlyWarningInfo,
  135. apiGetallWeatherInfo,
  136. apiGetirradianceForecast,
  137. apiGetStatusInfoAll,
  138. apiGetinsertLoginInformation,
  139. apiGetpersonalInformation,
  140. apiGetsinglePointToLogin,
  141. } from "@/api/api";
  142. import globalDialog from "@/components/powerPredictionComponent/homePageAssembly/globalDialogPage.vue";
  143. import weatherDetail from "@/components/powerPredictionComponent/homePageAssembly/weatherDetail.vue";
  144. //状态图片
  145. import oneimg from "@/assets/windStatusPic/yunxing.png";
  146. import twoimg from "@/assets/windStatusPic/daiji.png";
  147. import threeimg from "@/assets/windStatusPic/weihu.png";
  148. import fourimg from "@/assets/windStatusPic/tingji.png";
  149. import fiveimg from "@/assets/windStatusPic/xiandian.png";
  150. import siximg from "@/assets/windStatusPic/shoulei.png";
  151. import sevenimg from "@/assets/windStatusPic/guzhang.png";
  152. import oneimg1 from "@/assets/windStatusPic/yunxing_W.png";
  153. import twoimg1 from "@/assets/windStatusPic/daiji_W.png";
  154. import threeimg1 from "@/assets/windStatusPic/weihu_W.png";
  155. import fourimg1 from "@/assets/windStatusPic/tingji_W.png";
  156. import fiveimg1 from "@/assets/windStatusPic/xiandian_W.png";
  157. import siximg1 from "@/assets/windStatusPic/shoulei_W.png";
  158. import sevenimg1 from "@/assets/windStatusPic/guzhang_W.png";
  159. import redImg from "@/assets/windStatusPic/red.png";
  160. import greenImg from "@/assets/windStatusPic/green.png";
  161. import yellowImg from "@/assets/windStatusPic/yellow.png";
  162. import timeImg from "@/assets/windStatusPic/time.png";
  163. import timeImg1 from "@/assets/windStatusPic/time1.png";
  164. //大风预警图片
  165. import windBlue from "@/assets/weather/windBlue.png";
  166. import windYellow from "@/assets/weather/windYellow.png";
  167. import windOrange from "@/assets/weather/windOrange.png";
  168. import windRed from "@/assets/weather/windRed.png";
  169. //暴雨预警图片
  170. import rainBlue from "@/assets/weather/rainBlue.png";
  171. import rainYellow from "@/assets/weather/rainYellow.png";
  172. import rainOrange from "@/assets/weather/rainOrange.png";
  173. import rainRed from "@/assets/weather/rainRed.png";
  174. //雷电预警图片
  175. import thunderYellow from "@/assets/weather/thunderYellow.png";
  176. import thunderOrange from "@/assets/weather/thunderOrange.png";
  177. import thunderRed from "@/assets/weather/thunderRed.png";
  178. //暴雪预警图片
  179. import snowBlue from "@/assets/weather/snowBlue.png";
  180. import snowYellow from "@/assets/weather/snowYellow.png";
  181. import snowOrange from "@/assets/weather/snowOrange.png";
  182. import snowRed from "@/assets/weather/snowRed.png";
  183. //正常天气
  184. import sunshine from "@/assets/weather/sunshine.png";
  185. import overcast from "@/assets/weather/overcast.png";
  186. import cloudy from "@/assets/weather/cloudy.png";
  187. import rain from "@/assets/weather/rain.png";
  188. import snow from "@/assets/weather/snow.png";
  189. import thunder from "@/assets/weather/thunder.png";
  190. import {
  191. setToken
  192. } from "@/utils/auth";
  193. import jsonData from "./component/homePageNoMap.json";
  194. import {
  195. apiGethomeData
  196. } from "@/api/gengra";
  197. export default {
  198. components: {
  199. // commonHeader,
  200. // twopointfiveEcharts,
  201. globalDialog,
  202. weatherDetail,
  203. },
  204. data() {
  205. return {
  206. statusTimer: "",
  207. statusData: [],
  208. statusDataW: [],
  209. planFiveMin: "",
  210. currentTime: "",
  211. warningData: [],
  212. extremeWeather: [],
  213. messageDataxc: [],
  214. messageDataAll: [],
  215. ExceedTimeList: [],
  216. stationData: [],
  217. pickerTime: [],
  218. bodyHeight: document.documentElement.clientHeight - 60 + "px",
  219. isreload: true,
  220. dayShow: true,
  221. monthShow: false,
  222. yearShow: false,
  223. windShow: true,
  224. sunShow: false,
  225. showpowerLegend: [],
  226. echartsTheme: "",
  227. theme: null,
  228. redImg: redImg,
  229. greenImg: greenImg,
  230. yellowImg: yellowImg,
  231. timeImg: timeImg,
  232. timeImg1: timeImg1,
  233. wpId: "GJNY_SXGS_DBXNY_ZGS0",
  234. };
  235. },
  236. created() {
  237. this.warningData = [{
  238. name: "通讯预警",
  239. nameEn: "txyj",
  240. img: "",
  241. },
  242. {
  243. name: "测风塔预警",
  244. nameEn: "cftyj",
  245. img: "",
  246. },
  247. {
  248. name: "风机数据",
  249. nameEn: "fjsj",
  250. img: "",
  251. },
  252. {
  253. name: "中国数值气象",
  254. nameEn: "zgszqx",
  255. img: "",
  256. },
  257. {
  258. name: "欧洲数值气象",
  259. nameEn: "ozszqx",
  260. img: "",
  261. },
  262. ];
  263. this.messageDataAll = [{
  264. id: 1,
  265. name: "大风蓝色预警",
  266. color: "#5599ff",
  267. img: windBlue,
  268. typeName: "windBlue",
  269. msg: "未来24小时内,大风蓝色预警。做好防大风工作,关好门窗,加固围板、棚架,行人尽量不骑自行车,防高空坠物。",
  270. },
  271. {
  272. id: 2,
  273. name: "大风黄色预警",
  274. color: "#fac858",
  275. img: windYellow,
  276. typeName: "windYellow",
  277. msg: "未来12小时,大风黄色预警。应该停止露天活动和高空作业,切断户外危险电源,注意森林、草原火灾。",
  278. },
  279. {
  280. id: 3,
  281. name: "大风橙色预警",
  282. color: "#fc8452",
  283. img: windOrange,
  284. typeName: "windOrange",
  285. msg: "未来6小时大风橙色预警,检修人员减少外出,切断危险电源,注意防高空坠物。",
  286. },
  287. {
  288. id: 4,
  289. name: "大风红色预警",
  290. color: "#e73e3e",
  291. img: windRed,
  292. typeName: "windRed",
  293. msg: "未来6小时大风红色预警。应做好防范大风应急工作,工作人员不要随意外出,切断危险电源,设备设施尽快转移到安全地带。",
  294. },
  295. {
  296. id: 5,
  297. name: "暴雨蓝色预警",
  298. color: "#5599ff",
  299. img: rainBlue,
  300. typeName: "rainBlue",
  301. msg: "未来12小时内降雨量将达50毫米以上,注意山路湿滑。",
  302. },
  303. {
  304. id: 6,
  305. name: "暴雨黄色预警",
  306. color: "#fac858",
  307. img: rainYellow,
  308. typeName: "rainYellow",
  309. msg: "未来6小时内降雨量将达50毫米以上,降雨可能持续,检修人员提前返回场里。",
  310. },
  311. {
  312. id: 7,
  313. name: "暴雨橙色预警",
  314. color: "#fc8452",
  315. img: rainOrange,
  316. typeName: "rainOrange",
  317. msg: "未来3小时内降雨量将达50毫米以上,检修人员尽量避免现场工作。",
  318. },
  319. {
  320. id: 8,
  321. name: "暴雨红色预警",
  322. color: "#e73e3e",
  323. img: rainRed,
  324. typeName: "rainRed",
  325. msg: "未来3小时内降雨量将达100毫米以上,检修人员尽量避免现场工作或提前返回场里。",
  326. },
  327. {
  328. id: 9,
  329. name: "雷电黄色预警",
  330. color: "#fac858",
  331. img: thunderYellow,
  332. typeName: "thunderYellow",
  333. msg: "可能会造成雷电灾害事故,做好防雷工作。密切关注天气变化,尽量避免户外检修工作。",
  334. },
  335. {
  336. id: 10,
  337. name: "雷电橙色预警",
  338. color: "#fc8452",
  339. img: thunderOrange,
  340. typeName: "thunderOrange",
  341. msg: "雷电活动影响可能持续,出现雷电灾害事故的可能性比较大。落实防雷应急措施。工作人员避免户外活动,切断危险电源,不要在树下、电杆下、塔吊下避雨。",
  342. },
  343. {
  344. id: 11,
  345. name: "雷电红色预警",
  346. color: "#e73e3e",
  347. img: thunderRed,
  348. typeName: "thunderRed",
  349. msg: "未来2小时内有强烈的雷电活动发生,且可能持续,出现雷电灾害事故的可能性非常大。做好防雷应急抢险工作。工作人员躲入室内并关好门窗。切勿接触天线、水管、铁丝网、金属门窗、建筑物外墙,远离电线等带电设备和其他类似金属装置。密切注意雷电预警信息的发布。",
  350. },
  351. {
  352. id: 12,
  353. name: "暴雪蓝色预警",
  354. color: "#5599ff",
  355. img: snowBlue,
  356. typeName: "snowBlue",
  357. msg: "交通路面湿滑,可能会影响检修工作。",
  358. },
  359. {
  360. id: 13,
  361. name: "暴雪黄色预警",
  362. color: "#fac858",
  363. img: snowYellow,
  364. typeName: "snowYellow",
  365. msg: "交通路面湿滑,可能会影响检修工作。",
  366. },
  367. {
  368. id: 14,
  369. name: "暴雪橙色预警",
  370. color: "#fc8452",
  371. img: snowOrange,
  372. typeName: "snowOrange",
  373. msg: "可能影响交通,影响车行,避免坡路打滑。",
  374. },
  375. {
  376. id: 15,
  377. name: "暴雪红色预警",
  378. color: "#e73e3e",
  379. img: snowRed,
  380. typeName: "snowRed",
  381. msg: "对交通影响较大,车量出行困难,建议减少非必要出行。",
  382. },
  383. // {
  384. // id: 16,
  385. // type: '冻雨天气预警',
  386. // color: '#fc8452',
  387. // msg: '未来24小时可能有冻雨气象天气发生,请防范冻雨导致生产受累。'
  388. // },
  389. {
  390. id: 17,
  391. name: "晴天",
  392. color: "#3ba272",
  393. img: sunshine,
  394. typeName: "sunshine",
  395. msg: "蓝天真的很温柔,他将那些零零散散的云,都拥入自己的怀里。",
  396. },
  397. {
  398. id: 18,
  399. name: "阴天",
  400. color: "#3ba272",
  401. img: overcast,
  402. typeName: "overcast",
  403. msg: "乌云一片接着一片,板着脸走过,不时还传来一两声可怕的怒吼似箭的光,告诉着人们他的厉害。",
  404. },
  405. {
  406. id: 19,
  407. name: "多云",
  408. color: "#3ba272",
  409. img: cloudy,
  410. typeName: "cloudy",
  411. msg: "最美的天气,不是下雨天,不是大太阳天,而是多云的阴天,出门淋不着,晒不着。",
  412. },
  413. {
  414. id: 20,
  415. name: "雨天",
  416. color: "#3ba272",
  417. img: rain,
  418. typeName: "rain",
  419. msg: "再温柔平和宁静的落雨,也有把人浸透的威力。",
  420. },
  421. {
  422. id: 21,
  423. name: "雪天",
  424. color: "#3ba272",
  425. img: snow,
  426. typeName: "snow",
  427. msg: "雪花落入掌心,融化思念,释放温情,雪花落入大地,存储牵挂,诠释纯洁。",
  428. },
  429. {
  430. id: 22,
  431. name: "雷电",
  432. color: "#3ba272",
  433. img: thunder,
  434. typeName: "thunder",
  435. msg: "所有的雷声闪电,都是在雷雨云中发生的。",
  436. },
  437. ];
  438. this.ExceedTimeList = [{
  439. label: "超前15分钟",
  440. value: 0,
  441. },
  442. {
  443. label: "超前30分钟",
  444. value: 1,
  445. },
  446. {
  447. label: "超前45分钟",
  448. value: 2,
  449. },
  450. {
  451. label: "超前1小时",
  452. value: 3,
  453. },
  454. {
  455. label: "超前1小时15分钟",
  456. value: 4,
  457. },
  458. {
  459. label: "超前1小时30分钟",
  460. value: 5,
  461. },
  462. {
  463. label: "超前1小时45分钟",
  464. value: 6,
  465. },
  466. {
  467. label: "超前2小时",
  468. value: 7,
  469. },
  470. {
  471. label: "超前2小时15分钟",
  472. value: 8,
  473. },
  474. {
  475. label: "超前2小时30分钟",
  476. value: 9,
  477. },
  478. {
  479. label: "超前2小时45分钟",
  480. value: 10,
  481. },
  482. {
  483. label: "超前3小时",
  484. value: 11,
  485. },
  486. {
  487. label: "超前3小时15分钟",
  488. value: 12,
  489. },
  490. {
  491. label: "超前3小时30分钟",
  492. value: 13,
  493. },
  494. {
  495. label: "超前3小时45分钟",
  496. value: 14,
  497. },
  498. {
  499. label: "超前4小时",
  500. value: 15,
  501. },
  502. {
  503. label: "超前5小时",
  504. value: 19,
  505. },
  506. {
  507. label: "超前6小时",
  508. value: 23,
  509. },
  510. ];
  511. this.statusData = [{
  512. img: oneimg,
  513. name: "运行",
  514. nameEn: "yxsum",
  515. borderSty: "#1C99FF",
  516. backSty: "#0046C7",
  517. numBack: "#212223",
  518. number: 0,
  519. },
  520. {
  521. img: twoimg,
  522. name: "待机",
  523. nameEn: "djsum",
  524. borderSty: "#05BB4C",
  525. backSty: "#258952",
  526. numBack: "#212223",
  527. number: 0,
  528. },
  529. {
  530. img: sevenimg,
  531. name: "故障",
  532. nameEn: "jxsum",
  533. borderSty: "#BA3237",
  534. backSty: "#73262B",
  535. numBack: "#212223",
  536. number: 0,
  537. },
  538. {
  539. img: threeimg,
  540. name: "维护",
  541. nameEn: "whsum",
  542. borderSty: "#E17D24",
  543. backSty: "#694119",
  544. numBack: "#212223",
  545. number: 0,
  546. },
  547. {
  548. img: fiveimg,
  549. name: "限电",
  550. nameEn: "xdsum",
  551. borderSty: "#C530C8",
  552. backSty: "#7A277F",
  553. numBack: "#212223",
  554. number: 0,
  555. },
  556. {
  557. img: siximg,
  558. name: "受累",
  559. nameEn: "tjsum",
  560. borderSty: "#fff",
  561. backSty: "#38393B",
  562. numBack: "#212223",
  563. number: 0,
  564. },
  565. {
  566. img: fourimg,
  567. name: "离线",
  568. nameEn: "lxsum",
  569. borderSty: "#52595B",
  570. backSty: "#272a2b",
  571. numBack: "#212223",
  572. number: 0,
  573. },
  574. ];
  575. this.statusDataW = [{
  576. img: oneimg1,
  577. name: "运行",
  578. nameEn: "yxsum",
  579. borderSty: "#3777E8",
  580. backSty: "#1850B3",
  581. numBack: "#073484",
  582. number: 0,
  583. },
  584. {
  585. img: twoimg1,
  586. name: "待机",
  587. nameEn: "djsum",
  588. borderSty: "#6BDB97",
  589. backSty: "#0EAC4C",
  590. numBack: "#077C35",
  591. number: 0,
  592. },
  593. {
  594. img: sevenimg1,
  595. name: "故障",
  596. nameEn: "jxsum",
  597. borderSty: "#73262B",
  598. backSty: "#BA3237",
  599. numBack: "#881B1F",
  600. number: 0,
  601. },
  602. {
  603. img: threeimg1,
  604. name: "维护",
  605. nameEn: "whsum",
  606. borderSty: "#F1AF74",
  607. backSty: "#E17D24",
  608. numBack: "#A6530A",
  609. number: 0,
  610. },
  611. {
  612. img: fiveimg1,
  613. name: "限电",
  614. nameEn: "xdsum",
  615. borderSty: "#E757EA",
  616. backSty: "#C530C8",
  617. numBack: "#901193",
  618. number: 0,
  619. },
  620. {
  621. img: fourimg1,
  622. name: "受累",
  623. nameEn: "tjsum",
  624. borderSty: "#CDCDCD",
  625. backSty: "#A8A8A8",
  626. numBack: "#878787",
  627. number: 0,
  628. },
  629. {
  630. img: siximg1,
  631. name: "离线",
  632. nameEn: "lxsum",
  633. borderSty: "#595D61",
  634. backSty: "#38393B",
  635. numBack: "#151719",
  636. number: 0,
  637. },
  638. ];
  639. this.pickerTime = [
  640. new Date(
  641. new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
  642. ),
  643. new Date(
  644. new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
  645. 24 * 60 * 60 * 1000 -
  646. 1000
  647. ),
  648. ];
  649. this.showpowerLegend = [{
  650. name: "理论功率",
  651. color: "#5672c4",
  652. },
  653. {
  654. name: "可用功率",
  655. color: "#95cc7a",
  656. },
  657. {
  658. name: "AGC",
  659. color: "#f7c75f",
  660. },
  661. {
  662. name: "超短期",
  663. color: "#e96366",
  664. },
  665. {
  666. name: "实际",
  667. color: "#7ac1dd",
  668. },
  669. ];
  670. // if (this.$route.query.markKey) {
  671. // this.fromCustom(this.$route.query.userid);
  672. // }
  673. },
  674. computed: {
  675. pageHeight() {
  676. return {
  677. height: document.documentElement.clientHeight - 115 + "px",
  678. };
  679. },
  680. leftDivStyle() {
  681. let pageHeight = document.documentElement.clientHeight - 210;
  682. let heightChart = pageHeight / 2 + "px";
  683. return {
  684. height: heightChart,
  685. };
  686. },
  687. lineChartStyle() {
  688. let pageHeight = document.documentElement.clientHeight - 210;
  689. let heightChart = pageHeight / 2 + "px";
  690. return {
  691. width: "98%",
  692. height: heightChart,
  693. };
  694. },
  695. barChartStyle() {
  696. // let pageHeight = document.documentElement.clientHeight-220-240
  697. let pageHeight = document.documentElement.clientHeight - 260;
  698. let heightChart = pageHeight / 3 + "px";
  699. return {
  700. width: "100%",
  701. height: heightChart,
  702. };
  703. },
  704. },
  705. watch: {
  706. "$store.state.theme": {
  707. handler: function (newVal, oldVal) {
  708. this.theme = newVal;
  709. this.echartsTheme = !newVal ? "dark" : "";
  710. if (oldVal != undefined) {
  711. // this.getPowerPrediction();
  712. // this.getWindSpeed("风速");
  713. // this.getCapacity();
  714. // this.getAssessmentScore(0);
  715. // this.getAllStationWeather();
  716. // this.getWarningInfo();
  717. // this.getWindStstus();
  718. }
  719. },
  720. immediate: true,
  721. },
  722. },
  723. mounted() {
  724. // this.initPageData();
  725. this.initPageFn()
  726. },
  727. beforeRouteLeave(to, from, next) {
  728. next();
  729. if (this.statusTimer) {
  730. clearInterval(this.statusTimer);
  731. this.statusTimer = null;
  732. }
  733. if (this.planFiveMin) {
  734. clearInterval(this.planFiveMin);
  735. this.planFiveMin = null;
  736. }
  737. },
  738. methods: {
  739. initPageFn() {
  740. this.getPowerPrediction();
  741. this.getWindSpeed("风速");
  742. this.getCapacity();
  743. this.getAssessmentScore(0);
  744. this.getAllStationWeather();
  745. this.getWarningInfo();
  746. this.getWindStstus();
  747. this.getStationData()
  748. },
  749. initPageData() {
  750. if (!this.$route.query.markKey) {
  751. let that = this;
  752. this.stationData = jsonData.glStationsAllData.list;
  753. that.statusTimer = setInterval(function () {
  754. that.currentTime = that.changeDate(new Date());
  755. }, 1000);
  756. {
  757. let xAxis = [];
  758. let series = [];
  759. let legend = [];
  760. jsonData.todayPowerForecastData.dateList.forEach((item) => {
  761. xAxis.push(item.substring(item.indexOf(" ") + 1));
  762. });
  763. jsonData.todayPowerForecastData.dataFormatList.forEach((iten) => {
  764. if (iten.name !== "短期") {
  765. legend.push(iten.name);
  766. let seriesObj = {
  767. name: iten.name,
  768. type: "line",
  769. data: iten.data.map((it) => {
  770. return that.$utils.isHasNum(it);
  771. }),
  772. symbol: "none",
  773. };
  774. series.push(seriesObj);
  775. }
  776. });
  777. that.getPowerLine("lineChart", "今日功率预测", xAxis, legend, series);
  778. }
  779. that.handleWindSunData({
  780. data: jsonData.todayWindSpeedForecastData
  781. },
  782. "风速"
  783. );
  784. // that.handleWindSunData(
  785. // { data: jsonData.todayIrradianceForecastData },
  786. // "辐照度"
  787. // );
  788. {
  789. let xAxis = [];
  790. let series = [];
  791. let legend = [];
  792. jsonData.installedCapacityData.name.forEach((item) => {
  793. let XaObj = {
  794. value: item,
  795. textStyle: {
  796. width: 100,
  797. height: 25,
  798. backgroundColor: "#edeffb",
  799. color: "#36348e",
  800. borderRadius: 10,
  801. align: "center",
  802. verticalAlign: "middle",
  803. },
  804. };
  805. xAxis.push(XaObj);
  806. });
  807. jsonData.installedCapacityData.dataFormatList.forEach(
  808. (iten, index) => {
  809. legend.push(iten.name);
  810. let seriesObj = {
  811. name: iten.name,
  812. type: "bar",
  813. barGap: 0,
  814. emphasis: {
  815. focus: "series",
  816. },
  817. data: iten.data.map((it) => {
  818. return that.$utils.isHasNum(it);
  819. }),
  820. };
  821. series.push(seriesObj);
  822. }
  823. );
  824. that.getPowerBar("barChart", "功率统计", xAxis, legend, series);
  825. }
  826. {
  827. let xAxis = [];
  828. let series = [];
  829. let legend = [];
  830. jsonData.predictedAssessmentScoresData.name.forEach((item) => {
  831. let XaObj = {
  832. value: item,
  833. textStyle: {
  834. width: 120,
  835. height: 25,
  836. backgroundColor: "#edeffb",
  837. color: "#36348e",
  838. borderRadius: 10,
  839. align: "center",
  840. verticalAlign: "middle",
  841. },
  842. };
  843. xAxis.push(XaObj);
  844. });
  845. jsonData.predictedAssessmentScoresData.dataFormatList.forEach(
  846. (iten, index) => {
  847. legend.push(iten.name);
  848. let seriesObj = {
  849. name: iten.name,
  850. type: "bar",
  851. barGap: 0,
  852. emphasis: {
  853. focus: "series",
  854. },
  855. data: iten.data.map((it) => {
  856. return that.$utils.isHasNum(it);
  857. }),
  858. };
  859. series.push(seriesObj);
  860. }
  861. );
  862. that.getPowerBar("barChart1", "预测考核分数", xAxis, legend, series);
  863. }
  864. {
  865. that.messageDataxc = [];
  866. that.extremeWeather = jsonData.weatherForecastAllTerminalData
  867. jsonData.weatherForecastAllTerminalData.forEach((item) => {
  868. let weatherDataFromWeb = null;
  869. weatherDataFromWeb = JSON.parse(item.content);
  870. that.everyStationWeather(weatherDataFromWeb, item.terminalName);
  871. });
  872. }
  873. that.warningData.forEach((item) => {
  874. for (let it in jsonData.earlyWarningInfoData) {
  875. if (item.nameEn === it) {
  876. if (jsonData.earlyWarningInfoData[it] === 1) {
  877. item.img = that.redImg;
  878. } else if (jsonData.earlyWarningInfoData[it] === 2) {
  879. item.img = that.greenImg;
  880. } else {
  881. item.img = that.yellowImg;
  882. }
  883. }
  884. }
  885. });
  886. that.statusData.forEach((item) => {
  887. for (let it in jsonData.unitStatusInfoAllData) {
  888. if (item.nameEn === it) {
  889. item.number = jsonData.unitStatusInfoAllData[it];
  890. }
  891. }
  892. });
  893. that.statusDataW.forEach((item) => {
  894. for (let it in jsonData.unitStatusInfoAllData) {
  895. if (item.nameEn === it) {
  896. item.number = jsonData.unitStatusInfoAllData[it];
  897. }
  898. }
  899. });
  900. that.allStatus = jsonData.unitStatusInfoAllData;
  901. console.log("extremeWeather===>>>", that.extremeWeather)
  902. that.messageDataxc.forEach(item => {
  903. that.extremeWeather.forEach(it => {
  904. if (item.name === it.terminalName) {
  905. let obj = {
  906. alertTitle: it.alertTitle ? it.alertTitle : item.data[0].name,
  907. alertMessage: it.alertMessage ? it.alertMessage : item.data[0]
  908. .msg
  909. }
  910. item.alertObj = obj
  911. }
  912. })
  913. })
  914. console.log("messageDataxc===>>>321", that.messageDataxc)
  915. }
  916. },
  917. showColor(str) {
  918. return str.indexOf("预警") !== -1 ? true : false
  919. },
  920. showTitle(item) {
  921. return item.substring(0, item.indexOf('发布') + 2)
  922. },
  923. statusSty(item) {
  924. return `border: 1px solid ${item.borderSty};background: ${item.backSty}`;
  925. },
  926. statusNumSty(item) {
  927. return `border: 1px solid ${item.borderSty};background:${item.numBack}`;
  928. },
  929. fromCustom(name) {
  930. let that = this;
  931. let params = {
  932. markKey: this.$route.query.markKey,
  933. userid: this.$route.query.userid,
  934. };
  935. apiGetsinglePointToLogin(params)
  936. .then((datas) => {
  937. if (datas) {
  938. setToken(datas.token);
  939. that.LoginInfor(name, datas.id);
  940. }
  941. })
  942. .catch((e) => {
  943. let url = location.origin + "/#/login";
  944. window.open(url, "_self");
  945. location.reload();
  946. });
  947. },
  948. // 插入登录信息
  949. LoginInfor(name, id) {
  950. let that = this;
  951. let params = {
  952. loginName: name,
  953. };
  954. apiGetinsertLoginInformation(params).then((datas) => {
  955. if (datas) {
  956. window.sessionStorage.setItem(
  957. "userDatamsg",
  958. JSON.stringify(datas.data)
  959. );
  960. that.personalInfo(id);
  961. }
  962. });
  963. },
  964. // 用户信息
  965. personalInfo(id) {
  966. let that = this;
  967. let params = {
  968. userId: id,
  969. };
  970. apiGetpersonalInformation(params).then((datas) => {
  971. if (datas) {
  972. window.sessionStorage.setItem(
  973. "usermsg",
  974. JSON.stringify(datas.data.user)
  975. );
  976. that.$router.push({
  977. name: "homePageNoMap",
  978. });
  979. setTimeout(() => {
  980. that.getStationData();
  981. that.statusTimer = setInterval(function () {
  982. that.currentTime = that.changeDate(new Date());
  983. }, 1000);
  984. that.planFiveMin = setInterval(function () {
  985. that.getPowerPrediction();
  986. that.getWindSpeed(that.windShow ? "风速" : "辐照度");
  987. }, 300000);
  988. that.getPowerPrediction();
  989. that.getWindSpeed("风速");
  990. that.getCapacity();
  991. that.getAssessmentScore(0);
  992. that.getAllStationWeather();
  993. that.getWarningInfo();
  994. that.getWindStstus();
  995. for (let i = 0; i < 1; i++) {
  996. window.location.reload();
  997. }
  998. }, 500);
  999. }
  1000. });
  1001. },
  1002. // 获取风机状态服务
  1003. getWindStstus() {
  1004. let that = this;
  1005. let params = {
  1006. wpId: this.wpId,
  1007. };
  1008. apiGethomeData(params)
  1009. .then((res) => {
  1010. if (res && res.data.ztmap) {
  1011. that.statusData.forEach((item) => {
  1012. for (let it in res.data.ztmap) {
  1013. if (item.nameEn === it) {
  1014. item.number = res.data.ztmap[it];
  1015. }
  1016. }
  1017. });
  1018. that.statusDataW.forEach((item) => {
  1019. for (let it in res.data.ztmap) {
  1020. if (item.nameEn === it) {
  1021. item.number = res.data.ztmap[it];
  1022. }
  1023. }
  1024. });
  1025. }
  1026. })
  1027. apiGetStatusInfoAll().then((datas) => {
  1028. if (datas) {
  1029. if (datas.data) {
  1030. that.allStatus = datas.data;
  1031. }
  1032. }
  1033. });
  1034. },
  1035. showDetail(item, index) {
  1036. this.$refs.weatherDetail.dialogVisible = true;
  1037. this.$refs.weatherDetail.title = "天气预警";
  1038. this.$refs.weatherDetail.messageAll = this.messageDataxc;
  1039. this.$refs.weatherDetail.activeName = index.toString();
  1040. this.$refs.weatherDetail.statusName = item.data[0].name;
  1041. console.log(item);
  1042. },
  1043. //获取预警状态信息
  1044. getWarningInfo() {
  1045. let that = this;
  1046. apiGetEarlyWarningInfo().then((datas) => {
  1047. if (datas) {
  1048. if (datas.data) {
  1049. that.warningData.forEach((item) => {
  1050. for (let it in datas.data) {
  1051. if (item.nameEn === it) {
  1052. if (datas.data[it] === 1) {
  1053. item.img = that.redImg;
  1054. } else if (datas.data[it] === 2) {
  1055. item.img = that.greenImg;
  1056. } else {
  1057. item.img = that.yellowImg;
  1058. }
  1059. }
  1060. }
  1061. });
  1062. }
  1063. }
  1064. });
  1065. },
  1066. // 获取所有场站天气
  1067. getAllStationWeather() {
  1068. let that = this;
  1069. apiGetallWeatherInfo().then((datas) => {
  1070. if (datas && datas.data) {
  1071. that.messageDataxc = [];
  1072. that.extremeWeather = datas.data
  1073. datas.data.forEach((item) => {
  1074. let weatherDataFromWeb = null;
  1075. weatherDataFromWeb = JSON.parse(item.content);
  1076. that.everyStationWeather(weatherDataFromWeb, item.terminalName);
  1077. });
  1078. }
  1079. });
  1080. },
  1081. //处理每个场站天气数据
  1082. everyStationWeather(weatherDataFromWeb, stationName) {
  1083. // console.log("weatherDataFromWeb", weatherDataFromWeb);
  1084. let weatherTit = {
  1085. windBlue: 0,
  1086. windYellow: 0,
  1087. windOrange: 0,
  1088. windRed: 0,
  1089. rainBlue: 0,
  1090. rainYellow: 0,
  1091. rainOrange: 0,
  1092. rainRed: 0,
  1093. thunderYellow: 0,
  1094. thunderOrange: 0,
  1095. thunderRed: 0,
  1096. snowBlue: 0,
  1097. snowYellow: 0,
  1098. snowOrange: 0,
  1099. snowRed: 0,
  1100. };
  1101. weatherDataFromWeb["24_hour_forecast"].info.forEach((item, index) => {
  1102. if (index < 24) {
  1103. if (item.wind_power_num === "6" || item.wind_power_num === "7") {
  1104. //大风蓝色预警
  1105. weatherTit.windBlue += 1;
  1106. }
  1107. if (index < 13) {
  1108. if (item.wind_power_num === "8" || item.wind_power_num === "9") {
  1109. //大风黄色预警
  1110. weatherTit.windYellow += 1;
  1111. weatherTit.windBlue = 0;
  1112. } else if (
  1113. item.precipitation > "40" &&
  1114. item.precipitation <= "50" &&
  1115. item.weather.indexOf("雨") !== -1
  1116. ) {
  1117. //暴雨蓝色预警
  1118. weatherTit.rainBlue += 1;
  1119. } else if (
  1120. item.precipitation > "3" &&
  1121. item.precipitation <= "4" &&
  1122. item.weather.indexOf("雪") !== -1
  1123. ) {
  1124. //暴雪蓝色预警
  1125. weatherTit.snowBlue += 1;
  1126. } else if (
  1127. item.precipitation >= "6" &&
  1128. item.weather.indexOf("雪") !== -1
  1129. ) {
  1130. //暴雪黄色预警
  1131. weatherTit.snowYellow += 1;
  1132. weatherTit.snowBlue = 0;
  1133. }
  1134. if (index < 7) {
  1135. if (
  1136. item.wind_power_num === "10" ||
  1137. item.wind_power_num === "11"
  1138. ) {
  1139. //大风橙色预警
  1140. weatherTit.windOrange += 1;
  1141. weatherTit.windYellow = 0;
  1142. weatherTit.windBlue = 0;
  1143. } else if (
  1144. item.wind_power_num === "12" ||
  1145. item.wind_power_num === "13"
  1146. ) {
  1147. //大风红色预警
  1148. weatherTit.windRed += 1;
  1149. weatherTit.windOrange = 0;
  1150. weatherTit.windYellow = 0;
  1151. weatherTit.windBlue = 0;
  1152. } else if (
  1153. item.weather.indexOf("雷") !== -1 ||
  1154. item.weather.indexOf("电") !== -1
  1155. ) {
  1156. //雷电黄色预警
  1157. weatherTit.thunderYellow += 1;
  1158. } else if (
  1159. item.precipitation > "40" &&
  1160. item.precipitation <= 50 &&
  1161. item.weather.indexOf("雨") !== -1
  1162. ) {
  1163. //暴雨黄色预警
  1164. weatherTit.rainYellow += 1;
  1165. weatherTit.rainBlue = 0;
  1166. } else if (
  1167. item.precipitation >= "10" &&
  1168. item.weather.indexOf("雪") !== -1
  1169. ) {
  1170. //暴雪橙色预警
  1171. weatherTit.snowOrange += 1;
  1172. weatherTit.snowYellow = 0;
  1173. weatherTit.snowBlue = 0;
  1174. } else if (
  1175. item.precipitation >= "15" &&
  1176. item.weather.indexOf("雪") !== -1
  1177. ) {
  1178. //暴雪红色预警
  1179. weatherTit.snowRed += 1;
  1180. weatherTit.snowOrange = 0;
  1181. weatherTit.snowYellow = 0;
  1182. weatherTit.snowBlue = 0;
  1183. }
  1184. if (index < 5) {
  1185. if (
  1186. item.weather.indexOf("雷") !== -1 ||
  1187. item.weather.indexOf("电") !== -1
  1188. ) {
  1189. //雷电橙色预警
  1190. weatherTit.thunderOrange += 1;
  1191. weatherTit.thunderYellow = 0;
  1192. }
  1193. if (index < 4) {
  1194. if (
  1195. item.precipitation > "50" &&
  1196. item.weather.indexOf("雨") !== -1
  1197. ) {
  1198. //暴雨橙色预警
  1199. weatherTit.rainOrange += 1;
  1200. weatherTit.rainYellow = 0;
  1201. weatherTit.rainBlue = 0;
  1202. } else if (
  1203. item.precipitation >= "100" &&
  1204. item.weather.indexOf("雨") !== -1
  1205. ) {
  1206. //暴雨红色预警
  1207. weatherTit.rainRed += 1;
  1208. weatherTit.rainOrange = 0;
  1209. weatherTit.rainYellow = 0;
  1210. weatherTit.rainBlue = 0;
  1211. }
  1212. if (index < 3) {
  1213. if (
  1214. item.weather.indexOf("雷") !== -1 ||
  1215. item.weather.indexOf("电") !== -1
  1216. ) {
  1217. //雷电红色预警
  1218. weatherTit.thunderRed += 1;
  1219. weatherTit.thunderOrange = 0;
  1220. weatherTit.thunderYellow = 0;
  1221. }
  1222. }
  1223. }
  1224. }
  1225. }
  1226. }
  1227. }
  1228. });
  1229. // let weatherStatus = ['wind', 'rain', 'thunder', 'snow']
  1230. // let weatherLeave = ['Blue', 'Yellow', 'Orange', 'Red']
  1231. let useweatherTit = {};
  1232. for (let i in weatherTit) {
  1233. if (weatherTit[i] > 0) {
  1234. useweatherTit[i] = weatherTit[i];
  1235. }
  1236. }
  1237. if (Object.keys(useweatherTit).length > 0) {
  1238. for (let i in useweatherTit) {
  1239. let showMsgObj = {
  1240. name: stationName,
  1241. data: [],
  1242. weatherDetail: {},
  1243. weather: {},
  1244. };
  1245. for (let j = 0; j < this.messageDataAll.length; j++) {
  1246. if (this.messageDataAll[j].typeName === i) {
  1247. showMsgObj.data.push(this.messageDataAll[j]);
  1248. this.getOnlyWeatherData(
  1249. weatherDataFromWeb["24_hour_forecast"].info,
  1250. weatherDataFromWeb.weather,
  1251. showMsgObj,
  1252. "Y"
  1253. );
  1254. this.messageDataxc.push(showMsgObj);
  1255. }
  1256. }
  1257. }
  1258. } else {
  1259. let showMsgObj = {
  1260. name: stationName,
  1261. data: [],
  1262. weatherDetail: {},
  1263. weather: {},
  1264. };
  1265. if (
  1266. weatherDataFromWeb.weather.weather.indexOf("晴") !== -1 ||
  1267. weatherDataFromWeb.weather.weather.indexOf("扬沙") !== -1 ||
  1268. weatherDataFromWeb.weather.weather.indexOf("霾") !== -1 ||
  1269. weatherDataFromWeb.weather.weather.indexOf("浮尘") !== -1
  1270. ) {
  1271. showMsgObj.data.push(this.messageDataAll[15]);
  1272. } else if (
  1273. weatherDataFromWeb.weather.weather.indexOf("阴") !== -1 ||
  1274. weatherDataFromWeb.weather.weather.indexOf("雾") !== -1
  1275. ) {
  1276. showMsgObj.data.push(this.messageDataAll[16]);
  1277. } else if (weatherDataFromWeb.weather.weather.indexOf("多云") !== -1) {
  1278. showMsgObj.data.push(this.messageDataAll[17]);
  1279. } else if (weatherDataFromWeb.weather.weather.indexOf("雨") !== -1) {
  1280. showMsgObj.data.push(this.messageDataAll[18]);
  1281. } else if (weatherDataFromWeb.weather.weather.indexOf("雪") !== -1) {
  1282. showMsgObj.data.push(this.messageDataAll[19]);
  1283. } else if (weatherDataFromWeb.weather.weather.indexOf("雷电") !== -1) {
  1284. showMsgObj.data.push(this.messageDataAll[20]);
  1285. }
  1286. this.messageDataxc.push(showMsgObj);
  1287. // weatherDataFromWeb['15_day_forecast'].info[0]
  1288. // weatherDataFromWeb['24_hour_forecast'].info[0]
  1289. this.getOnlyWeatherData(
  1290. weatherDataFromWeb["24_hour_forecast"].info[0],
  1291. weatherDataFromWeb.weather,
  1292. showMsgObj,
  1293. "N"
  1294. );
  1295. }
  1296. // console.log("weatherTit", weatherTit);
  1297. this.messageDataxc.forEach(item => {
  1298. this.extremeWeather.forEach(it => {
  1299. if (item.name === it.terminalName) {
  1300. let obj = {
  1301. alertTitle: it.alertTitle ? it.alertTitle : item.data[0].name,
  1302. alertMessage: it.alertMessage ? it.alertMessage : item.data[0]
  1303. .msg
  1304. }
  1305. item.alertObj = obj
  1306. }
  1307. })
  1308. })
  1309. console.log("messageDataxc===>>>123>", this.messageDataxc);
  1310. },
  1311. //获取天气预警的相关天气数据
  1312. getOnlyWeatherData(datas, weather, obj, type) {
  1313. if (type === "Y") {
  1314. for (let j = 0; j < datas.length; j++) {
  1315. let item = datas[j];
  1316. if (j < 24) {
  1317. if (
  1318. (item.wind_power_num === "6" || item.wind_power_num === "7") &&
  1319. obj.data[0].typeName === "windBlue"
  1320. ) {
  1321. //大风蓝色预警
  1322. obj.weatherDetail = item;
  1323. obj.weather = weather;
  1324. }
  1325. if (j < 13) {
  1326. if (
  1327. (item.wind_power_num === "8" || item.wind_power_num === "9") &&
  1328. obj.data[0].typeName === "windYellow"
  1329. ) {
  1330. //大风黄色预警
  1331. obj.weatherDetail = item;
  1332. obj.weather = weather;
  1333. } else if (
  1334. item.precipitation > "40" &&
  1335. item.precipitation <= "50" &&
  1336. item.weather.indexOf("雨") !== -1 &&
  1337. obj.data[0].typeName === "rainBlue"
  1338. ) {
  1339. //暴雨蓝色预警
  1340. obj.weatherDetail = item;
  1341. obj.weather = weather;
  1342. } else if (
  1343. item.precipitation > "3" &&
  1344. item.precipitation <= "4" &&
  1345. item.weather.indexOf("雪") !== -1 &&
  1346. obj.data[0].typeName === "snowBlue"
  1347. ) {
  1348. //暴雪蓝色预警
  1349. obj.weatherDetail = item;
  1350. obj.weather = weather;
  1351. } else if (
  1352. item.precipitation >= "6" &&
  1353. item.weather.indexOf("雪") !== -1 &&
  1354. obj.data[0].typeName === "snowYellow"
  1355. ) {
  1356. //暴雪黄色预警
  1357. obj.weatherDetail = item;
  1358. obj.weather = weather;
  1359. }
  1360. if (j < 7) {
  1361. if (
  1362. (item.wind_power_num === "10" ||
  1363. item.wind_power_num === "11") &&
  1364. obj.data[0].typeName === "windOrange"
  1365. ) {
  1366. //大风橙色预警
  1367. obj.weatherDetail = item;
  1368. obj.weather = weather;
  1369. } else if (
  1370. (item.wind_power_num === "12" ||
  1371. item.wind_power_num === "13") &&
  1372. obj.data[0].typeName === "windRed"
  1373. ) {
  1374. //大风红色预警
  1375. obj.weatherDetail = item;
  1376. obj.weather = weather;
  1377. } else if (
  1378. (item.weather.indexOf("雷") !== -1 ||
  1379. item.weather.indexOf("电") !== -1) &&
  1380. obj.data[0].typeName === "thunderYellow"
  1381. ) {
  1382. //雷电黄色预警
  1383. item.weatherDetail = item;
  1384. item.weather = weather;
  1385. } else if (
  1386. item.precipitation > "40" &&
  1387. item.precipitation <= 50 &&
  1388. item.weather.indexOf("雨") !== -1 &&
  1389. obj.data[0].typeName === "rainYellow"
  1390. ) {
  1391. //暴雨黄色预警
  1392. obj.weatherDetail = item;
  1393. obj.weather = weather;
  1394. } else if (
  1395. item.precipitation >= "10" &&
  1396. item.weather.indexOf("雪") !== -1 &&
  1397. obj.data[0].typeName === "snowOrange"
  1398. ) {
  1399. //暴雪橙色预警
  1400. obj.weatherDetail = item;
  1401. obj.weather = weather;
  1402. } else if (
  1403. item.precipitation >= "15" &&
  1404. item.weather.indexOf("雪") !== -1 &&
  1405. obj.data[0].typeName === "snowRed"
  1406. ) {
  1407. //暴雪红色预警
  1408. obj.weatherDetail = item;
  1409. obj.weather = weather;
  1410. }
  1411. if (j < 5) {
  1412. if (
  1413. (item.weather.indexOf("雷") !== -1 ||
  1414. item.weather.indexOf("电") !== -1) &&
  1415. obj.data[0].typeName === "thunderOrange"
  1416. ) {
  1417. //雷电橙色预警
  1418. obj.weatherDetail = item;
  1419. obj.weather = weather;
  1420. }
  1421. if (j < 4) {
  1422. if (
  1423. item.precipitation > "50" &&
  1424. item.weather.indexOf("雨") !== -1 &&
  1425. obj.data[0].typeName === "rainOrange"
  1426. ) {
  1427. //暴雨橙色预警
  1428. item.weatherDetail = item;
  1429. item.weather = weather;
  1430. } else if (
  1431. item.precipitation >= "100" &&
  1432. item.weather.indexOf("雨") !== -1 &&
  1433. obj.data[0].typeName === "rainRed"
  1434. ) {
  1435. //暴雨红色预警
  1436. obj.weatherDetail = item;
  1437. obj.weather = weather;
  1438. }
  1439. if (j < 3) {
  1440. if (
  1441. (item.weather.indexOf("雷") !== -1 ||
  1442. item.weather.indexOf("电") !== -1) &&
  1443. obj.data[0].typeName === "thunderRed"
  1444. ) {
  1445. //雷电红色预警
  1446. obj.weatherDetail = item;
  1447. obj.weather = weather;
  1448. }
  1449. }
  1450. }
  1451. }
  1452. }
  1453. }
  1454. }
  1455. }
  1456. } else {
  1457. obj.weatherDetail = datas;
  1458. obj.weather = weather;
  1459. }
  1460. },
  1461. notReload(val) {
  1462. this.isreload = val;
  1463. },
  1464. getStationData() {
  1465. apiGetStationGL().then((datas) => {
  1466. this.stationData = datas.data.list;
  1467. });
  1468. },
  1469. getWindorSunDate(type) {
  1470. this.windShow = false;
  1471. this.sunShow = false;
  1472. if (type === "风速") {
  1473. this.windShow = true;
  1474. this.getWindSpeed("风速");
  1475. } else {
  1476. this.sunShow = true;
  1477. this.getWindSpeed("辐照度");
  1478. }
  1479. },
  1480. getbarDate(type) {
  1481. this.dayShow = false;
  1482. this.monthShow = false;
  1483. this.yearShow = false;
  1484. if (type === "日") {
  1485. this.dayShow = true;
  1486. this.getAssessmentScore(0);
  1487. } else if (type === "月") {
  1488. this.monthShow = true;
  1489. this.getAssessmentScore(1);
  1490. } else {
  1491. this.yearShow = true;
  1492. this.getAssessmentScore(2);
  1493. }
  1494. },
  1495. doubleclick(name) {
  1496. if (this.stationData.length > 0) {
  1497. this.isreload = false;
  1498. this.$refs.global.dialogVisible = true;
  1499. this.$refs.global.tableData = [];
  1500. this.$refs.global.dateType = 1;
  1501. this.$refs.global.loading = true;
  1502. this.$refs.global.pickerTime = this.pickerTime;
  1503. this.$refs.global.windShow = this.windShow;
  1504. this.$refs.global.init(name);
  1505. this.$nextTick(() => {
  1506. const myChart1 = this.$echarts.init(
  1507. document.getElementById("lineChart"),
  1508. this.echartsTheme
  1509. );
  1510. const myChart2 = this.$echarts.init(
  1511. document.getElementById("lineChart1"),
  1512. this.echartsTheme
  1513. );
  1514. myChart1.dispatchAction({
  1515. type: "hideTip",
  1516. });
  1517. myChart2.dispatchAction({
  1518. type: "hideTip",
  1519. });
  1520. if (name === "全域功率预测") {
  1521. this.$refs.global.getChartsData();
  1522. this.$refs.global.getTableData();
  1523. } else {
  1524. this.$refs.global.getwindChartsData();
  1525. this.$refs.global.getwindTableData();
  1526. }
  1527. });
  1528. }
  1529. },
  1530. changeDate(date) {
  1531. var y = date.getFullYear();
  1532. var m = date.getMonth() + 1;
  1533. m = m < 10 ? "0" + m : m;
  1534. var d = date.getDate();
  1535. d = d < 10 ? "0" + d : d;
  1536. var h = date.getHours();
  1537. h = h < 10 ? "0" + h : h;
  1538. var minute = date.getMinutes();
  1539. minute = minute < 10 ? "0" + minute : minute;
  1540. var second = date.getSeconds();
  1541. second = second < 10 ? "0" + second : second;
  1542. return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
  1543. },
  1544. // 今日功率预测
  1545. getPowerPrediction() {
  1546. let that = this;
  1547. apiGetPowerPrediction().then((datas) => {
  1548. if (datas && datas.data) {
  1549. let xAxis = [];
  1550. let series = [];
  1551. let legend = [];
  1552. if (datas.data.dateList.length > 0) {
  1553. datas.data.dateList.forEach((item) => {
  1554. xAxis.push(item.substring(item.indexOf(" ") + 1));
  1555. });
  1556. }
  1557. if (datas.data.dataFormatList.length > 0) {
  1558. datas.data.dataFormatList.forEach((iten) => {
  1559. if (iten.name !== "短期") {
  1560. legend.push(iten.name);
  1561. let seriesObj = {
  1562. name: iten.name,
  1563. type: "line",
  1564. data: iten.data.map((it) => {
  1565. return that.$utils.isHasNum(it);
  1566. }),
  1567. symbol: "none",
  1568. };
  1569. series.push(seriesObj);
  1570. }
  1571. });
  1572. }
  1573. that.getPowerLine("lineChart", "今日功率预测", xAxis, legend, series);
  1574. }
  1575. });
  1576. },
  1577. // 今日风速预测
  1578. getWindSpeed(type) {
  1579. let that = this;
  1580. if (type === "风速") {
  1581. apiGetWindSpeed().then((datas) => {
  1582. that.handleWindSunData(datas, type);
  1583. });
  1584. } else {
  1585. apiGetirradianceForecast().then((datas) => {
  1586. that.handleWindSunData(datas, type);
  1587. });
  1588. }
  1589. },
  1590. //处理风速和辐照度数据
  1591. handleWindSunData(datas, type) {
  1592. if (datas && datas.data) {
  1593. let xAxis = [];
  1594. let series = [];
  1595. let legend = [];
  1596. if (datas.data.dateList.length > 0) {
  1597. datas.data.dateList.forEach((item) => {
  1598. xAxis.push(item.substring(item.indexOf(" ") + 1));
  1599. });
  1600. }
  1601. if (datas.data.dataFormatList.length > 0) {
  1602. datas.data.dataFormatList.forEach((iten) => {
  1603. legend.push(iten.name);
  1604. let seriesObj = {
  1605. name: iten.name,
  1606. type: "line",
  1607. data: iten.data.map((it) => {
  1608. return this.$utils.isHasNum(it);
  1609. }),
  1610. symbol: "none",
  1611. };
  1612. series.push(seriesObj);
  1613. });
  1614. }
  1615. this.getPowerLine(
  1616. "lineChart1",
  1617. type === "风速" ? "今日风速预测" : "今日辐照度预测",
  1618. xAxis,
  1619. legend,
  1620. series
  1621. );
  1622. }
  1623. },
  1624. getPowerLine(name, title, xAxis, legend, series) {
  1625. let option = {
  1626. title: {
  1627. text: title,
  1628. textStyle: {
  1629. fontSize: "16",
  1630. fontWeight: "bold",
  1631. },
  1632. },
  1633. tooltip: {
  1634. trigger: "axis",
  1635. formatter: name === "lineChart" ?
  1636. (item) => {
  1637. let str =
  1638. `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
  1639. let strMsg = "";
  1640. if (item.length > 1) {
  1641. item.forEach((it, index) => {
  1642. // if (index !== 3) {
  1643. if (it.seriesName !== "超短期") {
  1644. strMsg = `<div style="margin-bottom: 5px">
  1645. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
  1646. <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
  1647. </div>`;
  1648. this.showpowerLegend[index].name = it.seriesName;
  1649. this.showpowerLegend[index].color = it.color;
  1650. } else {
  1651. if (it.axisValue === "00:15:00") {
  1652. it.color = "#e96366";
  1653. }
  1654. strMsg = `<div style="margin-bottom: 5px">
  1655. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
  1656. it.color
  1657. };\"></span>&nbsp;
  1658. <span style="display:inline-block;">${
  1659. it.color === "#e96366" ? "超短期" : "短期"
  1660. }:</span>&nbsp;&nbsp;<span>${it.value}</span>
  1661. </div>`;
  1662. if (it.color === "#e96366") {
  1663. this.showpowerLegend[index].name = "超短期";
  1664. } else {
  1665. this.showpowerLegend[index].name = "短期";
  1666. }
  1667. this.showpowerLegend[index].color = it.color;
  1668. }
  1669. str = str + strMsg;
  1670. });
  1671. } else {
  1672. if (item[0].axisValue === "00:15:00") {
  1673. item[0].color = "#e96366";
  1674. }
  1675. strMsg = `<div style="margin-bottom: 5px">
  1676. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
  1677. item[0].color
  1678. };\"></span>&nbsp;
  1679. <span style="display:inline-block;">${
  1680. item[0].color === "#e96366" ? "超短期" : "短期"
  1681. }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
  1682. </div>`;
  1683. if (item[0].color === "#e96366") {
  1684. this.showpowerLegend[3].name = "超短期";
  1685. } else {
  1686. this.showpowerLegend[3].name = "短期";
  1687. }
  1688. this.showpowerLegend[3].color = item[0].color;
  1689. str = str + strMsg;
  1690. }
  1691. return str;
  1692. } : "",
  1693. },
  1694. // axisPointer: {
  1695. // link: {
  1696. // xAxisIndex: 'all'
  1697. // },
  1698. // label: {
  1699. // formatter: (params) =>{
  1700. // // debugger
  1701. // this.lengedObj = params.seriesData[3]
  1702. // console.log('lengedObj======>>>>', this.lengedObj)
  1703. // if (this.lengedObj.color !== '#39ccd9') {
  1704. // option.legend.data = legend
  1705. // } else {
  1706. // legend.forEach(it =>{
  1707. // if (it === '超短期') {
  1708. // it = '短期'
  1709. // }
  1710. // })
  1711. // option.legend.data = legend
  1712. // }
  1713. // }
  1714. // }
  1715. // },
  1716. legend: {
  1717. right: name !== "lineChart1" ? "20" : "20%",
  1718. data: legend,
  1719. // show: name === 'lineChart' ? false : true
  1720. show: false,
  1721. // formatter: name === 'lineChart' ? (name, type) => {
  1722. // // debugger
  1723. // if (!type) {
  1724. // switch (name) {
  1725. // case '超短期':
  1726. // return this.lengedObj.seriesName ? this.lengedObj.seriesName : name
  1727. // break;
  1728. // default:
  1729. // return name
  1730. // }
  1731. // } else {
  1732. // let datalen = []
  1733. // name.seriesData.forEach(it =>{
  1734. // if (it.color === '#39ccd9') {
  1735. // it.seriesName = '短期'
  1736. // }
  1737. // datalen.push(it.seriesName)
  1738. // })
  1739. // return datalen
  1740. // }
  1741. // } : ''
  1742. },
  1743. grid: {
  1744. left: "5%",
  1745. right: "5%",
  1746. bottom: "3%",
  1747. containLabel: true,
  1748. },
  1749. xAxis: {
  1750. type: "category",
  1751. boundaryGap: false,
  1752. data: xAxis,
  1753. },
  1754. yAxis: {
  1755. type: "value",
  1756. name: title === "今日功率预测" ?
  1757. "兆瓦(Mw)" : title === "今日风速预测" ?
  1758. "m/s" : "W/㎡",
  1759. },
  1760. series: series,
  1761. };
  1762. if (!this.theme) {
  1763. option.backgroundColor = "";
  1764. }
  1765. if (name === "lineChart") {
  1766. let hour = new Date().getHours() + 6;
  1767. let min = new Date().getMinutes();
  1768. let allTime = "";
  1769. let num = 0;
  1770. if (0 <= min && min < 15) {
  1771. allTime = hour + ":00:00";
  1772. } else if (15 <= min && min < 30) {
  1773. allTime = hour + ":15:00";
  1774. } else if (30 <= min && min < 45) {
  1775. allTime = hour + ":30:00";
  1776. } else if (45 <= min && min < 60) {
  1777. allTime = hour + ":45:00";
  1778. }
  1779. xAxis.forEach((item, index) => {
  1780. if (item === allTime) {
  1781. num = index;
  1782. }
  1783. });
  1784. if (num > 0) {
  1785. option.visualMap = {
  1786. show: false,
  1787. dimension: 0,
  1788. seriesIndex: 3,
  1789. pieces: [{
  1790. gt: 0,
  1791. lte: num,
  1792. color: "#e96366",
  1793. },
  1794. {
  1795. gt: num,
  1796. color: "#39ccd9",
  1797. },
  1798. ],
  1799. };
  1800. }
  1801. } else {
  1802. option.legend.show = true;
  1803. option.data = legend;
  1804. option.right = "20";
  1805. }
  1806. // 基于准备好的dom,初始化echarts实例
  1807. let dom = document.getElementById(name);
  1808. dom.removeAttribute("_echarts_instance_") ?
  1809. dom.removeAttribute("_echarts_instance_") :
  1810. "";
  1811. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1812. myChart.setOption(option);
  1813. myChart.on(
  1814. "mousemove",
  1815. this.setTooltip("lineChart", "lineChart1", this.windShow ? 3 : 0)
  1816. );
  1817. window.addEventListener("resize", function () {
  1818. myChart.resize();
  1819. });
  1820. },
  1821. setTooltip(name1, name2, num) {
  1822. const myChart1 = this.$echarts.init(
  1823. document.getElementById(name1),
  1824. this.echartsTheme
  1825. );
  1826. const myChart2 = this.$echarts.init(
  1827. document.getElementById(name2),
  1828. this.echartsTheme
  1829. );
  1830. this.$utils.setTooltip(myChart1, myChart2, num);
  1831. },
  1832. // 装机,并网,实时,可用电量
  1833. getCapacity() {
  1834. let that = this;
  1835. apiGetCapacity().then((datas) => {
  1836. if (datas && datas.data) {
  1837. let xAxis = [];
  1838. let series = [];
  1839. let legend = [];
  1840. if (datas.data.name.length > 0) {
  1841. datas.data.name.forEach((item) => {
  1842. let XaObj = {
  1843. value: item,
  1844. textStyle: {
  1845. width: 100,
  1846. height: 25,
  1847. backgroundColor: "#edeffb",
  1848. color: "#36348e",
  1849. borderRadius: 10,
  1850. align: "center",
  1851. verticalAlign: "middle",
  1852. },
  1853. };
  1854. xAxis.push(XaObj);
  1855. });
  1856. }
  1857. if (datas.data.dataFormatList.length > 0) {
  1858. datas.data.dataFormatList.forEach((iten, index) => {
  1859. legend.push(iten.name);
  1860. let seriesObj = {
  1861. name: iten.name,
  1862. type: "bar",
  1863. barGap: 0,
  1864. emphasis: {
  1865. focus: "series",
  1866. },
  1867. data: iten.data.map((it) => {
  1868. return that.$utils.isHasNum(it);
  1869. }),
  1870. // itemStyle:{
  1871. // normal: {
  1872. // color: color[index]
  1873. // }
  1874. // }
  1875. };
  1876. series.push(seriesObj);
  1877. });
  1878. }
  1879. that.getPowerBar("barChart", "功率统计", xAxis, legend, series);
  1880. }
  1881. });
  1882. },
  1883. // 预测考核分数
  1884. getAssessmentScore(type) {
  1885. let that = this;
  1886. let params = {
  1887. statisticType: type,
  1888. };
  1889. apiGetAssessmentScore(params).then((datas) => {
  1890. if (datas && datas.data) {
  1891. let xAxis = [];
  1892. let series = [];
  1893. let legend = [];
  1894. if (datas.data.name.length > 0) {
  1895. datas.data.name.forEach((item) => {
  1896. let XaObj = {
  1897. value: item,
  1898. textStyle: {
  1899. width: 120,
  1900. height: 25,
  1901. backgroundColor: "#edeffb",
  1902. color: "#36348e",
  1903. borderRadius: 10,
  1904. align: "center",
  1905. verticalAlign: "middle",
  1906. },
  1907. };
  1908. xAxis.push(XaObj);
  1909. });
  1910. }
  1911. if (datas.data.dataFormatList.length > 0) {
  1912. datas.data.dataFormatList.forEach((iten, index) => {
  1913. legend.push(iten.name);
  1914. let seriesObj = {
  1915. name: iten.name,
  1916. type: "bar",
  1917. barGap: 0,
  1918. emphasis: {
  1919. focus: "series",
  1920. },
  1921. data: iten.data.map((it) => {
  1922. return that.$utils.isHasNum(it);
  1923. }),
  1924. };
  1925. series.push(seriesObj);
  1926. });
  1927. }
  1928. that.getPowerBar("barChart1", "预测考核分数", xAxis, legend, series);
  1929. }
  1930. });
  1931. },
  1932. getPowerBar(name, title, xAxis, legend, series) {
  1933. let option = {
  1934. title: {
  1935. text: title,
  1936. textStyle: {
  1937. fontSize: "16",
  1938. fontWeight: "bold",
  1939. },
  1940. },
  1941. tooltip: {
  1942. trigger: "axis",
  1943. axisPointer: {
  1944. type: "shadow",
  1945. },
  1946. },
  1947. legend: {
  1948. right: "20",
  1949. data: title === "功率统计" ? legend : [],
  1950. },
  1951. grid: {
  1952. left: "1%",
  1953. right: "5%",
  1954. bottom: "2%",
  1955. containLabel: true,
  1956. },
  1957. xAxis: [{
  1958. type: "category",
  1959. axisTick: {
  1960. show: false,
  1961. },
  1962. axisLabel: {
  1963. margin: 18,
  1964. },
  1965. data: xAxis,
  1966. }, ],
  1967. yAxis: [{
  1968. type: "value",
  1969. name: title === "预测考核分数" ? "分" : "兆瓦(M/w)",
  1970. }, ],
  1971. series: series,
  1972. };
  1973. if (!this.theme) {
  1974. option.backgroundColor = "";
  1975. }
  1976. if (title === "预测考核分数") {
  1977. option.grid.height = "70%";
  1978. option.legend.width = "100%";
  1979. option.legend.top = 25;
  1980. } else {
  1981. option.legend.right = "20";
  1982. }
  1983. // 基于准备好的dom,初始化echarts实例
  1984. let dom = document.getElementById(name);
  1985. dom.removeAttribute("_echarts_instance_") ?
  1986. dom.removeAttribute("_echarts_instance_") :
  1987. "";
  1988. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1989. myChart.setOption(option);
  1990. window.addEventListener("resize", function () {
  1991. myChart.resize();
  1992. });
  1993. },
  1994. },
  1995. };
  1996. </script>
  1997. <style lang="less" scoped>
  1998. @import "../../viewsCss/homePageNoMapLess.less";
  1999. .themeDark {
  2000. .homePage_main {
  2001. background: #040c0b;
  2002. .mainLeft,
  2003. .mainRight {
  2004. .lineStyle {
  2005. background: #161f1e;
  2006. .chart-name {
  2007. display: flex;
  2008. align-items: center;
  2009. position: absolute;
  2010. top: 0;
  2011. height: 39px;
  2012. width: 96%;
  2013. border-bottom: 1px solid rgba(153, 153, 153, 0.5);
  2014. .point {
  2015. width: 6px;
  2016. height: 1px;
  2017. background-color: #ffffff;
  2018. position: absolute;
  2019. &.point-left {
  2020. left: 0;
  2021. }
  2022. &.point-right {
  2023. right: 0;
  2024. }
  2025. &.top {
  2026. top: -1px;
  2027. }
  2028. &.bottom {
  2029. bottom: -1px;
  2030. }
  2031. }
  2032. }
  2033. }
  2034. }
  2035. .mainLeft {
  2036. .styleOneData {
  2037. span {
  2038. width: 90px;
  2039. border-radius: 4px;
  2040. }
  2041. .changeStyle {
  2042. color: #fff;
  2043. background: linear-gradient(90deg,
  2044. rgba(28, 108, 255, 0.7),
  2045. rgba(28, 108, 255, 0));
  2046. border: 1px solid #404858;
  2047. }
  2048. }
  2049. .styleData {
  2050. span {
  2051. width: 90px;
  2052. }
  2053. span:nth-child(1) {
  2054. border-right: none;
  2055. border-radius: 4px 0px 0px 4px;
  2056. }
  2057. span:nth-child(2) {
  2058. border-radius: 0px 4px 4px 0px;
  2059. }
  2060. .changeStyle {
  2061. color: #fff;
  2062. background: linear-gradient(90deg,
  2063. rgba(28, 108, 255, 0.7),
  2064. rgba(28, 108, 255, 0));
  2065. border: 1px solid #404858;
  2066. }
  2067. .defaultSty {
  2068. color: #a1a7b9;
  2069. background: linear-gradient(90deg,
  2070. rgba(64, 72, 88, 0.7),
  2071. rgba(64, 72, 88, 0));
  2072. border: 1px solid #404858;
  2073. }
  2074. }
  2075. }
  2076. .mainRight {
  2077. .styleData {
  2078. span {
  2079. width: 45px;
  2080. }
  2081. span:nth-child(1) {
  2082. border-right: none;
  2083. border-radius: 4px 0px 0px 4px;
  2084. }
  2085. span:nth-child(2) {
  2086. border-right: none;
  2087. }
  2088. span:nth-child(3) {
  2089. border-radius: 0px 4px 4px 0px;
  2090. }
  2091. .changeStyle {
  2092. color: #fff;
  2093. background: linear-gradient(90deg,
  2094. rgba(28, 108, 255, 0.7),
  2095. rgba(28, 108, 255, 0));
  2096. border: 1px solid #404858;
  2097. }
  2098. .defaultSty {
  2099. color: #a1a7b9;
  2100. background: linear-gradient(90deg,
  2101. rgba(64, 72, 88, 0.7),
  2102. rgba(64, 72, 88, 0));
  2103. border: 1px solid #404858;
  2104. }
  2105. }
  2106. .messageData {
  2107. background: #161f1e;
  2108. p {
  2109. color: #fff;
  2110. }
  2111. .msgHeight {
  2112. .stationSty,
  2113. .msgSty {
  2114. color: #fff;
  2115. }
  2116. }
  2117. }
  2118. }
  2119. }
  2120. .footer {
  2121. background: #040c0b;
  2122. .exitV {
  2123. background: #161f1e;
  2124. box-shadow: 0px 1px 5px 0px rgba(159, 161, 175, 0.72);
  2125. position: relative;
  2126. top: 10px;
  2127. border-radius: 10px 10px 0 0;
  2128. .time {
  2129. span {
  2130. font-family: Microsoft YaHei;
  2131. font-weight: 400;
  2132. font-size: 14px;
  2133. color: #fff;
  2134. line-height: 24px;
  2135. margin-left: 10px;
  2136. }
  2137. }
  2138. .earlywarning {
  2139. .warningdata {
  2140. span {
  2141. font-family: Microsoft YaHei;
  2142. font-weight: 400;
  2143. font-size: 14px;
  2144. color: #fff;
  2145. line-height: 24px;
  2146. }
  2147. }
  2148. }
  2149. }
  2150. }
  2151. }
  2152. .themeLight {
  2153. .homePage_main {
  2154. background: #edeffb;
  2155. .mainLeft,
  2156. .mainRight {
  2157. .lineStyle {
  2158. background: #fff;
  2159. .chart-name {
  2160. display: flex;
  2161. align-items: center;
  2162. position: absolute;
  2163. top: 0;
  2164. height: 39px;
  2165. width: 96%;
  2166. border-bottom: 1px solid #e1e3ea;
  2167. .point {
  2168. width: 6px;
  2169. height: 1px;
  2170. background-color: #e1e3ea;
  2171. position: absolute;
  2172. &.point-left {
  2173. left: 0;
  2174. }
  2175. &.point-right {
  2176. right: 0;
  2177. }
  2178. &.top {
  2179. top: -1px;
  2180. }
  2181. &.bottom {
  2182. bottom: -1px;
  2183. }
  2184. }
  2185. }
  2186. }
  2187. }
  2188. .mainLeft {
  2189. .styleOneData {
  2190. span {
  2191. width: 90px;
  2192. border-radius: 4px;
  2193. }
  2194. .changeStyle {
  2195. color: #fff;
  2196. background: linear-gradient(90deg,
  2197. rgba(28, 108, 255, 0.7),
  2198. rgba(28, 108, 255, 0));
  2199. border: 1px solid #404858;
  2200. }
  2201. }
  2202. .styleData {
  2203. span {
  2204. width: 90px;
  2205. }
  2206. span:nth-child(1) {
  2207. border-right: none;
  2208. border-radius: 4px 0px 0px 4px;
  2209. }
  2210. span:nth-child(2) {
  2211. border-radius: 0px 4px 4px 0px;
  2212. }
  2213. .changeStyle {
  2214. color: #fff;
  2215. background: #4f70ec;
  2216. border: 1px solid #4f70ec;
  2217. }
  2218. .defaultSty {
  2219. color: #a1a7b9;
  2220. background: #d0d3e1;
  2221. border: 1px solid #d0d3e1;
  2222. }
  2223. }
  2224. }
  2225. .mainRight {
  2226. .styleData {
  2227. span {
  2228. width: 45px;
  2229. }
  2230. span:nth-child(1) {
  2231. border-right: none;
  2232. border-radius: 4px 0px 0px 4px;
  2233. }
  2234. span:nth-child(2) {
  2235. border-right: none;
  2236. }
  2237. span:nth-child(3) {
  2238. border-radius: 0px 4px 4px 0px;
  2239. }
  2240. .changeStyle {
  2241. color: #fff;
  2242. background: #4f70ec;
  2243. border: 1px solid #4f70ec;
  2244. }
  2245. .defaultSty {
  2246. color: #a1a7b9;
  2247. background: #d0d3e1;
  2248. border: 1px solid #d0d3e1;
  2249. }
  2250. }
  2251. .messageData {
  2252. background: #fff;
  2253. p {
  2254. color: #000;
  2255. }
  2256. .msgHeight {
  2257. .stationSty,
  2258. .msgSty {
  2259. color: #000;
  2260. }
  2261. }
  2262. }
  2263. }
  2264. }
  2265. .footer {
  2266. background: #edeffb;
  2267. .exitV {
  2268. background: #fff;
  2269. box-shadow: 0px 1px 5px 0px rgba(159, 161, 175, 0.72);
  2270. position: relative;
  2271. top: 10px;
  2272. border-radius: 10px 10px 0 0;
  2273. .time {
  2274. span {
  2275. font-family: Microsoft YaHei;
  2276. font-weight: 400;
  2277. font-size: 14px;
  2278. color: #121212;
  2279. line-height: 24px;
  2280. margin-left: 10px;
  2281. }
  2282. }
  2283. .earlywarning {
  2284. .warningdata {
  2285. span {
  2286. font-family: Microsoft YaHei;
  2287. font-weight: 400;
  2288. font-size: 14px;
  2289. color: #121212;
  2290. line-height: 24px;
  2291. }
  2292. }
  2293. }
  2294. }
  2295. }
  2296. }
  2297. </style>