index.vue 33 KB

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