runningState.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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. Id: '',
  139. code: '',
  140. GW_BJ: '0', //高温报警(0:正常,1:报警)
  141. QFYC_BJ: '1', //缺风压差(0:正常,1:报警)
  142. LWDS_CX: '0', //初效故障报警(0:正常,1:故障)
  143. LWDS_ZX: '1', //中效故障报警(0:正常,1:故障)
  144. YJDJR_QT: '', //一级电加热启停(0:停止,1:启动)
  145. EJDJR_QT: '', //二级电加热启停(0:停止,1:启动)
  146. SJDJR_QT: '', //三级电加热启停(0:停止,1:启动)
  147. JZ_KGJ: '', //设备开关机(0:停止,1:启动)
  148. }
  149. }
  150. },
  151. onLoad(e) {
  152. this.getWD_1()
  153. this.getSD_1()
  154. this.getHSL()
  155. this.getWD_2()
  156. this.getSD_2()
  157. this.getYSTZ()
  158. this.getWD_SD()
  159. this.getSD_SD()
  160. this.getHSL_SD()
  161. this.getRSF()
  162. this.getLSF()
  163. this.getJSF()
  164. this.getGWBJ()
  165. this.getQFYC()
  166. this.getCXLW()
  167. this.getZXLW()
  168. this.getYJDJR()
  169. this.getEJDJR()
  170. this.getSJDJR()
  171. this.getJZ_KGJ()
  172. },
  173. methods: {
  174. back() {
  175. uni.navigateTo({
  176. url: '/pages/device/deviceInfo/deviceInfo'
  177. })
  178. },
  179. async list(e) {
  180. let vm = this;
  181. let url = uni.$api.deviceParam.list;
  182. let data = {
  183. sn: this.formData.sn,
  184. };
  185. let res = await uni.$http.get(url);
  186. this.deviceParams = res.data.data.deviceParams;
  187. console.log(res.data.data.deviceParams);
  188. },
  189. async getWD_1(e) {
  190. let vm = this;
  191. let url = uni.$api.deviceParam.detail;
  192. let data = {
  193. id: "207",
  194. };
  195. let res = await uni.$http.get(url, data);
  196. this.formData.WD_1 = res.data.data.deviceParam.value;
  197. console.log(this.formData.WD_1);
  198. },
  199. async getSD_1(e) {
  200. let vm = this;
  201. let url = uni.$api.deviceParam.detail;
  202. let data = {
  203. id: "293",
  204. };
  205. let res = await uni.$http.get(url, data);
  206. this.formData.SD_1 = res.data.data.deviceParam.value;
  207. console.log(this.formData.SD_1);
  208. },
  209. async getHSL(e) {
  210. let vm = this;
  211. let url = uni.$api.deviceParam.detail;
  212. let data = {
  213. id: "269",
  214. };
  215. let res = await uni.$http.get(url, data);
  216. this.formData.HSL = res.data.data.deviceParam.value;
  217. console.log(this.formData.HSL);
  218. },
  219. async getWD_2(e) {
  220. let vm = this;
  221. let url = uni.$api.deviceParam.detail;
  222. let data = {
  223. id: "308",
  224. };
  225. let res = await uni.$http.get(url, data);
  226. this.formData.WD_2 = res.data.data.deviceParam.value;
  227. console.log(this.formData.WD_2);
  228. },
  229. async getSD_2(e) {
  230. let vm = this;
  231. let url = uni.$api.deviceParam.detail;
  232. let data = {
  233. id: "309",
  234. };
  235. let res = await uni.$http.get(url, data);
  236. this.formData.SD_2 = res.data.data.deviceParam.value;
  237. console.log(this.formData.SD_2);
  238. },
  239. async getYSTZ(e) {
  240. let vm = this;
  241. let url = uni.$api.deviceParam.detail;
  242. let data = {
  243. id: "219",
  244. };
  245. let res = await uni.$http.get(url, data);
  246. this.formData.JZ_YSTZ = res.data.data.deviceParam.value;
  247. console.log(this.formData.JZ_YSTZ);
  248. },
  249. async getWD_SD(e) {
  250. let vm = this;
  251. let url = uni.$api.deviceParam.detail;
  252. let data = {
  253. id: "296",
  254. };
  255. let res = await uni.$http.get(url, data);
  256. this.formData.WD_SD = res.data.data.deviceParam.value;
  257. console.log(this.formData.WD_SD);
  258. },
  259. async getSD_SD(e) {
  260. let vm = this;
  261. let url = uni.$api.deviceParam.detail;
  262. let data = {
  263. id: "231",
  264. };
  265. let res = await uni.$http.get(url, data);
  266. this.formData.SD_SD = res.data.data.deviceParam.value;
  267. console.log(this.formData.SD_SD);
  268. },
  269. async getHSL_SD(e) {
  270. let vm = this;
  271. let url = uni.$api.deviceParam.detail;
  272. let data = {
  273. id: "227",
  274. };
  275. let res = await uni.$http.get(url, data);
  276. this.formData.HSL_SD = res.data.data.deviceParam.value;
  277. console.log(this.formData.HSL_SD);
  278. },
  279. async getRSF(e) {
  280. let vm = this;
  281. let url = uni.$api.deviceParam.detail;
  282. let data = {
  283. id: "216",
  284. };
  285. let res = await uni.$http.get(url, data);
  286. this.formData.RSF = res.data.data.deviceParam.value;
  287. console.log(this.formData.RSF);
  288. },
  289. async getLSF(e) {
  290. let vm = this;
  291. let url = uni.$api.deviceParam.detail;
  292. let data = {
  293. id: "268",
  294. };
  295. let res = await uni.$http.get(url, data);
  296. this.formData.LSF = res.data.data.deviceParam.value;
  297. console.log(this.formData.LSF);
  298. },
  299. async getJSF(e) {
  300. let vm = this;
  301. let url = uni.$api.deviceParam.detail;
  302. let data = {
  303. id: "212",
  304. };
  305. let res = await uni.$http.get(url, data);
  306. this.formData.JSF = res.data.data.deviceParam.value;
  307. console.log(this.formData.JSF);
  308. },
  309. async getGWBJ(e) {
  310. let vm = this;
  311. let url = uni.$api.deviceParam.detail;
  312. let data = {
  313. id: "294",
  314. };
  315. let res = await uni.$http.get(url, data);
  316. this.formData.GW_BJ = res.data.data.deviceParam.value;
  317. },
  318. async getQFYC(e) {
  319. let vm = this;
  320. let url = uni.$api.deviceParam.detail;
  321. let data = {
  322. id: "306",
  323. };
  324. let res = await uni.$http.get(url, data);
  325. this.formData.QFYC_BJ = res.data.data.deviceParam.value;
  326. },
  327. async getCXLW(e) {
  328. let vm = this;
  329. let url = uni.$api.deviceParam.detail;
  330. let data = {
  331. id: "283",
  332. };
  333. let res = await uni.$http.get(url, data);
  334. this.formData.LWDS_CX = res.data.data.deviceParam.value;
  335. },
  336. async getZXLW(e) {
  337. let vm = this;
  338. let url = uni.$api.deviceParam.detail;
  339. let data = {
  340. id: "303",
  341. };
  342. let res = await uni.$http.get(url, data);
  343. this.formData.LWDS_ZX = res.data.data.deviceParam.value;
  344. },
  345. async getYJDJR(e) {
  346. let vm = this;
  347. let url = uni.$api.deviceParam.detail;
  348. let data = {
  349. id: "215",
  350. };
  351. let res = await uni.$http.get(url, data);
  352. this.formData.YJDJR_QT = res.data.data.deviceParam.value;
  353. },
  354. async getEJDJR(e) {
  355. let vm = this;
  356. let url = uni.$api.deviceParam.detail;
  357. let data = {
  358. id: "211",
  359. };
  360. let res = await uni.$http.get(url, data);
  361. this.formData.EJDJR_QT = res.data.data.deviceParam.value;
  362. },
  363. async getSJDJR(e) {
  364. let vm = this;
  365. let url = uni.$api.deviceParam.detail;
  366. let data = {
  367. id: "213",
  368. };
  369. let res = await uni.$http.get(url, data);
  370. this.formData.SJDJR_QT = res.data.data.deviceParam.value;
  371. },
  372. async getJZ_KGJ(e) {
  373. let vm = this;
  374. let url = uni.$api.deviceParam.detail;
  375. let data = {
  376. id: "267",
  377. };
  378. let res = await uni.$http.get(url, data);
  379. this.formData.JZ_KGJ = res.data.data.deviceParam.value;
  380. },
  381. async stopAndStart(e) {
  382. this.formData.JZ_KGJ == 1 ? this.formData.JZ_KGJ = 0 : this.formData.JZ_KGJ = 1;
  383. let vm = this;
  384. let url = uni.$api.deviceParam.updateParam;
  385. let data = {
  386. id: "267",
  387. value: this.formData.JZ_KGJ,
  388. name: "JZ_KGJ",
  389. sn: "CK1"
  390. };
  391. let res = await uni.$http.get(url, data);
  392. console.log(res.data.data.value);
  393. }
  394. }
  395. }
  396. </script>
  397. <style>
  398. .anniu {
  399. width: 116rpx;
  400. height: 116rpx;
  401. float: right;
  402. margin-right: 10rpx;
  403. }
  404. .button {
  405. background-color: #E12A1F;
  406. color: white;
  407. width: 654rpx;
  408. margin-left: 48rpx;
  409. margin-top: 44rpx;
  410. }
  411. .name1 {
  412. color: #848586;
  413. font-size: 24rpx;
  414. }
  415. .name {
  416. color: #848586;
  417. font-size: 30rpx;
  418. }
  419. .value {
  420. font-size: 38rpx;
  421. color: #444546;
  422. }
  423. .paramItem {
  424. display: flex;
  425. flex-direction: column;
  426. margin-left: 58rpx;
  427. margin-right: 46rpx;
  428. }
  429. .paramItem1 {
  430. display: flex;
  431. flex-direction: column;
  432. margin-left: 40rpx;
  433. margin-right: 40rpx;
  434. }
  435. .param {
  436. display: flex;
  437. flex-direction: row;
  438. margin-left: 24rpx;
  439. align-items: center;
  440. justify-content: center;
  441. width: 702rpx;
  442. height: 140rpx;
  443. background-color: white;
  444. border-bottom-right-radius: 8rpx;
  445. border-bottom-left-radius: 8rpx;
  446. }
  447. .tiaoText {
  448. margin-left: 44rpx;
  449. font-size: 34rpx;
  450. font-weight: 550;
  451. }
  452. .stopTiaoText {
  453. margin-left: 44rpx;
  454. font-size: 36rpx;
  455. font-weight: 550;
  456. }
  457. .tiao {
  458. margin-top: 26rpx;
  459. border-top-left-radius: 8rpx;
  460. border-top-right-radius: 8rpx;
  461. margin-left: 24rpx;
  462. width: 702rpx;
  463. height: 60px;
  464. background: #EAF1FE;
  465. font-size: 30rpx;
  466. color: #007AFF;
  467. display: flex;
  468. align-items: center;
  469. }
  470. .stopTiao {
  471. margin-top: 26rpx;
  472. border-top-left-radius: 8rpx;
  473. border-top-right-radius: 8rpx;
  474. margin-left: 24rpx;
  475. width: 702rpx;
  476. height: 60px;
  477. background: #007AFF;
  478. font-size: 38rpx;
  479. color: white;
  480. display: flex;
  481. align-items: center;
  482. }
  483. .xia {
  484. display: flex;
  485. flex-direction: row;
  486. }
  487. .xiaItem {
  488. color: white;
  489. display: flex;
  490. flex-direction: column;
  491. margin-left: 20rpx;
  492. margin-right: 20rpx;
  493. align-items: center;
  494. justify-content: center;
  495. margin-bottom: 16rpx;
  496. }
  497. .shang {
  498. display: flex;
  499. flex-direction: row;
  500. }
  501. .shangItem {
  502. color: white;
  503. display: flex;
  504. flex-direction: column;
  505. margin-left: 30rpx;
  506. margin-right: 30rpx;
  507. align-items: center;
  508. justify-content: center;
  509. margin-bottom: 16rpx;
  510. }
  511. .buttonItem {
  512. display: flex;
  513. flex-direction: row;
  514. font-size: 20rpx;
  515. color: #444546;
  516. }
  517. .but {
  518. width: 50rpx;
  519. height: 50rpx;
  520. display: flex;
  521. align-items: center;
  522. justify-content: center;
  523. margin-left: 10rpx;
  524. margin-top: 5rpx;
  525. font-size: 24rpx;
  526. }
  527. .active-but {
  528. background-color: #00ff99;
  529. }
  530. .xiaBut {
  531. display: flex;
  532. flex-direction: row;
  533. font-size: 20rpx;
  534. color: #444546;
  535. }
  536. .KGJ_button{
  537. background-color: #00ff99;
  538. }
  539. .xiaButton {
  540. width: 100rpx;
  541. height: 50rpx;
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. margin-left: 10rpx;
  546. margin-top: 5rpx;
  547. font-size: 24rpx;
  548. }
  549. .head {
  550. font-size: 26rpx;
  551. height: 300px;
  552. background: linear-gradient(180deg, #2A8FFB 0%, #0467FB 100%);
  553. display: flex;
  554. flex-direction: column;
  555. align-items: center;
  556. justify-content: center;
  557. }
  558. .comp {
  559. background-color: #D6D6D6;
  560. width: 702rpx;
  561. height: 200rpx;
  562. border-radius: 8rpx;
  563. margin-bottom: 20rpx;
  564. }
  565. </style>