runningState.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="shang">
  5. <view class="shangItem">
  6. <text>冷水阀</text>
  7. <text>{{formData.LSF}}%</text>
  8. </view>
  9. <view class="shangItem">
  10. <text style="margin-left: 6rpx;">电加热</text>
  11. <view class="buttonItem">
  12. <button class="but" :class="{'active-but': formData.YJDJR_QT == 0}">一</button>
  13. <button class="but" :class="{'active-but': formData.EJDJR_QT == 0}">二</button>
  14. <button class="but" :class="{'active-but': formData.SJDJR_QT == 0}">三</button>
  15. </view>
  16. </view>
  17. <view class="shangItem">
  18. <text>加湿器</text>
  19. <text>{{formData.JSF}}%</text>
  20. </view>
  21. </view>
  22. <view class="comp"></view>
  23. <view class="xia">
  24. <view class="xiaItem">
  25. <text>初效滤网</text>
  26. <view class="xiaBut">
  27. <button class="xiaButton">{{ formData.LWDS_CX === '0' ? '正常' : '报警' }}</button>
  28. </view>
  29. </view>
  30. <view class="xiaItem">
  31. <text>热水阀</text>
  32. <text>{{formData.RSF}}%</text>
  33. </view>
  34. <view class="xiaItem">
  35. <text>高温报警</text>
  36. <view class="xiaBut">
  37. <button class="xiaButton"> {{ formData.GW_BJ === '0' ? '正常' : '报警' }}</button>
  38. </view>
  39. </view>
  40. <view class="xiaItem">
  41. <text>缺风压差</text>
  42. <view class="xiaBut">
  43. <button class="xiaButton">{{ formData.QFYC_BJ === '0' ? '正常' : '报警' }}</button>
  44. </view>
  45. </view>
  46. <view class="xiaItem">
  47. <text>中效滤网</text>
  48. <view class="xiaBut">
  49. <button class="xiaButton">{{ formData.LWDS_ZX === '0' ? '正常' : '报警' }}</button>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="hold">
  55. <view class="tiao">
  56. <text class="tiaoText">CK-1</text>
  57. </view>
  58. <view class="param">
  59. <view class="paramItem">
  60. <text class="name">温度</text>
  61. <text class="value">{{formData.WD_1}}℃</text>
  62. </view>
  63. <view class="paramItem">
  64. <text class="name">湿度</text>
  65. <text class="value">{{formData.SD_1}}%</text>
  66. </view>
  67. <view class="paramItem">
  68. <text class="name">含湿量</text>
  69. <text class="value">{{formData.HSL}}g/kg</text>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="hold">
  74. <view class="tiao">
  75. <text class="tiaoText">CK-2</text>
  76. </view>
  77. <view class="param">
  78. <view class="paramItem">
  79. <text class="name">温度</text>
  80. <text class="value">{{formData.WD_2}}℃</text>
  81. </view>
  82. <view class="paramItem">
  83. <text class="name">湿度</text>
  84. <text class="value">{{formData.SD_2}}%</text>
  85. </view>
  86. <view class="paramItem">
  87. <text class="name">含湿量</text>
  88. <text class="value">无g/kg</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="stop">
  93. <view class="stopTiao">
  94. <text class="stopTiaoText">停机延时:{{formData.JZ_YSTZ}}s</text>
  95. </view>
  96. <view class="param">
  97. <view class="paramItem1">
  98. <text class="name1">排风温度设定</text>
  99. <text class="value">{{formData.WD_SD}}℃</text>
  100. </view>
  101. <view class="paramItem1">
  102. <text class="name1">排风湿度设定</text>
  103. <text class="value">{{formData.SD_SD}}%</text>
  104. </view>
  105. <view class="paramItem1">
  106. <text class="name1">排风含湿量设定</text>
  107. <text class="value">{{formData.HSL_SD}}g/kg</text>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="stopButton">
  112. <button class="button" @tap="stopAndStart" :class="{'KGJ_button': formData.JZ_KGJ == 0}">开关按钮</button>
  113. </view>
  114. <view class="anniu" @tap="back">
  115. <image class="anniu" src="../../static/设备菜单/前往列表@2x.png"></image>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. export default {
  121. data() {
  122. return {
  123. deviceParams: [],
  124. formData: {
  125. RSF: '',
  126. LSF: '',
  127. JSF: '',
  128. sn: 'CK1',
  129. WD_1: '',
  130. SD_1: '',
  131. WD_2: '',
  132. SD_2: '',
  133. WD_SD: '',
  134. SD_SD: '',
  135. HSL: '',
  136. HSL_SD: '',
  137. JZ_YSTZ: '',
  138. JZ_KGJ: '',
  139. Id: '',
  140. code: '',
  141. GW_BJ: '0', //高温报警(0:正常,1:报警)
  142. QFYC_BJ: '1', //缺风压差(0:正常,1:报警)
  143. LWDS_CX: '0', //初效故障报警(0:正常,1:故障)
  144. LWDS_ZX: '1', //中效故障报警(0:正常,1:故障)
  145. YJDJR_QT: '', //一级电加热启停(0:停止,1:启动)
  146. EJDJR_QT: '', //二级电加热启停(0:停止,1:启动)
  147. SJDJR_QT: '', //三级电加热启停(0:停止,1:启动)
  148. JZ_KGJ: '', //设备开关机(0:停止,1:启动)
  149. }
  150. }
  151. },
  152. onLoad(e) {
  153. this.getWD_1()
  154. this.getSD_1()
  155. this.getHSL()
  156. this.getWD_2()
  157. this.getSD_2()
  158. this.getYSTZ()
  159. this.getWD_SD()
  160. this.getSD_SD()
  161. this.getHSL_SD()
  162. this.getRSF()
  163. this.getLSF()
  164. this.getJSF()
  165. this.getGWBJ()
  166. this.getQFYC()
  167. this.getCXLW()
  168. this.getZXLW()
  169. this.getYJDJR()
  170. this.getEJDJR()
  171. this.getSJDJR()
  172. this.getJZ_KGJ()
  173. },
  174. methods: {
  175. back() {
  176. uni.navigateTo({
  177. url: '/pages/device/deviceInfo/deviceInfo'
  178. })
  179. },
  180. async list(e) {
  181. let vm = this;
  182. let url = uni.$api.deviceParam.list;
  183. let data = {
  184. sn: this.formData.sn,
  185. };
  186. let res = await uni.$http.get(url);
  187. this.deviceParams = res.data.data.deviceParams;
  188. console.log(res.data.data.deviceParams);
  189. },
  190. async getWD_1(e) {
  191. let vm = this;
  192. let url = uni.$api.deviceParam.detail;
  193. let data = {
  194. id: "206",
  195. };
  196. let res = await uni.$http.get(url, data);
  197. this.formData.WD_1 = res.data.data.deviceParam.value;
  198. console.log(this.formData.WD_1);
  199. },
  200. async getSD_1(e) {
  201. let vm = this;
  202. let url = uni.$api.deviceParam.detail;
  203. let data = {
  204. id: "284",
  205. };
  206. let res = await uni.$http.get(url, data);
  207. this.formData.SD_1 = res.data.data.deviceParam.value;
  208. console.log(this.formData.SD_1);
  209. },
  210. async getHSL(e) {
  211. let vm = this;
  212. let url = uni.$api.deviceParam.detail;
  213. let data = {
  214. id: "262",
  215. };
  216. let res = await uni.$http.get(url, data);
  217. this.formData.HSL = res.data.data.deviceParam.value;
  218. console.log(this.formData.HSL);
  219. },
  220. async getWD_2(e) {
  221. let vm = this;
  222. let url = uni.$api.deviceParam.detail;
  223. let data = {
  224. id: "298",
  225. };
  226. let res = await uni.$http.get(url, data);
  227. this.formData.WD_2 = res.data.data.deviceParam.value;
  228. console.log(this.formData.WD_2);
  229. },
  230. async getSD_2(e) {
  231. let vm = this;
  232. let url = uni.$api.deviceParam.detail;
  233. let data = {
  234. id: "299",
  235. };
  236. let res = await uni.$http.get(url, data);
  237. this.formData.SD_2 = res.data.data.deviceParam.value;
  238. console.log(this.formData.SD_2);
  239. },
  240. async getYSTZ(e) {
  241. let vm = this;
  242. let url = uni.$api.deviceParam.detail;
  243. let data = {
  244. id: "217",
  245. };
  246. let res = await uni.$http.get(url, data);
  247. this.formData.JZ_YSTZ = res.data.data.deviceParam.value;
  248. console.log(this.formData.JZ_YSTZ);
  249. },
  250. async getWD_SD(e) {
  251. let vm = this;
  252. let url = uni.$api.deviceParam.detail;
  253. let data = {
  254. id: "287",
  255. };
  256. let res = await uni.$http.get(url, data);
  257. this.formData.WD_SD = res.data.data.deviceParam.value;
  258. console.log(this.formData.WD_SD);
  259. },
  260. async getSD_SD(e) {
  261. let vm = this;
  262. let url = uni.$api.deviceParam.detail;
  263. let data = {
  264. id: "229",
  265. };
  266. let res = await uni.$http.get(url, data);
  267. this.formData.SD_SD = res.data.data.deviceParam.value;
  268. console.log(this.formData.SD_SD);
  269. },
  270. async getHSL_SD(e) {
  271. let vm = this;
  272. let url = uni.$api.deviceParam.detail;
  273. let data = {
  274. id: "225",
  275. };
  276. let res = await uni.$http.get(url, data);
  277. this.formData.HSL_SD = res.data.data.deviceParam.value;
  278. console.log(this.formData.HSL_SD);
  279. },
  280. async getRSF(e) {
  281. let vm = this;
  282. let url = uni.$api.deviceParam.detail;
  283. let data = {
  284. id: "215",
  285. };
  286. let res = await uni.$http.get(url, data);
  287. this.formData.RSF = res.data.data.deviceParam.value;
  288. console.log(this.formData.RSF);
  289. },
  290. async getLSF(e) {
  291. let vm = this;
  292. let url = uni.$api.deviceParam.detail;
  293. let data = {
  294. id: "261",
  295. };
  296. let res = await uni.$http.get(url, data);
  297. this.formData.LSF = res.data.data.deviceParam.value;
  298. console.log(this.formData.LSF);
  299. },
  300. async getJSF(e) {
  301. let vm = this;
  302. let url = uni.$api.deviceParam.detail;
  303. let data = {
  304. id: "211",
  305. };
  306. let res = await uni.$http.get(url, data);
  307. this.formData.JSF = res.data.data.deviceParam.value;
  308. console.log(this.formData.JSF);
  309. },
  310. async getGWBJ(e) {
  311. let vm = this;
  312. let url = uni.$api.deviceParam.detail;
  313. let data = {
  314. id: "285",
  315. };
  316. let res = await uni.$http.get(url, data);
  317. this.formData.GW_BJ = res.data.data.deviceParam.value;
  318. },
  319. async getQFYC(e) {
  320. let vm = this;
  321. let url = uni.$api.deviceParam.detail;
  322. let data = {
  323. id: "296",
  324. };
  325. let res = await uni.$http.get(url, data);
  326. this.formData.QFYC_BJ = res.data.data.deviceParam.value;
  327. },
  328. async getCXLW(e) {
  329. let vm = this;
  330. let url = uni.$api.deviceParam.detail;
  331. let data = {
  332. id: "274",
  333. };
  334. let res = await uni.$http.get(url, data);
  335. this.formData.LWDS_CX = res.data.data.deviceParam.value;
  336. },
  337. async getZXLW(e) {
  338. let vm = this;
  339. let url = uni.$api.deviceParam.detail;
  340. let data = {
  341. id: "293",
  342. };
  343. let res = await uni.$http.get(url, data);
  344. this.formData.LWDS_ZX = res.data.data.deviceParam.value;
  345. },
  346. async getYJDJR(e) {
  347. let vm = this;
  348. let url = uni.$api.deviceParam.detail;
  349. let data = {
  350. id: "214",
  351. };
  352. let res = await uni.$http.get(url, data);
  353. this.formData.YJDJR_QT = res.data.data.deviceParam.value;
  354. },
  355. async getEJDJR(e) {
  356. let vm = this;
  357. let url = uni.$api.deviceParam.detail;
  358. let data = {
  359. id: "210",
  360. };
  361. let res = await uni.$http.get(url, data);
  362. this.formData.EJDJR_QT = res.data.data.deviceParam.value;
  363. },
  364. async getSJDJR(e) {
  365. let vm = this;
  366. let url = uni.$api.deviceParam.detail;
  367. let data = {
  368. id: "212",
  369. };
  370. let res = await uni.$http.get(url, data);
  371. this.formData.SJDJR_QT = res.data.data.deviceParam.value;
  372. },
  373. async getJZ_KGJ(e) {
  374. let vm = this;
  375. let url = uni.$api.deviceParam.detail;
  376. let data = {
  377. id: "260",
  378. };
  379. let res = await uni.$http.get(url, data);
  380. this.formData.JZ_KGJ = res.data.data.deviceParam.value;
  381. },
  382. async stopAndStart(e) {
  383. this.formData.JZ_KGJ == 1 ? this.formData.JZ_KGJ = 0 : this.formData.JZ_KGJ = 1;
  384. let vm = this;
  385. let url = uni.$api.deviceParam.updateParam;
  386. let data = {
  387. id: "260",
  388. value: this.formData.JZ_KGJ,
  389. name: "JZ_KGJ",
  390. sn: "CK1"
  391. };
  392. let res = await uni.$http.get(url, data);
  393. console.log(res.data.data.value);
  394. }
  395. }
  396. }
  397. </script>
  398. <style>
  399. .anniu {
  400. width: 116rpx;
  401. height: 116rpx;
  402. float: right;
  403. margin-right: 10rpx;
  404. }
  405. .button {
  406. background-color: #E12A1F;
  407. color: white;
  408. width: 654rpx;
  409. margin-left: 48rpx;
  410. margin-top: 44rpx;
  411. }
  412. .name1 {
  413. color: #848586;
  414. font-size: 24rpx;
  415. }
  416. .name {
  417. color: #848586;
  418. font-size: 30rpx;
  419. }
  420. .value {
  421. font-size: 38rpx;
  422. color: #444546;
  423. }
  424. .paramItem {
  425. display: flex;
  426. flex-direction: column;
  427. margin-left: 58rpx;
  428. margin-right: 46rpx;
  429. }
  430. .paramItem1 {
  431. display: flex;
  432. flex-direction: column;
  433. margin-left: 40rpx;
  434. margin-right: 40rpx;
  435. }
  436. .param {
  437. display: flex;
  438. flex-direction: row;
  439. margin-left: 24rpx;
  440. align-items: center;
  441. justify-content: center;
  442. width: 702rpx;
  443. height: 140rpx;
  444. background-color: white;
  445. border-bottom-right-radius: 8rpx;
  446. border-bottom-left-radius: 8rpx;
  447. }
  448. .tiaoText {
  449. margin-left: 44rpx;
  450. font-size: 34rpx;
  451. font-weight: 550;
  452. }
  453. .stopTiaoText {
  454. margin-left: 44rpx;
  455. font-size: 36rpx;
  456. font-weight: 550;
  457. }
  458. .tiao {
  459. margin-top: 26rpx;
  460. border-top-left-radius: 8rpx;
  461. border-top-right-radius: 8rpx;
  462. margin-left: 24rpx;
  463. width: 702rpx;
  464. height: 60px;
  465. background: #EAF1FE;
  466. font-size: 30rpx;
  467. color: #007AFF;
  468. display: flex;
  469. align-items: center;
  470. }
  471. .stopTiao {
  472. margin-top: 26rpx;
  473. border-top-left-radius: 8rpx;
  474. border-top-right-radius: 8rpx;
  475. margin-left: 24rpx;
  476. width: 702rpx;
  477. height: 60px;
  478. background: #007AFF;
  479. font-size: 38rpx;
  480. color: white;
  481. display: flex;
  482. align-items: center;
  483. }
  484. .xia {
  485. display: flex;
  486. flex-direction: row;
  487. }
  488. .xiaItem {
  489. color: white;
  490. display: flex;
  491. flex-direction: column;
  492. margin-left: 20rpx;
  493. margin-right: 20rpx;
  494. align-items: center;
  495. justify-content: center;
  496. margin-bottom: 16rpx;
  497. }
  498. .shang {
  499. display: flex;
  500. flex-direction: row;
  501. }
  502. .shangItem {
  503. color: white;
  504. display: flex;
  505. flex-direction: column;
  506. margin-left: 30rpx;
  507. margin-right: 30rpx;
  508. align-items: center;
  509. justify-content: center;
  510. margin-bottom: 16rpx;
  511. }
  512. .buttonItem {
  513. display: flex;
  514. flex-direction: row;
  515. font-size: 20rpx;
  516. color: #444546;
  517. }
  518. .but {
  519. width: 50rpx;
  520. height: 50rpx;
  521. display: flex;
  522. align-items: center;
  523. justify-content: center;
  524. margin-left: 10rpx;
  525. margin-top: 5rpx;
  526. font-size: 24rpx;
  527. }
  528. .active-but {
  529. background-color: #00ff99;
  530. }
  531. .xiaBut {
  532. display: flex;
  533. flex-direction: row;
  534. font-size: 20rpx;
  535. color: #444546;
  536. }
  537. .KGJ_button{
  538. background-color: #00ff99;
  539. }
  540. .xiaButton {
  541. width: 100rpx;
  542. height: 50rpx;
  543. display: flex;
  544. align-items: center;
  545. justify-content: center;
  546. margin-left: 10rpx;
  547. margin-top: 5rpx;
  548. font-size: 24rpx;
  549. }
  550. .head {
  551. font-size: 26rpx;
  552. height: 300px;
  553. background: linear-gradient(180deg, #2A8FFB 0%, #0467FB 100%);
  554. display: flex;
  555. flex-direction: column;
  556. align-items: center;
  557. justify-content: center;
  558. }
  559. .comp {
  560. background-color: #D6D6D6;
  561. width: 702rpx;
  562. height: 200rpx;
  563. border-radius: 8rpx;
  564. margin-bottom: 20rpx;
  565. }
  566. </style>