index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="dashboard-container">
  3. <div class="search-content">
  4. <!-- <el-input style="width: 220px;" placeholder="请输入监测系统名称" v-model="searchData.monitorSystemName" clearable></el-input> -->
  5. <el-select
  6. v-model="searchData.monitorSystemName"
  7. placeholder="请选择监测系统名称"
  8. style="width: 220px; margin-right: 20px"
  9. filterable
  10. clearable
  11. >
  12. <el-option
  13. v-for="item in monitorNameData"
  14. :key="item.monitorSystemName"
  15. :label="item.monitorSystemName"
  16. :value="item.monitorSystemName"
  17. />
  18. </el-select>
  19. <el-select style="width: 220px;" clearable placeholder="请选择状态" v-model="searchData.status">
  20. <el-option label="在线" value="1"></el-option>
  21. <el-option label="离线" value="2"></el-option>
  22. </el-select>
  23. <div class="search-btn">
  24. <div class="search" @click="searchBtn()">查询</div>
  25. <div class="reset" @click="reset()">重置</div>
  26. </div>
  27. </div>
  28. <div class="table-content">
  29. <div style="width: 100%;height: 30px;">
  30. <div class="btn" style="margin-right: -3px;" @click="reset()">刷新</div>
  31. </div>
  32. <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
  33. <el-table-column type="index" label="序号" width="80">
  34. </el-table-column>
  35. <el-table-column prop="monitorSystemName" show-overflow-tooltip="true" label="监测系统名称">
  36. </el-table-column>
  37. <el-table-column prop="statusName" label="状态">
  38. <template slot-scope="scope">
  39. <span style="color: red;" v-if="scope.row.statusName == '未联通'">离线</span>
  40. <span v-else>在线</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="报警数量">
  44. <template slot-scope="scope">
  45. <span style="color:blue;cursor: pointer;" @click="toAlarmList(scope.row,'')">{{ scope.row.countAll||0 }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="未解除报警总数">
  49. <template slot-scope="scope">
  50. <span style="color:blue;cursor: pointer;" @click="toAlarmList(scope.row,'2')">{{ scope.row.failureToReport||0 }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="turnOnTime" label="最近接入时间" width="300px">
  54. </el-table-column>
  55. </el-table>
  56. <div class="pagination">
  57. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="[10, 15, 20]"
  58. :page-size="searchData.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
  59. </el-pagination>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import {getMonitoringSystemMonitoringList} from '@/api/systemMonitoring'
  66. import { monitorNameList } from "@/api/monitor";
  67. export default {
  68. name:'monitoringSystemMonitoring',
  69. data () {
  70. return {
  71. tableData: [],
  72. total: 0,
  73. searchData:{
  74. pageNum: 1,
  75. pageSize: 10,
  76. monitorSystemName:'',
  77. status:''
  78. },
  79. monitorNameData: [],
  80. }
  81. },
  82. created() {
  83. this.getList(this.searchData)
  84. this.getMonitoreName();
  85. },
  86. methods:{
  87. getMonitoreName() {
  88. let params = {};
  89. monitorNameList(params).then((response) => {
  90. this.monitorNameData = response.data;
  91. });
  92. },
  93. getList(params) {
  94. getMonitoringSystemMonitoringList(params).then(res => {
  95. if (res.code == 200) {
  96. this.tableData = res.data.records
  97. this.total = res.data.total
  98. }
  99. })
  100. },
  101. searchBtn() {
  102. this.searchData.pageNum = 1
  103. this.getList(this.searchData)
  104. },
  105. reset() {
  106. this.searchData = {
  107. pageNum: 1,
  108. pageSize: 10,
  109. monitorSystemName:'',
  110. status:''
  111. }
  112. this.getList(this.searchData)
  113. },
  114. handleSizeChange(val) {
  115. this.searchData.pageSize = val
  116. this.getList(this.searchData)
  117. },
  118. handleCurrentChange(val) {
  119. this.searchData.pageNum = val
  120. this.getList(this.searchData)
  121. },
  122. toAlarmList(row,val) {
  123. this.$router.push({
  124. name:'List',
  125. params:{
  126. pageNum:1,
  127. pageSize:10,
  128. source:row.clientId,
  129. isLock:val
  130. }
  131. })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .dashboard {
  138. &-container {
  139. margin: 30px;
  140. }
  141. &-text {
  142. font-size: 30px;
  143. line-height: 46px;
  144. }
  145. }
  146. .dashboard-container {
  147. .search-content {
  148. width: 100%;
  149. height: 74px;
  150. background-color: #fff;
  151. display: flex;
  152. align-items: center;
  153. padding-left: 10px;
  154. .el-input {
  155. margin: 0 10px;
  156. }
  157. .el-select {
  158. margin: 0 10px;
  159. }
  160. .search-btn {
  161. display: flex;
  162. align-items: center;
  163. height: 100%;
  164. margin-left: 10px;
  165. div {
  166. // margin: 0 6px;
  167. display: inline-block;
  168. width: 80px;
  169. height: 40px;
  170. border-radius: 2px;
  171. font-size: 14px;
  172. line-height: 40px;
  173. text-align: center;
  174. }
  175. div:hover {
  176. cursor: pointer;
  177. }
  178. .search {
  179. margin-right: 10px;
  180. background-color: #2766DD;
  181. color: #F7F8FB;
  182. }
  183. .search:hover {
  184. background-color: #4D85F4;
  185. }
  186. .reset {
  187. color: #333334;
  188. border: 1px solid #D7D7D7;
  189. }
  190. .reset:hover {
  191. color: #1F9FFF;
  192. border: 1px solid #1F9FFF;
  193. }
  194. }
  195. }
  196. .table-content {
  197. margin-top: 15px;
  198. width: 100%;
  199. background-color: #fff;
  200. padding: 0 20px 20px;
  201. .btn {
  202. margin: 15px 20px 15px 0;
  203. cursor: pointer;
  204. float: left;
  205. text-align: center;
  206. width: 98px;
  207. height: 34px;
  208. border-radius: 2px;
  209. border: 1px solid #ABC7FD;
  210. line-height: 34px;
  211. font-weight: 400;
  212. font-size: 14px;
  213. color: #2250C8;
  214. background-color: #E7EEFF;
  215. }
  216. .btn:hover {
  217. color: #FFFFFF;
  218. background-color: #2250C8;
  219. border: 1px solid #2250C8;
  220. }
  221. .btn:active {
  222. color: #FFFFFF;
  223. background-color: #194DA4;
  224. border: 1px solid #194DA4;
  225. }
  226. .startUsing {
  227. width: 54px;
  228. height: 24px;
  229. margin: 14.5px auto 0;
  230. line-height: 24px;
  231. text-align: center;
  232. font-size: 12px;
  233. color: #00974D;
  234. border-radius: 4px;
  235. background-color: #E7FAF0;
  236. border: 1px solid #BEFDDD;
  237. }
  238. .Deactivate {
  239. width: 54px;
  240. height: 24px;
  241. margin: 14.5px auto 0;
  242. line-height: 24px;
  243. text-align: center;
  244. font-size: 12px;
  245. color: #FF9933;
  246. border-radius: 4px;
  247. background-color: #FFF3E8;
  248. border: 1px solid #FDE6CF;
  249. }
  250. .operateBtn {
  251. display: flex;
  252. justify-content: center;
  253. color: #2866DD;
  254. div {
  255. font-size: 14px;
  256. margin: 0 5px;
  257. cursor: pointer;
  258. }
  259. }
  260. .pagination {
  261. margin: 10px 0;
  262. width: 100%;
  263. height: 20px;
  264. .el-pagination {
  265. float: right;
  266. margin: 10px 0;
  267. }
  268. }
  269. }
  270. }
  271. </style>