syzDetails.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. <template>
  2. <!-- <el-dialog-->
  3. <!-- width="90%"-->
  4. <!-- @open="opened"-->
  5. <!-- @closed="closed"-->
  6. <!-- :fullscreen="true"-->
  7. <!-- :show-close="true"-->
  8. <!-- class="dialogs"-->
  9. <!-- >-->
  10. <!-- <template #title>-->
  11. <!-- <div class="showTitles currentShowTitles">-->
  12. <!-- <div class="titles">升压站</div>-->
  13. <!-- </div>-->
  14. <!-- </template>-->
  15. <div class="bodyy">
  16. <el-tabs
  17. type="border-card"
  18. stretch
  19. lazy
  20. style="width: 100%; height: 100%"
  21. v-model="activeTab"
  22. @tab-click="tabClick"
  23. >
  24. <el-tab-pane
  25. class="syzDetailsPaneItem"
  26. v-for="(item, index) in syzArray"
  27. :key="index"
  28. :name="item.id"
  29. >
  30. <template #label>
  31. <span v-if="pageshowMode % 2">
  32. <el-badge is-dot v-if="item.isWarning === '1'">
  33. <span>{{ item.name }}</span>
  34. </el-badge>
  35. <span v-else>{{ item.name }}</span>
  36. </span>
  37. <span v-else>
  38. <el-badge is-dot v-if="item.isWarning === '1'">
  39. <span>{{ item.name }}</span>
  40. </el-badge>
  41. <span v-else>{{ item.name }}</span>
  42. </span>
  43. </template>
  44. <div class="buttonGroup" v-if="item.id === 'all'">
  45. <el-button-group>
  46. <el-button type="plain" size="small" @click="changeHeight('D')"
  47. :class="allHeight === 'D' ? 'showSty' : ''">大图标
  48. </el-button>
  49. <el-button type="plain" size="small" @click="changeHeight('Z')"
  50. :class="allHeight === 'Z' ? 'showSty' : ''">中图标
  51. </el-button>
  52. <el-button type="plain" size="small" @click="changeHeight('X')"
  53. :class="allHeight === 'X' ? 'showSty' : ''">小图标
  54. </el-button>
  55. </el-button-group>
  56. </div>
  57. <div v-if="item.id === 'all'" :style="allpageHeight"
  58. style="width: 100%;display: inline-block;overflow-y:auto">
  59. <div v-for="(item, index) in allSvgMsgData" :key="index" :style="getStyle(allHeight)">
  60. <div class="showAllSvgMsg" @dblclick="dblgetSvgDataFn(item.id)" :class="getWarnstyle(item)">
  61. <div class="showAllSvgMsg_top" v-html="item.msg"></div>
  62. <div class="showAllSvgMsg_bot">
  63. <span>{{ item.name }}</span>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div id="svg" :style="pageHeight" v-if="item.id !== 'all' && item.id === activeTab" v-html="svgMsg" v-loading="loading"></div>
  69. <BHB ref="svgRef" v-if="item.id === 'SXJ_KGDL_BHBF01_SBS'"/>
  70. <BHBSQ ref="svgRef" v-if="item.id === 'SXJ_KGDL_BHB3F01_SBS'"/>
  71. <DJY ref="svgRef" v-if="item.id === 'SXJ_KGDL_DJYF01_SBS'"/>
  72. <GJY ref="svgRef" v-if="item.id === 'SXJ_KGDL_GJYF01_SBS'"/>
  73. <HSM ref="svgRef" v-if="item.id === 'SXJ_KGDL_HSMF01_SBS'"/>
  74. <MLJ ref="svgRef" v-if="item.id === 'NMM_KGDL_MLJF01_SBS'"/>
  75. <NJL ref="svgRef" v-if="item.id === 'SXJ_KGDL_NJLF01_SBS'"/>
  76. <PDL ref="svgRef" v-if="item.id === 'SXJ_KGDL_PDLF01_SBS'"/>
  77. <PTZ ref="svgRef" v-if="item.id === 'SXJ_KGDL_PTZF01_SBS'"/>
  78. <XWT ref="svgRef" v-if="item.id === 'SXJ_KGDL_XWTF01_SBS'"/>
  79. <YF ref="svgRef" v-if="item.id === 'SXJ_KGDL_YFF01_SBS'"/>
  80. <YLZ ref="svgRef" v-if="item.id === 'SXJ_KGDL_YLZF01_SBS'"/>
  81. <YTY ref="svgRef" v-if="item.id === 'SXJ_KGDL_YTYF01_SBS'"/>
  82. <ZK ref="svgRef" v-if="item.id === 'SXJ_KGDL_ZKF01_SBS'"/>
  83. <FSSJS ref="svgRef" v-if="item.id === 'SXJ_KGDL_FSG01_SBS'"/>
  84. <FSJR ref="svgRef" v-if="item.id === 'SXJ_KGDL_JRG01_SBS'"/>
  85. <HRCC ref="svgRef" v-if="item.id === 'SXJ_KGDL_HRG01_SBS'"/>
  86. <PLZH ref="svgRef" v-if="item.id === 'SXJ_KGDL_PLG01_SBS'"/>
  87. <SYRX ref="svgRef" v-if="item.id === 'SXJ_KGDL_SYG01_SBS'"/>
  88. <TZXS ref="svgRef" v-if="item.id === 'SXJ_KGDL_TZG01_SBS'"/>
  89. <TLYY ref="svgRef" v-if="item.id === 'SXJ_KGDL_TLG01_SBS'"/>
  90. <YGWJB ref="svgRef" v-if="item.id === 'SXJ_KGDL_YGG01_SBS'"/>
  91. <YXJH ref="svgRef" v-if="item.id === 'SXJ_KGDL_YXG01_SBS'"/>
  92. <YYYW ref="svgRef" v-if="item.id === 'SXJ_KGDL_YYG01_SBS'"/>
  93. <div class="alarmIconBox" v-if="item.id !== 'all'" @click="switchAlarmSound(index)">
  94. <el-tooltip
  95. v-if="item.isMute"
  96. effect="light"
  97. :content="`当前${item.name}升压站报警已消音,请注意`"
  98. placement="left"
  99. >
  100. <i
  101. class="el-icon-close-notification"
  102. style="color: orangered"
  103. ></i>
  104. </el-tooltip>
  105. <i v-else class="el-icon-bell" style="color: rgb(219, 215, 0)"></i>
  106. </div>
  107. </el-tab-pane>
  108. </el-tabs>
  109. <!-- <CurrentWarningCard-->
  110. <!-- :currentClass="$store.state.currentWarningCardClass"-->
  111. <!-- :activeTab="activeTab || 'MHS_FDC'"-->
  112. <!-- v-if="activeTab !== 'all'"-->
  113. <!-- />-->
  114. </div>
  115. <!-- </el-dialog>-->
  116. </template>
  117. <script>
  118. import BHB from "../factoryMonitor/windPowerPlant/boosterStation/components/BHB.vue";
  119. import BHBSQ from "../factoryMonitor/windPowerPlant/boosterStation/components/BHBSQ.vue";
  120. import DJY from "../factoryMonitor/windPowerPlant/boosterStation/components/DJY.vue";
  121. import GJY from "../factoryMonitor/windPowerPlant/boosterStation/components/GJY.vue";
  122. import HSM from "../factoryMonitor/windPowerPlant/boosterStation/components/HSM.vue";
  123. import MLJ from "../factoryMonitor/windPowerPlant/boosterStation/components/MLJ.vue";
  124. import NJL from "../factoryMonitor/windPowerPlant/boosterStation/components/NJL.vue";
  125. import PDL from "../factoryMonitor/windPowerPlant/boosterStation/components/PDL.vue";
  126. import PTZ from "../factoryMonitor/windPowerPlant/boosterStation/components/PTZ.vue";
  127. import XWT from "../factoryMonitor/windPowerPlant/boosterStation/components/XWT.vue";
  128. import YF from "../factoryMonitor/windPowerPlant/boosterStation/components/YF.vue";
  129. import YLZ from "../factoryMonitor/windPowerPlant/boosterStation/components/YLZ.vue";
  130. import YTY from "../factoryMonitor/windPowerPlant/boosterStation/components/YTY.vue";
  131. import ZK from "../factoryMonitor/windPowerPlant/boosterStation/components/ZK.vue";
  132. import FSSJS from "../factoryMonitor/photovoltaic/lightBoosterStation/components/fangshansunjiashan.vue";
  133. import FSJR from "../factoryMonitor/photovoltaic/lightBoosterStation/components/fanshijunran.vue";
  134. import HRCC from "../factoryMonitor/photovoltaic/lightBoosterStation/components/huairenchuchen.vue";
  135. import PLZH from "../factoryMonitor/photovoltaic/lightBoosterStation/components/pingluzuhu.vue";
  136. import SYRX from "../factoryMonitor/photovoltaic/lightBoosterStation/components/shanyinrongxin.vue";
  137. import TZXS from "../factoryMonitor/photovoltaic/lightBoosterStation/components/tianzhenxusheng.vue";
  138. import TLYY from "../factoryMonitor/photovoltaic/lightBoosterStation/components/tunliuwuyuan.vue";
  139. import YGWJB from "../factoryMonitor/photovoltaic/lightBoosterStation/components/yanggaoweijiabao.vue";
  140. import YXJH from "../factoryMonitor/photovoltaic/lightBoosterStation/components/yingxianjinghui.vue";
  141. import YYYW from "../factoryMonitor/photovoltaic/lightBoosterStation/components/youyuyouwei.vue";
  142. import api from "@api/stateMonitor/index.js";
  143. import CurrentWarningCard from "./currentWarningCard.vue";
  144. export default {
  145. props: {
  146. activeTabStation: {
  147. type: String,
  148. default: "",
  149. },
  150. },
  151. components: {
  152. BHB,
  153. BHBSQ,
  154. DJY,
  155. GJY,
  156. HSM,
  157. MLJ,
  158. NJL,
  159. PDL,
  160. PTZ,
  161. XWT,
  162. YF,
  163. YLZ,
  164. YTY,
  165. ZK,
  166. FSSJS,
  167. FSJR,
  168. HRCC,
  169. PLZH,
  170. SYRX,
  171. TZXS,
  172. TLYY,
  173. YGWJB,
  174. YXJH,
  175. YYYW,
  176. // CurrentWarningCard
  177. },
  178. data() {
  179. return {
  180. activeTab: this.$store.state.activeTab,
  181. svgVisible: true,
  182. audio: null,
  183. timmer: null,
  184. syzArray: [],
  185. pageshowMode: 0,
  186. svgMsg: '',
  187. loading: false,
  188. allTagidArr: [],
  189. starTimer: null,
  190. allTagsMS: {},
  191. allrefreshData: {},
  192. allConditions: {},
  193. onlytag: {},
  194. allSvgMsgData: [],
  195. allHeight: 'D',
  196. allWarnData: [],
  197. starTimerWarn: null,
  198. numm: 0,
  199. stationSort: []
  200. };
  201. },
  202. computed: {
  203. pageHeight() {
  204. return {
  205. 'height': document.documentElement.clientHeight - 60 + 'px'
  206. }
  207. },
  208. allpageHeight() {
  209. return {
  210. 'height': document.documentElement.clientHeight - 200 + 'px'
  211. }
  212. },
  213. },
  214. created() {
  215. this.opened()
  216. },
  217. updated() {
  218. },
  219. methods: {
  220. // 获取升压站报警数据
  221. getSyzWarnData() {
  222. api.alarmFault().then((res) => {
  223. if (res && res.data) {
  224. let datas = res.data
  225. let arr = []
  226. datas.forEach(it => {
  227. if (it.rank === '5' && it.category1 === 'SYZ') {
  228. // if (it.stationName.indexOf('风电场') !== -1 ) {
  229. // str = it.stationName.substring(0, it.stationName.indexOf('风电场'))
  230. // } else if (it.stationName.indexOf('光伏电站') !== -1) {
  231. // str = it.stationName.substring(0, it.stationName.indexOf('光伏电站'))
  232. // }
  233. arr.push(it.category2)
  234. }
  235. // let str = ''
  236. })
  237. this.allWarnData = this.unique(arr)
  238. }
  239. })
  240. },
  241. unique(arr) {
  242. let newArr = []
  243. for (let i = 0; i < arr.length; i++) {
  244. if (newArr.indexOf(arr[i]) === -1) {
  245. newArr.push(arr[i])
  246. }
  247. }
  248. return newArr
  249. },
  250. getWarnstyle(item) {
  251. let showWarn = ''
  252. this.allWarnData.forEach(it => {
  253. if (it === item.id) {
  254. showWarn = 'warningMaskNew'
  255. }
  256. })
  257. return showWarn
  258. },
  259. getStyle(type) {
  260. let num = null
  261. let num1 = null
  262. let num2 = null
  263. if (type === 'D') {
  264. return {
  265. 'width': '33.3%',
  266. 'float': 'left',
  267. 'height': '400px'
  268. }
  269. } else if (type === 'Z') {
  270. num = parseInt(this.allSvgMsgData.length / 4)
  271. num1 = this.allSvgMsgData.length % 4
  272. num2 = num1 > 0 ? num + 1 : num
  273. return {
  274. 'width': '25%',
  275. 'float': 'left',
  276. 'height': (document.documentElement.clientHeight - 200) / num2 + 'px'
  277. }
  278. } else {
  279. num = parseInt(this.allSvgMsgData.length / 5)
  280. num1 = this.allSvgMsgData.length % 5
  281. num2 = num1 > 0 ? num + 1 : num
  282. return {
  283. 'width': '20%',
  284. 'float': 'left',
  285. 'height': (document.documentElement.clientHeight - 200) / num2 + 'px'
  286. }
  287. }
  288. },
  289. changeHeight(type) {
  290. this.allHeight = type
  291. },
  292. getAllStationtab() {
  293. let obj = {
  294. id: 'all',
  295. name: '全部'
  296. }
  297. api.getAllStationTab().then((res) => {
  298. if (res && res.data) {
  299. res.data.unshift(obj)
  300. this.syzArray = res.data
  301. this.activeTab = res.data[0].id
  302. if (this.activeTab === 'all') {
  303. let allMsg = res.data
  304. this.allSvgMsgData = []
  305. this.stationSort = []
  306. allMsg.forEach(it => {
  307. if (it.id !== 'all') {
  308. this.stationSort.push(it.name)
  309. this.getallSvgDataFn(it.id, it.name)
  310. }
  311. })
  312. // window.sessionStorage.setItem('allSvgData', [])
  313. console.log('allSvgMsgData', this.allSvgMsgData)
  314. console.log('stationSort', this.stationSort)
  315. console.log('allMsg', allMsg)
  316. }
  317. // this.getSvgDataFn(res.data[0].id)
  318. }
  319. })
  320. },
  321. // 获取所有升压站数据
  322. getallSvgDataFn(id, name) {
  323. let params = {
  324. id: id
  325. }
  326. api.getSvgData(params).then((res) => {
  327. let str = ''
  328. // str = res.data.substring(res.data.indexOf('<svg'))
  329. str = res
  330. str = str.replace('<svg', '<svg viewBox="0 -100 1900 1260"')
  331. let obj = {
  332. id: id,
  333. name: name,
  334. msg: str
  335. }
  336. this.allSvgMsgData.push(obj)
  337. if (this.allSvgMsgData.length === this.stationSort.length) {
  338. let sortArr = []
  339. this.stationSort.forEach(itc => {
  340. this.allSvgMsgData.forEach(itb => {
  341. if (itc === itb.name) {
  342. sortArr.push(itb)
  343. }
  344. })
  345. })
  346. this.allSvgMsgData = sortArr
  347. }
  348. })
  349. },
  350. // 获取升压站数据
  351. getSvgDataFn(val) {
  352. this.svgMsg = ''
  353. this.loading = true
  354. let params = {
  355. id: val
  356. }
  357. api.getSvgData(params).then((res) => {
  358. if (res && res.data) {
  359. let str = ''
  360. str = res.data.substring(res.data.indexOf('<svg'))
  361. str = str.replace('<svg', '<svg viewBox="0 0 1900 1260"')
  362. this.svgMsg = str
  363. let html = document.getElementById('svg')
  364. let svg1 = document.getElementsByTagName('svg')
  365. this.$nextTick(() => {
  366. if (svg1) {
  367. let allTags = []
  368. let allTagsxc = []
  369. let status = ['g', 'text', 'rect', 'line', 'polyline', 'circle', 'ellipse', 'polygon']
  370. status.forEach(it => {
  371. let allgs = []
  372. allgs = document.querySelectorAll(it);
  373. allTags.push(allgs)
  374. })
  375. allTags = [...allTags[0], ...allTags[1], ...allTags[2], ...allTags[3], ...allTags[4], ...allTags[5], ...allTags[6], ...allTags[7]]
  376. allTags.forEach((it) => {
  377. if (it.getAttribute("tagid")) {
  378. allTagsxc.push(it);
  379. }
  380. });
  381. console.log('allTags222=>', allTagsxc)
  382. this.allTagidArr = allTagsxc
  383. this.getSvgInfo()
  384. }
  385. console.log('html111=>', html)
  386. })
  387. this.loading = false
  388. }
  389. })
  390. },
  391. // 获取触发器
  392. getSvgInfo() {
  393. let params = {
  394. id: this.activeTab
  395. }
  396. api.getAllStationSvgInfo(params).then((res) => {
  397. if (res && res.data) {
  398. if (res.data.tags) {
  399. let strarr = []
  400. let str = ''
  401. for (let i in res.data.tags) {
  402. strarr.push(res.data.tags[i].tag)
  403. }
  404. str = strarr.join(',')
  405. this.allTagsMS = res.data.tags
  406. this.allConditions = res.data.conditions
  407. // this.getrefreshData(str)
  408. this.starTimer = setInterval(() => {
  409. this.getrefreshData(str)
  410. }, 1000)
  411. }
  412. console.log('SvgInfo333=>', res)
  413. }
  414. })
  415. },
  416. // 获取根盾数据
  417. getrefreshData(val) {
  418. api.refreshData(val).then((res) => {
  419. if (res && res.data) {
  420. this.allrefreshData = res.data
  421. this.refreshDataFn(this.allTagsMS)
  422. }
  423. console.log('refreshData444=>', res)
  424. })
  425. },
  426. // 刷新数据
  427. refreshDataFn(datas) {
  428. for (let it in datas) {
  429. let tagId = datas[it];
  430. this.toRefreshFn(it, tagId);
  431. }
  432. },
  433. // 刷新自定义组件
  434. toRefreshFn(val, data) {
  435. var tag = this.allrefreshData[data.tag];
  436. if (!tag) return;
  437. this.allTagidArr.forEach(it => {
  438. this.onlytag = {}
  439. if (it.attributes.tagid) {
  440. if (val === it.attributes.tagid.value) {
  441. this.onlytag = it
  442. if (it.nodeName === 'polyline') {
  443. console.log('onlyTag666', this.onlytag)
  444. }
  445. if (it.nodeName !== 'text') {
  446. if (this.onlytag.attributes.csid) {
  447. let csid = this.onlytag.attributes.csid.value.split(';')
  448. csid.forEach(ic => {
  449. if (ic) {
  450. if (!this.allConditions[ic].isBinding) {
  451. let num = parseInt(this.allConditions[ic].value) === 0 ? '0' : parseInt(this.allConditions[ic].value)
  452. if (num) {
  453. let num2 = tag.value === 0 ? '0' : tag.value
  454. if (num === num2) {
  455. this.onlytag.setAttribute(this.allConditions[ic].property, this.allConditions[ic].propertyValue)
  456. return
  457. }
  458. }
  459. } else {
  460. this.onlytag.setAttribute(this.allConditions[ic].property, this.allConditions[ic].propertyValue)
  461. }
  462. }
  463. })
  464. }
  465. } else {
  466. this.onlytag.textContent = tag.value.toFixed(2)
  467. }
  468. }
  469. }
  470. })
  471. // console.log('onlyTag555', this.onlytag)
  472. },
  473. // '全部'界面双击事件
  474. dblgetSvgDataFn(name) {
  475. this.activeTab = name
  476. // this.getSvgDataFn(name)
  477. },
  478. // 初始化第一次报警并判断是否播放声音
  479. initAlarm() {
  480. let syzAlarmArray = this.$store.getters.syzAlarmArray;
  481. const firstAlarmItem = syzAlarmArray.find((ele) => {
  482. return !ele.isConfirm && ele.rank === this.$store.state.syzAlarmRank;
  483. });
  484. firstAlarmItem &&
  485. this.audioPlay(this.getSound(firstAlarmItem.soundSource));
  486. firstAlarmItem &&
  487. this.$store.getters.syzAlarmArray.forEach((ele) => {
  488. if (ele.stationId === firstAlarmItem.stationId) {
  489. ele.isConfirm = true;
  490. }
  491. });
  492. this.activeTab =
  493. this.activeTabStation ||
  494. firstAlarmItem?.stationId ||
  495. syzAlarmArray.find((ele) => {
  496. return ele.rank === this.$store.state.syzAlarmRank;
  497. })?.stationId ||
  498. this.$store.getters.syzArray[0].id;
  499. syzAlarmArray.forEach((ele) => {
  500. if (ele.stationId === firstAlarmItem?.stationId) {
  501. ele.isConfirm = true;
  502. this.clearWarningTag(ele.stationId);
  503. } else if (
  504. !ele.isConfirm &&
  505. ele.stationId !== firstAlarmItem?.stationId
  506. ) {
  507. this.renderWarningTag(ele.stationId);
  508. }
  509. });
  510. this.$store.commit("syzAlarmArray", syzAlarmArray);
  511. },
  512. // 定时器循环数据判断小红点渲染及是否播放声音
  513. renderAlarm(stationId = "", playSound = true) {
  514. let syzAlarmArray = this.$store.getters.syzAlarmArray;
  515. syzAlarmArray.forEach((ele) => {
  516. if (ele.stationId === stationId) {
  517. ele.isConfirm = true;
  518. this.clearWarningTag(ele.stationId);
  519. } else if (!ele.isConfirm && ele.stationId !== stationId) {
  520. this.renderWarningTag(ele.stationId);
  521. }
  522. });
  523. const res = syzAlarmArray.find((ele) => {
  524. return !ele.isConfirm;
  525. });
  526. if (playSound) {
  527. // this.audioPlay("./static/sound/syz.mp3");
  528. }
  529. this.$store.commit("syzAlarmArray", syzAlarmArray);
  530. },
  531. // 返回音频文件路径
  532. getSound(fileName) {
  533. return `./static/sound/${fileName}.mp3`;
  534. },
  535. // 播放音频
  536. audioPlay(audioPath) {
  537. let soundMuteSelf = [];
  538. let soundMuteOther = [];
  539. this.$store.getters.syzAlarmArray.forEach((ele) => {
  540. if (ele.stationId === this.activeTab) {
  541. soundMuteSelf.push(ele);
  542. } else {
  543. soundMuteOther.push(ele);
  544. }
  545. });
  546. let alarmSelfLock = soundMuteSelf.some((ele) => {
  547. return !ele.isConfirm;
  548. });
  549. let alarmOtherLock = soundMuteOther.some((ele) => {
  550. return !ele.isConfirm;
  551. });
  552. if (alarmOtherLock) {
  553. this.audio = new Audio(audioPath);
  554. this.audio.play();
  555. } else if (alarmSelfLock) {
  556. this.$store.getters.syzArray.forEach((ele) => {
  557. if (ele.stationId === this.activeTab) {
  558. ele.isMute = false;
  559. this.audio = new Audio(audioPath);
  560. this.audio.play();
  561. }
  562. });
  563. } else if (!alarmSelfLock) {
  564. this.$store.getters.syzArray.forEach((ele) => {
  565. if (ele.stationId === this.activeTab) {
  566. if (!ele.isMute) {
  567. this.audio = new Audio(audioPath);
  568. this.audio.play();
  569. }
  570. }
  571. });
  572. }
  573. },
  574. // 显示某个小红点
  575. renderWarningTag(stationId = "") {
  576. this.$store.getters.syzArray.forEach((ele) => {
  577. if (ele.id === stationId) {
  578. ele.isWarning = "1";
  579. }
  580. });
  581. this.pageshowMode++;
  582. },
  583. // 清除某个小红点
  584. clearWarningTag(stationId = "") {
  585. this.$store.getters.syzArray.forEach((ele) => {
  586. if (ele.id === stationId) {
  587. ele.isWarning = "0";
  588. }
  589. });
  590. this.pageshowMode++;
  591. },
  592. // 切换报警声音开关
  593. switchAlarmSound(index) {
  594. this.$store.getters.syzArray[index].isMute =
  595. !this.$store.getters.syzArray[index].isMute;
  596. },
  597. opened() {
  598. // this.initAlarm();
  599. this.getAllStationtab()
  600. /*this.timmer = setInterval(() => {
  601. this.renderAlarm();
  602. }, 3000);
  603. let starTimerWarn = setInterval(() => {
  604. this.getSyzWarnData()
  605. }, 2000)
  606. if (this.activeTabStation) {
  607. setTimeout(() => {
  608. clearInterval(this.starTimer);
  609. this.starTimer = null;
  610. this.$store.commit("activeTab", this.activeTabStation);
  611. this.renderAlarm(this.activeTabStation, false);
  612. if (this.activeTabStation !== 'all') {
  613. this.activeTab = this.activeTabStation
  614. this.debounce(this.getSvgDataFn(this.activeTabStation), 200)
  615. }
  616. }, 100);
  617. }*/
  618. },
  619. closed() {
  620. // this.$refs.svgRef[0].closed()
  621. // this.$refs.svgRef[1].closed()
  622. // this.$refs.svgRef[2].closed()
  623. // this.$refs.svgRef[3].closed()
  624. // this.$refs.svgRef[4].closed()
  625. clearInterval(this.starTimer);
  626. clearInterval(this.starTimerWarn);
  627. clearInterval(this.timmer);
  628. this.starTimer = null
  629. this.starTimerWarn = null
  630. this.timmer = null;
  631. this.$store.commit("activeTab", "");
  632. this.$store.commit("syzDialogShow", false);
  633. },
  634. tabClick(res) {
  635. // clearInterval(this.starTimer);
  636. // this.starTimer = null;
  637. // this.$store.commit("activeTab", res.props.name);
  638. /*this.renderAlarm(res.props.name, false);
  639. if (res.props.name !== 'all') {
  640. this.debounce(this.getSvgDataFn(res.props.name), 200)
  641. // this.getSvgDataFn(res.props.name)
  642. }*/
  643. },
  644. debounce(fn, delay) {
  645. var delay = delay || 200;
  646. var timer;
  647. return function () {
  648. var th = this;
  649. var args = arguments;
  650. if (timer) {
  651. clearTimeout(timer);
  652. }
  653. timer = setTimeout(function () {
  654. timer = null;
  655. fn.apply(th, args);
  656. }, delay);
  657. };
  658. },
  659. throttle(fn, interval) {
  660. var last;
  661. var timer;
  662. var interval = interval || 200;
  663. return function () {
  664. var th = this;
  665. var args = arguments;
  666. var now = +new Date();
  667. if (last && now - last < interval) {
  668. clearTimeout(timer);
  669. timer = setTimeout(function () {
  670. last = now;
  671. fn.apply(th, args);
  672. }, interval);
  673. } else {
  674. last = now;
  675. fn.apply(th, args);
  676. }
  677. }
  678. }
  679. },
  680. watch: {
  681. "$store.state.syzArray"(res) {
  682. this.syzArray = res;
  683. },
  684. },
  685. };
  686. </script>
  687. <style lang="less" scoped>
  688. .bodyy {
  689. display: flex;
  690. flex-direction: row;
  691. background-color: black;
  692. width: 98%;
  693. margin-top: -30px;
  694. height: 90vh;
  695. position: relative;
  696. overflow: hidden;
  697. margin-left: 44px;
  698. .syzDetailsPaneItem {
  699. position: relative;
  700. .buttonGroup {
  701. margin-bottom: 10px;
  702. display: flex;
  703. // justify-content: end;
  704. float: right;
  705. .el-button-group {
  706. .el-button {
  707. min-height: 30px !important;
  708. }
  709. .showSty {
  710. color: #409eff;
  711. border-color: #c6e2ff;
  712. background-color: #ecf5ff;
  713. outline: 0;
  714. }
  715. }
  716. }
  717. .warningMaskNew {
  718. background-color: rgba(186, 50, 55, 0.5);
  719. animation: fade 2000ms infinite;
  720. -webkit-animation: fade 2000ms infinite;
  721. }
  722. @keyframes fade {
  723. from {
  724. opacity: 0.7;
  725. }
  726. 50% {
  727. opacity: 0.3;
  728. }
  729. to {
  730. opacity: 0.7;
  731. }
  732. }
  733. @-webkit-keyframes fade {
  734. from {
  735. opacity: 0.7;
  736. }
  737. 50% {
  738. opacity: 0.3;
  739. }
  740. to {
  741. opacity: 0.7;
  742. }
  743. }
  744. .showAllSvgMsg {
  745. width: calc(100% - 15px);
  746. height: calc(100% - 15px);
  747. // padding: 20px;
  748. // margin-bottom: 20px;
  749. // background: #3a3a3a;
  750. // border: 3px solid #3a3a3a;
  751. border: 3px solid #646464;
  752. border-radius: 10px;
  753. .showAllSvgMsg_top {
  754. border-radius: 10px 10px 0 0;
  755. height: calc(100% - 40px);
  756. width: 100%;
  757. // background: #fff;
  758. }
  759. .showAllSvgMsg_bot {
  760. background: #3a3a3a;
  761. border-radius: 0 0 8px 8px;
  762. height: 40px;
  763. text-align: center;
  764. span {
  765. position: relative;
  766. top: 10px;
  767. font-weight: bold;
  768. color: #fff;
  769. }
  770. }
  771. }
  772. .alarmIconBox {
  773. position: absolute;
  774. right: 0;
  775. top: 0;
  776. cursor: pointer;
  777. i {
  778. font-size: 20px;
  779. }
  780. }
  781. }
  782. }
  783. </style>
  784. <style lang="less">
  785. .bodyy {
  786. .pop-up-main,
  787. .paln-box {
  788. width: 100%;
  789. height: 90vh;
  790. overflow: hidden;
  791. position: relative;
  792. }
  793. .movableItem {
  794. // width: 1920PX !important;
  795. // height: 800PX !important;
  796. .svg {
  797. // width: 100%;
  798. // height: 92%;
  799. margin-left: 0;
  800. margin-top: 8%;
  801. }
  802. }
  803. .el-badge__content.is-fixed.is-dot {
  804. right: 0;
  805. top: 10px;
  806. background: #f25656;
  807. animation: twinkle 0.75s infinite;
  808. border-color: transparent;
  809. }
  810. @keyframes twinkle {
  811. 0% {
  812. opacity: 0;
  813. }
  814. 50% {
  815. opacity: 1;
  816. }
  817. 100% {
  818. opacity: 0;
  819. }
  820. }
  821. }
  822. .currentShowTitles {
  823. width: 100%;
  824. position: relative;
  825. .alarIcon {
  826. position: absolute;
  827. right: 50px;
  828. top: 5;
  829. font-size: 20px;
  830. cursor: pointer;
  831. }
  832. }
  833. </style>