check.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <div class="check-page">
  3. <header>
  4. <div :class="activeId===item.id?'active item':'item'" v-for="item in items" :key="item.id" @click="changeHead(item)">{{ item.name }}</div>
  5. </header>
  6. <div class="tab">
  7. <div :class="activetab===item.id?'active item':'item'" v-for="item in tabs" :key="item.id" @click="changeTab(item)">{{ item.name }}</div>
  8. </div>
  9. <div class="container">
  10. <div class="lf">
  11. <div class="search-container">
  12. <el-input v-model="search.name" class="input" placeholder="请输入传感器名称" />
  13. <el-select v-model="search.level" class="select" placeholder="全部">
  14. <el-option
  15. v-for="item in options1"
  16. :key="item.value"
  17. :label="item.label"
  18. :value="item.value"
  19. />
  20. </el-select>
  21. <el-select v-model="search.value" class="select" placeholder="全部">
  22. <el-option
  23. v-for="item in options"
  24. :key="item.value"
  25. :label="item.label"
  26. :value="item.value"
  27. />
  28. </el-select>
  29. <el-date-picker
  30. v-model="search.time"
  31. type="date"
  32. class="date11"
  33. placeholder="请选择预警时间"
  34. style="width:200px;margin-right: 14px;"
  35. :default-value="new Date(2010, 9, 1)"
  36. />
  37. <el-input-number v-model="search.range" class="input" placeholder="Please input" :controls="false" style="margin-top: 14px;"/>
  38. <div class="bt search" @click="searchSubmit">查询</div>
  39. <div class="bt" @click="resetSubmit">重置</div>
  40. </div>
  41. <div class="lf-container">
  42. <div class="card-container">
  43. <div class="card" v-for="(item,index) in 8" :key="index">
  44. <div class="title">压力传感器</div>
  45. <div class="info">
  46. <p>设备编号:A02166644624</p>
  47. <p>安装位置:Ⅲ号-770-32008</p>
  48. <p>压力值:12Pa</p>
  49. <p>是否在线:在线</p>
  50. </div>
  51. <footer :class="'status-'+(index+1)">威胁</footer>
  52. </div>
  53. </div>
  54. <div class="el-pagination-wrap">
  55. <el-pagination small layout="prev, pager, next" :total="50" />
  56. </div>
  57. </div>
  58. </div>
  59. <div class="rt">
  60. <div class="head">
  61. <div class="name">传感器数据统计</div>
  62. <div class="number">123</div>
  63. </div>
  64. <div class="head-info">
  65. <div class="item total">
  66. <div class="name">总数</div>
  67. <div class="number">123</div>
  68. </div>
  69. <div class="item normal">
  70. <div class="name">正常</div>
  71. <div class="number">120</div>
  72. </div>
  73. <div class="item error">
  74. <div class="name">异常</div>
  75. <div class="number">3</div>
  76. </div>
  77. </div>
  78. <div class="chart-wrap">
  79. <div class="title">报警统计</div>
  80. <alert-chart ref="alert-chart" />
  81. </div>
  82. <div class="chart-wrap">
  83. <div class="title">预警处理情况</div>
  84. <warn-chart ref="warn-chart" />
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import AlertChart from './components/AlertChart.vue'
  92. import WarnChart from './components/WarnChart.vue'
  93. export default {
  94. name:"sensor",
  95. components:{
  96. AlertChart,
  97. WarnChart
  98. },
  99. data(){
  100. return{
  101. activeId:'1',
  102. activetab:'1',
  103. items:[
  104. {name:"首页",id:"1",path:"/particulars/sensor"},
  105. {name:"压力传感器",id:"2",path:"/particulars/check"},
  106. {name:"位移传感器",id:"3",path:"/particulars/goaf-info"},
  107. {name:"有害气体传感器",id:"4",path:"/particulars/goaf-info"},
  108. {name:"视频监控",id:"5",path:"/particulars/goaf-info"},
  109. ],
  110. tabs:[
  111. {name:"Ⅲ号",id:"1"},
  112. {name:"770",id:"2"},
  113. {name:"32001",id:"3"},
  114. ],
  115. search:{
  116. name:"",
  117. level:"",
  118. time:"",
  119. status:"",
  120. range:0
  121. } ,
  122. options:[
  123. {label:1,value:2},
  124. {label:2,value:3},
  125. {label:3,value:4}
  126. ] ,
  127. options1:[
  128. {label:1,value:2},
  129. {label:2,value:3},
  130. {label:3,value:4}
  131. ]
  132. }
  133. },
  134. created(){
  135. this.init()
  136. },
  137. methods:{
  138. init(){
  139. this.$nextTick(()=>{
  140. this.$refs['alert-chart'].init();
  141. this.$refs['warn-chart'].init();
  142. })
  143. },
  144. changeHead(item){
  145. this.activeId=item.id
  146. },
  147. changeTab(item){
  148. this.activetab=item.id
  149. },
  150. searchSubmit(){
  151. },
  152. resetSubmit(){
  153. this.search={
  154. name:"",
  155. level:"",
  156. time:"",
  157. status:"",
  158. range:0
  159. }
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .check-page{
  166. header{
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. padding-top: 0.5vh;
  171. .item{
  172. width: 188px;
  173. height: 36px;
  174. line-height: 36px;
  175. text-align: center;
  176. background-image: url(@/assets/sensor/head.png);
  177. background-size: 100% 100%;
  178. background-repeat: no-repeat;
  179. margin-right: 12px;
  180. max-width: 20%;
  181. color: #7FCFF4;
  182. cursor: pointer;
  183. &.active{
  184. background-image: url(@/assets/sensor/head_active.png);
  185. color: #2AFFFF;
  186. }
  187. }
  188. }
  189. .tab{
  190. padding-top: 1.5vh;
  191. .item{
  192. display: inline-block;
  193. padding: 5px 10px;
  194. color: #fff;
  195. font-size: 16px;
  196. background: #003B7A;
  197. border: 1px solid #004EA2;
  198. letter-spacing: 0.6px;
  199. margin-right: 24px;
  200. border-radius: 4px 15px 8px 4px;
  201. cursor: pointer;
  202. &.active{
  203. background: #0083CF;
  204. border: 1px solid #0097DD;
  205. }
  206. }
  207. }
  208. .container{
  209. display: flex;
  210. .lf{
  211. width: 60%;
  212. padding-left: 100px;
  213. .search-container{
  214. padding:4.4vh 0 5vh 0;
  215. box-sizing: border-box;
  216. display: flex;
  217. flex-wrap: wrap;
  218. .input,.select,.el-date-editor{
  219. width: 220px;
  220. margin-right:16px;
  221. color: #fff;
  222. }
  223. ::v-deep{
  224. .el-input__wrapper{
  225. background-color: rgba(8, 128, 255, 0.2);
  226. border: 0;
  227. box-shadow: none;
  228. }
  229. .el-input__inner{
  230. color: #fff;
  231. }
  232. }
  233. .bt{
  234. width: 100px;
  235. height: 36px;
  236. line-height: 36px;
  237. text-align: center;
  238. color: #fff;
  239. font-size: 14px;
  240. background: rgba(8, 128, 255, 0.2);
  241. border-radius: 4px;
  242. margin-top: 14px;
  243. cursor: pointer;
  244. &.search{
  245. background: linear-gradient(rgba(94, 226, 255, 1),rgba(79, 175, 255, 1));
  246. margin:14px 10px 0 0;
  247. }
  248. }
  249. }
  250. .lf-container{
  251. .card-container{
  252. display: flex;
  253. justify-content: flex-start;
  254. flex-wrap: wrap;
  255. padding-left: 50px;
  256. .card{
  257. width: 22%;
  258. height: 25vh;
  259. background: rgba(35, 229, 254, 0.06);
  260. border: 1px solid #115C7C;
  261. margin:0 4% 10px 0;
  262. box-sizing: border-box;
  263. overflow: hidden;
  264. padding: 14px;
  265. color: #fff;
  266. position: relative;
  267. &:nth-child(4n){
  268. margin-right: 0;
  269. }
  270. .title{
  271. font-size: 18px;
  272. font-weight: bold;
  273. padding-bottom: 12px;
  274. text-align: center;
  275. }
  276. .info{
  277. font-size: 14px;
  278. p{
  279. line-height: 22px;
  280. }
  281. }
  282. footer{
  283. width: 100%;
  284. height: 36px;
  285. line-height: 36px;
  286. position: absolute;
  287. bottom: 0;
  288. left: 0;
  289. text-align: center;
  290. background: #0C6ECF;
  291. &.status-1{
  292. background: #DCBA3D;
  293. }
  294. &.status-2{
  295. background: #EC6B1D;
  296. }
  297. &.status-3{
  298. background: #F33737;
  299. }
  300. }
  301. }
  302. }
  303. .el-pagination-wrap{
  304. float: right;
  305. margin-top: 5vh;
  306. ::v-deep{
  307. .el-pager li,button{
  308. background-color: #00539F;
  309. margin-left: 10px;
  310. color: rgba(255, 255, 255, 0.75);
  311. &.is-active{
  312. background-color: rgba(0, 131, 207, 1);
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. .rt{
  320. flex: 1;
  321. padding-left: 5%;
  322. box-sizing: border-box;
  323. .head{
  324. height: 32px;
  325. background-image: url(@/views/home/images/home/title.png);
  326. background-size: 100% 100%;
  327. background-repeat: no-repeat;
  328. color: #2affff;
  329. font-size: 20px;
  330. display: flex;
  331. justify-content: space-between;
  332. align-items: center;
  333. text-indent: 24px;
  334. padding: 0 14px;
  335. font-family: "YouSheBiaoTiHei";
  336. letter-spacing: 1px;
  337. margin-top: 4.8vh;
  338. }
  339. .head-info{
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. padding-top: 20px;
  344. .item{
  345. width: 33.33%;
  346. display: flex;
  347. justify-content: center;
  348. align-items: center;
  349. flex-direction: column;
  350. color: #fff;
  351. font-size: 12px;
  352. &.total{
  353. display: block;
  354. font-weight: bold;
  355. text-align: left;
  356. .name{
  357. font-size: 14px;
  358. line-height: 20px;
  359. }
  360. .number{
  361. font-size: 20px;
  362. line-height: 38px;
  363. font-weight: 700;
  364. background: rgba(108, 128, 151, 0.1)
  365. }
  366. }
  367. &.normal{
  368. border-left:1px solid rgba(255, 255, 255, 0.12);
  369. border-right:1px solid rgba(255, 255, 255, 0.12);
  370. margin: 0 2%;
  371. height: 100%;
  372. .number{
  373. font-size: 20px;
  374. line-height: 28px;
  375. color: #3CD495;
  376. font-weight: 500;
  377. }
  378. }
  379. &.error{
  380. .number{
  381. font-size: 20px;
  382. line-height: 28px;
  383. color: #D4603C;
  384. font-weight: 500;
  385. }
  386. }
  387. }
  388. }
  389. .chart-wrap{
  390. padding-top: 0.8vh;
  391. .title{
  392. color: #fff;
  393. font-size: 18px;
  394. line-height: 20px;
  395. padding: 10px;
  396. position: relative;
  397. font-family: "YouSheBiaoTiHei";
  398. letter-spacing: 1px;
  399. margin-bottom: 2vh;
  400. &::after{
  401. display: block;
  402. content: "";
  403. width: 100%;
  404. height: 3px;
  405. position: absolute;
  406. bottom: 0;
  407. left: 0;
  408. background-image: url('./images/line.png');
  409. background-repeat: no-repeat;
  410. background-size: 100% 100%;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. </style>