autodoor.vue 37 KB

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