index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div style="height:calc(100vh);width:100%;background: #000">
  3. <div class="page largeScreeanHomePage">
  4. <div class="timeBox">{{ time }}</div>
  5. <div class="topTiltle">
  6. <span class="title">风压管理平台</span>
  7. <!-- <img-->
  8. <!-- class="titleImg"-->
  9. <!-- referrerpolicy="no-referrer"-->
  10. <!-- src="../../assets/largeScreenImg/index/heilongjiangshengfengziyuangaikuang.png"-->
  11. <!-- />-->
  12. </div>
  13. <div class="btuGroup">
  14. <div class="topBtu topRightBtu" @click="push()">
  15. <span class="btuText">后台管理</span>
  16. </div>
  17. </div>
  18. <div class="myMain-container">
  19. <!-- 环境检测仪 -->
  20. <div class="main-left">
  21. <div class="mainBg eqBox" v-for="item in eqData">
  22. <div class="subtitleDiv" @click="clickWeatherLook(item)">
  23. <span class="subtitle">{{ item.weatherLookName }}</span>
  24. </div>
  25. <div class="eqContainer">
  26. <div class="imgBox">
  27. <img src="../../../public/img/FXY.png"/>
  28. </div>
  29. <div class="contentBox">
  30. <div>
  31. <svg class="icon" aria-hidden="true">
  32. <use xlink:href="#icon-xinghao"></use>
  33. </svg>
  34. <span class="header-title">型号:</span> <span>{{ item.modelNumber }}</span>
  35. </div>
  36. <div>
  37. <svg class="icon" aria-hidden="true">
  38. <use xlink:href="#icon-jingweidu"></use>
  39. </svg>
  40. <span class="header-title">经纬度:</span> <span>{{ item.longitude }} , {{ item.latitude }}</span>
  41. </div>
  42. <div>
  43. <svg class="icon" aria-hidden="true">
  44. <use xlink:href="#icon-wendu"></use>
  45. </svg>
  46. <span class="header-title">温度:</span> {{item.t}} °
  47. </div>
  48. <div>
  49. <svg class="icon" aria-hidden="true">
  50. <use xlink:href="#icon-shidu-copy"></use>
  51. </svg>
  52. <span class="header-title">湿度:</span> {{item.rh}} %rh
  53. </div>
  54. <div>
  55. <svg class="icon" aria-hidden="true">
  56. <use xlink:href="#icon-YaQiang"></use>
  57. </svg>
  58. <span class="header-title">压强:</span> {{item.pa}} Pa
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <!-- 实时监控 -->
  65. <div class="main-right">
  66. <div class="mainBg rightBg">
  67. <div class="decoration">
  68. <dv-decoration-12 class="ddv12"/>
  69. </div>
  70. <div class="rightTitleBox">
  71. <div class="rightTitleBg rightTitleContent">
  72. <span>实时监控</span>
  73. </div>
  74. </div>
  75. <!-- 右侧主体 -->
  76. <div class="right-main-container">
  77. <!-- 主体上方 -->
  78. <div style="height: 40%">
  79. <div class="rightSubtitle">通道信息</div>
  80. <div class="tableDiv">
  81. <el-table
  82. :header-cell-style="{'background-color':'transparent',color:'#fff'}"
  83. :data="tableData"
  84. style="width: 100%">
  85. <el-table-column
  86. prop="tunnelName" align="center"
  87. label="通道名称"
  88. >
  89. </el-table-column>
  90. <el-table-column
  91. prop="address" align="center"
  92. label="地址"
  93. >
  94. </el-table-column>
  95. <el-table-column
  96. prop="status" align="center"
  97. label="通道状态">
  98. <template slot-scope="scope">
  99. <svg class="icon" aria-hidden="true" v-if="scope.row.status === '1'">
  100. <use xlink:href="#icon-zhengchang"></use>
  101. </svg>
  102. <svg class="icon" aria-hidden="true" v-else>
  103. <use xlink:href="#icon-lianjieduankai"></use>
  104. </svg>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. </div>
  109. </div>
  110. <!--主体下方-->
  111. <div style="height: 60%">
  112. <div class="rightSubtitle">实时风速风向折线图</div>
  113. <div id="wswdChart"/>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </template>
  122. <script>
  123. import {list} from "@/api/biz/dataQuery/weatherLook";
  124. import '../../assets/icons/iconfont'
  125. import {selectHomePage,selectHomePageByPTR} from "@/api/biz/dataQuery/environmentalData";
  126. import {homepageTunnelInfo} from "@/api/biz/dataQuery/tunnelInfo";
  127. import {dateFormat} from "@/utils/dateTimeFormat";
  128. export default {
  129. name: "index",
  130. data() {
  131. return {
  132. time: null,
  133. wsTime: null,
  134. tunnelTime:null,
  135. eqData: [],
  136. eqNo: '',
  137. eqName: '',
  138. //时间控件 当天的零点到23:59:59
  139. dataTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 -1000],
  140. timeList:[],
  141. // ptrData:{1001:{pa: 0, t: 28, rh: 66.5}}
  142. ptrData:[],
  143. tableData:[
  144. {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
  145. {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
  146. {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
  147. {tunnelName:'通道1',address:'192.168.10.226:505',status:'0'},
  148. ],
  149. charts:null
  150. }
  151. },
  152. destroyed() {
  153. this.charts = null
  154. clearInterval(this.timer)
  155. this.timer = null
  156. clearInterval(this.wsTime)
  157. this.wsTime = null
  158. clearInterval(this.tunnelTime)
  159. this.tunnelTime = null
  160. },
  161. mounted() {
  162. this.getTimeArray()
  163. this.formatTime()
  164. this.timer = setInterval(this.formatTime, 1000 * 60)
  165. this.init()
  166. },
  167. methods: {
  168. init(){
  169. this.getWeatherLookInfo()
  170. this.wsTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
  171. this.getTunnelInfo()
  172. this.tunnelTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
  173. },
  174. getWeatherLookInfo() {
  175. selectHomePageByPTR().then(res => {
  176. // this.eqData = res.rows
  177. this.eqData = res.data
  178. this.eqNo = this.eqData[0].weatherLookNo
  179. this.eqName = this.eqData[0].weatherLookName
  180. this.getWindData()
  181. }).catch(err => {
  182. console.log('首页获取环境监测仪信息异常:' + err)
  183. })
  184. },
  185. getWindData() {
  186. selectHomePage({weatherLookNo: this.eqNo}).then(res => {
  187. let ws = res.data.wsList
  188. let wd = res.data.wdList
  189. this.draw(this.timeList, ws, wd, this.eqName)
  190. }).catch(err => {
  191. console.log('首页获取风数据异常:' + err)
  192. })
  193. },
  194. getTunnelInfo(){
  195. homepageTunnelInfo().then(res=>{
  196. this.tableData= res.data
  197. }).catch(err=>{
  198. console.log('获取通道信息异常:'+err)
  199. })
  200. },
  201. clickWeatherLook(value) {
  202. this.eqNo = value.weatherLookNo
  203. this.eqName = value.weatherLookName
  204. clearInterval(this.wsTime)
  205. this.getWindData()
  206. this.wsTime = setInterval(this.getWindData, 1000 * 60 * 10)
  207. },
  208. draw(time, ws, wd, name) {
  209. if(this.charts == null){
  210. this.charts = this.$echarts.init(document.getElementById('wswdChart'));
  211. }
  212. let option = {
  213. title: {
  214. text: name + '数据',
  215. textStyle: {
  216. color: '#fff'
  217. }
  218. },
  219. grid: {
  220. top: 70,
  221. bottom: 70
  222. },
  223. tooltip: {
  224. trigger: 'axis'
  225. },
  226. legend: {
  227. data: ['风速', '风向'],
  228. textStyle: {
  229. color: '#fff'
  230. }
  231. },
  232. dataZoom: [
  233. {
  234. show: false,
  235. realtime: true,
  236. },
  237. {
  238. type: 'inside',
  239. realtime: true,
  240. }
  241. ],
  242. xAxis: [
  243. {
  244. type: 'category',
  245. boundaryGap: false,
  246. axisLine: {onZero: false, lineStyle: {color: '#fff'}},
  247. axisLabel: {color: '#fff'},
  248. data: time
  249. }],
  250. yAxis: [
  251. {
  252. name: '风速(m/s)',
  253. type: 'value',
  254. axisLabel: {color: '#fff'},
  255. axisLine: {show: true},
  256. nameTextStyle: {
  257. color: '#fff'
  258. }
  259. },
  260. {
  261. name: '风向(°)',
  262. alignTicks: true,
  263. axisLabel: {color: '#fff'},
  264. axisLine: {show: true},
  265. nameTextStyle: {
  266. color: '#fff'
  267. },
  268. type: 'value'
  269. }
  270. ],
  271. series: [
  272. {
  273. name: '风速',
  274. type: 'line',
  275. data: ws
  276. },
  277. {
  278. name: '风向',
  279. type: 'line',
  280. yAxisIndex: 1,
  281. data: wd
  282. }
  283. ]
  284. };
  285. option && this.charts.setOption(option,true);
  286. },
  287. push() {
  288. this.$router.push({path: "/dataQuery/weatherStationInfo"})
  289. },
  290. /*时间格式化*/
  291. formatTime() {
  292. this.time = ''
  293. let date = new Date()
  294. let year = date.getFullYear(); // 年
  295. let month = date.getMonth() + 1; // 月
  296. let day = date.getDate();
  297. let hour = date.getHours(); // 获取当前小时数(0-23)
  298. let minutes = date.getMinutes();
  299. if (month < 10) month = "0" + month;
  300. if (day < 10) day = "0" + day;
  301. if (minutes < 10) minutes = "0" + minutes;
  302. this.time = year + "-" + month + "-" + day + " " + hour + ' : ' + minutes;
  303. },
  304. /*获取当天每十分钟一个点的时间集合*/
  305. getTimeArray(){
  306. let timeList = []
  307. for(let i = this.dataTime[0];i<=this.dataTime[1];i+=60*1000*10){
  308. timeList.push(dateFormat(new Date(i)))
  309. }
  310. this.timeList = timeList
  311. }
  312. }
  313. }
  314. </script>
  315. <style scoped>
  316. .icon {
  317. width: 2em;
  318. height: 2em;
  319. vertical-align: -0.15em;
  320. fill: currentColor;
  321. overflow: hidden;
  322. }
  323. .largeScreeanHomePage {
  324. width: 100%;
  325. height: calc(100vh);
  326. background: url(../../../public/img/bg.png) -3px -1px no-repeat;
  327. background-size: 100% 100%;
  328. color: white;
  329. }
  330. .topTiltle {
  331. width: 100%;
  332. height: 5.5%;
  333. background: url(../../assets/largeScreenImg/index/topTitleBg.png) -2px -1px no-repeat;
  334. background-size: 100% 100%;
  335. display: flex;
  336. justify-content: center;
  337. }
  338. .title {
  339. width: 17%;
  340. height: 100%;
  341. text-align: center;
  342. margin-top: .2%;
  343. font-size: 30px;
  344. font-weight: 800;
  345. background-image: linear-gradient(
  346. 360deg,
  347. rgba(178, 204, 252, 1) 0,
  348. rgba(178, 204, 252, 1) 0,
  349. rgba(255, 255, 255, 1) 100%,
  350. rgba(255, 255, 255, 1) 100%
  351. );
  352. background-clip: text;
  353. color: transparent;
  354. }
  355. .timeBox {
  356. position: absolute;
  357. left: 2%;
  358. top: 0;
  359. font-size: 20px;
  360. line-height: 40px;
  361. font-family: timeFont !important;
  362. }
  363. .page {
  364. position: fixed;
  365. top: 0;
  366. left: 0;
  367. bottom: 0;
  368. right: 0;
  369. overflow: auto;
  370. box-shadow: inset 0px -20px 550px 200px rgb(50, 93, 246, 0.1);
  371. }
  372. .btuGroup {
  373. position: absolute;
  374. right: 0;
  375. top: 0;
  376. color: white;
  377. width: 10%;
  378. height: 5.5%;
  379. display: flex;
  380. font-size: 18px;
  381. }
  382. .topBtu {
  383. height: 100%;
  384. margin-top: -1.5%;
  385. display: flex;
  386. justify-content: center;
  387. align-items: center;
  388. cursor: pointer;
  389. }
  390. .topRightBtu {
  391. background: url(../../assets/largeScreenImg/index/topRightBtuBg.png) 100% no-repeat;
  392. background-size: 100% 100%;
  393. width: 100%;
  394. }
  395. /**/
  396. .myMain-container {
  397. margin-top: .5%;
  398. width: 100%;
  399. height: calc(93vh);
  400. display: flex;
  401. justify-content: space-around;
  402. }
  403. .main-left {
  404. width: 66%;
  405. display: flex;
  406. flex-wrap: wrap;
  407. justify-content: space-around;
  408. align-content: stretch;
  409. }
  410. .main-right {
  411. width: 33%;
  412. }
  413. .mainBg {
  414. background: url(../../assets/largeScreenImg/index/leftTextBg.png) 100% no-repeat;
  415. background-size: 100% 110%;
  416. padding: 1%;
  417. }
  418. .rightTitleBg {
  419. height: 40px;
  420. width: 150px;
  421. background: url(../../assets/largeScreenImg/resourcesInfo/heightBg.png) 100% no-repeat;
  422. background-size: 100% 110%;
  423. padding: 1%;
  424. }
  425. .rightTitleContent {
  426. display: flex;
  427. align-items: center;
  428. justify-content: center;
  429. font-size: 20px;
  430. }
  431. .eqBox {
  432. width: 49%;
  433. height: 49%;
  434. }
  435. .rightBg {
  436. height: 99%;
  437. width: 98.5%;
  438. }
  439. .subtitleDiv {
  440. background: url(../../assets/largeScreenImg/resourcesInfo/rightTitleBg.png) 100% no-repeat;
  441. background-size: 100% 100%;
  442. padding: 1%;
  443. }
  444. .subtitle {
  445. position: relative;
  446. left: 8%;
  447. font-size: 20px;
  448. line-height: 20px;
  449. }
  450. .eqContainer {
  451. width: 100%;
  452. height: 90%;
  453. display: flex;
  454. justify-content: space-around;
  455. }
  456. .imgBox {
  457. width: 40%;
  458. height: 90%;
  459. display: grid;
  460. place-items: center;
  461. }
  462. .contentBox {
  463. width: 60%;
  464. height: 70%;
  465. font-size: 18px;
  466. position: relative;
  467. top: 10%;
  468. display: grid;
  469. }
  470. .contentBox div {
  471. line-height: 30px;
  472. display: flex;
  473. align-items: center;
  474. }
  475. .header-title {
  476. margin-left: 3%;
  477. width: 80px;
  478. }
  479. .decoration {
  480. height: 80px;
  481. width: 100px;
  482. overflow: hidden;
  483. position: fixed;
  484. right: 1%;
  485. }
  486. .ddv12 {
  487. width: 150px;
  488. height: 150px;
  489. position: relative;
  490. top: -40%;
  491. left: -20%;
  492. }
  493. .right-main-container {
  494. display: flex;
  495. flex-direction: column;
  496. height: 95%;
  497. justify-content: space-between;
  498. }
  499. .rightSubtitle {
  500. margin: 2% 1%;
  501. width: 40%;
  502. background: url(../../assets/largeScreenImg/zaiyunAndqianqi/branckTitleBg.png) 100% no-repeat;
  503. background-size: 100% 100%;
  504. padding: 1%;
  505. }
  506. #wswdChart {
  507. width: 100%;
  508. height: calc(50vh);
  509. }
  510. .tableDiv /deep/ .el-table, .el-table__expanded-cell {
  511. background-color: transparent;
  512. }
  513. .tableDiv /deep/ .el-table tr {
  514. background-color: transparent!important;
  515. }
  516. .tableDiv /deep/ .el-table--enable-row-transition .el-table__body td, .el-table .cell{
  517. color: #fff;
  518. background-color: transparent;
  519. }
  520. .tableDiv /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  521. background-color: transparent;
  522. }
  523. .tableDiv /deep/.el-table--medium .el-table__cell {
  524. padding: 9px 0;
  525. }
  526. </style>