index.vue 36 KB

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