autodoor.vue 38 KB

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