index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  1. <template>
  2. <div class="largeScreen">
  3. <div class="app-title-bg">
  4. <span class="sys-time">{{ sysTime }}</span>
  5. <div class="top-right-style flex items-center">
  6. <div class="top-badge">
  7. <el-badge :value="allBadgeValue.alarm" v-if="allBadgeValue.alarm !== 0">
  8. <img src="../../assets/images/svg/remind.svg" class="badge-img" @click="openAlarm()"/>
  9. </el-badge>
  10. <img src="../../assets/images/svg/remind.svg" class="badge-img" @click="openAlarm()" v-else/>
  11. </div>
  12. <div class="cpp-btu-background home-jump-btu">
  13. <span @click="jumpRout">后台管理</span>
  14. </div>
  15. </div>
  16. <div class="titleBg">
  17. <span class="title-text">集 中 功 率 预 测</span>
  18. </div>
  19. </div>
  20. <div class="home-main-container flex">
  21. <!-- 左-->
  22. <div class="width-20 ml-0 flex-column justify-between">
  23. <div class="border-style">
  24. <div class="barTitleBg right-title-style">场站数据统计</div>
  25. <div class="flex flex-wrap" style="height: 25vh">
  26. <div class="flex width-50">
  27. <img src="../../assets/images/dashboard/num3.png" class="left-img"/>
  28. <div class="flex-column justify-center items-center">
  29. <span>风速(m/s)</span>
  30. <span>{{ envData.ws }}</span>
  31. </div>
  32. </div>
  33. <div class="flex width-50">
  34. <img src="../../assets/images/dashboard/num2.png" class="left-img"/>
  35. <div class="flex-column justify-center items-center">
  36. <span>风电开机容量</span>
  37. <span>{{ envData.ws }}</span>
  38. </div>
  39. </div>
  40. <div class="flex width-50">
  41. <img src="../../assets/images/dashboard/num4.png" class="left-img"/>
  42. <div class="flex-column justify-center items-center">
  43. <span>辐照度(W/㎡)</span>
  44. <span>{{ envData.radiance }}</span>
  45. </div>
  46. </div>
  47. <div class="flex width-50">
  48. <img src="../../assets/images/dashboard/num2.png" class="left-img"/>
  49. <div class="flex-column justify-center items-center">
  50. <span>光伏开机容量</span>
  51. <span>{{ envData.ws }}</span>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="border-style">
  57. <div class="barTitleBg right-title-style">生产数据统计</div>
  58. <div class="flex-column justify-center" style="height: 25vh">
  59. <left-middle :params="leftMiddleParams"/>
  60. </div>
  61. </div>
  62. <div class="border-style position-r">
  63. <div class="barTitleBg right-title-style">短期偏差统计</div>
  64. <div style="height: 30vh">
  65. <left-bottom :params="leftBottomParams"/>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- 中 -->
  70. <div class="width-48 mr-0 ml-0">
  71. <div class="height-58vh">
  72. <div class="position-r height-58vh centerMap">
  73. <center-top />
  74. </div>
  75. </div>
  76. <div class="border-style position-r" style="margin-top: 1%">
  77. <div class="barTitleBg right-title-style flex justify-between">
  78. 功率曲线
  79. <div class="flex position-a" style="right: 2.2vw;">
  80. <div class="btu-checked forecastLine btu-checked-style flex items-center justify-center" id="day"
  81. @click="changeForecastLine('day')">当日
  82. </div>
  83. <div class="btu-no-checked forecastLine btu-checked-style flex items-center justify-center" id="tenDay"
  84. @click="changeForecastLine('tenDay')">十日
  85. </div>
  86. <div class="btu-no-checked forecastLine btu-checked-style flex items-center justify-center" id="wind"
  87. @click="changeForecastLine('wind')">风电
  88. </div>
  89. <div class="btu-no-checked forecastLine btu-checked-style flex items-center justify-center"
  90. id="photovoltaic" @click="changeForecastLine('photovoltaic')">光伏
  91. </div>
  92. </div>
  93. </div>
  94. <center-bottom :params="centerBottomParams"/>
  95. </div>
  96. </div>
  97. <!-- 右-->
  98. <div class="width-20 mr-0 flex-column justify-between">
  99. <div class="border-style position-r">
  100. <div class="flex position-a" style="right: .3vw;top: .5vh">
  101. <div class="btu-checked accuracy btu-checked-style flex items-center justify-center" id="accuracy-day"
  102. @click="changeAccuracy('accuracy-day')">日
  103. </div>
  104. <div class="btu-no-checked accuracy btu-checked-style flex items-center justify-center" id="accuracy-month"
  105. @click="changeAccuracy('accuracy-month')">月
  106. </div>
  107. </div>
  108. <div class="barTitleBg right-title-style ">准确率排名</div>
  109. <div style="height: 25vh">
  110. <right-top :params="rightTopParams"/>
  111. </div>
  112. </div>
  113. <div class="border-style position-r">
  114. <div class="barTitleBg right-title-style flex justify-between">气象预测
  115. <div class="flex">
  116. <div class="btu-checked weather btu-checked-style flex items-center justify-center" id="weather-wind"
  117. @click="changeWeather('weather-wind')">风电
  118. </div>
  119. <div class="btu-no-checked weather btu-checked-style flex items-center justify-center"
  120. id="weather-photovoltaic" @click="changeWeather('weather-photovoltaic')">光伏
  121. </div>
  122. </div>
  123. </div>
  124. <div style="height: 25vh">
  125. <right-middle :params="rightMiddleParams"/>
  126. </div>
  127. </div>
  128. <div class="border-style position-r">
  129. <div class="barTitleBg right-title-style">未来10天预测电量</div>
  130. <div style="height: 30vh">
  131. <right-bottom :params="rightBottomParams"/>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="dark-el-dialog">
  137. <el-dialog width="60%" style="top:15%" :visible.sync="outerVisible" :close-on-click-modal="false">
  138. <div slot="title" class="dialog-title flex justify-between">
  139. <div class="flex justify-between" style="width: 80%">
  140. <el-button @click="acknowledgeAll()">全部确认</el-button>
  141. <div id="btuAll" class="clickAfter" @click="clickBtuClass('btuAll')">
  142. <el-button @click="getAbnormalAlarms('')">全部告警</el-button>
  143. </div>
  144. <div id="btuE1" class="clickBefore" @click="clickBtuClass('btuE1')">
  145. <el-button @click="getAbnormalAlarms('E1')">通道告警</el-button>
  146. </div>
  147. <div id="btuE2" class="clickBefore" @click="clickBtuClass('btuE2')">
  148. <el-button @click="getAbnormalAlarms('E2')">上报告警</el-button>
  149. </div>
  150. <div id="btuE3" class="clickBefore" @click="clickBtuClass('btuE3')">
  151. <el-button @click="getAbnormalAlarms('E3')">站端硬件告警</el-button>
  152. </div>
  153. <div id="btuE4" class="clickBefore" @click="clickBtuClass('btuE4')">
  154. <el-button @click="getAbnormalAlarms('E4')">中心解析告警</el-button>
  155. </div>
  156. <div id="btuE5" class="clickBefore" @click="clickBtuClass('btuE5')">
  157. <el-button @click="getAbnormalAlarms('E5')">通用告警</el-button>
  158. </div>
  159. <el-button @click="getAlarmConfs()">不告警配置</el-button>
  160. </div>
  161. <div class="dialog-title-badge flex justify-between">
  162. <el-badge :value="this.badgeValue.alarm">
  163. <img src="../../assets/images/svg/remind.svg" width="20px"/>
  164. </el-badge>
  165. <!-- <el-badge :value="badgeValue.confirm">-->
  166. <!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
  167. <!-- </el-badge>-->
  168. </div>
  169. </div>
  170. <div>
  171. <el-table
  172. :data="tableDataAlarm"
  173. border max-height="300px"
  174. element-loading-background="rgba(8, 61, 92,1)"
  175. v-loading="loadingAlarm"
  176. style="width: 100%">
  177. <el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
  178. <el-table-column
  179. prop="stationCode" align="center" :formatter="formatStation" :show-overflow-tooltip="true"
  180. label="场站名称"
  181. >
  182. </el-table-column>
  183. <el-table-column
  184. prop="startTime" align="center"
  185. label="报警开始时间" :formatter="formatStartDate"
  186. >
  187. </el-table-column>
  188. <el-table-column
  189. prop="endTime" align="center"
  190. label="报警结束时间" :formatter="formatEndDate"
  191. >
  192. </el-table-column>
  193. <el-table-column
  194. prop="msg" align="center" :show-overflow-tooltip="true"
  195. label="报警描述">
  196. </el-table-column>
  197. \
  198. <el-table-column
  199. prop="alarmType" align="center" :formatter="formatAlarmSource"
  200. label="报警来源">
  201. </el-table-column>
  202. <el-table-column
  203. prop="operate" align="center"
  204. label="操作" width="80">
  205. <template v-slot="{ row }">
  206. <img src="../../assets/images/svg/remind.svg" @click="acknowledge(row)" width="20px"/>
  207. <!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. <div class="block flex" style="justify-content: end">
  212. <el-pagination
  213. popper-class="cpp-popper"
  214. @size-change="handleSizeChangeAlarm"
  215. @current-change="handleCurrentChangeAlarm"
  216. :current-page=this.alarmPage.currentPage
  217. :page-sizes="[10, 15, 30, 50]"
  218. :page-size=this.alarmPage.pageSize
  219. layout="total, sizes, prev, pager, next, jumper"
  220. :total=this.alarmPage.total>
  221. </el-pagination>
  222. </div>
  223. <el-dialog
  224. width="40%" style="top:20%"
  225. title="不告警配置"
  226. :visible.sync="innerVisible"
  227. append-to-body>
  228. <!-- TODO 移植v3 -->
  229. <div class="dark-el-dialog" style="margin-top: -20px">
  230. <el-row>
  231. <el-col :span="1.5">失效时间:</el-col>
  232. <el-col :span="10">
  233. <el-date-picker
  234. :clearable="false"
  235. v-model="expireTime"
  236. type="datetime"
  237. value-format="timestamp"
  238. placeholder="选择失效时间"
  239. popper-class="cpp-popper"
  240. size="small"
  241. @change="changeInfo">
  242. </el-date-picker>
  243. </el-col>
  244. </el-row>
  245. <el-row :gutter="10" class="mb8" style="margin-top: 5px">
  246. <el-col :span="1.5">
  247. <el-button
  248. type="primary"
  249. icon="el-icon-plus"
  250. size="mini"
  251. popper-class="cpp-popper"
  252. @click="handleAdd"
  253. >新增
  254. </el-button>
  255. </el-col>
  256. <el-col :span="1.5">
  257. <el-button
  258. type="success"
  259. icon="el-icon-edit"
  260. size="mini"
  261. popper-class="cpp-popper"
  262. @click="handleUpdate"
  263. >修改
  264. </el-button>
  265. </el-col>
  266. <el-col :span="1.5">
  267. <el-button
  268. type="danger"
  269. icon="el-icon-delete"
  270. size="mini"
  271. popper-class="cpp-popper"
  272. @click="handleDelete"
  273. >删除
  274. </el-button>
  275. </el-col>
  276. <!-- <el-col :span="1.5">-->
  277. <!-- <el-button-->
  278. <!-- type="danger"-->
  279. <!-- plain-->
  280. <!-- icon="el-icon-select"-->
  281. <!-- size="mini"-->
  282. <!-- popper-class="cpp-popper"-->
  283. <!-- @click="getAlarmConfs"-->
  284. <!-- >查询-->
  285. <!-- </el-button>-->
  286. <!-- </el-col>-->
  287. </el-row>
  288. <div style="padding-top: 10px">
  289. <vxe-table
  290. ref="xTable"
  291. align="center"
  292. class="mytable-style"
  293. auto-resize
  294. border
  295. resizable
  296. export-config
  297. highlight-current-row
  298. show-overflow
  299. :data="tableDataAlarmConf"
  300. :radio-config="{trigger: 'row',checkMethod: checkRadioMethod}"
  301. >
  302. <vxe-column type="radio" width="60"/>
  303. <vxe-table-column field="stationCode" title="场站名称"
  304. :formatter="alarmConfTypeStationFormat"></vxe-table-column>
  305. <vxe-table-column field="keyword" title="关键词"></vxe-table-column>
  306. <vxe-table-column field="type" title="类型" :formatter="alarmConfTypeFormat"></vxe-table-column>
  307. <vxe-table-column field="expireTime" title="失效时间"></vxe-table-column>
  308. </vxe-table>
  309. <vxe-pager
  310. background
  311. :loading="loadingAlarmConf"
  312. :current-page.sync="alarmConfPage.currentPage"
  313. :page-size.sync="alarmConfPage.pageSize"
  314. :total="alarmConfPage.total"
  315. @page-change="handleSizeChangeAlarmConf"
  316. :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
  317. </vxe-pager>
  318. </div>
  319. </div>
  320. <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px"
  321. height="600px" style="top:30%"
  322. append-to-body>
  323. <div class="dark-el-dialog">
  324. <el-form ref="form" :model="form" :rules="rules" width="830px" label-width="150px">
  325. <el-row class="mb4">
  326. <el-col :span="12">
  327. <el-form-item label="场站" prop="stationCode">
  328. <el-select v-model="form.stationCode" placeholder="请选择" style="width: 100%"
  329. popper-class="cpp-popper">
  330. <el-option
  331. v-for="item in this.stationSelect()"
  332. :key="item.value"
  333. :label="item.label"
  334. :value="item.value"
  335. />
  336. </el-select>
  337. </el-form-item>
  338. </el-col>
  339. <el-col :span="12">
  340. <el-form-item label="关键词" prop="keyword">
  341. <el-input style="width: 100%" v-model="form.keyword" maxlength="50"
  342. popper-class="cpp-popper"/>
  343. </el-form-item>
  344. </el-col>
  345. </el-row>
  346. <el-row class="mb4">
  347. <el-col :span="12">
  348. <el-form-item label="类型" prop="type">
  349. <el-select v-model="form.type" placeholder="请选择" style="width: 100%"
  350. popper-class="cpp-popper">
  351. <el-option
  352. v-for="item in this.alarmConfType"
  353. :key="item.value"
  354. :label="item.label"
  355. :value="item.value"
  356. />
  357. </el-select>
  358. </el-form-item>
  359. </el-col>
  360. <el-col :span="12">
  361. <el-form-item label="失效时间" prop="expireTime">
  362. <el-date-picker
  363. :clearable="false"
  364. v-model="form.expireTime"
  365. type="datetime"
  366. value-format="yyyy-MM-dd HH:mm:ss"
  367. placeholder="选择失效时间"
  368. :picker-options="pickerOptions"
  369. popper-class="cpp-popper">
  370. </el-date-picker>
  371. </el-form-item>
  372. </el-col>
  373. </el-row>
  374. </el-form>
  375. <div slot="footer" class="dialog-footer">
  376. <el-button type="primary" @click="commitChannel">确 定</el-button>
  377. <el-button @click="cancelChannel">取 消</el-button>
  378. </div>
  379. </div>
  380. </el-dialog>
  381. </el-dialog>
  382. </div>
  383. </el-dialog>
  384. </div>
  385. </div>
  386. </template>
  387. <script>
  388. import {formatToDateTime} from "../../utils/dateUtil";
  389. import leftMiddle from './components/left-middle.vue'
  390. import rightTop from './components/right-top.vue'
  391. import rightBottom from './components/right-bottom.vue'
  392. import centerBottom from "./components/center-bottom.vue";
  393. import rightMiddle from "./components/right-middle.vue";
  394. import leftBottom from "./components/left-bottom.vue";
  395. import centerTop from "./components/center-top.vue";
  396. export default {
  397. name: 'largeScreen',
  398. components: {leftMiddle, rightTop, rightBottom, centerBottom, rightMiddle, leftBottom,centerTop},
  399. data() {
  400. const checkExpireTime = (rule, value, callback) => {
  401. if (value == null || value === '') {
  402. callback(new Error('失效时间不能为空'))
  403. }
  404. if (value < formatToDateTime(new Date().getTime())) {
  405. callback(new Error('失效不能在当前时间之前'))
  406. }
  407. callback()
  408. }
  409. return {
  410. xdbl: 0,
  411. // 限电场站数
  412. xdczs: 0,
  413. // 总场站数
  414. zczs: 0,
  415. realList: [],
  416. ableList: [],
  417. theoryList: [],
  418. cdqList: [],
  419. dqList: [],
  420. sysBizDataTimer: "",
  421. sysTime: '',
  422. sysInterval: null,
  423. outerVisible: false,
  424. innerVisible: false,
  425. tableDataAlarm: [],
  426. tableDataAlarmConf: [],
  427. loadingAlarm: false,
  428. loadingAlarmConf: false,
  429. tableDataAlarmBak: [],
  430. digitalDisk: [
  431. {
  432. name: '实际功率',
  433. num: '0'
  434. }, {
  435. name: '可用功率',
  436. num: '0'
  437. }, {
  438. name: '理论功率',
  439. num: '0'
  440. }, {
  441. name: '超短期预测功率',
  442. num: '0'
  443. }, {
  444. name: '短期预测功率',
  445. num: '0'
  446. }],
  447. totality: {
  448. number: 0,
  449. capacity: 0
  450. },
  451. envData: {
  452. ws: 0,
  453. radiance: 0,
  454. },
  455. // 告警统计值
  456. allBadgeValue: {
  457. alarm: 0,
  458. confirm: 0
  459. },
  460. // 告警统计值
  461. badgeValue: {
  462. alarm: 0,
  463. confirm: 0
  464. },
  465. page: {
  466. total: 0, // 总页数
  467. currentPage: 1, // 当前页数
  468. pageSize: 10 // 每页显示多少条
  469. },
  470. alarmPage: {
  471. total: 0, // 总页数
  472. currentPage: 1, // 当前页数
  473. pageSize: 10 // 每页显示多少条
  474. },
  475. alarmConfPage: {
  476. total: 0, // 总页数
  477. currentPage: 1, // 当前页数
  478. pageSize: 10 // 每页显示多少条
  479. },
  480. stationList: [],
  481. alarmEnum: [],
  482. alarmType: '',
  483. form: {
  484. stationCode: '',
  485. keyword: '',
  486. type: 1,
  487. expireTime: undefined
  488. },
  489. // 表单校验
  490. rules: {
  491. stationCode: [
  492. {required: true, message: "场站编号不能为空", trigger: "blur"}
  493. ],
  494. keyword: [
  495. {required: true, message: "关键词", trigger: "blur"}
  496. ],
  497. type: [
  498. {required: true, message: "类型不能为空", trigger: "blur"}
  499. ],
  500. expireTime: [
  501. {required: true, validator: checkExpireTime}
  502. ],
  503. },
  504. title: '',
  505. open: false,
  506. alarmConfType: [
  507. {
  508. label: "等于",
  509. value: 1
  510. },
  511. {
  512. label: "包含",
  513. value: 0
  514. }
  515. ],
  516. //当前日期之前日期不可选
  517. pickerOptions: {
  518. disabledDate(time) {
  519. return time.getTime() < Date.now() - 8.64e7;
  520. // return time.getTime() <= Date.now();
  521. }
  522. },
  523. expireTime: new Date().getTime(),
  524. leftMiddleParams: {}, //生产数据模块值
  525. rightBottomParams: {}, // 未来10天预测电量
  526. rightTopParams: [], // 准确率排名
  527. centerBottomParams: {},//功率曲线
  528. rightMiddleParams: {},//气象预测
  529. leftBottomParams: {}//短期偏差统计
  530. }
  531. },
  532. beforeDestroy() {
  533. const _this = this
  534. window.removeEventListener('resize', function () {
  535. _this.myChart0.resize();
  536. _this.myChart1.resize();
  537. })
  538. clearInterval(this.sysInterval);
  539. clearInterval(this.sysBizDataTimer);
  540. },
  541. mounted() {
  542. this.init()
  543. const _this = this
  544. this.sysInterval = setInterval(function () {
  545. _this.sysTime = formatToDateTime(new Date())
  546. }, 1000)
  547. if (this.sysBizDataTimer) {
  548. clearInterval(this.sysBizDataTimer);
  549. } else {
  550. this.sysBizDataTimer = setInterval(() => {
  551. this.getBizData(this);//再次加载数据,自己定义的方法
  552. }, 60000);//每隔60秒刷新一次
  553. }
  554. },
  555. methods: {
  556. formatNumber(num) {
  557. if (Number(num) == 0) {
  558. return 0
  559. }
  560. // 转换为字符串以便处理
  561. const numStr = num.toString();
  562. let nums = numStr.split(".")
  563. if (nums[0].length == 1 || nums[0].length == 2) {
  564. return num.toFixed(2);
  565. }
  566. if (nums[0].length == 3) {
  567. return parseFloat(num.toFixed(1));
  568. } else {
  569. return nums[0];
  570. }
  571. },
  572. async getBizData() {
  573. await this.$axios({url: '/largeScreenController/getBizData', method: 'get'}).then(response => {
  574. // 顶部统计值
  575. let sumMap = response.data.sumMap
  576. this.digitalDisk[0].num = this.formatNumber(sumMap.realSum) + ''
  577. this.digitalDisk[1].num = this.formatNumber(sumMap.ableSum) + ''
  578. this.digitalDisk[2].num = this.formatNumber(sumMap.theorySum) + ''
  579. this.digitalDisk[3].num = this.formatNumber(sumMap.cdqSum) + ''
  580. this.digitalDisk[4].num = this.formatNumber(sumMap.dqSum) + ''
  581. // 曲线图
  582. let curveMap = response.data.curveMap
  583. this.centerBottomParams = {
  584. realList: curveMap.realList,
  585. ableList: curveMap.ableList,
  586. theoryList: curveMap.theoryList,
  587. cdqList: curveMap.cdqList,
  588. dqList: curveMap.dqList
  589. }
  590. this.mockData()
  591. // 限电信息
  592. let xdMap = response.data.xdMap
  593. this.totality.number = xdMap.zczs
  594. this.totality.capacity = xdMap.totalCapacity
  595. this.xdczs = xdMap.xdczs
  596. this.zczs = xdMap.zczs
  597. this.xdbl = xdMap.xdbl
  598. // 风速、辐照度平均值
  599. let envDataMap = response.data.envDataMap
  600. this.envData.ws = envDataMap.wsAvg
  601. this.envData.radiance = envDataMap.fzdAvg
  602. }).catch(err => {
  603. clearInterval(this.sysBizDataTimer);
  604. })
  605. },
  606. mockData(){
  607. this.rightBottomParams ={
  608. xData: [
  609. "12-01",
  610. "12-02",
  611. "12-03",
  612. "12-04",
  613. "12-05",
  614. "12-06",
  615. "12-07",
  616. "12-08",
  617. "12-09",
  618. "12-10",
  619. "12-11",
  620. "12-12",
  621. "12-13",
  622. "12-14",
  623. "12-15",
  624. "12-16",
  625. "12-17",
  626. "12-18",
  627. "12-19",
  628. "12-20",
  629. "12-21",
  630. "12-22",
  631. "12-23",
  632. "12-24",
  633. "12-25",
  634. "12-26",
  635. "12-27",
  636. "12-28",
  637. "12-29",
  638. "12-30",
  639. "12-31"
  640. ],
  641. pData: [
  642. 90.69,
  643. 121.28,
  644. 100.1,
  645. 66.02,
  646. 151.14,
  647. 316.08,
  648. 113.21,
  649. 100.14,
  650. 192.39,
  651. 317.92,
  652. 275.32,
  653. 184.14,
  654. 326.11,
  655. 473.03,
  656. 487.25,
  657. 361.38,
  658. 465.54,
  659. 443.73,
  660. 516.83,
  661. 369.04,
  662. 272.89,
  663. 198.42,
  664. 596.15,
  665. 351.34,
  666. 406.07,
  667. 582.7,
  668. 490.01,
  669. 488.05,
  670. 370.14,
  671. 88.29,
  672. 178.89
  673. ]}
  674. this.rightTopParams = [
  675. {sort: 1, name: '新疆光伏电站', accuracy: '99.8%'},
  676. {sort: 2, name: '新疆光伏电站', accuracy: '97.8%'},
  677. {sort: 3, name: '新疆光伏电站', accuracy: '96.8%'},
  678. {sort: 3, name: '新疆光伏电站', accuracy: '96.8%'},
  679. {sort: 4, name: '新疆光伏电站', accuracy: '95.8%'},
  680. {sort: 4, name: '新疆光伏电站', accuracy: '95.8%'}]
  681. this.leftBottomParams = {
  682. boxplotData: [
  683. [-8.09, -3.11, -2.11, 0.21, 5.19],
  684. [-8.65, -2.04, 0.19, 2.36, 8.97],
  685. [-6.46, -0.83, 0.52, 2.92, 8.55],
  686. [-7.97, -1.55, 0.37, 2.74, 9.16],
  687. [-5.56, -0.89, 1.31, 2.23, 6.91],
  688. [-6.23, -1.18, 0.28, 2.19, 7.24]
  689. ],
  690. scatterData: [
  691. ["10月26", -8.41],
  692. ["10月27", -10.48],
  693. ["10月28", 10.61],
  694. ["10月29", 10.1],
  695. ["10月30", -9.39],
  696. ["10月31", 7.88]
  697. ],
  698. xData: ["10月26", "10月27", "10月28", "10月29", "10月30", "10月31"]
  699. }
  700. this.leftMiddleParams ={
  701. dayValue: 456,
  702. daySum: 1000,
  703. realValue: 987,
  704. realSum: 2000
  705. }
  706. },
  707. jumpRout() {
  708. this.$router.push({path: "/cloudDataQuery"})
  709. },
  710. openAlarm() {
  711. this.alarmPage = {
  712. total: 0, // 总页数
  713. currentPage: 1, // 当前页数
  714. pageSize: 10 // 每页显示多少条
  715. }
  716. this.getAbnormalAlarms("")
  717. this.outerVisible = true
  718. },
  719. init() {
  720. this.getBizData()
  721. this.getStationCode()
  722. this.drawTable()
  723. // this.drawChart()
  724. },
  725. async getStationCode() {
  726. await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
  727. this.stationList = response.data
  728. })
  729. await this.$axios({url: '/enumSelect/alarmEnum', method: 'get'}).then(response => {
  730. this.alarmEnum = response.data
  731. })
  732. },
  733. drawTable() {
  734. // let data = [
  735. // {name: 'xxx', date: 1728700191000, describe: 'xxxx', operate: 1, type: 'report'},
  736. // {name: 'xxx', date: 1728613791000, describe: 'xxxx', operate: 1, type: 'tunnel'},
  737. // {name: 'xxx', date: 1728440991000, describe: 'xxxx', operate: 1, type: 'report'},
  738. // {name: 'xxx', date: 1728527391000, describe: 'xxxx', operate: 1, type: ''},
  739. // {name: 'xxx', date: 1728354591000, describe: 'xxxx', operate: 0, type: ''}
  740. // ]
  741. // this.tableDataAlarmBak = data
  742. // this.tableDataAlarm = data
  743. // this.page.total = this.tableDataAlarm.length
  744. this.getAlarmSize()
  745. // this.badgeValue.confirm = this.tableDataAlarm.filter(w => w.operate === 0).length
  746. // this.badgeValue.alarm = this.tableDataAlarm.filter(w => w.operate === 1).length
  747. },
  748. getAlarmSize() {
  749. this.$axios.get('/abnormalAlarm/alarmCountStatus1').then(response => {
  750. this.allBadgeValue.alarm = response.data
  751. }).catch(() => {
  752. })
  753. },
  754. changeInfo() {
  755. this.getAlarmConfs()
  756. },
  757. getAlarmConfs() {
  758. this.loadingAlarmConf = true
  759. let queryParams = {
  760. currentPage: this.alarmConfPage.currentPage,
  761. pageSize: this.alarmConfPage.pageSize,
  762. time: this.expireTime
  763. }
  764. this.innerVisible = true
  765. this.$axios.get('/alarmConf/pageByExpireTime', {params: queryParams}).then(response => {
  766. this.tableDataAlarmConf = response.data.records
  767. this.alarmConfPage.total = response.data.total
  768. this.loadingAlarmConf = false
  769. }).catch(() => {
  770. this.loadingAlarmConf = false
  771. })
  772. },
  773. getAbnormalAlarms(prop) {
  774. this.alarmPage = {
  775. total: 0, // 总页数
  776. currentPage: 1, // 当前页数
  777. pageSize: 10 // 每页显示多少条
  778. }
  779. this.alarmType = prop
  780. this.filterInfo()
  781. },
  782. filterInfo() {
  783. this.getAlarmSize()
  784. this.loadingAlarm = true
  785. let queryParams = {
  786. currentPage: this.alarmPage.currentPage,
  787. pageSize: this.alarmPage.pageSize,
  788. alarmType: this.alarmType
  789. }
  790. this.$axios.get('/abnormalAlarm/dashboard', {params: queryParams}).then(response => {
  791. this.tableDataAlarm = response.data.records
  792. this.alarmPage.total = response.data.total
  793. this.badgeValue.alarm = response.data.total
  794. this.loadingAlarm = false
  795. }).catch(() => {
  796. this.loadingAlarm = false
  797. })
  798. // if (prop !== null) {
  799. // this.tableDataAlarm = this.tableDataAlarmBak.filter(w => w.type === prop)
  800. // } else {
  801. // this.tableDataAlarm = JSON.parse(JSON.stringify(this.tableDataAlarmBak))
  802. // }
  803. },
  804. clickBtuClass(id) {
  805. let clickItem = document.getElementById(id)
  806. let activeItem = document.querySelector('.clickAfter')
  807. activeItem.classList.remove('clickAfter')
  808. activeItem.classList.add('clickBefore')
  809. clickItem.classList.remove('clickBefore')
  810. clickItem.classList.add('clickAfter')
  811. },
  812. /**
  813. * 切换功率曲线按钮
  814. * */
  815. changeForecastLine(id) {
  816. const activeItem = document.querySelector('.btu-checked.forecastLine')
  817. this.checkedClass(id, activeItem)
  818. },
  819. /**
  820. * 切换准确率排行按钮
  821. * */
  822. changeAccuracy(id) {
  823. const activeItem = document.querySelector('.btu-checked.accuracy')
  824. this.checkedClass(id, activeItem)
  825. },
  826. /**
  827. * 切换气象预测按钮
  828. * */
  829. changeWeather(id) {
  830. const activeItem = document.querySelector('.btu-checked.weather')
  831. this.checkedClass(id, activeItem)
  832. },
  833. formatStartDate(row) {
  834. return formatToDateTime(row.startTime)
  835. },
  836. formatEndDate(row) {
  837. if (row.endTime) {
  838. return formatToDateTime(row.startTime)
  839. } else {
  840. return "未结束"
  841. }
  842. },
  843. formatStation(row) {
  844. let name = '未知场站名称'
  845. this.stationList.forEach(s => {
  846. if (row.stationCode == s.value) {
  847. name = s.label
  848. return
  849. }
  850. })
  851. return name
  852. },
  853. formatAlarmSource(row) {
  854. let name = '未知场站名称'
  855. this.alarmEnum.forEach(s => {
  856. if (row.alarmType === s.value) {
  857. name = s.label
  858. return name
  859. }
  860. })
  861. return name
  862. },
  863. handleSizeChangeAlarm(val) {
  864. this.alarmPage.pageSize = val
  865. this.alarmPage.currentPage = 1
  866. this.filterInfo()
  867. },
  868. handleCurrentChangeAlarm(val) {
  869. this.alarmPage.currentPage = val
  870. this.filterInfo()
  871. },
  872. handleSizeChangeAlarmConf({currentPage, pageSize}) {
  873. this.currentPage = currentPage
  874. this.pageSize = pageSize
  875. this.getAlarmConfs();
  876. },
  877. acknowledgeAll() {
  878. this.$confirm('是否确认执行"所有场站告警全部确认"操作?', '提示', {
  879. confirmButtonText: '确定',
  880. cancelButtonText: '取消',
  881. type: 'warning'
  882. }).then(() => {
  883. this.$axios.get('/abnormalAlarm/acknowledgeAll').then(response => {
  884. this.filterInfo()
  885. this.$message.info("确认成功!")
  886. }).catch(() => {
  887. this.loading = false
  888. })
  889. })
  890. },
  891. acknowledge(row) {
  892. this.$confirm('是否对 【' + this.formatStation(row) + ':' + row.msg + '】进行"确认"操作?', '提示', {
  893. confirmButtonText: '确定',
  894. cancelButtonText: '取消',
  895. type: 'warning'
  896. }).then(() => {
  897. row.status = 1
  898. this.$axios.post('/abnormalAlarm/updateStatus1', row).then(response => {
  899. this.$message.info("【" + row.msg + "】 已确认!")
  900. this.filterInfo()
  901. }).catch(() => {
  902. this.loading = false
  903. })
  904. })
  905. },
  906. // 表单重置
  907. reset() {
  908. this.edit = false;
  909. this.form = {
  910. stationCode: '',
  911. name: '',
  912. electricFieldTypeEnum: '',
  913. capacity: '',
  914. longitude: '',
  915. latitude: '',
  916. provinceEnum: '',
  917. ftpChanelId: '',
  918. ftpUrl: '',
  919. },
  920. this.resetForm("form");
  921. },
  922. // 取消按钮
  923. cancelChannel() {
  924. this.open = false;
  925. this.reset();
  926. },
  927. /** 新增按钮操作 */
  928. handleAdd() {
  929. this.reset();
  930. this.open = true;
  931. this.title = "新增场站信息";
  932. this.edit = false;
  933. },
  934. /** 修改按钮操作 */
  935. handleUpdate() {
  936. this.title = "修改场站信息";
  937. this.reset();
  938. const _selectData = this.$refs.xTable.getRadioRecord(true)
  939. if (_selectData == null) {
  940. this.$message({
  941. type: 'warning',
  942. message: '请选择记录!'
  943. });
  944. return
  945. }
  946. this.open = true;
  947. this.edit = true;
  948. this.form = JSON.parse(JSON.stringify(_selectData))
  949. },
  950. // 提交按钮
  951. commitChannel() {
  952. this.$refs["form"].validate(async valid => {
  953. if (valid) {
  954. if (this.form.id != undefined) {
  955. // 更新操作
  956. this.$axios.post('/alarmConf/updateById', this.form).then((res) => {
  957. this.$message.success('修改成功')
  958. this.open = false;
  959. this.getAlarmConfs()
  960. this.getAlarmSize()
  961. this.filterInfo()
  962. }).catch((error) => {
  963. })
  964. } else {
  965. // 新增操作
  966. this.$axios.post('/alarmConf/save', this.form).then((res) => {
  967. if (res == undefined) {
  968. this.$message.success('新增失败')
  969. } else {
  970. this.$message.success('新增成功')
  971. this.getAlarmConfs()
  972. this.getAlarmSize()
  973. this.filterInfo()
  974. this.open = false;
  975. }
  976. }).catch((error) => {
  977. })
  978. }
  979. }
  980. });
  981. },
  982. /** 删除按钮操作 */
  983. handleDelete() {
  984. const _selectData = this.$refs.xTable.getRadioRecord(true)
  985. if (_selectData == null) {
  986. this.$message({
  987. type: 'warning',
  988. message: '请选择记录!'
  989. });
  990. return
  991. }
  992. this.$confirm('是否确认删除?', '提示', {
  993. confirmButtonText: '确定',
  994. cancelButtonText: '取消',
  995. type: 'warning'
  996. }).then(() => {
  997. this.doDelete(_selectData)
  998. }).catch(() => {
  999. });
  1000. },
  1001. /**
  1002. * 删除提交
  1003. */
  1004. doDelete(row) {
  1005. this.$axios.post('/alarmConf/remove', row).then((res) => {
  1006. this.$message.success('删除成功!')
  1007. this.getAlarmConfs()
  1008. }).catch((error) => {
  1009. })
  1010. this.loading = false
  1011. },
  1012. stationSelect() {
  1013. let a = [{label: '所有场站', value: 'all'}]
  1014. this.stationList.forEach(s => {
  1015. a.push(s)
  1016. })
  1017. return a
  1018. },
  1019. alarmConfTypeFormat({cellValue, row, column}) {
  1020. let result = '未知类型'
  1021. this.alarmConfType.forEach(a => {
  1022. if (a.value == cellValue) {
  1023. result = a.label
  1024. }
  1025. })
  1026. return result
  1027. },
  1028. alarmConfTypeStationFormat({cellValue, row, column}) {
  1029. let result = '未知'
  1030. this.stationSelect().forEach(a => {
  1031. if (a.value == cellValue) {
  1032. result = a.label
  1033. }
  1034. })
  1035. return result
  1036. },
  1037. checkRadioMethod({row}) {
  1038. return row.expireTime > formatToDateTime(new Date().getTime())
  1039. },
  1040. checkedClass(id, activeItem) {
  1041. let clickItem = document.getElementById(id)
  1042. // let activeItem = document.querySelector('.btu-checked')
  1043. activeItem.classList.remove('btu-checked')
  1044. activeItem.classList.add('btu-no-checked')
  1045. clickItem.classList.remove('btu-no-checked')
  1046. clickItem.classList.add('btu-checked')
  1047. },
  1048. }
  1049. }
  1050. </script>
  1051. <style scoped lang="scss">
  1052. $top-container-height: 11vh;
  1053. .largeScreen {
  1054. width: 100%;
  1055. height: calc(100vh);
  1056. color: white;
  1057. background-color: #101C38;
  1058. background-image: url('../../assets/images/pageBg.png');
  1059. background-size: cover;
  1060. background-position: center;
  1061. background-repeat: no-repeat;
  1062. }
  1063. .top-right-style {
  1064. width: 15%;
  1065. position: absolute !important;
  1066. right: .8vw;
  1067. justify-content: end;
  1068. }
  1069. .top-badge {
  1070. cursor: pointer;
  1071. margin-right: 1.5vw;
  1072. padding-top: .5vh;
  1073. ::v-deep .el-badge__content.is-fixed {
  1074. top: 5px;
  1075. right: 5px;
  1076. }
  1077. ::v-deep .el-badge__content {
  1078. border-radius: .5vw;
  1079. font-size: .6vw;
  1080. height: 2vh;
  1081. line-height: 2vh;
  1082. padding: 0 .2vw;
  1083. }
  1084. }
  1085. .home-jump-btu {
  1086. border-color: #1890ff;
  1087. width: 5vw;
  1088. height: 3.15vh;
  1089. cursor: pointer;
  1090. display: flex;
  1091. align-items: center;
  1092. justify-content: center;
  1093. font-size: .85vw;
  1094. }
  1095. .home-jump-btu:active {
  1096. transform: translateY(2px);
  1097. }
  1098. .chartStyle {
  1099. width: 100%;
  1100. height: 30vh;
  1101. }
  1102. .home-main-container {
  1103. position: relative;
  1104. }
  1105. .float-container {
  1106. position: absolute;
  1107. }
  1108. .right-container-style {
  1109. width: 30%;
  1110. margin-top: 3vh;
  1111. //height: calc(100vh - 10rem);
  1112. }
  1113. .left-container-style {
  1114. width: 12%;
  1115. height: calc(50%);
  1116. left: 3vw;
  1117. font-size: 1vw;
  1118. }
  1119. .left-img {
  1120. width: 6vw;
  1121. }
  1122. .badge-img {
  1123. width: 1.5vw;
  1124. }
  1125. .border-style {
  1126. border-radius: 5px;
  1127. box-shadow: 0px 1px 5px 3px rgba(29, 128, 218, 0.85);
  1128. }
  1129. .right-top-style {
  1130. font-size: 1vw;
  1131. width: 50%;
  1132. }
  1133. .top-1 {
  1134. top: 1rem;
  1135. }
  1136. .top-2 {
  1137. top: 5vh;
  1138. }
  1139. .top-default {
  1140. top: $top-container-height;
  1141. }
  1142. .right-1 {
  1143. right: 1rem;
  1144. }
  1145. .width-100 {
  1146. width: 100%;
  1147. }
  1148. .height-10r {
  1149. height: $top-container-height;
  1150. }
  1151. .width-20 {
  1152. width: 25vw;
  1153. }
  1154. .width-48 {
  1155. width: 48vw;
  1156. }
  1157. .width-50 {
  1158. width: 50%;
  1159. }
  1160. .height-58vh {
  1161. height: 58vh
  1162. }
  1163. .text-style {
  1164. width: 70%;
  1165. height: 3.5vh;
  1166. padding: .6vh 0 0 2.2vw;
  1167. font-size: .9vw;
  1168. }
  1169. .unit-style {
  1170. margin-left: .5vw;
  1171. font-size: 1vw;
  1172. }
  1173. .num-style {
  1174. width: 1.55vw;
  1175. height: 5vh;
  1176. font-size: 1.5vw;
  1177. margin-left: 0.5vw;
  1178. }
  1179. .number-bg-style {
  1180. margin-top: 10px;
  1181. }
  1182. .right-title-style {
  1183. width: 90%;
  1184. padding: .5vh 0 0 2vw;
  1185. font-size: 1vw;
  1186. height: 3.6vh;
  1187. }
  1188. .barTitleBg {
  1189. background-image: url('../../assets/images/dashboard/barTitleBg.png');
  1190. background-size: 100% 100%;
  1191. background-position: center;
  1192. background-repeat: no-repeat;
  1193. }
  1194. .centerMap {
  1195. background-image: url('../../assets/images/dashboard/map.png');
  1196. background-size: 100% 100%;
  1197. background-position: center;
  1198. background-repeat: no-repeat;
  1199. }
  1200. .btu-checked-style {
  1201. width: 4vw;
  1202. height: 3vh;
  1203. font-size: .85vw;
  1204. margin-left: .5vw;
  1205. cursor: pointer;
  1206. }
  1207. .btu-checked {
  1208. background-image: url('../../assets/images/dashboard/btu-checked.png');
  1209. background-size: 100% 100%;
  1210. background-position: center;
  1211. background-repeat: no-repeat;
  1212. }
  1213. .btu-no-checked {
  1214. background-image: url('../../assets/images/dashboard/btu-no-checked.png');
  1215. background-size: 100% 100%;
  1216. background-position: center;
  1217. background-repeat: no-repeat;
  1218. }
  1219. .dialog-title {
  1220. width: 90%;
  1221. }
  1222. .dialog-title-badge {
  1223. //width: 10%;
  1224. ::v-deep .el-badge__content.is-fixed {
  1225. top: 10px;
  1226. right: 5px;
  1227. }
  1228. ::v-deep .el-badge__content {
  1229. background-color: transparent;
  1230. font-size: 14px;
  1231. border: none;
  1232. }
  1233. }
  1234. </style>