homePageNoMap.vue 82 KB

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