index.vue 29 KB

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