itdmScreenIndex.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. <template>
  2. <div class="bg">
  3. <!-- 头部 -->
  4. <div class="header">检测试验监控管理平台</div>
  5. <!-- <div>
  6. <a-button class="fanHui" @click="back">返回</a-button>
  7. </div> -->
  8. <div class="l1">
  9. <div class="leHeader">
  10. <span>试验电压数据</span>
  11. </div>
  12. <div class="l1cen">
  13. <div class="l1item">A线电压</div>
  14. <div class="l1item2">{{ this.tY1.voltageA }}V</div>
  15. <div class="l1item">B线电压</div>
  16. <div class="l1item2">{{ this.tY1.voltageB }}V</div>
  17. <div class="l1item">C线电压</div>
  18. <div class="l1item2">{{ this.tY1.voltageC }}V</div>
  19. </div>
  20. </div>
  21. <div class="l2">
  22. <div class="leHeader">
  23. <span>温箱试验数据</span>
  24. </div>
  25. <div class="geXian"></div>
  26. <div class="l1Ta">
  27. <a-table
  28. ref="tableW"
  29. size="small"
  30. rowKey="id"
  31. :scroll="{ y: 'calc(100vh - 600px)' }"
  32. :columns="columnsW"
  33. :dataSource="tableDataW"
  34. :pagination="false">
  35. </a-table>
  36. </div>
  37. </div>
  38. <div class="l3">
  39. <div class="leHeader">
  40. <span>力学试验数据</span>
  41. </div>
  42. <div class="geXian"></div>
  43. <div class="l1Ta">
  44. <a-table
  45. ref="tableL"
  46. size="small"
  47. rowKey="id"
  48. :scroll="{ y: 'calc(100vh - 600px)' }"
  49. :columns="columnsL"
  50. :dataSource="tableDataL"
  51. :pagination="false">
  52. </a-table>
  53. </div>
  54. </div>
  55. <div class="cen">
  56. <div class="ceHeader">
  57. <div>设备运行状况</div>
  58. <div class="ceHeader2 jc-end">
  59. <a-button class="all" size="small" @click="zhengchang()">全部</a-button>
  60. <a-button class="success" size="small" @click="zhengchang(1)">运行中</a-button>
  61. <a-button class="butDanger" size="small" @click="zhengchang(2)">报警</a-button>
  62. <a-button class="danger" size="small" @click="zhengchang(3)">故障</a-button>
  63. <a-button class="info" size="small" @click="zhengchang(0)">待机</a-button>
  64. </div>
  65. </div>
  66. <div class="cen1">
  67. <div class="c1Ta">
  68. <!-- 设备参数状态 -->
  69. <div class="device-data u-flex">
  70. <div class="item-container" v-for="(item, index) in deviceOptions" :key="index" @click="graph(item)">
  71. <div class="font">{{item.deviceName}}</div>
  72. <div class="u-flex-cjac">
  73. <a-row class="row-top">
  74. <a-col :span="12"><div class="grid-content2 bg-purple bt-top" style="padding-top: 10px;">设备编号:</div></a-col>
  75. <a-col :span="12"><div class="grid-content2 bg-purple-light bt-top" style="font-size:8px;padding-top: 1px;">{{item.deviceNo}}</div></a-col>
  76. <a-col :span="12"><div class="grid-content bg-purple" >设备状态:</div></a-col>
  77. <a-col :span="12">
  78. <div v-if="item.deviceStatus == 0" class="grid-content bg-purple-light">待机</div>
  79. <div v-if="item.deviceStatus == 1" class="grid-content bg-purple-light" style="color:#1EFFD5;">运行中</div>
  80. <div v-if="item.deviceStatus == 2" class="grid-content bg-purple-light">报警</div>
  81. <div v-if="item.deviceStatus == 3" class="grid-content bg-purple-light">故障</div>
  82. <div v-if="item.deviceStatus == 4" class="grid-content bg-purple-light"></div>
  83. </a-col>
  84. </a-row>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="ceHeader">
  91. <span>报警信息</span>
  92. <a-button class="pause" size="small" @click="pause">{{typeAll ?'开启播报':'关闭播报' }}</a-button>
  93. </div>
  94. <div class="cen2">
  95. <div class="c2Ta">
  96. <a-table
  97. ref="tableB"
  98. size="small"
  99. rowKey="id"
  100. :scroll="{ y: 'calc(100vh - 600px)' }"
  101. :columns="columnsB"
  102. :dataSource="tableDataB"
  103. :pagination="false">
  104. <span slot="action" slot-scope="text, record">
  105. <!-- <a @click="yuYingDele(record)">删除</a> -->
  106. <a-popconfirm title="确定删除吗?" @confirm="() => yuYingDele(record)">
  107. <a style="color:#0AE2E2;">删除</a>
  108. </a-popconfirm>
  109. <!-- <a-button @click="yuYingDele(record)">
  110. <template #icon><SearchOutlined /></template>
  111. </a-button> -->
  112. </span>
  113. </a-table>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="r1">
  118. <div class="leHeader">
  119. <span>水液位实时监控</span>
  120. </div>
  121. <div class="l1cen">
  122. <div class="shuiyewei">
  123. <div class="echarts" style="height:100%" ref="zhuzhuang"></div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="r2">
  128. <div class="leHeader">
  129. <span>区域环境数据</span>
  130. </div>
  131. <div class="geXian"></div>
  132. <div class="r2Ta">
  133. <a-table
  134. ref="tabletY2"
  135. size="small"
  136. rowKey="id"
  137. :scroll="{y:true}"
  138. :columns="columnstY2"
  139. :dataSource="tY2"
  140. :pagination="false">
  141. <div slot="areaName" slot-scope="text, record">
  142. <span v-if="record.areaName ==1">温箱</span>
  143. <span v-if="record.areaName ==2">力学</span>
  144. <span v-if="record.areaName ==3">霉菌</span>
  145. </div>
  146. </a-table>
  147. </div>
  148. <div class="geXian"></div>
  149. <div class="inOrout">
  150. <div class="iOo">
  151. <div class="ioitem">进水口温度</div>
  152. <div class="ioitem">进水口水压</div>
  153. </div>
  154. <div class="iOo">
  155. <div class="ioitem">{{ this.tY1.inTemperature }}℃</div>
  156. <div class="ioitem">{{ this.tY1.inWaterPressure }}</div>
  157. </div>
  158. <div class="iOo">
  159. <div class="ioitem">出水口温度</div>
  160. <div class="ioitem">出水口水压</div>
  161. </div>
  162. <div class="iOo">
  163. <div class="ioitem">{{ this.tY1.outTemperature }}℃</div>
  164. <div class="ioitem">{{ this.tY1.outWaterPressure }}</div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="r3">
  169. <div class="leHeader">
  170. <span>设备维护数据</span>
  171. </div>
  172. <div class="geXian"></div>
  173. <!-- <div class="shuiyewei2">
  174. <div class="echarts" style="height:95%" ref="zhexian"></div>
  175. </div> -->
  176. <div class="l1Ta">
  177. <a-table
  178. ref="tableS"
  179. size="small"
  180. rowKey="id"
  181. :scroll="{ y: 'calc(100vh - 600px)' }"
  182. :columns="columnsS"
  183. :dataSource="tableDataS"
  184. :pagination="false">
  185. <span slot="action" slot-scope="text, record">
  186. <a @click="handle(record)" style="color:#0AE2E2;">处理完成</a>
  187. </span>
  188. </a-table>
  189. </div>
  190. </div>
  191. <j-modal
  192. :title="title"
  193. :width="width"
  194. :visible="handleOpen"
  195. class="dialog"
  196. @ok="submitForm"
  197. @cancel="handleCancel"
  198. cancelText="关闭">
  199. <a-form-model ref="form" :model="form" :rules="rules">
  200. <a-row>
  201. <a-col :span="24">
  202. <a-form-model-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mima">
  203. <a-input-password v-model="form.mima" placeholder="请输入密码" ></a-input-password>
  204. </a-form-model-item>
  205. </a-col>
  206. </a-row>
  207. </a-form-model>
  208. </j-modal>
  209. </div>
  210. </template>
  211. <script>
  212. // import * as echarts from 'echarts'
  213. import echarts from 'echarts'
  214. require('echarts/theme/macarons') // echarts theme
  215. import { message } from 'ant-design-vue';
  216. import {delBaojing, confirmPa} from '@/api/api'
  217. export default {
  218. name: 'itdmScreenIndex',
  219. data () {
  220. return {
  221. // websocket
  222. // path: 'ws://192.168.2.244:8080/itdmServer/itdmWebsocket/list2',
  223. path: 'ws://127.0.0.1:8080/itdmServer/itdmWebsocket/list2',
  224. socket: '',
  225. // 表头
  226. columnsW: [
  227. { title:'设备名称', align:"center", dataIndex: 'deviceName', },
  228. { title:'温度', align:"center", dataIndex: 'temperature', },
  229. { title:'湿度', align:"center", dataIndex: 'humidity', },
  230. { title:'A相电流', align:"center", dataIndex: 'currentA', },
  231. { title:'B相电流', align:"center", dataIndex: 'currentB', },
  232. { title:'C相电流', align:"center", dataIndex: 'currentC', },
  233. ],
  234. columnsL: [
  235. { title:'设备名称', align:"center", dataIndex: 'deviceName' },
  236. { title:'水温', align:"center", dataIndex: 'waterTemperature', },
  237. { title:'水压', align:"center", dataIndex: 'waterPressure', },
  238. { title:'电流', align:"center", dataIndex: 'current', },
  239. { title:'电压', align:"center", dataIndex: 'voltage', },
  240. ],
  241. columnsB: [
  242. { title:'设备名称', align:"center", dataIndex: 'deviceName', width: 80},
  243. { title:'类型', align:"center", dataIndex: 'valueType', width: 80 },
  244. { title:'数据', align:"center", dataIndex: 'value', },
  245. { title:'上限', align:"center", dataIndex: 'maxValue', },
  246. { title:'下限', align:"center", dataIndex: 'minValue', },
  247. { title:'报警信息', align:"center", dataIndex: 'alarmMessage', width: 260, },
  248. { title:'状态', align:"center", dataIndex: 'action', scopedSlots: { customRender: 'action' } },
  249. ],
  250. columnstY2: [
  251. { title:'区域名称', align:"center", dataIndex: 'areaName', scopedSlots: { customRender: 'areaName' } },
  252. { title:'温度', align:"center", dataIndex: 'temperature', },
  253. { title:'湿度', align:"center", dataIndex: 'humidity', },
  254. { title:'气压', align:"center", dataIndex: 'airPrassure', },
  255. ],
  256. columnsS: [
  257. { title:'设备名称', align:"center", dataIndex: 'deviceName', width: 80 },
  258. { title:'设备编号', align:"center", dataIndex: 'deviceNo', },
  259. { title:'维护时间', align:"center", dataIndex: 'repairTime', },
  260. { title:'剩余天数', align:"center", dataIndex: 'day', width: 80},
  261. { title:'操作', align:"center", dataIndex: 'action', width: 75, scopedSlots: { customRender: 'action' } },
  262. ],
  263. // 通用数据1(电压、进水口出水口温度、水压)
  264. tY1: [],
  265. // 通用数据2(三个区域温度、湿度、气压)
  266. tY2: [],
  267. // 温箱试验数据
  268. tableDataW: [],
  269. // 力学试验数据
  270. tableDataL: [],
  271. // 设备维护数据
  272. tableDataS: [],
  273. // 选择设备
  274. deviceOptions: [], // 所有设备
  275. allDevOptions: [], // 备用所有设备
  276. // 报警数据
  277. tableDataB: [],
  278. // 语音播报
  279. boBaoWZ: [],
  280. yuYin: [],
  281. // 停止播报按钮状态
  282. typeAll: false,
  283. // // 历史预警统计
  284. getYJ: [],
  285. // 单条语音播报id
  286. yuYing: {
  287. deleteId: null,
  288. alarmType: null,
  289. },
  290. shuiyewei: null,
  291. title: '密码验证',
  292. width:800,
  293. handleOpen: false,
  294. labelCol: {
  295. xs: { span: 24 },
  296. sm: { span: 5 },
  297. },
  298. wrapperCol: {
  299. xs: { span: 24 },
  300. sm: { span: 16 },
  301. },
  302. form: {
  303. id: 1,
  304. deviceId: null,
  305. mima: null,
  306. },
  307. // 表单校验
  308. rules: {
  309. mima: [{ required: true, message: "密码不能为空", trigger: "blur" }],
  310. }
  311. }
  312. },
  313. mounted () {
  314. // 设备初始化
  315. this.init()
  316. this.drawzhuzhuang() //绘制柱状图
  317. // this.drawZhexian() // 绘制折线图
  318. window.speechSynthesis.resume(this.voiceContent) // 继续播报
  319. // echarts自适应
  320. window.addEventListener("resize", () =>{
  321. this.zhuChart.resize();
  322. // this.zheChart.resize();
  323. });
  324. },
  325. destroyed () {
  326. console.log(1111)
  327. // 销毁监听
  328. // this.close()
  329. this.socket.close()
  330. window.speechSynthesis.cancel(this.voiceContent)
  331. },
  332. methods: {
  333. // 返回按钮
  334. back(){
  335. this.typeAll = false
  336. // this.$router.push('/visualization2')
  337. this.$router.go(-1);//返回上一层
  338. },
  339. // 停止播报按钮
  340. pause(){
  341. this.typeAll = !this.typeAll
  342. if (this.typeAll){
  343. window.speechSynthesis.cancel(this.voiceContent)
  344. }else{
  345. window.speechSynthesis.speak(this.voiceContent);
  346. }
  347. },
  348. // 查看折线图
  349. graph(item){
  350. console.log(item)
  351. // this.$router.push({path: '/data/wdz2/data/list',query:{deviceNamecj:this.deviceName,activeName: '7'}})
  352. this.$router.push({path: '/itdmScreen/itdmGraph', query:{id:item.id, deviceName:item.deviceName}})
  353. },
  354. // 设备状况按钮
  355. zhengchang(num){
  356. console.log(num)
  357. this.deviceOptions = []
  358. console.log(this.deviceOptions)
  359. var deOption = this.allDevOptions
  360. if( !num && num == undefined ){
  361. this.deviceOptions = this.allDevOptions
  362. return false
  363. }
  364. for (var i = 0; i < deOption.length; i++) {
  365. console.log(deOption[i].deviceStatus)
  366. if(deOption[i].deviceStatus == num){
  367. this.deviceOptions.push(deOption[i])
  368. console.log(this.deviceOptions)
  369. }
  370. }
  371. },
  372. // 单条语音删除按钮
  373. yuYingDele(record){
  374. console.log(record)
  375. console.log(record.id)
  376. this.yuYing.deleteId = record.id
  377. this.yuYing.alarmType = record.alarmType
  378. console.log(this.yuYing)
  379. delBaojing(this.yuYing).then(res =>{
  380. console.log(res)
  381. })
  382. },
  383. // 语音播报
  384. voiceBroadcast(text){
  385. this.voiceContent = new SpeechSynthesisUtterance(text);
  386. this.voiceContent.volume = 100;
  387. this.voiceContent.rate = 1;
  388. this.voiceContent.pitch = 1.5;
  389. console.log(this.voiceContent);
  390. window.speechSynthesis.speak(this.voiceContent)
  391. },
  392. // 处理按钮
  393. handle(record){
  394. console.log(record)
  395. this.reset();
  396. this.form.deviceId = record.deviceId
  397. this.handleOpen = true
  398. },
  399. // 取消按钮
  400. cancel() {
  401. this.handleOpen = false;
  402. this.reset();
  403. },
  404. reset() {
  405. this.form = {
  406. id: 1,
  407. deviceId: null,
  408. mima: null,
  409. };
  410. },
  411. handleCancel () {
  412. // this.close()
  413. this.handleOpen = false;
  414. },
  415. // 提交按钮
  416. submitForm() {
  417. this.$refs["form"].validate(valid => {
  418. if (valid) {
  419. console.log(this.form)
  420. confirmPa(this.form).then(res => {
  421. if (res.success) {
  422. message.success("设备已维护");
  423. this.handleOpen = false;
  424. } else {
  425. message.error('密码错误,维护失败!');
  426. this.form.mima = null;
  427. }
  428. })
  429. }
  430. });
  431. },
  432. // 水液位柱状图
  433. drawzhuzhuang(){
  434. var chartDom = this.$refs.zhuzhuang
  435. this.zhuChart = echarts.init(chartDom);
  436. var option;
  437. option = {
  438. // backgroundColor: '#001037',
  439. grid: {
  440. top: '0',
  441. left: '0',
  442. right: '2%',
  443. bottom: '14%',
  444. },
  445. tooltip: {
  446. show: false,
  447. trigger: 'axis',
  448. backgroundColor: 'rgba(65,114,231,0.8)',
  449. formatter: function (item) {
  450. return item[0].axisValueLabel + '<br />' + item[0].seriesName + ': ' + item[0].data;
  451. },
  452. },
  453. yAxis: {
  454. show: false,
  455. data: ['1月'],
  456. axisLine: {
  457. lineStyle: {
  458. color: '#0a4980',
  459. },
  460. },
  461. axisLabel: {
  462. textStyle: {
  463. color: '#ADD6FF',
  464. fontSize: 12,
  465. },
  466. },
  467. },
  468. xAxis: [
  469. {
  470. show: false,
  471. type: 'value',
  472. splitLine: {
  473. show: false,
  474. },
  475. axisLine: {
  476. show: true,
  477. lineStyle: {
  478. color: '#0a4980',
  479. },
  480. },
  481. axisLabel: {
  482. show: true,
  483. fontSize: 12,
  484. textStyle: {
  485. color: '#ADD6FF',
  486. },
  487. },
  488. },
  489. ],
  490. series: [
  491. {
  492. name: '水液位',
  493. type: 'bar',
  494. barWidth: 12,
  495. itemStyle: {
  496. normal: {
  497. color: {
  498. type: 'linear',
  499. x: 0,
  500. y: 0,
  501. x2: 1,
  502. y2: 0,
  503. colorStops: [
  504. {
  505. offset: 0,
  506. color: 'rgb(5,27,56)', // 0% 处的颜色
  507. },
  508. {
  509. offset: 1,
  510. color: 'rgb(36,188,255)', // 100% 处的颜色
  511. },
  512. ],
  513. global: false, // 缺省为 false
  514. },
  515. },
  516. },
  517. // data: [1.5],
  518. z: 0,
  519. zlevel: 0,
  520. label: {
  521. show: true,
  522. color: '#92E6EF',
  523. position: 'right',
  524. },
  525. },
  526. {
  527. type: 'bar',
  528. barGap: '-125%',
  529. // data: [6],
  530. barWidth: 18,
  531. itemStyle: {
  532. normal: {
  533. color: 'transparent',
  534. barBorderColor: 'rgb(148,217,249)',
  535. barBorderWidth: 1,
  536. },
  537. },
  538. z: 2,
  539. // data: this.tY1.waterLevel
  540. },
  541. ],
  542. };option && this.zhuChart.setOption(option);
  543. },
  544. // websocket
  545. init: function () {
  546. if(typeof(WebSocket) === "undefined"){
  547. alert("您的浏览器不支持socket")
  548. }else{
  549. // 实例化socket
  550. this.socket = new WebSocket(this.path)
  551. // 监听socket连接
  552. this.socket.onopen = this.open
  553. // 监听socket错误信息
  554. this.socket.onerror = this.error
  555. // 监听socket消息
  556. this.socket.onmessage = this.getMessage
  557. // 监听销毁
  558. this.socket.onclose = this.close
  559. }
  560. },
  561. open: function () {
  562. console.log("socket连接成功")
  563. },
  564. error: function () {
  565. console.log("连接错误")
  566. },
  567. getMessage: function (msg) {
  568. // console.log(msg.data,JSON.parse(msg.data))
  569. // console.log(JSON.parse(msg.data).length)
  570. var wsData = JSON.parse(msg.data)
  571. console.log(wsData)
  572. for (var i = 0; i < wsData.length; i++) {
  573. console.log(wsData[i].name)
  574. // 通用数据1
  575. if(wsData[i].name == '通用数据1'){
  576. this.tY1 = wsData[i].data
  577. this.shuiyewei = Number(this.tY1.waterLevel) + 1 +""
  578. console.log(11111111111,this.tY1)
  579. let that = this
  580. this.zhuChart.setOption({
  581. series: [{
  582. // 根据名字对应到相应的系列
  583. name: '水液位',
  584. type: 'bar',
  585. data: [that.tY1.waterLevel]
  586. },
  587. {
  588. type: 'bar',
  589. barGap: '-125%',
  590. barWidth: 18,
  591. z: 2,
  592. data: [that.shuiyewei]
  593. },]
  594. });
  595. // this.$nextTick(() => {
  596. // this.drawzhuzhuang()
  597. // })
  598. }
  599. // 通用数据2
  600. if(wsData[i].name == '通用数据2'){
  601. this.tY2 = wsData[i].data
  602. console.log(22222222222,this.tY2)
  603. }
  604. // 温箱试验数据
  605. if(wsData[i].name == '温箱试验数据'){
  606. this.tableDataW = wsData[i].data
  607. // console.log(this.tableDataW)
  608. }
  609. // 力学试验数据
  610. if(wsData[i].name == '力学设备试验数据'){
  611. this.tableDataL = wsData[i].data
  612. // console.log(this.tableDataL)
  613. }
  614. // 设备状态
  615. if(wsData[i].name == '设备运行状况'){
  616. this.deviceOptions = wsData[i].data
  617. this.allDevOptions = wsData[i].data
  618. console.log(123456,this.deviceOptions)
  619. }
  620. // 报警列表
  621. if(wsData[i].name == '报警列表'){
  622. this.tableDataB = wsData[i].data
  623. console.log(this.tableDataB)
  624. }
  625. // 设备维护列表
  626. if(wsData[i].name == '设备维护预警'){
  627. this.tableDataS = wsData[i].data
  628. console.log(this.tableDataS)
  629. }
  630. // 语音播报
  631. if(wsData[i].name == '语音列表' && this.typeAll == false){
  632. // 1.由于所有异常数据全部读取,停止上一次
  633. window.speechSynthesis.cancel(this.voiceContent)
  634. // console.log(window.speechSynthesis.speaking)
  635. // 2.开始这一次
  636. this.boBaoWZ = wsData[i].data.map((item) => {
  637. // console.log(item)
  638. return item.voice
  639. })
  640. // console.log(this.boBaoWZ)
  641. // // 3.判断是否正在读
  642. // if (window.speechSynthesis.speaking !== false) {
  643. // this.voiceBroadcast(this.boBaoWZ)
  644. // }else{
  645. // this.yuYin = this.boBaoWZ
  646. // this.voiceBroadcast(this.yuYin)
  647. // }
  648. this.voiceBroadcast(this.boBaoWZ)
  649. }
  650. // 历史预警统计
  651. // if(wsData[i].name == 'y'){
  652. // this.getYJ = wsData[i].data
  653. // console.log(this.getYJ)
  654. // this.zheChart.setOption({
  655. // series: [{
  656. // // 根据名字对应到相应的系列
  657. // name: '报警',
  658. // type: 'line',
  659. // data: this.getYJ
  660. // }]
  661. // });
  662. // }
  663. }
  664. }
  665. }
  666. }
  667. </script>
  668. <style lang="less" scoped>
  669. /* flex布局 */
  670. .u-flex,.u-flex-ac,.u-flex-jac,.u-flex-jab,.u-flex-jaa,.u-flex-cjac,.u-flex-cjab,.jc-end{ display: flex; }
  671. .fd-column,.u-flex-cjac,.u-flex-cjab{ flex-direction: column; }
  672. .jc-center,.u-flex-jac,.u-flex-cjac{ justify-content: center; }
  673. .jc-sb,.u-flex-jab,.u-flex-cjab{ justify-content: space-between; }
  674. .jc-sa,.u-flex-jaa{ justify-content: space-around; }
  675. .jc-start{ justify-content: flex-start; }
  676. .jc-end{ justify-content: flex-end; }
  677. .ai-center,.u-flex-ac,.u-flex-jab,.u-flex-jac,.u-flex-jaa,.u-flex-cjac{ align-items: center; }
  678. .ai-start{ align-items: flex-start; }
  679. .ai-end{ align-items: flex-end; }
  680. .ai-stretch{ align-items: stretch; }
  681. .f1{ flex: 1; }
  682. .f-auto{ flex: auto; }
  683. .bg{
  684. width: 100%;
  685. height: 100%;
  686. background: url('../../../assets/images/big.jpg') no-repeat center center;
  687. overflow: hidden;
  688. }
  689. .header{
  690. width: 100%;
  691. height: 60px !important;
  692. background: url('../../../assets/images/titleBg22.png') no-repeat center center;
  693. background-size: cover 100%;
  694. line-height: 60px;
  695. text-align: center;
  696. font-size: 35px;
  697. letter-spacing: 5px;
  698. color: rgb(188, 255, 252);
  699. font-weight: bold;
  700. }
  701. .leHeader{
  702. padding-left: 10px;
  703. width: 100%;
  704. height: 22px;
  705. // background-color: aquamarine;
  706. color: #44bae0;
  707. font-size: 20px;
  708. letter-spacing: 1px;
  709. cursor: pointer;
  710. font-weight: 600;
  711. }
  712. .ceHeader{
  713. padding-left: 10px;
  714. width: 50%;
  715. height: 22px;
  716. // background-color: aquamarine;
  717. color: #44bae0;
  718. font-size: 20px;
  719. letter-spacing: 1px;
  720. cursor: pointer;
  721. font-weight: 600;
  722. }
  723. .ceHeader2{
  724. padding-right: 10px;
  725. width: 50%;
  726. height: 30px;
  727. // background-color: aquamarine;
  728. color: #44bae0;
  729. font-size: 20px;
  730. letter-spacing: 1px;
  731. cursor: pointer;
  732. font-weight: 600;
  733. position: absolute;
  734. right: 0;
  735. top: 1.5%;
  736. }
  737. .geXian{
  738. margin-top: 3px;
  739. background: url('../../../assets/images/up.png') no-repeat center center;
  740. background-size: auto 220%;
  741. // background-color: rgb(255, 204, 127);
  742. width: 100%;
  743. height: 3%;
  744. }
  745. .cen{
  746. margin: 0 10px 18px 10px;
  747. padding: 0.5% 0 0 0;
  748. width: 40%;
  749. height: 88%;
  750. background-color: #27a0d41b !important;
  751. // background: url('../../../assets/images/bg.png') no-repeat center center;
  752. background-size: auto 111.3%;
  753. // background: url('../../../assets/images/2/center2.png') no-repeat center center;
  754. // background-size: contain;
  755. position: absolute;
  756. left: 29.4%;
  757. top: 10%;
  758. // bottom: 0%;
  759. // // 滚动条
  760. // overflow-y: auto;
  761. // 设备布局
  762. .device-data{
  763. flex-wrap: wrap;
  764. // 每一个设备
  765. .item-container{
  766. width: calc(24.5% - 6px);
  767. height: 106px;
  768. margin-bottom: 8px;
  769. margin-left: 2px;
  770. margin-right: 6px;
  771. font-size: 15px;
  772. padding-top: 3px;
  773. // border: 3px solid #148cb1;
  774. // border-width: 140px 40px 90px 40px;
  775. background-image:linear-gradient(0deg, #05799c, #05799c38);
  776. box-shadow: 0 10px 10px 0 rgba(0,0,0,.1);
  777. // border-image: url('../../assets/images/bgs.png') 60 100 50 90 fill;
  778. border-image-width: 26px 40px 18px 32px;
  779. border-image-repeat: stretch;
  780. position: relative;
  781. }
  782. }
  783. }
  784. .cen1{
  785. padding-top: 3px;
  786. margin: 9px 0 0 0;
  787. height: 55%;
  788. width: 100%;
  789. // 滚动条
  790. // overflow-y: auto;
  791. }
  792. .cen2{
  793. margin: 9px 0 0 0;
  794. height: 36%;
  795. width: 100%;
  796. // background-color: aquamarine;
  797. // 滚动条
  798. // overflow-y: auto;
  799. }
  800. .c1Ta{
  801. width: 97%;
  802. height: 97%;
  803. margin: 5px 10px 5px 10px;
  804. // background-color: aquamarine;
  805. // 滚动条
  806. overflow-y: auto;
  807. }
  808. .c2Ta{
  809. width: 97%;
  810. height: 88%;
  811. margin: 5px 10px 5px 10px;
  812. // background-color: aquamarine;
  813. }
  814. .l1{
  815. padding-top: 0.5%;
  816. margin-left: 10px;
  817. height: 10%;
  818. width: 28.5%;
  819. background-color: #10376469;
  820. position: absolute;
  821. top: 10%;
  822. }
  823. .l1cen{
  824. height: 70%;
  825. width: 100%;
  826. margin: 10px 10px 0px 10px;
  827. // background-color: #06c4c437;
  828. display: flex;
  829. // justify-content: center;
  830. }
  831. .l1item{
  832. height: 70%;
  833. width: 16%;
  834. // background-color: #446185;
  835. display: flex;
  836. justify-content: center;
  837. align-items: center;
  838. color: #c6f7ff;
  839. font-size: 14px;
  840. border: 1px solid #0A5D89;
  841. }
  842. .l1item2{
  843. height: 70%;
  844. width: 16%;
  845. background-color: #0A5D89;
  846. display: flex;
  847. justify-content: center;
  848. align-items: center;
  849. color: #c6f7ff;
  850. font-size: 14px;
  851. border: 1px solid #0A5D89;
  852. }
  853. .l2{
  854. padding-top: 2%;
  855. margin-left: 10px;
  856. width: 28.5%;
  857. height: 42%;
  858. // background-color: #0f356169;
  859. // height: 47%;
  860. background: url('../../../assets/images/bg.png') no-repeat center center;
  861. background-size: auto 100%;
  862. position: absolute;
  863. top: 19%;
  864. }
  865. .l1Ta{
  866. width: 96%;
  867. height: 79%;
  868. margin: 5px 10px 0px 10px;
  869. // background-color: aquamarine;
  870. // overflow-y: auto;
  871. }
  872. .l3{
  873. padding-top: 2%;
  874. margin-left: 10px;
  875. width: 28.5%;
  876. height: 42%;
  877. // background-color: #0f356169;
  878. // height: 47%;
  879. background: url('../../../assets/images/bg.png') no-repeat center center;
  880. background-size: auto 100%;
  881. position: absolute;
  882. bottom: 0%;
  883. }
  884. .r1{
  885. margin-right: 10px;
  886. padding-top: 0.5%;
  887. margin-left: 10px;
  888. height: 10%;
  889. width: 28.5%;
  890. background-color: #10376469;
  891. position: absolute;
  892. right: 0px;
  893. top: 10%;
  894. }
  895. .r2{
  896. padding-top: 2%;
  897. margin-right: 10px;
  898. width: 28.5%;
  899. height: 42%;
  900. background: url('../../../assets/images/bg.png') no-repeat center center;
  901. background-size: auto 100%;
  902. position: absolute;
  903. right: 0px;
  904. top: 19%;
  905. }
  906. .r2Ta{
  907. width: 96%;
  908. height: 46%;
  909. margin: 5px 10px 0px 10px;
  910. // background-color: aquamarine;
  911. }
  912. .inOrout{
  913. width: 96%;
  914. height: 28%;
  915. margin: 10px 10px 0px 10px;
  916. display: flex;
  917. }
  918. .iOo{
  919. width: 25%;
  920. height: 100%;
  921. }
  922. .ioitem{
  923. width: 100%;
  924. height: 45%;
  925. color: #c6f7ff;
  926. font-size: 14px;
  927. // background-color: #05799c;
  928. border: 1px solid #0A5D89;
  929. display: flex;
  930. justify-content: center;
  931. align-items: center;
  932. }
  933. .r3{
  934. padding-top: 2%;
  935. margin-right: 10px;
  936. width: 28.5%;
  937. height: 42%;
  938. background: url('../../../assets/images/bg.png') no-repeat center center;
  939. background-size: auto 100%;
  940. position: absolute;
  941. right: 0px;
  942. bottom: 0%;
  943. }
  944. /* 设置滚动条的样式 */
  945. ::-webkit-scrollbar {
  946. width: 10px;
  947. }
  948. /* 滚动槽 */
  949. ::-webkit-scrollbar-track {
  950. -webkit-box-shadow: inset006pxrgba(0,0,0,0.3);
  951. background:rgba(30, 180, 206, 0);
  952. border-radius: 8px;
  953. }
  954. /* 滚动条滑块 */
  955. ::-webkit-scrollbar-thumb {
  956. border-radius: 10px;
  957. background:rgba(30, 179, 206, 0.459);
  958. -webkit-box-shadow: inset006pxrgba(0,0,0,0.5);
  959. }
  960. // ::-webkit-scrollbar-thumb:window-inactive {
  961. // background:rgba(25,189,242, 0.9);
  962. // // background:rgba(37, 173, 214, 0.788);
  963. // }
  964. //每个设备字体
  965. .font{
  966. color: rgba(243, 243, 243, 0.918);
  967. display: flex;
  968. justify-content: center;
  969. }
  970. // 预警字体
  971. ::v-deep.font2{
  972. color: rgba(243, 243, 243, 0.918);
  973. font-size: 16px;
  974. }
  975. // 正常异常按钮显示
  976. .font-bu{
  977. color: rgba(243, 243, 243, 0.918);
  978. display: flex;
  979. justify-content: center;
  980. margin: 10px;
  981. }
  982. // 报警文字
  983. .yc{
  984. color: brown;
  985. }
  986. .shuiyewei{
  987. height: 82%;
  988. width: 96%;
  989. // margin: 10px;
  990. // background-color: aquamarine;
  991. }
  992. .shuiyewei2{
  993. height: 80%;
  994. width: 96%;
  995. margin: 10px;
  996. }
  997. // 返回按钮
  998. .fanHui{
  999. background: #116B8D;
  1000. color: rgb(206, 255, 239);
  1001. border-color: rgba(47, 117, 129, 0.74);
  1002. position: absolute;
  1003. top: 1%;
  1004. right: 1%;
  1005. }
  1006. // 点击按钮后按钮的颜色
  1007. .el-button.is-plain:hover, .el-button.is-plain:focus{
  1008. background: #116B8D;
  1009. color: rgb(206, 255, 239);
  1010. border-color: rgba(47, 117, 129, 0.74);
  1011. }
  1012. .pause{
  1013. // margin: 0 0 0 3%;
  1014. background: #116B8D;
  1015. color: rgb(206, 255, 239);
  1016. border-color: rgba(47, 117, 129, 0.74);
  1017. position: absolute;
  1018. right: 2%;
  1019. }
  1020. // ::v-deep .ant-btn{
  1021. // // margin: 0 0 0 3%;
  1022. // background: #116B8D;
  1023. // color: rgb(206, 255, 239);
  1024. // border-color: rgba(47, 117, 129, 0.74);
  1025. // }
  1026. .boB{
  1027. color: rgb(206, 255, 239);
  1028. }
  1029. .all{
  1030. background: #116B8D;
  1031. color: rgb(206, 255, 239);
  1032. border-color: rgba(47, 117, 129, 0.74);
  1033. }
  1034. .all2{
  1035. background: #5c9bb2;
  1036. color: rgb(206, 255, 239);
  1037. border-color: rgba(47, 117, 129, 0.74);
  1038. }
  1039. // ::v-deep .ant-btn{
  1040. // background: #5c9bb2;
  1041. // color: rgb(206, 255, 239);
  1042. // border-color: rgba(47, 117, 129, 0.74);
  1043. // }
  1044. // 表格
  1045. ::v-deep .ant-table-small{
  1046. border: 0;
  1047. }
  1048. // 更改表头背景样式
  1049. ::v-deep .ant-table-small > .ant-table-content .ant-table-header{
  1050. background-color: #0A5D89 !important;
  1051. // font-size: 15px;
  1052. border-bottom: 0;
  1053. }
  1054. // 更改表头样式
  1055. ::v-deep .ant-table-thead > tr > th{
  1056. border-bottom: 0;
  1057. color: #c6f7ff !important;
  1058. font-size: 15px;
  1059. }
  1060. // 删除表格主体下边框
  1061. ::v-deep .ant-table-tbody > tr > td{
  1062. border-bottom: 0;
  1063. }
  1064. // 更改表格主体样式
  1065. ::v-deep .ant-table-content{
  1066. // background-color: #0A5D89 !important;
  1067. color: #c6f7ff ;
  1068. font-size: 14px;
  1069. border-bottom: 0;
  1070. }
  1071. ::v-deep .ant-table-tbody tr:nth-child(2n)
  1072. {
  1073. background-color:#0A5D89;
  1074. border: 0px;
  1075. }
  1076. ::v-deep .ant-table-tbody tr:nth-child(2n-1)
  1077. {
  1078. background-color:#103A5A;
  1079. border: 0px;
  1080. }
  1081. ::v-deep .ant-table-header .ant-table-hide-scrollbar{
  1082. background-color: #0A5D89 !important;
  1083. color: #c6f7ff;
  1084. font-size: 15px;
  1085. border-bottom: 0;
  1086. }
  1087. // 暂无数据样式
  1088. ::v-deep .ant-table-placeholder{
  1089. background-color:#103A5A;
  1090. border-top: 0px;
  1091. }
  1092. ::v-deep .ant-empty-normal{
  1093. color: #b1d9df;
  1094. }
  1095. // 表格鼠标悬停背景颜色
  1096. ::v-deep table tbody tr:hover>td {
  1097. background-color:#546b94!important
  1098. }
  1099. // ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td{
  1100. // background-color: #546b94 !important;
  1101. // }
  1102. // ::v-deep .el-table--enable-row-transition .el-table__body td{
  1103. // background-color: #103E5F !important;
  1104. // }
  1105. // 上面的方法或者下面的都可以(表格鼠标悬停背景颜色)
  1106. // ::v-deep .el-table__body tr:hover>td{
  1107. // background-color: #103E5F !important;
  1108. // }
  1109. // ::v-deep .el-table__body tr.current-row>td{
  1110. // background-color: #103E5F !important;
  1111. // }
  1112. // 表格滚动条
  1113. // 隐藏表头滚动条
  1114. ::v-deep .ant-table-fixed-header .ant-table-scroll .ant-table-header {
  1115. background: #0A5D89 !important;
  1116. box-sizing: border-box !important;
  1117. // overflow: hidden !important;
  1118. }
  1119. ::v-deep .ant-table-body {
  1120. &::-webkit-scrollbar {
  1121. height: 12px;
  1122. width: 8px;
  1123. overflow-y: auto;
  1124. }
  1125. // 滑块样式
  1126. &::-webkit-scrollbar-thumb {
  1127. border-radius: 5px;
  1128. background: rgba(30, 179, 206, 0.459);
  1129. }
  1130. // 滚动槽样式
  1131. &::-webkit-scrollbar-track {
  1132. -webkit-box-shadow: 0;
  1133. border-radius: 0;
  1134. background: #103A5A;
  1135. }
  1136. }
  1137. /* 修改表格的滚动条(滚动条的宽度)*/
  1138. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  1139. width: 10px; // 横向滚动条
  1140. height: 10px; // 纵向滚动条 必写
  1141. }
  1142. /* 表格滚动条的滑块*/
  1143. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  1144. background-color: rgba(30, 179, 206, 0.459);
  1145. border-radius: 3px; //滚动条圆弧
  1146. }
  1147. /* 表格的表头与内容不对齐 */
  1148. ::v-deep .el-table th.gutter {
  1149. display: table-cell !important;
  1150. }
  1151. // 按钮样式
  1152. .success {
  1153. background-color: #06C4C4;
  1154. border-color:#5bb486bd;
  1155. color: #ffffff;
  1156. margin-left: 5px;
  1157. }
  1158. ::v-deep .ant-btn-primary{
  1159. background-color: #06C4C4;
  1160. border-color:#5bb486bd;
  1161. color: #ffffff;
  1162. }
  1163. .danger {
  1164. background-color: #f0a182;
  1165. border-color: #e49f84;
  1166. color: #ffffff;
  1167. margin-left: 5px;
  1168. }
  1169. .info {
  1170. background-color: #b4b4b4de;
  1171. border-color: #8d8d8d;
  1172. color: #ffffff;
  1173. margin-left: 5px;
  1174. }
  1175. .butDanger {
  1176. background-color: #f08282;
  1177. border-color: #e48484;
  1178. color: #ffffff;
  1179. margin-left: 5px;
  1180. }
  1181. // 自定义表格
  1182. .row-top{
  1183. margin: 5px 5px 5px 5px;
  1184. }
  1185. .bt-top{
  1186. border-top: 1px solid #1797AD;
  1187. }
  1188. .bt-h100{
  1189. height: 100px;
  1190. }
  1191. .bt-h60{
  1192. height: 60px;
  1193. }
  1194. .bt-h250{
  1195. height: 222px;
  1196. }
  1197. .bg-purple {
  1198. text-align: center;
  1199. color: rgba(243, 243, 243, 0.918);
  1200. font-size: 13px;
  1201. // font-weight: 800;
  1202. border-left: 1px solid #1797AD;
  1203. }
  1204. .bg-purple-light {
  1205. text-align: center;
  1206. color: rgba(243, 243, 243, 0.918);
  1207. font-size: 13px;
  1208. // font-weight: 800;
  1209. border-left: 1px solid #1797AD;
  1210. border-right: 1px solid #1797AD;
  1211. }
  1212. .grid-content {
  1213. padding-top: 5px;
  1214. padding-left: 5px;
  1215. padding-right: 5px;
  1216. border-bottom: 1px solid #1797AD;
  1217. min-height: 30px;
  1218. }
  1219. .grid-content2 {
  1220. padding-top: 5px;
  1221. padding-left: 5px;
  1222. padding-right: 5px;
  1223. border-bottom: 1px solid #1797AD;
  1224. min-height: 40px;
  1225. }
  1226. // 弹框样式
  1227. .ant-modal-content{
  1228. padding-top:10%;
  1229. // background-color: #05799c;
  1230. }
  1231. ::v-deep .ant-modal-header{
  1232. background-color:#0A5D89;
  1233. border-bottom: 0px;
  1234. // color: #06C4C4;
  1235. }
  1236. ::v-deep .ant-modal-title{
  1237. // background-color:#0A5D89;
  1238. color: #c6f7ff;
  1239. font-size: 20px;
  1240. }
  1241. ::v-deep .ant-modal-close{
  1242. // background-color:#0A5D89;
  1243. color: #c6f7ff;
  1244. }
  1245. ::v-deep .el-form-item__label{
  1246. // background-color:#0A5D89;
  1247. color: #c6f7ff;
  1248. font-size: 15px;
  1249. font-weight: 600;
  1250. }
  1251. // ::v-deep .el-input__inner:focus{
  1252. // // background-color:#0A5D89;
  1253. // color: #c6f7ff;
  1254. // }
  1255. // 输入框中字体设置
  1256. ::v-deep .ant-form-item-label > label{
  1257. color: #c6f7ff;
  1258. }
  1259. ::v-deep input::-webkit-input-placeholder {
  1260. color: #c6f7ff;
  1261. }
  1262. ::v-deep .ant-input{
  1263. background-color: #3988b3;
  1264. // background-color: #126897;
  1265. // border: 1px solid #1797AD;
  1266. border: 1px solid #197585;
  1267. color: #c6f7ff;
  1268. }
  1269. ::v-deep .ant-modal-body{
  1270. background-color: #0A5D89;
  1271. }
  1272. ::v-deep .ant-modal-footer{
  1273. background-color: #0A5D89;
  1274. border-top: 0px;
  1275. }
  1276. ::v-deep .has-error .ant-form-explain, .has-error .ant-form-split{
  1277. color: #ed6969;
  1278. font-size: 13px;
  1279. }
  1280. ::v-deep .ant-form-item-required::before{
  1281. // color: #e48484;
  1282. border-color: #ed6969;
  1283. }
  1284. // ::v-deep .a {
  1285. // color: #c6f7ff !important;
  1286. // }
  1287. // ::v-deep .a:link {color: red} /* 未访问的链接 */
  1288. // ::v-deep .a:visited {color: green} /* 已访问的链接 */
  1289. // ::v-deep .a:hover {color: black} /* 鼠标移动到链接上 */
  1290. // ::v-deep .a:active {color: yellow} /* 选定的链接,即鼠标按下去的时候不松开显示的状态 */
  1291. </style>