equipmentConditionMonitoring.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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: '1'
  134. }
  135. },
  136. onReady() {
  137. this.getDeviceStatusMonitoring();
  138. // this.getDeviceTypeList();
  139. },
  140. methods: {
  141. //设备查询
  142. deviceChange(e) {
  143. // console.log(e);
  144. this.deviceType = e[0].value;
  145. this.device = e[0].label;
  146. this.getDeviceStatusMonitoring();
  147. },
  148. //状态查询
  149. statusChange(e) {
  150. // console.log(e);
  151. this.status = e[0].value;
  152. this.statusName = e[0].label;
  153. this.getDeviceStatusMonitoring();
  154. },
  155. getDeviceStatusMonitoring() {
  156. uni.showLoading({
  157. title: "加载中",
  158. mask: true,
  159. })
  160. API.deviceStatusMonitoring({
  161. pageIndex: 1,
  162. pageSize: 100,
  163. deviceType: this.deviceType,
  164. status: this.status
  165. }).then((response) => {
  166. uni.hideLoading();
  167. this.deviceList = response.data.data;
  168. }).catch(error => {
  169. uni.showToast({
  170. title: error,
  171. icon: "none"
  172. })
  173. })
  174. },
  175. //查询设备类型list
  176. getDeviceTypeList() {
  177. uni.showLoading({
  178. title: "加载中",
  179. mask: true,
  180. })
  181. API_electricityMeter.findByName({
  182. name: '设备类型'
  183. }).then((res) => {
  184. uni.hideLoading();
  185. var list = [];
  186. list = res.data.map(item => {
  187. return {
  188. label: item.name,
  189. value: item.value
  190. }
  191. })
  192. list.unshift({
  193. label: '全部设备',
  194. value: ''
  195. })
  196. this.deviceTypeList = list;
  197. }).catch(error => {
  198. uni.showToast({
  199. title: error,
  200. icon: "none"
  201. })
  202. })
  203. },
  204. toElectronicMonitoring(item) {
  205. uni.navigateTo({
  206. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name +
  207. '&companyId=' + item.companyId
  208. })
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. .dropdown {
  215. background-color: #fff;
  216. position: sticky;
  217. top: 88rpx;
  218. z-index: 999;
  219. padding: 18rpx 46rpx;
  220. display: flex;
  221. border-bottom: 1px solid rgba(245, 245, 245, 1);
  222. .dropdown-item {
  223. width: 50%;
  224. text-align: center;
  225. height: 60rpx;
  226. line-height: 60rpx;
  227. display: flex;
  228. align-items: center;
  229. justify-content: center;
  230. .text {
  231. max-width: 80%;
  232. white-space: nowrap;
  233. overflow: hidden;
  234. text-overflow: ellipsis;
  235. }
  236. }
  237. }
  238. .main {
  239. background-color: #fff;
  240. padding: 0 32rpx;
  241. .item:last-of-type {
  242. border: none;
  243. }
  244. .item {
  245. padding: 32rpx 0;
  246. display: flex;
  247. border-bottom: 1px solid rgba(245, 245, 245, 1);
  248. .item-icon {
  249. width: 72rpx;
  250. height: 72rpx;
  251. border-radius: 4px;
  252. background-color: rgba(219, 234, 255, 1);
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. .img {
  257. width: 48rpx;
  258. height: 48rpx;
  259. }
  260. }
  261. .item-content {
  262. flex: 1;
  263. margin-left: 16rpx;
  264. .content1 {
  265. display: flex;
  266. align-items: center;
  267. .name1 {
  268. color: rgba(51, 51, 51, 1);
  269. font-weight: bold;
  270. max-width: 50%;
  271. white-space: nowrap;
  272. overflow: hidden;
  273. text-overflow: ellipsis;
  274. }
  275. .name2 {
  276. color: rgba(119, 119, 119, 1);
  277. font-size: 24rpx;
  278. margin-left: 16rpx;
  279. }
  280. }
  281. .content2 {
  282. margin-top: 4rpx;
  283. display: flex;
  284. align-items: center;
  285. justify-content: space-between;
  286. .text {
  287. color: rgba(119, 119, 119, 1);
  288. font-size: 24rpx;
  289. }
  290. }
  291. .content3 {
  292. margin-top: 8rpx;
  293. display: flex;
  294. align-items: center;
  295. justify-content: space-between;
  296. padding-right: 16rpx;
  297. .state-item {
  298. display: flex;
  299. color: rgba(51, 51, 51, 1);
  300. font-size: 24rpx;
  301. .state-value {
  302. color: #00B962;
  303. }
  304. .state-value2 {
  305. color: #FF6923;
  306. }
  307. }
  308. }
  309. }
  310. }
  311. .item-state {
  312. margin-left: auto;
  313. display: flex;
  314. align-items: center;
  315. .dot {
  316. width: 16rpx;
  317. height: 16rpx;
  318. border-radius: 999px;
  319. }
  320. .text {
  321. margin: 0 8rpx;
  322. color: rgba(51, 51, 51, 1);
  323. font-size: 24rpx;
  324. }
  325. .off-line {
  326. background-color: rgba(255, 123, 0, 1);
  327. }
  328. .on-line {
  329. background-color: rgba(0, 185, 98, 1);
  330. }
  331. }
  332. }
  333. </style>