equipmentConditionMonitoring.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view>
  3. <u-navbar title="设备状态监测" title-color="#101010"></u-navbar>
  4. <view class="dropdown">
  5. <view class="dropdown-item">
  6. <view class="text">
  7. {{device}}
  8. </view>
  9. <!-- <view class="item-icon">
  10. <u-icon name="arrow-down" color="#999999" v-if="show1==false"></u-icon>
  11. <u-icon name="arrow-up" color="#999999" v-else></u-icon>
  12. </view> -->
  13. </view>
  14. <view class="dropdown-item" @click="show2=true">
  15. <view class="text">
  16. {{statusName}}
  17. </view>
  18. <view class="icon">
  19. <u-icon name="arrow-down" color="#999999" v-if="show2==false"></u-icon>
  20. <u-icon name="arrow-up" color="#999999" v-else></u-icon>
  21. </view>
  22. </view>
  23. </view>
  24. <u-select v-model="show1" mode="single-column" :list="deviceTypeList" @confirm="deviceChange"></u-select>
  25. <u-select v-model="show2" mode="single-column" :list="statusList" @confirm="statusChange"></u-select>
  26. <view class="main">
  27. <view class="item" v-for="(item,index) in deviceList" :key="index" @click="toElectronicMonitoring(item)">
  28. <view class="item-icon" v-if="item.classify == '1'">
  29. <image class="img" src="@/assets/img/energy1.svg" mode=""></image>
  30. </view>
  31. <view class="item-icon" v-if="item.classify == '2'">
  32. <image class="img" src="@/assets/img/transformer2.svg" mode=""></image>
  33. </view>
  34. <view class="item-content">
  35. <view class="content1">
  36. <view class="name1">
  37. {{item.name}}
  38. </view>
  39. <view class="name2">
  40. {{item.installationAddressSimple}}
  41. </view>
  42. </view>
  43. <view class="content2">
  44. <view class="text">
  45. {{item.deviceTypeN}}
  46. </view>
  47. <view class="item-state">
  48. <view class="dot" :class="item.online ? 'on-line' : 'off-line'">
  49. </view>
  50. <view class="text">
  51. {{item.online ? '在线' : '离线'}}
  52. </view>
  53. <view class="more">
  54. <u-icon name="arrow-right" size="24" color="#acacac"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="content3" v-if="item.classify == '2'">
  59. <view class="state-item">
  60. <view class="state-title">
  61. 运行状态:
  62. </view>
  63. <view class="state-value" v-if="item.deviceStatus == '1'">
  64. 正常
  65. </view>
  66. <view class="state-value2" v-else>
  67. 异常
  68. </view>
  69. </view>
  70. <view class="state-item">
  71. <view class="state-title">
  72. 温度状态:
  73. </view>
  74. <view class="state-value" v-if="item.temperatureStatus == '1'">
  75. 正常
  76. </view>
  77. <view class="state-value2" v-else>
  78. 异常
  79. </view>
  80. </view>
  81. <view class="state-item">
  82. <view class="state-title">
  83. 烟感状态:
  84. </view>
  85. <view class="state-value" v-if="item.smokeStatus == '1'">
  86. 正常
  87. </view>
  88. <view class="state-value2" v-else>
  89. 异常
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <u-divider :isnone="deviceList.length==0" nonetext="暂无数据" border-color="#CFD2D5"></u-divider>
  97. </view>
  98. </template>
  99. <script>
  100. import * as API from '@/apis/pagejs/index.js'
  101. import * as API_electricityMeter from '@/apis/pagejs/electricityMeter.js'
  102. export default {
  103. data() {
  104. return {
  105. deviceList: [],
  106. show1: false,
  107. show2: false,
  108. device: '变压器智能监控及巡检仪',
  109. statusName: '全部状态',
  110. deviceTypeList: [],
  111. statusList: [{
  112. value: '',
  113. label: '全部状态'
  114. },
  115. {
  116. value: '1',
  117. label: '离线'
  118. },
  119. {
  120. value: '2',
  121. label: '温度异常'
  122. },
  123. {
  124. value: '3',
  125. label: '烟感异常'
  126. },
  127. {
  128. value: '4',
  129. label: '设备异常'
  130. }
  131. ],
  132. status: '',
  133. deviceType: ''
  134. }
  135. },
  136. onReady() {
  137. this.getDeviceTypeList();
  138. },
  139. methods: {
  140. //设备查询
  141. deviceChange(e) {
  142. // console.log(e);
  143. this.deviceType = e[0].value;
  144. this.device = e[0].label;
  145. this.getDeviceStatusMonitoring();
  146. },
  147. //状态查询
  148. statusChange(e) {
  149. // console.log(e);
  150. this.status = e[0].value;
  151. this.statusName = e[0].label;
  152. this.getDeviceStatusMonitoring();
  153. },
  154. getDeviceStatusMonitoring() {
  155. uni.showLoading({
  156. title: "加载中",
  157. mask: true,
  158. })
  159. API.deviceStatusMonitoring({
  160. pageIndex: 1,
  161. pageSize: 100,
  162. deviceType: this.deviceType,
  163. status: this.status
  164. }).then((response) => {
  165. uni.hideLoading();
  166. this.deviceList = response.data.data;
  167. }).catch(error => {
  168. uni.showToast({
  169. title: error,
  170. icon: "none"
  171. })
  172. })
  173. },
  174. //查询设备类型list
  175. getDeviceTypeList() {
  176. uni.showLoading({
  177. title: "加载中",
  178. mask: true,
  179. })
  180. API_electricityMeter.findByName({
  181. name: '设备类型'
  182. }).then((res) => {
  183. uni.hideLoading();
  184. var list = [];
  185. list = res.data.map(item => {
  186. return {
  187. label: item.name,
  188. value: item.value
  189. }
  190. })
  191. // list.unshift({
  192. // label: '全部设备',
  193. // value: ''
  194. // })
  195. this.deviceTypeList = list;
  196. for (var i = 0; i < list.length; i++) {
  197. if(list[i].label == this.device) {
  198. this.deviceType = list[i].value;
  199. }
  200. }
  201. this.getDeviceStatusMonitoring();
  202. }).catch(error => {
  203. uni.showToast({
  204. title: error,
  205. icon: "none"
  206. })
  207. })
  208. },
  209. toElectronicMonitoring(item) {
  210. uni.navigateTo({
  211. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name +
  212. '&companyId=' + item.companyId
  213. })
  214. }
  215. }
  216. }
  217. </script>
  218. <style lang="scss" scoped>
  219. .dropdown {
  220. background-color: #fff;
  221. position: sticky;
  222. top: 88rpx;
  223. z-index: 999;
  224. padding: 18rpx 46rpx;
  225. display: flex;
  226. border-bottom: 1px solid rgba(245, 245, 245, 1);
  227. .dropdown-item {
  228. width: 50%;
  229. text-align: center;
  230. height: 60rpx;
  231. line-height: 60rpx;
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. .text {
  236. max-width: 80%;
  237. white-space: nowrap;
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. }
  241. }
  242. }
  243. .main {
  244. background-color: #fff;
  245. padding: 0 32rpx;
  246. .item:last-of-type {
  247. border: none;
  248. }
  249. .item {
  250. padding: 32rpx 0;
  251. display: flex;
  252. border-bottom: 1px solid rgba(245, 245, 245, 1);
  253. .item-icon {
  254. width: 72rpx;
  255. height: 72rpx;
  256. border-radius: 4px;
  257. background-color: rgba(219, 234, 255, 1);
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. .img {
  262. width: 48rpx;
  263. height: 48rpx;
  264. }
  265. }
  266. .item-content {
  267. flex: 1;
  268. margin-left: 16rpx;
  269. .content1 {
  270. display: flex;
  271. align-items: center;
  272. .name1 {
  273. color: rgba(51, 51, 51, 1);
  274. font-weight: bold;
  275. max-width: 50%;
  276. white-space: nowrap;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. }
  280. .name2 {
  281. color: rgba(119, 119, 119, 1);
  282. font-size: 24rpx;
  283. margin-left: 16rpx;
  284. }
  285. }
  286. .content2 {
  287. margin-top: 4rpx;
  288. display: flex;
  289. align-items: center;
  290. justify-content: space-between;
  291. .text {
  292. color: rgba(119, 119, 119, 1);
  293. font-size: 24rpx;
  294. }
  295. }
  296. .content3 {
  297. margin-top: 8rpx;
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. padding-right: 16rpx;
  302. .state-item {
  303. display: flex;
  304. color: rgba(51, 51, 51, 1);
  305. font-size: 24rpx;
  306. .state-value {
  307. color: #00B962;
  308. }
  309. .state-value2 {
  310. color: #FF6923;
  311. }
  312. }
  313. }
  314. }
  315. }
  316. .item-state {
  317. margin-left: auto;
  318. display: flex;
  319. align-items: center;
  320. .dot {
  321. width: 16rpx;
  322. height: 16rpx;
  323. border-radius: 999px;
  324. }
  325. .text {
  326. margin: 0 8rpx;
  327. color: rgba(51, 51, 51, 1);
  328. font-size: 24rpx;
  329. }
  330. .off-line {
  331. background-color: rgba(255, 123, 0, 1);
  332. }
  333. .on-line {
  334. background-color: rgba(0, 185, 98, 1);
  335. }
  336. }
  337. }
  338. </style>