autodoor.vue 37 KB

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