autodoor.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. <template>
  2. <view style="overflow: auto; height: 100%">
  3. <!-- 建议放在外层 -->
  4. <u-navbar
  5. :title="name"
  6. @leftClick="backPage"
  7. :bgImage="backPic"
  8. :bgStatusImage="backPic0"
  9. >
  10. <view class="u-nav-slot" slot="left">
  11. <u-icon name="arrow-left" size="20"> </u-icon>
  12. </view>
  13. </u-navbar>
  14. <view class="main">
  15. <view class="u-page container">
  16. <div class="button-grid flcard" v-if="this.TabCur == 'gate'">
  17. <u-button
  18. type="primary"
  19. text="打开前门"
  20. @click="showPasswordDialog('frontGateOpen_S')"
  21. ></u-button>
  22. <u-button
  23. type="primary"
  24. text="关闭前门"
  25. @click="showPasswordDialog('frontGateClose_S')"
  26. ></u-button>
  27. <u-button
  28. type="primary"
  29. text="打开后门"
  30. @click="showPasswordDialog('rearGateOpen_S')"
  31. ></u-button>
  32. <u-button
  33. type="primary"
  34. text="关闭后门"
  35. @click="showPasswordDialog('rearGateClose_S')"
  36. ></u-button>
  37. <u-button
  38. type="primary"
  39. text="打开前后门"
  40. @click="showPasswordDialog('sameTimeOpen')"
  41. ></u-button>
  42. <u-button
  43. type="primary"
  44. text="关闭前后门"
  45. @click="showPasswordDialog('sameTimeClose')"
  46. ></u-button>
  47. </div>
  48. <div
  49. class="button-grid flcard"
  50. v-if="this.TabCur == 'window' && this.nwindownum == 1"
  51. >
  52. <u-button
  53. type="primary"
  54. text="设定面积"
  55. @click="showPasswordDialog('frontSetValue')"
  56. ></u-button>
  57. </div>
  58. <div
  59. class="button-grid flcard"
  60. v-if="this.TabCur == 'window' && this.nwindownum == 2"
  61. >
  62. <u-button
  63. type="primary"
  64. text="设定前窗面积"
  65. @click="showPasswordDialog('frontSetValue')"
  66. ></u-button>
  67. <u-button
  68. type="primary"
  69. text="设定后窗面积"
  70. @click="showPasswordDialog('rearSetValue')"
  71. ></u-button>
  72. </div>
  73. <div class="flcard" v-if="this.TabCur == 'gate'">
  74. <doorAnimate
  75. :gatestate1="frontGateStatus"
  76. :gatestate2="midGateStatus"
  77. :gatestate3="rearGateStatus"
  78. :cameralist="cameralist"
  79. :height="height"
  80. :doorcount="ndoorcount"
  81. ></doorAnimate>
  82. </div>
  83. <div class="flcard" v-if="this.TabCur == 'windrect'">
  84. <windrectAnimate
  85. :state="state"
  86. :title="title"
  87. :videoURL="viedeoUrl"
  88. :height="height"
  89. :type="deviceType"
  90. ></windrectAnimate>
  91. </div>
  92. <div class="flcard" v-if="this.TabCur == 'fanlocal'">
  93. <fanlocalAnimate
  94. :fan1State="fan1State"
  95. :fan2State="fan2State"
  96. :title="title"
  97. :videoURL="viedeoUrl"
  98. :height="height"
  99. ></fanlocalAnimate>
  100. </div>
  101. <div class="flcard" v-if="this.TabCur == 'fanmain'">
  102. <fanmainAnimate
  103. ref="fanpage"
  104. style="width: 100%"
  105. :door1="door1"
  106. :topdoor1="topdoor1"
  107. :fundoor1="fundoor1"
  108. :door2="door2"
  109. :topdoor2="topdoor2"
  110. :fundoor2="fundoor2"
  111. :nowfengji="qidongfengji"
  112. ></fanmainAnimate>
  113. </div>
  114. <div
  115. class="flcard"
  116. v-if="this.TabCur == 'window' && this.nwindownum == 1"
  117. >
  118. <windowAnimate
  119. :windowAngle="windowAngle"
  120. :height="height"
  121. :windowcount="nwindownum"
  122. ></windowAnimate>
  123. </div>
  124. <div
  125. class="flcard"
  126. v-if="this.TabCur == 'window' && this.nwindownum == 2"
  127. >
  128. <windowAnimate
  129. :windowAngle="windowAngle"
  130. :windowAngle1="windowAngle1"
  131. :height="height"
  132. :windowcount="nwindownum"
  133. ></windowAnimate>
  134. </div>
  135. <div class="flcard">
  136. <div
  137. class="flex-container"
  138. v-if="TabCur != 'fanlocal' && TabCur != 'fanmain'"
  139. >
  140. <div
  141. class="itemback"
  142. v-for="(item, index) in showColum[TabCur + '_detail']"
  143. :key="index"
  144. v-show="item.appShow == 1"
  145. >
  146. <div
  147. class="datacardtime"
  148. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  149. >
  150. <view
  151. class="demo-layout bg-purple-light"
  152. style="padding: 20rpx; color: #3787fe"
  153. >
  154. {{ readTime }}
  155. </view>
  156. </div>
  157. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  158. <div class="left-content">
  159. <view
  160. v-if="item.monitorcode == 'ndoortype' && item.datatype == 1"
  161. class="demo-layout bg-purple-light"
  162. style="margin-top: 60rpx; color: #3787fe"
  163. >
  164. {{
  165. tableData[item.monitorcode] == "1"
  166. ? "行人"
  167. : tableData[item.monitorcode] == "2"
  168. ? "行车"
  169. : "--"
  170. }}
  171. </view>
  172. <view
  173. v-else-if="
  174. item.monitorcode == 'netStatus' && item.datatype == 1
  175. "
  176. class="demo-layout bg-purple-light"
  177. style="margin-top: 60rpx; color: #3787fe"
  178. >
  179. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  180. </view>
  181. <view
  182. v-else-if="
  183. item.monitorcode == 'warnFlag' && item.datatype == 1
  184. "
  185. class="demo-layout bg-purple-light"
  186. style="margin-top: 60rpx; color: #3787fe"
  187. >
  188. {{ warnFlag == "1" ? "正常" : "异常" }}
  189. </view>
  190. <view
  191. v-else-if="item.datatype == 1"
  192. class="demo-layout bg-purple-light"
  193. style="margin-top: 60rpx; color: #3787fe"
  194. >
  195. {{
  196. tableData[item.monitorcode] == null ||
  197. tableData[item.monitorcode] == ""
  198. ? "--"
  199. : tableData[item.monitorcode]
  200. }}
  201. </view>
  202. <view
  203. v-else-if="item.datatype == 2"
  204. class="demo-layout bg-purple-light"
  205. style="margin-top: 60rpx; color: #3787fe"
  206. >
  207. {{
  208. tableData.readData[item.monitorcode] == null ||
  209. tableData.readData[item.monitorcode] == ""
  210. ? "--"
  211. : tableData.readData[item.monitorcode]
  212. }}
  213. </view>
  214. <div class="spacer"></div>
  215. <!-- 间距 -->
  216. <view
  217. class="demo-layout bg-purple-light"
  218. style="color: #677799"
  219. >
  220. {{ item.des }}
  221. </view>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="flex-container" v-else-if="TabCur == 'fanmain'">
  227. <div>主机</div>
  228. <div
  229. class="itemback"
  230. v-for="(item, index) in showColum[TabCur + '_monitor_left']"
  231. :key="index"
  232. v-show="item.appShow == 1"
  233. >
  234. <div
  235. class="datacardtime"
  236. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  237. >
  238. <view
  239. class="demo-layout bg-purple-light"
  240. style="padding: 20rpx; color: #3787fe"
  241. >
  242. {{ readTime }}
  243. </view>
  244. </div>
  245. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  246. <div class="left-content">
  247. <view
  248. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  249. class="demo-layout bg-purple-light"
  250. style="margin-top: 60rpx; color: #3787fe"
  251. >
  252. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  253. </view>
  254. <view
  255. v-else-if="item.datatype == 1"
  256. class="demo-layout bg-purple-light"
  257. style="margin-top: 60rpx; color: #3787fe"
  258. >
  259. {{
  260. tableData[
  261. item.monitorcode.startsWith("Fan")
  262. ? item.monitorcode.replace(/^Fan/, "Fan1")
  263. : item.monitorcode
  264. ] !== undefined &&
  265. tableData[
  266. item.monitorcode.startsWith("Fan")
  267. ? item.monitorcode.replace(/^Fan/, "Fan1")
  268. : item.monitorcode
  269. ] !== null
  270. ? tableData[
  271. item.monitorcode.startsWith("Fan")
  272. ? item.monitorcode.replace(/^Fan/, "Fan1")
  273. : item.monitorcode
  274. ]
  275. : "-"
  276. }}
  277. </view>
  278. <view
  279. v-else-if="item.datatype == 2"
  280. class="demo-layout bg-purple-light"
  281. style="margin-top: 60rpx; color: #3787fe"
  282. >
  283. {{
  284. tableData.readData[
  285. item.monitorcode.startsWith("Fan")
  286. ? item.monitorcode.replace(/^Fan/, "Fan1")
  287. : item.monitorcode
  288. ] !== undefined &&
  289. tableData.readData[
  290. item.monitorcode.startsWith("Fan")
  291. ? item.monitorcode.replace(/^Fan/, "Fan1")
  292. : item.monitorcode
  293. ] !== null
  294. ? tableData.readData[
  295. item.monitorcode.startsWith("Fan")
  296. ? item.monitorcode.replace(/^Fan/, "Fan1")
  297. : item.monitorcode
  298. ]
  299. : "-"
  300. }}
  301. </view>
  302. <div class="spacer"></div>
  303. <!-- 间距 -->
  304. <view
  305. class="demo-layout bg-purple-light"
  306. style="color: #677799"
  307. >
  308. {{ item.des }}
  309. </view>
  310. </div>
  311. </div>
  312. </div>
  313. <div>备机</div>
  314. <div
  315. class="itemback"
  316. v-for="(item, index) in showColum[TabCur + '_monitor_left']"
  317. :key="index"
  318. v-show="item.appShow == 1"
  319. >
  320. <div
  321. class="datacardtime"
  322. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  323. >
  324. <view
  325. class="demo-layout bg-purple-light"
  326. style="padding: 20rpx; color: #3787fe"
  327. >
  328. {{ readTime }}
  329. </view>
  330. </div>
  331. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  332. <div class="left-content">
  333. <view
  334. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  335. class="demo-layout bg-purple-light"
  336. style="margin-top: 60rpx; color: #3787fe"
  337. >
  338. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  339. </view>
  340. <view
  341. v-else-if="item.datatype == 1"
  342. class="demo-layout bg-purple-light"
  343. style="margin-top: 60rpx; color: #3787fe"
  344. >
  345. {{
  346. tableData[
  347. item.monitorcode.startsWith("Fan")
  348. ? item.monitorcode.replace(/^Fan/, "Fan2")
  349. : item.monitorcode
  350. ] !== undefined &&
  351. tableData[
  352. item.monitorcode.startsWith("Fan")
  353. ? item.monitorcode.replace(/^Fan/, "Fan2")
  354. : item.monitorcode
  355. ] !== null
  356. ? tableData[
  357. item.monitorcode.startsWith("Fan")
  358. ? item.monitorcode.replace(/^Fan/, "Fan2")
  359. : item.monitorcode
  360. ]
  361. : "-"
  362. }}
  363. </view>
  364. <view
  365. v-else-if="item.datatype == 2"
  366. class="demo-layout bg-purple-light"
  367. style="margin-top: 60rpx; color: #3787fe"
  368. >
  369. {{
  370. tableData.readData[
  371. item.monitorcode.startsWith("Fan")
  372. ? item.monitorcode.replace(/^Fan/, "Fan2")
  373. : item.monitorcode
  374. ] !== undefined &&
  375. tableData.readData[
  376. item.monitorcode.startsWith("Fan")
  377. ? item.monitorcode.replace(/^Fan/, "Fan2")
  378. : item.monitorcode
  379. ] !== null
  380. ? tableData.readData[
  381. item.monitorcode.startsWith("Fan")
  382. ? item.monitorcode.replace(/^Fan/, "Fan2")
  383. : item.monitorcode
  384. ]
  385. : "-"
  386. }}
  387. </view>
  388. <div class="spacer"></div>
  389. <!-- 间距 -->
  390. <view
  391. class="demo-layout bg-purple-light"
  392. style="color: #677799"
  393. >
  394. {{ item.des }}
  395. </view>
  396. </div>
  397. </div>
  398. </div>
  399. </div>
  400. <div class="flex-container" v-else-if="TabCur == 'fanlocal'">
  401. <div>主机</div>
  402. <div
  403. class="itemback"
  404. v-for="(item, index) in showColum[TabCur + '_monitor_right']"
  405. :key="index"
  406. v-show="item.appShow == 1"
  407. >
  408. <div
  409. class="datacardtime"
  410. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  411. >
  412. <view
  413. class="demo-layout bg-purple-light"
  414. style="padding: 20rpx; color: #3787fe"
  415. >
  416. {{ readTime }}
  417. </view>
  418. </div>
  419. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  420. <div class="left-content">
  421. <view
  422. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  423. class="demo-layout bg-purple-light"
  424. style="margin-top: 60rpx; color: #3787fe"
  425. >
  426. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  427. </view>
  428. <view
  429. v-else-if="item.datatype == 1"
  430. class="demo-layout bg-purple-light"
  431. style="margin-top: 60rpx; color: #3787fe"
  432. >
  433. {{
  434. tableData[
  435. item.monitorcode.startsWith("Fan")
  436. ? item.monitorcode.replace(/^Fan/, "Fan1")
  437. : item.monitorcode
  438. ] !== undefined &&
  439. tableData[
  440. item.monitorcode.startsWith("Fan")
  441. ? item.monitorcode.replace(/^Fan/, "Fan1")
  442. : item.monitorcode
  443. ] !== null
  444. ? tableData[
  445. item.monitorcode.startsWith("Fan")
  446. ? item.monitorcode.replace(/^Fan/, "Fan1")
  447. : item.monitorcode
  448. ]
  449. : "-"
  450. }}
  451. </view>
  452. <view
  453. v-else-if="item.datatype == 2"
  454. class="demo-layout bg-purple-light"
  455. style="margin-top: 60rpx; color: #3787fe"
  456. >
  457. {{
  458. tableData.readData[
  459. item.monitorcode.startsWith("Fan")
  460. ? item.monitorcode.replace(/^Fan/, "Fan1")
  461. : item.monitorcode
  462. ] !== undefined &&
  463. tableData.readData[
  464. item.monitorcode.startsWith("Fan")
  465. ? item.monitorcode.replace(/^Fan/, "Fan1")
  466. : item.monitorcode
  467. ] !== null
  468. ? tableData.readData[
  469. item.monitorcode.startsWith("Fan")
  470. ? item.monitorcode.replace(/^Fan/, "Fan1")
  471. : item.monitorcode
  472. ]
  473. : "-"
  474. }}
  475. </view>
  476. <div class="spacer"></div>
  477. <!-- 间距 -->
  478. <view
  479. class="demo-layout bg-purple-light"
  480. style="color: #677799"
  481. >
  482. {{ item.des }}
  483. </view>
  484. </div>
  485. </div>
  486. </div>
  487. <div>备机</div>
  488. <div
  489. class="itemback"
  490. v-for="(item, index) in showColum[TabCur + '_monitor_right']"
  491. :key="index"
  492. v-show="item.appShow == 1"
  493. >
  494. <div
  495. class="datacardtime"
  496. v-if="item.monitorcode == 'readTime' && item.datatype == 1"
  497. >
  498. <view
  499. class="demo-layout bg-purple-light"
  500. style="padding: 20rpx; color: #3787fe"
  501. >
  502. {{ readTime }}
  503. </view>
  504. </div>
  505. <div class="datacard" v-if="item.monitorcode !== 'readTime'">
  506. <div class="left-content">
  507. <view
  508. v-if="item.monitorcode == 'netStatus' && item.datatype == 1"
  509. class="demo-layout bg-purple-light"
  510. style="margin-top: 60rpx; color: #3787fe"
  511. >
  512. {{ doorNetStatus == "1" ? "正常" : "异常" }}
  513. </view>
  514. <view
  515. v-else-if="item.datatype == 1"
  516. class="demo-layout bg-purple-light"
  517. style="margin-top: 60rpx; color: #3787fe"
  518. >
  519. {{
  520. tableData[
  521. item.monitorcode.startsWith("Fan")
  522. ? item.monitorcode.replace(/^Fan/, "Fan2")
  523. : item.monitorcode
  524. ] !== undefined &&
  525. tableData[
  526. item.monitorcode.startsWith("Fan")
  527. ? item.monitorcode.replace(/^Fan/, "Fan2")
  528. : item.monitorcode
  529. ] !== null
  530. ? tableData[
  531. item.monitorcode.startsWith("Fan")
  532. ? item.monitorcode.replace(/^Fan/, "Fan2")
  533. : item.monitorcode
  534. ]
  535. : "-"
  536. }}
  537. </view>
  538. <view
  539. v-else-if="item.datatype == 2"
  540. class="demo-layout bg-purple-light"
  541. style="margin-top: 60rpx; color: #3787fe"
  542. >
  543. {{
  544. tableData.readData[
  545. item.monitorcode.startsWith("Fan")
  546. ? item.monitorcode.replace(/^Fan/, "Fan2")
  547. : item.monitorcode
  548. ] !== undefined &&
  549. tableData.readData[
  550. item.monitorcode.startsWith("Fan")
  551. ? item.monitorcode.replace(/^Fan/, "Fan2")
  552. : item.monitorcode
  553. ] !== null
  554. ? tableData.readData[
  555. item.monitorcode.startsWith("Fan")
  556. ? item.monitorcode.replace(/^Fan/, "Fan2")
  557. : item.monitorcode
  558. ]
  559. : "-"
  560. }}
  561. </view>
  562. <div class="spacer"></div>
  563. <!-- 间距 -->
  564. <view
  565. class="demo-layout bg-purple-light"
  566. style="color: #677799"
  567. >
  568. {{ item.des }}
  569. </view>
  570. </div>
  571. </div>
  572. </div>
  573. </div>
  574. </div>
  575. </view>
  576. </view>
  577. <u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false">
  578. <div class="containers">
  579. <view class="passWordName">
  580. <view
  581. class="title"
  582. style="margin-top: 15px"
  583. v-if="this.TabCur == 'window'"
  584. >风窗面积</view
  585. >
  586. <u-input
  587. class="passArea"
  588. style="margin-top: 15px; border-color: #2a94ff"
  589. v-model="windowArea"
  590. type="text"
  591. v-if="this.TabCur == 'window'"
  592. ></u-input>
  593. </view>
  594. <view class="passWordInput">
  595. <view style="margin-top: 15px" class="title">输入密码</view>
  596. <u-input
  597. style="margin-top: 15px; border-color: #2a94ff"
  598. v-model="password"
  599. type="password"
  600. ></u-input
  601. ></view>
  602. </div>
  603. <view class="btns">
  604. <u-button
  605. style="margin: 20px"
  606. type="primary"
  607. @click="confirmPassword()"
  608. color="linear-gradient(to right, rgb(53, 138, 254), rgb(38, 171, 244))"
  609. >确认</u-button
  610. >
  611. <u-button
  612. style="margin: 20px"
  613. type="primary"
  614. :plain="true"
  615. @click="cancelPassword()"
  616. >取消</u-button
  617. >
  618. </view>
  619. </u-popup>
  620. </view>
  621. </template>
  622. <script>
  623. import api from "@/api/api";
  624. import initDictOptions from "@/common/util/dictUtil.js";
  625. import doorAnimate from "../doorAnimate/doorAnimate.vue";
  626. import windowAnimate from "../windowAnimate/windowAnimate.vue";
  627. import windrectAnimate from "../windrectAnimate/windrectAnimate.vue";
  628. import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
  629. import fanmainAnimate from "../fanmainAnimate/fanmainAnimate.vue";
  630. export default {
  631. data() {
  632. return {
  633. tableData: {}, //监测数据
  634. typeList: [], //展示字段
  635. itemId: "", // 初始化 itemId
  636. name: "", // 初始化 name
  637. deviceid: "", //初始化设备id
  638. TabCur: "",
  639. checked: [],
  640. backPic0: "url(/static/topnavbar0.png)",
  641. backPic: "url(/static/topnavbar.png)",
  642. frontAngle: "", //风窗打开角度
  643. nwindownum: "", //风窗道数
  644. ndoorcount: "", //风门道数
  645. deviceType: "", //设备类型
  646. show: false, //密码弹窗是否显示
  647. password: "", //控制设备密码
  648. paramcode: "", //控制字段
  649. height: "200px",
  650. popupStyle: {
  651. // 弹窗样式
  652. "background-color": "#fff",
  653. padding: "20px",
  654. "box-shadow": "0 2px 4px rgba(0, 0, 0, 0.1)",
  655. },
  656. frontGateStatus: "", //前门状态
  657. rearGateStatus: "", //后门状态
  658. midGateStatus: "", //状态
  659. doorNetStatus: "", //风门通信状态
  660. warnFlag: "", //风门报警
  661. readTime: "", //时间
  662. windowAngle: 0, //前窗打开角度
  663. windowAngle1: 0, //后窗打开角度
  664. windowArea: "", //风窗面积设定值
  665. viedeoUrl: "", //监控url
  666. sign: "",
  667. title: "测风设备",
  668. fan1State: "",
  669. fan2State: "",
  670. deviceid: "", //ID
  671. cameralist: [], //摄像数据
  672. showColum: {},
  673. };
  674. },
  675. onLoad(query) {
  676. //保存id到 data 中 可以在整个页面中使用
  677. this.itemId = query.id;
  678. this.name = query.name;
  679. this.TabCur = query.type;
  680. this.ndoorcount = 2;
  681. },
  682. components: {
  683. doorAnimate,
  684. windowAnimate,
  685. windrectAnimate,
  686. fanlocalAnimate,
  687. fanmainAnimate,
  688. },
  689. created() {
  690. this.getShowColum();
  691. this.getDeviceInfo(this.itemId);
  692. this.getVideoUrlById(this.itemId);
  693. },
  694. mounted() {
  695. this.startTimer();
  696. },
  697. methods: {
  698. startTimer() {
  699. this.timer = setInterval(() => {
  700. // 执行定时任务
  701. this.getDeviceInfo(this.itemId);
  702. }, 5000);
  703. },
  704. stopTimer() {
  705. // 停止定时器
  706. clearInterval(this.timer);
  707. },
  708. // 返回上一个页面
  709. backPage() {
  710. this.$destroy();
  711. uni.navigateBack({
  712. delta: 1,
  713. });
  714. },
  715. getShowColum() {
  716. new Promise((resolve, reject) => {
  717. api
  718. .getShowColum({})
  719. .then((response) => {
  720. if (response.data.code == 200) {
  721. var showlist = response.data.result;
  722. this.$store.commit("SET_SHOWCOLUM", showlist);
  723. this.showColum = showlist;
  724. } else {
  725. resolve(response);
  726. }
  727. })
  728. .catch((error) => {
  729. console.log("catch===>response", response);
  730. reject(error);
  731. });
  732. });
  733. },
  734. // //获取app展示字段数据
  735. // getShowList(type) {
  736. // const params = {
  737. // devicekind: type,
  738. // pagetype: "detail",
  739. // pageNo: 1,
  740. // pageSize: 100,
  741. // };
  742. // new Promise((resolve, reject) => {
  743. // api
  744. // .getShowColumList(params)
  745. // .then((response) => {
  746. // if (response.data.code == 200) {
  747. // this.typeList = response.data.result.records;
  748. // } else {
  749. // resolve(response);
  750. // }
  751. // })
  752. // .catch((error) => {
  753. // reject(error);
  754. // });
  755. // });
  756. // },
  757. //获取详情数据
  758. getDeviceInfo(ID) {
  759. let IDString = String(ID); // 将 ID 转换为字符串
  760. new Promise((resolve, reject) => {
  761. api
  762. .getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
  763. .then((response) => {
  764. if (
  765. response.data.code == 200 &&
  766. response.data.result.msgTxt[0].datalist.length > 0
  767. ) {
  768. var result = response.data.result.msgTxt[0].datalist[0];
  769. this.tableData = result;
  770. if (this.tableData.frontGateOpen == "1") {
  771. this.tableData.frontGateOpen = "打开";
  772. } else {
  773. this.tableData.frontGateOpen = "关闭";
  774. }
  775. if (this.tableData.midGateOpen == "1") {
  776. this.tableData.midGateOpen = "打开";
  777. } else {
  778. this.tableData.midGateOpen = "关闭";
  779. }
  780. if (this.tableData.rearGateOpen == "1") {
  781. this.tableData.rearGateOpen = "打开";
  782. } else {
  783. this.tableData.rearGateOpen = "关闭";
  784. }
  785. this.fan1State = result.readData.Fan1StartStatus;
  786. this.fan2State = result.readData.Fan2StartStatus;
  787. this.nwindownum = result.nwindownum;
  788. this.ndoorcount = result.ndoorcount;
  789. this.deviceType = result.deviceType;
  790. this.state = result.readData.sign;
  791. this.frontGateStatus = this.tableData.frontGateOpen;
  792. this.midGateStatus = this.tableData.midGateOpen;
  793. this.rearGateStatus = this.tableData.rearGateOpen;
  794. this.doorNetStatus = result.netStatus;
  795. this.warnFlag = result.warnLevel_str;
  796. this.readTime = result.readTime;
  797. this.qidongfengji = result.readData.Fan1StartStatus
  798. ? result.readData.Fan1StartStatus
  799. : result.readData.Fan2StartStatus;
  800. var maxarea = result.maxarea;
  801. this.windowAngle =
  802. (this.tableData.forntArea / maxarea) * 100 * 0.9;
  803. this.windowAngle1 =
  804. (this.tableData.rearArea / maxarea) * 100 * 0.9;
  805. this.deviceid = result.deviceID;
  806. this.$forceUpdate();
  807. } else {
  808. resolve(response);
  809. }
  810. })
  811. .catch((error) => {
  812. reject(error);
  813. });
  814. });
  815. },
  816. //获取监控URL 通过ID获取
  817. getVideoUrlById(ID) {
  818. let IDString = String(ID); // 将 ID 转换为字符串
  819. new Promise((resolve, reject) => {
  820. api
  821. .getCameraById({ deviceid: IDString })
  822. .then((response) => {
  823. if (response.data.code == 200) {
  824. if (response.data.result.records.length > 0) {
  825. this.cameralist = response.data.result.records[0];
  826. }
  827. } else {
  828. resolve(response);
  829. }
  830. })
  831. .catch((error) => {
  832. reject(error);
  833. });
  834. });
  835. },
  836. //设备控制
  837. ctrlDevice(pass) {
  838. let IDString = String(this.itemId); // 将 ID 转换为字符串
  839. const params = {
  840. deviceid: IDString,
  841. devicetype: this.deviceType,
  842. paramcode: this.paramcode,
  843. password: pass,
  844. value: this.windowArea,
  845. };
  846. new Promise((resolve, reject) => {
  847. api
  848. .controlDevice(params)
  849. .then((response) => {
  850. if (response.data.code == 200) {
  851. this.getDeviceInfo(IDString);
  852. // console.log("操作成功");
  853. } else {
  854. resolve(response);
  855. }
  856. })
  857. .catch((error) => {
  858. reject(error);
  859. });
  860. });
  861. },
  862. // 显示密码输入弹窗
  863. showPasswordDialog(controlCode) {
  864. this.paramcode = controlCode;
  865. this.show = true;
  866. },
  867. // 取消密码输入
  868. cancelPassword() {
  869. this.show = false;
  870. },
  871. confirmPassword() {
  872. this.ctrlDevice(this.password);
  873. // 发起请求后关闭密码输入弹窗
  874. this.show = false;
  875. },
  876. },
  877. destroyed() {
  878. // 停止定时器
  879. this.stopTimer();
  880. },
  881. };
  882. </script>
  883. <style lang="scss" scoped>
  884. .top-nav {
  885. background-image: url(../../../../static/topnavbar.png);
  886. background-size: cover; /* 背景图片大小适应 */
  887. height: 100%;
  888. }
  889. .top-nav2 {
  890. background-color: #ffffff;
  891. }
  892. .main {
  893. margin-top: 80px;
  894. }
  895. .container {
  896. display: flex;
  897. flex-direction: column;
  898. }
  899. .button-grid {
  900. display: grid;
  901. grid-template-columns: repeat(4, 1fr);
  902. gap: 5px; /* 可以根据需要调整行列之间的间距 */
  903. }
  904. .fanContent {
  905. display: flex;
  906. flex-direction: column;
  907. margin-top: 10rpx;
  908. margin-bottom: 10rpx;
  909. }
  910. .top,
  911. .bottom {
  912. flex: 1; /* 各占 50% */
  913. }
  914. .flcard {
  915. padding: 20rpx;
  916. background-color: #ffffff;
  917. margin-bottom: 5rpx;
  918. }
  919. .additional-div {
  920. grid-column: span 2; /* 让附加内容跨越三列 */
  921. display: flex;
  922. align-items: center;
  923. }
  924. .checkbox-group {
  925. margin-left: 10px; /* 可以根据需要调整间距 */
  926. }
  927. .card {
  928. background-color: #ffffff;
  929. margin: auto;
  930. margin-top: 20rpx;
  931. width: 90%;
  932. height: 280rpx;
  933. border: 1rpx solid #000000;
  934. border-radius: 20rpx;
  935. }
  936. .flex-containe {
  937. display: flex;
  938. flex-direction: row;
  939. flex-wrap: wrap;
  940. }
  941. .itemback {
  942. flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
  943. margin: 5px; /* 间距设置为5px */
  944. }
  945. .datacardtime {
  946. display: flex;
  947. width: 100%;
  948. flex: 1;
  949. margin: 1%;
  950. float: left;
  951. height: 50px;
  952. line-height: 29px;
  953. text-align: center;
  954. background: linear-gradient(
  955. to right,
  956. rgba(55, 135, 254, 0.08),
  957. rgba(4, 184, 255, 0.08),
  958. rgba(60, 161, 237, 0.08)
  959. );
  960. }
  961. .datacard {
  962. display: flex;
  963. width: 48%;
  964. flex: 1;
  965. margin: 1%;
  966. float: left;
  967. height: 180rpx;
  968. text-align: center;
  969. background: linear-gradient(
  970. to right,
  971. rgba(55, 135, 254, 0.08),
  972. rgba(4, 184, 255, 0.08),
  973. rgba(60, 161, 237, 0.08)
  974. );
  975. }
  976. .left-content {
  977. width: 100%;
  978. display: flex;
  979. flex-direction: column;
  980. }
  981. .spacer {
  982. height: 10rpx;
  983. }
  984. .right-content {
  985. width: 50%; /* 右侧内容占据50%宽度 */
  986. background-image: url(../../../../static/model/Pa.png);
  987. background-size: 100% 125%;
  988. }
  989. /*风窗样式*/
  990. div.autowindow_new {
  991. width: 200px;
  992. height: 200px;
  993. background-image: url(../../../../static/window/window-bk.png);
  994. background-size: 100% 100%;
  995. perspective: 800px;
  996. }
  997. /*风窗1 2 3 4*/
  998. div.window_new_1 {
  999. margin-top: 12px;
  1000. margin-left: 15px;
  1001. width: 170px;
  1002. height: 30px;
  1003. background-color: crimson;
  1004. box-sizing: border-box;
  1005. float: left;
  1006. z-index: 1;
  1007. /* transition: all 2s; */
  1008. background-image: url(../../../../static/window/window_new1.png);
  1009. background-size: 100% 100%;
  1010. }
  1011. div.window_new_2 {
  1012. margin-top: 2px;
  1013. margin-left: 15px;
  1014. width: 170px;
  1015. height: 29px;
  1016. background-color: crimson;
  1017. box-sizing: border-box;
  1018. float: left;
  1019. z-index: 1;
  1020. /* transition: all 2s; */
  1021. background-image: url(../../../../static/window/window_new1.png);
  1022. background-size: 100% 100%;
  1023. }
  1024. div.window_new_3 {
  1025. margin-top: 2px;
  1026. margin-left: 15px;
  1027. width: 170px;
  1028. height: 29px;
  1029. background-color: crimson;
  1030. box-sizing: border-box;
  1031. float: left;
  1032. z-index: 1;
  1033. /* transition: all 2s; */
  1034. background-image: url(../../../../static/window/window_new1.png);
  1035. background-size: 100% 100%;
  1036. }
  1037. div.window_new_4 {
  1038. margin-top: 2px;
  1039. margin-left: 15px;
  1040. width: 170px;
  1041. height: 29px;
  1042. background-color: crimson;
  1043. box-sizing: border-box;
  1044. float: left;
  1045. z-index: 1;
  1046. /* transition: all 2s; */
  1047. background-image: url(../../../../static/window/window_new1.png);
  1048. background-size: 100% 100%;
  1049. }
  1050. div.window_new_5 {
  1051. margin-top: 2px;
  1052. margin-left: 15px;
  1053. width: 170px;
  1054. height: 29px;
  1055. background-color: crimson;
  1056. box-sizing: border-box;
  1057. float: left;
  1058. z-index: 1;
  1059. /* transition: all 2s; */
  1060. background-image: url(../../../../static/window/window_new1.png);
  1061. background-size: 100% 100%;
  1062. }
  1063. div.window_new_1 {
  1064. transition: all 2s ease;
  1065. transform-origin: center center;
  1066. }
  1067. div.window_new_2 {
  1068. transition: all 2s ease;
  1069. transform-origin: center center;
  1070. }
  1071. div.window_new_3 {
  1072. transition: all 2s ease;
  1073. transform-origin: center center;
  1074. }
  1075. div.window_new_4 {
  1076. transition: all 2s ease;
  1077. transform-origin: center center;
  1078. }
  1079. div.window_new_5 {
  1080. transition: all 2s ease;
  1081. transform-origin: center center;
  1082. }
  1083. .btns {
  1084. display: flex;
  1085. }
  1086. .containers {
  1087. background-color: #fff;
  1088. }
  1089. .passWordName {
  1090. margin: 20px;
  1091. display: flex;
  1092. flex-direction: row;
  1093. justify-content: space-around;
  1094. }
  1095. .title {
  1096. margin-right: 20px;
  1097. line-height: 40px;
  1098. }
  1099. .passWordInput {
  1100. margin: 20px;
  1101. display: flex;
  1102. flex-direction: row;
  1103. justify-content: space-around;
  1104. }
  1105. .passArea {
  1106. border-color: red;
  1107. }
  1108. </style>